/* ================================================================
   Munchkins Merch — Full Arcade Cabinet Rework
   Deep midnight-blue "CRT screen" hero + cream sections with original
   Memphis-style accents. Animated pixel scene. CRT scanlines overlay.
   No third-party IP. All sprites + pattern are original.
   ================================================================ */

:root {
  /* Screen / cabinet */
  --screen:     #0a0e2c;
  --screen-2:   #131a3e;
  --cabinet:    #1b1f3d;
  --ink:        #0a0a14;

  /* Cream paper for body sections */
  --paper:      #FFF6E8;
  --paper-2:    #FFEFD3;
  --paper-3:    #FFE0BD;

  /* Arcade accents (bright + cheerful, NOT neon-pink) */
  --red:        #E63946;
  --red-dk:     #B72836;
  --yellow:     #FFD60A;
  --yellow-dk:  #E5BE00;
  --green:      #2A9D8F;
  --green-dk:   #1F7B70;
  --cyan:       #58F9F4;
  --coral:      #FF7A59;
  --coral-dk:   #E85F3D;
  --orange:     #FF9F1C;

  /* Memphis pattern accents (used ONLY in pattern, not main UI) */
  --m-teal:     #2EC4B6;
  --m-magenta:  #E63A8E;
  --m-purple:   #7B2CFF;
  --m-mustard:  #FFC857;

  --line: 3px;
  --line-chunky: 4px;
  --glow-cyan: 0 0 10px rgba(88,249,244,0.7), 0 0 22px rgba(88,249,244,0.4);
  --glow-yellow: 0 0 10px rgba(255,214,10,0.7), 0 0 22px rgba(255,214,10,0.4);

  --font-display: 'Bungee', 'Arial Black', system-ui, sans-serif;
  --font-arcade:  'Press Start 2P', monospace;
  --font-body:    'Quicksand', 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

/* ================================================================
   CRT OVERLAY — fixed full-screen, pointer-events: none
   Scanlines + vignette + subtle flicker.
   ================================================================ */
.crt { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.crt-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0)    0px,
    rgba(0,0,0,0)    2px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  mix-blend-mode: multiply;
}
.crt-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.18) 85%,
    rgba(0,0,0,0.32) 100%
  );
}
.crt-flicker {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.02);
  animation: flicker 7s infinite;
}
@keyframes flicker {
  0%, 100%   { opacity: 0; }
  92%        { opacity: 0; }
  92.4%      { opacity: 1; }
  92.8%      { opacity: 0; }
  93.2%      { opacity: 1; }
  93.6%      { opacity: 0; }
}

/* ================================================================
   ARCADE HUD — green-on-black CRT text strip at very top
   ================================================================ */
.arcade-hud {
  background: #000;
  color: var(--yellow);
  font-family: var(--font-arcade);
  font-size: clamp(8px, 1.3vw, 10px);
  letter-spacing: 0.1em;
  padding: 8px clamp(12px, 4vw, 28px);
  display: flex; gap: clamp(10px, 3vw, 28px);
  align-items: center; justify-content: center; flex-wrap: wrap;
  border-bottom: 2px solid var(--cyan);
  text-shadow: var(--glow-yellow);
}
.hud-item { white-space: nowrap; }
.hud-player { color: var(--cyan); text-shadow: var(--glow-cyan); }
.hud-player .hud-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(0.85); }
}
.hud-coin b { color: var(--cyan); font-weight: 400; }
.hud-score b.ticker { color: var(--red); letter-spacing: 0.18em; }
.hud-blink {
  color: var(--red);
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ================================================================
   STICKY NAV
   ================================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px clamp(14px, 4vw, 32px);
  background: var(--screen);
  border-bottom: var(--line) solid var(--cyan);
  box-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(88,249,244,0.25);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: clamp(13px, 3vw, 17px);
  letter-spacing: 0.05em;
  text-shadow: var(--glow-cyan);
}
.nav-brand-icon { color: var(--yellow); text-shadow: var(--glow-yellow); }
.brand-sep { color: var(--red); margin: 0 2px; }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(8px, 2.2vw, 18px); align-items: center; }
.nav-links a {
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--yellow); border-bottom-color: var(--yellow); }
.nav-cta {
  background: var(--red) !important;
  color: #fff !important;
  padding: 7px 14px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 3px; background: var(--cyan); margin: 4px 0; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--screen);
    border-bottom: var(--line) solid var(--cyan);
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav-links.is-open { max-height: 360px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 22px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav-cta { margin: 14px 22px; text-align: center; }
}

