/* ==========================================================================
   HOT POTATO 💣 TEAM EDITION — STYLESHEET
   Design System: Projector-Ready, High-Contrast, Dark Party Game Aesthetics
   ========================================================================== */

:root {
  /* Core Theme Colors */
  --bg-dark: #0d0f18;
  --bg-surface: #151928;
  --bg-surface-elevated: #1e2438;
  --bg-card: rgba(28, 34, 52, 0.75);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-hover: rgba(255, 255, 255, 0.25);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Vibrant Accent Colors */
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --success: #10b981;
  --success-dark: #059669;
  --success-glow: rgba(16, 185, 129, 0.4);
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.5);
  --warning: #f59e0b;
  --info: #38bdf8;
  --chaos-orange: #ff5722;
  --chaos-red: #d50000;
  
  /* Team Colors */
  --team-blue: #3b82f6;
  --team-blue-bg: rgba(59, 130, 246, 0.15);
  --team-blue-glow: rgba(59, 130, 246, 0.4);
  
  --team-red: #ef4444;
  --team-red-bg: rgba(239, 68, 68, 0.15);
  --team-red-glow: rgba(239, 68, 68, 0.4);
  
  --team-green: #10b981;
  --team-green-bg: rgba(16, 185, 129, 0.15);
  --team-green-glow: rgba(16, 185, 129, 0.4);
  
  --team-purple: #a855f7;
  --team-purple-bg: rgba(168, 85, 247, 0.15);
  --team-purple-glow: rgba(168, 85, 247, 0.4);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--team-blue-glow);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Ambient Background Layer */
body {
  background: 
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 10% 90%, rgba(239, 68, 68, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    #0d0f18;
  background-attachment: fixed;
}

/* Confetti / FX Canvas */
#fxCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* App Outer Container */
.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: filter 0.3s ease, transform 0.1s ease;
}

/* Screen Management */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
  display: flex;
}

.screen.hidden, .hidden {
  display: none !important;
}

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

/* ==========================================================================
   SCREEN 1: SETUP SCREEN
   ========================================================================== */
.setup-hero {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 24px;
}

.logo-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 16px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.game-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bomb-emoji {
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.6));
}

.edition-tag {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  width: 100%;
  margin-top: -6px;
}

.game-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: 8px;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.setup-card {
  width: 100%;
  max-width: 960px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.setup-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.step-label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 800;
}

/* Button Groups for Selectors */
.btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.btn-select {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 18px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.btn-select:hover {
  background: #28304a;
  color: #ffffff;
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.btn-select.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
  transform: scale(1.02);
}

/* Team Configuration Grid */
.teams-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.team-config-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.team-config-card.team-color-0 { border-top: 5px solid var(--team-blue); }
.team-config-card.team-color-1 { border-top: 5px solid var(--team-red); }
.team-config-card.team-color-2 { border-top: 5px solid var(--team-green); }
.team-config-card.team-color-3 { border-top: 5px solid var(--team-purple); }

.team-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-icon-badge {
  font-size: 1.8rem;
}

.team-name-input-wrap {
  flex: 1;
}

.team-name-input {
  width: 100%;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 8px 12px;
  background: #0f121d;
  color: white;
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease;
}

.team-name-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.players-input-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-num-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 68px;
}

.player-name-input {
  flex: 1;
  font-size: 0.95rem;
  padding: 8px 12px;
  background: #0b0e17;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.player-name-input:focus {
  border-color: #38bdf8;
  background: #111728;
}

.player-name-input.input-error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Links & Buttons */
.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease, transform 0.1s ease;
}

.btn-link:hover {
  color: #fef08a;
  transform: scale(1.03);
}

.setup-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  animation: shake 0.3s ease;
}

.setup-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* Huge Button */
.btn-primary {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 18px 36px;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 75, 43, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(255, 75, 43, 0.6);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-huge {
  font-size: 1.4rem;
  padding: 20px 48px;
}

.btn-secondary {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 18px 36px;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background: #2c3552;
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

/* Pulse animation on primary CTA */
.btn-pulse {
  animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 75, 43, 0.6);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(255, 75, 43, 0);
  }
}

