/* ============================================================
   Questron · PULSE Design System
   questron.app
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Void base */
  --bg:         #080808;
  --surface:    #0d0d0d;
  --surface-2:  #121212;
  --surface-3:  #191919;
  --surface-4:  #202020;

  /* PRIMARY — electric lime (distinctive, nothing like AI SaaS) */
  --lime:        #b8ff3c;
  --lime-soft:   #ceff6e;
  --lime-glow:   rgba(184,255,60,0.38);
  --lime-dim:    rgba(184,255,60,0.10);
  --lime-text:   #000;          /* text ON lime bg */

  /* SECONDARY — hot orange */
  --orange:      #ff5c1a;
  --orange-soft: #ff8c57;
  --orange-glow: rgba(255,92,26,0.38);
  --orange-dim:  rgba(255,92,26,0.12);

  /* TERTIARY — deep gold */
  --gold:        #ffd23f;
  --gold-glow:   rgba(255,210,63,0.35);
  --gold-dim:    rgba(255,210,63,0.10);

  /* QUATERNARY — electric mint */
  --mint:        #00e8a0;
  --mint-glow:   rgba(0,232,160,0.32);
  --mint-dim:    rgba(0,232,160,0.10);

  /* Kept names for legacy callers */
  --amber:       #ffd23f;
  --amber-glow:  rgba(255,210,63,0.35);
  --amber-dim:   rgba(255,210,63,0.10);
  --emerald:     #00e8a0;
  --emerald-glow:rgba(0,232,160,0.32);
  --emerald-dim: rgba(0,232,160,0.10);

  /* State */
  --correct:     #00e8a0;
  --correct-glow:rgba(0,232,160,0.35);
  --correct-dim: rgba(0,232,160,0.12);
  --wrong:       #3a3a3a;
  --wrong-dim:   rgba(58,58,58,0.30);

  /* Timer — lime → gold → orange */
  --timer-ok:    #b8ff3c;
  --timer-warn:  #ffd23f;
  --timer-urgent:#ff5c1a;

  /* Answer identity — NOTHING like Kahoot */
  --opt-a-color: #b8ff3c;
  --opt-a-glow:  rgba(184,255,60,0.42);
  --opt-a-dim:   rgba(184,255,60,0.10);
  --opt-b-color: #ff7733;
  --opt-b-glow:  rgba(255,119,51,0.40);
  --opt-b-dim:   rgba(255,119,51,0.10);
  --opt-c-color: #ffd23f;
  --opt-c-glow:  rgba(255,210,63,0.40);
  --opt-c-dim:   rgba(255,210,63,0.10);
  --opt-d-color: #00e8a0;
  --opt-d-glow:  rgba(0,232,160,0.38);
  --opt-d-dim:   rgba(0,232,160,0.10);

  /* Text */
  --text:        #f5f5f0;
  --text-subtle: #a8a89e;
  --text-faint:  #3a3a35;
  --text-muted:  #a8a89e;

  /* Borders */
  --border:      rgba(255,255,255,0.06);
  --border-mid:  rgba(255,255,255,0.11);
  --border-bright:rgba(255,255,255,0.20);

  /* Legacy compat */
  --accent:       #b8ff3c;
  --accent-light: #ceff6e;
  --accent-glow:  rgba(184,255,60,0.38);
  --accent-dim:   rgba(184,255,60,0.10);
  --violet:       #b8ff3c;   /* old violet → lime */
  --violet-soft:  #ceff6e;
  --violet-glow:  rgba(184,255,60,0.38);
  --violet-dim:   rgba(184,255,60,0.10);
  --cyan:         #00e8a0;   /* old cyan → mint */
  --cyan-soft:    #5fffc8;
  --cyan-glow:    rgba(0,232,160,0.32);
  --cyan-dim:     rgba(0,232,160,0.10);
  --green:        #00e8a0;
  --green-glow:   rgba(0,232,160,0.35);
  --red:          #ff6b6b;
  --spark:        #ff5c1a;
  --spark-dim:    rgba(255,92,26,0.12);
  --spark-glow:   rgba(255,92,26,0.38);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    system-ui, sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Spacing */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  40px;
  --gap-2xl: 64px;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.7);
  --shadow-violet: 0 0 30px var(--violet-glow), 0 0 60px rgba(124,58,237,0.15);
  --shadow-cyan:   0 0 30px var(--cyan-glow),   0 0 60px rgba(6,182,212,0.12);
  --shadow-card:   0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.55);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow: hidden; }
body {
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

/* ── THE LIVING BACKGROUND ──────────────────────────────────── */

/* Layer 1: Lava blobs */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: blobDrift linear infinite;
  will-change: transform, border-radius;
}
.bg-blob:nth-child(1) {
  width: 650px; height: 550px;
  background: radial-gradient(ellipse, #3a5a00 0%, transparent 70%);
  top: -12%; left: -10%;
  animation-duration: 28s;
  animation-delay: 0s;
}
.bg-blob:nth-child(2) {
  width: 520px; height: 580px;
  background: radial-gradient(ellipse, #6b2500 0%, transparent 70%);
  bottom: -15%; right: -5%;
  animation-duration: 35s;
  animation-delay: -12s;
}
.bg-blob:nth-child(3) {
  width: 420px; height: 420px;
  background: radial-gradient(ellipse, #004d30 0%, transparent 70%);
  top: 40%; right: 22%;
  animation-duration: 42s;
  animation-delay: -7s;
}
.bg-blob:nth-child(4) {
  width: 320px; height: 360px;
  background: radial-gradient(ellipse, #5a4400 0%, transparent 70%);
  top: 18%; left: 52%;
  animation-duration: 31s;
  animation-delay: -20s;
}

/* Layer 2: Fine dot dither overlay */
.bg-dither {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.55) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  opacity: 0.065;
}

/* Layer 3: Grid lines */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* Layer 4: CRT scanlines */
.bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.20) 2px,
    rgba(0,0,0,0.20) 3px
  );
}

