/* ---------- Fonts (per docs/UI-FX-BRAND.md) ----------
   Orbitron     -> main titles + hero tagline (mil-reg display register)
   Rajdhani     -> body / UI / buttons (clean condensed sans)
   Share Tech   -> stat labels + spec readouts (mil-log mono register)
   VT323        -> CRT/terminal accent (used in CRT frame chrome + toggle)
*/
@font-face {
  font-family: "Orbitron";
  src: url("assets/fonts/Orbitron-Variable.ttf") format("truetype-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("assets/fonts/Rajdhani-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Share Tech Mono";
  src: url("assets/fonts/ShareTechMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("assets/fonts/VT323-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Palette — lime from Steam logo; void.blue (not pure black) per brand 5.1 */
  --bg: #040810;
  --bg-elev: #0c1018;
  --bg-elev-2: #131822;
  --fg: #f2f2ee;
  --muted: #8a8a8a;
  --accent: #c1dd47;          /* FOXFIRE lime (matches Steam logo) */
  --accent-soft: #d6e87a;
  --accent-glow: rgba(193, 221, 71, 0.32);
  --accent-dim: rgba(193, 221, 71, 0.6);
  --danger: #ff3a3a;          /* enemy-eye red */
  --border: rgba(255, 255, 255, 0.08);

  /* Type stacks */
  --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "Share Tech Mono", ui-monospace, Consolas, monospace;
  --font-crt:     "VT323", "Share Tech Mono", ui-monospace, monospace;

  --container: 1100px;
  --radius: 12px;
  --gap: clamp(1rem, 3vw, 2rem);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, iframe { max-width: 100%; display: block; }
a { color: var(--accent); }
::selection { background: var(--accent); color: #000; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---------- Page-wide CRT overlay ---------- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(0, 0, 0, 0.18) 3px,
      rgba(0, 0, 0, 0.18) 3px
    ),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: multiply;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem clamp(3rem, 8vw, 5rem);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
/* Hero background: the no-logo Steam art, positioned so the ship sits right-of-center */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-bg.png");
  background-repeat: no-repeat;
  background-position: 75% 60%;
  background-size: cover;
  opacity: 0.7;
  z-index: -2;
}
/* Soft bleed so the hero blends into void.blue at top and bottom */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      var(--bg) 0%,
      rgba(4, 8, 16, 0.65) 8%,
      rgba(4, 8, 16, 0.0) 25%,
      rgba(4, 8, 16, 0.0) 60%,
      rgba(4, 8, 16, 0.85) 92%,
      var(--bg) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(4, 8, 16, 0.55) 80%);
  z-index: -1;
}
.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  position: relative;
}
.hero__logo {
  --logo-width: min(560px, 80vw);
  width: var(--logo-width);
  height: auto;
  /* The PNG has ~35% transparent padding below the glyphs.
     Pull the next element up so the visible gap to AWAITING INPUT
     is ~10px regardless of viewport width. Tune the 0.2 factor if
     the gap drifts after a logo crop. */
  margin: 0 auto calc(10px - var(--logo-width) * 0.2);
  filter: drop-shadow(0 0 40px var(--accent-glow));
  position: relative;
  z-index: 2;
}

