/* ============================================
   GAME NIGHT — COMPLETE DESIGN SYSTEM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---- Design Tokens ---- */
:root {
  --bg:           #020208;
  --surface:      #0a0b1e;
  --surface2:     #12142a;
  --gold:         #FFD700;
  --gold-dark:    #9A7B1C;
  --gold-grad:    linear-gradient(135deg, #FFE875 0%, #D4AF37 50%, #9A7B1C 100%);
  --correct:      #00e676;
  --wrong:        #ff1744;
  --buzzed:       #ff9100;
  --text:         #ffffff;
  --muted:        #8f9bb3;
  --team-a:       #ff4d4d;
  --team-b:       #4d7aff;
  --glass-bg:     rgba(10, 11, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Outfit', sans-serif;

  --radius:    16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { position: relative; }
a { color: var(--gold); text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ---- Particle Canvas ---- */
#particleCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ---- Scanline Overlay ---- */
.scanline-overlay {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ---- Spotlight Beam ---- */
.spotlight-sweep {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  overflow: hidden;
}
.spotlight-sweep::before {
  content: '';
  position: absolute;
  width: 200px; height: 200%;
  top: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.02), transparent);
  animation: spotlightMove 12s ease-in-out infinite;
  will-change: transform;
}

/* ---- Page Container ---- */
.page-container {
  position: relative; z-index: 2;
  width: 100%; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.page-container.scrollable { overflow-y: auto; }

/* ---- Glass Panel ---- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ---- Typography ---- */
.font-display { font-family: var(--font-display); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-correct { color: var(--correct); }
.text-wrong { color: var(--wrong); }
.text-team-a { color: var(--team-a); }
.text-team-b { color: var(--team-b); }

.gold-gradient-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-huge {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 6px;
  line-height: 1;
}
.title-large {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  letter-spacing: 4px;
  line-height: 1.1;
}
.title-medium {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  letter-spacing: 3px;
}
.title-small {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 2px;
}
.subtitle {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

/* ---- Connection Pill ---- */
.connection-pill {
  position: fixed; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: rgba(10,11,30,0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--muted);
  z-index: 9999;
  transition: all 0.3s ease;
}
.conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wrong);
  transition: background 0.3s ease;
}
.connection-pill.connected .conn-dot { background: var(--correct); }
.connection-pill.connected { border-color: rgba(0,230,118,0.2); }

/* ---- Top Bar / Header ---- */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(10, 11, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  flex-shrink: 0;
}
.top-bar-brand {
  display: flex; align-items: center; gap: 12px;
}
.top-bar-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 3px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.top-bar-title {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---- Scoreboard (F1 Broadcast Style) ---- */
.scoreboard-bar {
  display: flex; align-items: center; justify-content: center; gap: 32px;
  padding: 10px 24px;
  background: rgba(10, 11, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.scoreboard-team {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
  min-width: 180px;
  transition: all 0.3s ease;
}
.scoreboard-team.team-a {
  background: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 77, 77, 0.3);
}
.scoreboard-team.team-b {
  background: rgba(77, 122, 255, 0.15);
  border: 1px solid rgba(77, 122, 255, 0.3);
}
.scoreboard-team-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
}
.scoreboard-team.team-a .scoreboard-team-name { color: var(--team-a); }
.scoreboard-team.team-b .scoreboard-team-name { color: var(--team-b); }
.scoreboard-score {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
  color: var(--text);
}
.scoreboard-vs {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 3px;
}
.scoreboard-leading {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.4) !important;
}
.scoreboard-game-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Scoreboard - Large variant (for livetv and main-screen top) */
.scoreboard-large {
  display: flex; align-items: center; justify-content: center; gap: 40px;
  padding: 16px 32px;
}
.scoreboard-large .scoreboard-team { min-width: 240px; padding: 10px 28px; }
.scoreboard-large .scoreboard-team-name { font-size: 1.5rem; }
.scoreboard-large .scoreboard-score { font-size: 2.5rem; }

/* ---- Lifeline Icons (Scoreboard) ---- */
.lifeline-dots {
  display: flex; gap: 6px; margin-top: 4px;
}
.lifeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
  transition: all 0.3s ease;
}
.lifeline-dot.used {
  background: var(--muted);
  opacity: 0.3;
}

/* ---- Alert System ---- */
.alert-bar {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 12px 24px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  will-change: transform;
}
.alert-bar.visible { transform: translateY(0); }
.alert-bar.info    { background: rgba(255,215,0,0.15); color: var(--gold); border-bottom: 1px solid rgba(255,215,0,0.3); }
.alert-bar.success { background: rgba(0,230,118,0.15); color: var(--correct); border-bottom: 1px solid rgba(0,230,118,0.3); }
.alert-bar.warning { background: rgba(255,145,0,0.15); color: var(--buzzed); border-bottom: 1px solid rgba(255,145,0,0.3); }
.alert-bar.error   { background: rgba(255,23,68,0.15); color: var(--wrong); border-bottom: 1px solid rgba(255,23,68,0.3); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  will-change: transform;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-xl { padding: 20px 40px; font-size: 1.3rem; border-radius: var(--radius); }

.btn-primary {
  background: var(--gold-grad);
  color: #000;
  border-color: var(--gold-dark);
  font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(255,215,0,0.3); }

.btn-success { background: rgba(0,230,118,0.2); border-color: var(--correct); color: var(--correct); }
.btn-success:hover { background: rgba(0,230,118,0.3); box-shadow: 0 0 15px rgba(0,230,118,0.2); }

.btn-danger { background: rgba(255,23,68,0.2); border-color: var(--wrong); color: var(--wrong); }
.btn-danger:hover { background: rgba(255,23,68,0.3); box-shadow: 0 0 15px rgba(255,23,68,0.2); }

.btn-warning { background: rgba(255,145,0,0.2); border-color: var(--buzzed); color: var(--buzzed); }
.btn-warning:hover { background: rgba(255,145,0,0.3); box-shadow: 0 0 15px rgba(255,145,0,0.2); }

.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.1);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-team-a { background: rgba(255,77,77,0.2); border-color: var(--team-a); color: var(--team-a); }
.btn-team-a:hover { background: rgba(255,77,77,0.3); }
.btn-team-b { background: rgba(77,122,255,0.2); border-color: var(--team-b); color: var(--team-b); }
.btn-team-b:hover { background: rgba(77,122,255,0.3); }

.btn-glow-pulse { animation: gold-pulse 1.5s ease-in-out infinite; }

/* ---- Input Fields ---- */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  outline: none;
}
.input-field:focus { border-color: var(--gold); }
.input-field::placeholder { color: rgba(143,155,179,0.5); }

.input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group { margin-bottom: 16px; }

/* ---- KBC Option Boxes ---- */
.kbc-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 0 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.kbc-option {
  clip-path: polygon(4% 0%, 96% 0%, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
  background: linear-gradient(90deg, rgba(14,18,48,0.8), rgba(8,10,29,0.9));
  border: 1.5px solid rgba(255,255,255,0.15);
  padding: 16px 45px;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  color: var(--muted);
  will-change: transform, opacity;
  position: relative;
  min-height: 60px;
}
.kbc-option .opt-label {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 28px;
}
.kbc-option .opt-text {
  flex: 1;
}
.kbc-option.hidden-opt { visibility: hidden; pointer-events: none; }
.kbc-option.revealed { 
  visibility: visible;
  animation: option-reveal 0.6s ease-out forwards;
}
.kbc-option.selected {
  border-color: var(--buzzed);
  background: rgba(255,145,0,0.2);
  color: white;
  box-shadow: 0 0 20px rgba(255,145,0,0.15);
}
.kbc-option.locked {
  border-color: var(--gold);
  animation: gold-pulse 0.8s infinite;
  color: white;
}
.kbc-option.correct {
  border-color: var(--correct);
  background: rgba(0,230,118,0.3);
  color: white;
  box-shadow: 0 0 30px rgba(0,230,118,0.4);
}
.kbc-option.wrong {
  border-color: var(--wrong);
  background: rgba(255,23,68,0.3);
  color: white;
  box-shadow: 0 0 30px rgba(255,23,68,0.3);
}
.kbc-option.removed { visibility: hidden; pointer-events: none; }
.kbc-option.dimmed { opacity: 0.3; }

/* ---- KBC Options — Responsive ---- */
@media (max-width: 768px) {
  .kbc-options-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 8px;
  }
  .kbc-option {
    padding: 14px 32px;
    font-size: 1.1rem;
    min-height: 52px;
  }
}

/* ---- Buzzer Button ---- */
.buzzer-container {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  flex-shrink: 0;
}
.buzzer-btn {
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 4px solid var(--wrong);
  background: radial-gradient(circle at 35% 35%, #ff6666, #cc0000, #880000);
  color: white;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  will-change: transform;
  box-shadow: 0 0 30px rgba(255,23,68,0.3), inset 0 -6px 12px rgba(0,0,0,0.3);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.buzzer-btn:active:not(:disabled) {
  transform: scale(0.92);
  box-shadow: 0 0 50px rgba(255,23,68,0.6), inset 0 2px 8px rgba(0,0,0,0.4);
}
.buzzer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.buzzer-btn.buzzed-self {
  border-color: var(--correct);
  background: radial-gradient(circle at 35% 35%, #66ff99, #00cc44, #008822);
  box-shadow: 0 0 40px rgba(0,230,118,0.4);
  animation: buzzer-glow 0.5s ease;
}
.buzzer-btn.locked {
  border-color: var(--muted);
  background: radial-gradient(circle at 35% 35%, #555, #333, #222);
  box-shadow: none;
}
/* Bigger on mobile */
@media (max-width: 480px) {
  .buzzer-btn { width: 200px; height: 200px; font-size: 2.2rem; }
}

/* ---- Timer ---- */
.timer-display {
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: 4px;
  color: var(--text);
  text-align: center;
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  transition: color 0.3s ease;
}
.timer-display.urgent { color: var(--wrong); animation: timer-pulse 0.5s ease-in-out infinite; }
.timer-display.paused { color: var(--muted); }

.timer-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--text);
  position: relative;
}
.timer-circle.urgent { border-color: var(--wrong); color: var(--wrong); }

/* ---- Countdown Overlay ---- */
.countdown-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,2,8,0.85);
  z-index: 5000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.countdown-overlay.active { opacity: 1; }
.countdown-number {
  font-family: var(--font-display);
  font-size: 12rem;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(255,215,0,0.5);
  animation: countdown-pop 0.8s ease-out;
  will-change: transform, opacity;
}
.countdown-number.buzz-text {
  font-size: 6rem;
  color: var(--correct);
  text-shadow: 0 0 60px rgba(0,230,118,0.5);
  letter-spacing: 12px;
}

/* ---- Buzz Flash ---- */
.buzz-flash {
  position: fixed; inset: 0;
  z-index: 4000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.buzz-flash.active { opacity: 1; animation: buzz-flash-anim 0.8s ease-out forwards; }
.buzz-flash.team-a { background: radial-gradient(ellipse at center, rgba(255,77,77,0.4), transparent 70%); }
.buzz-flash.team-b { background: radial-gradient(ellipse at center, rgba(77,122,255,0.4), transparent 70%); }
.buzz-flash-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 4rem;
  letter-spacing: 6px;
  text-shadow: 0 0 40px currentColor;
}

/* ---- Team Colors & Badges ---- */
.team-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.team-badge.team-a { background: rgba(255,77,77,0.2); color: var(--team-a); border: 1px solid rgba(255,77,77,0.3); }
.team-badge.team-b { background: rgba(77,122,255,0.2); color: var(--team-b); border: 1px solid rgba(77,122,255,0.3); }

/* ---- Portal Cards (Index Page) ---- */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.portal-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: transform;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.portal-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,215,0,0.05), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.portal-card:hover::before { opacity: 1; }
.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,215,0,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(255,215,0,0.05);
}
.portal-icon {
  font-size: 2.5rem;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--glass-border);
}
.portal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 3px;
  color: var(--gold);
}
.portal-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.portal-device {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(143,155,179,0.5);
  margin-top: auto;
  padding-top: 8px;
}

