/* ============================================================
   CARTRIDGE — Late-'90s / N64-era skin
   ------------------------------------------------------------
   Palette : charcoal console darks + warm-gray plastic, with the
             four iconic N64 controller-button accents
             (blue A, green B, yellow C, red Start).
   Type    : Press Start 2P (display) · VT323 (body) · Silkscreen (labels)
             all falling back to monospace.
   Surfaces: hard-edged, beveled "plastic hardware" panels built from
             layered inset/outset shadows (--bevel-*).
   Extras  : opt-in CRT overlay via `body.crt-mode` (scanlines +
             aperture grille + vignette + gentle flicker).
   ============================================================ */

/* ===== TOKENS ===== */
:root{
  /* -- charcoal console body -- */
  --charcoal:   #14141a;   /* deepest ground */
  --charcoal-2: #1e1e26;   /* raised surface / cards */
  --charcoal-3: #2a2a34;   /* higher surface / controls */

  /* -- warm-gray console plastic -- */
  --plastic:    #8b877b;
  --plastic-lt: #b7b2a3;   /* bevel highlight edge */
  --plastic-dk: #4a473f;   /* bevel shadow edge */

  /* -- N64 controller button accents -- */
  --n64-blue:   #2f6fed;   /* A button */
  --n64-green:  #38bb59;   /* B button */
  --n64-yellow: #f4c518;   /* C buttons */
  --n64-red:    #e2372a;   /* Start button */

  /* -- neutrals -- */
  --cream:      #ece7d6;   /* label plastic / primary text */
  --muted:      rgba(236,231,214,0.62);
  --faint:      rgba(236,231,214,0.40);
  --line:       rgba(236,231,214,0.14);

  /* -- type -- */
  --display: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --body:    'VT323', ui-monospace, 'Courier New', monospace;
  --label:   'Silkscreen', ui-monospace, 'Courier New', monospace;

  --radius: 4px;

  /* -- reusable plastic bevels --
     raised  = light top-left, dark bottom-right (proud plastic)
     inset   = dark top-left, light bottom-right (recessed slot) */
  --bevel-raise:
    inset 2px 2px 0 rgba(255,255,255,0.20),
    inset -2px -2px 0 rgba(0,0,0,0.55);
  --bevel-inset:
    inset 2px 2px 0 rgba(0,0,0,0.60),
    inset -2px -2px 0 rgba(255,255,255,0.10);
  --drop: 0 5px 0 rgba(0,0,0,0.45), 0 10px 22px rgba(0,0,0,0.55);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body{
  margin:0;
  background:
    radial-gradient(140% 100% at 50% -10%, #202028 0%, var(--charcoal) 60%) fixed;
  color: var(--cream);
  font-family: var(--body);
  font-size: 19px;           /* VT323 renders small; bump the base */
  line-height: 1.35;
  position: relative;
  min-height: 100vh;
}

.wrap{ max-width: 1180px; margin: 0 auto; padding: 0 28px; }

a{ color: var(--n64-yellow); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* faint dither, evokes low-res console UI, sits under everything */
.halftone-overlay{
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: radial-gradient(var(--cream) 1px, transparent 1.4px);
  background-size: 5px 5px;
}

/* ===== CRT OVERLAY (opt-in, toggled by body.crt-mode) ===== */
.crt-overlay{
  position: fixed; inset: 0;
  z-index: 60;
  pointer-events: none;
  display: none;
  /* aperture grille (RGB) + horizontal scanlines layered together */
  background:
    repeating-linear-gradient(
      to right,
      rgba(255,0,0,0.05)   0px, rgba(255,0,0,0.05)   1px,
      rgba(0,255,0,0.045)  1px, rgba(0,255,0,0.045)  2px,
      rgba(0,0,255,0.05)   2px, rgba(0,0,255,0.05)   3px),
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0)     0px, rgba(0,0,0,0)     2px,
      rgba(0,0,0,0.22)  3px, rgba(0,0,0,0.22)  3px);
}
body.crt-mode .crt-overlay{ display: block; }
/* gentle vignette + a slow brightness flicker for the tube feel */
.crt-overlay::after{
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 160px 40px rgba(0,0,0,0.55);
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,0.35) 100%);
  animation: crt-flicker 6s steps(60) infinite;
}
@keyframes crt-flicker{
  0%,100%{ opacity: 0.92; }
  47%{ opacity: 0.97; }
  50%{ opacity: 0.86; }
  53%{ opacity: 0.97; }
}

