/* =========================================================================
   Agency Action: Replay — arcade cabinet design system
   Display type: Press Start 2P · Reading type: VT323
   Layout: marquee (backlit sign) → bezel/CRT screen → control deck
   ========================================================================= */
:root {
  --display: 'Press Start 2P', monospace;
  --body: 'VT323', 'Courier New', monospace;

  --bg-0: #04050d;
  --bg-1: #0b0f24;
  --bg-2: #131a38;
  --ink: #eef2ff;
  --muted: #8b93b8;
  --line: #283052;

  --gold: #ffcf3f;
  --coral: #ff4d5d;
  --cyan: #3ef0d4;
  --violet: #8a7bff;

  --cab-1: #23263a;
  --cab-2: #15172a;
  --cab-3: #0c0d1a;

  --glow-gold: 0 0 18px rgba(255, 207, 63, 0.45);
  --glow-cyan: 0 0 18px rgba(62, 240, 212, 0.4);
  --glow-coral: 0 0 18px rgba(255, 77, 93, 0.45);
}

* { box-sizing: border-box; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* the arcade room: photo backdrop + gentle darkening so the cabinet pops */
  background:
    radial-gradient(ellipse 75% 65% at 50% 45%, rgba(2, 3, 8, 0) 35%, rgba(2, 3, 8, 0.55) 100%),
    url('assets/arcade-room-bg.jpg') center / cover no-repeat,
    #020308;
  font-family: var(--body);
  color: var(--ink);
  padding: 14px 10px calc(34px + env(safe-area-inset-bottom, 0px));
}

/* =========================================================================
   THE CABINET
   ========================================================================= */
#stage {
  perspective: 950px;
  perspective-origin: 50% 40%;
  /* the 3D projection pushes the deck below its layout box — reserve room */
  padding-bottom: 110px;
}

#cabinet {
  position: relative;
  transform: rotateX(6deg);
  transform-style: preserve-3d;
  will-change: transform;
  /* the cabinet plane must not eat clicks aimed at tilted children */
  pointer-events: none;
  display: flex;
  flex-direction: column;
  width: 800px;
  max-width: 98vw;
  border-radius: 22px;
  padding: 14px 18px 16px;
  perspective: 900px;
  perspective-origin: 50% 36%;
}

/* cabinet body sits behind the tilted planes so they never intersect it */
.cab-bg {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(165deg, var(--cab-1) 0%, var(--cab-2) 40%, var(--cab-3) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 2px rgba(0, 0, 0, 0.5),
    0 40px 90px rgba(0, 0, 0, 0.8);
  transform: translateZ(-70px) scale(1.075);
  pointer-events: none;
}

/* side walls span the full depth from front face to the back plane,
   so no background ever peeks between wall and body */
.cab-side {
  position: absolute;
  top: 12px; bottom: 8px;
  width: 76px;
  background: linear-gradient(90deg, #07080f, #14172a 55%, #1f2237);
  pointer-events: none;
}
.cab-side.left {
  left: -74px;
  transform: rotateY(77deg);
  transform-origin: 100% 50%;
  box-shadow: inset -8px 0 14px rgba(0, 0, 0, 0.55);
}
.cab-side.right {
  right: -74px;
  background: linear-gradient(270deg, #07080f, #14172a 55%, #1f2237);
  transform: rotateY(-77deg);
  transform-origin: 0% 50%;
  box-shadow: inset 8px 0 14px rgba(0, 0, 0, 0.55);
}
/* glow pooling on the arcade floor beneath the cabinet */
#cabinet::after {
  content: '';
  position: absolute;
  left: 6%; right: 6%; bottom: -30px;
  height: 34px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(96, 110, 255, 0.22), transparent 70%);
  filter: blur(7px);
  pointer-events: none;
}

/* ---------- marquee ---------- */
#marquee {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #060710;
  transform: rotateX(11deg);
  transform-origin: 50% 100%;
  margin: 0 10px;
  background:
    radial-gradient(ellipse 90% 130% at 50% 50%, #2c1d54 0%, #190f33 60%, #100a22 100%);
  box-shadow:
    inset 0 0 40px rgba(138, 123, 255, 0.25),
    0 6px 24px rgba(0, 0, 0, 0.5);
}

.marquee-bulbs {
  height: 8px;
  background-image: radial-gradient(circle 2.2px at 50% 50%, #ffe9a3 0%, #c79a23 70%, transparent 71%);
  background-size: 18px 8px;
  background-position: 9px 0;
  animation: bulbs 1.4s steps(2) infinite;
  opacity: 0.9;
}
@keyframes bulbs {
  0% { background-position: 9px 0; }
  100% { background-position: 27px 0; }
}

.marquee-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  padding: 14px 10px 15px;
}
.marquee-mic {
  font-size: 24px;
  align-self: center;
  filter: drop-shadow(0 0 12px rgba(255, 207, 63, 0.7));
}
.marquee-name {
  font-family: var(--display);
  font-size: 21px;
  color: var(--gold);
  letter-spacing: 3px;
  text-shadow:
    2px 2px 0 var(--coral),
    0 0 26px rgba(255, 207, 63, 0.75),
    0 0 60px rgba(255, 160, 60, 0.4);
}
.marquee-sub {
  font-family: var(--display);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 5px;
  text-shadow: 0 0 18px rgba(62, 240, 212, 0.85);
}

#btn-mute {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 15px;
  padding: 5px 8px;
  cursor: pointer;
  z-index: 2;
  transition: border-color 0.15s;
}
#btn-mute:hover { border-color: var(--gold); }
#btn-mute.muted { opacity: 0.55; }
#marquee { position: relative; pointer-events: auto; }

