/* P OF THE WEEK — one build, two layouts (per HANDOVER 09).
 * body.layout-desktop : full-bleed playfield, edge to edge — no frame chrome.
 * body.layout-mobile  : the gameboy interface — the playfield above the RED
 *                       shell controller strip, thin black screen bezel +
 *                       rounded corners while in a level. Orientation locked.
 */
@font-face {
  font-family: "Pix32";
  src: url("/assets/shared/font/pix32.v1.woff2") format("woff2");
  font-display: swap;
}

* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
html, body {
  height: 100%;
  background: #04050a;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed; width: 100%;
  font-family: "Pix32", "Courier New", monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* JS disabled: a plain 8-bit style notice instead of a silent black page
   (a class rule, not an inline style, so it renders under the CSP too) */
.noscript-msg {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #04050a; color: #ffd24a;
  font-size: clamp(10px, 3vmin, 18px); letter-spacing: 2px; line-height: 2;
  text-shadow: 0 3px 0 #000;
}

/* full-bleed app: the frame is just a container, the viewport fills it */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#frame { flex: 1 1 auto; min-height: 0; position: relative; }

/* DESKTOP: a dark CRT-TV bezel around the whole screen. The app padding is the
   plastic frame; the screen recesses into it with rounded corners + a glass
   inner shadow. Mobile keeps its own gameboy shell (rules further down). */
body.layout-desktop #app {
  padding: clamp(12px, 2.4vmin, 40px);
  background:
    radial-gradient(130% 120% at 50% 0%, #24262d 0%, #141519 45%, #090a0d 100%);
}
body.layout-desktop #frame {
  border-radius: clamp(10px, 1.8vmin, 24px);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 clamp(2px, 0.4vmin, 4px) #000,        /* screen lip */
    inset 0 0 clamp(30px, 6vmin, 80px) rgba(0,0,0,0.7), /* CRT corner darkening */
    0 0 0 clamp(3px, 0.7vmin, 7px) #050506,           /* frame inner edge */
    0 clamp(6px, 1.2vmin, 14px) clamp(18px, 4vmin, 44px) rgba(0,0,0,0.7); /* drop */
}
#viewport {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #04050a;
  touch-action: none;
}
#game {
  display: block; width: 100%; height: 100%;
  touch-action: none;
  /* slight exposure/gamma pull-down so the composition isn't blown out */
  filter: brightness(0.9) contrast(1.05);
}
/* subtle CRT scanlines (intensity 0.225) */
#scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0.259) 0px, rgba(0, 0, 0, 0.259) 1px,
    transparent 1px, transparent 3px);
}
/* full-composition CRT glow: a blurred, brightened mirror of each frame,
   screen-blended back over the picture */
#bloom {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 4;
  mix-blend-mode: screen;
  filter: blur(5px) brightness(1.3) saturate(1.1);
  opacity: 0.17;
}
/* thin black gameboy screen bezel — path rebuilt to pixel size on resize;
   shown only in mobile gameboy mode while in a level */
#bezel {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 6;
  display: none;
}

/* a very slight turquoise grade over the WHOLE screen composition — sits at
   the top of the viewport stack so it colors the scene, CRT effects, loader and
   victory alike. It's inside #viewport, so the gameboy controller strip (a
   sibling of #frame) is never touched. Clipped to the rounded screen corners by
   #viewport's overflow:hidden. */
#tint {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 60;
  background: rgba(64, 224, 208, 0.035);
}

/* mobile-gesture hardening — touches that BEGIN on the game surface or the
   controls belong to the game: no page pan/pinch, no double-tap zoom, no
   text-selection loupe, no long-press callout, no image drag, no tap flash.
   #frame (the black console chrome around the screen) is included so a
   double-tap whose second tap lands just BESIDE the D-pad or the screen
   can't zoom either. Scoped to the game surfaces — never html/body — and
   the viewport meta stays user-scalable, so OS accessibility zoom keeps
   working. NOTE: CSS alone is not enough on iOS Safari (WebKit can still
   surface the loupe / double-tap zoom) — see the raw-touch guard in main.js. */