/* ---- Backend Navigation ---- */
.backend-nav {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.nav-btn {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--surface2); }
.nav-btn.active {
  color: var(--gold);
  background: rgba(255,215,0,0.1);
  border-color: rgba(255,215,0,0.3);
}
.nav-btn.danger { color: var(--wrong); }
.nav-btn.danger:hover { background: rgba(255,23,68,0.1); }

.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 4px;
}
.nav-dropdown-content.show { display: block; }
.nav-dropdown-item {
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--muted);
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.nav-dropdown-item:hover { background: var(--surface2); color: var(--text); }
.nav-dropdown-item.active { color: var(--gold); }

/* ---- Status Strip ---- */
.status-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px;
  background: rgba(10,11,30,0.6);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.status-item {
  display: flex; align-items: center; gap: 6px;
}
.status-item strong { color: var(--text); }
.status-live { color: var(--correct); font-weight: 700; }

/* ---- Backend Two-Column Layout ---- */
.backend-main {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  overflow: hidden;
}
.backend-primary {
  padding: 20px;
  overflow-y: auto;
}
.backend-sidebar {
  padding: 20px;
  border-left: 1px solid var(--glass-border);
  overflow-y: auto;
  background: rgba(10,11,30,0.3);
}
@media (max-width: 1024px) {
  .backend-main { grid-template-columns: 1fr; }
  .backend-sidebar { border-left: none; border-top: 1px solid var(--glass-border); }
}

