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

:root {
  --bg-dark: #020208;
  --bg-navy: #05071a;
  --gold: #FFD700;
  --gold-dark: #9A7B1C;
  --gold-light: #FFF4B8;
  --gold-grad: linear-gradient(135deg, #FFE875 0%, #D4AF37 50%, #9A7B1C 100%);
  --blue-brand: #0d153d;
  --blue-grad: linear-gradient(135deg, #090e2b 0%, #040614 100%);
  --blue-glow: rgba(0, 191, 255, 0.15);
  --correct: #00e676;
  --correct-grad: linear-gradient(135deg, #00ff87 0%, #60efff 100%);
  --wrong: #ff1744;
  --wrong-grad: linear-gradient(135deg, #ff007f 0%, #7f00ff 100%);
  --buzzed: #ff9100;
  --buzzed-grad: linear-gradient(135deg, #ff9100 0%, #ff3d00 100%);
  --text-white: #ffffff;
  --text-gold: #FFD700;
  --text-gray: #8f9bb3;
  --glass: rgba(10, 14, 45, 0.4);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-gold: rgba(255, 215, 0, 0.15);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  /* Cyberpunk mesh grid + deep space gradient */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px),
    radial-gradient(circle at 50% 30%, #0d123a 0%, #020208 85%);
  background-size: 40px 40px, 40px 40px, auto;
}

/* Background Particle Overlay */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Cinematic Titles */
.display-title {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.25));
  text-align: center;
  margin-bottom: 5px;
}

.display-subtitle {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--text-gray);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 30px;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 191, 255, 0.03), transparent 60%);
  pointer-events: none;
}

.glass-panel:hover {
  border-color: var(--glass-border-gold);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(255, 215, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  transition: all 0.3s ease;
}

/* Scoreboard Broadcast Styling (F1 inspired) */
.scoreboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.scoreboard-row {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.04) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.scoreboard-row.active-team {
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.05);
}

.scoreboard-cell {
  padding: 16px 24px;
  font-size: 1.25rem;
  font-weight: 700;
  vertical-align: middle;
  text-transform: uppercase;
}

.scoreboard-cell.rank {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  width: 70px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.scoreboard-cell.score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: #fff;
  text-align: right;
  letter-spacing: 1px;
}

/* 3D Tactile Buzzer Button (KBC Stage console look) */
.buzzer-container {
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.buzzer-btn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 12px solid #1a1e36;
  background: radial-gradient(circle at 35% 35%, #ff4b1f 0%, #ff1f1f 45%, #9b0000 85%, #630000 100%);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(255, 31, 31, 0.2),
    inset 0 10px 15px rgba(255, 255, 255, 0.25),
    inset 0 -10px 15px rgba(0, 0, 0, 0.5);
  color: white;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  user-select: none;
  outline: none;
}

.buzzer-btn::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 215, 0, 0.2);
  pointer-events: none;
}

.buzzer-btn:active:not(:disabled) {
  transform: translateY(4px) scale(0.96);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 31, 31, 0.1),
    inset 0 5px 8px rgba(0, 0, 0, 0.6),
    inset 0 -5px 8px rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 35% 35%, #e61b1b 0%, #b30000 50%, #4a0000 100%);
}