#frame, #game, #viewport, #loader, #victory,
#touch-controls, #touch-controls * {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- mobile: the gameboy interface ---------------- */
#touch-controls { display: none; }
/* the gameboy console (shell + bezel + rounded screen) stays on from the moment
   the START screen is dismissed, THROUGH every between-level loading blink and
   retry, until victory — `gb-on` persists across transitions where `in-level`
   toggles off. It's only absent on the two full-screen screens: the START
   screen and the VICTORY screen (neither carries `gb-on`). */
body:not(.gb-on) #touch-controls { display: none !important; }

body.layout-mobile #app { height: 100%; height: 100dvh; }
/* solid black behind the playfield so the viewport's rounded-corner notches
   (and any subpixel seam above the controller strip) never show color */
body.layout-mobile #frame { background: #000; }

/* gameboy mode: round the screen corners + show the thin black bezel,
   whenever the console is on (matches the controller strip) */
body.layout-mobile.gb-on #viewport { border-radius: clamp(8px, 2.4vmin, 20px); }
body.layout-mobile.gb-on #bezel { display: block; }

/* the controller strip is present whenever the console is on (levels AND the
   loading blinks between them) — never on the START / victory screens */
body.layout-mobile.gb-on #touch-controls {
  display: block;
  position: relative;                       /* in normal flow at the bottom — not an overlay */
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1288 / 444;                 /* matches the RED shell art */
  max-height: 34vh;
  /* the shell art maps to the CONTENT box; the safe-area padding below it
     (home-indicator zone) stays solid black — no red bleeding into the
     bottom corners of notched phones */
  background: url("/assets/shared/ui/controls.v1.webp") center / 100% 100% no-repeat #000;
  background-origin: content-box;
  background-clip: content-box;
  pointer-events: none;                     /* the art passes touches through... */
  touch-action: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* CSS-built glossy beveled BLACK controls seated in the shell wells.
   Placements (centers, % of the container) measured from the red shell:
   D-pad (12.04%, 57.44%); JUMP disc (77.29%, 62.61%); SHOOT disc (91.03%, 46.85%). */
#tc-dpad {
  position: absolute; left: 12.04%; top: 57.44%;
  width: 18.96%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
}
#tc-dpad .dseg {
  position: relative;
  background: linear-gradient(155deg, #3d4048 0%, #24262c 46%, #0f1115 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.22), inset 0 -3px 5px rgba(0, 0, 0, 0.6);
  transition: filter 0.05s;
}
#tc-dpad .up    { grid-area: 1 / 2 / 2 / 3; border-radius: 32% 32% 0 0; }
#tc-dpad .left  { grid-area: 2 / 1 / 3 / 2; border-radius: 32% 0 0 32%; }
#tc-dpad .mid   { grid-area: 2 / 2 / 3 / 3; background: #26282e; }
#tc-dpad .right { grid-area: 2 / 3 / 3 / 4; border-radius: 0 32% 32% 0; }
#tc-dpad .down  { grid-area: 3 / 2 / 4 / 3; border-radius: 0 0 32% 32%; }
#tc-dpad .mid::after {                                        /* raised center nub */
  content: ""; position: absolute; inset: 0; margin: auto; width: 42%; height: 42%;
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #484b53, #17191e);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), inset 0 -1px 2px rgba(0, 0, 0, 0.6);
}
#tc-dpad.dir-left .left, #tc-dpad.dir-right .right { filter: brightness(1.7); }

/* JUMP / SHOOT: glossy black domes (no text); press pushes them down */
#tc-btn-jump, #tc-btn-shoot {
  position: absolute; width: 10.6%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle at 38% 30%, #4b4f58 0%, #2a2d34 52%, #0d0e11 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.32),
    inset 0 -5px 8px rgba(0, 0, 0, 0.66),
    0 5px 0 rgba(9, 10, 12, 0.95),
    0 8px 10px rgba(0, 0, 0, 0.55);
}
#tc-btn-jump  { left: 77.29%; top: 62.61%; }
#tc-btn-shoot { left: 91.03%; top: 46.85%; }
#tc-btn-jump.on, #tc-btn-shoot.on {
  transform: translate(-50%, -50%) translateY(4px);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(9, 10, 12, 0.95),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