.deck-edge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px -16px -14px;
  padding: 4px 24px 4px;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 24, 0.9) 40%);
}
.edge-line {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #2e6fd8 30%, #54b0ff 50%, #2e6fd8 70%, transparent);
  box-shadow: 0 0 9px rgba(80, 160, 255, 0.55);
  opacity: 0.8;
}
.edge-icon { filter: drop-shadow(0 0 6px rgba(90, 180, 255, 0.8)); flex: 0 0 auto; }

/* ---------- bezel + CRT ---------- */
#bezel {
  pointer-events: auto;
  margin-top: 3px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(170deg, #101223 0%, #07080f 70%);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.05),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8),
    0 14px 28px rgba(0, 0, 0, 0.55);
  transform: rotateX(3deg);
  transform-origin: 50% 100%;
}

#game-frame {
  position: relative;
  width: 100%;
  height: min(66vh, 640px);
  min-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

#crt-glow {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 62;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.055) 46%, rgba(255, 255, 255, 0.015) 56%, transparent 62%),
    radial-gradient(ellipse 70% 45% at 50% 8%, rgba(98, 110, 255, 0.10), transparent 70%);
}

#scanlines {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

#vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 61;
  background: radial-gradient(ellipse 105% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- control deck ---------- */
#control-deck {
  pointer-events: auto;
  margin-top: 6px;
  border-radius: 12px 12px 16px 16px;
  border: 3px solid #060710;
  border-bottom: 12px solid #05060c;
  transform: rotateX(29deg);
  transform-origin: 50% 0%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 45%),
    radial-gradient(circle 1px at 13% 28%, rgba(255,255,255,0.07) 99%, transparent),
    radial-gradient(circle 1px at 67% 61%, rgba(255,255,255,0.05) 99%, transparent),
    radial-gradient(circle 1px at 41% 79%, rgba(255,255,255,0.06) 99%, transparent),
    radial-gradient(circle 1px at 88% 23%, rgba(255,255,255,0.05) 99%, transparent),
    linear-gradient(178deg, #1c2347 0%, #131838 55%, #0a0d20 100%);
  background-size: 100% 100%, 90px 70px, 110px 80px, 70px 90px, 130px 60px, 100% 100%;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.06),
    0 22px 34px rgba(0, 0, 0, 0.65);
  padding: 6px 16px 20px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

/* joystick */
.joystick { position: relative; width: 74px; height: 66px; flex: 0 0 auto; }
.joy-arrow {
  position: absolute;
  font-size: 8px;
  color: rgba(139, 147, 184, 0.5);
  font-family: var(--body);
}
.joy-arrow.n { top: -4px; left: 50%; transform: translateX(-50%); }
.joy-arrow.s { bottom: -10px; left: 50%; transform: translateX(-50%); }
.joy-arrow.w { left: -4px; top: 58%; }
.joy-arrow.e { right: -4px; top: 58%; }
.joy-boot {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 28%, #2c2c34, #0d0d12 75%);
  border: 2px solid #000;
  box-shadow:
    0 -7px 0 -3px #1a1a21,
    0 -13px 0 -7px #222229,
    inset 0 2px 2px rgba(255, 255, 255, 0.12);
  z-index: 1;
}
.joy-base {
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 32%, #3a3f55, #14172a 72%);
  border: 2px solid #000;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.16),
    inset 0 -4px 8px rgba(0, 0, 0, 0.6),
    0 5px 10px rgba(0, 0, 0, 0.5);
}
.joy-stick {
  position: absolute;
  bottom: 11px; left: 50%;
  width: 7px; height: 36px;
  margin-left: -3.5px;
  transform-origin: 50% 100%;
  animation: joyWiggle 6s ease-in-out infinite;
  z-index: 1;
}
.joy-shaft {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #3a3a44, #d9dde6 45%, #2a2a32);
}
.joy-ball {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #ff9d9d, #e62117 58%, #6f0c06);
  border: 2px solid #000;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.45), 0 5px 10px rgba(0, 0, 0, 0.55);
}
@keyframes joyWiggle {
  0%, 52%, 78%, 100% { transform: perspective(500px) rotateX(-38deg) rotateZ(0deg); }
  58% { transform: perspective(500px) rotateX(-38deg) rotateZ(-13deg); }
  64% { transform: perspective(500px) rotateX(-38deg) rotateZ(9deg); }
  70% { transform: perspective(500px) rotateX(-38deg) rotateZ(-5deg); }
}

