/* SPACECAT Rhetoric Rush — free web demo.
   Own cloned palette (the product's cosmic arcade: deep space, signal cyan, star cream,
   caution gold, mission violet) — deliberately NOT the site's navy/cyan main.css tokens,
   the same way timestamp/ and geodetective/ carry their own skins. */

:root {
  --space: #060416;
  --space-2: #0b0824;
  --panel: rgba(19, 16, 58, 0.72);
  --panel-solid: #131040;
  --cyan: #4df4ff;
  --cyan-dim: #2cc4d4;
  --cream: #fff6df;
  --gold: #ffd166;
  --violet: #9b6cff;
  --pink: #ff5e8a;
  --ink: #0a0620;
  --body-text: #d9d4ef;
  --muted: #8f89b8;
  --line: rgba(77, 244, 255, 0.16);
  --line-strong: rgba(77, 244, 255, 0.34);
  --glow-cyan: 0 0 26px rgba(77, 244, 255, 0.35);
  --glow-gold: 0 0 26px rgba(255, 209, 102, 0.35);
  --f-head: "Orbitron", "Inter", sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-passage: Georgia, "Times New Roman", serif;
  --maxw: 1080px;
  --r: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* An author display (flex/grid) silently BEATS the hidden attribute's UA display:none —
   the chain board shipped visible on every SPACE question exactly this way. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--space);
  color: var(--body-text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Layered starfield — pure CSS, no canvas, nothing for a Chromebook to churn on. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 246, 223, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 74%, rgba(255, 246, 223, 0.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 56% 16%, rgba(77, 244, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 58%, rgba(255, 246, 223, 0.65) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 82% 32%, rgba(255, 209, 102, 0.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 81%, rgba(255, 246, 223, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 51%, rgba(155, 108, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 89%, rgba(255, 246, 223, 0.45) 50%, transparent 51%),
    radial-gradient(ellipse 80% 55% at 70% 0%, rgba(155, 108, 255, 0.14), transparent 62%),
    radial-gradient(ellipse 65% 45% at 8% 100%, rgba(77, 244, 255, 0.1), transparent 60%),
    linear-gradient(180deg, #08051d 0%, var(--space) 45%, #0a0620 100%);
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat,
    no-repeat, no-repeat, no-repeat;
  background-size: 520px 520px, 480px 480px, 610px 610px, 540px 540px, 700px 700px,
    650px 650px, 570px 570px, 620px 620px, auto, auto, auto;
  animation: drift 240s linear infinite;
}

/* A whisper of CRT — the product's texture, at an opacity that never fights the text. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
}

@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: -520px 260px, 480px -240px, -305px -610px, 540px 270px,
    -350px 700px, 325px -325px, -570px 285px, 310px 620px, 0 0, 0 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--gold); color: var(--ink); padding: 10px 16px;
  border-radius: var(--r); font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ------------------------------------------------------------ masthead */

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 4, 22, 0.75);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.mast-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.mast-brand img { display: block; }
.mast-mark {
  margin: 0; font-family: var(--f-head); font-size: 0.72rem; letter-spacing: 0.22em;
  color: var(--cyan);
}

/* -------------------------------------------------------------- shared */

main { position: relative; z-index: 1; }

.screen { max-width: var(--maxw); margin: 0 auto; padding: clamp(18px, 4vw, 40px); }
.screen[hidden] { display: none; }

.kicker {
  margin: 0 0 6px; font-family: var(--f-head); font-size: 0.72rem;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold);
}
.kicker__tag {
  margin-left: 10px; letter-spacing: 0.08em; text-transform: none;
  color: var(--muted); font-family: var(--f-body); font-size: 0.78rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-head); font-weight: 700; font-size: 0.92rem;
  padding: 13px 24px; border-radius: var(--r); cursor: pointer;
  text-decoration: none; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn--gold {
  background: linear-gradient(135deg, var(--gold), #ffb74d);
  color: var(--ink); box-shadow: var(--glow-gold);
}
.btn--gold:hover { box-shadow: 0 0 34px rgba(255, 209, 102, 0.55); transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--cream); border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow-cyan); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* --------------------------------------------------------------- entry */

.hero {
  position: relative; border-radius: calc(var(--r) * 1.6); overflow: hidden;
  border: 1px solid var(--line-strong);
  min-height: 480px; display: flex; align-items: flex-end;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.hero__art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 40%;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(182deg, rgba(6, 4, 22, 0.05) 20%, rgba(6, 4, 22, 0.82) 62%, rgba(6, 4, 22, 0.96) 100%);
}
.hero__body { position: relative; padding: clamp(20px, 4vw, 44px); max-width: 640px; }
.wordmark {
  margin: 0; font-family: var(--f-head); font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 4.4rem); letter-spacing: 0.08em; line-height: 1;
  color: var(--cream);
  text-shadow: 0 0 30px rgba(77, 244, 255, 0.55), 0 4px 24px rgba(0, 0, 0, 0.6);
}
.hero__sub {
  margin: 4px 0 14px; font-family: var(--f-head); font-weight: 500;
  font-size: clamp(0.9rem, 2.4vw, 1.25rem); letter-spacing: 0.55em; color: var(--cyan);
}
.hero__lede { margin: 0 0 18px; font-size: 1.02rem; color: var(--body-text); }
.hero__lede strong { color: var(--cream); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hero__note { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.hero__pitch {
  margin: 0; font-size: 0.9rem; color: var(--body-text);
  border-left: 3px solid var(--gold); padding-left: 12px;
}
.hero__pitch strong { color: var(--cream); }
.hero__credit {
  position: absolute; right: 14px; top: 12px; margin: 0;
  font-size: 0.7rem; color: rgba(255, 246, 223, 0.55);
  background: rgba(6, 4, 22, 0.5); padding: 3px 9px; border-radius: 999px;
}

.entry-rail {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px;
}
.rail-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start;
}
.rail-card p { margin: 0; font-size: 0.9rem; }
.rail-card strong { color: var(--cream); }
.rail-num {
  font-family: var(--f-head); font-weight: 700; color: var(--cyan);
  font-size: 0.85rem; padding-top: 2px;
}

/* ------------------------------------------------------------ briefing */

.dossier { max-width: 820px; margin: 0 auto; }
.dossier__head { margin-bottom: 20px; }
.dossier__title {
  margin: 0 0 10px; font-family: var(--f-head); font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.3rem); color: var(--cream); letter-spacing: 0.03em;
}
.dossier__brief { margin: 0 0 14px; font-size: 1rem; }
.dossier__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dossier__chips li {
  font-family: var(--f-head); font-size: 0.68rem; letter-spacing: 0.14em;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--cyan); background: rgba(77, 244, 255, 0.06);
}

.passage {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: calc(var(--r) * 1.4); padding: clamp(18px, 3.6vw, 34px);
}
.passage__head {
  margin: 0 0 14px; font-family: var(--f-head); font-size: 0.78rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
}
.passage__head span { color: var(--muted); letter-spacing: 0.04em; text-transform: none; font-family: var(--f-body); }
.passage p {
  font-family: var(--f-passage); font-size: 1.05rem; line-height: 1.75;
  color: var(--cream); margin: 0 0 1em; position: relative; padding-left: 34px;
}
.passage p:last-child { margin-bottom: 0; }
.passage p .pnum {
  position: absolute; left: 0; top: 0.35em;
  font-family: var(--f-head); font-size: 0.62rem; color: var(--violet);
}
.dossier__go { margin-top: 20px; }
.dossier__hint { margin: 10px 0 0; text-align: center; font-size: 0.82rem; color: var(--muted); }

/* ----------------------------------------------------------------- hud */

.hud {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 16px; margin-bottom: 16px;
  position: sticky; top: 62px; z-index: 40; backdrop-filter: blur(8px);
}
.hud__phase {
  margin: 0; font-family: var(--f-head); font-size: 0.7rem;
  letter-spacing: 0.18em; color: var(--gold); white-space: nowrap;
}
.progress-strip { display: flex; gap: 5px; flex: 1; min-width: 120px; }
.progress-strip i {
  flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 246, 223, 0.12);
}
.progress-strip i.done { background: var(--cyan); box-shadow: 0 0 8px rgba(77, 244, 255, 0.6); }
.progress-strip i.missed { background: var(--pink); }
.progress-strip i.now { background: var(--gold); box-shadow: 0 0 8px rgba(255, 209, 102, 0.7); }
.hud__meters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hud__chip {
  font-family: var(--f-head); font-size: 0.8rem; color: var(--cream);
  background: rgba(255, 246, 223, 0.06); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}