#touch-controls .tc-zone {
  position: absolute;
  pointer-events: auto;                     /* ...only the hit-zones catch them */
  touch-action: none;
  background: transparent; border: 0;
}
/* hit-zones over the art (percent of the container); the D-pad is ONE drag
   zone — press + slide the thumb side to side to steer */
#tc-dpad-zone { left: 0;   top: 26%; width: 24%;  height: 64%; }
#tc-jump      { left: 70%; top: 38%; width: 14.5%; height: 52%; }
#tc-shoot     { left: 84%; top: 22%; width: 15%;   height: 50%; }

/* ---------------- toast ---------------- */
/* the SHOOT: LVL 5 ONLY toast sits low on the screen — just above the gameboy
   controller strip (which is outside #viewport, so the viewport bottom edge is
   right above it) */
#toast {
  position: absolute; left: 50%; bottom: clamp(10px, 4vh, 40px);
  transform: translateX(-50%);
  color: #ffd24a; font-size: clamp(9px, 2.4vmin, 16px);
  letter-spacing: 2px; text-shadow: 0 3px 0 #000;
  opacity: 0; pointer-events: none; z-index: 22;
}
#toast.show { animation: toast-fade 1.2s steps(8, end) forwards; }
@keyframes toast-fade { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- level-entry banner ---------------- */
/* "LEVEL N — NAME" in the top RIGHT on every level entry, holds ~2s then fades.
   On Level 5 (.l5) it drops just below the boss's orange hearts so the two
   read together as the boss's nameplate. */
#level-banner {
  position: absolute; right: 4.5%; top: 3.4%;
  color: #fff; font-size: clamp(9px, 2.3vmin, 15px); letter-spacing: 2px;
  text-shadow: 0 3px 0 #000; text-align: right;
  opacity: 0; pointer-events: none; z-index: 22;
}
#level-banner.l5 { top: calc(1.7vh + 5.4vh); }   /* below the boss hearts (canvas HUD, top-right) */
#level-banner.show { animation: banner-fade 3s steps(10, end) forwards; }
@keyframes banner-fade { 0% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- loading screens ---------------- */
#loader {
  position: absolute; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center;
  background: #06070e;
  image-rendering: pixelated;
}
#loader.show { display: flex; }
/* START SCREEN: the key art backdrop behind the coin + blinking START.
   Two images — the portrait art on mobile, the landscape art on desktop
   (via the --start-art custom property set per layout below). The whole tube
   reads like a live CRT: a very slight gamma lift baked into a gentle
   brightness flicker. */
#loader.with-coin {
  background:
    linear-gradient(to bottom, rgba(4,5,12,0) 40%, rgba(4,5,12,0.35) 78%, rgba(4,5,12,0.72) 100%),
    var(--start-art) center / cover no-repeat,
    #06070e;
  animation: crt-flicker 0.7s steps(1, end) infinite;
}
body.layout-mobile  { --start-art: url("/assets/shared/ui/start-mobile.v2.webp"); }
body.layout-desktop { --start-art: url("/assets/shared/ui/start-desktop.v2.webp"); }
/* the CRT flicker — baseline brightness/contrast is the very slight gamma bump;
   the small irregular steps read as an old tube's unstable brightness */