/* ---- Control Section ---- */
.control-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.control-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}
.control-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ---- Question Chips ---- */
.question-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.q-chip {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface2);
  color: var(--muted);
}
.q-chip:hover { border-color: var(--gold); color: var(--text); }
.q-chip.active { border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.1); }
.q-chip.correct { border-color: var(--correct); color: var(--correct); background: rgba(0,230,118,0.1); }
.q-chip.wrong { border-color: var(--wrong); color: var(--wrong); background: rgba(255,23,68,0.1); }
.q-chip.timeout { border-color: var(--muted); color: var(--muted); opacity: 0.6; }
.q-chip.skipped { border-color: var(--buzzed); color: var(--buzzed); background: rgba(255,145,0,0.1); }

/* ---- Host Note ---- */
.host-note {
  padding: 16px;
  background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 0.9rem;
  margin: 12px 0;
}
.host-note-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 6px;
}

/* ---- Lifeline Buttons & Bar ---- */
.lifeline-bar {
  display: flex; gap: 8px;
  padding: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.lifeline-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}
.lifeline-btn .lifeline-icon { font-size: 1.4rem; }
.lifeline-btn:hover:not(:disabled):not(.used) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255,215,0,0.1);
}
.lifeline-btn.used {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}
.lifeline-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.lifeline-btn.active-lifeline {
  border-color: var(--buzzed);
  color: var(--buzzed);
  background: rgba(255,145,0,0.15);
  animation: gold-pulse 1s infinite;
}