.hud__chip b { color: var(--gold); font-weight: 700; }
.hud__chip--combo { border-color: rgba(255, 94, 138, 0.5); }
.hud__integrity { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; }
.hud__integrityLabel { font-family: var(--f-head); letter-spacing: 0.14em; color: var(--muted); }
.hud__integrityTrack {
  width: 74px; height: 6px; border-radius: 4px; overflow: hidden;
  background: rgba(255, 246, 223, 0.12); display: inline-block;
}
.hud__integrityTrack i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.5s var(--ease);
}
.hud__integrity b { color: var(--cyan); font-family: var(--f-head); font-size: 0.78rem; }

/* --------------------------------------------------------------- qcard */

.qwrap { max-width: 860px; margin: 0 auto; }

.passage-toggle {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--body-text); font-family: var(--f-body); font-size: 0.84rem;
  padding: 7px 16px; cursor: pointer;
}
.passage-toggle:hover, .passage-toggle[aria-expanded="true"] {
  border-color: var(--cyan); color: var(--cyan);
}
.passage-panel {
  margin-bottom: 14px; border: 1px solid var(--line-strong);
  border-radius: var(--r); background: rgba(13, 10, 38, 0.92);
}
.passage-panel__scroll { max-height: 300px; overflow-y: auto; padding: 18px 22px; }
.passage-panel__scroll p {
  font-family: var(--f-passage); font-size: 0.98rem; line-height: 1.7;
  color: var(--cream); margin: 0 0 0.9em; position: relative; padding-left: 30px;
}
.passage-panel__scroll .pnum {
  position: absolute; left: 0; top: 0.3em;
  font-family: var(--f-head); font-size: 0.6rem; color: var(--violet);
}

