/*
  Home page: night shift in the hangar.
  Loaded after shared/gh.css and portal.css, on index.html only. The page is always dark:
  floodlights, painted floor markings, a shutter that rolls up once, a departures board.
  Motion budget: transform/opacity animations only, the 3D hero pauses off-screen,
  and everything decorative stops for prefers-reduced-motion.
*/

body.hx-home {
  --hx-night: var(--gh-night);
  --hx-plate: #111b24;
  --hx-plate-hi: #182531;
  --hx-bone: var(--gh-bone);
  --hx-beam: #fff1d6;
  --hx-led: var(--gh-led);
  --hx-scene: #7cf2c8;
  --hx-ease: var(--gh-ease);
  overflow-x: clip;
}

/* ---------- Bar: transparent over the hero, glass once the page scrolls ---------- */

:root[data-gh-scheme="night"] .hx-bar {
  position: fixed;
  inset: 0 0 auto;
  border-bottom-color: transparent;
  background: linear-gradient(180deg, rgba(5, 9, 13, 0.6), rgba(5, 9, 13, 0));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color 250ms ease, border-color 250ms ease;
}

:root[data-gh-scheme="night"] .hx-bar:not(.is-scrolled)::after {
  opacity: 0;
}

:root[data-gh-scheme="night"] .hx-bar.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: rgba(9, 16, 23, 0.84);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
}

/* ---------- Buttons on the dark page ---------- */

.hx-home .btn {
  border-radius: 6px;
}

.hx-ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--hx-bone);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hx-ghost:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.hx-cta {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1.0625rem;
  box-shadow: 0 0 0 0 rgba(255, 190, 11, 0.5), 0 14px 30px -12px rgba(255, 190, 11, 0.55);
  transition: transform 160ms var(--hx-ease), box-shadow 160ms ease, background-color 140ms ease;
}

.hx-dice {
  width: 20px;
  height: 20px;
  color: #13202b;
  transition: transform 400ms var(--hx-ease);
}

.hx-cta:hover .hx-dice {
  transform: rotate(180deg);
}

.hx-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(255, 190, 11, 0.18), 0 18px 34px -12px rgba(255, 190, 11, 0.7);
}

/* ---------- Hero ---------- */

.hx-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(640px, min(100svh, 980px));
  overflow: hidden;
  background: #0b1118;
  --hx-scene: #7cf2c8;
}

.hx-hero[data-scene="mergeCannons"] { --hx-scene: #ff8a3d; }
.hx-hero[data-scene="pocketPlanet"] { --hx-scene: #6fd6c8; }
.hx-hero[data-scene="planetColony"] { --hx-scene: #ffcf5a; }
.hx-hero[data-scene="cultivation"] { --hx-scene: #8fd6ff; }
.hx-hero[data-scene="boardGames"] { --hx-scene: #e3b867; }
.hx-hero[data-scene="party"] { --hx-scene: #ff9ec7; }

.hx-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hx-stage > :not(canvas) {
  pointer-events: none;
}

/* A painted hangar floor in CSS: what the shutter opens onto before the 3D bay arrives. */
.hx-floor {
  position: absolute;
  inset: 30% 0 0;
  background:
    radial-gradient(ellipse 20% 24% at 70% 22%, #3a434d 0 40%, #2a323b 80%, rgba(255, 190, 11, 0.9) 81% 86%, transparent 87%),
    radial-gradient(ellipse 25% 31% at 70% 22%, transparent 0 94%, rgba(255, 190, 11, 0.55) 95% 98%, transparent 99%),
    radial-gradient(ellipse 33% 41% at 70% 22%, transparent 0 96%, rgba(255, 190, 11, 0.28) 97% 99%, transparent 100%),
    radial-gradient(ellipse 34% 30% at 70% 24%, rgba(255, 236, 200, 0.16), transparent 70%),
    radial-gradient(ellipse 70% 80% at 70% 22%, #313a43 0%, #1b232b 48%, #0b1015 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
}

.hx-hero.is-3d .hx-floor {
  opacity: 0;
  transition: opacity 1200ms ease;
}

.hx-hero .door-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1200ms ease;
}

.hx-hero.is-3d .door-3d {
  opacity: 1;
}

/* Two floodlight cones from the roof, swaying a little. */
.hx-beams {
  position: absolute;
  inset: -10% 0 0;
  opacity: 0.9;
  background:
    conic-gradient(from 166deg at 64% -6%, transparent 0deg, rgba(255, 241, 214, 0.1) 9deg, rgba(255, 241, 214, 0.02) 18deg, transparent 22deg),
    conic-gradient(from 178deg at 22% -8%, transparent 0deg, rgba(255, 241, 214, 0.07) 8deg, transparent 17deg);
  transform-origin: 50% 0;
  animation: hx-sway 11s ease-in-out infinite alternate;
  pointer-events: none;
}

.hx-hero.is-3d .hx-beams {
  opacity: 0.45;
}

.hx-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 16, 23, 0.94) 0%, rgba(9, 16, 23, 0.74) 28%, rgba(9, 16, 23, 0.18) 56%, rgba(9, 16, 23, 0) 72%),
    linear-gradient(0deg, rgba(9, 16, 23, 0.95) 0%, rgba(9, 16, 23, 0) 30%),
    linear-gradient(180deg, rgba(9, 16, 23, 0.7) 0%, rgba(9, 16, 23, 0) 20%);
}

/* Labels floating over each pad of the 3D turntable (positioned by hangar-hero.js). */
.hx-tags {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hx-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  padding: 5px 11px 4px;
  border: 1px solid color-mix(in srgb, var(--tag) 60%, transparent);
  border-radius: 999px;
  color: var(--hx-bone);
  background: rgba(8, 13, 18, 0.72);
  font: 600 0.8125rem/1.2 var(--gh-font-body);
  white-space: nowrap;
  text-decoration: none;
  transform-origin: 50% 100%;
  translate: -50% -100%;
  pointer-events: auto;
  will-change: transform;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.hx-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 18px;
  background: linear-gradient(var(--tag), transparent);
}

.hx-tag.is-front {
  border-color: var(--gh-signal);
  color: var(--gh-signal-ink);
  background: var(--gh-signal);
  box-shadow: 0 0 24px rgba(255, 190, 11, 0.45);
  font-weight: 700;
}

.hx-tag.is-hover {
  border-color: var(--tag);
  color: #071015;
  background: var(--tag);
  box-shadow: 0 0 24px color-mix(in srgb, var(--tag) 60%, transparent);
}

.hx-hero:not(.is-3d) .hx-tags {
  display: none;
}

/* The turntable as a ring of cards in CSS 3D (phones, reduced motion, no WebGL). */
.hx-carousel {
  position: absolute;
  z-index: 0;
  left: 70%;
  top: 46%;
  width: clamp(200px, 22vw, 300px);
  aspect-ratio: 4 / 5;
  translate: -50% -50%;
  perspective: 1100px;
  display: none;
}

.hx-hero.is-lite .hx-carousel {
  display: block;
}

.hx-carousel::after {
  content: "";
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -18%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 190, 11, 0.22), rgba(0, 0, 0, 0.4) 45%, transparent 70%);
  transform: rotateX(70deg);
  pointer-events: none;
}

.hx-ring {
  --radius: calc(clamp(200px, 22vw, 300px) * 0.95);
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--radius) * -1)) rotateY(var(--turn, 0deg));
  transition: transform 1300ms cubic-bezier(0.6, 0, 0.2, 1);
}