/* Everything else sits above layers */
body > *:not(.bg-blobs):not(.bg-dither):not(.bg-grid):not(.arena):not(.vignette):not(#flyby):not(.site-nav):not(#bg-ascii-canvas) {
  position: relative;
  z-index: 2;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden      { display: none !important; }
.muted       { color: var(--text-subtle); font-size: 0.9em; }
.text-center { text-align: center; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--gap-md);
}
.page-center {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gap-lg);
}
/* Subtle radial vignette on page — pulls focus to UI panels */
/* Removed full-viewport overlay; instead each panel carries its own shadow halo (see .glass/.panel) */
.page-center > *, .container.screen > * { position: relative; z-index: 1; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Gradient headline text */
.gradient-text {
  background: linear-gradient(135deg, var(--violet-soft) 0%, var(--cyan-soft) 50%, var(--emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

/* ── PULSE Logo ─────────────────────────────────────────────── */
.pulse-logo {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1;
  position: relative;
  text-decoration: none;
}
.pulse-logo .logo-quest {
  background: linear-gradient(135deg, var(--lime), var(--mint));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pulse-logo .logo-tron {
  color: var(--text);
}
.pulse-logo .logo-pip {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime);
  margin-left: 3px;
  vertical-align: super;
  animation: pipPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 10px var(--lime-glow);
}

/* ── Glass / Card ───────────────────────────────────────────── */
.glass {
  background: rgba(10,10,10,0.90);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  /* Radial dark halo — background recedes away from panel */
  box-shadow: 0 0 80px 40px rgba(0,0,0,0.75);
}
.glass-elevated {
  background: rgba(14,14,14,0.94);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-lg);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: var(--shadow-card), 0 0 100px 55px rgba(0,0,0,0.82);
}
.panel {
  background: rgba(10,10,10,0.92);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), 0 0 90px 48px rgba(0,0,0,0.80);
  padding: var(--gap-lg);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 12px 22px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.15s ease,
              opacity 0.15s;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: 0.28; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:not(:disabled):active { transform: scale(0.95) !important; }

/* Shimmer sweep on hover */
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-18deg);
  transition: left 0.45s ease;
  pointer-events: none;
}
.btn:not(:disabled):hover::after { left: 120%; }

.btn-primary {
  background: var(--lime);
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 20px var(--lime-glow), 0 4px 12px rgba(0,0,0,0.4);
}
.btn-primary:not(:disabled):hover {
  background: var(--lime-soft);
  box-shadow: 0 0 36px var(--lime-glow), 0 6px 20px rgba(0,0,0,0.5);
  transform: translateY(-2px) scale(1.01);
}

.btn-ghost {
  background: transparent;
  color: var(--text-subtle);
  border: 1px solid var(--border-mid);
}
.btn-ghost:not(:disabled):hover {
  color: var(--text);
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--spark);
  border: 1.5px solid rgba(184,255,60,0.5);
}
.btn-secondary:not(:disabled):hover {
  background: var(--lime-dim);
  border-color: var(--spark);
  color: var(--spark);
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--lime-glow);
}

.btn-lg {
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: var(--r-lg);
}

.btn-ready {
  background: linear-gradient(135deg, #065f46, #059669);
  color: #fff;
  animation: readyGlow 2s ease-in-out infinite;
  box-shadow: 0 0 24px var(--correct-glow);
}

.btn-cta {
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 20px var(--orange-glow), 0 4px 12px rgba(0,0,0,0.4);
}
.btn-cta:not(:disabled):hover {
  box-shadow: 0 0 36px var(--orange-glow), 0 6px 20px rgba(0,0,0,0.5);
  transform: translateY(-2px) scale(1.01);
}

/* Legacy compat */
.primary {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.88rem;
  padding: 12px 22px; border-radius: var(--r-md); border: none;
  background: var(--lime); color: #000;
  cursor: pointer; box-shadow: 0 0 20px var(--lime-glow); transition: all 0.15s ease;
  position: relative; overflow: hidden;
}
.primary:disabled { opacity: 0.28; cursor: not-allowed; }
.primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 0 32px var(--lime-glow); }

/* ── Inputs ─────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-dim), 0 0 16px var(--lime-glow);
}
.input::placeholder { color: var(--text-faint); }

/* ── Drop Zone ──────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--gap-md);
  padding: 44px 32px;
  border: 2px dashed var(--border-mid);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--lime);
  background: var(--lime-dim);
  box-shadow: 0 0 32px var(--lime-glow);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.drop-zone-icon { font-size: 2.2rem; }
.drop-zone-label { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--text-subtle); }
.drop-zone-sub   { font-size: 0.8rem; color: var(--text-faint); }

/* ── Quiz preview ───────────────────────────────────────────── */
.quiz-preview { display: flex; align-items: center; gap: var(--gap-md); padding: var(--gap-md); }
.quiz-preview-icon { font-size: 1.6rem; flex-shrink: 0; }
.quiz-preview-meta { flex: 1; min-width: 0; }
.quiz-preview-title {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.quiz-preview-stats { display: flex; gap: var(--gap-md); margin-top: 4px; flex-wrap: wrap; }
.quiz-stat {
  font-size: 0.78rem; color: var(--text-subtle);
  background: var(--surface-3); padding: 2px 8px;
  border-radius: var(--r-full); font-weight: 500;
  border: 1px solid var(--border);
}

/* ── Game Code — Holographic ────────────────────────────────── */
.game-code-block { text-align: center; padding: var(--gap-xl) var(--gap-lg) var(--gap-lg); }
.game-code-label {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: var(--gap-lg);
}
.game-code {
  display: flex; justify-content: center; gap: 8px; margin-bottom: var(--gap-lg);
}
.game-code-char {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(52px, 12vw, 84px);
  height: clamp(66px, 15vw, 106px);
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(184,255,60,0.22);
  border-radius: var(--r-xl);
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  color: var(--lime);
  text-shadow: 0 0 30px var(--lime-glow), 0 0 60px rgba(184,255,60,0.25);
  box-shadow:
    0 0 24px rgba(184,255,60,0.18),
    0 0 80px rgba(184,255,60,0.06),
    inset 0 0 20px rgba(184,255,60,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
  animation: codeCharIdle 3s ease-in-out infinite;
  animation-delay: calc(var(--char-i, 0) * 0.3s);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
}
.game-code-char.pop {
  animation: codeCharPop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
  box-shadow: 0 0 40px var(--lime-glow), 0 0 80px rgba(184,255,60,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
/* Even-indexed digits use orange to break up the all-lime look */
.game-code-char:nth-child(even) {
  color: var(--opt-b-color);
  border-color: rgba(255,119,51,0.22);
  text-shadow: 0 0 30px rgba(255,119,51,0.5), 0 0 60px rgba(255,119,51,0.22);
  box-shadow:
    0 0 24px rgba(255,119,51,0.18),
    0 0 80px rgba(255,119,51,0.06),
    inset 0 0 20px rgba(255,119,51,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.game-code-char.pop:nth-child(even) {
  box-shadow: 0 0 40px rgba(255,119,51,0.5), 0 0 80px rgba(255,119,51,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
.game-code-url { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); letter-spacing: 0.04em; }

/* ── Player Chips ───────────────────────────────────────────── */
.lobby-players {
  display: flex; flex-wrap: wrap; gap: var(--gap-sm);
  min-height: 44px; align-content: flex-start;
}
.player-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border-mid);
  font-family: var(--font-display); font-size: 0.83rem; font-weight: 600;
  color: var(--text);
  animation: chipPop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  transition: box-shadow 0.2s;
}
.player-chip:hover { box-shadow: 0 0 12px rgba(167,139,250,0.2); }
.player-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.player-count { font-size: 0.82rem; font-weight: 600; color: var(--text-subtle); }

/* ── Question Card ──────────────────────────────────────────── */
.question-card {
  padding: var(--gap-lg) var(--gap-xl);
  animation: slideInDown 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
@media (max-width: 640px) { .question-card { padding: var(--gap-md); } }

.question-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--gap-md); gap: var(--gap-md);
}
.question-progress-pill {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  color: var(--text-subtle);
  background: var(--surface-3);
  border-radius: var(--r-full);
  padding: 4px 12px;
  border: 1px solid var(--border);
}
.progress-bar-track {
  width: 100%; height: 2px;
  background: var(--border); border-radius: var(--r-full);
  overflow: hidden; margin-bottom: var(--gap-lg);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--mint));
  border-radius: var(--r-full);
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--lime-glow);
}
.question-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.75rem);
  font-weight: 700; line-height: 1.3;
  color: var(--text); min-height: 2em;
}
.ref-image {
  width: 100%; max-height: 280px; object-fit: cover;
  margin-top: var(--gap-lg); border-radius: var(--r-md);
  border: 1px solid var(--border);
}