.qcard {
  display: flex; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: calc(var(--r) * 1.4); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: cardIn 0.45s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.qcard__rail {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 14px; min-width: 84px;
  background: linear-gradient(180deg, rgba(155, 108, 255, 0.16), rgba(77, 244, 255, 0.08));
  border-right: 1px solid var(--line);
}
.qcard__letter {
  font-family: var(--f-head); font-weight: 900; font-size: 2rem; line-height: 1;
  color: var(--cyan); text-shadow: 0 0 18px rgba(77, 244, 255, 0.7);
}
.qcard__term {
  font-family: var(--f-head); font-size: 0.6rem; letter-spacing: 0.16em;
  color: var(--cream); writing-mode: vertical-rl; text-orientation: mixed;
}
.qcard__body { padding: clamp(18px, 3.4vw, 30px); flex: 1; min-width: 0; }
.qcard__chain {
  margin: 0 0 8px; font-family: var(--f-head); font-size: 0.68rem;
  letter-spacing: 0.18em; color: var(--violet);
}
.chain-board {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px;
}
.chain-slot {
  font-family: var(--f-head); font-size: 0.62rem; letter-spacing: 0.14em;
  border: 1px dashed var(--line-strong); color: var(--muted);
  border-radius: 6px; padding: 5px 10px;
}
.chain-slot.filled {
  border-style: solid; border-color: var(--cyan); color: var(--cyan);
  background: rgba(77, 244, 255, 0.08);
}
.chain-slot.now { border-style: solid; border-color: var(--gold); color: var(--gold); }
.chain-arrow { color: var(--muted); font-size: 0.8rem; }
.evidence {
  margin: 0 0 16px; padding: 14px 18px; border-left: 3px solid var(--gold);
  background: rgba(255, 209, 102, 0.06); border-radius: 0 var(--r) var(--r) 0;
}
.evidence__tag {
  margin: 0 0 6px; font-family: var(--f-head); font-size: 0.6rem;
  letter-spacing: 0.22em; color: var(--gold);
}
.evidence p:not(.evidence__tag) {
  margin: 0; font-family: var(--f-passage); font-size: 0.98rem;
  line-height: 1.65; color: var(--cream);
}
.qcard__prompt {
  margin: 0 0 6px; font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  color: var(--cream); line-height: 1.35; font-weight: 600;
}
.qcard__instruction { margin: 0 0 18px; font-size: 0.88rem; color: var(--muted); }

.options { display: grid; gap: 10px; }
.option {
  text-align: left; width: 100%; cursor: pointer;
  background: rgba(255, 246, 223, 0.04); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 16px 13px 46px; position: relative;
  color: var(--body-text); font-family: var(--f-body); font-size: 0.95rem; line-height: 1.5;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease);
}
.option::before {
  content: attr(data-key); position: absolute; left: 14px; top: 12px;
  font-family: var(--f-head); font-size: 0.72rem; color: var(--cyan);
  border: 1px solid var(--line-strong); border-radius: 6px;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
}
.option:hover:not(:disabled) {
  border-color: var(--cyan); background: rgba(77, 244, 255, 0.07);
  transform: translateX(3px);
}
.option:disabled { cursor: not-allowed; }
.option.wrong {
  border-color: rgba(255, 94, 138, 0.65); background: rgba(255, 94, 138, 0.08);
  color: var(--muted); animation: shake 0.4s var(--ease);
}
.option.wrong::before { color: var(--pink); border-color: rgba(255, 94, 138, 0.65); content: "✕"; }
.option.right {
  border-color: var(--cyan); background: rgba(77, 244, 255, 0.1); color: var(--cream);
  box-shadow: var(--glow-cyan);
}
.option.right::before { color: var(--ink); background: var(--cyan); border-color: var(--cyan); content: "✓"; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
}
.qcard__wrong {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r);
  border: 1px solid rgba(255, 94, 138, 0.4); background: rgba(255, 94, 138, 0.07);
  font-size: 0.9rem; color: var(--body-text);
}
.qcard__wrong strong { color: var(--pink); }