/* AWAITING INPUT status chip under the logo */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto 1.25rem;
  padding: 0.3rem 0.8rem;
  background: rgba(4, 8, 16, 0.55);
  border: 1px solid rgba(193, 221, 71, 0.25);
  border-radius: 999px;
  font-family: var(--font-crt);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(193, 221, 71, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  z-index: 2;
}
.status-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: chip-pulse 1.4s ease-in-out infinite;
}
@keyframes chip-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.85); }
}
.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.75rem 0 1.25rem;
}
.hero__lede {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--fg);
  margin: 0 auto 2rem;
  max-width: 56ch;
}
.hero__ctas {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
/* Decorative spider crawling in the hero corner */
.hero__spider {
  position: absolute;
  left: clamp(0.5rem, 3vw, 2rem);
  bottom: clamp(0.5rem, 3vw, 2rem);
  width: clamp(48px, 7vw, 84px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 12px rgba(193, 221, 71, 0.25));
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  animation: spider-skitter 6s ease-in-out infinite;
}
@keyframes spider-skitter {
  0%, 100% { transform: translateX(0) translateY(0) rotate(-3deg); }
  25%      { transform: translateX(8px) translateY(-4px) rotate(2deg); }
  50%      { transform: translateX(-4px) translateY(2px) rotate(-1deg); }
  75%      { transform: translateX(6px) translateY(-2px) rotate(3deg); }
}

/* ---------- Hero trailer composite (CRT-framed, sits under logo) ---------- */
.hero__trailer {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  /* Pull up slightly so logo's drop-shadow kisses the top chrome */
  margin-top: -0.25rem;
}
.crt-frame {
  position: relative;
  background: #02060c;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(193, 221, 71, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  isolation: isolate;
}
.crt-frame__chrome {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(180deg, #0a1018 0%, #060a10 100%);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-crt);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(193, 221, 71, 0.6);
}
.crt-frame__led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: led-blink 2.4s ease-in-out infinite;
}
@keyframes led-blink {
  0%, 60%, 100% { opacity: 1; }
  70%, 90%      { opacity: 0.3; }
}
.crt-frame__label { font-size: 0.95rem; }

/* The actual video container — 16:9 box inside the CRT frame */
.video-wrap {
  position: relative;
  padding-top: 56.25%;
  background: #000;
}
.video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Lite YouTube embed — solid black background + lime play button until clicked.
   Click loads the iframe and requests fullscreen. */
.lite-yt {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #000;
  overflow: hidden;
  display: block;
}
.lite-yt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.lite-yt__play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 56px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  filter: drop-shadow(0 0 24px rgba(193, 221, 71, 0.35));
  transition: transform 0.15s ease, filter 0.15s ease;
  pointer-events: none; /* parent handles the click */
}
.lite-yt:hover .lite-yt__play {
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 0 36px rgba(193, 221, 71, 0.55));
}
.lite-yt__play svg { display: block; width: 100%; height: 100%; }
.lite-yt.is-activated { cursor: default; }
.lite-yt.is-activated iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
/* Subtle scanlines overlaying just the video */
.crt-frame__scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  mix-blend-mode: multiply;
  z-index: 2;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
}
.btn--primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px var(--accent-glow);
  background: var(--accent-soft);
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
  margin: 0 0 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.7rem;
  border-radius: 2px;
}

/* ---------- About ---------- */
.about { max-width: 70ch; }
.about p { margin: 0 0 1rem; }
.about__lead { font-size: clamp(1.05rem, 2vw, 1.2rem); }
.about__lead strong { color: var(--accent); }