/* ================================================================
   CABINET — wraps marquee + screen
   ================================================================ */
.cabinet {
  background:
    /* Side rails of the cabinet */
    linear-gradient(90deg, var(--cabinet) 0%, var(--cabinet) 3%, transparent 3%, transparent 97%, var(--cabinet) 97%, var(--cabinet) 100%),
    var(--screen);
  padding: clamp(24px, 4vw, 48px) clamp(10px, 3vw, 28px) clamp(28px, 4vw, 56px);
}

/* ================================================================
   MARQUEE — framed logo with light bulbs
   ================================================================ */
.marquee {
  max-width: 1100px;
  margin: 0 auto clamp(20px, 3vw, 36px);
  position: relative;
}
.marquee-frame {
  position: relative;
  background: linear-gradient(180deg, #c83b50, var(--red) 50%, #a82232 100%);
  border: var(--line-chunky) solid var(--ink);
  border-radius: 14px;
  padding: 22px;
  box-shadow:
    0 6px 0 var(--ink),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -4px 0 rgba(0,0,0,0.25);
}
.marquee-inner {
  background: #FFFFFF;
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  padding: clamp(14px, 3vw, 24px) clamp(12px, 3vw, 28px);
  display: grid;
  place-items: center;
  position: relative;
  /* Subtle Memphis pattern peek behind the logo */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke-width='3'><path d='M5 30 q15 -12 30 0 t30 0 t30 0 t30 0' stroke='%232EC4B6' opacity='0.13'/><path d='M5 95 q15 -12 30 0 t30 0 t30 0 t30 0' stroke='%23E63A8E' opacity='0.13'/><circle cx='15' cy='60' r='3' fill='%237B2CFF' opacity='0.13' stroke='none'/><circle cx='105' cy='60' r='3' fill='%23FFC857' opacity='0.13' stroke='none'/><polygon points='60,50 66,62 54,62' fill='%232EC4B6' opacity='0.15' stroke='none'/><polygon points='30,15 36,5 42,15' fill='%23E63A8E' opacity='0.13' stroke='none'/><polygon points='90,15 96,5 102,15' fill='%237B2CFF' opacity='0.13' stroke='none'/></g></svg>");
  background-size: 120px 120px;
}
.marquee-logo {
  position: relative;
  width: clamp(220px, 65vw, 520px);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

/* Light bulbs — generated via CSS gradient strips with dot patterns + blink animation */
.bulbs { position: absolute; pointer-events: none; }
.bulbs-top, .bulbs-bottom { left: 10px; right: 10px; height: 12px; }
.bulbs-top { top: -6px; }
.bulbs-bottom { bottom: -6px; }
.bulbs-left, .bulbs-right { top: 10px; bottom: 10px; width: 12px; }
.bulbs-left { left: -6px; }
.bulbs-right { right: -6px; }

/* Bulb pattern via repeating radial-gradient */
.bulbs-top, .bulbs-bottom {
  background:
    repeating-linear-gradient(
      to right,
      var(--yellow) 0 8px,
      transparent 8px 22px
    );
  filter: drop-shadow(0 0 6px var(--yellow));
  animation: bulbs-blink 1.2s steps(2, end) infinite;
  border-radius: 6px;
}
.bulbs-bottom {
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 11px,
      var(--orange) 11px 19px,
      transparent 19px 22px
    );
  filter: drop-shadow(0 0 6px var(--orange));
  animation-delay: 0.6s;
}
.bulbs-left, .bulbs-right {
  background:
    repeating-linear-gradient(
      to bottom,
      var(--yellow) 0 8px,
      transparent 8px 22px
    );
  filter: drop-shadow(0 0 6px var(--yellow));
  animation: bulbs-blink 1.2s steps(2, end) infinite;
  border-radius: 6px;
}
.bulbs-right { animation-delay: 0.6s; background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 11px,
      var(--orange) 11px 19px,
      transparent 19px 22px
    );
  filter: drop-shadow(0 0 6px var(--orange));
}
@keyframes bulbs-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}

/* ================================================================
   SCREEN — the arcade game display
   ================================================================ */
.screen {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--screen);
  border: var(--line-chunky) solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  padding: clamp(48px, 8vw, 100px) clamp(20px, 4vw, 56px);
  box-shadow:
    0 8px 0 var(--ink),
    inset 0 0 60px rgba(88,249,244,0.08),
    inset 0 0 0 6px rgba(255,255,255,0.04);
  isolation: isolate;
}

.scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* STARS */
.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px #fff;
  animation: twinkle 3s ease-in-out infinite;
}
.star.s1  { top: 8%;  left: 12%; animation-delay: 0s; }
.star.s2  { top: 14%; left: 28%; animation-delay: .4s; background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.star.s3  { top: 6%;  left: 44%; animation-delay: .8s; }
.star.s4  { top: 18%; left: 58%; animation-delay: 1.2s; background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.star.s5  { top: 9%;  left: 72%; animation-delay: 1.6s; }
.star.s6  { top: 16%; left: 88%; animation-delay: 2.0s; background: var(--coral); box-shadow: 0 0 4px var(--coral); }
.star.s7  { top: 28%; left: 6%;  animation-delay: 2.4s; }
.star.s8  { top: 32%; left: 22%; animation-delay: .2s; background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.star.s9  { top: 24%; left: 40%; animation-delay: .6s; }
.star.s10 { top: 30%; left: 56%; animation-delay: 1.0s; }
.star.s11 { top: 26%; left: 76%; animation-delay: 1.4s; background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.star.s12 { top: 34%; left: 92%; animation-delay: 1.8s; }
.star.s13 { top: 48%; left: 5%;  animation-delay: .3s; }
.star.s14 { top: 52%; left: 28%; animation-delay: .7s; background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.star.s15 { top: 44%; left: 50%; animation-delay: 1.1s; }
.star.s16 { top: 50%; left: 72%; animation-delay: 1.5s; }
.star.s17 { top: 46%; left: 90%; animation-delay: 1.9s; background: var(--coral); box-shadow: 0 0 4px var(--coral); }
.star.s18 { top: 38%; left: 15%; animation-delay: 2.3s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* SUN */
.sun {
  position: absolute;
  left: 50%; top: 18%;
  transform: translateX(-50%);
  width: clamp(180px, 30vw, 280px);
  height: clamp(180px, 30vw, 280px);
  filter:
    drop-shadow(0 0 24px rgba(255,159,28,0.6))
    drop-shadow(0 0 50px rgba(255,122,89,0.4));
  z-index: 1;
}
.sun svg { width: 100%; height: 100%; }

/* GRID FLOOR — perspective + scrolling */
.grid-floor {
  position: absolute;
  left: -10%; right: -10%;
  bottom: 0;
  height: 55%;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0, transparent 22px,
      rgba(88,249,244,0.7) 23px, rgba(88,249,244,0.7) 24px
    ),
    repeating-linear-gradient(
      to right,
      transparent 0, transparent 44px,
      rgba(230,57,70,0.55) 45px, rgba(230,57,70,0.55) 46px
    );
  background-size: 100% 24px, 100% 100%;
  transform: perspective(420px) rotateX(60deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 100%);
  animation: grid-scroll 2.5s linear infinite;
  z-index: 0;
}
@keyframes grid-scroll {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 24px, 0 0; }
}

/* FLOATING SPRITES */
.sprites { position: absolute; inset: 0; z-index: 2; }
.sprite {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: clamp(28px, 4vw, 44px);
  height: clamp(28px, 4vw, 44px);
  opacity: 0.85;
  animation: drift var(--dur, 10s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5));
}
.sprite svg { width: 100%; height: 100%; image-rendering: pixelated; }
.sp-4, .sp-5, .sp-6 { width: clamp(40px, 6vw, 64px); }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(-8px, -14px) rotate(-6deg); }
  50%      { transform: translate(6px, -22px) rotate(4deg); }
  75%      { transform: translate(-4px, -10px) rotate(-3deg); }
}

/* SCREEN CONTENT */
.screen-content {
  position: relative;
  z-index: 5;
  text-align: center;
  color: #fff;
  max-width: 760px;
  margin: 0 auto;
}
.press-start {
  font-family: var(--font-arcade);
  font-size: clamp(11px, 1.6vw, 13px);
  color: var(--yellow);
  letter-spacing: 0.18em;
  margin: 0 0 18px;
  text-shadow: var(--glow-yellow);
  animation: blink 1s steps(1, end) infinite;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5.8vw, 56px);
  margin: 0 0 14px;
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: #fff;
  text-shadow:
    2px 2px 0 var(--red),
    4px 4px 0 var(--cyan);
}
.hero-sub {
  font-size: clamp(14px, 2.2vw, 17px);
  color: rgba(255,255,255,0.88);
  max-width: 520px;
  margin: 0 auto 26px;
  font-weight: 600;
}
.hero-sub-em { color: var(--yellow); text-shadow: var(--glow-yellow); }
.hero-cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ================================================================
   ARCADE BUTTONS — glossy round with press effect
   ================================================================ */
