/* v18 Mission Control: black, white, safety orange, telemetry. Tokens + the parts every page shares. */
:root {
  --void: #000;
  --deck: #0b0b0b;
  --deck-2: #141414;
  --white: #f5f5f2;
  --white-dim: rgba(245, 245, 242, .66);
  --white-faint: rgba(245, 245, 242, .32);
  --line: rgba(245, 245, 242, .14);
  --line-hi: rgba(245, 245, 242, .3);
  --orange: #ff5b14;
  --orange-hi: #ff7a3d;
  --orange-glow: rgba(255, 91, 20, .42);
  --go: #3ee07c;
  --go-glow: rgba(62, 224, 124, .4);
  --hold: #ffb21a;
  --din: "DIN Condensed", "Avenir Next Condensed", "Helvetica Neue", "Arial Narrow", system-ui, sans-serif;
  --num: "DIN Alternate", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", "SFMono-Regular", Menlo, "Andale Mono", ui-monospace, monospace;
  --sans: "Avenir Next", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .1, 1);
  --snap: cubic-bezier(.3, 1.4, .5, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --gut: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--void); color: var(--white); }
body { font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
em { font-style: normal; }

/* ---- the stage: the engine's canvas, full bleed ---- */
.stage { position: fixed; inset: 0; z-index: 1; }
.stage.is-off { visibility: hidden; }

/* ---- the pages layer ---- */
.screen { position: fixed; inset: 0; z-index: 10; overflow-x: clip; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.is-empty { pointer-events: none; }
.page { min-height: 100%; position: relative; overflow-x: clip; }
.page.is-leaving { animation: leave .26s ease-in both; }
@keyframes leave { to { opacity: 0; transform: translateY(-10px); } }

/* the console backdrop on every non-play page: a fine grid, a vignette */
.deck {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 91, 20, .07), transparent 55%),
    linear-gradient(rgba(245, 245, 242, .035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(245, 245, 242, .035) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--void);
}

/* ---- small type parts ---- */
.kicker { display: inline-flex; align-items: center; gap: 9px; font: 600 11.5px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--orange); }
.kicker__sq { width: 8px; height: 8px; background: var(--orange); flex: none; animation: blink 1.6s steps(2, jump-none) infinite; }
.kicker--w { color: var(--white-dim); }
@keyframes blink { 50% { opacity: .2; } }
.mono { font-family: var(--mono); }
.dim { color: var(--white-faint); }

/* corner brackets around a screen or a card */
.frame { position: absolute; inset: calc(10px + var(--sat)) 10px calc(10px + var(--sab)); pointer-events: none; }
.frame i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--white-faint); }
.frame i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
.frame i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* hazard tape */
.tape { height: 8px; background: repeating-linear-gradient(-45deg, var(--orange) 0 10px, #000 10px 20px); }

/* ---- the one forward button ---- */
.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; overflow: hidden;
  min-height: 60px; width: 100%; max-width: 420px; padding: 4px 26px 0; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--orange); color: #000; font: 700 22px/1 var(--din); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 122, 61, .6), 0 16px 40px -14px var(--orange-glow);
  transition: transform .16s var(--ease), background .2s, opacity .3s, color .2s;
}
.cta::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.cta.is-ready::before { animation: sweep 2.6s var(--ease) .3s infinite; }
@keyframes sweep { 0% { transform: translateX(-120%); } 40%, 100% { transform: translateX(120%); } }
.cta:hover:not([disabled]) { background: var(--orange-hi); }
.cta:active:not([disabled]) { transform: scale(.97); }
.cta .go { font-size: 15px; transform: translateY(-2px); }
.cta[disabled] { cursor: default; background: transparent; color: var(--white-dim); box-shadow: inset 0 0 0 1px var(--line-hi); }
.cta.is-arming[disabled] { background: var(--orange); color: #000; opacity: .55; box-shadow: none; }
.cta.is-tapped { transform: scale(.96); background: var(--white); }
.cta--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--white-faint); }

/* the loading spinner on the first button */
.spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-hi); border-top-color: var(--orange); animation: turn .8s linear infinite; transform: translateY(-2px); }
.cta[disabled] .spin { display: inline-block; }
@keyframes turn { to { transform: translateY(-2px) rotate(360deg); } }

/* ---- the quiet buttons (never data-cta) ---- */
.mute {
  position: fixed; z-index: 60; top: calc(10px + var(--sat)); right: 10px; width: 46px; height: 46px; border-radius: 4px;
  border: 1px solid var(--line-hi); background: rgba(0, 0, 0, .62); color: var(--white-dim); display: grid; place-items: center; cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s;
}
.mute:active { transform: scale(.92); }
.mute .mute__off { display: none; }
.mute[aria-pressed="true"] { color: var(--orange); border-color: var(--orange); }
.mute[aria-pressed="true"] .mute__on { display: none; }
.mute[aria-pressed="true"] .mute__off { display: inline; }
body[data-phase="results"] .mute { display: none; }

/* entrance helper: children marked .in rise in one after another (opacity + translate only, never scale on tap targets) */
.in { animation: rise .5s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