/* ── PLASMA Timer Ring ──────────────────────────────────────── */
.timer-container {
  position: relative; flex-shrink: 0;
  width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
}
/* Rotating plasma halo behind the ring */
.timer-container::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from var(--plasma-angle, 0deg),
    var(--violet-soft),
    var(--cyan-soft),
    var(--amber),
    var(--orange),
    var(--violet-soft)
  );
  animation: plasmaRotate 3s linear infinite;
  opacity: 0.35;
  filter: blur(4px);
}
.timer-container.urgent::before { opacity: 0.7; animation-duration: 1s; }
.timer-container.warn::before   { opacity: 0.5; animation-duration: 2s; }

.timer-ring {
  width: 68px; height: 68px;
  transform: rotate(-90deg);
  overflow: clip; position: relative; z-index: 1;
}
.timer-ring__bg {
  fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 6;
}
.timer-ring__fill {
  fill: none;
  stroke: url(#plasmaGradient);
  stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke 0.4s ease;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}
.timer-number {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700;
  color: var(--text); line-height: 1;
  font-variant-numeric: tabular-nums; z-index: 2;
}
.timer-container.urgent .timer-ring__fill { filter: drop-shadow(0 0 8px var(--orange-glow)); }
.timer-container.urgent .timer-number     { color: var(--timer-urgent); animation: timerShake 0.6s ease-in-out infinite; }
.timer-container.warn   .timer-ring__fill { filter: drop-shadow(0 0 6px var(--amber-glow)); }
.timer-container.warn   .timer-number     { color: var(--timer-warn); }

/* SVG gradient def inline via CSS – actual gradient injected in HTML */
#timerBar, #timerBarFill { display: none; }

/* ── Answer Grid ────────────────────────────────────────────── */
.answers-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (max-width: 600px) { .answers-grid { grid-template-columns: 1fr; } }

/* ── ANSWER CARDS — Frosted Glass + Ghost Letter ─────────────────────────── */
.answer {
  display: flex; align-items: center; gap: var(--gap-md);
  padding: 0 20px; min-height: 82px;
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 600;
  color: var(--text);
  cursor: pointer; overflow: hidden; position: relative;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  /* 3D tilt */
  transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
  transition:
    transform 0.08s ease,
    box-shadow 0.22s ease,
    background 0.2s ease,
    border-color 0.2s ease;
  animation: answerIn 0.32s cubic-bezier(0.22,1,0.36,1) both;
  will-change: transform;
}
.answer:nth-child(1) { animation-delay: 0.04s; }
.answer:nth-child(2) { animation-delay: 0.08s; }
.answer:nth-child(3) { animation-delay: 0.12s; }
.answer:nth-child(4) { animation-delay: 0.16s; }

/* Ghost letter watermark — unique identity replacing Kahoot shapes */
.answer::before {
  content: var(--ghost-letter, 'A');
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono); font-weight: 700;
  font-size: 3.8rem; line-height: 1;
  color: currentColor;
  opacity: 0.07;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s;
}
.answer:hover::before { opacity: 0.12; }

/* Answer fill bar (vote %) */
.answer-fill-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--fill, 0) * 1%);
  background: currentColor;
  opacity: 0.06; pointer-events: none;
  transition: width 0.4s ease;
}

.answer .shape {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid currentColor;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
.answer:hover .shape { opacity: 1; background: rgba(255,255,255,0.10); }

.answer .label { flex: 1; line-height: 1.3; }
.answer .answer-icon {
  font-size: 1.1rem; margin-left: auto; opacity: 0;
  transition: opacity 0.2s; flex-shrink: 0;
}

/* Identity colours */
.answer.opt-a { color: var(--opt-a-color); border-color: rgba(184,255,60,0.18); }
.answer.opt-b { color: var(--opt-b-color); border-color: rgba(255,119,51,0.18); }
.answer.opt-c { color: var(--opt-c-color); border-color: rgba(255,210,63,0.18); }
.answer.opt-d { color: var(--opt-d-color); border-color: rgba(0,232,160,0.18); }

.answer.opt-a { --ghost-letter: 'A'; }
.answer.opt-b { --ghost-letter: 'B'; }
.answer.opt-c { --ghost-letter: 'C'; }
.answer.opt-d { --ghost-letter: 'D'; }

/* Hover — glow lift */
.answer.opt-a:not(:disabled):hover { background: rgba(184,255,60,0.07); box-shadow: 0 0 28px var(--opt-a-glow), 0 0 0 1px var(--opt-a-color); border-color: var(--opt-a-color); transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px); }
.answer.opt-b:not(:disabled):hover { background: rgba(255,119,51,0.07); box-shadow: 0 0 28px var(--opt-b-glow), 0 0 0 1px var(--opt-b-color); border-color: var(--opt-b-color); transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px); }
.answer.opt-c:not(:disabled):hover { background: rgba(255,210,63,0.07); box-shadow: 0 0 28px var(--opt-c-glow), 0 0 0 1px var(--opt-c-color); border-color: var(--opt-c-color); transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px); }
.answer.opt-d:not(:disabled):hover { background: rgba(0,232,160,0.07); box-shadow: 0 0 28px var(--opt-d-glow), 0 0 0 1px var(--opt-d-color); border-color: var(--opt-d-color); transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px); }