.screw {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #6a7290, #2a2f49 65%, #11142a);
  border: 1px solid #000;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.screw::after {
  content: '';
  position: absolute;
  top: 50%; left: 18%; right: 18%;
  height: 2px;
  margin-top: -1px;
  background: #0a0c1a;
  transform: rotate(35deg);
}
.screw.tl { top: 9px; left: 11px; }
.screw.tr { top: 9px; right: 11px; }
.screw.bl { bottom: 9px; left: 11px; }
.screw.br { bottom: 9px; right: 11px; }
.screw.tr::after, .screw.bl::after { transform: rotate(-50deg); }

/* start button */
.start-btn { background: none; border: none; padding: 0; font: inherit; }
.ab-white {
  background: radial-gradient(circle at 35% 30%, #ffffff, #dde2ee 58%, #9aa3b8);
  color: #e62117;
  font-size: 18px;
}
.start-btn .ab-label { color: #d8dde8; }

/* action-button cluster: arcade fighter stagger */
.btn-cluster { display: flex; flex-direction: column; }
.cluster-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.cluster-row.single .arcade-btn:nth-child(even) { transform: translateY(6px); }
.deck-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 3px;
  color: #7d87b6;
  margin: 2px 0 8px;
  background: none;
  border: none;
  width: 100%;
  cursor: default;
  padding: 0;
}
.deck-chev { display: none; }
.deck-label .rule {
  flex: 0 1 110px;
  height: 5px;
  background:
    repeating-linear-gradient(90deg, #3a4470 0 4px, transparent 4px 9px) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #2a3258 0 4px, transparent 4px 9px) 0 100% / 100% 2px no-repeat;
}
.arcade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  cursor: pointer;
}
.ab-cap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  border: 3px solid rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  transform: perspective(600px) rotateX(-18deg);
  transform-origin: 50% 100%;
  box-shadow:
    inset 0 5px 7px rgba(255, 255, 255, 0.38),
    inset 0 -7px 9px rgba(0, 0, 0, 0.45),
    0 0 0 4px #101018,
    0 3px 0 4px #000,
    0 7px 0 4px rgba(0, 0, 0, 0.7),
    0 12px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.07s, box-shadow 0.07s, filter 0.15s;
}
.ab-cap::after {
  content: '';
  position: absolute;
  top: 7%; left: 16%;
  width: 46%; height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.75), transparent 70%);
  pointer-events: none;
}
.ab-cap svg { width: 17px; height: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4)); }
.arcade-btn:hover .ab-cap { filter: brightness(1.18) saturate(1.1); }
.arcade-btn:active .ab-cap {
  transform: perspective(600px) rotateX(-18deg) translateY(6px);
  box-shadow:
    inset 0 5px 7px rgba(255, 255, 255, 0.25),
    inset 0 -4px 7px rgba(0, 0, 0, 0.5),
    0 0 0 4px #101018,
    0 1px 0 4px #000,
    0 5px 10px rgba(0, 0, 0, 0.5);
}
.ab-orange { background: radial-gradient(circle at 35% 30%, #ffb163, #f07b16 60%, #a44d05); }
.ab-purple { background: radial-gradient(circle at 35% 30%, #c9a6ff, #8e4fe8 60%, #5c2b9e); }
.ab-green  { background: radial-gradient(circle at 35% 30%, #7ce8a2, #1db954 60%, #0e7434); }
.ab-red    { background: radial-gradient(circle at 35% 30%, #ff8d8d, #e62117 60%, #99140d); }
.ab-blue   { background: radial-gradient(circle at 35% 30%, #8fc9ff, #2f7fe0 60%, #1a4e96); }
.ab-label {
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--muted);
}
.arcade-btn:hover .ab-label { color: var(--ink); }

.hidden { display: none !important; }

/* =========================================================================
   ON-SCREEN UI
   ========================================================================= */
.btn {
  font-family: var(--display);
  font-size: 12px;
  padding: 15px 24px;
  margin-top: 18px;
  color: #161002;
  background: linear-gradient(180deg, #ffe27a 0%, var(--gold) 55%, #f0b428 100%);
  border: 3px solid #0a0803;
  border-radius: 4px;
  box-shadow: 0 6px 0 #7e5e06, var(--glow-gold);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #7e5e06, var(--glow-gold); }
.btn:focus-visible { outline: 3px dashed var(--cyan); outline-offset: 3px; }

.btn-alt {
  color: #021410;
  background: linear-gradient(180deg, #7ffce9 0%, var(--cyan) 55%, #1cc9ad 100%);
  box-shadow: 0 6px 0 #0e6b5c, var(--glow-cyan);
}
.btn-alt:active { box-shadow: 0 2px 0 #0e6b5c, var(--glow-cyan); }

.btn-big { font-size: 14px; padding: 18px 34px; }

.blink-slow { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 6px 0 #7e5e06, 0 0 10px rgba(255, 207, 63, 0.25); }
  50% { box-shadow: 0 6px 0 #7e5e06, 0 0 30px rgba(255, 207, 63, 0.65); }
}

.mini-btn {
  font-family: var(--display);
  background: var(--bg-2);
  color: var(--muted);
  border: 2px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  padding: 9px 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.mini-btn:hover { color: var(--coral); border-color: var(--coral); }

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  text-align: center;
  padding: 26px;
  overflow-y: auto;
  animation: screenIn 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.screen-kicker {
  font-family: var(--display);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 4px;
  text-shadow: var(--glow-cyan);
  margin: 0 0 14px;
}

/* ---------- title ---------- */
.title-stack { display: flex; flex-direction: column; align-items: center; }
.title-mic {
  font-size: 46px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 18px rgba(255, 207, 63, 0.55));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

#screen-title h1 {
  font-family: var(--display);
  font-size: clamp(22px, 5vw, 36px);
  line-height: 1.35;
  margin: 0;
  color: var(--gold);
  text-shadow:
    3px 3px 0 var(--coral),
    6px 6px 0 #1a0b22,
    0 0 34px rgba(255, 207, 63, 0.4);
  letter-spacing: 3px;
}
#screen-title h1 span {
  display: block;
  color: var(--ink);
  text-shadow:
    3px 3px 0 var(--violet),
    6px 6px 0 #1a0b22,
    0 0 34px rgba(138, 123, 255, 0.45);
}
.title-replay {
  font-family: var(--display);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 6px;
  margin-top: 18px;
  text-shadow: var(--glow-cyan);
}
#title-scene {
  image-rendering: pixelated;
  margin-top: 16px;
  max-width: 88%;
}
.tagline {
  font-size: 20px;
  color: var(--muted);
  letter-spacing: 3px;
  margin: 22px 0 2px;
}
.credits-link {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 3px;
  color: #6a74a3;
  background: none;
  border: none;
  margin-top: 28px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s, text-shadow 0.15s;
}
.credits-link:hover { color: var(--gold); text-shadow: var(--glow-gold); }

/* ---------- credits roll ---------- */
#screen-credits {
  display: block;
  overflow: hidden;
  background: rgba(3, 4, 11, 0.98);
  cursor: pointer;
  padding: 0;
}
.credits-roll {
  position: absolute;
  left: 0; right: 0; top: 0;
  text-align: center;
  transform: translateY(var(--cr-start, 600px));
}
.credits-roll.rolling { animation: creditsRoll 14s linear forwards; }
@keyframes creditsRoll {
  from { transform: translateY(var(--cr-start, 600px)); }
  to { transform: translateY(-100%); }
}
.cr-mic { font-size: 44px; margin-bottom: 26px; filter: drop-shadow(0 0 18px rgba(255, 207, 63, 0.6)); }
.cr-title {
  font-family: var(--display);
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 3px;
  line-height: 1.6;
  text-shadow: 3px 3px 0 var(--coral), 0 0 30px rgba(255, 207, 63, 0.4);
  margin: 0 0 50px;
}
.cr-title span { display: block; font-size: 13px; color: var(--cyan); letter-spacing: 8px; margin-top: 14px; text-shadow: var(--glow-cyan); }
.cr-line { font-family: var(--display); margin: 0 0 14px; line-height: 2; }
.cr-line.big { font-size: 13px; color: var(--ink); margin-bottom: 60px; }
.cr-line.dim { font-size: 9px; color: #6a74a3; letter-spacing: 3px; margin-bottom: 16px; }
.cr-line.gold { font-size: 14px; color: var(--gold); text-shadow: var(--glow-gold); margin-bottom: 60px; }
.cr-name { font-family: var(--display); font-size: 14px; color: var(--ink); margin: 0 0 10px; }
.cr-org { font-family: var(--display); font-size: 10px; color: var(--cyan); text-shadow: var(--glow-cyan); margin: 0 0 36px; letter-spacing: 2px; }
.cr-line.end { margin-top: 30px; margin-bottom: 80px; }
.cr-line.end b { color: var(--gold); text-shadow: var(--glow-gold); }
.cr-skip {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  font-size: 14px;
  font-family: var(--body);
  color: #565e83;
  letter-spacing: 3px;
  animation: breathe2 2s ease-in-out infinite;
}

/* ---------- episode select ---------- */
.select-heading {
  font-family: var(--display);
  font-size: 16px;
  color: var(--gold);
  text-shadow: 3px 3px 0 #1a0b22, var(--glow-gold);
  margin: 0 0 6px;
}
#episode-list { width: 100%; max-width: 600px; }

.ep-card {
  position: relative;
  display: flex;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: linear-gradient(165deg, var(--bg-2) 0%, #0e1330 100%);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.ep-card:hover, .ep-card.focused {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), var(--glow-gold);
}
.ep-card:hover .ep-go, .ep-card.focused .ep-go { color: var(--gold); transform: translateX(4px); }

.ep-tile {
  flex: 0 0 78px;
  height: 78px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  background: linear-gradient(160deg, #2a1f55 0%, #15224d 100%);
  border: 2px solid #3a3f77;
  text-shadow: 0 0 12px rgba(62, 240, 212, 0.5);
}
.ep-tile .ep-word { font-size: 7px; color: var(--muted); letter-spacing: 2px; }
.ep-tile .ep-n { font-size: 22px; color: var(--cyan); margin-top: 8px; }

.ep-body { flex: 1; min-width: 0; }
.ep-date { font-size: 15px; color: var(--cyan); letter-spacing: 2px; }
.ep-title {
  font-family: var(--display);
  font-size: 10px;
  color: var(--ink);
  line-height: 1.75;
  margin: 7px 0 5px;
}
.ep-blurb { font-size: 17px; color: #a3acce; line-height: 1.4; }
.ep-meta {
  font-size: 15px;
  color: #565e83;
  margin-top: 7px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  letter-spacing: 1px;
}
.ep-best { color: var(--cyan); }
.ep-go {
  align-self: center;
  font-family: var(--display);
  color: var(--line);
  font-size: 14px;
  transition: color 0.12s, transform 0.12s;
}
.ep-clear {
  position: absolute;
  top: -11px;
  left: 14px;
  font-family: var(--display);
  background: linear-gradient(180deg, #7ffce9, var(--cyan));
  border: 2px solid #021410;
  border-radius: 3px;
  font-size: 8px;
  padding: 5px 9px;
  color: #021410;
  transform: rotate(-3deg);
}
.ep-new {
  position: absolute;
  top: -11px;
  right: 14px;
  font-family: var(--display);
  background: linear-gradient(180deg, #ff7280, var(--coral));
  border: 2px solid #12030a;
  border-radius: 3px;
  font-size: 8px;
  padding: 5px 9px;
  color: #fff;
  box-shadow: var(--glow-coral);
  animation: newPulse 1.6s ease-in-out infinite;
}
@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 77, 93, 0.4); }
  50% { box-shadow: 0 0 22px rgba(255, 77, 93, 0.85); }
}
.select-hint {
  font-size: 15px;
  color: #565e83;
  margin-top: 22px;
  letter-spacing: 2px;
}

/* ---------- action intro ---------- */
#screen-action { overflow: hidden; }

.action-lines {
  position: absolute; inset: -50%;
  background: repeating-linear-gradient(
    115deg,
    transparent 0 70px,
    rgba(255, 207, 63, 0.05) 70px 78px,
    transparent 78px 160px,
    rgba(62, 240, 212, 0.05) 160px 168px
  );
  animation: linesSweep 1.1s linear infinite;
  pointer-events: none;
}
@keyframes linesSweep {
  from { transform: translateX(0); }
  to { transform: translateX(-230px); }
}

.action-ep {
  font-family: var(--display);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 3px;
  margin: 0 0 10px;
  animation: fadeUp 0.4s 0.15s both;
}
.action-ready {
  font-family: var(--display);
  font-size: 30px;
  margin: 0 0 18px;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--coral), 0 0 36px rgba(255, 207, 63, 0.55);
  letter-spacing: 4px;
  animation: readyIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both, readyBlink 1.1s 0.6s steps(2) infinite;
}
@keyframes readyIn {
  from { opacity: 0; transform: scale(2.4); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes readyBlink {
  0%, 100% { text-shadow: 3px 3px 0 var(--coral), 0 0 14px rgba(255, 207, 63, 0.3); }
  50% { text-shadow: 3px 3px 0 var(--coral), 0 0 44px rgba(255, 207, 63, 0.85); }
}

.action-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  margin: 6px 0 16px;
}
.action-host { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.action-host canvas {
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6));
}
.action-host.left { animation: chargeLeft 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.action-host.right { animation: chargeRight 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.action-host.left canvas, .action-host.right canvas { animation: runBob 0.45s 0.55s ease-in-out infinite; }
@keyframes chargeLeft {
  from { opacity: 0; transform: translateX(-260px); }
  to { opacity: 1; transform: none; }
}
@keyframes chargeRight {
  from { opacity: 0; transform: translateX(260px); }
  to { opacity: 1; transform: none; }
}
@keyframes runBob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-7px) rotate(1.5deg); }
}
.action-name {
  font-family: var(--display);
  font-size: 10px;
  color: var(--ink);
  letter-spacing: 1px;
  animation: fadeUp 0.4s 0.7s both;
}
.action-org {
  font-family: var(--display);
  font-size: 8px;
  color: var(--cyan);
  letter-spacing: 1px;
  text-shadow: var(--glow-cyan);
  animation: fadeUp 0.4s 0.85s both;
}

.action-burst { position: relative; width: 110px; height: 110px; flex: 0 0 auto; }
.burst-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) 0deg 18deg, transparent 18deg 45deg,
    var(--gold) 45deg 63deg, transparent 63deg 90deg,
    var(--gold) 90deg 108deg, transparent 108deg 135deg,
    var(--gold) 135deg 153deg, transparent 153deg 180deg,
    var(--gold) 180deg 198deg, transparent 198deg 225deg,
    var(--gold) 225deg 243deg, transparent 243deg 270deg,
    var(--gold) 270deg 288deg, transparent 288deg 315deg,
    var(--gold) 315deg 333deg, transparent 333deg 360deg
  );
  opacity: 0.32;
  animation: burstSpin 5s linear infinite;
}
@keyframes burstSpin { to { transform: rotate(360deg); } }
.burst-mic {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  filter: drop-shadow(0 0 16px rgba(255, 207, 63, 0.8));
  animation: micPulse 0.9s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

.action-search {
  font-family: var(--display);
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
  letter-spacing: 1px;
  max-width: 640px;
  margin: 12px 0 0;
  text-shadow: 2px 2px 0 #1a0b22;
  animation: fadeUp 0.45s 1.1s both;
}
.action-search b {
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--coral), 0 0 26px rgba(255, 207, 63, 0.6);
}
.action-brought {
  font-family: var(--display);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 2px;
  margin: 14px 0 0;
  animation: fadeUp 0.45s 1.35s both;
}
.action-brought b { color: var(--cyan); text-shadow: var(--glow-cyan); }
.action-skip {
  font-size: 15px;
  color: #565e83;
  letter-spacing: 2px;
  margin: 22px 0 0;
  animation: fadeUp 0.45s 1.8s both, breathe2 2s 2.2s ease-in-out infinite;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- session ---------- */
#screen-session {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 16px 26px 14px;
}
#session-top { display: flex; align-items: center; gap: 14px; }
#progress {
  position: relative;
  flex: 1;
  height: 14px;
  background: #070a18;
  border: 2px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
#progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(100% / var(--qn, 8) - 2px),
    rgba(7, 10, 24, 0.9) calc(100% / var(--qn, 8) - 2px) calc(100% / var(--qn, 8))
  );
  pointer-events: none;
}
#progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--cyan), #7ffce9);
  box-shadow: var(--glow-cyan);
  transition: width 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* LED scoreboard */
#scoreboard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #070a18;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
}
.score-label {
  font-family: var(--display);
  font-size: 8px;
  color: #5a6390;
  letter-spacing: 2px;
}
#score {
  font-family: var(--display);
  font-size: 16px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 207, 63, 0.75);
  letter-spacing: 2px;
}
#score.bump { animation: scoreBump 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
#streak {
  font-family: var(--display);
  color: #ff9f1c;
  font-size: 11px;
  animation: flame 0.8s ease-in-out infinite;
}
@keyframes flame {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255, 159, 28, 0.6)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 12px rgba(255, 159, 28, 0.9)); }
}
.score-pop {
  position: absolute;
  right: 10px;
  top: -6px;
  font-family: var(--display);
  font-size: 11px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  animation: popUp 1s ease-out forwards;
  pointer-events: none;
}
@keyframes popUp {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px); }
}

