/* new-17 site styles. Tokens: tokens.css (design system v2 — Fibonacci lengths, φ opacities, two families). */
@import url('tokens.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--void); color: var(--ink-2); overflow: hidden;
  font: 400 var(--t-body) / var(--lh-body) var(--font-sans); letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em, i, b, cite, dfn, var, address { font-style: normal; }
b { font-weight: 500; color: var(--ink-1); }
h1, h2, h3, p { font-weight: 400; }

/* ─────────── type (v2: five sizes) ─────────── */
.display { font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--tr-display); color: var(--ink-1); }
.body    { font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); color: var(--ink-2); }
.caption { font-size: var(--t-small); line-height: var(--lh-small); letter-spacing: var(--tr-small); color: var(--ink-3); }
.dots {
  font-family: var(--font-dots); font-weight: 700; font-variation-settings: "ROND" 100;
  font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: 0; color: var(--ink-1);
}
.dots small {
  font-family: var(--font-sans); font-variation-settings: normal; font-weight: 400;
  font-size: var(--t-small); color: var(--ink-3); margin-left: var(--f8);
}
.dots--34 { font-size: var(--t-heading); }
.dots--89 { font-size: var(--t-title); }

/* ─────────── surfaces and buttons (v2: fill only, no edges) ─────────── */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-h); min-width: var(--btn-w); padding: 0 var(--f34); border-radius: var(--r-btn);
  font-size: var(--t-small); line-height: 1; font-weight: 500; letter-spacing: 0;
  transition: background-color var(--dur-press) var(--ease-expo), color var(--dur-press) var(--ease-expo), scale var(--dur-press) var(--ease-expo);
}
.btn:active { scale: .98; }
.btn--primary { background: var(--fg); color: var(--void); }
.btn--primary:hover { background: #fff; }
.btn--text { min-width: 0; padding: 0 var(--f21); color: var(--ink-2); }
.btn--text:hover { color: var(--ink-1); }

/* ─────────── hero v4 (stage 2) — header after the user's ref, a sticky glowing tick ring, a 3D flying title lockup.
   Everything flush to --edge (16). ─────────── */
.hero { position: fixed; inset: 0; overflow: hidden; background: var(--void); }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__fade { display: none; }
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 8, 8, .618) 0%, rgba(8, 8, 8, 0) 21%, rgba(8, 8, 8, 0) 61.8%, rgba(8, 8, 8, .618) 100%);
}

/* header: a square logo tile and two smaller buttons (no action yet) */
.hero__head, .game__head {   /* one header for both screens, in the same spot: across the launch cut it reads as one */
  position: absolute; inset: var(--edge) var(--edge) auto; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.hero__head > *, .game__head > * { pointer-events: auto; }
.tile { display: block; width: var(--f55); height: var(--f55); }
.hero__btns, .game__btns { display: flex; gap: var(--f5); }
.hbtn {
  height: var(--f34); padding: 0 var(--f21); border-radius: var(--f8);
  background: rgba(238, 244, 248, .854); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  color: var(--void); font-family: var(--font-sans); font-size: var(--t-small); font-weight: 500; line-height: 1;
  transition: background-color var(--dur-press) var(--ease-expo), scale var(--dur-press) var(--ease-expo);
}
.hbtn:hover { background: #fff; }
.hbtn:active { scale: .98; }
.hbtn:disabled { opacity: .382; cursor: default; }
.hbtn:disabled:hover { background: rgba(238, 244, 248, .854); }
.hbtn:disabled:active { scale: 1; }

/* the tick ring: a Ø 610 hover zone around a Ø 377 ring (445 drawing box), centred in the right golden column */
.ring {
  position: absolute; z-index: 1; width: calc(var(--u) * 610); height: calc(var(--u) * 610); border-radius: 50%;
  left: calc(80.9vw - var(--edge) / 2 - var(--u) * 305); top: calc(38.2% - var(--u) * 305); touch-action: none;
}
.ring:focus-visible { outline: none; }
.ring__tilt {
  position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 678); height: calc(var(--u) * 678);   /* the Ø 610 zone + 34 pad */
  margin: calc(var(--u) * -339) 0 0 calc(var(--u) * -339);
}
.ring__tilt::before {   /* a soft darkening so the ticks read over any frame */
  content: ""; position: absolute; inset: calc(var(--u) * 95); border-radius: 50%; pointer-events: none;   /* around the Ø 377 ring */
  background: radial-gradient(closest-side, rgba(8, 8, 8, .382), rgba(8, 8, 8, 0));
}
.ring__ticks, .ring__bloom { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ring__bloom { filter: blur(calc(var(--u) * 34)); mix-blend-mode: plus-lighter; }   /* additive, sweeping light on top of the ticks */
@supports not (mix-blend-mode: plus-lighter) { .ring__bloom { mix-blend-mode: screen; } }
.disc {
  position: absolute; left: 50%; top: 50%; width: var(--disc); height: var(--disc); border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--ink-5); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  font-family: var(--font-display); font-size: var(--t-body); font-weight: 500; letter-spacing: var(--tr-label);
  text-transform: uppercase; color: var(--ink-1);
  transition: background-color var(--dur-press) var(--ease-expo), color var(--dur-press) var(--ease-expo), scale var(--dur-press) var(--ease-expo), opacity var(--dur-press) var(--ease-expo);
}
.disc:hover { background: var(--fg); color: var(--void); }
.disc:active { scale: .98; }
.disc:disabled { opacity: .382; cursor: default; }
.disc:disabled:hover { background: var(--ink-5); color: var(--ink-1); }

/* the title lockups: small 55 over big 144 (MUSTANG / FASTBACK), flying through 3D space (lib/titles.js writes --e) */
.titles { position: absolute; left: var(--edge); bottom: var(--edge); perspective: calc(var(--u) * 987); perspective-origin: 0 100%; pointer-events: none; }
.lockup {
  display: grid; justify-items: start; margin: 0; transform-origin: 0 50%;
  font-family: var(--font-display); text-transform: uppercase; color: var(--ink-1);
}
.lockup + .lockup { position: absolute; left: 0; bottom: 0; }
.lockup__sm { font-weight: 400; font-size: var(--t-display); line-height: 1; letter-spacing: var(--tr-wordmark); margin-bottom: var(--f13); }
.lockup__lg {
  position: relative; white-space: nowrap; margin-bottom: -.082em;   /* the letters sit on the 16 edge */
  font-weight: 300; font-size: var(--t-giant); line-height: var(--lh-giant); letter-spacing: var(--tr-giant);
}
[data-title="a"] {   /* exits: swings up-left and away */
  transform: translate3d(calc(var(--e, 0) * -89 * var(--u)), calc(var(--e, 0) * -233 * var(--u)), calc(var(--e, 0) * -377 * var(--u)))
             rotateX(calc(var(--e, 0) * 34deg)) rotateY(calc(var(--e, 0) * -55deg));
}
[data-title="b"] {   /* enters: from huge and tilted at the upper left, close to the camera */
  opacity: 0;
  transform: translate3d(calc(var(--e, 1) * -55 * var(--u)), calc(var(--e, 1) * -377 * var(--u)), calc(var(--e, 1) * 377 * var(--u)))
             rotateX(calc(var(--e, 1) * -34deg)) rotateY(calc(var(--e, 1) * 21deg));
}

/* ─────────── the site cursor (lib/cursor.js): a 34 white circle, difference blend; ×1.618 over buttons, .8 pressed ─────────── */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor {
  position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none;
  mix-blend-mode: difference; opacity: 0; transition: opacity var(--dur-press) var(--ease-expo);
}
.cursor.is-on { opacity: 1; }
.cursor::before {
  content: ""; position: absolute; left: calc(var(--f34) / -2); top: calc(var(--f34) / -2);
  width: var(--f34); height: var(--f34); border-radius: 50%; background: var(--fg);
  transition: scale var(--dur-press) var(--ease-expo);
}
.cursor.is-hover::before { scale: 1.618; }
.cursor.is-down::before { scale: .8; }
.cursor.is-hover.is-down::before { scale: 1.3; }

/* ─────────── screens: Start blurs the hero out and the game in; Menu runs it back ─────────── */
.screen { transition: opacity var(--dur-in) var(--ease-expo), filter var(--dur-in) var(--ease-expo), transform var(--dur-in) var(--ease-expo); }
[data-screen="game"] .hero { opacity: 0; filter: blur(var(--f21)); transform: scale(1.055); pointer-events: none; }
[data-screen="hero"] .game { opacity: 0; filter: blur(var(--f21)); transform: scale(.97); pointer-events: none; }
body:not(.is-anim)[data-screen="game"] .hero,
body:not(.is-anim)[data-screen="hero"] .game { visibility: hidden; }   /* not rendered at rest: the blur keeps no surface alive */
.launch-shade { position: fixed; inset: 0; z-index: 5; background: #000; pointer-events: none; opacity: 0; }
.intro-skip {
  display: none; position: fixed; z-index: 6; left: 50%; transform: translateX(-50%);
  bottom: max(4px, env(safe-area-inset-bottom)); padding: 12px 16px;
  border: 0; background: transparent; color: #d0d8dc; opacity: .5; font: 650 13px/1.3 var(--font-sans);
  white-space: nowrap; text-shadow: 0 1px 5px #000;
}
.is-launch .intro-skip { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .is-launch .intro-skip { animation: intro-skip-pulse 2.8s ease-in-out infinite; }
  @keyframes intro-skip-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .52; } }
}