.answer:disabled { cursor: default; }
.answer:disabled:not(.correct):not(.wrong):not(.locked):not(.player-correct):not(.player-wrong):not(.player-reveal-correct) {
  opacity: 0.4;
}

/* Selected / locked */
.answer.locked.opt-a, .answer.selected.opt-a { background: rgba(184,255,60,0.10); box-shadow: 0 0 36px var(--opt-a-glow); border-color: var(--opt-a-color); transform: scale(1.02) perspective(600px); }
.answer.locked.opt-b, .answer.selected.opt-b { background: rgba(255,119,51,0.10); box-shadow: 0 0 36px var(--opt-b-glow); border-color: var(--opt-b-color); transform: scale(1.02) perspective(600px); }
.answer.locked.opt-c, .answer.selected.opt-c { background: rgba(255,210,63,0.10); box-shadow: 0 0 36px var(--opt-c-glow); border-color: var(--opt-c-color); transform: scale(1.02) perspective(600px); }
.answer.locked.opt-d, .answer.selected.opt-d { background: rgba(0,232,160,0.10); box-shadow: 0 0 36px var(--opt-d-glow); border-color: var(--opt-d-color); transform: scale(1.02) perspective(600px); }

/* ── CARD FLIP REVEAL ───────────────────────────────────────── */
.answer.card-flipping {
  animation: cardFlipOut 0.26s cubic-bezier(0.4,0,1,1) forwards !important;
  pointer-events: none;
}
.answer.card-flip-in {
  animation: cardFlipIn 0.30s cubic-bezier(0,0,0.6,1.0) both !important;
  pointer-events: none;
}

/* Reveal states (applied after flip midpoint) */
.answer.correct {
  background: rgba(0,232,160,0.12) !important;
  border-color: var(--correct) !important;
  color: var(--correct) !important;
  box-shadow: 0 0 36px var(--correct-glow), inset 0 0 28px rgba(0,232,160,0.06) !important;
}
.answer.correct::before { content: 'A'; opacity: 0.08 !important; }
.answer.correct .answer-icon { opacity: 1; }

.answer.wrong {
  opacity: 0.88 !important;
  background: rgba(28,8,8,0.92) !important;
  border-color: rgba(200,50,50,0.30) !important;
  color: rgba(210,90,90,0.85) !important;
  backdrop-filter: blur(32px) !important;
  -webkit-backdrop-filter: blur(32px) !important;
  box-shadow: 0 0 28px rgba(180,30,30,0.25) !important;
  filter: brightness(0.88);
  transform: perspective(600px) scale(0.975) !important;
  overflow: visible !important;
}

.answer.player-correct {
  background: rgba(0,232,160,0.12) !important;
  border-color: var(--correct) !important; color: var(--correct) !important;
  box-shadow: 0 0 36px var(--correct-glow) !important;
}
.answer.player-correct .answer-icon { opacity: 1; color: var(--correct); }

.answer.player-wrong {
  opacity: 0.55 !important;
  background: rgba(15,15,15,0.88) !important;
  border-color: rgba(80,80,80,0.25) !important;
  color: #555 !important;
  filter: grayscale(0.7) brightness(0.7);
  text-decoration: line-through;
}

.answer.player-reveal-correct {
  background: rgba(0,232,160,0.10) !important;
  border-color: var(--correct) !important; color: var(--correct) !important;
  box-shadow: 0 0 22px var(--correct-glow) !important;
}

.answer-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; padding: 3px 7px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.07);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  margin-left: auto; flex-shrink: 0; color: var(--text-subtle);
  border: 1px solid var(--border);
}

/* ── SHAME NAMES (wrong answer name-and-shame rail) ──────────────────── */
.answer-slot {
  /* Wrapper that lets shame names sit below the card in the grid */
  display: flex; flex-direction: column; gap: 5px;
}
.shame-names {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 2px 4px;
  z-index: 10;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.shame-names.visible {
  opacity: 1;
  transform: translateY(0);
}
.shame-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 5px;
  background: rgba(200,60,60,0.12);
  border: 1px solid rgba(200,60,60,0.25);
  border-radius: var(--r-full);
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 600;
  color: rgba(220,120,120,0.90);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  animation: chipPop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
.shame-chip-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  filter: grayscale(0.7);
  opacity: 0.6;
}
/* Tiny skull icon on shame chips */
.shame-chip::before {
  content: '💀';
  font-size: 0.6rem;
  opacity: 0.55;
}

/* ── Bar Chart ──────────────────────────────────────────────── */
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 72px; margin-top: var(--gap-sm); padding: 0 4px;
}
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-fill { width: 100%; min-height: 4px; border-radius: var(--r-sm) var(--r-sm) 0 0; transition: height 0.55s cubic-bezier(0.22,1,0.36,1); }
.bar-fill.opt-a { background: var(--opt-a-color); box-shadow: 0 0 10px var(--opt-a-glow); }
.bar-fill.opt-b { background: var(--opt-b-color); box-shadow: 0 0 10px var(--opt-b-glow); }
.bar-fill.opt-c { background: var(--opt-c-color); box-shadow: 0 0 10px var(--opt-c-glow); }
.bar-fill.opt-d { background: var(--opt-d-color); box-shadow: 0 0 10px var(--opt-d-glow); }
.bar-count { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; color: var(--text-subtle); }