/* ==========================================================================
   SCREEN 2: MAIN GAME ARENA
   ========================================================================== */
#gameScreen {
  padding: 16px 20px 32px 20px;
  max-width: 1300px;
  margin: 0 auto;
}

/* Header / Status Bar */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
}

.round-badge {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 6px 14px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  border-radius: var(--radius-full);
}

.special-badge {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 900;
  padding: 6px 16px;
  background: linear-gradient(90deg, #ff5722, #d50000);
  color: #ffffff;
  border-radius: var(--radius-full);
  box-shadow: 0 0 16px rgba(255, 87, 34, 0.7);
  animation: chaosPulse 1s infinite alternate;
}

@keyframes chaosPulse {
  from { transform: scale(1); filter: drop-shadow(0 0 6px #ff5722); }
  to { transform: scale(1.06); filter: drop-shadow(0 0 16px #ff1744); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 14px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: #2e3754;
  color: #ffffff;
  border-color: var(--border-glass-hover);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* ==========================================================================
   SCOREBOARD SECTION
   ========================================================================== */
.scoreboard-wrapper {
  width: 100%;
  margin-bottom: 20px;
}

.scoreboard-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  text-align: center;
}

.scoreboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.score-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-card.active-turn {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px var(--shadow-glow);
}

.score-card.team-0 { border-color: var(--team-blue); --shadow-glow: var(--team-blue-glow); }
.score-card.team-1 { border-color: var(--team-red); --shadow-glow: var(--team-red-glow); }
.score-card.team-2 { border-color: var(--team-green); --shadow-glow: var(--team-green-glow); }
.score-card.team-3 { border-color: var(--team-purple); --shadow-glow: var(--team-purple-glow); }

.score-team-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-team-icon {
  font-size: 1.6rem;
}

.score-team-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-turn-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-points-badge {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  background: #0c0e17;
  color: #ffffff;
  min-width: 50px;
  text-align: center;
  transition: transform 0.2s ease;
}

.score-bump {
  animation: scoreBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--gold) !important;
  color: #000000 !important;
}

@keyframes scoreBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   GAME ARENA MAIN
   ========================================================================== */
.game-arena {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Chaos Active Mode Shift */
.app-container.chaos-mode {
  background: 
    radial-gradient(circle at 50% 10%, rgba(255, 87, 34, 0.25) 0%, transparent 65%),
    radial-gradient(circle at 50% 90%, rgba(213, 0, 0, 0.2) 0%, transparent 60%),
    #140500 !important;
}

.app-container.chaos-mode .game-arena {
  background: rgba(35, 10, 5, 0.85);
  border-color: rgba(255, 87, 34, 0.5);
  box-shadow: 0 0 40px rgba(255, 87, 34, 0.25);
}

.app-container.chaos-mode .team-turn-banner {
  background: linear-gradient(90deg, rgba(255, 87, 34, 0.2), rgba(213, 0, 0, 0.3), rgba(255, 87, 34, 0.2));
  border-color: #ff5722;
}

/* Active Team Turn Banner */
.team-turn-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  font-family: var(--font-heading);
}

.banner-flame {
  font-size: 1.4rem;
  animation: flameWobble 0.8s infinite alternate ease-in-out;
}

@keyframes flameWobble {
  from { transform: scale(0.9) rotate(-6deg); }
  to { transform: scale(1.15) rotate(6deg); }
}

.active-team-name {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.banner-sub {
  font-size: 1.25rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
}

/* Special Event Pill */
.event-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.2));
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-full);
  color: #fef08a;
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease;
}

.event-icon {
  font-size: 1.3rem;
}

.event-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
}

.event-desc {
  font-size: 0.95rem;
  color: #fde68a;
}

/* Arena Stages */
.arena-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* STAGE 1: SPEAKER SELECTION */
.stage-prompt-box {
  text-align: center;
  margin-bottom: 24px;
}