#qa {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  overflow-y: auto;
  text-align: center;
  padding: 8px 4px 6px;
}
#qa.enter { animation: qaIn 0.4s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes qaIn {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}

#q-kicker {
  font-family: var(--display);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 3px;
  text-shadow: var(--glow-cyan);
  margin: 4px 0 16px;
}

#q-quote {
  position: relative;
  font-size: 23px;
  line-height: 1.42;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-2) 0%, #0e1330 100%);
  border: 2px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: 10px;
  padding: 18px 22px 18px 28px;
  text-align: left;
  margin: 0 auto 16px;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
#q-quote::before {
  content: '“';
  position: absolute;
  top: -24px;
  left: 12px;
  font-size: 58px;
  color: var(--gold);
  text-shadow: var(--glow-gold);
  font-family: Georgia, serif;
}
#q-quote .blank {
  display: inline-block;
  min-width: 90px;
  border-bottom: 3px solid var(--gold);
  color: var(--gold);
  text-align: center;
  text-shadow: var(--glow-gold);
}

#q-text {
  font-size: 23px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 580px;
  margin: 0 auto 16px;
}

/* ---------- clip player ---------- */
#clip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #070a18;
  border: 2px solid var(--line);
  border-radius: 30px;
  padding: 9px 18px 9px 9px;
  max-width: 460px;
  margin: 0 auto 16px;
  width: 100%;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}