/* ===== LEDs (glowing hardware indicators) =====
   One reusable bead: a bright center + a colored bloom (box-shadow).
   Color is set through --led, so `.led-green/red/blue/yellow` (or an
   inline override) recolor both the bead and its glow at once.
   `.led-off` is the dark, unlit state; `.pulse` adds a soft breathing
   glow for "power/live" lights. */
.led{
  --led: var(--n64-green);
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--led) 62%);
  /* layered bloom: hot white core -> tight color -> wide color halo */
  box-shadow:
    0 0 3px 1px rgba(255,255,255,0.9),
    0 0 7px 2px var(--led),
    0 0 15px 4px var(--led),
    0 0 26px 7px var(--led),
    0 0 42px 12px var(--led),
    inset 0 0 2px rgba(0,0,0,0.4);
}
.led-sm{ width: 7px; height: 7px; }
.led-lg{ width: 13px; height: 13px; }
.led-green{  --led: var(--n64-green); }
.led-red{    --led: var(--n64-red); }
.led-blue{   --led: var(--n64-blue); }
.led-yellow{ --led: var(--n64-yellow); }
.led-off{
  background: radial-gradient(circle at 35% 30%, #4a4a50, #16161b 62%);
  box-shadow: inset 0 0 3px rgba(0,0,0,0.85), inset 0 1px 1px rgba(255,255,255,0.08);
}
.led.pulse{ animation: led-pulse 1.9s ease-in-out infinite; }
@keyframes led-pulse{
  0%,100%{ filter: brightness(0.75) saturate(1); }
  50%{ filter: brightness(1.9) saturate(1.3); }
}

/* ===== HEADER ===== */
.site-header{
  position: sticky; top: 0; z-index: 40;
  background: rgba(20,20,26,0.90);
  backdrop-filter: blur(6px);
  border-bottom: 4px solid var(--n64-blue);
  box-shadow: 0 3px 0 rgba(0,0,0,0.5);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px 28px;
}
.logo{
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--n64-blue);
}
.logo-dot{ color: var(--n64-red); }
.header-nav{ display:flex; gap: 8px; flex-wrap: wrap; }
.nav-link{
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.5px;
  background: var(--charcoal-3);
  border: 2px solid var(--plastic-dk);
  color: var(--cream);
  padding: 9px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  box-shadow: var(--bevel-raise);
  transition: color 0.12s, background 0.12s, transform 0.06s;
}
.nav-link:hover{ color: var(--n64-yellow); }
.nav-link:active{ transform: translateY(2px); box-shadow: var(--bevel-inset); }
.nav-link:focus-visible{ outline: 2px solid var(--n64-yellow); outline-offset: 2px; }

/* CRT toggle sits in the nav; lights up green when active */
.crt-toggle.is-on{
  color: var(--charcoal);
  background: var(--n64-green);
  border-color: #0d0d10;
  text-shadow: none;
  box-shadow: var(--bevel-raise), 0 0 8px 1px var(--n64-green), 0 0 18px 3px rgba(56,187,89,0.7);
}