/* ---- Lifeline Request Banner ---- */
.lifeline-request-banner {
  padding: 16px;
  background: rgba(255,145,0,0.1);
  border: 1px solid rgba(255,145,0,0.3);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  animation: request-pulse 1.5s ease-in-out infinite;
}
.lifeline-request-text {
  font-weight: 600;
  color: var(--buzzed);
  font-size: 0.95rem;
}
.lifeline-request-actions {
  display: flex; gap: 8px;
}

/* ---- Number Grid (Team Formation) ---- */
.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.number-card {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 2px solid var(--glass-border);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: transform;
  perspective: 600px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.number-card:hover:not(.picked):not(.disabled) {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.number-card.picked {
  cursor: default;
  animation: card-flip 0.6s ease;
}
.number-card.picked.team-a-pick {
  border-color: var(--team-a);
  background: rgba(255,77,77,0.15);
  color: var(--team-a);
}
.number-card.picked.team-b-pick {
  border-color: var(--team-b);
  background: rgba(77,122,255,0.15);
  color: var(--team-b);
}
.number-card.disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}
.number-card-name {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

/* ---- Card Shuffle (Game 3) ---- */
.card-shuffle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 16px;
  max-width: 500px;
  margin: 0 auto;
}
.shuffle-card {
  aspect-ratio: 0.7;
  border-radius: var(--radius);
  border: 2px solid var(--gold-dark);
  background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: transform;
  animation: card-shuffle-float 3s ease-in-out infinite;
  color: #000;
}
.shuffle-card:hover { transform: translateY(-4px) scale(1.05); }
.shuffle-card.revealed {
  background: var(--surface2);
  border-color: var(--correct);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  animation: card-flip 0.6s ease;
}

/* ---- Image Display ---- */
.image-display {
  position: relative;
  max-width: 100%;
  max-height: 60vh;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  margin: 0 auto;
}
.image-display img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.image-timer-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,2,8,0.5);
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(255,215,0,0.5);
  pointer-events: none;
}
.image-lock-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(2,2,8,0.7);
  z-index: 10;
}
.lock-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: lock-pulse 1s ease-in-out infinite;
}
.image-hidden-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--muted);
  letter-spacing: 4px;
}