.clip-btn {
  font-family: var(--display);
  font-size: 13px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7ffce9, var(--cyan));
  color: #021410;
  border: 2px solid #021410;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: var(--glow-cyan);
  transition: transform 0.08s, filter 0.15s;
}
.clip-btn:hover { filter: brightness(1.1); transform: scale(1.06); }
.clip-btn.playing { background: linear-gradient(180deg, #ffe27a, var(--gold)); box-shadow: var(--glow-gold); }

.eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: 0 0 auto; }
.eq i {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0.35;
  transition: opacity 0.2s;
}
#clip.playing .eq i { opacity: 1; box-shadow: 0 0 8px rgba(62, 240, 212, 0.7); animation: eq 0.7s ease-in-out infinite; }
#clip.playing .eq i:nth-child(1) { animation-delay: 0s; }
#clip.playing .eq i:nth-child(2) { animation-delay: 0.15s; }
#clip.playing .eq i:nth-child(3) { animation-delay: 0.3s; }
#clip.playing .eq i:nth-child(4) { animation-delay: 0.1s; }
#clip.playing .eq i:nth-child(5) { animation-delay: 0.25s; }
@keyframes eq {
  0%, 100% { height: 5px; }
  50% { height: 20px; }
}

#clip-track {
  flex: 1;
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}
#clip-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #7ffce9);
  box-shadow: 0 0 10px rgba(62, 240, 212, 0.6);
  border-radius: 4px;
}
#clip-label {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
  flex: 0 0 auto;
}