.arcade-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: clamp(14px, 2.2vw, 16px);
  letter-spacing: 0.05em;
  color: #fff;
  text-decoration: none;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow:
    0 6px 0 var(--ink),
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -4px 0 rgba(0,0,0,0.25);
  position: relative;
  transition: transform .1s, box-shadow .1s, filter .15s;
  cursor: pointer;
}
.arcade-btn::before {
  content: ""; position: absolute;
  top: 4px; left: 12px; right: 12px; height: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0));
  border-radius: 999px;
  pointer-events: none;
}
.arcade-btn:hover, .arcade-btn:focus-visible { filter: brightness(1.08); }
.arcade-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 var(--ink),
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -4px 0 rgba(0,0,0,0.25);
}
.ab-arrow { font-weight: 800; font-size: 1.2em; }
.ab-sm {
  padding: 10px 18px;
  font-size: 12px;
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.25);
}
.ab-sm:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.25); }

.ab-red    { background: radial-gradient(circle at 30% 25%, #ff7c87, #E63946 60%, #b72836 100%); }
.ab-blue   { background: radial-gradient(circle at 30% 25%, #7eaaff, #3A86FF 60%, #1a66d8 100%); }
.ab-cyan   { background: radial-gradient(circle at 30% 25%, #b2fffc, #58F9F4 60%, #2bb9b3 100%); color: var(--ink); text-shadow: 1px 1px 0 rgba(255,255,255,0.4); }
.ab-yellow { background: radial-gradient(circle at 30% 25%, #fff3a0, #FFD60A 60%, #d9b400 100%); color: var(--ink); text-shadow: 1px 1px 0 rgba(255,255,255,0.4); }
.ab-green  { background: radial-gradient(circle at 30% 25%, #6fd8cb, #2A9D8F 60%, #1c7268 100%); }
.ab-coral  { background: radial-gradient(circle at 30% 25%, #ffb09a, #FF7A59 60%, #d6502c 100%); }

/* ================================================================
   PIXEL DIVIDER (between sections — "STAGE CLEAR")
   ================================================================ */
.pixel-divider {
  background: var(--screen);
  color: var(--yellow);
  text-align: center;
  padding: 14px 12px;
  font-family: var(--font-arcade);
  font-size: clamp(9px, 1.6vw, 12px);
  letter-spacing: 0.2em;
  border-top: var(--line) solid var(--ink);
  border-bottom: var(--line) solid var(--ink);
  position: relative;
  text-shadow: var(--glow-yellow);
}
.pixel-divider::before, .pixel-divider::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(
    to right,
    var(--red) 0 16px, transparent 16px 24px,
    var(--cyan) 24px 40px, transparent 40px 48px,
    var(--yellow) 48px 64px, transparent 64px 72px,
    var(--green) 72px 88px, transparent 88px 96px
  );
}
.pixel-divider::before { top: -6px; }
.pixel-divider::after  { bottom: -6px; }

/* ================================================================
   SECTIONS COMMON
   ================================================================ */
.section {
  padding: clamp(64px, 10vw, 110px) clamp(18px, 5vw, 56px);
  position: relative;
}
.section-head { text-align: center; margin-bottom: clamp(32px, 5vw, 52px); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-arcade);
  font-size: clamp(9px, 1.5vw, 11px);
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6.5vw, 52px);
  margin: 0;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow:
    2px 2px 0 var(--yellow),
    4px 4px 0 var(--red);
}
.section-title.alt {
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--ink);
}
.section-sub {
  margin: 14px 0 0;
  font-family: var(--font-arcade);
  font-size: clamp(9px, 1.5vw, 11px);
  letter-spacing: 0.15em;
  color: var(--green-dk);
}

/* ================================================================
   MEMPHIS BG — original 90s squiggles + confetti pattern
   Used on Character Select section. Tasteful, not wall-to-wall.
   ================================================================ */
.memphis-bg {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><g fill='none' stroke-width='4' stroke-linecap='round'><path d='M20 40 q15 -18 30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0' stroke='%232EC4B6' opacity='0.55'/><path d='M10 200 q15 -18 30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0' stroke='%23E63A8E' opacity='0.5'/></g><g stroke='none'><circle cx='40' cy='110' r='5' fill='%237B2CFF' opacity='0.55'/><circle cx='200' cy='130' r='5' fill='%23FFC857' opacity='0.6'/><circle cx='110' cy='90' r='4' fill='%23E63A8E' opacity='0.5'/><circle cx='160' cy='180' r='4' fill='%232EC4B6' opacity='0.6'/><polygon points='80,140 90,158 70,158' fill='%237B2CFF' opacity='0.55'/><polygon points='180,80 192,98 168,98' fill='%23E63A8E' opacity='0.5'/><polygon points='120,200 132,218 108,218' fill='%232EC4B6' opacity='0.55'/><path d='M55 70 l10 -10 l10 10 l10 -10' stroke='%237B2CFF' stroke-width='3' fill='none' opacity='0.55' stroke-linecap='round'/><path d='M170 30 l10 -10 l10 10 l10 -10' stroke='%23FFC857' stroke-width='3' fill='none' opacity='0.6' stroke-linecap='round'/><path d='M30 170 l10 -10 l10 10 l10 -10' stroke='%23E63A8E' stroke-width='3' fill='none' opacity='0.5' stroke-linecap='round'/><path d='M150 220 l10 -10 l10 10 l10 -10' stroke='%232EC4B6' stroke-width='3' fill='none' opacity='0.55' stroke-linecap='round'/><path d='M5 120 a18 18 0 0 1 36 0' stroke='%23E63A8E' stroke-width='3' fill='none' opacity='0.5'/><path d='M205 60 a18 18 0 0 1 36 0' stroke='%237B2CFF' stroke-width='3' fill='none' opacity='0.5'/></g></svg>");
  background-size: 240px 240px;
}

/* CHARACTER SELECT GALLERY */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(18px, 3vw, 28px);
  max-width: 1180px;
  margin: 0 auto;
}
.char-card {
  position: relative;
  background: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  padding: 18px 18px 22px;
  box-shadow:
    0 6px 0 var(--ink),
    0 14px 24px -10px rgba(0,0,0,0.15);
  transition: transform .2s, box-shadow .2s;
}
.char-card::before {
  /* Top racing stripe */
  content: ""; position: absolute; top: -8px; left: 16px; right: 16px; height: 6px;
  background: linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 25% 50%, var(--cyan) 50% 75%, var(--green) 75% 100%);
  border-radius: 3px 3px 0 0;
}
.char-card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--ink), 0 18px 30px -10px rgba(0,0,0,0.2); }
.char-tag {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-arcade);
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  letter-spacing: 0.1em;
  z-index: 2;
}
.char-portrait {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--screen);
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink);
  /* Subtle screen scanlines on the portrait */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(255,255,255,0.04) 3px, rgba(255,255,255,0.04) 4px);
}
.char-portrait img { width: 100%; height: 100%; object-fit: contain; padding: 12px; position: relative; z-index: 1; }
/* Real product photos (P1–P3): fill the frame and crop cleanly, no stretch, no letterbox. */
.char-portrait--photo img { object-fit: cover; object-position: center; padding: 0; }
/* Per-photo crop tuning so each sack sits centered in the square frame. */
/* tiedye + donut-buddy are pre-cropped square + centered, so plain center is correct */
.char-portrait--photo img[src*="trio"] { object-position: 47% center; }
.char-meta { padding-top: 14px; }
.char-name {
  font-family: var(--font-display);
  font-size: clamp(14px, 2.3vw, 17px);
  margin: 8px 0 4px;
  letter-spacing: 0.02em;
}
.char-stat {
  font-family: var(--font-arcade);
  font-size: 9px;
  margin: 0 0 8px;
  letter-spacing: 0.1em;
  color: var(--green-dk);
}
.char-stat b { color: var(--ink); }
.char-desc { font-size: 14px; color: #3a3a4d; margin: 0 0 14px; min-height: 42px; font-weight: 500; }

/* ================================================================
   BONUS STAGE
   ================================================================ */
.section-custom { background: var(--paper); }
.bonus-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  background: var(--screen);
  color: #fff;
  border: var(--line-chunky) solid var(--ink);
  border-radius: 18px;
  padding: clamp(36px, 5vw, 56px) clamp(22px, 5vw, 44px);
  box-shadow: 0 10px 0 var(--ink), 0 24px 36px -16px rgba(0,0,0,0.3);
  /* Subtle scanlines */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,0.025) 4px);
}
.bonus-banner {
  position: absolute;
  top: -20px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(13px, 2.2vw, 17px);
  padding: 6px 18px;
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--ink);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.coin-slot {
  width: 100px;
  margin: 14px auto 18px;
  text-align: center;
}
.coin-slot-frame {
  background: linear-gradient(180deg, #2b3158 0%, #1a1f3d 100%);
  border: var(--line) solid var(--ink);
  border-radius: 10px;
  padding: 14px 12px 12px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), 0 4px 0 var(--ink);
  position: relative;
}
.coin-slot-led {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  margin: 0 auto 8px;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.coin-slot-hole {
  width: 60px; height: 6px;
  background: var(--ink);
  border-radius: 3px;
  margin: 0 auto;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.coin-slot-label {
  font-family: var(--font-arcade);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--yellow);
  margin: 8px 0 0;
  text-shadow: var(--glow-yellow);
}
.bonus-card .section-title { color: var(--yellow); text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--ink); }
.bonus-lead {
  font-size: clamp(16px, 2.4vw, 19px);
  margin: 14px 0 12px;
  font-weight: 600;
}
.bonus-sub { font-size: 14.5px; color: rgba(255,255,255,0.78); margin: 0 0 22px; }