.hx-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #101820;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 50px -20px rgba(0, 0, 0, 0.9);
  transform: rotateY(calc(var(--i) * (360deg / var(--n, 5)))) translateZ(var(--radius));
  backface-visibility: hidden;
  filter: brightness(0.55) saturate(0.8);
  transition: filter 700ms ease;
}

.hx-card.is-front {
  filter: none;
  box-shadow: 0 0 0 2px var(--gh-signal), 0 0 40px rgba(255, 190, 11, 0.35), 0 30px 50px -20px rgba(0, 0, 0, 0.9);
}

.hx-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-card-boards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10%;
  align-content: center;
  padding: 14%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 209, 102, 0.25), transparent 60%),
    #1a2a22;
}

.hx-card-boards svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 6px;
  box-shadow: 0 10px 16px -8px rgba(0, 0, 0, 0.9);
}

.hx-card-boards svg:nth-child(odd) {
  transform: rotate(-6deg);
}

.hx-card-boards svg:nth-child(even) {
  transform: rotate(5deg) translateY(8%);
}

/* A warm hand torch that follows a mouse pointer. Moved with transform only. */
.hx-torch {
  position: absolute;
  left: 0;
  top: 0;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 206, 110, 0.11), rgba(255, 206, 110, 0.04) 35%, transparent 62%);
  opacity: 0;
  transition: opacity 400ms ease;
  will-change: transform;
  pointer-events: none;
}

.hx-hero.is-lit .hx-torch {
  opacity: 1;
}

.hx-hero-inner {
  pointer-events: none;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 40px;
  padding-top: calc(56px + clamp(56px, 12vh, 150px));
  padding-bottom: clamp(32px, 6vh, 64px);
}

.hx-copy,
.hx-lift {
  pointer-events: auto;
}

.hx-copy h2 {
  max-width: 8em;
  font-size: clamp(2.6rem, 1rem + 3.6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  color: var(--hx-bone);
  /* The glint band tiles every 260%, so the text is always fully painted. */
  background: linear-gradient(100deg, var(--hx-bone) 0 42%, #ffffff 47%, var(--hx-led) 50%, #ffffff 53%, var(--hx-bone) 58% 100%) 120% 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.55));
  animation: hx-rise 900ms var(--hx-ease) 900ms both, hx-glint 1600ms ease-out 1500ms both;
}

:root:not(:lang(en)) .hx-copy h2 {
  line-height: 1.06;
}

:root:lang(en) .hx-copy h2 {
  max-width: 10em;
  font-size: clamp(2.3rem, 0.9rem + 3vw, 3.8rem);
}

.hx-lede {
  max-width: 31em;
  margin-top: 26px;
  color: rgba(238, 241, 238, 0.82);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.22rem);
  text-wrap: pretty;
  animation: hx-rise 900ms var(--hx-ease) 1020ms both;
}

.hx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  animation: hx-rise 900ms var(--hx-ease) 1120ms both;
}


/* The game on the lift: a glass panel whose glow takes the game's colour. */
.hx-lift {
  justify-self: end;
  width: min(380px, 100%);
  animation: hx-rise 900ms var(--hx-ease) 1250ms both;
}