/* ---------- options ---------- */
#q-options { max-width: 580px; margin: 0 auto; width: 100%; }
#q-options button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--body);
  font-size: 21px;
  line-height: 1.32;
  margin: 9px 0;
  padding: 12px 16px;
  background: linear-gradient(165deg, var(--bg-2) 0%, #0d1228 100%);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
#q-options button:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateX(5px);
  box-shadow: -4px 0 0 var(--gold);
}
#q-options button:disabled { cursor: default; }
#q-options button.correct {
  border-color: var(--cyan);
  background: linear-gradient(165deg, #0e2f28 0%, #0a1f1c 100%);
  box-shadow: var(--glow-cyan);
  animation: popCorrect 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
#q-options button.wrong {
  border-color: var(--coral);
  background: linear-gradient(165deg, #3a1018 0%, #220a10 100%);
  animation: shakeX 0.35s;
}
@keyframes popCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* who-said-it host cards */
#q-options.hosts { display: flex; gap: 20px; justify-content: center; }
#q-options.hosts button {
  width: 148px;
  text-align: center;
  padding: 14px 12px 12px;
  border-radius: 12px;
}
#q-options.hosts button:hover:not(:disabled) {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), var(--glow-gold);
}
#q-options.hosts canvas {
  image-rendering: pixelated;
  display: block;
  margin: 0 auto 10px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