/* ── Leaderboard ────────────────────────────────────────────── */
.leaderboard-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.lb-row {
  display: flex; align-items: center; gap: var(--gap-sm);
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  animation: rankSlide 0.35s cubic-bezier(0.22,1,0.36,1) both;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.lb-row:nth-child(1) { animation-delay: 0.03s; }
.lb-row:nth-child(2) { animation-delay: 0.06s; }
.lb-row:nth-child(3) { animation-delay: 0.09s; }
.lb-row:nth-child(4) { animation-delay: 0.12s; }
.lb-row:nth-child(5) { animation-delay: 0.15s; }

.lb-row.self {
  border-color: var(--violet-soft);
  box-shadow: 0 0 20px var(--violet-glow), inset 0 0 16px var(--violet-dim);
}
.lb-row.correct { border-color: rgba(74,222,128,0.2); }

.lb-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--violet-dim), transparent);
  width: var(--pct, 0%); pointer-events: none;
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.lb-row.self .lb-bar { background: linear-gradient(90deg, var(--violet-dim), transparent); }
.lb-row:nth-child(1) .lb-bar { background: linear-gradient(90deg, rgba(251,191,36,0.1), transparent); }

.lb-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  color: #fff; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.lb-rank {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  color: var(--text-subtle); width: 28px; flex-shrink: 0; text-align: center;
}
.lb-rank.gold   { color: var(--amber); text-shadow: 0 0 10px var(--amber-glow); }
.lb-rank.silver { color: #9ca3af; }
.lb-rank.bronze { color: #b45309; }

.lb-name { flex: 1; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-streak {
  display: inline-flex; align-items: center; gap: 1px;
  font-size: 0.68rem; font-weight: 800; font-family: var(--font-display);
  color: var(--spark); background: rgba(255,92,26,0.12);
  border: 1px solid rgba(255,92,26,0.25); border-radius: 99px;
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
  animation: streakPop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes streakPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Signal Rush race board (between-question leaderboard) ────────── */
.race-board { display: flex; flex-direction: column; gap: 7px; }
.race-row {
  display: grid;
  grid-template-columns: 42px 36px 1fr 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  position: relative; overflow: hidden;
  opacity: 0;
  animation: raceSlideIn 0.4s cubic-bezier(0.22,1,0.36,1) var(--race-delay, 0s) forwards;
}
.race-row.is-self {
  border-color: rgba(184,255,60,0.3);
  background: rgba(184,255,60,0.055);
}
.race-row.is-leader::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 55%, rgba(251,191,36,0.06));
  pointer-events: none;
}
@keyframes raceSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.race-rank {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex-shrink: 0; line-height: 1;
}
.race-rank-badge {
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 800;
  border-radius: 4px; padding: 1px 4px; line-height: 1.4;
  animation: rankBadgePop 0.35s cubic-bezier(0.34,1.56,0.64,1) calc(var(--race-delay, 0s) + 0.22s) both;
}
.race-rank-badge.up   { color: #4ade80; background: rgba(74,222,128,0.15); }
.race-rank-badge.down { color: var(--spark); background: rgba(255,92,26,0.15); }
@keyframes rankBadgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.race-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.73rem; font-weight: 800;
  color: #000; flex-shrink: 0;
}
.race-info { min-width: 0; }
.race-name {
  font-weight: 600; font-size: 0.85rem;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.race-bar-track {
  height: 5px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.race-bar-fill {
  height: 100%; border-radius: 3px;
  width: 0;
  animation: raceBarGrow 0.5s cubic-bezier(0.22,1,0.36,1)
    calc(var(--race-delay, 0s) + 0.1s) forwards;
}
@keyframes raceBarGrow { to { width: var(--pct, 0%); } }
.race-score-col { text-align: right; flex-shrink: 0; }
.race-score {
  display: block; font-family: var(--font-mono);
  font-size: 0.82rem; font-weight: 700;
}
.race-delta {
  display: block; font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 700; color: var(--correct);
  animation: deltaFade 2.5s ease 0.5s both;
}
.lb-badge { font-size: 0.68rem; font-weight: 700; background: var(--violet-dim); color: var(--violet-soft); padding: 2px 7px; border-radius: var(--r-full); flex-shrink: 0; border: 1px solid rgba(167,139,250,0.2); }
.lb-score { font-family: var(--font-mono); font-weight: 700; font-size: 0.88rem; color: var(--text); flex-shrink: 0; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.lb-delta { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--correct); flex-shrink: 0; min-width: 50px; text-align: right; animation: deltaFade 2.5s ease 0.5s both; }

/* ── Podium ─────────────────────────────────────────────────── */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: var(--gap-md); padding: var(--gap-xl) 0 var(--gap-md); }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: var(--gap-sm); width: 110px; }
.podium-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: #fff; box-shadow: var(--shadow-md);
  animation: avatarPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.podium-place.p1 .podium-avatar { width: 64px; height: 64px; font-size: 1.2rem; box-shadow: 0 0 28px var(--amber-glow), var(--shadow-md); }
.podium-name { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; text-align: center; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.podium-block {
  width: 100%; border-radius: var(--r-md) var(--r-md) 0 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px; overflow: hidden;
  transform-origin: bottom;
  animation: podiumRise 0.7s cubic-bezier(0.22,1,0.36,1) both;
}
.podium-place.p1 .podium-block { height: 100px; background: linear-gradient(180deg, #fbbf24, #d97706); box-shadow: 0 0 32px var(--amber-glow); animation-delay: 0.05s; }
.podium-place.p2 .podium-block { height: 72px;  background: linear-gradient(180deg, #9ca3af, #6b7280); animation-delay: 0.15s; }
.podium-place.p3 .podium-block { height: 52px;  background: linear-gradient(180deg, #b45309, #92400e); animation-delay: 0.25s; }
.podium-rank { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }

/* ── Floating Reactions ─────────────────────────────────────── */
.floating-reaction {
  position: fixed; font-size: 2.2rem;
  pointer-events: none; z-index: 400;
  animation: emojiRise 2.6s cubic-bezier(0.22,1,0.36,1) both;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.reaction-source {
  position: fixed;
  width: fit-content;
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
  color: var(--text-subtle);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 2px 8px;
  box-shadow: var(--shadow-sm); pointer-events: none; z-index: 400;
  animation: emojiRise 2.6s cubic-bezier(0.22,1,0.36,1) both;
  white-space: nowrap;
}
#signalBurst { position: fixed; bottom: 60px; right: 16px; pointer-events: none; z-index: 400; }

/* ── Confetti ───────────────────────────────────────────────── */
.confetti-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 300; }
.confetti-piece { position: absolute; top: -20px; animation: confettiFall linear both; }

/* ── PARTICLE BURST (on correct answer) ────────────────────── */
.particle-burst {
  position: absolute; top: 50%; left: 50%;
  pointer-events: none; z-index: 10;
}
.particle {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  animation: particleShoot 0.7s ease-out both;
  transform-origin: 0 0;
}

/* ── Feedback Panel ─────────────────────────────────────────── */
.feedback-icon {
  font-size: 3.5rem;
  animation: feedbackIcon 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  line-height: 1;
}
.feedback-delta {
  font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700;
  color: var(--correct);
  animation: deltaFloat 2.5s ease forwards;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--correct-glow);
}

/* ── Locked Overlay ─────────────────────────────────────────── */
.locked-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--gap-md); padding: var(--gap-xl); text-align: center;
  animation: fadeSlate 0.2s ease both;
}
.locked-check {
  font-size: 3rem;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  line-height: 1;
  color: var(--violet-soft);
  text-shadow: 0 0 24px var(--violet-glow);
}
.locked-text { font-weight: 700; font-size: 0.95rem; color: var(--text-subtle); }
.locked-badge {
  padding: 8px 20px; border-radius: var(--r-md); font-weight: 700; font-size: 0.9rem;
  animation: readyGlow 1.6s ease-in-out infinite;
}

/* ── Code Inputs (Join) ─────────────────────────────────────── */
.code-inputs { display: flex; gap: 8px; justify-content: center; }
.code-digit {
  width: 52px; height: 64px;
  font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  color: var(--text); caret-color: var(--violet-soft);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s cubic-bezier(0.34,1.56,0.64,1);
  -moz-appearance: textfield; appearance: textfield;
}
.code-digit::-webkit-outer-spin-button,
.code-digit::-webkit-inner-spin-button { -webkit-appearance: none; }
.code-digit:focus {
  border-color: var(--violet-soft);
  box-shadow: 0 0 0 2px var(--violet-dim), 0 0 20px var(--violet-glow);
  transform: translateY(-3px) scale(1.04);
}
.code-digit.filled {
  border-color: var(--violet-soft);
  color: var(--violet-soft);
  text-shadow: 0 0 14px var(--violet-glow);
  box-shadow: 0 0 16px var(--violet-dim);
}
.code-digit.error {
  border-color: var(--red);
  box-shadow: 0 0 16px rgba(248,113,113,0.3);
  animation: shakeWrong 0.4s ease;
}
.name-section { animation: fadeSlate 0.28s ease both; }

/* ── Waiting Screen — Orbital ───────────────────────────────── */
.waiting-frame {
  background: rgba(14,14,26,0.8);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  box-shadow: 0 0 60px var(--violet-glow), var(--shadow-lg);
  padding: var(--gap-2xl) var(--gap-xl);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--gap-lg); text-align: center; max-width: 380px; width: 100%;
  backdrop-filter: blur(24px);
}
/* Orbital rings */
.waiting-rings {
  position: relative; width: 90px; height: 90px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.waiting-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid var(--violet-soft);
  animation: orbitPulse 3s ease-out infinite;
  opacity: 0;
  box-shadow: 0 0 8px var(--violet-glow);
}
.waiting-ring:nth-child(1) { width: 32px; height: 32px; animation-delay: 0s; }
.waiting-ring:nth-child(2) { width: 58px; height: 58px; animation-delay: 0.8s; border-color: var(--cyan-soft); box-shadow: 0 0 8px var(--cyan-glow); }
.waiting-ring:nth-child(3) { width: 86px; height: 86px; animation-delay: 1.6s; border-color: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow); }

/* Orbiting dot */
.waiting-orbit {
  position: absolute;
  width: 90px; height: 90px;
  animation: orbitSpin 4s linear infinite;
}
.waiting-orbit::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange-glow);
}

.waiting-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--violet-soft);
  box-shadow: 0 0 16px var(--violet-glow);
  z-index: 1;
}
.waiting-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-subtle);
}
.waiting-name-display {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 800;
  background: linear-gradient(135deg, var(--violet-soft), var(--cyan-soft));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1.1;
}
.waiting-game-title { font-size: 0.85rem; font-weight: 600; color: var(--text-subtle); }
.waiting-pulse { display: none; }
.waiting-cursor { display: none; }