/* ---- Spot The Difference (Game 5) ---- */
.spot-diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  max-height: 60vh;
}
.spot-diff-image {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.spot-diff-image img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.diff-marker {
  position: absolute;
  border: 3px solid var(--correct);
  border-radius: 50%;
  pointer-events: none;
  animation: diff-found 0.5s ease-out;
  box-shadow: 0 0 15px rgba(0,230,118,0.5);
}
.diff-marker.wrong-tap {
  border-color: var(--wrong);
  box-shadow: 0 0 15px rgba(255,23,68,0.5);
  animation: diff-wrong 0.5s ease-out forwards;
}

/* ---- Audience Voting ---- */
.voting-panel {
  padding: 20px;
}
.voting-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
}
.voting-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}
.vote-btn {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--glass-border);
  background: var(--surface2);
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.vote-btn:hover { border-color: var(--gold); background: rgba(255,215,0,0.1); }
.vote-btn.voted { border-color: var(--correct); background: rgba(0,230,118,0.15); pointer-events: none; }
.vote-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.vote-results {
  margin-top: 16px;
  padding: 16px;
}
.vote-bar-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.vote-bar-label {
  font-weight: 700;
  font-size: 1rem;
  min-width: 28px;
  color: var(--gold);
}
.vote-bar-track {
  flex: 1; height: 28px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.vote-bar-fill {
  height: 100%;
  background: var(--gold-grad);
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 0;
}
.vote-bar-pct {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
  color: var(--muted);
}

/* ---- Question History (LiveTV) ---- */
.history-panel {
  padding: 16px;
  overflow-y: auto;
  max-height: 200px;
}
.history-panel-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 12px;
}
.history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.85rem;
  background: rgba(10,11,30,0.4);
  border: 1px solid var(--glass-border);
}
.history-q-num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  min-width: 28px;
}
.history-result-icon {
  font-size: 0.9rem;
}
.history-result-icon.correct { color: var(--correct); }
.history-result-icon.wrong { color: var(--wrong); }
.history-result-icon.timeout { color: var(--muted); }
.history-detail {
  flex: 1;
  color: var(--muted);
}
.history-points {
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.history-points.positive { color: var(--correct); }
.history-points.negative { color: var(--wrong); }
.history-points.zero { color: var(--muted); }

/* ---- Score Float Animation ---- */
.score-float {
  position: fixed;
  pointer-events: none;
  z-index: 6000;
  font-family: var(--font-display);
  font-size: 3rem;
  animation: float-score 1.2s ease-out forwards;
  will-change: transform, opacity;
  text-shadow: 0 0 20px currentColor;
}
.score-float.positive { color: var(--correct); }
.score-float.negative { color: var(--wrong); }

/* ---- Result Overlay ---- */
.result-overlay {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(2,2,8,0.85);
  z-index: 5500;
  pointer-events: none;
}
.result-overlay .result-text {
  font-family: var(--font-display);
  font-size: 5rem;
  letter-spacing: 8px;
  animation: result-slam 0.5s ease-out;
  will-change: transform, opacity;
}
.result-overlay .result-text.correct { color: var(--correct); text-shadow: 0 0 60px rgba(0,230,118,0.5); }
.result-overlay .result-text.wrong { color: var(--wrong); text-shadow: 0 0 60px rgba(255,23,68,0.5); }
.result-overlay .result-text.timeout { color: var(--muted); }

/* ---- WRB Screen ---- */
.wrb-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  z-index: 100;
}
.wrb-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 8px;
  text-align: center;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: cinematic-enter 1.5s ease-out;
}
.wrb-timer {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--muted);
  letter-spacing: 4px;
}
.wrb-announcement {
  font-size: 1.3rem;
  color: var(--text);
  text-align: center;
  max-width: 600px;
  animation: name-reveal 0.8s ease-out;
  will-change: clip-path, opacity, transform;
}

