
main:has(> #lattice),
main:has(> #cubic-lattice) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "description"
    "lattice"
    "rotation"
    "controls";
  width: 100%;
  max-width: 700px;
  margin-inline: auto;
}
main:has(> #lattice) > header,
main:has(> #cubic-lattice) > header {
  display: contents;
}
main:has(> #lattice) > #lattice,
main:has(> #cubic-lattice) > #cubic-lattice {
  grid-area: lattice;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  touch-action: none;
}
main:has(> #lattice) > header > h1,
main:has(> #cubic-lattice) > header > h1 {
  grid-area: title;
  margin: 16px 0 0;
  text-align: center;
}
main:has(> #lattice) > header > p,
main:has(> #cubic-lattice) > header > p {
  grid-area: description;
  margin: 8px auto 0;
  text-align: center;
}
main:has(> #lattice) > header > #rotation,
main:has(> #cubic-lattice) > header > #cubic-rotation {
  grid-area: rotation;
  justify-self: center;
  min-height: 44px;
  margin: 12px 0 0;
  padding: 0 18px;
  border: 1px solid #36e2cb;
  border-radius: 999px;
  background: #0b131d;
  color: #f2f4fa;
  font: 600 0.875rem/1.2 system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgb(0 0 0 / 45%);
  cursor: pointer;
}
main:has(> #lattice) > header > #rotation:hover,
main:has(> #cubic-lattice) > header > #cubic-rotation:hover {
  background: #153431;
  color: #7af5e5;
}
main:has(> #lattice) > header > #rotation:focus-visible,
main:has(> #cubic-lattice) > header > #cubic-rotation:focus-visible,
main:has(> #lattice) > #lattice:focus-visible,
main:has(> #cubic-lattice) > #cubic-lattice:focus-visible {
  outline: 2px solid #36e2cb;
  outline-offset: 4px;
}
main:has(> #lattice) > #controls,
main:has(> #cubic-lattice) > #cubic-controls {
  grid-area: controls;
  margin: 4px 0 0;
  text-align: center;
}