/* ── Answered counter ───────────────────────────────────────── */
.answered-counter { display: flex; align-items: center; gap: var(--gap-sm); font-size: 0.78rem; font-weight: 600; color: var(--text-subtle); }
.answered-bar { flex: 1; height: 3px; background: var(--border); border-radius: var(--r-full); overflow: hidden; min-width: 60px; }
.answered-fill { height: 100%; background: linear-gradient(90deg, var(--violet-soft), var(--cyan-soft)); border-radius: var(--r-full); transition: width 0.3s ease; box-shadow: 0 0 6px var(--violet-glow); }

/* ── Host controls ──────────────────────────────────────────── */
.host-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap-md); margin-top: var(--gap-md); padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}

/* ── Screens ────────────────────────────────────────────────── */
.screen { animation: fadeSlate 0.22s ease both; }

/* ── Pause Banner ───────────────────────────────────────────── */
.paused-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, var(--violet), #7c3aed, var(--cyan), #06b6d4, var(--violet));
  background-size: 300% 100%;
  animation: pauseBannerShift 4s linear infinite;
  color: #fff; padding: 9px var(--gap-md);
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  text-align: center; z-index: 300; white-space: nowrap; overflow: hidden;
}
.paused-banner-inner { display: inline-block; padding-left: 100%; animation: pauseMarquee 9s linear infinite; }

/* ── Corner Toggles ─────────────────────────────────────────── */
.sound-toggle {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: var(--r-full); padding: 8px 14px;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  color: var(--text-subtle); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: all 0.15s ease; display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(10px);
}
.sound-toggle:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-bright); }
.sound-toggle.muted { opacity: 0.5; }

.mode-toggle {
  position: fixed; bottom: 16px; left: 16px; z-index: 200;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: var(--r-full); padding: 8px 14px;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  color: var(--text-subtle); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: all 0.15s ease; backdrop-filter: blur(10px);
}
.mode-toggle:hover { background: var(--surface-3); color: var(--text); }