/* ---- Explanation Card ---- */
.explanation-card {
  max-width: 600px;
  margin: 16px auto;
  padding: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  animation: cinematic-enter 0.5s ease-out;
}
.explanation-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.explanation-text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---- Confirm Overlay ---- */
.confirm-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,2,8,0.85);
  z-index: 9500;
}
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 400px;
  text-align: center;
}
.confirm-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--wrong);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.confirm-text {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.confirm-actions {
  display: flex; gap: 12px; justify-content: center;
}

/* ---- Game Intro Screen ---- */
.game-intro {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  z-index: 200;
  animation: cinematic-enter 1s ease-out;
}
.game-intro-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: 10px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}
.game-intro-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2.5rem);
  letter-spacing: 6px;
  color: var(--muted);
  text-align: center;
  animation: name-reveal 1s ease-out 0.5s both;
}

/* ---- Rules Screen ---- */
.rules-screen {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px;
  animation: cinematic-enter 0.6s ease-out;
}
.rules-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 4px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 24px;
}
.rules-content {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}
.rules-content h3 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin: 20px 0 8px;
}
.rules-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.rules-content td, .rules-content th {
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  text-align: left;
}
.rules-content th { color: var(--gold); background: var(--surface2); }

/* ---- Question Container (Main Screen) ---- */
.question-area {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  gap: 24px;
  position: relative;
}
.question-text-box {
  text-align: center;
  max-width: 800px;
  padding: 24px 32px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  animation: cinematic-enter 0.5s ease-out;
}
.question-number {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ---- Captain Header ---- */
.captain-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10,11,30,0.9);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.captain-team-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
}
.captain-team-name.team-a { color: var(--team-a); }
.captain-team-name.team-b { color: var(--team-b); }
.captain-score {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
}
.captain-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 16px;
}
.captain-status {
  text-align: center;
  padding: 16px;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}
.captain-status-icon { font-size: 2rem; margin-bottom: 8px; display: block; }

/* ---- Confetti Canvas ---- */
#confettiCanvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 7000;
}

/* ---- Team Formation Layout ---- */
.tf-three-col {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 16px;
  padding: 16px;
  flex: 1;
  overflow: hidden;
}
.tf-team-panel {
  padding: 16px;
  border-radius: var(--radius);
  overflow-y: auto;
}
.tf-team-panel.team-a { background: rgba(255,77,77,0.05); border: 1px solid rgba(255,77,77,0.15); }
.tf-team-panel.team-b { background: rgba(77,122,255,0.05); border: 1px solid rgba(77,122,255,0.15); }
.tf-panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
  margin-bottom: 12px;
  text-align: center;
}
.tf-player-item {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  font-size: 0.95rem;
  animation: name-reveal 0.8s ease-out;
  will-change: clip-path, opacity, transform;
}
.tf-center-panel {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
@media (max-width: 768px) {
  .tf-three-col { grid-template-columns: 1fr; }
}

/* ---- Rapid Fire (Game 3) ---- */
.rapid-fire-question {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
  max-width: 80%;
  animation: cinematic-enter 0.3s ease-out;
}
.rapid-fire-timer {
  font-family: var(--font-display);
  font-size: 8rem;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(255,215,0,0.3);
}
.rapid-fire-result {
  font-family: var(--font-display);
  font-size: 4rem;
  animation: result-slam 0.4s ease-out;
}
.rapid-fire-result.survived { color: var(--correct); }
.rapid-fire-result.out { color: var(--wrong); }

/* ---- Categories (Game 6) ---- */
.category-display {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 6px;
  color: var(--gold);
  text-align: center;
}
.player-spotlight {
  text-align: center;
  padding: 24px;
}
.player-spotlight-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 4px;
  color: var(--text);
  animation: name-reveal 0.6s ease-out;
  will-change: clip-path, opacity, transform;
}
.player-spotlight-team {
  font-size: 1rem;
  margin-top: 8px;
}