/* ---------- Features ---------- */
.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .features { grid-template-columns: repeat(4, 1fr); }
}
.feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.feature__stat {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}
.feature p {
  margin: 0;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.gallery img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.25s ease, border-color 0.2s ease;
}
.gallery img:hover {
  transform: scale(1.02);
  border-color: var(--accent-dim);
}
@media (min-width: 640px) {
  .gallery { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
@media (min-width: 960px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Link cards ---------- */
.links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .links { grid-template-columns: repeat(3, 1fr); }
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.link-card__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.link-card__action {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Mailing list ---------- */
.section--mailing { padding-bottom: clamp(3rem, 8vw, 5rem); }
.mailing__copy {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 50ch;
}

/* EmailOctopus embed container — the script injects its own form inside.
   We force any injected child to behave inline so the embed cannot escape
   into a sticky / fixed banner regardless of how the form is configured. */
.mailing__embed {
  position: relative;
  max-width: 480px;
  isolation: isolate;
}
/* Cage anything the script renders inside this container */
.mailing__embed > *:not(script) {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
  max-width: 100% !important;
  z-index: auto !important;
}
.mailing__embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

/* Belt-and-suspenders: if the EO script appends fixed/sticky elements to
   <body> (escaping our container), force them static too. The selectors
   below are deliberately broad to catch common EO class/id patterns. */
body > [id^="eo-"][style*="fixed"],
body > [id^="eo-"][style*="sticky"],
body > [class*="eo-form"][style*="fixed"],
body > [class*="emailoctopus"][style*="fixed"] {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* ---------- System requirements ---------- */
.section--sysreq { padding-top: 0; }
.sysreq {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.sysreq__summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style: none;
  position: relative;
  user-select: none;
  color: var(--fg);
}
.sysreq__summary::-webkit-details-marker { display: none; }
.sysreq__summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}
.sysreq[open] .sysreq__summary::after {
  content: "\2212";
  color: var(--accent);
}
.sysreq__body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.sysreq__body h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.25rem 0 0.75rem;
  font-weight: 700;
}
.sysreq__list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
}
.sysreq__list dt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}
.sysreq__list dd {
  margin: 0;
  color: var(--fg);
}
.sysreq__note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* =====================================================================
   MINI-GAME
   ===================================================================== */

/* Sticky HUD wrapper (toggle + health) */
.minigame-hud {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

/* Toggle */
.minigame-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-crt);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(193, 221, 71, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.minigame-toggle:hover {
  border-color: var(--accent);
  background: rgba(4, 8, 16, 0.95);
}
.minigame-toggle__led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3a3a;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.minigame-toggle[aria-pressed="true"] .minigame-toggle__led {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: led-blink 1.4s ease-in-out infinite;
}

/* The stage where enemies live */
.minigame-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9500;
  overflow: hidden;
  display: none;
}
.minigame-stage.is-active { display: block; }

/* Enemy sprite (positioned via JS) */
.minigame-enemy {
  position: absolute;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 60, 60, 0.5));
  will-change: transform;
  pointer-events: none;
}

/* Laser bolt — grows forward from its left-center origin */
.minigame-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(193, 221, 71, 0) 0%,
    var(--accent) 35%,
    #ffffff 80%,
    var(--accent) 100%);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent), 0 0 4px #fff;
  transform-origin: 0 50%;
  will-change: transform;
  pointer-events: none;
}

/* Thruster trail particles — foxfire-cyan, fade + shrink */
.minigame-trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle,
    #ffffff 0%,
    #5BE2C9 30%,
    rgba(91, 226, 201, 0.55) 60%,
    rgba(91, 226, 201, 0) 100%);
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  mix-blend-mode: screen;
}

/* Custom cursor (the fighter jet sprite) */
.minigame-cursor {
  position: fixed;
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 9700;
  transform: translate(-9999px, -9999px);
  filter: drop-shadow(0 0 8px var(--accent-glow));
  will-change: transform;
  display: none;
}
.minigame-cursor.is-active { display: block; }

/* The system cursor stays visible — the ship is moved with WASD, not the mouse. */

/* Red hit flash — full-screen, animated by JS class toggle */
.minigame-hit-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9600;
  background: radial-gradient(ellipse at center, rgba(255, 30, 30, 0.55) 0%, rgba(255, 30, 30, 0) 70%);
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.minigame-hit-flash.is-flashing { opacity: 1; transition: opacity 60ms ease-in; }

/* HULL bar (under the toggle, only visible when game active) */
.minigame-health {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  user-select: none;
}