/* ── Copy Code Button ───────────────────────────────────────── */
.copy-code-btn {
  background: var(--surface-3); border: 1px solid var(--border-mid);
  border-radius: var(--r-md); padding: 6px 14px;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  color: var(--text-subtle); cursor: pointer; transition: all 0.15s ease;
}
.copy-code-btn:hover { background: var(--surface-4); color: var(--text); border-color: var(--violet-soft); box-shadow: 0 0 12px var(--violet-glow); }
.copy-code-btn.copied { color: var(--correct); border-color: var(--correct); box-shadow: 0 0 12px var(--correct-glow); }

/* ── QR code ────────────────────────────────────────────────── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; background: var(--surface-2); border: 1px solid rgba(0,232,160,0.22); border-radius: var(--r-md); width: fit-content; margin: var(--gap-md) auto var(--gap-md); box-shadow: 0 0 24px rgba(0,232,160,0.10), 0 0 0 4px rgba(0,232,160,0.05); }
.qr-wrap > img, .qr-wrap canvas { border-radius: 4px; }
.qr-label { font-size: 0.68rem; font-weight: 700; color: var(--text-subtle); letter-spacing: 0.16em; text-transform: uppercase; }

/* ── Reaction Bar ───────────────────────────────────────────── */
.reaction-bar { display: flex; justify-content: center; gap: var(--gap-sm); flex-wrap: wrap; margin-top: var(--gap-sm); }
.reaction-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 8px 14px;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s ease, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.reaction-btn:hover { transform: scale(1.18) translateY(-3px); box-shadow: 0 0 20px rgba(167,139,250,0.3); border-color: var(--violet-soft); }
.reaction-btn:active { transform: scale(0.88); }
.reaction-btn.reacted { border-color: var(--violet-soft); background: var(--violet-dim); animation: reactionPop 0.3s cubic-bezier(0.34,1.56,0.64,1); box-shadow: 0 0 16px var(--violet-glow); }

/* ── Auto-advance ───────────────────────────────────────────── */
.auto-advance-bar { height: 2px; background: var(--border); border-radius: var(--r-full); overflow: hidden; margin-top: var(--gap-sm); }
.auto-advance-fill { height: 100%; background: linear-gradient(90deg, var(--violet-soft), var(--cyan)); border-radius: var(--r-full); transition: width 1s linear; }
.auto-advance-row { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); font-size: 0.78rem; font-weight: 600; color: var(--text-subtle); margin-top: 6px; }

/* ── Pause button ───────────────────────────────────────────── */
.pause-btn {
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: var(--r-md); padding: 9px 18px;
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; color: var(--text-subtle); transition: all 0.15s ease;
}
.pause-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-bright); }
.pause-btn.paused { color: var(--violet-soft); border-color: var(--violet-soft); background: var(--violet-dim); box-shadow: 0 0 16px var(--violet-glow); }

/* ── Review Stats ───────────────────────────────────────────── */
.review-stats { display: flex; gap: var(--gap-sm); flex-wrap: wrap; margin-bottom: var(--gap-md); }
.review-stat { flex: 1; min-width: 90px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--gap-md); text-align: center; }
.review-stat-value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--violet-soft); font-variant-numeric: tabular-nums; text-shadow: 0 0 16px var(--violet-glow); }
.review-stat-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); margin-top: 3px; }

/* ── Rank badge ─────────────────────────────────────────────── */
.rank-badge { display: inline-flex; align-items: center; background: var(--violet-dim); color: var(--violet-soft); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); border: 1px solid rgba(167,139,250,0.2); }

/* ── Spectator ──────────────────────────────────────────────── */
.spectator-banner { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 14px; text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--text-subtle); letter-spacing: 0.08em; margin-bottom: var(--gap-md); }

/* ── Builder ────────────────────────────────────────────────── */
.builder-header { text-align: center; padding: var(--gap-xl) 0 var(--gap-lg); }
.question-editor { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--gap-lg); margin-bottom: var(--gap-md); position: relative; border: 1px solid var(--border); transition: box-shadow 0.2s ease, border-color 0.2s; }
.question-editor:hover { box-shadow: var(--shadow-md); border-color: var(--border-mid); }
.question-num { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; color: var(--text-subtle); margin-bottom: var(--gap-sm); text-transform: uppercase; letter-spacing: 0.1em; }
.builder-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; color: var(--text); font-family: var(--font-body); font-size: 0.92rem; outline: none; box-sizing: border-box; margin-bottom: var(--gap-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.builder-input:focus { border-color: var(--violet-soft); box-shadow: 0 0 0 2px var(--violet-dim), 0 0 16px var(--violet-glow); }
.option-row { display: flex; align-items: center; gap: var(--gap-sm); margin-bottom: 6px; }
.option-correct-toggle { width: 22px; height: 22px; border-radius: var(--r-sm); border: 1px solid var(--border-mid); background: transparent; cursor: pointer; flex-shrink: 0; transition: all 0.15s; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: transparent; }
.option-correct-toggle.correct { background: var(--correct); border-color: var(--correct); color: #fff; box-shadow: 0 0 10px var(--correct-glow); }
.remove-question-btn { position: absolute; top: 12px; right: 12px; background: transparent; border: none; color: var(--text-subtle); font-size: 0.8rem; cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); transition: all 0.15s; }
.remove-question-btn:hover { background: rgba(248,113,113,0.1); color: var(--red); }
.builder-actions { display: flex; gap: var(--gap-md); flex-wrap: wrap; align-items: center; margin-top: var(--gap-xl); }
.json-preview { background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--border); padding: var(--gap-md); font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-subtle); white-space: pre; overflow-x: auto; max-height: 300px; overflow-y: auto; margin-top: var(--gap-lg); }
.time-input-row { display: flex; align-items: center; gap: var(--gap-sm); font-size: 0.85rem; color: var(--text-subtle); margin-top: var(--gap-sm); }
.time-input { width: 72px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 10px; color: var(--text); font-family: var(--font-mono); font-size: 0.92rem; text-align: center; outline: none; }
.time-input:focus { border-color: var(--violet-soft); }