.hero__scrim, .hero__head, .hero .ring, .titles {
  transition: opacity var(--dur-in) var(--ease-expo), filter var(--dur-in) var(--ease-expo), transform var(--dur-in) var(--ease-expo);
}
.is-launch .hero__scrim, .is-launch .hero__head, .is-launch .hero .ring, .is-launch .titles {
  opacity: 0; filter: blur(var(--f13)); pointer-events: none;
  transition: opacity .45s var(--ease-in), filter .45s var(--ease-in), transform .45s var(--ease-in);
}
.is-launch .hero__head { transition-duration: .25s; }
.is-launch .hero .ring { transform: scale(2.2); }                        /* we fly through the ring */
.is-launch .titles { transform: translate(-8%, 6%) scale(1.6); }        /* the lockup rushes past to the lower left */
.is-cut .screen { transition: none; }
.game__head { transition: opacity .61s var(--ease-expo), filter .61s var(--ease-expo); }
.telemetry { transition: opacity .61s var(--ease-expo) var(--stagger), filter .61s var(--ease-expo) var(--stagger), transform .61s var(--ease-expo) var(--stagger); }
.is-launch .game__head, .is-launch .telemetry { opacity: 0; filter: blur(var(--f13)); }   /* they arrive in steps after the cut */
.is-launch .telemetry { transform: translateY(var(--f34)); }

/* ─────────── the game screen · UI v5 "SpaceX telemetry" (lib/game/telemetry.js draws, hud.js writes) ─────────── */
.game { position: fixed; inset: 0; overflow: hidden; background: var(--void); }
.game__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: none; transition: opacity var(--dur-press) var(--ease-expo); }
.game__grade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform: translateZ(0); }
.game__scrim {   /* Busted only: the hero's scrim, so the lockup and the ring read over the crash */
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .377s var(--ease-expo);
  background: linear-gradient(180deg, rgba(8, 8, 8, .382) 0%, rgba(8, 8, 8, 0) 21%, rgba(8, 8, 8, 0) 50%, rgba(8, 8, 8, .618) 100%);
}

/* the cluster: SPEED Ø 144 · 34 · the timeline 610 · 34 · ALTITUDE Ø 144 = 966, on the road band below the ground line.
   Positions mirror GEO in telemetry.js (units: design px). */
