/* =====================================================================
   GUESSDIT · tokens, base, animations
   ===================================================================== */

:root {
  /* Tweakable */
  --accent: #ff5e3a;
  --accent-2: #ffd23f;

  /* Cabinet palette */
  --bg-0: #0b0814;
  --bg-1: #14101e;
  --bg-2: #1c1729;
  --ink: #0e0a14;

  /* Card paper */
  --paper: #f5ecd6;
  --paper-2: #ede2c6;
  --paper-ink: #1a140a;
  --paper-muted: #76664a;

  /* Status */
  --good: #36d399;
  --bad: #ff4f5e;

  /* UI text */
  --fg: #f0e8d6;
  --fg-dim: rgba(240, 232, 214, 0.55);
  --fg-quiet: rgba(240, 232, 214, 0.32);

  /* Fonts */
  --font-arcade: "Press Start 2P", "VT323", monospace;
  --font-display: "Bowlby One", "Bowlby One SC", "Arial Black", sans-serif;
  --font-ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "VT323", ui-monospace, monospace;

  /* Sizing */
  --app-w: 480px;
  --screen-x: 18px;
  --screen-y: 28px;
  --gap: 12px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Card */
  --card-w: 220px;
  --card-h: 308px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(255, 94, 58, 0.10), transparent 70%),
    radial-gradient(900px 600px at 50% 110%, rgba(255, 210, 63, 0.05), transparent 70%),
    linear-gradient(180deg, #0c0815, #07050d 60%);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

button { font-family: inherit; color: inherit; }
input  { font-family: inherit; color: inherit; }

/* ---------- Cabinet wrap ---------- */
.cabinet {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 30%, var(--bg-0) 100%);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 560px) {
  :root { --app-w: 540px; --screen-x: 26px; --screen-y: 36px; --gap: 14px; }
  .cabinet {
    margin: 16px 0;
    min-height: calc(100vh - 32px);
    border-radius: 24px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 24px 64px rgba(0, 0, 0, 0.55),
      0 0 100px rgba(255, 94, 58, 0.12);
  }
}
@media (min-width: 760px) {
  :root { --app-w: 680px; --screen-x: 40px; --screen-y: 44px; --gap: 18px; }
  .cabinet {
    margin: 28px 0;
    min-height: calc(100vh - 56px);
    border-radius: 28px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 32px 80px rgba(0, 0, 0, 0.60),
      0 0 120px rgba(255, 94, 58, 0.15);
  }
  .hud-team .nm { max-width: 110px; font-size: 10px; }
  .hud-team .sc { font-size: 18px; }
  .btn { font-size: 14px; }
  .modal { max-width: 480px; padding: 36px 32px; }
}
@media (min-width: 1060px) {
  :root { --app-w: 820px; --screen-x: 54px; --screen-y: 56px; --gap: 22px; }
  .hud-team .nm { max-width: 160px; }
  .modal { max-width: 560px; }
}

.cabinet-glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(500px 320px at 50% -5%, rgba(255, 94, 58, 0.20), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cabinet-scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.0) 0,
    rgba(0, 0, 0, 0.0) 2px,
    rgba(0, 0, 0, 0.16) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.35;
}
.cabinet-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 50;
  background: radial-gradient(120% 100% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%);
}
body.no-scanlines .cabinet-scanlines { display: none; }

/* ---------- App root ---------- */
#root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Marquee bulbs ---------- */
.bulbs {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.bulbs > i {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffeec4, var(--accent-2) 55%, #6b4a00 100%);
  box-shadow: 0 0 8px rgba(255, 210, 63, 0.6);
  animation: bulb 1.6s linear infinite;
}
.bulbs > i:nth-child(2) { animation-delay: 0.2s; }
.bulbs > i:nth-child(3) { animation-delay: 0.4s; }
.bulbs > i:nth-child(4) { animation-delay: 0.6s; }
.bulbs > i:nth-child(5) { animation-delay: 0.8s; }
.bulbs > i:nth-child(6) { animation-delay: 1.0s; }
.bulbs > i:nth-child(7) { animation-delay: 1.2s; }
.bulbs > i:nth-child(8) { animation-delay: 1.4s; }
@keyframes bulb {
  0%, 100% { opacity: 1; filter: brightness(1.1); }
  50%      { opacity: 0.35; filter: brightness(0.6); }
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  width: 100%;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-arcade);
  font-size: 13px;
  letter-spacing: 1.5px;
  line-height: 1;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.35),
    0 6px 0 #2a1207,
    0 12px 24px rgba(255, 94, 58, 0.35);
  transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms;
  position: relative;
  text-transform: uppercase;
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 3px 0 #2a1207,
    0 6px 12px rgba(255, 94, 58, 0.30);
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 14px 18px;
}
.btn.go { background: var(--good); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3), 0 6px 0 #0a4a32, 0 12px 24px rgba(54, 211, 153, 0.3); }
.btn.danger { background: var(--bad); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3), 0 6px 0 #5a1018, 0 12px 24px rgba(255, 79, 94, 0.3); }
.btn.ghost {
  background: transparent;
  color: var(--fg-dim);
  box-shadow: none;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

/* ---------- Inputs ---------- */
.tag-input {
  width: 100%;
  padding: 14px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-family: var(--font-arcade);
  font-size: 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  outline: none;
  caret-color: var(--accent);
}
.tag-input::placeholder {
  color: rgba(240, 232, 214, 0.22);
  letter-spacing: 4px;
}
.tag-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(255, 94, 58, 0.18);
}