.hx-now {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 20px 20px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  color: var(--hx-bone);
  background: linear-gradient(160deg, rgba(24, 37, 49, 0.72), rgba(8, 14, 20, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px color-mix(in srgb, var(--hx-scene) 22%, transparent),
    0 30px 70px -26px color-mix(in srgb, var(--hx-scene) 45%, rgba(0, 0, 0, 0.8));
  text-decoration: none;
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: box-shadow 500ms ease, transform 200ms var(--hx-ease);
}

.hx-now::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--hx-scene), color-mix(in srgb, var(--hx-scene) 30%, transparent));
  transition: background 500ms ease;
}

.hx-now:hover {
  transform: translateY(-3px);
}

.hx-now-caption {
  display: block;
  font-size: var(--fs-s);
  line-height: 1.55;
  color: rgba(238, 241, 238, 0.8);
}

.hx-now strong {
  display: block;
  margin: 2px 0 6px;
  color: var(--hx-bone);
  font-family: var(--gh-font-display);
  font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
}

.hx-now .door-flag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  border-radius: 3px;
  color: #08100f;
  background: var(--hx-scene);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.3;
  transition: background-color 500ms ease;
}

.hx-now-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--gh-signal);
  font-weight: 700;
  font-size: var(--fs-s);
}

.hx-now-go::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  transition: transform 200ms var(--hx-ease);
}

.hx-now:hover .hx-now-go::before {
  transform: translateX(3px);
}

.hx-lift-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hx-lift-nav[hidden] {
  display: none;
}

.hx-lift-nav button {
  position: relative;
  overflow: hidden;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(238, 241, 238, 0.72);
  background: rgba(9, 16, 23, 0.55);
  font: 600 var(--fs-xs)/1 var(--gh-font-body);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hx-lift-nav button:hover {
  color: var(--hx-bone);
  border-color: rgba(255, 255, 255, 0.35);
}

.hx-lift-nav button[aria-pressed="true"] {
  border-color: var(--gh-signal);
  color: var(--gh-signal-ink);
  background: var(--gh-signal);
}

.hx-lift-nav button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: rgba(26, 19, 0, 0.45);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

/* Hazard sill and the departures ticker of every game on the site. */
.hx-sill {
  height: 12px;
  background: var(--gh-hazard);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.hx-ticker {
  position: relative;
  height: 48px;
  overflow: hidden;
  border-bottom: 1px solid #16222c;
  background:
    radial-gradient(circle, rgba(255, 214, 107, 0.06) 1px, transparent 1.4px) 0 0 / 4px 4px,
    #04080b;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.hx-ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: hx-ticker 80s linear infinite;
}

.hx-ticker ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-ticker li {
  display: flex;
  align-items: center;
  gap: 30px;
  padding-right: 30px;
  color: var(--hx-led);
  font-family: var(--gh-font-display);
  font-size: 1.15rem;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 190, 11, 0.55), 0 0 2px rgba(255, 214, 107, 0.9);
}

.hx-ticker li::after {
  content: "";
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--gh-flare);
  box-shadow: 0 0 8px rgba(255, 106, 74, 0.9);
}

/* ---------- Sections ---------- */

.hx-section {
  padding-top: clamp(80px, 10vw, 140px);
  scroll-margin-top: 64px;
}

.hx-head {
  max-width: 46em;
  margin-bottom: clamp(28px, 3.5vw, 44px);
}

/* Section titles sit on a painted floor marking. */
.hx-head h2 {
  color: var(--hx-bone);
  font-size: clamp(2.3rem, 1.3rem + 3vw, 4rem);
  line-height: 1;
}

.hx-head h2::before {
  content: "";
  display: block;
  width: 72px;
  height: 7px;
  margin-bottom: 20px;
  background: var(--gh-signal);
  transform: skewX(-24deg);
  box-shadow: 0 0 18px rgba(255, 190, 11, 0.45);
}

.hx-head p {
  margin-top: 14px;
  color: var(--gh-steel);
  font-size: var(--fs-m);
  text-wrap: pretty;
}

.hx-genre {
  color: color-mix(in srgb, var(--accent, var(--gh-signal)) 85%, white);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hx-summary {
  margin-top: 8px;
  color: rgba(238, 241, 238, 0.8);
  font-size: var(--fs-s);
  line-height: 1.65;
  text-wrap: pretty;
}

.hx-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.hx-facts li {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(238, 241, 238, 0.78);
  background: rgba(9, 16, 23, 0.45);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.hx-bay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Original games: lit bays ---------- */

.hx-bays {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  perspective: 1400px;
}

.hx-bay {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  min-height: 300px;
  border-radius: 16px;
  background: var(--hx-plate);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 40px 70px -40px rgba(0, 0, 0, 0.9);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 500ms var(--hx-ease), box-shadow 300ms ease;
}

.hx-bay.is-feature {
  grid-column: 1 / -1;
  min-height: clamp(420px, 40vw, 560px);
}

.hx-bay.is-tilting {
  transition: transform 80ms linear, box-shadow 300ms ease;
}

.hx-bay:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 40px 90px -36px color-mix(in srgb, var(--accent) 50%, black);
}

.hx-bay-art,
.hx-bloom-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  overflow: hidden;
}