.telemetry {
  position: absolute; left: 50%; bottom: var(--edge); width: calc(var(--u) * 966); height: var(--f144);
  margin-left: calc(var(--u) * -483); pointer-events: none;
}
.telemetry::before {   /* one soft darkening under the cluster so the ticks read over any plate (no card, no glass) */
  content: ""; position: absolute; inset: calc(var(--u) * -55) calc(var(--u) * -144); pointer-events: none;
  background: radial-gradient(closest-side, rgba(8, 8, 8, .382), rgba(8, 8, 8, 0));
}
.telemetry__ticks, .telemetry__bloom {
  position: absolute; left: calc(var(--u) * -34); top: calc(var(--u) * -34);
  width: calc(100% + var(--u) * 68); height: calc(100% + var(--u) * 68);
}
.telemetry__bloom { filter: blur(var(--f13)); mix-blend-mode: plus-lighter; }
@supports not (mix-blend-mode: plus-lighter) { .telemetry__bloom { mix-blend-mode: screen; } }
.gauge {
  position: absolute; top: 0; width: var(--f144); height: var(--f144);
  display: grid; place-content: center; justify-items: center; gap: var(--f5);
}
.gauge--speed { left: 0; }
.gauge--alt { right: 0; }
.gauge .dots { font-size: var(--t-heading); }
.gauge .caption { line-height: 1; }
.timeline__dist {   /* rides the head tick (hud.js writes --x), like the ring's 000° */
  position: absolute; left: 0; top: calc(var(--u) * 37); white-space: nowrap; font-size: var(--t-body);
  transform: translate(calc(var(--u) * var(--x, 178) - 50%), -100%);
}
.timeline__nodes { list-style: none; position: absolute; left: 0; top: calc(var(--u) * 89); }
.timeline__nodes li {
  position: absolute; top: 0; white-space: nowrap; line-height: 1; color: var(--ink-3);   /* coming: the caption ink */
  transition: color .377s var(--ease-expo);
}
.timeline__nodes [data-node="0"] { left: calc(var(--u) * 178); }
.timeline__nodes [data-node="1"] { left: calc(var(--u) * 381.3); transform: translateX(-50%); }
.timeline__nodes [data-node="2"] { left: calc(var(--u) * 584.7); transform: translateX(-50%); }
.timeline__nodes [data-node="3"] { left: calc(var(--u) * 788); transform: translateX(-100%); }
.timeline__nodes [data-state="past"] { color: var(--ink-2); }
.timeline__nodes [data-state="now"], .timeline__nodes [data-state="beat"] { color: var(--ink-1); }
.timeline__clock {
  position: absolute; left: calc(var(--u) * 178); width: var(--f610); bottom: 0;
  display: flex; justify-content: center; align-items: baseline; gap: var(--f8); white-space: nowrap;
}
.timeline__t { font-family: var(--font-display); font-size: var(--t-small); letter-spacing: var(--tr-label); color: var(--ink-3); }
.timeline__clock .dots { font-size: var(--t-body); }
.timeline__hint { margin-left: var(--f13); font-size: var(--t-body); line-height: 1; color: var(--ink-2); }   /* READY's call to action: body size, not a caption */
.game:not([data-status="ready"]) .timeline__hint, .game[data-status="ready"] .timeline__dist { display: none; }
.dots .colon { font-family: var(--font-display); font-weight: 300; font-variation-settings: normal; color: var(--ink-3); margin: 0 .08em; }

/* the phase callout: a lockup flying through 3D like the hero's, mirrored into the free sky at the upper right.
   hud.js writes --e (entering: 1 → 0), --o (leaving: 0 → 1), opacity and blur from world.phaseSteps. */
.callouts {
  position: absolute; right: var(--edge); top: calc(var(--edge) + var(--f55) + var(--f34));
  perspective: calc(var(--u) * 987); perspective-origin: 100% 0; pointer-events: none;
}
.callout {
  justify-items: end; transform-origin: 100% 50%; opacity: 0; visibility: hidden;
  transform: translate3d(calc(var(--e, 1) * 55 * var(--u)), calc(var(--e, 1) * -144 * var(--u)), calc(var(--e, 1) * 377 * var(--u)))
             rotateX(calc(var(--e, 1) * -34deg)) rotateY(calc(var(--e, 1) * -21deg))
             translate3d(calc(var(--o, 0) * 89 * var(--u)), calc(var(--o, 0) * -233 * var(--u)), calc(var(--o, 0) * -377 * var(--u)))
             rotateX(calc(var(--o, 0) * 34deg)) rotateY(calc(var(--o, 0) * 55deg));
}
.callout .lockup__sm { font-size: var(--t-body); letter-spacing: var(--tr-label); margin-bottom: var(--f8); }
.callout .lockup__lg { font-size: var(--t-title); margin-bottom: 0; }

.pause-note {
  position: absolute; left: 50%; top: 38.2%; display: grid; justify-items: center; gap: var(--f13); pointer-events: none;
  transform: translate(-50%, -50%) translateY(var(--in-y)); opacity: 0; filter: blur(var(--in-blur));
}
.pause-note__title {
  font-family: var(--font-display); font-weight: 300; text-transform: uppercase;
  font-size: var(--t-display); line-height: 1; letter-spacing: var(--tr-wordmark); color: var(--ink-1);
}

/* Busted v2: the hero's layout — the lockup bottom left, the ring + disc in the right golden column, the summary
   under it. hud.js drives the entrance from the game's steps (the title flies in like hero B, the ring fills to
   distance / best, the summary staggers in); Restart is the START disc, enabled at RESTART_LOCK. */
.busted { position: absolute; inset: 0; visibility: hidden; pointer-events: none; perspective: calc(var(--u) * 987); perspective-origin: 0 100%; }
.busted__title {
  position: absolute; left: var(--edge); bottom: var(--edge); opacity: 0;
  transform: translate3d(calc(var(--e, 1) * -55 * var(--u)), calc(var(--e, 1) * -377 * var(--u)), calc(var(--e, 1) * 377 * var(--u)))
             rotateX(calc(var(--e, 1) * -34deg)) rotateY(calc(var(--e, 1) * 21deg));
}
.busted__ring .disc { pointer-events: auto; }
.busted__stats {
  position: absolute; left: calc(80.9vw - var(--edge) / 2 - var(--u) * 233); width: calc(var(--u) * 466);
  top: calc(38.2% + var(--u) * 233); display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--f21);
}
.busted__stats div { display: grid; gap: var(--f8); justify-items: center; }
.busted__stats dd { font-size: var(--t-body); white-space: nowrap; }
.busted__best {
  position: absolute; left: calc(80.9vw - var(--edge) / 2 - var(--u) * 233); width: calc(var(--u) * 466);
  top: calc(38.2% + var(--u) * 322); text-align: center;
}
.busted__best.is-new { color: var(--ink-1); }
[data-bust-in] { opacity: 0; }