/* ---------- Labels ---------- */
.eyebrow {
  font-family: var(--font-arcade);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--fg-quiet);
  text-transform: uppercase;
}
.mono { font-family: var(--font-mono); }

/* ---------- Card primitives ---------- */
.card {
  --card-bg: var(--paper);
  --card-ink: var(--paper-ink);
  position: relative;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.7), transparent 45%),
    linear-gradient(180deg, var(--card-bg) 0%, var(--paper-2) 100%);
  color: var(--card-ink);
  border: 2px solid var(--card-ink);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.45),
    inset 0 0 0 5px var(--card-ink),
    0 14px 28px rgba(0, 0, 0, 0.4),
    0 4px 0 var(--card-ink);
  overflow: hidden;
  user-select: none;
}
.card .grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.4;
}
.card .corner-stripe {
  position: absolute;
  top: 12px; right: 12px; bottom: 12px;
  width: 4px;
  background: repeating-linear-gradient(45deg, var(--paper-ink) 0 6px, transparent 6px 12px);
  opacity: 0.35;
}

/* The "foil" pts pip */
.pip {
  --pip-bg: var(--accent);
  --pip-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.65), transparent 50%),
    var(--pip-bg);
  border: 2px solid var(--paper-ink);
  color: var(--pip-fg);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 3px 0 var(--paper-ink);
  position: relative;
}
.pip.small { min-width: 26px; height: 26px; font-size: 14px; box-shadow: 0 2px 0 var(--paper-ink); }
.pip.tiny  { min-width: 22px; height: 22px; font-size: 12px; border-width: 1.5px; box-shadow: 0 1px 0 var(--paper-ink); }
.pip.dots, .pip.bars { padding: 0 10px; gap: 3px; }
.pip .dot { width: 6px; height: 6px; background: #fff; border-radius: 50%; box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.pip .bar { width: 4px; background: #fff; border-radius: 1px; box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.pip.small .dot { width: 4px; height: 4px; }
.pip.small .bar { width: 3px; }

/* Difficulty hue on pip */
.pip[data-diff="easy"]   { --pip-bg: #36d399; }
.pip[data-diff="medium"] { --pip-bg: #ffaa3c; }
.pip[data-diff="hard"]   { --pip-bg: #ff4f5e; }
.pip[data-diff="expert"] { --pip-bg: #b06dff; }

/* Card layouts */
.card.size-lg { width: 100%; aspect-ratio: 5 / 7; }
.card.size-md { width: 100%; aspect-ratio: 5 / 7; }
.card.size-sm { width: 100%; aspect-ratio: 5 / 6.4; }

.card-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 16px 14px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px;
}
.card-tier {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--paper-muted);
  line-height: 1;
  text-align: right;
}
.card-word {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 0.95;
  color: var(--paper-ink);
  padding: 0 4px;
  text-wrap: balance;
  hyphens: auto;
}
.card-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--paper-muted);
  text-transform: uppercase;
}
.card-foot .pip { transform: rotate(180deg); }

/* States */
.card.selected {
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.5),
    inset 0 0 0 5px var(--paper-ink),
    0 0 0 3px var(--accent),
    0 18px 36px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(255, 94, 58, 0.4);
  transform: translateY(-4px);
}
.card.won {
  --card-bg: #d5f3e3;
  --card-ink: #0e3a2a;
  border-color: #0e3a2a;
}
.card.won::after {
  content: "✓ GUESSED";
  position: absolute; top: 18px; left: -28px;
  transform: rotate(-18deg);
  background: var(--good);
  color: #fff;
  padding: 6px 36px;
  font-family: var(--font-arcade);
  font-size: 11px;
  letter-spacing: 2px;
  box-shadow: 0 2px 0 #0e3a2a;
}
.card.blasted {
  --card-bg: #f5d0d3;
  --card-ink: #4a0e16;
  border-color: #4a0e16;
  opacity: 0.75;
}
.card.blasted::after {
  content: "✗ BLASTED";
  position: absolute; top: 18px; right: -36px;
  transform: rotate(18deg);
  background: var(--bad);
  color: #fff;
  padding: 6px 44px;
  font-family: var(--font-arcade);
  font-size: 11px;
  letter-spacing: 2px;
  box-shadow: 0 2px 0 #4a0e16;
}
.card.blasted .card-word {
  text-decoration: line-through;
  text-decoration-thickness: 4px;
  text-decoration-color: var(--bad);
}
.card.dim { opacity: 0.5; filter: saturate(0.6); }
.card.active {
  animation: cardPulse 1.6s ease-in-out infinite;
}
@keyframes cardPulse {
  0%, 100% { box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.5),
    inset 0 0 0 5px var(--paper-ink),
    0 0 0 3px var(--accent),
    0 18px 36px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(255, 94, 58, 0.4); }
  50% { box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.5),
    inset 0 0 0 5px var(--paper-ink),
    0 0 0 5px var(--accent),
    0 22px 44px rgba(0, 0, 0, 0.45),
    0 0 50px rgba(255, 94, 58, 0.55); }
}