.hx-bay-art img,
.hx-bloom-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 900ms var(--hx-ease);
}

.hx-bay:hover .hx-bay-art img,
.hx-bloom:hover .hx-bloom-art img {
  transform: scale(1.08);
}

.hx-bay-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 10, 14, 0.97) 0%, rgba(6, 10, 14, 0.82) 34%, rgba(6, 10, 14, 0.2) 64%, rgba(6, 10, 14, 0) 80%);
}

.hx-bay.is-feature .hx-bay-art::after {
  background:
    linear-gradient(90deg, rgba(6, 10, 14, 0.94) 0%, rgba(6, 10, 14, 0.7) 32%, rgba(6, 10, 14, 0) 60%),
    linear-gradient(0deg, rgba(6, 10, 14, 0.6) 0%, rgba(6, 10, 14, 0) 40%);
}

.hx-bay.is-feature .hx-bay-art img {
  object-position: 70% 50%;
}

.hx-bay.is-feature .hx-bay-body {
  max-width: 560px;
  padding: clamp(24px, 3.4vw, 48px);
}

.hx-glare {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(520px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.16), transparent 50%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.hx-bay:hover .hx-glare,
.hx-bloom:hover .hx-glare {
  opacity: 1;
}

/* The art is the link; text sits on top and only its own links take clicks. */
.hx-bay-body {
  position: relative;
  padding: clamp(20px, 2.4vw, 32px);
  pointer-events: none;
}

.hx-bay-body a,
.hx-bay-body .btn {
  pointer-events: auto;
}

.hx-bay h3 {
  margin-top: 6px;
  color: var(--hx-bone);
  font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.6rem);
}

.hx-bay.is-feature h3 {
  font-size: clamp(2.4rem, 1.6rem + 2.4vw, 3.8rem);
}

.hx-bay h3 a {
  text-decoration: none;
}

.hx-bay h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

/* The smaller bays are cards: art on top, text on the plate below, so busy key art never
   sits under copy. */
.hx-bay:not(.is-feature) {
  justify-content: flex-start;
  min-height: 0;
}

.hx-bay:not(.is-feature) .hx-bay-art {
  position: relative;
  inset: auto;
  z-index: 0;
  aspect-ratio: 16 / 10;
}

.hx-bay:not(.is-feature) .hx-bay-art::after {
  background: linear-gradient(0deg, var(--hx-plate) 0%, rgba(17, 27, 36, 0) 42%);
}

.hx-bay:not(.is-feature) .hx-bay-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 2px 22px 22px;
}

.hx-bay:not(.is-feature) .hx-bay-actions {
  margin-top: auto;
  padding-top: 18px;
}

.hx-bay:not(.is-feature) .hx-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hx-bay:not(.is-feature) h3 {
  font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem);
}

.hx-bay.is-feature .hx-summary {
  max-width: 34em;
  font-size: var(--fs-base);
}

/* ---------- Live planet in the featured bay (desktop) ---------- */

.hx-planet,
.hx-planet-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hx-planet-scrim {
  background: linear-gradient(90deg, rgba(6, 10, 14, 0.9) 0%, rgba(6, 10, 14, 0.55) 30%, rgba(6, 10, 14, 0) 52%);
}