/* status-driven visibility */
.game:is([data-status="paused"], [data-status="countdown"]) :is(.game__canvas, .game__grade) { opacity: .382; }
.resume-countdown { display: none; }
.game[data-status="countdown"] .resume-countdown {
  display: grid; position: absolute; inset: 0; place-items: center; pointer-events: none;
  font: 500 clamp(72px, 13vmin, 144px)/1 var(--font-display);
  font-variant-numeric: tabular-nums; color: var(--ink-1); text-shadow: 0 3px 22px #071215;
}
.game[data-status="paused"] .pause-note {
  opacity: 1; filter: blur(0); transform: translate(-50%, -50%);
  transition: opacity .377s var(--ease-expo), filter .377s var(--ease-expo), transform .377s var(--ease-expo);
}
.game[data-status="busted"] .game__scrim { opacity: 1; }
.game[data-status="busted"] .telemetry { opacity: 0; filter: blur(var(--f13)); transition-duration: .377s; }
.game[data-status="busted"] .busted { visibility: visible; }
.game:not([data-status="busted"]) .busted {   /* Restart: everything leaves in 233 ms */
  opacity: 0; filter: blur(var(--f8));
  transition: opacity .233s var(--ease-expo), filter .233s var(--ease-expo), visibility 0s .233s;
}

/* ─────────── stage 9 · phones ───────────
   Touch: key prompts swap for touch prompts; no double-tap zoom, no callouts. Both phone ranges: the notch and the
   home indicator are kept clear, and the header keeps thumb-sized targets. Portrait re-composes each screen; short
   landscape keeps the desktop composition, scaled by height (tokens.css). */
.t { display: none; }
@media (hover: none) and (pointer: coarse) {
  .k { display: none; }
  .t { display: inline; }
  button { touch-action: manipulation; }
  body { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 767px) and (orientation: portrait), (max-height: 520px) and (orientation: landscape) {
  .hero__head, .game__head {
    inset: max(var(--edge), env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right)) auto max(var(--edge), env(safe-area-inset-left));
  }
  .tile { width: max(40px, var(--f55)); height: max(40px, var(--f55)); border-radius: max(10px, var(--r-panel)); }
  .hbtn { height: max(34px, var(--f34)); padding: 0 max(14px, var(--f21)); }
  .titles, .busted__title { left: max(var(--edge), env(safe-area-inset-left)); bottom: max(var(--edge), env(safe-area-inset-bottom)); }
  .callouts { right: max(var(--edge), env(safe-area-inset-right)); top: calc(max(var(--edge), env(safe-area-inset-top)) + max(40px, var(--f55)) + max(13px, var(--f34))); }
}

/* short landscape: the instruments and the Busted summary get their own, larger design pixel so the text floors fit */
@media (max-height: 520px) and (orientation: landscape) {
  .telemetry {
    --u: calc(100dvh / 700);
    width: calc(var(--u) * 966); height: calc(var(--u) * 144); margin-left: calc(var(--u) * -483);
    bottom: max(calc(var(--u) * 16), env(safe-area-inset-bottom));
  }
  .gauge { width: calc(var(--u) * 144); height: calc(var(--u) * 144); }
  .timeline__clock { width: calc(var(--u) * 610); }
  .busted__stats, .busted__best { --u: calc(100dvh / 600); }
  .busted__stats { left: calc(80.9vw - var(--edge) / 2 - var(--u) * 233); width: calc(var(--u) * 466); top: calc(38.2% + var(--u) * 210); }
  .busted__best { left: calc(80.9vw - var(--edge) / 2 - var(--u) * 233); width: calc(var(--u) * 466); top: calc(38.2% + var(--u) * 300); }
}