.stage-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.stage-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.speaker-buttons-grid {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.btn-speaker {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-speaker:hover {
  background: #2b3554;
  border-color: #60a5fa;
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.btn-speaker:active {
  transform: translateY(-1px) scale(0.98);
}

.speaker-icon {
  font-size: 2.4rem;
}

.speaker-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
}

.speaker-stats {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.speaker-key-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.speaker-tip {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* STAGE 2: ACTIVE QUESTION & COUNTDOWN */
.current-speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.3));
  border: 1.5px solid #60a5fa;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.speaker-avatar {
  font-size: 1.4rem;
}

.speaker-label {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #e0f2fe;
}

.speaker-label strong {
  color: #ffffff;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: #38bdf8;
}

/* Question Card */
.question-card {
  width: 100%;
  max-width: 920px;
  padding: 28px 36px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  border-width: 2px;
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tag {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--info);
  text-transform: uppercase;
}

.points-tag {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  padding: 4px 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  border-radius: var(--radius-full);
  color: #34d399;
}

.question-text {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.8vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  letter-spacing: -0.5px;
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-subtext {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffedd5;
  background: linear-gradient(90deg, rgba(255, 87, 34, 0.3), rgba(213, 0, 0, 0.3));
  border: 1px dashed var(--chaos-orange);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-top: 14px;
  animation: pulseChaosSub 1.5s infinite ease-in-out;
}

@keyframes pulseChaosSub {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ==========================================================================
   GIANT ANIMATED CARTOON BOMB COMPONENT
   ========================================================================== */
.bomb-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0 28px 0;
  position: relative;
}

.bomb-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bomb-visual {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.bomb-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
}

/* Fuse path animation */
#fusePath {
  stroke-dasharray: 120;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear;
}

/* Fuse Spark */
#fuseSparkGroup {
  animation: sparkFlicker 0.1s infinite alternate;
}

@keyframes sparkFlicker {
  0% { transform: scale(0.9) rotate(-3deg); opacity: 0.85; }
  100% { transform: scale(1.25) rotate(3deg); opacity: 1; }
}

/* Belly Timer Display inside Bomb */
.bomb-timer-display {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.timer-number {
  font-family: var(--font-heading);
  font-size: 4.8rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 0.9;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.timer-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Bomb Timer States */
/* 15-6s: Normal Breathing */
.bomb-visual.state-normal {
  animation: bombBreathe 2.5s infinite ease-in-out;
}

@keyframes bombBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* 5-3s: Warning Pulse (Amber) */
.bomb-visual.state-warning {
  animation: bombWarningPulse 0.6s infinite alternate ease-in-out;
}

.bomb-visual.state-warning .timer-number {
  color: #fbbf24;
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
}

.bomb-visual.state-warning .timer-label {
  color: #fbbf24;
}

@keyframes bombWarningPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.9)); }
}

/* 2-1s: Critical Intensity (Red & Violent Shake) */
.bomb-visual.state-critical {
  animation: bombCriticalShake 0.12s infinite alternate linear;
}

.bomb-visual.state-critical .timer-number {
  color: #ef4444;
  text-shadow: 0 0 35px rgba(239, 68, 68, 1);
  transform: scale(1.15);
}

.bomb-visual.state-critical .timer-label {
  color: #ef4444;
  font-weight: 900;
}

@keyframes bombCriticalShake {
  0% { transform: translate(-3px, 2px) rotate(-3deg) scale(1.08); filter: drop-shadow(0 0 35px rgba(239, 68, 68, 1)); }
  100% { transform: translate(3px, -2px) rotate(3deg) scale(1.12); filter: drop-shadow(0 0 50px rgba(255, 30, 30, 1)); }
}

/* ==========================================================================
   TEACHER CONTROL PANEL
   ========================================================================== */
.teacher-controls-panel {
  width: 100%;
  max-width: 960px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
}

.controls-buttons-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr;
  gap: 14px;
}

.btn-action {
  font-family: var(--font-heading);
  padding: 16px 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-action:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
}

.btn-action:active {
  transform: translateY(1px);
}

.btn-action-icon {
  font-size: 1.6rem;
}

.btn-action-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.2;
}

.main-action-text {
  font-size: 1.15rem;
  font-weight: 900;
}

.key-hint {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 600;
}

/* Button Variants */
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 6px 20px var(--success-glow);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 6px 20px var(--danger-glow);
}

.btn-neutral {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
}