@keyframes crt-flicker {
  0%,100% { filter: brightness(1.065) contrast(1.05) saturate(1.04); }
  9%      { filter: brightness(1.045) contrast(1.05) saturate(1.04); }
  17%     { filter: brightness(1.08)  contrast(1.05) saturate(1.04); }
  26%     { filter: brightness(1.05)  contrast(1.05) saturate(1.04); }
  37%     { filter: brightness(1.075) contrast(1.05) saturate(1.04); }
  45%     { filter: brightness(1.035) contrast(1.05) saturate(1.04); }   /* a dip */
  52%     { filter: brightness(1.06)  contrast(1.05) saturate(1.04); }
  61%     { filter: brightness(1.05)  contrast(1.05) saturate(1.04); }
  73%     { filter: brightness(1.08)  contrast(1.05) saturate(1.04); }
  84%     { filter: brightness(1.055) contrast(1.05) saturate(1.04); }
  93%     { filter: brightness(1.04)  contrast(1.05) saturate(1.04); }
}
/* comp glow on the start screen: a blurred, brightened copy of the art
   screen-blended back over it — a soft phosphor bloom that gently breathes */
#loader.with-coin::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;   /* just above the art, below the title */
  background: var(--start-art) center / cover no-repeat;
  filter: blur(7px) brightness(1.5) saturate(1.25);
  mix-blend-mode: screen; opacity: 0.2;
  animation: crt-glow 3.3s ease-in-out infinite;
}
@keyframes crt-glow { 0%,100% { opacity: 0.15; } 50% { opacity: 0.26; } }
@media (prefers-reduced-motion: reduce) {
  #loader.with-coin { animation: none; filter: brightness(1.06) contrast(1.05); }
  #loader.with-coin::before { animation: none; }
}
/* minimal keyboard guide — desktop start screen only (hidden on mobile + the
   black-blink transitions, and once START is pressed / loading) */
/* the levels 1-4 control brief — DESKTOP start screen only, tucked just under
   PUSH START (move / jump / mute; shoot is Level 5 only, taught there) */
.loader-keys { display: none; }
body.layout-desktop #loader.with-coin.ready .loader-keys {
  display: flex; flex-wrap: wrap; justify-content: center;
  position: absolute; left: 50%; top: 89%; transform: translateX(-50%); z-index: 5;
  gap: clamp(10px, 2.2vmin, 22px);
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(6px, 1.15vmin, 9px); letter-spacing: 1px;
  text-shadow: 0 2px 0 #000;
}

/* the P OF THE WEEK title logo — start screen only, crowning the upper-right
   corner; a real image so it stays crisp. Portrait art gets a bigger logo than
   the wide desktop art. */
.loader-logo { display: none; }
#loader.with-coin .loader-logo {
  display: block; position: absolute; top: 3.5%; right: 3%;
  width: 46%; height: auto; z-index: 2; pointer-events: none;   /* behind the scanlines (z-index: 3) */
  image-rendering: auto;                     /* smooth logo, NOT pixelated */
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 18px rgba(0, 0, 0, 0.5));
  animation: logo-bob 3.6s ease-in-out infinite;
}
body.layout-desktop #loader.with-coin .loader-logo { width: 27%; top: 5%; right: 4%; }
body.layout-mobile #loader.with-coin .loader-logo { width: 52.9%; top: calc(3.5% + 80px); right: calc(3% + 10px); }  /* 15% bigger, down 80px, left 25px then right 15px = net left 10px */
@keyframes logo-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6%); } }
/* start-screen layout: the P coin spins in the MIDDLE of the screen; PUSH START
   sits at the top of the bottom quarter; the desktop control brief tucks under
   it. (Each is absolutely placed against #loader, so .loader-box just collapses.)
   z-index 5 keeps the coin/START crisp above the scanlines. */