/* Control hint (passive label, only visible when game is active) */
.minigame-hint {
  display: none;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(193, 221, 71, 0.2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.minigame-hint.is-active { display: inline-flex; }
.minigame-hint__label { color: var(--muted); text-transform: uppercase; }
.minigame-hint__value { text-shadow: 0 0 6px rgba(193, 221, 71, 0.4); }
.minigame-hint__sep   { color: var(--muted); opacity: 0.6; }

/* Kill counter (always visible under toggle, persists across sessions) */
.minigame-kills {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(193, 221, 71, 0.2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.minigame-kills__label {
  text-transform: uppercase;
  color: var(--muted);
}
.minigame-kills__count {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(193, 221, 71, 0.4);
  font-size: 0.9rem;
}
.minigame-kills.is-celebrating .minigame-kills__count {
  animation: kill-pulse 0.6s ease-out;
}
@keyframes kill-pulse {
  0%   { transform: scale(1);   color: var(--accent); }
  40%  { transform: scale(1.4); color: #fff; text-shadow: 0 0 14px #fff; }
  100% { transform: scale(1);   color: var(--accent); }
}
.minigame-health.is-active { display: inline-flex; }
.minigame-health__label {
  text-transform: uppercase;
  color: var(--muted);
}
.minigame-health__bar {
  display: inline-flex;
  gap: 2px;
}
.minigame-health__seg {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  box-shadow: 0 0 4px rgba(193, 221, 71, 0.5);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.minigame-health__seg.is-lost {
  background: #2a1a1a;
  box-shadow: none;
}
.minigame-health__count {
  min-width: 1.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* MISSION FAILED overlay — full-screen modal-ish, click to dismiss */
.mission-failed {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at center, rgba(80, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 0.95) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fail-fade-in 0.4s ease-out;
}
.mission-failed.is-active { display: flex; }
@keyframes fail-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.mission-failed__card {
  text-align: center;
  max-width: 480px;
  padding: 2rem 2rem 1.75rem;
  background: rgba(4, 8, 16, 0.92);
  border: 1px solid var(--danger);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(255, 58, 58, 0.3), 0 30px 60px rgba(0, 0, 0, 0.8);
}
.mission-failed__sub {
  font-family: var(--font-crt);
  font-size: 1rem;
  color: var(--danger);
  letter-spacing: 0.15em;
  margin: 0 0 0.5rem;
  text-shadow: 0 0 6px rgba(255, 58, 58, 0.6);
  animation: chip-pulse 1.4s ease-in-out infinite;
}
.mission-failed__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 1rem;
  color: var(--fg);
  text-shadow: 0 0 30px rgba(255, 58, 58, 0.5);
}
.mission-failed__pilot {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* ---------- Mini-game toast (milestone announcements) ---------- */
.minigame-toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 10500;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  background: rgba(4, 8, 16, 0.92);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-crt);
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(193, 221, 71, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 32px rgba(193, 221, 71, 0.2);
  pointer-events: none;
}
.minigame-toast.is-visible {
  display: inline-flex;
  animation: toast-in 0.25s ease-out both;
}
.minigame-toast.is-leaving {
  animation: toast-out 0.4s ease-in both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
.minigame-toast__caret {
  animation: caret-blink 0.9s steps(2, end) infinite;
}
@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- FTPL CASCADE nuke flash ---------- */
.minigame-nuke {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9650;
  background: radial-gradient(circle at center,
    #ffffff 0%,
    rgba(193, 221, 71, 0.8) 25%,
    rgba(91, 226, 201, 0.4) 55%,
    rgba(0, 0, 0, 0) 80%);
  opacity: 0;
}
.minigame-nuke.is-detonating {
  animation: nuke-flash 0.9s ease-out both;
}
@keyframes nuke-flash {
  0%   { opacity: 0; transform: scale(0.4); }
  10%  { opacity: 1; transform: scale(1);   }
  100% { opacity: 0; transform: scale(1.4); }
}

/* ---------- ANOMALY DETECTED (5k-kill easter egg) ----------
   Hard, intense distortion of the whole site. Dismissed by ESC.
   Session-only (not persisted).
*/
body.anomaly {
  --bg:            #08000a;
  --bg-elev:       #16041a;
  --bg-elev-2:     #240a2c;
  --fg:            #ffe0ec;
  --muted:         #b888a0;
  --accent:        #ff3a78;
  --accent-soft:   #ff80b8;
  --accent-glow:   rgba(255, 58, 120, 0.6);
  --accent-dim:    rgba(255, 58, 120, 0.75);
  --danger:        #ff1740;
  --border:        rgba(255, 200, 220, 0.15);
  animation: anomaly-pulse 3.2s ease-in-out infinite,
             anomaly-shake 0.18s steps(2) infinite;
}

/* Slow color drift — hue rotates, saturation pulses */
@keyframes anomaly-pulse {
  0%, 100% { filter: hue-rotate(0deg)   saturate(1.4) contrast(1.05); }
  20%      { filter: hue-rotate(35deg)  saturate(1.8) contrast(1.1);  }
  40%      { filter: hue-rotate(-30deg) saturate(1.6); }
  60%      { filter: hue-rotate(55deg)  saturate(2)   contrast(1.2);  }
  80%      { filter: hue-rotate(-18deg) saturate(1.5); }
}
/* Fast micro-shake (jitters the whole frame) */
@keyframes anomaly-shake {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(0.6px, -0.4px); }
  100% { transform: translate(-0.5px, 0.5px); }
}

/* Intensified scanlines + vignette + glitch */
body.anomaly .crt-overlay {
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 1px,
      rgba(80, 0, 30, 0.55) 2px
    ),
    radial-gradient(ellipse at center, transparent 20%, rgba(120, 0, 40, 0.9) 100%);
  animation: anomaly-glitch 0.45s steps(3) infinite;
}
@keyframes anomaly-glitch {
  0%, 60%  { opacity: 1; transform: translateX(0) translateY(0); }
  65%      { opacity: 0.5; transform: translateX(3px) translateY(-1px); }
  68%      { opacity: 0.85; transform: translateX(-4px) translateY(2px); }
  72%      { opacity: 1; transform: translateX(0); }
  88%      { opacity: 0.55; transform: translateX(2px); }
  92%      { opacity: 1; }
  100%     { opacity: 1; transform: translateX(0); }
}

/* Chromatic aberration on every important text surface */
body.anomaly .hero__tagline,
body.anomaly .section__title,
body.anomaly .feature__stat,
body.anomaly .link-card__label,
body.anomaly .sysreq__summary,
body.anomaly .minigame-toast,
body.anomaly .mission-failed__title {
  text-shadow:
    -2px 0 0 rgba(255, 30, 80, 0.9),
     2px 0 0 rgba(60, 220, 255, 0.8),
     0 0 24px rgba(255, 58, 120, 0.5);
  animation: anomaly-letter-jitter 0.12s steps(2) infinite;
}
@keyframes anomaly-letter-jitter {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(0.8px); }
  100% { transform: translateX(-0.6px); }
}

/* Hero bg image inversion */
body.anomaly .hero::before {
  filter: hue-rotate(180deg) saturate(0.4) blur(1.5px) contrast(1.2);
}

/* Sporadic RGB-corruption flash overlay */
body.anomaly::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9750;
  background: transparent;
  animation: anomaly-rgb-flash 6.4s infinite;
}
@keyframes anomaly-rgb-flash {
  0%, 88%, 100% { background: transparent; }
  89%           { background: rgba(255, 0, 60, 0.18); }
  90%           { background: rgba(0, 255, 200, 0.15); }
  91%           { background: rgba(255, 255, 255, 0.08); }
  92%           { background: transparent; }
}

/* Suppress everything if the user has reduced motion turned on */
@media (prefers-reduced-motion: reduce) {
  body.anomaly,
  body.anomaly .crt-overlay,
  body.anomaly::before,
  body.anomaly .hero__tagline,
  body.anomaly .section__title,
  body.anomaly .feature__stat,
  body.anomaly .link-card__label,
  body.anomaly .sysreq__summary,
  body.anomaly .minigame-toast,
  body.anomaly .mission-failed__title {
    animation: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .link-card, .feature { transition: none; }
  .hero__spider, .crt-frame__led, .minigame-toggle__led { animation: none; }
}