/* Card back */
.card.back .card-face { display: none; }
.card.back {
  background:
    repeating-linear-gradient(45deg, var(--accent) 0 12px, #c43818 12px 24px);
}
.card.back::before {
  content: "G";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 78px;
  color: rgba(255, 255, 255, 0.85);
  -webkit-text-stroke: 3px var(--ink);
  letter-spacing: -2px;
}

/* ---------- Slot wrapper ---------- */
.slot {
  position: relative;
}
.slot-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}
.slot-meta .label {
  font-family: var(--font-arcade);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--fg-dim);
}
.slot-meta .time {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent-2);
  letter-spacing: 1px;
}

/* ---------- Page transitions ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px var(--screen-x) var(--screen-y);
  gap: var(--gap);
}
.screen.fade-in { animation: fadeIn 280ms ease both; }
.screen.fade-out { animation: fadeOut 220ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px) scale(0.99);} to { opacity: 1; transform: none;} }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px) scale(0.99);} }

/* ---------- HUD ---------- */
.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(255, 94, 58, 0.10), transparent),
    rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky; top: 0; z-index: 20;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hud-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.hud-team.active {
  background: rgba(255, 94, 58, 0.16);
  border-color: rgba(255, 94, 58, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 94, 58, 0.2);
}
.hud-team .nm {
  font-family: var(--font-arcade);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--fg-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px;
}
.hud-team.active .nm { color: var(--accent); }
.hud-team .sc {
  font-family: var(--font-arcade);
  font-size: 16px;
  color: var(--fg);
  margin-top: 2px;
}
.hud-team.active .sc { color: var(--accent); }
.hud-round {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--fg-quiet);
  text-transform: uppercase;
  text-align: right;
  line-height: 1.2;
  padding-left: 8px;
}
.hud-round b { color: var(--fg-dim); }
.hud-exit {
  appearance: none; border: 1px solid rgba(255, 79, 94, 0.4);
  background: rgba(255, 79, 94, 0.15);
  color: rgba(255, 180, 185, 0.95);
  font-family: var(--font-arcade);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 200ms ease both;
}
.modal {
  background: linear-gradient(180deg, #1a1428, #100b1c);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

/* ---------- Misc helpers ---------- */
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.txt-center { text-align: center; }

/* ---------- Waiting screen ---------- */
.waiting-screen {
  justify-content: center;
}

/* Pixel sprite character */
.sprite-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: spriteBounce 0.55s ease-in-out infinite alternate;
  position: relative;
  user-select: none;
}

.sprite-head {
  width: 42px;
  height: 38px;
  background: var(--accent);
  border: 2.5px solid var(--fg);
  border-radius: 5px 5px 3px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.sprite-eye {
  width: 7px;
  height: 7px;
  background: var(--fg);
  border-radius: 1px;
  animation: eyeBlink 3.4s ease-in-out infinite;
}

.sprite-body-row {
  display: flex;
  align-items: flex-start;
  position: relative;
}

.sprite-body {
  width: 36px;
  height: 48px;
  background: var(--accent-2);
  border: 2.5px solid var(--fg);
  border-top: none;
  border-radius: 0 0 4px 4px;
}

.sprite-arm {
  width: 16px;
  height: 9px;
  background: var(--accent);
  border: 2px solid var(--fg);
  border-radius: 3px;
  position: relative;
  top: 10px;
}

.sprite-arm-l {
  transform-origin: right center;
  animation: armWaveL 0.42s ease-in-out infinite alternate;
}

.sprite-arm-r {
  transform-origin: left center;
  animation: armWaveR 0.42s ease-in-out infinite alternate;
}

.sprite-legs {
  display: flex;
  gap: 4px;
}

.sprite-leg {
  width: 14px;
  height: 26px;
  background: var(--accent);
  border: 2px solid var(--fg);
  border-top: none;
  border-radius: 0 0 4px 4px;
  transform-origin: top center;
}

.sprite-leg-l {
  animation: legStepL 0.36s ease-in-out infinite alternate;
}

.sprite-leg-r {
  animation: legStepR 0.36s ease-in-out infinite alternate;
}

.sprite-shadow {
  width: 54px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
  margin-top: 3px;
  animation: shadowPulse 0.55s ease-in-out infinite alternate;
}

/* Sprite keyframes */
@keyframes spriteBounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-20px); }
}
@keyframes armWaveL {
  from { transform: rotate(-35deg); }
  to   { transform: rotate(25deg); }
}
@keyframes armWaveR {
  from { transform: rotate(25deg); }
  to   { transform: rotate(-35deg); }
}
@keyframes legStepL {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(18deg); }
}
@keyframes legStepR {
  from { transform: rotate(18deg); }
  to   { transform: rotate(-18deg); }
}
@keyframes shadowPulse {
  from { transform: scaleX(0.85) scaleY(0.7); opacity: 0.45; }
  to   { transform: scaleX(1.35) scaleY(1.2); opacity: 0.9; }
}
@keyframes eyeBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  94%           { transform: scaleY(0.08); }
}