#loader.with-coin #loader-coin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
}
#loader.with-coin .loader-stage {
  position: absolute; left: 50%; top: 80%; transform: translateX(-50%); z-index: 5;
}
@media (prefers-reduced-motion: reduce) { #loader.with-coin .loader-logo { animation: none; } }

/* ---------------- level 5 mission brief ---------------- */
/* a small objective + control diagram along the BOTTOM of the screen on Level-5
   entry, then it fades — the UFO assault only starts once it's gone. NO overlay,
   just the text + diagram. DESKTOP shows the keyboard diagram (P = shoot);
   MOBILE shows only the objective text (the on-screen buttons are self-evident). */
#brief {
  position: absolute; inset: 0; z-index: 30;
  display: none; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: clamp(4px, 1.2vh, 10px); pointer-events: none;
  padding-bottom: clamp(12px, 4vh, 40px);
  opacity: 0; transition: opacity 0.5s ease;
}
#brief.show { display: flex; opacity: 1; }
.brief-obj {
  color: #ffd24a; text-align: center;
  font-size: clamp(11px, 3.2vmin, 20px); letter-spacing: 2px; line-height: 1.1;
  text-shadow: 0 3px 0 #000, 0 0 12px rgba(255, 210, 74, 0.5);
  animation: ld-flicker 1.1s steps(2, end) infinite;
}
.brief-ctls { display: flex; flex-direction: row; gap: clamp(10px, 3.4vmin, 26px); }
body.layout-mobile .brief-ctls { display: none; }   /* mobile: objective message only, no diagram */
.brief-row {
  display: flex; align-items: center; gap: clamp(4px, 1.2vmin, 8px);
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(7px, 1.7vmin, 11px); letter-spacing: 1px; text-shadow: 0 2px 0 #000, 0 0 6px #000;
}
.brief-row .k {
  display: inline-block; min-width: clamp(22px, 6.5vmin, 38px); text-align: center;
  padding: clamp(2px, 0.5vmin, 4px) clamp(4px, 1vmin, 7px);
  border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 4px;
  color: #fff; background: rgba(0, 0, 0, 0.55);
}
.brief-row .k.hot { color: #0a0b0e; background: #ffd24a; border-color: #ffd24a; }  /* the P shoot key pops */
.brief-row span { text-align: left; }
/* desktop shows the keyboard keys (incl. P = shoot); mobile shows the on-screen
   button names — each layout gets its own control labels */
.k.mob { display: none; }
body.layout-mobile .k.desk { display: none; }
body.layout-mobile .k.mob { display: inline-block; }

/* CRT scanlines over the start screen (the in-game #scan sits behind the loader),
   heavier than the in-game 0.225 for a chunkier retro read */
#loader.with-coin::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;   /* over the title logo (z-index: 2) */
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0.437) 0px, rgba(0, 0, 0, 0.437) 1px,
    transparent 1px, transparent 3px);
}
/* the black cover: opaque black over the START SCREEN, ABOVE every start-screen
   layer (art, title, coin, START, scanlines), while its assets load — then it
   fades out to reveal them all TOGETHER in one clean pass. Only matters on the
   start screen (booting) — everywhere else it's transparent. */
.loader-cover {
  position: absolute; inset: 0; background: #000; z-index: 20;
  pointer-events: none; opacity: 1; transition: opacity 0.7s ease;   /* black by default */
}
#loader:not(.booting) .loader-cover { opacity: 0; }   /* loaded -> fade the black out */
#loader.error .loader-cover { opacity: 0; }            /* ...also lift it for a retry prompt */

/* minimal mode — every loading moment EXCEPT the start screen: pure black,
   no text, no bar, no spinner (just the black blink) */
#loader.minimal { background: #000; }
#loader.minimal .loader-box { display: none; }
#loader.minimal.error .loader-box { display: flex; }   /* the retry prompt still surfaces on a failed load */
.loader-box {
  width: 100%; padding: 0 8%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  transition: opacity 0.3s steps(4, end);
}
#loader.out .loader-box { opacity: 0; }    /* the coin's in the slot — fade to black */

/* the P coin spinner (drawn by loader.js) — ONLY on the site-launch Start
   Screen; hidden on every between-level / retry loading screen */
#loader-coin {
  display: none;
  width: 96px; height: 84px;
  image-rendering: pixelated;
}
#loader.with-coin #loader-coin { display: block; }
/* the stage stacks the progress bits, the error line and START in ONE grid
   cell and swaps them with visibility — the box never reflows, so the title
   sits at exactly the same spot in every phase */