.hx-bay.is-live {
  background: radial-gradient(ellipse 60% 90% at 70% 50%, #15233d 0%, #0a1222 55%, #060a14 100%);
}

.hx-bay.is-live .hx-planet {
  pointer-events: auto;
  opacity: 1;
  cursor: crosshair;
}

.hx-bay.is-live .hx-planet-scrim {
  opacity: 1;
}

.hx-bay.is-live .hx-bay-art {
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hx-bay.is-live[data-mode="lower"] .hx-planet {
  cursor: s-resize;
}

.hx-bay.is-live[data-mode="quake"] .hx-planet,
.hx-bay.is-live[data-mode="volcano"] .hx-planet {
  cursor: cell;
}

.hx-planet-tools,
.hx-planet-hint,
.hx-planet-score {
  display: none;
}

/* Who is winning on the live planet: blue tribe left, red tribe right. */
.hx-bay.is-live .hx-planet-score {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 22em;
  margin-top: 18px;
}

.hx-planet-score b {
  min-width: 2.6em;
  font-family: var(--gh-font-display);
  font-size: 1.35rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.hx-planet-score .is-blue {
  color: #4aa3ff;
  text-align: right;
}

.hx-planet-score .is-red {
  color: #ff6b57;
}

.hx-planet-meter {
  --share: 0.5;
  display: flex;
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.hx-planet-meter i {
  display: block;
  height: 100%;
  transition: flex-grow 600ms ease;
}

.hx-planet-meter i:first-child {
  flex: var(--share) 1 0;
  background: linear-gradient(90deg, #1f5fa8, #4aa3ff);
}

.hx-planet-meter i:last-child {
  flex: calc(1 - var(--share)) 1 0;
  border-left: 2px solid #fff;
  background: linear-gradient(90deg, #ff6b57, #a8302a);
}

.hx-bay.is-live .hx-planet-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.hx-bay.is-live .hx-planet-hint {
  display: block;
  margin-top: 10px;
  max-width: 30em;
  color: var(--gh-steel);
  font-size: var(--fs-xs);
}

.hx-planet-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(238, 241, 238, 0.85);
  background: rgba(9, 16, 23, 0.6);
  font: 600 var(--fs-xs)/1 var(--gh-font-body);
  cursor: pointer;
  pointer-events: auto;
}

.hx-planet-tools button:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.hx-planet-tools button[aria-pressed="true"] {
  border-color: var(--gh-signal);
  color: var(--hx-bone);
  background: rgba(255, 190, 11, 0.14);
}

.hx-planet-tools i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--sw);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

/* ---------- Board games: a wall of boards with a light that follows the pointer ---------- */

.hx-wall {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-wall li {
  display: flex;
}

.hx-board {
  --x: -500px;
  --y: -500px;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  overflow: hidden;
  padding: 18px 14px 16px;
  border-radius: 12px;
  color: var(--hx-bone);
  background: linear-gradient(180deg, #121d27, #0c151c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: transform 220ms var(--hx-ease);
}

/* Edge light and inner sheen, both centred on the pointer (set by home.js). */
.hx-board::before,
.hx-board::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.hx-board::before {
  padding: 1px;
  background: radial-gradient(220px circle at var(--x) var(--y), rgba(255, 196, 40, 0.95), rgba(255, 196, 40, 0.25) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.hx-board::after {
  background: radial-gradient(260px circle at var(--x) var(--y), rgba(255, 220, 140, 0.08), transparent 60%);
}

.hx-wall.is-lit .hx-board::before,
.hx-wall.is-lit .hx-board::after {
  opacity: 1;
}

.hx-board:hover {
  transform: translateY(-3px);
}

/* Each board lies flat on the table and lifts up to face you on hover. */
.hx-board-glyph {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 6px;
  box-shadow: 0 14px 18px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: perspective(260px) rotateX(38deg) rotateZ(-8deg);
  transform-origin: 50% 80%;
  transition: transform 420ms var(--hx-ease), box-shadow 420ms ease;
}

.hx-board:hover .hx-board-glyph,
.hx-board:focus-visible .hx-board-glyph {
  transform: perspective(260px) rotateX(0deg) rotateZ(0deg) translateY(-4px) scale(1.12);
  box-shadow: 0 20px 26px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 26px -6px rgba(255, 196, 40, 0.5);
}

.hx-board strong {
  font-family: var(--gh-font-display);
  font-size: 1.32rem;
  font-weight: 400;
  line-height: 1.1;
}

.hx-board span {
  color: var(--gh-steel);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hx-board-all {
  background: linear-gradient(160deg, rgba(255, 190, 11, 0.2), rgba(255, 190, 11, 0.04) 70%), #0c151c;
  box-shadow: inset 0 0 0 1px rgba(255, 190, 11, 0.4);
}

.hx-board-all strong {
  color: var(--gh-signal);
}

.hx-board-stack {
  position: relative;
  display: block;
  width: 72px;
  height: 58px;
  margin-bottom: 14px;
}

.hx-board-stack svg {
  position: absolute;
  top: 6px;
  width: 44px;
  height: 44px;
  border-radius: 5px;
  box-shadow: 0 10px 16px -8px rgba(0, 0, 0, 0.9);
  transition: transform 420ms var(--hx-ease);
}

.hx-board-stack svg:nth-child(1) { left: 0; transform: rotate(-14deg); }
.hx-board-stack svg:nth-child(2) { left: 14px; transform: rotate(-2deg); }
.hx-board-stack svg:nth-child(3) { left: 28px; transform: rotate(11deg); }
.hx-board-all:hover .hx-board-stack svg:nth-child(1) { transform: translateX(-6px) rotate(-20deg); }
.hx-board-all:hover .hx-board-stack svg:nth-child(3) { transform: translateX(8px) rotate(18deg); }

/* ---------- Party games: BingoBloom and a pinboard of polaroids ---------- */

.hx-party {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.45fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.hx-bloom {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  min-height: 560px;
  border-radius: 16px;
  --accent: #ff9ec7;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 40px 70px -40px rgba(0, 0, 0, 0.9);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 500ms var(--hx-ease);
}

.hx-bloom.is-tilting {
  transition: transform 80ms linear;
}

.hx-bloom-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 16, 12, 0.96) 0%, rgba(20, 16, 12, 0.7) 36%, rgba(20, 16, 12, 0) 62%);
}

.hx-bloom-body {
  position: relative;
  padding: 26px;
  pointer-events: none;
}

.hx-bloom-body a,
.hx-bloom-body .btn {
  pointer-events: auto;
}

.hx-bloom h3 {
  color: #fff8ef;
  font-size: clamp(2rem, 1.4rem + 1.6vw, 2.8rem);
}

.hx-bloom h3 a {
  text-decoration: none;
}

.hx-bloom .hx-genre {
  margin-top: 4px;
}

.hx-pinboard {
  padding: clamp(18px, 2.4vw, 30px);
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.025), transparent 40%),
    radial-gradient(rgba(0, 0, 0, 0.35) 1px, transparent 1.6px) 0 0 / 9px 9px,
    linear-gradient(180deg, #1b2630, #141d26);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hx-polaroids {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 20px;
  margin: 0;
  padding: 10px 2px 0;
  list-style: none;
}

.hx-polaroid {
  --r: -2.5deg;
  --t: 4deg;
  position: relative;
  display: block;
  padding: 7px 7px 11px;
  border-radius: 2px;
  color: #1f252b;
  background: #f2efe7;
  box-shadow: 0 14px 22px -12px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  text-decoration: none;
  transform: rotate(var(--r));
  transition: transform 260ms var(--hx-ease), box-shadow 260ms ease;
}

.hx-polaroids li:nth-child(4n + 2) .hx-polaroid { --r: 2deg; --t: -5deg; }
.hx-polaroids li:nth-child(4n + 3) .hx-polaroid { --r: -1deg; --t: 2deg; }
.hx-polaroids li:nth-child(4n + 4) .hx-polaroid { --r: 3deg; --t: -3deg; }
.hx-polaroids li:nth-child(8n + 5) .hx-polaroid { --r: 1.5deg; }
.hx-polaroids li:nth-child(8n + 7) .hx-polaroid { --r: -3deg; }

.hx-polaroid::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 54px;
  height: 18px;
  margin-left: -27px;
  background: rgba(255, 214, 107, 0.62);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transform: rotate(var(--t));
}

.hx-polaroid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ddd8cc;
}

.hx-polaroid strong {
  display: block;
  margin-top: 9px;
  font-family: var(--gh-font-display);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.1;
}

.hx-polaroid span {
  display: block;
  margin-top: 2px;
  color: #67707a;
  font-size: 0.72rem;
  line-height: 1.35;
}

.hx-polaroid:hover,
.hx-polaroid:focus-visible {
  z-index: 2;
  transform: rotate(0deg) translateY(-8px) scale(1.06);
  box-shadow: 0 30px 40px -18px rgba(0, 0, 0, 0.95);
}

/* Polaroids get pinned up one by one the first time the board scrolls into view. */
.hx-pinboard.is-waiting .hx-polaroid {
  opacity: 0;
  transform: rotate(calc(var(--r) * 3)) translateY(-26px) scale(1.12);
}

.hx-pinboard.is-pinning .hx-polaroid {
  transition: transform 520ms cubic-bezier(0.3, 1.4, 0.5, 1), opacity 260ms ease;
  transition-delay: calc(var(--i, 0) * 45ms);
}

.hx-note {
  margin-top: 26px;
  color: var(--gh-steel);
  font-size: var(--fs-xs);
}

.hx-link {
  color: var(--gh-signal);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- Updates: a split-flap departures board ---------- */

.hx-departures {
  max-width: 1000px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 14px;
  list-style: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
    #05090d;
  box-shadow: inset 0 0 0 1px #17232d, 0 40px 70px -40px rgba(0, 0, 0, 0.9);
}

.hx-departures li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 14px 4px;
  border-bottom: 1px solid #111c25;
}

.hx-departures li:last-child {
  border-bottom: 0;
}

.hx-departures time {
  display: flex;
  gap: 3px;
  color: var(--hx-led);
  font-family: var(--gh-font-display);
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
}

.hx-flap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  height: 1.55em;
  border-radius: 3px;
  background: linear-gradient(180deg, #1a2630 0 50%, #131d26 50% 100%);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.04);
  text-shadow: 0 0 8px rgba(255, 190, 11, 0.45);
}

.hx-flap::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(0, 0, 0, 0.7);
}

.hx-flap.is-sep {
  width: 0.55em;
  background: none;
  box-shadow: none;
}

.hx-flap.is-sep::after {
  display: none;
}

.hx-flap.is-flipping {
  animation: hx-flip 90ms linear infinite;
}

.hx-departures p {
  color: rgba(238, 241, 238, 0.86);
  font-size: var(--fs-s);
  line-height: 1.6;
}

.hx-home .gh-footer {
  margin-top: clamp(80px, 10vw, 140px);
}

/* ---------- Motion ---------- */

@keyframes hx-rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@keyframes hx-glint {
  from { background-position: 120% 0; }
  to { background-position: -20% 0; }
}

@keyframes hx-sway {
  from { transform: rotate(-2.5deg); }
  to { transform: rotate(2.5deg); }
}

@keyframes hx-ticker {
  to { transform: translateX(-50%); }
}

@keyframes hx-flip {
  0% { transform: scaleY(1); }
  50% { transform: scaleY(0.2); }
  100% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hx-torch {
    display: none;
  }

  .hx-copy h2,
  .hx-lede,
  .hx-actions,
  .hx-lift,
  .hx-beams,
  .hx-ticker-track {
    animation: none;
  }

  .hx-copy h2 {
    background-position: -20% 0;
  }

  .hx-bay,
  .hx-bloom,
  .hx-board,
  .hx-board-glyph,
  .hx-polaroid,
  .hx-bay-art img {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hx-wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hx-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 28px;
  }

  .hx-lift {
    justify-self: start;
  }

  .hx-hero-inner {
    padding-top: calc(56px + clamp(300px, 46vh, 460px));
  }

  .hx-carousel {
    left: 50%;
    top: calc(56px + clamp(150px, 23vh, 230px));
    width: clamp(160px, 40vw, 250px);
  }

  .hx-ring {
    --radius: calc(clamp(160px, 40vw, 250px) * 0.95);
  }

  .hx-floor {
    inset: 8% 0 0;
  }

  .hx-scrim {
    background:
      linear-gradient(0deg, rgba(9, 16, 23, 0.97) 0%, rgba(9, 16, 23, 0.82) 45%, rgba(9, 16, 23, 0.35) 75%, rgba(9, 16, 23, 0.6) 100%);
  }

  .hx-bays {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .hx-bay.is-feature {
    grid-row: auto;
    min-height: 520px;
  }

  .hx-bay:not(.is-feature) {
    min-height: 260px;
  }

  .hx-party {
    grid-template-columns: minmax(0, 1fr);
  }

  .hx-bloom {
    min-height: 460px;
  }

  .hx-wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hx-hero {
    min-height: auto;
  }

  .hx-hero-inner {
    padding-top: calc(56px + clamp(280px, 42vh, 380px));
    padding-bottom: 26px;
  }

  .hx-copy h2 {
    font-size: clamp(2.7rem, 1.2rem + 7vw, 3.6rem);
  }

  :root:lang(en) .hx-copy h2 {
    font-size: clamp(2.3rem, 1rem + 6vw, 3rem);
  }

  .hx-actions .btn {
    flex: 1 1 auto;
  }

  .hx-lift {
    width: 100%;
  }

  .hx-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hx-polaroids {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .hx-polaroid {
    padding: 5px 5px 8px;
  }

  .hx-polaroid::before {
    width: 38px;
    height: 13px;
    margin-left: -19px;
    top: -7px;
  }

  .hx-polaroid strong {
    font-size: 0.82rem;
  }

  .hx-polaroid span {
    display: none;
  }

  .hx-bay.is-feature {
    min-height: 460px;
  }

  .hx-bay:not(.is-feature) {
    flex-direction: column;
    min-height: 0;
  }

  .hx-bay:not(.is-feature) .hx-bay-art {
    position: relative;
    inset: auto;
    z-index: 0;
    aspect-ratio: 16 / 9;
  }

  .hx-bay:not(.is-feature) .hx-bay-art::after {
    background: linear-gradient(0deg, var(--hx-plate) 0%, rgba(17, 27, 36, 0) 45%);
  }

  .hx-bay:not(.is-feature) .hx-bay-body {
    width: auto;
    padding: 4px 20px 22px;
  }

  .hx-departures li {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .hx-ticker li {
    font-size: 1rem;
  }
}

/* Touch devices: no live blur over the drifting cover art, which would re-blur every frame. */
@media (pointer: coarse), (max-width: 960px) {
  .hx-now,
  .hx-ghost,
  .hx-lift-nav button {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hx-now {
    background: linear-gradient(160deg, rgba(20, 31, 41, 0.94), rgba(8, 14, 20, 0.96));
  }

  .hx-lift-nav button {
    background: rgba(9, 16, 23, 0.85);
  }
}

@media print {
  .hx-ticker,
  .hx-torch,
  .hx-beams,
  .hx-progress {
    display: none;
  }
}

/* ---------- 叠出文明: the five stages as a row of little cards ---------- */

.hx-evo-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.hx-evo-stages li {
  display: flex;
  align-items: center;
}

.hx-evo-stages li + li::before {
  content: "";
  width: 12px;
  height: 2px;
  margin: 0 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
}

.hx-evo-stages span {
  padding: 4px 9px 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 3px solid var(--stage);
  border-radius: 6px;
  background: rgba(6, 10, 14, 0.62);
  color: var(--hx-bone);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.hx-evo picture {
  display: contents;
}

/* One column: the cards would sit under the copy, so the art goes on top like the small bays. */
@media (max-width: 960px) {
  .hx-bay.hx-evo {
    justify-content: flex-start;
    min-height: 0;
  }

  .hx-bay.hx-evo .hx-bay-art {
    position: relative;
    inset: auto;
    z-index: 0;
    aspect-ratio: 16 / 10;
  }

  .hx-bay.hx-evo .hx-bay-art::after {
    background: linear-gradient(0deg, var(--hx-plate) 0%, rgba(17, 27, 36, 0) 40%);
  }

  .hx-bay.hx-evo .hx-bay-art img {
    object-position: 50% 50%;
  }

  .hx-bay.hx-evo .hx-bay-body {
    max-width: none;
    padding: 0 22px 24px;
  }
}

/* ---------- 小星系: the live star system is the top of the page ---------- */

.hx-cosmos {
  position: relative;
  isolation: isolate;
  height: max(640px, min(100svh, 1000px));
  /* What shows before the sky is drawn, or without WebGL. */
  background:
    radial-gradient(ellipse 34% 30% at 50% 46%, rgba(255, 176, 80, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 22% 30%, rgba(90, 70, 190, 0.2), transparent 70%),
    radial-gradient(ellipse 45% 35% at 80% 66%, rgba(40, 120, 170, 0.18), transparent 70%),
    #05070d;
  color: var(--hx-bone);
}

.hx-cosmos-copy {
  position: absolute;
  z-index: 3;
  top: calc(56px + clamp(16px, 4vh, 44px));
  left: max(var(--gh-gutter), calc((100% - var(--gh-page-width, 1180px)) / 2));
  max-width: min(23rem, 31%);
  /* Drags across the words still turn the system; only the buttons take the pointer. */
  pointer-events: none;
}

/* A soft dark pool behind the words, so orbit lines passing behind them stay quiet. */
.hx-cosmos-copy::before {
  content: "";
  position: absolute;
  inset: -60px -90px -50px -120px;
  z-index: -1;
  background: radial-gradient(ellipse 60% 58% at 42% 48%, rgba(4, 6, 12, 0.72), rgba(4, 6, 12, 0.38) 55%, transparent 78%);
  pointer-events: none;
}

.hx-cosmos-kicker {
  margin: 0;
  color: #ffcf5a;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.hx-cosmos h1 {
  margin: 10px 0 0;
  font-family: var(--gh-font-display);
  font-size: clamp(2.1rem, 1rem + 2.4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.08;
  color: #fff4dc;
  text-shadow: 0 0 28px rgba(255, 180, 80, 0.35), 0 2px 18px rgba(0, 0, 0, 0.6);
  text-wrap: balance;
}

.hx-cosmos-lede {
  max-width: 26em;
  margin: 14px 0 0;
  color: rgba(232, 238, 244, 0.84);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.06rem);
  line-height: 1.65;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.hx-cosmos .hx-actions {
  margin-top: 22px;
  pointer-events: auto;
  animation: hx-rise 700ms var(--hx-ease) 200ms both;
}

.hx-cosmos .gx-tools {
  top: calc(56px + clamp(14px, 3vh, 30px));
  right: max(var(--gh-gutter), calc((100% - var(--gh-page-width, 1180px)) / 2));
}

/* The five games along the bottom: tap a name to play. */
.hx-gx-worlds {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(14px, 3vh, 26px);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  width: min(1280px, calc(100% - 2 * var(--gh-gutter)));
  transform: translateX(-50%);
}

.hx-gx-world {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid var(--accent);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--hx-ease);
}

.hx-gx-world:hover,
.hx-gx-world:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: rgba(14, 20, 30, 0.82);
  transform: translateY(-2px);
}

.hx-gx-play {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 6px 10px 14px;
  color: inherit;
  text-decoration: none;
}

.hx-gx-play strong {
  overflow: hidden;
  font-family: var(--gh-font-display);
  font-size: 1.12rem;
  font-weight: 400;
  color: var(--accent);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hx-gx-play span {
  overflow: hidden;
  color: rgba(214, 222, 232, 0.72);
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hx-gx-play:focus-visible,
.hx-gx-how:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}

.hx-gx-how {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #dfe6ec;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.hx-gx-how:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.hx-cosmos-note {
  position: absolute;
  top: 45%;
  width: 100%;
  text-align: center;
  color: #c3ccd4;
}

/* Upright screens: the words above the system. */
@media (max-aspect-ratio: 1/1) {
  .hx-cosmos-copy {
    max-width: none;
    right: var(--gh-gutter);
    top: calc(56px + 14px);
  }
}

/* Narrow screens: smaller words, the games a row to swipe along. */
@media (max-width: 900px) {

  .hx-cosmos h1 {
    font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.4rem);
  }

  .hx-cosmos-lede {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .hx-cosmos .hx-actions {
    position: fixed;
    display: none;
  }

  .hx-cosmos .gx-tools {
    top: auto;
    bottom: calc(clamp(14px, 3vh, 26px) + 76px);
  }

  .hx-gx-worlds {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 42%);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .hx-gx-worlds::-webkit-scrollbar {
    display: none;
  }

  .hx-gx-world {
    scroll-snap-align: start;
  }

  .hx-gx-world:hover,
  .hx-gx-world:focus-within {
    transform: none;
  }
}

/* Short landscape screens (a phone held sideways): the hero fits the screen, the words get small. */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .hx-cosmos {
    height: max(360px, 100svh);
  }

  .hx-cosmos-copy {
    top: calc(56px + 8px);
    max-width: min(17rem, 34%);
  }

  .hx-cosmos h1 {
    font-size: 1.45rem;
  }

  .hx-cosmos-lede,
  .hx-cosmos .gx-tools {
    display: none;
  }

  .hx-gx-worlds {
    grid-auto-flow: row;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    bottom: 10px;
    overflow: visible;
  }

  .hx-gx-play {
    padding: 6px 4px 6px 10px;
  }

  .hx-gx-play span,
  .hx-gx-how {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-cosmos .hx-actions {
    animation: none;
  }
}

/* ---------- The hangar: the turntable is the second way in, below the galaxy ---------- */

.hx-hero.hx-hangar {
  min-height: max(600px, min(88svh, 860px));
}

.hx-hangar .hx-hero-inner {
  padding-top: clamp(70px, 12vh, 140px);
}

.hx-kicker {
  margin: 0 0 12px;
  color: var(--hx-led);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

/* portal.css keeps the guide pages' 3D covers out of the pointer's way; this one is played with. */
.hx-hangar .door-3d {
  pointer-events: auto;
}

.hx-hangar.is-3d .door-3d {
  cursor: grab;
}

.hx-hangar .door-3d.is-dragging {
  cursor: grabbing;
}

@media (max-width: 960px) {
  .hx-hangar .hx-hero-inner {
    padding-top: calc(clamp(300px, 46vh, 460px));
  }
}

@media (max-width: 640px) {
  .hx-hero.hx-hangar {
    min-height: auto;
  }

  .hx-hangar .hx-hero-inner {
    padding-top: clamp(280px, 42vh, 380px);
  }
}