@media (max-width: 767px) and (orientation: portrait) {
  /* Frame the car and its jets together on narrow screens. The wipe reads the same crop and fade. */
  .hero { --clip-height: min(70dvh, 116vw); }
  .hero__video { inset: 0 0 auto 0; height: var(--clip-height); object-position: 18% 50%; }
  .hero__fade {
    display: block; position: absolute; left: 0; right: 0; top: calc(var(--clip-height) * .6); height: calc(var(--clip-height) * .4); pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 8, 8, 0), var(--void));
    -webkit-backdrop-filter: blur(var(--f13)); backdrop-filter: blur(var(--f13));
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 55%); mask-image: linear-gradient(180deg, transparent, #000 55%);
  }

  /* the ring: centred, a little smaller (its own design pixel), START inside */
  .hero .ring {
    --u: calc(100vw / 520);
    left: calc(50% - var(--u) * 305); top: calc(42% - var(--u) * 305);
  }
  .hero .ring .disc { width: calc(var(--u) * 144); height: calc(var(--u) * 144); }

  /* the lockups: bottom left, sized to the width (ROADSTER fits) */
  .titles { --u: calc(100vw / 800); perspective: calc(var(--u) * 987); }
  .titles .lockup__sm { font-size: calc(var(--u) * 55); margin-bottom: calc(var(--u) * 13); }
  .titles .lockup__lg { font-size: calc(var(--u) * 144); }

  /* the telemetry: two rows — the gauges at the sides with the clock between them, the mission timeline across the
     width under them. Positions mirror GEO.mob in lib/game/telemetry.js (units: --tu, 1/398 of the box) */
  .telemetry {
    --tu: calc((100vw - 2 * var(--edge)) / 398);
    left: var(--edge); margin-left: 0; width: calc(var(--tu) * 398); height: calc(var(--tu) * 226);
    bottom: calc(var(--edge) + env(safe-area-inset-bottom));
  }
  .telemetry::before { inset: calc(var(--tu) * -34) calc(var(--tu) * -21); }
  .telemetry__ticks, .telemetry__bloom {
    left: calc(var(--tu) * -34); top: calc(var(--tu) * -34);
    width: calc(100% + var(--tu) * 68); height: calc(100% + var(--tu) * 68);
  }
  .gauge { width: calc(var(--tu) * 120); height: calc(var(--tu) * 120); }
  .gauge .dots { font-size: max(18px, calc(var(--tu) * 30)); }
  .timeline__dist { top: calc(var(--tu) * 128); transform: translate(calc(var(--tu) * var(--x, 0) - 50%), -100%); font-size: var(--t-body); }
  .timeline__nodes { top: calc(var(--tu) * 182); }
  .timeline__nodes [data-node="0"] { left: 0; }
  .timeline__nodes [data-node="1"] { left: calc(var(--tu) * 132.7); }
  .timeline__nodes [data-node="2"] { left: calc(var(--tu) * 265.3); }
  .timeline__nodes [data-node="3"] { left: calc(var(--tu) * 398); }
  .timeline__clock {
    left: calc(var(--tu) * 120); width: calc(var(--tu) * 158); bottom: auto; top: calc(var(--tu) * 34);
    flex-direction: column; align-items: center; gap: calc(var(--tu) * 5);
  }
  .timeline__hint { margin: calc(var(--tu) * 8) 0 0; font-size: var(--t-small); white-space: normal; text-align: center; line-height: 1.382; }

  /* the callout: the same flight, smaller */
  .callouts { --u: calc(100vw / 640); perspective: calc(var(--u) * 987); }
  .callout .lockup__lg { font-size: calc(var(--u) * 89); }

  .pause-note__title { font-size: var(--f34); }

  /* Busted: the ring centred high, the summary as a 2 × 2 grid under it, the lockup at the bottom */
  .busted__title { --u: calc(100vw / 640); }
  .busted__title .lockup__sm { font-size: calc(var(--u) * 44); margin-bottom: calc(var(--u) * 13); }
  .busted__title .lockup__lg { font-size: calc(var(--u) * 144); }
  .busted__ring {   /* above the road (the field's ground line is at 58 %) */
    --u: calc(100vw / 520);
    left: calc(50% - var(--u) * 305); top: calc(28% - var(--u) * 305);
  }
  .busted__ring .disc { width: calc(var(--u) * 144); height: calc(var(--u) * 144); }
  .busted__stats {   /* below the road, on the dark floor, clear of the crash */
    left: var(--edge); width: calc(100vw - 2 * var(--edge)); top: 63%;
    grid-template-columns: repeat(2, 1fr); row-gap: var(--f21);
  }
  .busted__best { left: var(--edge); width: calc(100vw - 2 * var(--edge)); top: calc(63% + var(--f144)); }
}