/* -------------------------------------------------------------- flight
   The paid product's flight chrome, lifted from its Index.html <style> block
   (fonts, HUD stats, echo bank, power chips, juice pops, prompt, countdown,
   route track). Class names and values kept verbatim where possible. */

@font-face {
  font-family: "Kenney Future";
  src: url("assets/kenney-future.ttf") format("truetype");
  font-display: swap;
}

.screen--flight {
  max-width: 1080px;
  --display: "Kenney Future", "Arial Narrow", system-ui, sans-serif;
  --void: #060416; --magenta: #ff4fd8; --amber: #ffd36a; --good: #65ffc6;
  --fmuted: #aaa7c8; --fline: rgba(127, 227, 255, 0.22);
}

.flight-constellation { display: flex; justify-content: center; gap: 6px; }
.flight-constellation span {
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%;
  color: #77738e; font-family: var(--display); font-size: 0.5rem;
}
.flight-constellation span.lit { border-color: var(--amber); background: var(--amber); color: var(--void); box-shadow: 0 0 12px rgba(255, 211, 106, 0.45); }

.flight-hud {
  display: grid; grid-template-columns: 1.4fr repeat(3, 0.6fr) auto; align-items: center;
  gap: 8px; min-height: 58px; padding: 10px 20px;
  border: 1px solid var(--fline); border-bottom: 0;
  border-radius: calc(var(--r) * 1.4) calc(var(--r) * 1.4) 0 0;
  background: rgba(6, 5, 25, 0.9); backdrop-filter: blur(14px);
}
.hud-biome { display: flex; flex-direction: column; }
.hud-biome small { color: var(--fmuted); font-family: var(--display); font-size: 0.42rem; letter-spacing: 0.08em; }
.hud-biome b { margin-top: 4px; color: var(--amber); font-family: var(--display); font-size: 0.53rem; line-height: 1.25; }
.hud-stat { position: relative; overflow: hidden; padding-left: 12px; border-left: 1px solid var(--fline); }
.hud-stat small { display: block; color: var(--fmuted); font-family: var(--display); font-size: 0.48rem; letter-spacing: 0.1em; }
.hud-stat b { display: inline-block; color: var(--cream); font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 0.9rem; transition: transform 0.24s, color 0.24s; }
.hud-stat.integrity b { color: var(--good); }
.hud-stat.flash-up b { color: var(--amber); transform: scale(1.18); }
.hud-stat.flash-down b { color: var(--pink); transform: scale(1.12); }
.hud-stat.flash-up:after, .hud-stat.flash-down:after {
  content: ""; position: absolute; inset: 0 auto 0 -55%; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  animation: hudShimmer 0.82s ease-out;
}
@keyframes hudShimmer { to { left: 115%; } }

.canvas-wrap {
  position: relative; overflow: hidden; background: #080621;
  border: 1px solid var(--fline);
}
#gameCanvas { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; cursor: pointer; touch-action: none; }
.canvas-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.75); }
.canvas-wrap.slowfield-active .canvas-vignette { box-shadow: inset 0 0 105px rgba(105, 64, 196, 0.38), inset 0 0 32px rgba(185, 140, 255, 0.22); }
.canvas-wrap.magnet-active { outline: 1px solid rgba(255, 211, 106, 0.3); outline-offset: -2px; }

.mission-toast {
  position: absolute; top: 18px; left: 50%; z-index: 3; max-width: min(620px, 80%); margin: 0;
  padding: 0.75rem 1rem; border: 1px solid var(--fline); border-radius: 9px;
  background: rgba(7, 5, 28, 0.85); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  opacity: 0; transform: translate(-50%, -15px); transition: 0.25s ease;
  text-align: center; font-size: 0.74rem; color: var(--cream); pointer-events: none;
}
.mission-toast.visible { opacity: 1; transform: translate(-50%, 0); }

.echo-bank {
  position: absolute; right: 18px; top: 18px; z-index: 3; display: flex; gap: 10px;
  align-items: center; padding: 8px 10px; border: 1px solid rgba(77, 244, 255, 0.28);
  border-radius: 10px; background: rgba(6, 5, 28, 0.72); backdrop-filter: blur(6px);
}
.echo-bank > span { color: var(--fmuted); font-family: var(--display); font-size: 0.42rem; letter-spacing: 0.08em; }
.echo-bank > div { display: flex; gap: 5px; }
.echo-bank i {
  display: grid; place-items: center; width: 25px; height: 25px;
  border: 1px dashed rgba(255, 255, 255, 0.24); border-radius: 7px;
  color: #77738e; font-family: var(--display); font-size: 0.44rem; font-style: normal;
}
.echo-bank i.scanned { border-style: solid; border-color: var(--cyan); background: rgba(77, 244, 255, 0.13); color: var(--cyan); box-shadow: 0 0 12px rgba(77, 244, 255, 0.25); }