.btn-neutral:hover {
  background: #2b3552;
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

/* ==========================================================================
   POPUP OVERLAYS (SUCCESS & BOOM)
   ========================================================================== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.popup-card {
  text-align: center;
  padding: 48px 64px;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.success-card {
  background: linear-gradient(135deg, #064e3b, #047857);
  border: 3px solid #34d399;
  box-shadow: 0 0 50px rgba(16, 185, 129, 0.6);
}

.popup-icon {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  color: #ffffff;
}

.popup-points {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #fef08a;
}

.popup-team-update {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #a7f3d0;
}

.boom-card {
  background: linear-gradient(135deg, #7f1d1d, #991b1b, #450a0a);
  border: 4px solid #ef4444;
  box-shadow: 0 0 80px rgba(239, 68, 68, 0.9);
}

.boom-flame-icon {
  font-size: 5rem;
  animation: boomFlare 0.4s infinite alternate;
}

.boom-text {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 950;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 0 30px #ef4444;
}

.boom-sub {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fca5a5;
}

.boom-points {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #94a3b8;
}

.boom-next-msg {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  margin-top: 8px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes shakeHard {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-12px, 8px) rotate(-4deg); }
  20% { transform: translate(12px, -8px) rotate(4deg); }
  30% { transform: translate(-10px, -6px) rotate(-3deg); }
  40% { transform: translate(10px, 6px) rotate(3deg); }
  50% { transform: translate(-6px, 4px) rotate(-1deg); }
  60% { transform: translate(6px, -4px) rotate(1deg); }
}

.animate-shake-hard {
  animation: shakeHard 0.6s ease-in-out;
}

/* Screen Shake for Explosion */
.screen-shake {
  animation: shakeHard 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Screen Flash for Explosion */
.screen-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  opacity: 0.9;
  pointer-events: none;
  z-index: 10000;
  animation: flashOut 0.4s ease-out forwards;
}

@keyframes flashOut {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* ==========================================================================
   SCREEN 3: WINNER & CELEBRATION SCREEN
   ========================================================================== */
#winnerScreen {
  justify-content: center;
}

.winner-container {
  width: 100%;
  max-width: 960px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.winner-trophies {
  font-size: 3.5rem;
}

.animate-bounce {
  animation: trophyBounce 1s infinite alternate ease-in-out;
}

@keyframes trophyBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

.winner-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 950;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.winner-team-announcement {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
}

.winner-glow {
  color: var(--gold);
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
  font-size: 1.15em;
}

.winner-quote {
  font-size: 1.35rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* Podium Section */
.podium-section {
  width: 100%;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.podium-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.podium-card.rank-1 {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.15), var(--bg-surface));
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--gold-glow);
}

.podium-medal {
  font-size: 2.5rem;
}

.podium-team-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.podium-score {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
}

/* Player Awards */
.awards-grid {
  width: 100%;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.award-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.award-top-speaker {
  border-left: 5px solid #ff4b2b;
}

.award-team-player {
  border-left: 5px solid var(--gold);
}

.award-icon {
  font-size: 2.2rem;
}

.award-badge-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.award-player-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
}

.award-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* Stats Table */
.stats-table-wrapper {
  width: 100%;
  max-width: 780px;
  margin-top: 10px;
}

.stats-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 12px;
  text-align: left;
}

.stats-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.stats-table th {
  background: #0f121e;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
}

.stats-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-surface);
  color: #f1f5f9;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.winner-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

/* ==========================================================================
   MODALS (PAUSE & RULES)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(10px);
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-icon {
  font-size: 3rem;
}

.rules-modal-card {
  max-width: 680px;
  text-align: left;
  align-items: stretch;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close:hover {
  color: #ffffff;
}

.rules-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.rule-box h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px;
}

.rule-box ul {
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

kbd {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  background: #0f121e;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--gold);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Projector, Tablet, Desktop)
   ========================================================================== */
@media (max-width: 900px) {
  .controls-buttons-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .game-arena {
    padding: 20px 16px;
  }

  .question-card {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .controls-buttons-row {
    grid-template-columns: 1fr;
  }

  .setup-card {
    padding: 20px 16px;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