/* Happy sprite — shown on guessed-card buffer */
.sprite-eye.happy {
  width: 10px;
  height: 5px;
  border-radius: 10px 10px 0 0;
  animation: none;
  transform: none;
}
.sprite-wrap.happy {
  animation: spriteJump 0.85s ease-in-out infinite;
}
.sprite-wrap.happy .sprite-arm-l {
  animation: armJoyL 0.85s ease-in-out infinite;
}
.sprite-wrap.happy .sprite-arm-r {
  animation: armJoyR 0.85s ease-in-out infinite;
}
.sprite-wrap.happy .sprite-leg-l,
.sprite-wrap.happy .sprite-leg-r {
  animation: none;
  transform: rotate(0deg);
}
.sprite-wrap.happy .sprite-shadow {
  animation: shadowJump 0.85s ease-in-out infinite;
}
@keyframes spriteJump {
  0%   { transform: translateY(0)    scaleY(1)    scaleX(1); }
  12%  { transform: translateY(6px)  scaleY(0.80) scaleX(1.20); }
  32%  { transform: translateY(-44px) scaleY(1.08) scaleX(0.94); }
  55%  { transform: translateY(-40px) scaleY(1.05) scaleX(0.96); }
  78%  { transform: translateY(-2px) scaleY(0.84) scaleX(1.14); }
  90%  { transform: translateY(0)    scaleY(1.04) scaleX(0.97); }
  100% { transform: translateY(0)    scaleY(1)    scaleX(1); }
}
@keyframes shadowJump {
  0%, 100% { transform: scaleX(1.1)  scaleY(0.9);  opacity: 0.7; }
  12%      { transform: scaleX(1.65) scaleY(1.45); opacity: 1; }
  32%, 55% { transform: scaleX(0.42) scaleY(0.32); opacity: 0.18; }
  78%      { transform: scaleX(1.8)  scaleY(1.6);  opacity: 1; }
  90%      { transform: scaleX(1.2)  scaleY(1.0);  opacity: 0.8; }
}
@keyframes armJoyL {
  0%, 100% { transform: rotate(-128deg); }
  50%      { transform: rotate(-112deg); }
}
@keyframes armJoyR {
  0%, 100% { transform: rotate(128deg); }
  50%      { transform: rotate(112deg); }
}