/* ================================================================
   3 LEVELS (How it works)
   ================================================================ */
.section-how { background: var(--paper-2); }
.levels {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}
.level-frame {
  text-align: center;
  background: var(--screen);
  color: #fff;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  padding: 32px 22px 26px;
  box-shadow: 0 6px 0 var(--ink);
  position: relative;
  /* Scanline inner */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,0.03) 4px);
}
.level-num {
  position: absolute;
  top: -16px; left: 50%; transform: translateX(-50%);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 5px 12px;
  border: var(--line) solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--ink);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.level-art {
  margin: 14px auto 16px;
  width: 88px; height: 88px;
  display: grid; place-items: center;
  background: var(--screen-2);
  border: 2px solid var(--cyan);
  border-radius: 12px;
  box-shadow: inset 0 0 14px rgba(88,249,244,0.3);
}
.level-art svg { width: 60px; height: 60px; image-rendering: pixelated; }
.level-frame h3 {
  font-family: var(--font-display);
  font-size: clamp(14px, 2.2vw, 17px);
  margin: 6px 0 8px;
  letter-spacing: 0.04em;
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
}
.level-frame p { margin: 0; font-size: 14px; color: rgba(255,255,255,0.82); font-weight: 500; }

/* ================================================================
   FOOTER — cabinet base
   ================================================================ */