.fire-button { display: none; }
@media (any-pointer: coarse) {
  .fire-button:not([hidden]) {
    display: block; position: absolute; z-index: 3; right: max(var(--edge), env(safe-area-inset-right));
    bottom: max(22%, env(safe-area-inset-bottom)); min-width: 64px; min-height: 46px;
    background: #ffb68d; touch-action: manipulation;
  }
}
.motivation {
  position: absolute; left: 50%; bottom: 24%; transform: translateX(-50%);
  width: max-content; max-width: 90vw; text-align: center; pointer-events: none;
  color: #ffe6a0; font: 600 clamp(17px, 2.4vw, 32px)/1.2 var(--font-display);
  text-shadow: 0 1px 4px #151009, 0 0 16px #452f17;
}
@media (orientation: portrait) { .motivation { bottom: 32%; } }
.flight-panel {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + var(--edge) + var(--f55) + 12px);
  left: var(--edge); pointer-events: none; color: var(--ice);
  font: 400 clamp(11px, 1vw, 14px)/1.45 var(--font-sans);
  text-shadow: 0 1px 5px #080e17; max-width: min(90vw, 32em);
}
.power-slot { width: clamp(135px, 14vw, 195px); display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; margin-top: 4px; color: var(--fg); font-variant-numeric: tabular-nums; }
.power-slot[hidden] { display: none; }
.power-slot time { color: var(--accent); }
.power-slot i { grid-column: 1/-1; height: 3px; background: #ffffff32; border-radius: 3px; overflow: hidden; }
.power-slot b { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.flight-label { text-transform: uppercase; letter-spacing: .1em; }
.flight-load { color: var(--mist); }
.game[data-status="ready"] .flight-panel, .game[data-status="crashed"] .flight-panel { visibility: hidden; }
.pilot-dialog {
  margin: auto; width: min(90vw, 450px); max-height: 85dvh; overflow: auto; padding: clamp(20px, 4vw, 36px);
  border: 1px solid #4b606e; border-radius: 13px; color: var(--fg); background: #101923;
  font: 400 15px/1.5 var(--font-sans); box-shadow: 0 20px 80px #05080eb3;
}
.pilot-dialog::backdrop { background: #050911bd; }
.pilot-dialog form { float: right; }
.pilot-dialog h2 { font: 400 clamp(22px, 4vw, 32px)/1.2 var(--font-display); margin-bottom: 20px; }
.pilot-dialog dt, .pilot-dialog legend { font-weight: 500; color: var(--ice); margin-top: 14px; }
.pilot-dialog dd, .pilot-dialog small { color: #c0ccd5; }
.pilot-dialog fieldset { border: 0; }
.pilot-dialog label { display: block; margin: 12px 0; }
.pilot-dialog small { display: block; margin-left: 22px; }
.pilot-dialog input { accent-color: var(--ice); }
.pilot-dialog form button { min-width: 58px; width: auto; padding: 0 12px; height: 32px; }
.has-cursor .pilot-dialog, .has-cursor .pilot-dialog * { cursor: auto !important; }
@media (max-width: 767px) and (orientation: portrait) {
  .game[data-status="busted"] .flight-panel {
    top: 54%; left: 50%; width: 94%; max-width: none; transform: translate(-50%, -50%);
    text-align: center; line-height: 1.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .game__head, .telemetry { transition: none; }
}

.ranked-result { position: absolute; right: var(--edge); bottom: var(--edge); color: var(--ice); font: 14px/1.4 var(--font-display); }

/* The same live board moves from the film to the launch grid. */
.scoreboard {
  --pad: clamp(16px, 1.8vw, 28px);
  --rows: 18dvh;
  display: grid; gap: 0; width: 100%; padding: var(--pad);
  border: 1px solid #d5f7f84d; border-top: 2px solid #9de8e7ae;
  border-radius: 3px 14px 14px 3px;
  color: #f1fbff; background: linear-gradient(110deg, #0b1b22bc, #10212968);
  box-shadow: 0 8px 36px #0003;
  font: 400 clamp(14px, 1.2vw, 18px)/1.3 var(--font-sans);
}
[data-cover-board] {
  position: absolute; z-index: 2; left: max(var(--edge), 3vw); top: 26%;
  width: min(41vw, 570px); max-height: 47dvh; overflow: auto;
  scrollbar-width: thin;
}
.is-launch [data-cover-board], .game:not([data-status="ready"]) [data-ready-board] { display: none; }
[data-ready-board] {
  position: absolute; z-index: 3; inset: max(62px, 7dvh) 0 max(20px, 9dvh);
  width: min(88vw, 800px); margin-inline: auto;
  display: flex; flex-direction: column; justify-content: center; pointer-events: none;
}
[data-ready-board] .scoreboard {
  --pad: clamp(12px, 2.5dvh, 25px) clamp(16px, 3vw, 36px);
  --rows: min(31dvh, 290px);
  display: flex; flex-direction: column; max-height: 100%; pointer-events: auto;
  background: linear-gradient(110deg, #09151eeb, #0a1c24c4);
  font-size: clamp(15px, 1.4vw, 20px);
}
[data-ready-board] .scoreboard > * { flex: none; }
[data-ready-board] .scoreboard > .board-scroll { flex: 0 1 auto; min-height: 0; grid-template-rows: minmax(0,1fr); }
[data-ready-board] .board-scroll ol { min-height: 0; }
.game[data-status="ready"] .telemetry { visibility: hidden; }
.board-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.board-title h2 { font: 400 clamp(27px, 3.5vw, 53px)/1 var(--font-display); letter-spacing: -.055em; }
[data-ready-board] h2 { font-size: clamp(32px, min(5vw, 7dvh), 64px); }
.board-title > span, .board-columns, .driver-entry label {
  font: 500 11px/1.3 var(--font-sans); letter-spacing: .12em; text-transform: uppercase;
}
.board-title > span { color: #b4eeee; white-space: nowrap; }
.board-columns, .scoreboard li {
  display: grid; grid-template-columns: clamp(42px, 4vw, 65px) minmax(0, 1fr) max-content; column-gap: 8px; align-items: baseline;
}
.board-columns { margin-top: 1.3em; padding-bottom: 5px; border-bottom: 1px solid #b1dbdc55; color: #dae8e9; }
.scoreboard li { padding: .32em 0; border-bottom: 1px solid #c5ebee29; font-variant-numeric: tabular-nums; }
.scoreboard li span:first-child { color: #a7d6d8; font-size: .85em; }
.scoreboard li.vacant { color: #b0c1c4; }
.scoreboard li span:nth-child(2) { overflow-wrap: anywhere; }
.scoreboard li:first-child:not(.vacant) span:last-child { color: #a9f6ec; }
.scoreboard ol { list-style: none; max-height: var(--rows); overflow: auto; scrollbar-width: thin; }
.scoreboard [data-board-message]:not(:empty) { padding: .8em 0; }
.scoreboard p:empty, .scoreboard ol:empty { display: none; }
.driver-entry { margin-top: .9em; }
.driver-entry label { display: block; margin-bottom: 5px; color: #e0eded; }
.driver-entry > div { display: flex; border: 1px solid #a6c4c58a; border-radius: 5px; overflow: hidden; background: #05131ab8; }
.driver-entry > div:focus-within { outline: 2px solid #9fe2df; outline-offset: 2px; }
.driver-entry input { flex: 1; min-width: 0; padding: 9px 12px; color: white; font: inherit; border: 0; background: transparent; outline: 0; user-select: text; }
.driver-entry input::placeholder { color: #c1ccce; }
.driver-entry button { padding: 0 1.15em; color: #baf7ef; font: 500 .9em var(--font-sans); background: #47656a55; }
.driver-entry [role="status"]:not(:empty) { margin-top: 6px; font-size: 13px; }
.drive-hint { display: none; }
[data-ready-board] .drive-hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 1em;
  margin-top: 1em; padding-top: .85em; border-top: 1px solid #b1dbdc50;
  font: 400 clamp(14px, 1.35vw, 19px)/1.6 var(--font-sans);
}
.drive-hint button { color: #d7fff7; text-align: left; }
kbd { font: 500 .93em var(--font-sans); border: 1px solid #dbeeed77; border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: #fff; }
[data-capsule] canvas { width: 34px; height: auto; vertical-align: middle; }
.pilot-dialog .power-title { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.power-title canvas { width: 40px; }
.pilot-dialog .power-title + dd { margin-left: 48px; }
@media (max-width: 767px) and (orientation: portrait) {
  [data-cover-board] { left: var(--edge); top: 54%; width: min(88vw, 480px); max-height: 29dvh; }
  [data-cover-board] .scoreboard { --pad: 12px 16px; --rows: 7dvh; }
  [data-ready-board] { width: 93vw; }

}
@media (max-height: 520px) and (orientation: landscape) {
  [data-cover-board] { top: 19%; max-height: 56dvh; }
  .scoreboard { --pad: 10px 16px; --rows: 12dvh; }
  [data-ready-board] { inset-block: max(46px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-bottom)); }
  [data-ready-board] .scoreboard { --pad: 8px 16px; --rows: 26dvh; font-size: 14px; }
  [data-ready-board] h2 { font-size: 25px; }
  [data-ready-board] .board-columns, [data-ready-board] .driver-entry { margin-top: 4px; }
  [data-ready-board] .drive-hint { margin-top: 5px; padding-top: 3px; }
  [data-ready-board] .drive-hint canvas { width: 24px; }
  [data-ready-board] .driver-entry input { padding-block: 5px; }
  [data-ready-board] [data-board-message]:not(:empty) { padding-block: 3px; }
  [data-ready-board] button.start-run { padding-block: 4px; margin-top: 4px; }
}

.garage { width: min(94vw, 820px); padding: clamp(16px, 3vw, 30px); background: #10191e; }
.garage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.garage-head h2 { margin: 0; letter-spacing: -.04em; }
.garage-head form { float: none; }
.garage-stage { position: relative; overflow: hidden; border-radius: 6px; border: 1px solid #53656e;
  background: radial-gradient(ellipse at 42% 42%, #41565f, transparent 70%),
    linear-gradient(180deg, #1a2a31 0%, #233840 68%, #58656a 69%, #273338 79%, #172126); }
.garage-finish { display: flex; gap: .75em; align-items: baseline; padding: 14px 18px 0; color: #ebf4f3; }
.garage-finish strong { font: 400 clamp(22px, 3vw, 34px)/1 var(--font-display); letter-spacing: -.04em; }
.garage-finish span { font-size: 13px; color: #c4d2d3; }
.garage-stage canvas { display: block; width: 100%; }
.garage fieldset { margin-top: 16px; min-width: 0; }
.garage legend { padding-bottom: 7px; color: #cbd9db; font: 500 12px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; }
.garage-models { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.garage-models button { border: 1px solid #53636b; border-radius: 4px; background: #19252b; padding: 6px 1px; color: #cfdbdf; font: 400 clamp(11px, 1.4vw, 14px) var(--font-display); }
.garage-models canvas { display: block; width: 100%; margin-bottom: 3px; }
.garage-models button[aria-pressed="true"] { border-color: #9de3db; background: #233739; color: #fff; box-shadow: inset 0 -2px #9de3db; }
.garage-paints { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.garage-paints button { position: relative; height: 34px; border-radius: 4px; border: 1px solid #b6c4ca77; background: linear-gradient(170deg, #fff5, transparent 48%, #0003), var(--swatch); }
.garage-paints button[data-paint="matteBlack"] { background: var(--swatch); }
.garage-paints button[aria-pressed="true"] { outline: 2px solid #e8fbfa; outline-offset: 2px; }
.garage-paints button[aria-pressed="true"]::after { content: '✓'; color: white; text-shadow: 0 1px 3px #000; }
.garage button:focus-visible { outline: 2px dashed white; outline-offset: 3px; }
@media (max-width: 520px) {
  .garage-models { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .garage-paints { grid-template-columns: repeat(5,1fr); }
}

.board-scroll { display: grid; grid-template-columns: minmax(0,1fr) 18px; column-gap: 8px; position: relative; }
.board-columns { padding-right: 26px; }
.board-scroll ol { grid-column: 1; scrollbar-width: none; overscroll-behavior: contain; }
.board-scroll ol::-webkit-scrollbar { display: none; }
.board-scrollbar {
  position: absolute; inset: 0 0 0 auto; height: 100%; width: 18px; margin: 0;
  writing-mode: vertical-lr; direction: ltr; appearance: none; background: transparent;
  cursor: pointer; touch-action: none;
}
.board-scrollbar::-webkit-slider-runnable-track { width: 5px; background: #baded55e; border-radius: 6px; }
.board-scrollbar::-webkit-slider-thumb { appearance: none; width: 9px; height: 18px; margin-left: -2px; border-radius: 5px; background: #b6f1e7; }
.board-scrollbar::-moz-range-track { width: 5px; background: #baded55e; border-radius: 6px; }
.board-scrollbar::-moz-range-thumb { width: 9px; height: 18px; border: 0; border-radius: 5px; background: #b6f1e7; }
.garage-models { grid-template-columns: repeat(4,minmax(0,1fr)); }
.garage-paints { grid-template-columns: repeat(12,1fr); }
.roof-toggle { position: absolute; top: 10px; right: 12px; padding: 6px 11px; border: 1px solid #a7d2d7;
  border-radius: 6px; color: #eefbff; background: #112932e8; font: 500 14px/1.2 var(--font-sans); }
.roof-toggle small { display: block; color: #a6e2d9; margin: 1px 0 0; font-size: 11px; }
@media (max-width: 520px) {
  .garage-models { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .garage-paints { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .garage-stage:has(.roof-toggle:not([hidden])) .garage-finish { padding-right: 100px; }
}

.start-run, .scoreboard .ranked-result { display: none; }
[data-ready-board] .start-run {
  display: block; align-self: center; margin: .65em 0 0; padding: .55em 1.4em;
  border: 1px solid #a9e4de99; border-radius: 5px; background: #294b54; color: #eefffa;
  font: 500 clamp(15px, 1.5vw, 21px)/1.3 var(--font-display);
}
[data-ready-board] .start-run:hover { background: #355e65; }
[data-finish-board] {
  position: absolute; left: max(var(--edge), 3vw); top: 14%; width: min(46vw, 620px);
  max-height: 56dvh; overflow: auto; pointer-events: auto; scrollbar-width: thin;
}
[data-finish-board] .scoreboard { --rows: 19dvh; background: linear-gradient(110deg,#09151eea,#102129ca); }
[data-finish-board] .ranked-result:not(:empty) {
  display: block; position: static; margin-top: .65em; color: #b9f4e9; font: 500 .97em/1.3 var(--font-display);
}
.finished-driver { background: #375b61; box-shadow: inset 2px 0 #acfff0; }
.finished-driver span:first-child { padding-left: 6px; }
.game[data-status="busted"] .flight-panel { visibility: hidden; }

@media (max-width: 767px) and (orientation: portrait) {
  .busted { overflow-y: auto; }
  [data-finish-board] {
    top: max(65px, 9dvh); left: 4vw; width: 92vw; max-height: 49dvh;
  }
  [data-finish-board] .scoreboard { --pad: 12px 16px; --rows: 13dvh; }
  .busted__title { left: 4vw; bottom: auto; top: 61%; }
  .busted__title .lockup__sm { font-size: 12px; }
  .busted__title .lockup__lg { font-size: clamp(36px,11vw,64px); }
  .busted__ring { --u: min(.39px,.06dvh); left: calc(79% - var(--u)*305); top: calc(66% - var(--u)*305); }
  .busted__stats { top: 78%; grid-template-columns: repeat(4,1fr); gap: 4px; }
  .busted__best { top: 89%; }
}
@media (max-height: 520px) and (orientation: landscape) {
  [data-finish-board] { top: 17%; max-height: 61dvh; }
  [data-finish-board] .scoreboard { --rows: 14dvh; --pad: 8px 14px; }
}

.exit-dialog { width: min(90vw, 390px); }
.exit-dialog h2 { margin-bottom: 10px; }
.exit-dialog p { color: #c6d5da; }
.exit-dialog form { display: flex; gap: 10px; float: none; margin-top: 23px; }
.exit-dialog form button { min-height: 40px; }
.exit-dialog .exit-run { background: #28373e; color: #dce6e9; }
.exit-dialog button:focus-visible { outline: 2px solid #a4e9df; outline-offset: 3px; }
body:has(.exit-dialog[open]) .pause-note { visibility: hidden; }

.studio-identity { display: flex; align-items: center; gap: 8px; }
.legal-links { display: grid; font: 500 12px/1.3 var(--font-sans); }
.legal-links a { width: fit-content; color: #eef6f7; padding: 3px 6px; background: #0d1b20de; border-radius: 3px; text-underline-offset: 2px; }
.legal-links a:focus-visible { outline: 2px solid white; }
.driver-entry label small { font-size: .86em; letter-spacing: normal; text-transform: none; }

.studio-credit { display: inline-flex; align-items: baseline; gap: .4em; color: #daeaeb; font: 500 11px/1.1 var(--font-sans); letter-spacing: .02em; text-transform: none; white-space: nowrap; }
.studio-credit img { display: block; width: auto; height: .74em; height: 1cap; }
.menu-legal { display: flex; gap: 14px; margin-top: 18px; }
.menu-legal a { padding: 4px 0; background: transparent; }
.hero-legal {
  position: absolute; z-index: 3;
  right: max(var(--edge), env(safe-area-inset-right)); bottom: max(5px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.hero-legal a { padding: 6px 0; color: #bfccd2; text-decoration: none; background: transparent; text-shadow: 0 1px 4px #000; }
.hero-legal a:hover, .hero-legal a:focus-visible { color: white; }
.is-launch .hero-legal { visibility: hidden; }
.titles .studio-credit { font-size: 13px; position: absolute; left: calc(100% + var(--f21)); bottom: .15em; }
@media (max-width: 980px) {
  .hero .titles { right: max(var(--edge), env(safe-area-inset-right)); bottom: calc(max(5px, env(safe-area-inset-bottom)) + 34px); }
  .titles .studio-credit { position: static; justify-self: end; margin-top: 8px; }
}
.preflight-credit { display: none; }
[data-ready-board] .preflight-credit { display: block; margin-bottom: 5px; line-height: 1; }
.exit-dialog > .studio-credit { margin-bottom: 12px; }
@media (max-height: 520px) and (orientation: landscape) {
  [data-ready-board] .preflight-credit { align-self: end; position: absolute; margin: 0 0 0 auto; transform: translateY(-100%); }
}

.referral-dialog {
  width: min(1120px, calc(100vw - 12px), calc((100dvh - 12px) * 16 / 9));
  max-width: none; max-height: none; aspect-ratio: 16 / 9; overflow: hidden;
  margin: auto; padding: 0; border: 0; border-radius: 8px;
  background: #081018; color: #f3f6f8; font: 500 14px/1.3 var(--font-sans);
}
.referral-dialog::backdrop { background: #060e13ed; }
.has-cursor .referral-dialog, .has-cursor .referral-dialog * { cursor: auto !important; }
.has-cursor .referral-dialog :is(a,button:enabled) { cursor: pointer !important; }
.referral-video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.referral-video[hidden] { display: none; }
.referral-continue, .referral-play {
  position: absolute; border: 1px solid #ffffff45; border-radius: 5px; padding: 8px 11px;
  background: #0a1520b3; color: #f4f7fa; font: inherit; font-variant-numeric: tabular-nums;
}
.referral-continue { top: clamp(5px,1.3vw,16px); right: clamp(6px,1.3vw,16px); }
.referral-continue:disabled { color: #c4cdd5; }
.referral-play { top: 50%; left: 50%; transform: translate(-50%,-50%); }
.referral-fallback { position: absolute; inset: 24% 10%; align-content: center; text-align: center; }
.referral-footer {
  position: absolute; bottom: 4px; left: 0; right: 0; padding: 0 clamp(8px,1.4vw,18px);
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
.referral-footer a { pointer-events: auto; padding: 6px 0; color: #dceafb; font-size: clamp(11px,1.3vw,13px); text-decoration: none; text-shadow: 0 1px 4px #000; }
.referral-progress { position: absolute; inset: auto 0 0; height: 3px; background: #ffffff24; pointer-events: none; }
.referral-progress span { display: block; height: 100%; background: #8cbcff; transform-origin: left; transform: scaleX(0); }
.referral-dialog :is(a,button):focus-visible { outline: 2px solid #a4d3ff; outline-offset: -2px; }
.referral-status { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }

.script-notice {
  position: fixed; z-index: 20; top: 1rem; left: 50%; transform: translateX(-50%);
  width: min(90%, 36rem); padding: 1em; background: #10262c; color: white;
}