.loader-stage {
  width: 100%;
  display: grid; place-items: center;
}
.loader-stage > * { grid-area: 1 / 1; }
.loader-progress {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
#loader.ready .loader-progress,
#loader.error .loader-progress { visibility: hidden; }
/* the 8-bit loader bar (after codepen.io/neontrenton/pen/gOJaYGz):
   a white pixel-art frame SVG with the fill inset inside it — fill recolored
   to the UI yellow. The two 1px "helper" squares pixel-round the fill's ends. */
.c-bar {
  position: relative;
  width: min(76%, 474px);
  aspect-ratio: 237 / 22;
}
.c-bar__frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: #fff;
  shape-rendering: crispEdges;
}
.c-bar__fill {
  position: absolute; display: block;
  background: #ffd24a;
  left: 4.2194%; right: 4.6413%;            /* 10/237 and 11/237 */
  top: 22.7273%; height: 54.5455%;          /* 5/22 and 12/22 */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.16s steps(6, end);
}
.c-bar__px {
  position: absolute; display: block;
  background: #ffd24a;
  width: 1.6878%; height: 18.1818%;         /* 4/237 and 4/22 */
  top: 40.9091%;                            /* 9/22 */
  opacity: 0;
}
.c-bar__px--left  { left: 2.9536%; }        /* 7/237 */
.c-bar__px--right { right: 2.9536%; }
.c-bar__px--left.on, .c-bar__px--right.on { opacity: 1; }
.loader-pct {
  color: #fff; font-size: clamp(6px, 1.9vmin, 10px); text-shadow: 0 2px 0 #000;
}
.loader-error {
  visibility: hidden;
  color: #ff6b6b; font-size: clamp(8px, 2.2vmin, 12px);
  text-shadow: 0 2px 0 #000;
  animation: ld-blink 0.9s steps(1, end) infinite;
}
#loader.error .loader-error { visibility: visible; }
/* when the level is fully in, the bar gives way to the blinking 16-bit START */
.loader-start {
  visibility: hidden; color: #ffd24a;
  font-size: clamp(14px, 5.2vmin, 30px); letter-spacing: 3px;
  text-shadow: 0 5px 0 #000, 0 0 12px rgba(255, 210, 74, 0.45);
  animation: ld-blink 0.9s steps(1, end) infinite;
}
#loader.ready .loader-start { visibility: visible; }

@keyframes ld-blink   { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes ld-flicker { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.5; } }

/* ---------------- victory ---------------- */
#victory {
  position: absolute; inset: 0; z-index: 50; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 3.4vmin, 30px);
  background: rgba(4, 5, 12, 0.92);
  text-align: center;
}
#victory.show { display: flex; }
.victory-title {
  color: #ffd24a; font-size: clamp(12px, 4vmin, 26px); letter-spacing: 3px;
  text-shadow: 0 4px 0 #000;
  animation: ld-flicker 1.1s steps(2, end) infinite;
}
#victory-score {
  color: #fff; font-size: clamp(22px, 8vmin, 56px); letter-spacing: 4px;
  text-shadow: 0 6px 0 #000, 0 0 18px rgba(255, 255, 255, 0.35);
}
/* the ATOMIC P release plug */
.victory-links {
  display: flex; gap: clamp(14px, 4vmin, 30px); align-items: center;
  margin-top: clamp(4px, 1.5vmin, 12px);
}
.vl-icon {
  width: clamp(26px, 6vmin, 44px); height: clamp(26px, 6vmin, 44px);
  fill: #ffd24a;
  filter: drop-shadow(0 2px 0 #000);
}
.victory-plug {
  color: #fff; font-size: clamp(9px, 2.6vmin, 15px); letter-spacing: 3px;
  text-shadow: 0 3px 0 #000, 0 0 10px rgba(255, 210, 74, 0.4);
  animation: ld-blink 0.9s steps(1, end) infinite;
}