#q-options.hosts .host-name {
  font-family: var(--display);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2px;
}

/* ---------- feedback + action bar ---------- */
#feedback { margin-top: 6px; animation: continueIn 0.3s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
#fb-verdict {
  font-family: var(--display);
  font-size: 14px;
  margin: 10px 0 8px;
  animation: popCorrect 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
#fb-verdict.good { color: var(--cyan); text-shadow: var(--glow-cyan); }
#fb-verdict.bad { color: var(--coral); text-shadow: var(--glow-coral); }
#fb-answer {
  font-size: 21px;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(62, 240, 212, 0.4);
  letter-spacing: 1px;
  max-width: 580px;
  margin: 0 auto 8px;
}
#fb-explain {
  font-size: 20px;
  line-height: 1.45;
  color: #aeb8dd;
  max-width: 580px;
  margin: 0 auto;
}
#fb-clip-hint {
  font-size: 14px;
  color: var(--cyan);
  letter-spacing: 2px;
  margin-top: 10px;
  animation: breathe2 2s ease-in-out infinite;
}
@keyframes breathe2 { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

#action-bar {
  flex: 0 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 2px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
}
.btn-continue {
  width: 100%;
  max-width: 420px;
  margin-top: 0;
  font-size: 13px;
  padding: 16px 20px;
  text-align: center;
  animation: continueIn 0.25s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
@keyframes continueIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
#key-hints {
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 2px;
  color: #5d6792;
}
@media (pointer: coarse) {
  #key-hints { display: none; }
  .action-skip { display: none; }       /* "press enter" hint on the intro */
  .select-hint { display: none; }       /* arrow-key hint on the picker */
}

/* ---------- results ---------- */
#res-title {
  font-family: var(--display);
  font-size: 20px;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--coral), 0 0 30px rgba(255, 207, 63, 0.4);
  margin: 0;
}
#res-rank {
  font-family: var(--display);
  font-size: 11px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin: 12px 0 16px;
  letter-spacing: 1px;
}
#res-box {
  font-size: 20px;
  line-height: 1.85;
  background: linear-gradient(165deg, var(--bg-2) 0%, #0e1330 100%);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px 28px;
  min-width: 360px;
  text-align: left;
  letter-spacing: 1px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
#res-box .row { display: flex; justify-content: space-between; gap: 44px; }
#res-box .total {
  font-family: var(--display);
  font-size: 13px;
  color: var(--gold);
  text-shadow: var(--glow-gold);
  border-top: 2px solid var(--line);
  margin-top: 8px;
  padding-top: 10px;
  line-height: 2.2;
}