.power-hud { position: absolute; right: 18px; top: 76px; z-index: 6; display: grid; gap: 7px; width: min(330px, 42%); }
.power-chip {
  position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center;
  overflow: hidden; padding: 9px 11px; border: 1px solid var(--power-color, var(--good));
  border-radius: 10px; background: rgba(5, 31, 42, 0.93);
  box-shadow: 0 0 22px color-mix(in srgb, var(--power-color, var(--good)) 18%, transparent);
}
.power-chip > i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--power-color, var(--good)) 15%, transparent); color: var(--power-color, var(--good)); font-family: var(--display); font-size: 0.72rem; font-style: normal; }
.power-chip > div { min-width: 0; }
.power-chip b { display: block; color: #fff; font-family: var(--display); font-size: 0.46rem; letter-spacing: 0.08em; }
.power-chip small { display: block; margin-top: 4px; color: #d4d2df; font-size: 0.58rem; white-space: normal; }
.power-chip > em { position: absolute; left: 0; bottom: 0; width: var(--power-progress, 100%); height: 3px; background: var(--power-color, var(--good)); box-shadow: 0 0 9px var(--power-color, var(--good)); transition: width 1s linear; }
.power-chip.shield { --power-color: var(--good); }
.power-chip.magnet { --power-color: var(--amber); background: rgba(67, 47, 11, 0.94); }
.power-chip.slow { --power-color: #c7a4ff; background: rgba(42, 20, 79, 0.94); }

.power-announcement {
  position: absolute; z-index: 7; left: 50%; top: 17%; width: min(470px, 72%);
  padding: 13px 16px 13px 64px; border: 1px solid var(--power-color, var(--cyan)); border-radius: 12px;
  background: linear-gradient(105deg, rgba(6, 5, 28, 0.96), rgba(24, 17, 65, 0.93));
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.42), 0 0 32px color-mix(in srgb, var(--power-color, var(--cyan)) 28%, transparent);
  transform: translateX(-50%); animation: powerBannerIn 1.9s ease-out forwards;
}
.power-announcement:before {
  content: attr(data-icon); position: absolute; left: 15px; top: 50%; display: grid; place-items: center;
  width: 38px; height: 38px; border: 1px solid var(--power-color, var(--cyan)); border-radius: 50%;
  background: color-mix(in srgb, var(--power-color, var(--cyan)) 14%, transparent);
  color: var(--power-color, var(--cyan)); font-family: var(--display); font-size: 1rem;
  transform: translateY(-50%); box-shadow: 0 0 20px color-mix(in srgb, var(--power-color, var(--cyan)) 32%, transparent);
}
.power-announcement small { display: block; color: var(--power-color, var(--cyan)); font-family: var(--display); font-size: 0.42rem; letter-spacing: 0.13em; }
.power-announcement b { display: block; margin: 5px 0 3px; color: #fff; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.05em; }
.power-announcement span { color: #d7d3e6; font-size: 0.68rem; }
@keyframes powerBannerIn {
  0% { opacity: 0; transform: translate(-50%, -18px) scale(0.95); }
  12%, 78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(0.98); }
}

.juice-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.juice-pop {
  position: absolute; display: flex; flex-direction: column; align-items: center; min-width: 92px;
  color: #fff; text-align: center; text-shadow: 0 2px 10px #050419;
  transform: translate(-50%, -50%); animation: juiceRise 0.9s ease-out forwards;
}
.juice-pop b { font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.06em; }
.juice-pop small { margin-top: 4px; padding: 3px 6px; border-radius: 5px; background: rgba(5, 4, 25, 0.76); color: #fff; font-family: var(--display); font-size: 0.38rem; letter-spacing: 0.08em; }
.juice-pop.score b { color: var(--amber); filter: drop-shadow(0 0 9px rgba(255, 211, 106, 0.55)); }
.juice-pop.combo b { color: var(--good); filter: drop-shadow(0 0 9px rgba(101, 255, 198, 0.55)); }
.juice-pop.damage b { color: #ff8eaa; filter: drop-shadow(0 0 9px rgba(255, 102, 139, 0.5)); }
.juice-pop.power b { color: #fff; filter: drop-shadow(0 0 12px rgba(77, 244, 255, 0.65)); }
@keyframes juiceRise {
  0% { opacity: 0; transform: translate(-50%, -25%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.96); }
}

.flight-prompt {
  position: absolute; left: 20px; bottom: 20px; z-index: 4; display: flex; gap: 0.55rem; align-items: center;
  padding: 0.55rem 0.7rem; border: 1px solid var(--fline); border-radius: 9px;
  background: rgba(7, 5, 28, 0.78); font-family: var(--display); font-size: 0.46rem;
  letter-spacing: 0.06em; color: var(--cream); transition: opacity 0.3s;
}
.flight-prompt span { display: flex; gap: 0.35rem; align-items: center; }
.flight-prompt i { width: 1px; height: 20px; background: var(--fline); }
.flight-prompt > b { min-width: 66px; color: var(--cyan); font-size: 0.44rem; text-align: right; }
.flight-prompt kbd { padding: 3px 6px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px; background: rgba(255, 255, 255, 0.07); font-family: var(--display); font-size: 0.42rem; }
.flight-prompt.faded { opacity: 0.46; }
.flight-prompt.active, .canvas-wrap.thrust-active .flight-prompt { opacity: 1; border-color: var(--cyan); background: rgba(12, 73, 98, 0.9); box-shadow: 0 0 24px rgba(77, 244, 255, 0.28); color: #fff; }
.flight-prompt.active kbd { background: var(--cyan); color: var(--void); }
.canvas-wrap.dive-active .flight-prompt { border-color: var(--magenta); background: rgba(79, 31, 103, 0.9); box-shadow: 0 0 24px rgba(255, 79, 216, 0.24); }
.canvas-wrap.dive-active .flight-prompt > b { color: #ff9bea; }
.canvas-wrap.dive-active .flight-prompt.active kbd { background: #ff9bea; }

.countdown {
  position: absolute; inset: 0; z-index: 7; display: none; place-items: center;
  background: rgba(5, 4, 22, 0.32); color: var(--cream); font-family: var(--display);
  font-size: clamp(4rem, 15vw, 9rem); text-shadow: 0 0 34px var(--cyan);
}
.countdown.visible { display: grid; animation: countPop 0.65s ease; }
@keyframes countPop { 0% { transform: scale(0.55); opacity: 0; } 35% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

.touch-flight {
  display: none; position: absolute; right: 18px; width: 92px; height: 62px;
  border: 1px solid rgba(77, 244, 255, 0.5); border-radius: 16px;
  background: rgba(19, 103, 135, 0.68); color: #fff; touch-action: none; z-index: 5; cursor: pointer;
}
.touch-flight-up { bottom: 92px; }
.touch-flight-down { bottom: 20px; border-color: rgba(255, 79, 216, 0.55); background: rgba(111, 34, 113, 0.68); }
.touch-flight span { display: block; font-size: 1.05rem; }
.touch-flight b { font-family: var(--display); font-size: 0.44rem; letter-spacing: 0.08em; }
.touch-flight:active { transform: scale(0.96); filter: brightness(1.25); }
@media (pointer: coarse) { .touch-flight { display: block; } }

.flight-footer {
  display: grid; grid-template-columns: 1fr minmax(240px, 2fr) auto; gap: 16px; align-items: center;
  min-height: 42px; padding: 7px 18px; border: 1px solid var(--fline); border-top: 0;
  border-radius: 0 0 calc(var(--r) * 1.4) calc(var(--r) * 1.4);
  background: #090722; color: var(--fmuted); font-size: 0.62rem; font-family: var(--display);
}
.route-track { position: relative; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); }
.route-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--amber)); box-shadow: 0 0 10px rgba(77, 244, 255, 0.45); }
.route-track i { position: absolute; top: 50%; width: 11px; height: 11px; border: 2px solid var(--void); border-radius: 50%; background: #4a4664; transform: translate(-50%, -50%); }
.route-track .g1 { left: 26%; }
.route-track .g2 { left: 56%; }
.route-track .g3 { left: 85%; }
.route-track i.open { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

.fintro {
  position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 4, 22, 0.82); backdrop-filter: blur(3px); padding: 16px;
  overflow-y: auto;
}
.fintro__card {
  max-width: 560px; text-align: center;
  background: linear-gradient(180deg, #17124a, var(--panel-solid));
  border: 1px solid var(--line-strong); border-radius: calc(var(--r) * 1.6);
  padding: clamp(18px, 3.5vw, 30px);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.65), var(--glow-cyan);
}
.fintro__card h2 { margin: 4px 0 10px; font-family: var(--f-head); font-size: 1.3rem; color: var(--cream); }
.fintro__lede { margin: 0 0 14px; font-size: 0.93rem; }
.fintro__keys {
  list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px;
  font-size: 0.85rem; color: var(--body-text);
}
.fintro__keys b { color: var(--cyan); font-family: var(--f-head); font-size: 0.78rem; letter-spacing: 0.06em; }
.fintro__cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fintro__note { margin: 12px 0 0; font-size: 0.8rem; color: var(--muted); }

.fcontrols {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
}
.fbtn {
  width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(19, 16, 64, 0.75); color: var(--cyan); font-size: 1.5rem;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
.fbtn:active { background: rgba(77, 244, 255, 0.2); }

.results__flightline {
  margin: 0 0 18px; text-align: center; font-size: 0.88rem; color: var(--body-text);
}
.results__flightline b { color: var(--gold); }

/* ------------------------------------------------------------ feedback */

.feedback {
  position: fixed; inset: 0; z-index: 120; display: flex;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(6, 4, 22, 0.78); backdrop-filter: blur(4px);
}
.feedback[hidden] { display: none; }
.feedback__card {
  width: min(560px, 100%); max-height: calc(100vh - 36px); overflow-y: auto;
  background: linear-gradient(180deg, #17124a, var(--panel-solid));
  border: 1px solid var(--line-strong); border-radius: calc(var(--r) * 1.6);
  padding: clamp(20px, 4vw, 30px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), var(--glow-cyan);
  animation: popIn 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes popIn {
  0% { transform: scale(0.6) translateY(18px); opacity: 0; }
  55% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
.feedback__hero { text-align: center; margin-bottom: 14px; }
.feedback__tier {
  display: block; font-family: var(--f-head); font-weight: 700;
  font-size: 1.15rem; letter-spacing: 0.06em; color: var(--cream); margin-bottom: 4px;
}
.feedback__tier.t-comet, .feedback__tier.t-streak { color: var(--gold); }
.feedback__tier.t-hit { color: var(--cyan); }
.feedback__tier.t-recover { color: var(--violet); }
.feedback__tier.t-slow { color: var(--muted); }
.feedback__pts { font-family: var(--f-head); font-weight: 900; font-size: 2.6rem; color: var(--gold); }
.feedback__pts small {
  font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0.08em;
}
.feedback__yours {
  margin: 0 0 12px; padding: 12px 16px; border-radius: var(--r);
  background: rgba(77, 244, 255, 0.07); border: 1px solid var(--line);
  font-size: 0.92rem;
}
.feedback__yours strong { color: var(--cyan); }
.feedback__explain { margin: 0 0 12px; font-size: 0.95rem; color: var(--body-text); }
.feedback__recap {
  margin: 0 0 4px; font-size: 0.85rem; color: var(--gold);
  font-family: var(--f-head); letter-spacing: 0.02em;
}
.feedback__recap::before { content: "⟡ SIGNAL LOGGED — "; font-size: 0.68rem; letter-spacing: 0.16em; }
.feedback__chain { margin: 0 0 8px; display: grid; gap: 8px; }
.feedback__chain .chainrow {
  border-left: 3px solid var(--violet); padding: 8px 14px;
  background: rgba(155, 108, 255, 0.08); border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.88rem;
}
.feedback__chain .chainrow b {
  display: block; font-family: var(--f-head); font-size: 0.6rem;
  letter-spacing: 0.2em; color: var(--violet); margin-bottom: 3px;
}
.feedback__actions { margin-top: 16px; }

/* ------------------------------------------------------------- results */

.results { max-width: 780px; margin: 0 auto; }
.results__head { text-align: center; margin-bottom: 24px; }
.results__emblem { margin: 6px 0 0; font-size: 3.4rem; line-height: 1; }
.results__rank {
  margin: 8px 0 2px; font-family: var(--f-head); font-weight: 900;
  font-size: clamp(1.3rem, 4vw, 2rem); letter-spacing: 0.14em; color: var(--cream);
  text-shadow: 0 0 24px rgba(255, 209, 102, 0.5);
}
.results__score { margin: 0 0 6px; font-family: var(--f-head); font-weight: 900; color: var(--gold); font-size: clamp(2rem, 6vw, 3rem); }
.results__score small { font-size: 0.9rem; font-weight: 500; color: var(--muted); margin-left: 8px; }
.results__verdict { margin: 0 auto 14px; max-width: 480px; font-size: 0.95rem; }
.meter {
  height: 10px; border-radius: 6px; overflow: hidden; max-width: 420px; margin: 0 auto;
  background: rgba(255, 246, 223, 0.1);
}
.meter i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transition: width 1.1s var(--ease);
}
.results__best { margin: 12px 0 0; font-size: 0.82rem; color: var(--muted); }

.stat-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.cell {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; text-align: center;
}
.cell__k {
  display: block; font-family: var(--f-head); font-size: 0.58rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.cell__v { font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; color: var(--cream); }
.cell__v span { color: var(--cyan); }

.rows { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 16px; font-size: 0.88rem;
}
.row__letter {
  font-family: var(--f-head); font-weight: 700; color: var(--cyan);
  min-width: 26px; text-align: center;
}
.row__term { font-family: var(--f-head); font-size: 0.66rem; letter-spacing: 0.12em; color: var(--muted); min-width: 86px; }
.row__recap { flex: 1; color: var(--body-text); min-width: 0; }
.row__mark { font-weight: 700; white-space: nowrap; }
.row__mark.hit { color: var(--cyan); }
.row__mark.miss { color: var(--pink); }

.reflection {
  background: rgba(155, 108, 255, 0.08); border: 1px solid rgba(155, 108, 255, 0.35);
  border-radius: calc(var(--r) * 1.4); padding: clamp(18px, 3.4vw, 28px); margin-bottom: 22px;
}
.reflection h3 { margin: 0 0 10px; font-family: var(--f-head); font-size: 0.95rem; letter-spacing: 0.08em; color: var(--violet); }
.reflection p { margin: 0 0 10px; font-family: var(--f-passage); font-size: 1rem; color: var(--cream); }
.reflection__note { font-family: var(--f-body) !important; font-size: 0.83rem !important; color: var(--muted) !important; margin-bottom: 0 !important; }

.conversion {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(77, 244, 255, 0.07));
  border: 1px solid rgba(255, 209, 102, 0.4); border-radius: calc(var(--r) * 1.4);
  padding: clamp(20px, 3.6vw, 30px); text-align: center;
}
.conversion h3 {
  margin: 0 0 10px; font-family: var(--f-head); font-size: 1.25rem; color: var(--cream);
}
.conversion p { margin: 0 auto 16px; max-width: 560px; font-size: 0.95rem; }
.conversion strong { color: var(--gold); }
.conversion__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.conversion__note { margin: 14px 0 0; font-size: 0.84rem; color: var(--muted); }
.conversion__note a { color: var(--cyan); }

/* ---------------------------------------------------------------- foot */

.foot {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 22px clamp(16px, 4vw, 40px) 30px;
  font-size: 0.8rem; color: var(--muted); text-align: center;
  position: relative; z-index: 1; background: rgba(6, 4, 22, 0.6);
}
.foot p { margin: 0 0 8px; }
.foot a { color: var(--cyan); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .stat-cells { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .entry-rail { grid-template-columns: 1fr; }
  .hero { min-height: 420px; }
  /* The product drops the route track and the desktop key legend on phones — the
     3-column footer overflows 390px otherwise (measured: #flightDistance to 406px). */
  .route-track { display: none; }
  .flight-footer { grid-template-columns: 1fr auto; font-size: 0.56rem; padding: 7px 12px; }
  .flight-prompt { display: none; }
  /* The product hides the biome plate and constellation on small screens; without that
     the route name wraps to two lines and the HUD eats the stage. */
  .flight-hud { grid-template-columns: repeat(3, 1fr); padding: 8px 12px; }
  .flight-constellation, .hud-biome { display: none; }
  .hud-stat:first-child { border-left: 0; padding-left: 0; }
  /* A 16:9 canvas is only ~219px tall at 390px wide — the toast, echo bank and power
     chip then land on top of each other. Give the stage a real height and letterbox. */
  .canvas-wrap { min-height: 320px; }
  #gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  .mission-toast { top: auto; bottom: 12px; max-width: 92%; font-size: 0.62rem; padding: 0.5rem 0.7rem; }
  .echo-bank { right: auto; left: 10px; top: 10px; padding: 6px 8px; }
  .echo-bank > span { display: none; }
  .echo-bank i { width: 21px; height: 21px; }
  .power-hud { right: 10px; top: 10px; width: min(220px, 56%); }
  .power-chip { grid-template-columns: 29px 1fr; padding: 7px 9px; }
  .power-chip > i { width: 27px; height: 27px; }
  .power-chip b { font-size: 0.4rem; }
  .power-chip small { font-size: 0.52rem; }
  .power-announcement { top: 14%; width: 86%; padding-left: 58px; }
  /* On a phone the hero body climbs to the top of the frame and runs under the absolute
     credit pill — hide the pill; the footer already carries the same credit. Deliberately
     NOT position:static (a static child in a flex row becomes a second column). */
  .hero__credit { display: none; }
  .hud { position: static; }
  .qcard { flex-direction: column; }
  .qcard__rail {
    flex-direction: row; justify-content: flex-start; min-width: 0;
    padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .qcard__term { writing-mode: horizontal-tb; font-size: 0.7rem; align-self: center; }
  .qcard__letter { font-size: 1.5rem; }
  .row__term { display: none; }
}

@media (max-width: 430px) {
  .hero__cta .btn { width: 100%; }
  .stat-cells { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cell__v { font-size: 1.05rem; }
  .masthead { flex-wrap: wrap; }
}