/* ── @keyframes ─────────────────────────────────────────────── */
@keyframes fadeSlate {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blobDrift {
  0%   { transform: translate(0,0) scale(1) rotate(0deg); border-radius: 40% 60% 70% 30% / 50% 40% 60% 50%; }
  25%  { transform: translate(6%,4%) scale(1.05) rotate(5deg); border-radius: 60% 40% 50% 50% / 40% 60% 40% 60%; }
  50%  { transform: translate(-4%,8%) scale(0.95) rotate(-3deg); border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
  75%  { transform: translate(8%,-4%) scale(1.08) rotate(8deg); border-radius: 30% 70% 60% 40% / 50% 50% 40% 60%; }
  100% { transform: translate(0,0) scale(1) rotate(0deg); border-radius: 40% 60% 70% 30% / 50% 40% 60% 50%; }
}
@keyframes gradientShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
@keyframes pipPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 10px var(--lime-glow); }
  50%     { transform: scale(1.4); box-shadow: 0 0 22px var(--lime-glow), 0 0 40px rgba(184,255,60,0.15); }
}
@keyframes plasmaRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes timerShake {
  0%,100% { transform: translate(-50%,-50%); }
  25%     { transform: translate(-53%,-50%); }
  75%     { transform: translate(-47%,-50%); }
}
@keyframes codeCharPop {
  0%   { transform: scale(0.5); opacity: 0.4; }
  65%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes codeCharIdle {
  0%,100% { box-shadow: 0 0 24px rgba(184,255,60,0.18), 0 0 80px rgba(184,255,60,0.06), inset 0 0 20px rgba(184,255,60,0.04); }
  50%     { box-shadow: 0 0 40px rgba(184,255,60,0.32), 0 0 100px rgba(184,255,60,0.10), inset 0 0 28px rgba(184,255,60,0.07); }
}
@keyframes chipPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes answerIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes correctBurst {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.07); }
  60%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
@keyframes shakeWrong {
  0%,100% { transform: translateX(0) perspective(600px); }
  20%     { transform: translateX(-8px) perspective(600px); }
  40%     { transform: translateX(8px) perspective(600px); }
  60%     { transform: translateX(-4px) perspective(600px); }
  80%     { transform: translateX(4px) perspective(600px); }
}
@keyframes cardFlipOut {
  from { transform: perspective(700px) rotateY(0deg) scale(1); opacity: 1; }
  to   { transform: perspective(700px) rotateY(-90deg) scale(0.94); opacity: 0.1; }
}
@keyframes cardFlipIn {
  from { transform: perspective(700px) rotateY(90deg) scale(0.94); opacity: 0.1; }
  to   { transform: perspective(700px) rotateY(0deg) scale(1); opacity: 1; }
}
@keyframes rankSlide {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes podiumRise {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes avatarPop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes emojiRise {
  0%   { opacity: 0; transform: scale(0.3) translateY(0); }
  12%  { opacity: 1; transform: scale(1.2) translateY(-12px); }
  22%  { transform: scale(1) translateY(-26px); }
  80%  { opacity: 0.8; transform: scale(0.95) translateY(-90px); }
  100% { opacity: 0; transform: scale(0.8) translateY(-130px); }
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@keyframes particleShoot {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}
@keyframes reactionPop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes feedbackIcon {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes deltaFloat {
  0%   { opacity: 0; transform: translateY(0); }
  10%  { opacity: 1; transform: translateY(-8px); }
  70%  { opacity: 1; transform: translateY(-44px); }
  100% { opacity: 0; transform: translateY(-70px); }
}
.feedback-streak {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; padding: 6px 16px;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 800;
  color: var(--spark); background: rgba(255,92,26,0.12);
  border: 1.5px solid rgba(255,92,26,0.3); border-radius: 99px;
  animation: streakBounce 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes streakBounce {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes deltaFade {
  0%,60% { opacity: 1; }
  100%   { opacity: 0; }
}
@keyframes orbitPulse {
  0%   { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes readyGlow {
  0%,100% { box-shadow: 0 0 20px var(--correct-glow); }
  50%     { box-shadow: 0 0 40px var(--correct-glow), 0 0 70px rgba(74,222,128,0.1); }
}
@keyframes pauseMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes pauseBannerShift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

@keyframes chipPop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .answers-grid { grid-template-columns: 1fr; }
  .answer { min-height: 66px; font-size: 0.9rem; padding: 0 14px; }
  .game-code-char { width: 44px; height: 56px; font-size: 1.8rem; }
  .question-text { font-size: clamp(0.95rem, 4.5vw, 1.3rem); }
  .question-card { padding: var(--gap-md); }
  .podium-place { width: 88px; }
  .podium-place.p1 .podium-avatar { width: 52px; height: 52px; }
  .timer-container { width: 56px; height: 56px; }
  .timer-ring { width: 56px; height: 56px; }
  .timer-number { font-size: 0.92rem; }
  .waiting-frame { padding: var(--gap-xl) var(--gap-lg); }
}
@media (max-width: 380px) {
  .code-inputs { gap: 5px; }
  .code-digit { width: 46px; height: 58px; font-size: 1.5rem; }
}

/* ── Site Nav (index / library / builder) ───────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap-lg);
  background: rgba(8,8,8,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  z-index: 200;
}
.site-nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}
.site-nav__links a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 0.15s;
  padding: 4px 0;
}
.site-nav__links a:hover,
.site-nav__links a.active { color: var(--spark); }
/* body offset when nav is present */
body:has(.site-nav) { padding-top: 52px; }

/* ── Library page ────────────────────────────────────────────── */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap-lg);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gap-md) var(--gap-xl);
}
.quiz-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  padding: var(--gap-md);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px 15px rgba(0,0,0,0.75),
              0 4px 20px rgba(184,255,60,0.08);
}
.quiz-card__cover {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  background: var(--surface-3);
  object-fit: cover;
  display: block;
}
.quiz-card__cover-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--text-subtle);
}
.quiz-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.quiz-card__meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
}
.quiz-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.quiz-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lime-dim);
  color: var(--spark);
  border: 1px solid rgba(184,255,60,0.2);
}
.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1100px;
  width: 100%;
  padding: 0 var(--gap-md) var(--gap-lg);
  margin: 0 auto;
}
.filter-chip {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover,
.filter-chip.active {
  border-color: var(--spark);
  color: var(--spark);
  background: var(--lime-dim);
}
.library-search {
  max-width: 400px;
  width: 100%;
  padding: 0 var(--gap-md) var(--gap-md);
  margin: 0 auto;
}
.library-empty {
  text-align: center;
  color: var(--text-subtle);
  padding: var(--gap-xl);
  font-size: 0.9rem;
}