/* share row */
#share-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}
.share-label {
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 2px;
  color: #5a6390;
}
.share-buttons { display: flex; gap: 12px; }
.share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Verdana, sans-serif;
  font-weight: bold;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.25),
    inset 0 -5px 8px rgba(0, 0, 0, 0.4),
    0 4px 0 rgba(0, 0, 0, 0.6);
  transition: transform 0.07s, filter 0.15s;
}
.share-btn:hover { filter: brightness(1.2); }
.share-btn:active { transform: translateY(3px); box-shadow: inset 0 4px 6px rgba(255,255,255,0.2), 0 1px 0 rgba(0,0,0,0.6); }
.share-btn.x  { background: radial-gradient(circle at 35% 30%, #4a4a55, #15151c 70%); }
.share-btn.fb { background: radial-gradient(circle at 35% 30%, #6f9ceb, #1877f2 60%, #0c4dab); }
.share-btn.li { background: radial-gradient(circle at 35% 30%, #5fb4e8, #0a66c2 60%, #07426022); font-size: 14px; }

.end-cta {
  font-size: 19px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 16px;
  max-width: 560px;
}
.end-buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ---------- confetti ---------- */
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.confetto {
  position: absolute;
  top: -14px;
  width: 9px; height: 9px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(740px) rotate(560deg); opacity: 0.25; }
}

/* short laptop windows: compress the machine so nothing scrolls */
@media (max-height: 880px) and (min-width: 841px) {
  #game-frame { height: 56vh; min-height: 430px; }
  #marquee .marquee-inner { padding: 9px 10px 10px; }
  .ab-cap { width: 46px; height: 46px; font-size: 19px; }
  .joystick { transform: scale(0.85); width: 72px; }
}

/* =========================================================================
   MOBILE
   ========================================================================= */
@media (max-width: 840px) {
  body { padding: 8px 4px; }
  #cabinet { padding: 10px 10px 12px; border-radius: 16px; }
  .marquee-inner { gap: 8px; padding: 9px 44px 10px 8px; flex-wrap: nowrap; }
  .marquee-name { font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
  .marquee-sub { font-size: 8px; letter-spacing: 2px; white-space: nowrap; }
  .marquee-mic { font-size: 14px; }
  #btn-mute { right: 8px; font-size: 12px; padding: 4px 6px; }
  #bezel { padding: 9px; margin-top: 10px; }
  #control-deck { margin-top: 8px; transform: rotateX(16deg); padding-bottom: 20px; }
  #marquee { transform: rotateX(7deg); margin: 0 4px; }
  #cabinet { transform: rotateX(3deg); }
  .cab-side { display: none; }
  .panel-row { gap: 16px; flex-wrap: wrap; }
  .joystick { display: none; }
  .screw { display: none; }

  /* collapsible subscribe tray: keep the game in the safe zone */
  .deck-label { cursor: pointer; padding: 8px 0; margin: 0; }
  .deck-chev {
    display: inline-block;
    color: var(--gold);
    font-size: 11px;
    transition: transform 0.2s;
    text-shadow: var(--glow-gold);
  }
  #control-deck:not(.collapsed) .deck-chev { transform: rotate(180deg); }
  #control-deck.collapsed .panel-row,
  #control-deck.collapsed .deck-edge { display: none; }
  #control-deck.collapsed { padding-bottom: 8px; }

  /* APP MODE: page never scrolls; marquee = fixed header, deck = fixed
     footer, and the question area is the one and only scroll region */
  html, body { height: 100%; }
  body { overflow: hidden; padding: 0; }
  #stage { height: 100vh; height: 100dvh; padding: 0; perspective: none; }
  #cabinet {
    transform: none !important;
    height: 100%;
    width: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .cab-side, #cabinet::after { display: none; }
  .cab-bg { transform: none; border-radius: 0; }
  #marquee { transform: none; margin: 0; flex: 0 0 auto; }
  #bezel { transform: none; flex: 1 1 auto; min-height: 0; display: flex; padding: 8px; margin-top: 8px; }
  #game-frame { height: auto !important; min-height: 0; flex: 1 1 auto; }
  #control-deck { transform: none; flex: 0 0 auto; margin-top: 8px; border-bottom-width: 3px; }
  .screen, #qa { overscroll-behavior: contain; }
  /* flatten the panel so all six buttons wrap as one tidy group */
  .btn-cluster, .cluster-row { display: contents; }
  .panel-row { flex-wrap: wrap; gap: 22px 18px; }
  .cluster-row.single .arcade-btn:nth-child(even) { transform: none; }
  .ab-cap { width: 38px; height: 38px; }
  .ab-cap svg { width: 15px; height: 15px; }
  .ab-label { font-size: 6px; }
  .arcade-btn { gap: 8px; }
  .cluster-row { gap: 14px; }
  .ab-cap { width: 46px; height: 46px; font-size: 18px; }

  .screen { padding: 18px 14px; }
  #screen-session { padding: 12px 14px 10px; }
  .title-mic { font-size: 38px; }
  #title-scene { max-width: 280px; }
  .tagline { font-size: 17px; letter-spacing: 2px; }
  .credits { font-size: 14px; }

  .ep-tile { flex: 0 0 60px; height: 60px; }
  .ep-tile .ep-n { font-size: 17px; }
  .ep-title { font-size: 9px; }
  .ep-blurb { font-size: 15px; }
  .ep-go { display: none; }

  .action-vs { gap: 16px; }
  .action-burst { width: 70px; height: 70px; }
  .burst-mic { font-size: 30px; }
  .action-ready { font-size: 20px; }
  .action-search { font-size: 11px; }
  #q-quote { font-size: 20px; padding: 12px 14px 12px 20px; margin-bottom: 10px; }
  #q-text { font-size: 20px; margin-bottom: 10px; }
  #q-kicker { margin: 2px 0 10px; }
  #clip { margin-bottom: 10px; padding: 7px 14px 7px 7px; }
  .clip-btn { width: 36px; height: 36px; font-size: 11px; }
  #action-bar { min-height: 8px; }
  #q-options button { font-size: 20px; padding: 12px 14px; margin: 8px 0; }
  #q-options.hosts { gap: 12px; }
  #q-options.hosts button { width: 132px; }
  #fb-explain { font-size: 18px; }
  #scoreboard { padding: 7px 10px; gap: 7px; }
  #score { font-size: 13px; }
  .score-label { display: none; }

  #res-box { min-width: 0; width: 100%; padding: 12px 18px; font-size: 18px; }
  #share-row { flex-direction: column; gap: 10px; }
  .end-buttons { width: 100%; }
  .end-buttons .btn { flex: 1; text-align: center; font-size: 10px; padding: 14px 10px; }
}