.buzzer-btn:disabled {
  background: radial-gradient(circle at 35% 35%, #2a2e45 0%, #151824 70%, #0a0c12 100%);
  border-color: #0d0f1a;
  color: #3f445a;
  box-shadow: 
    inset 0 5px 10px rgba(0,0,0,0.5),
    inset 0 -5px 10px rgba(255,255,255,0.01);
  cursor: not-allowed;
}

.buzzer-btn.buzzed-state {
  background: radial-gradient(circle at 35% 35%, #00ff87 0%, #00c35c 50%, #005a26 100%);
  border-color: var(--gold);
  color: black;
  box-shadow: 
    0 0 50px rgba(0, 255, 135, 0.6),
    inset 0 10px 15px rgba(255, 255, 255, 0.4);
  animation: gold-pulse 1.2s infinite;
}

/* Premium Buttons */
.btn-primary {
  background: var(--gold-grad);
  border: none;
  color: #03030d;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 10px;
  padding: 14px 32px;
  cursor: pointer;
  box-shadow: 
    0 5px 20px rgba(212, 175, 55, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(212, 175, 55, 0.45),
    0 0 15px rgba(255, 232, 117, 0.2);
  filter: brightness(1.08);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:disabled {
  background: #1b1e2e;
  border: 1px solid rgba(255,255,255,0.02);
  color: #434861;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 10px;
  padding: 12px 24px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.04);
  color: var(--gold);
}

/* KBC Hexagonal Gameboard Framing */
.kbc-question-container {
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.kbc-question-box {
  width: 100%;
  min-height: 120px;
  background: linear-gradient(90deg, rgba(13, 17, 45, 0.95) 0%, rgba(7, 9, 28, 0.98) 50%, rgba(13, 17, 45, 0.95) 100%);
  /* Hexagonal side-cuts */
  clip-path: polygon(4% 0%, 96% 0%, 100% 50%, 96% 100%, 4% 100%, 0% 50%);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 60px;
  text-align: center;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  border: 2.5px solid var(--gold);
  /* Fallback border shadow inside clip-path */
  box-shadow: 
    0 0 35px rgba(255, 215, 0, 0.12),
    inset 0 0 30px rgba(0, 191, 255, 0.15);
  line-height: 1.4;
}

.kbc-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 45px;
  width: 100%;
}

.kbc-option {
  clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
  background: linear-gradient(90deg, rgba(14, 18, 48, 0.8) 0%, rgba(8, 10, 29, 0.9) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 16px 45px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: var(--text-gray);
}

.kbc-option:hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
  border-color: var(--gold);
  color: white;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.kbc-option-prefix {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin-right: 15px;
  letter-spacing: 1px;
}

.kbc-option.hidden-option {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.kbc-option.selected {
  background: linear-gradient(90deg, rgba(255, 145, 0, 0.2) 0%, rgba(255, 61, 0, 0.3) 100%);
  border-color: var(--buzzed);
  color: white;
  box-shadow: 0 0 25px rgba(255, 145, 0, 0.3);
}

.kbc-option.locked {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 145, 0, 0.25) 100%);
  border-color: var(--gold);
  color: black !important;
  font-weight: 700;
  animation: gold-pulse 0.8s infinite;
}

.kbc-option.locked .kbc-option-prefix {
  color: black;
}

.kbc-option.correct {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.3) 0%, rgba(0, 230, 118, 0.5) 100%) !important;
  border-color: var(--correct) !important;
  color: white !important;
  box-shadow: 0 0 35px rgba(0, 230, 118, 0.5);
  font-weight: 700;
}

.kbc-option.correct .kbc-option-prefix {
  color: white;
}

.kbc-option.wrong {
  background: linear-gradient(90deg, rgba(255, 23, 68, 0.3) 0%, rgba(255, 23, 68, 0.5) 100%) !important;
  border-color: var(--wrong) !important;
  color: white !important;
  box-shadow: 0 0 35px rgba(255, 23, 68, 0.5);
}

.kbc-option.wrong .kbc-option-prefix {
  color: white;
}

/* Animations & Keyframes */
@keyframes gold-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5); }
  70% { box-shadow: 0 0 0 20px rgba(255, 215, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.pulse-gold-fx {
  animation: gold-pulse 1.8s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-fx {
  animation: shake 0.4s ease-in-out;
}

/* Sound/Mute Toggle Indicator icon */
.sound-toggle {
  position: fixed;
  top: 25px;
  right: 25px;
  z-index: 1000;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-gray);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold);
  color: white;
}

/* Screen flash overlay */
.flash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0);
  animation: flash-white 0.4s ease-out forwards;
}

@keyframes flash-white {
  0% { background-color: rgba(255, 255, 255, 0.8); }
  100% { background-color: rgba(255, 255, 255, 0); }
}

/* Dynamic countdown digits overlay */
.countdown-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 10rem;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 35px rgba(255,215,0,0.4));
  z-index: 200;
  animation: pop-count 1s ease-in-out infinite;
  display: none;
}

@keyframes pop-count {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  20% { opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.2);
}