/* ---- Content Area (fill remaining height) ---- */
.content-area {
  flex: 1;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.content-center {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes option-reveal {
  0%   { opacity: 0; transform: scaleX(0.5) translateX(-20px); filter: brightness(3); }
  60%  { filter: brightness(1.3); }
  100% { opacity: 1; transform: scaleX(1) translateX(0); filter: brightness(1); }
}

@keyframes countdown-pop {
  0%   { transform: scale(2.5); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes name-reveal {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; transform: translateY(10px); }
  100% { clip-path: inset(0 0% 0 0); opacity: 1; transform: translateY(0); }
}

@keyframes float-score {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

@keyframes result-slam {
  0%   { transform: scale(3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cinematic-enter {
  0%   { clip-path: inset(0 0 100% 0); opacity: 0; }
  100% { clip-path: inset(0 0 0% 0); opacity: 1; }
}

@keyframes card-flip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes gold-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
  50%      { box-shadow: 0 0 30px rgba(255,215,0,0.5); }
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes buzz-flash-anim {
  0%   { opacity: 0.8; }
  100% { opacity: 0; }
}

@keyframes request-pulse {
  0%, 100% { border-color: rgba(255,145,0,0.3); }
  50%      { border-color: rgba(255,145,0,0.6); }
}

@keyframes spotlightMove {
  0%   { transform: translateX(-200px); }
  50%  { transform: translateX(calc(100vw + 200px)); }
  50.1% { transform: translateX(-200px); }
  100% { transform: translateX(-200px); }
}

@keyframes lock-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.1); opacity: 0.7; }
}

@keyframes diff-found {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes diff-wrong {
  0%   { transform: scale(0); opacity: 0; }
  30%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

@keyframes buzzer-glow {
  0%   { box-shadow: 0 0 30px rgba(0,230,118,0.3); }
  50%  { box-shadow: 0 0 60px rgba(0,230,118,0.6); }
  100% { box-shadow: 0 0 40px rgba(0,230,118,0.4); }
}

@keyframes card-shuffle-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slide-up {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.3); }
}

@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .portal-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 20px; }
  .scoreboard-large { gap: 24px; padding: 12px 20px; }
  .scoreboard-large .scoreboard-team { min-width: 180px; }
  .tf-three-col { grid-template-columns: 1fr; }
  .spot-diff-container { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 768px) {
  .top-bar { padding: 10px 16px; }
  .scoreboard-bar { gap: 12px; padding: 8px 12px; flex-wrap: wrap; }
  .scoreboard-team { min-width: 120px; padding: 4px 12px; font-size: 0.9rem; }
  .scoreboard-score { font-size: 1.4rem; }
  .portal-grid { grid-template-columns: 1fr; padding: 16px; }
  .question-text-box { font-size: 1.2rem; padding: 16px; }
  .timer-display { font-size: 2rem; }
  .result-overlay .result-text { font-size: 3rem; }
  .countdown-number { font-size: 8rem; }
  .buzz-flash-text { font-size: 2.5rem; }
}

/* Captain Phone — small screens */
@media (max-width: 480px) {
  .captain-header { padding: 8px 12px; }
  .captain-content { padding: 12px; }
  .lifeline-bar { gap: 6px; }
  .lifeline-btn { min-width: 60px; padding: 10px 8px; font-size: 0.7rem; }
  .kbc-option { padding: 12px 24px; font-size: 1rem; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden { display: none !important; }
.invisible { visibility: hidden !important; pointer-events: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.no-scroll { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