.footer {
  background: var(--screen);
  color: rgba(255,255,255,0.9);
  text-align: center;
  position: relative;
  border-top: var(--line-chunky) solid var(--ink);
}
.footer-stripe {
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 24px,
    var(--yellow) 24px 48px,
    var(--cyan) 48px 72px,
    var(--green) 72px 96px
  );
  border-bottom: var(--line) solid var(--ink);
}
.footer-inner { padding: clamp(36px, 6vw, 60px) clamp(18px, 5vw, 40px); max-width: 720px; margin: 0 auto; }
.footer-logo {
  width: 200px;
  margin: 0 auto 16px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 12px 0 18px; }
.footer-links a {
  color: var(--cyan); text-decoration: none;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-shadow: var(--glow-cyan);
}
.footer-links a:hover { color: var(--yellow); text-shadow: var(--glow-yellow); }
.footer-line {
  font-family: var(--font-arcade);
  font-size: 10px;
  color: var(--yellow);
  letter-spacing: 0.18em;
  margin: 8px 0 14px;
  text-shadow: var(--glow-yellow);
}
.blink-slow { animation: blink 1.6s steps(1, end) infinite; color: var(--red); }
.footer-meta { margin: 6px 0 0; font-size: 11px; color: rgba(255,255,255,0.55); font-family: var(--font-arcade); letter-spacing: 0.1em; }

/* ================================================================
   PERFORMANCE / REDUCED MOTION
   ================================================================ */
@media (max-width: 760px) {
  /* Lighter scene on phones — fewer sprites visible */
  .sp-6, .sp-7, .sp-10 { display: none; }
  .crt-vignette { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .star, .sprite, .grid-floor, .hud-blink, .press-start,
  .blink-slow, .crt-flicker, .bulbs-top, .bulbs-bottom,
  .bulbs-left, .bulbs-right, .hud-player .hud-dot,
  .coin-slot-led {
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}