/* ===== HERO ===== */
.hero{
  position: relative; z-index: 1;
  padding: 72px 28px 56px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.eyebrow{
  font-family: var(--label);
  color: var(--n64-green);
  font-size: 11px;
  letter-spacing: 2px;
  margin: 0 0 18px;
}
.hero-title{
  font-family: var(--display);
  font-size: clamp(26px, 5.4vw, 54px);
  line-height: 1.25;
  margin: 0 0 22px;
  color: var(--cream);
  /* chunky, pixel-friendly multi-color drop stack (blue → red) */
  text-shadow:
    3px 3px 0 var(--n64-blue),
    6px 6px 0 var(--n64-red),
    8px 8px 0 rgba(0,0,0,0.35);
}
.hero-sub{
  max-width: 46ch;
  color: var(--muted);
  font-size: 21px;
}

/* ===== CARTRIDGE SLOT (signature element) ===== */
.slot-wrap{ display:flex; flex-direction: column; gap: 14px; }
.cart-slot{
  position: relative;
  background: linear-gradient(180deg, var(--charcoal-3), var(--charcoal-2));
  border: 3px dashed rgba(244,197,24,0.55);
  border-radius: 6px;
  padding: 46px 28px 30px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  color: var(--n64-yellow);
  text-align: center;
  box-shadow: var(--bevel-inset), var(--drop);
}
/* The old "cartridge teeth" strip sat over the top edge and read as a
   dark, jagged line that clashed with the clean dashed border on the
   other three sides. Hide it so all four sides match. */
.cart-slot .slot-teeth{ display: none; }
.cart-slot:hover{ border-color: var(--n64-yellow); transform: translateY(-2px); }
.cart-slot:focus-visible{ outline: 2px solid var(--n64-blue); outline-offset: 4px; }
.cart-slot.drag-over{
  border-color: var(--n64-green);
  border-style: solid;
  background: linear-gradient(180deg, rgba(56,187,89,0.16), var(--charcoal-2));
  transform: scale(1.01);
}
.cart-slot.has-file{
  border-style: solid;
  border-color: var(--n64-green);
}
/* status light in the slot corner: amber while idle, green once a
   cartridge is in (has-file) or hovering over the slot (drag-over) */
.slot-led{
  position: absolute; top: 14px; right: 16px; z-index: 2;
  --led: var(--n64-yellow);
}
.cart-slot.has-file .slot-led,
.cart-slot.drag-over .slot-led{ --led: var(--n64-green); }

.slot-label{ display:flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.slot-title{ font-family: var(--display); font-size: 15px; line-height: 1.4; color: var(--cream); text-shadow: 2px 2px 0 rgba(0,0,0,0.5); }
.slot-sub{ font-family: var(--body); font-size: 18px; color: var(--muted); }
.slot-formats{
  font-family: var(--label);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 1px;
  color: var(--n64-blue);
}

/* ===== SECTION HEAD ===== */
.section-head{
  display:flex; align-items: baseline; justify-content: space-between;
  border-bottom: 4px solid var(--n64-red);
  padding-bottom: 12px;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h2{
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--n64-red);
}
.section-count{
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--n64-yellow);
}

/* ===== ARCADE MACHINE (coin-drop play target) ===== */
.arcade-machine{
  margin: 0 0 36px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.arcade-machine-cab{
  position: relative;
  width: 100%; max-width: 300px;
  background: linear-gradient(180deg, var(--charcoal-3) 0%, var(--charcoal) 100%);
  border: 3px solid #0d0d10;
  border-radius: 14px;
  box-shadow: var(--bevel-raise), var(--drop);
  overflow: hidden;
  padding-bottom: 22px;
}
/* power light on the cabinet's marquee corner */
.cab-power{ position: absolute; top: 13px; right: 14px; z-index: 2; }
.arcade-machine-marquee{
  padding: 12px 14px 8px;
  text-align: center;
  background:
    radial-gradient(120% 180% at 50% -40%, rgba(244,197,24,0.28), transparent 60%),
    linear-gradient(135deg, var(--n64-blue) 0%, #1c4fb8 100%);
}
.arcade-machine-marquee span{
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--cream);
  text-shadow: 0 0 10px rgba(244,197,24,0.7), 2px 2px 0 rgba(0,0,0,0.5);
}
.arcade-machine-screen{
  margin: 14px 18px 0;
  aspect-ratio: 4/3;
  background: #06070a;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--bevel-inset), inset 0 0 40px rgba(0,0,0,0.85);
  padding: 12px;
}
.arcade-machine-screen-text{
  font-family: var(--label);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 1px;
  color: var(--n64-green);
  text-align: center;
  text-shadow: 0 0 6px rgba(56,187,89,0.9), 0 0 14px rgba(56,187,89,0.7), 0 0 24px rgba(56,187,89,0.5);
  animation: coin-blink 1.2s steps(2, start) infinite;
}
@keyframes coin-blink{ 50%{ opacity: 0.15; } }

.coin-slot{
  margin: 18px auto 0;
  width: 84px; height: 26px;
  background: linear-gradient(180deg, #2c2b2f, #17161a);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--bevel-inset);
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.coin-slot-slit{
  width: 46px; height: 6px;
  border-radius: 3px;
  background: #000;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
}
.coin-slot.drag-over{
  background: linear-gradient(180deg, #3a3820, #221f10);
  box-shadow: var(--bevel-inset), 0 0 0 3px rgba(244,197,24,0.55), 0 0 18px rgba(244,197,24,0.55);
  transform: scale(1.06);
}
.coin-slot.coin-accepted{ animation: coin-flash 0.5s ease; }
@keyframes coin-flash{
  0%{ box-shadow: var(--bevel-inset), 0 0 0 3px rgba(56,187,89,0.7), 0 0 24px rgba(56,187,89,0.7); }
  100%{ box-shadow: var(--bevel-inset); }
}
.arcade-machine-hint{
  font-family: var(--body);
  font-size: 17px;
  color: var(--muted);
  text-align: center;
  max-width: 42ch;
  margin: 0;
}

/* ===== LIBRARY ===== */
.library{ position: relative; z-index: 1; padding: 40px 28px 80px; }
.library-empty{
  border: 3px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--faint);
  font-family: var(--body);
  font-size: 19px;
}
.library-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

/* -- Cartridge card: a little plastic hardware panel -- */
.cart-card{
  background: var(--charcoal-2);
  border: 2px solid #0d0d10;
  border-radius: var(--radius);
  padding: 20px 14px 14px;
  overflow: visible;
  display:flex; flex-direction: column; align-items: center;
  gap: 10px;
  text-align: center;
  box-shadow: var(--bevel-raise), 0 6px 14px rgba(0,0,0,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cart-card:hover{
  transform: translateY(-3px);
  box-shadow: var(--bevel-raise), 0 12px 22px rgba(0,0,0,0.55), 0 0 0 2px var(--n64-yellow);
}

/* Each ROM renders as a draggable coin: drag it onto the arcade machine's
   coin slot to play, or just click/Enter it -- drag-and-drop has no
   built-in touch or keyboard equivalent, so both paths must work. */
.cart-thumb{
  width: 118px; height: 118px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 4px solid var(--n64-yellow);
  background:
    repeating-linear-gradient(135deg, var(--n64-blue) 0 10px, #1c4fb8 10px 20px);
  display:flex; align-items:center; justify-content:center;
  position: relative;
  cursor: grab;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(255,255,255,0.30),
    inset 0 -3px 6px rgba(0,0,0,0.40);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.cart-thumb:hover{ transform: scale(1.04); }
.cart-thumb:active{ cursor: grabbing; }
.cart-thumb.dragging{ opacity: 0.35; transform: scale(0.88); }
.cart-thumb:focus-visible{ outline: 2px solid var(--n64-yellow); outline-offset: 4px; }
.cart-thumb::after{
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background-image: radial-gradient(var(--charcoal) 1px, transparent 1.4px);
  background-size: 5px 5px;
  opacity: 0.18;
}
.cart-thumb .cart-sys{
  font-family: var(--label);
  font-size: 11px;
  line-height: 1.4;
  color: var(--cream);
  text-shadow: 1px 1px 0 var(--charcoal);
  position: relative; z-index: 1;
  letter-spacing: 0.5px;
  padding: 0 10px;
}
.cart-art{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  display: none;
}
.cart-thumb.has-art .cart-art{ display: block; }
.cart-thumb.has-art .cart-sys{ display: none; }
.cart-thumb.has-art::after{ z-index: 2; opacity: 0.08; }
.cart-play-hint{
  position: absolute; inset: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,26,0.55);
  color: var(--cream);
  font-size: 22px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
  pointer-events: none;
}
.cart-thumb:hover .cart-play-hint,
.cart-thumb:focus-visible .cart-play-hint{ opacity: 1; }

.cart-body{ display:flex; flex-direction: column; align-items: center; gap: 8px; flex:1; width: 100%; }
.cart-name{
  font-family: var(--body);
  font-size: 19px;
  color: var(--cream);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-meta{
  font-family: var(--label);
  font-size: 9px;
  color: var(--n64-green);
  letter-spacing: 0.5px;
}
.cart-experimental{
  font-family: var(--label);
  font-size: 8px;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  border-radius: var(--radius);
  color: var(--n64-yellow);
  border: 1px solid var(--n64-yellow);
  cursor: help;
}
.cart-actions{ display:flex; gap: 8px; margin-top: auto; width: 100%; }
.cart-actions .btn-ghost{ flex: 1 1 auto; }

/* ===== BUTTONS (heavy plastic click) ===== */
.btn{
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.5px;
  border-radius: var(--radius);
  border: 2px solid #0d0d10;
  padding: 10px 10px;
  cursor: pointer;
  flex: 1;
  color: var(--cream);
  background: linear-gradient(180deg, var(--charcoal-3), var(--charcoal-2));
  text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
  /* raised bevel + a solid "wall" underneath = physical button height */
  box-shadow: var(--bevel-raise), 0 4px 0 rgba(0,0,0,0.55);
  transition: transform 0.05s ease, box-shadow 0.05s ease, filter 0.12s ease;
}
.btn:hover{ filter: brightness(1.12); }
.btn:active{
  transform: translateY(4px);
  box-shadow: var(--bevel-inset), 0 0 0 rgba(0,0,0,0.55);
}
.btn:focus-visible{ outline: 2px solid var(--n64-yellow); outline-offset: 2px; }

.btn-play{ background: linear-gradient(180deg, #ff5647, var(--n64-red)); border-color: #7c150d; }
.btn-play:active{ box-shadow: var(--bevel-inset), 0 0 0 rgba(0,0,0,0.55); }
.btn-ghost{
  background: linear-gradient(180deg, var(--charcoal-3), var(--charcoal-2));
  color: var(--muted);
  flex: 0 0 auto;
}
.btn-ghost:hover{ color: var(--n64-red); filter: brightness(1.12); }

/* ===== BIOS FILES ===== */
.bios{ position: relative; z-index: 1; padding: 20px 28px 40px; }
.bios-intro{
  color: var(--muted);
  font-size: 18px;
  max-width: 62ch;
  margin: 0 0 24px;
}
.bios-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.bios-card{
  background: var(--charcoal-2);
  border: 2px solid #0d0d10;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--bevel-raise), 0 6px 14px rgba(0,0,0,0.4);
}
.bios-card-head{ display:flex; align-items:center; justify-content: space-between; gap: 8px; }
/* LED + name grouped on the left; the LED glows green once a BIOS is stored */
.bios-card-title{ display:inline-flex; align-items:center; gap: 9px; min-width: 0; }
.bios-card-label{
  font-family: var(--display);
  font-size: 12px;
  color: var(--cream);
  text-shadow: 1px 1px 0 var(--n64-blue);
}
.bios-card-req{
  font-family: var(--label);
  font-size: 8px;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  border-radius: var(--radius);
}
.bios-card-req.required{ color: var(--n64-red); border: 1px solid var(--n64-red); }
.bios-card-req.optional{ color: var(--n64-green); border: 1px solid var(--n64-green); }
.bios-card-status{
  font-family: var(--body);
  font-size: 17px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bios-card-actions{ display: flex; gap: 8px; }

/* ===== DISC SYSTEM PICKER ===== */
.disc-picker-modal{
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.disc-picker-modal.open{ display: flex; }
.disc-picker-shell{
  width: 100%; max-width: 420px;
  background: var(--charcoal-2);
  border: 3px solid var(--n64-yellow);
  border-radius: 8px;
  padding: 26px 24px;
  text-align: center;
  box-shadow: var(--bevel-raise), var(--drop);
}
.disc-picker-shell h3{
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.4;
  color: var(--n64-yellow);
  margin: 0 0 12px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.disc-picker-file{
  font-family: var(--body);
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 20px;
  word-break: break-all;
}
.disc-picker-options{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.disc-pick-btn{ width: 100%; }
.disc-pick-cancel{ width: 100%; }

/* ===== LEGAL ===== */
.legal{ position: relative; z-index: 1; padding: 20px 28px 90px; }
.legal-card{
  background: var(--charcoal-2);
  border: 2px solid #0d0d10;
  border-left: 6px solid var(--n64-yellow);
  padding: 30px 32px;
  border-radius: var(--radius);
  box-shadow: var(--bevel-raise), 0 8px 18px rgba(0,0,0,0.45);
}
.legal-card h2{
  font-family: var(--display);
  font-size: 17px;
  margin: 0 0 20px;
  color: var(--n64-yellow);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.legal-list{ margin: 0; padding-left: 20px; display:flex; flex-direction: column; gap: 14px; }
.legal-list li{ color: var(--muted); font-size: 18px; line-height: 1.4; }
.legal-list strong{ color: var(--cream); }

/* ===== PLAYER MODAL: ARCADE CABINET ===== */
.player-modal{
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.player-modal.open{ display: flex; }

.arcade-cabinet{
  width: 100%; max-width: 760px;
  background: linear-gradient(180deg, var(--charcoal-3) 0%, var(--charcoal) 100%);
  border: 3px solid #0d0d10;
  border-radius: 22px;
  box-shadow: var(--bevel-raise), 0 30px 70px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* -- Marquee -- */
.cabinet-marquee{
  position: relative;
  padding: 18px 20px 10px;
  background:
    radial-gradient(120% 180% at 50% -40%, rgba(244,197,24,0.25), transparent 60%),
    linear-gradient(135deg, var(--n64-blue) 0%, #1c4fb8 100%);
  text-align: center;
}
.marquee-bulbs{
  height: 7px;
  background-image: repeating-radial-gradient(circle, var(--n64-yellow) 0 2.5px, transparent 3.5px 15px);
  opacity: 0.95;
  filter: drop-shadow(0 0 4px rgba(244,197,24,1)) drop-shadow(0 0 9px rgba(244,197,24,0.85));  /* make the bulbs read as lit */
}
.marquee-bulbs-bottom{ margin-top: 10px; }
/* power light on the player cabinet's marquee corner */
.cabinet-power{ position: absolute; top: 14px; right: 16px; z-index: 3; }
.marquee-title{
  display: block;
  font-family: var(--display);
  font-size: clamp(14px, 3vw, 22px);
  line-height: 1.3;
  color: var(--cream);
  text-shadow: 0 0 10px rgba(244,197,24,0.75), 2px 2px 0 rgba(0,0,0,0.5);
  padding: 12px 8px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* -- Screen -- */
.cabinet-screen{
  padding: 18px 22px;
  background: #06070a;
}
.screen-inner{
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--bevel-inset), inset 0 0 50px rgba(0,0,0,0.85);
}
.player-frame{ position: absolute; inset: 0; }
.screen-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.18) 3px
  );
  z-index: 4;
  pointer-events: none;
}
.screen-vignette{
  position: absolute; inset: 0;
  box-shadow: inset 0 0 80px 20px rgba(0,0,0,0.65);
  z-index: 4;
  pointer-events: none;
}

/* -- Control panel -- */
.cabinet-controls{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px 20px;
  background: linear-gradient(180deg, var(--charcoal-3) 0%, var(--charcoal) 100%);
  border-top: 2px solid rgba(236,231,214,0.08);
}
.joystick{ position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.joystick-base{
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 46px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--plastic), #17161a 75%);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
}
.joystick-shaft{
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: 6px; height: 26px;
  background: linear-gradient(180deg, var(--plastic-lt), var(--plastic));
  border-radius: 3px;
}
.joystick-ball{
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff5647, var(--n64-red) 70%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset -2px -2px 4px rgba(0,0,0,0.3);
}
.action-buttons{ display: flex; gap: 10px; }
/* the four N64 face-button colors: A(blue) B(green) C(yellow) Start(red) */
.arcade-btn{
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 3px 5px rgba(0,0,0,0.5), inset -2px -2px 4px rgba(0,0,0,0.25), inset 2px 2px 4px rgba(255,255,255,0.25);
}
.btn-yellow{ background: radial-gradient(circle at 35% 30%, #ffe27a, var(--n64-yellow) 70%); }
.btn-cyan{ background: radial-gradient(circle at 35% 30%, #6fa0ff, var(--n64-blue) 70%); }
.btn-red{ background: radial-gradient(circle at 35% 30%, #ff5647, var(--n64-red) 70%); }
.btn-cream{ background: radial-gradient(circle at 35% 30%, #7fe39a, var(--n64-green) 70%); }

.exit-btn{
  flex: 0 0 auto;
  border: 2px solid #7c150d;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff5647, var(--n64-red));
  box-shadow: 0 5px 0 #7c150d, 0 8px 12px rgba(0,0,0,0.5);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.exit-btn:active{ box-shadow: 0 0 0 #7c150d, 0 3px 6px rgba(0,0,0,0.5); transform: translateY(5px); }
.exit-btn-face{
  display: block;
  padding: 11px 18px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--cream);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.exit-btn:hover .exit-btn-face{ color: var(--n64-yellow); }
.exit-btn:focus-visible{ outline: 2px solid var(--n64-yellow); outline-offset: 3px; }

.player-iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  position: relative;
  z-index: 1;
}

@media (max-width: 560px){
  .cabinet-controls{ padding: 14px 16px 18px; gap: 12px; }
  .joystick{ width: 42px; height: 42px; }
  .arcade-btn{ width: 24px; height: 24px; }
  .marquee-title{ font-size: clamp(12px, 5vw, 18px); }
}

/* ===== FOOTER ===== */
.site-footer{
  position: relative; z-index: 1;
  border-top: 4px solid var(--n64-blue);
  padding: 22px 28px;
}
.site-footer p{
  font-family: var(--body);
  font-size: 17px;
  color: var(--faint);
  margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 880px){
  .hero{ grid-template-columns: 1fr; padding-top: 48px; }
  .hero-title{ font-size: clamp(22px, 8vw, 40px); }
}
@media (max-width: 480px){
  .wrap{ padding: 0 18px; }
  .header-inner{ padding: 12px 18px; }
  .logo{ font-size: 15px; }
}