@keyframes waitPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Particle explosion */
.sprite-explosion {
  position: relative;
  width: 80px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes particleFly0 { to { transform: translate(-45px,-65px) rotate(240deg); opacity: 0; } }
@keyframes particleFly1 { to { transform: translate(0,-80px) rotate(-200deg); opacity: 0; } }
@keyframes particleFly2 { to { transform: translate(45px,-65px) rotate(180deg); opacity: 0; } }
@keyframes particleFly3 { to { transform: translate(75px,0) rotate(150deg); opacity: 0; } }
@keyframes particleFly4 { to { transform: translate(45px,65px) rotate(300deg); opacity: 0; } }
@keyframes particleFly5 { to { transform: translate(0,80px) rotate(-260deg); opacity: 0; } }
@keyframes particleFly6 { to { transform: translate(-45px,65px) rotate(320deg); opacity: 0; } }
@keyframes particleFly7 { to { transform: translate(-75px,0) rotate(210deg); opacity: 0; } }
@keyframes confettiFall0 {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(640deg); opacity: 0; }
}
@keyframes confettiFall1 {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  45%  { transform: translateY(50vh) translateX(-40px) rotate(260deg); opacity: 1; }
  100% { transform: translateY(110vh) translateX(-70px) rotate(560deg); opacity: 0; }
}
@keyframes confettiFall2 {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  45%  { transform: translateY(50vh) translateX(45px) rotate(-260deg); opacity: 1; }
  100% { transform: translateY(110vh) translateX(65px) rotate(-560deg); opacity: 0; }
}
@keyframes confettiFall3 {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  25%  { transform: translateY(25vh) translateX(25px) rotate(160deg); }
  60%  { transform: translateY(65vh) translateX(-20px) rotate(390deg); opacity: 1; }
  100% { transform: translateY(110vh) translateX(10px) rotate(680deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE COMPONENTS — text and layout helpers that scale at breakpoints
   ═══════════════════════════════════════════════════════════════════════ */

/* Lobby room code */
.room-code {
  font-family: var(--font-arcade);
  font-size: 52px;
  letter-spacing: 14px;
  color: var(--accent);
  text-align: center;
  text-shadow: 0 0 30px rgba(255,94,58,0.55);
  line-height: 1;
  padding: 8px 0;
}
@media (min-width: 760px)  { .room-code { font-size: 64px; letter-spacing: 18px; } }
@media (min-width: 1060px) { .room-code { font-size: 76px; letter-spacing: 22px; } }

/* Waiting screen countdown */
.timer-big {
  font-family: var(--font-mono);
  font-size: 100px;
  line-height: 1;
}
@media (min-width: 560px)  { .timer-big { font-size: 120px; } }
@media (min-width: 760px)  { .timer-big { font-size: 152px; } }
@media (min-width: 1060px) { .timer-big { font-size: 188px; } }

/* Result screen score reveal */
.score-big {
  font-family: var(--font-display);
  font-size: 90px;
  line-height: 1;
}
@media (min-width: 560px)  { .score-big { font-size: 108px; } }
@media (min-width: 760px)  { .score-big { font-size: 132px; } }
@media (min-width: 1060px) { .score-big { font-size: 160px; } }

/* End screen winner */
.winner-name {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -1px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(255, 210, 63, 0.4);
}
@media (min-width: 760px)  { .winner-name { font-size: 62px; } }
@media (min-width: 1060px) { .winner-name { font-size: 76px; } }

/* Pick screen — cap card grid width so cards don't get huge on tablet/laptop */
.slot-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 560px)  { .slot-cards { max-width: 370px; margin: 0 auto; } }
@media (min-width: 760px)  { .slot-cards { max-width: 440px; } }
@media (min-width: 1060px) { .slot-cards { max-width: 500px; } }

/* Result screen card fan */
.fan-container {
  position: relative;
  height: 200px;
  margin: 8px 0 12px;
}
@media (min-width: 560px)  { .fan-container { height: 240px; } }
@media (min-width: 760px)  { .fan-container { height: 290px; } }
@media (min-width: 1060px) { .fan-container { height: 340px; } }

.fan-card {
  position: absolute;
  width: 96px;
  height: 144px;
}
@media (min-width: 560px)  { .fan-card { width: 114px; height: 171px; } }
@media (min-width: 760px)  { .fan-card { width: 140px; height: 210px; } }
@media (min-width: 1060px) { .fan-card { width: 168px; height: 252px; } }

/* End screen leaderboard */
.table-grid {
  display: grid;
  grid-template-columns: 56px 1fr 72px;
  align-items: center;
}
@media (min-width: 560px)  { .table-grid { grid-template-columns: 68px 1fr 84px; } }
@media (min-width: 760px)  { .table-grid { grid-template-columns: 84px 1fr 100px; } }
@media (min-width: 1060px) { .table-grid { grid-template-columns: 100px 1fr 120px; } }
