:root {
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.4);
  --primary-dark: #0369a1;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);
  --bg-gradient: radial-gradient(ellipse at top, #0f172a 0%, #030712 100%);
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Background effects */
.background-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
}

.circle-1 {
  width: 450px;
  height: 450px;
  background: #0284c7;
  top: -100px;
  left: -100px;
}

.circle-2 {
  width: 500px;
  height: 500px;
  background: #f59e0b;
  bottom: -150px;
  right: -100px;
}

.container {
  width: 100%;
  max-width: 780px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 12px;
}

.title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Score Board */
.score-board {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.score-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--card-border);
  padding: 10px 18px;
  border-radius: 12px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.highlight-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.score-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.highlight-card .score-value {
  color: #fbbf24;
}

/* Main Quiz Card */
.quiz-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 40px rgba(2, 132, 199, 0.06);
}

/* Randomizer Section */
.randomizer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 8px 20px -4px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px -4px var(--primary-glow);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

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

.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
  }
  50% {
    box-shadow: 0 0 28px rgba(2, 132, 199, 0.85);
  }
}

.remaining-badge {
  font-size: 0.85rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Visualizer Container */
.player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.visualizer-wrapper {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 140px;
  background: rgba(3, 7, 18, 0.7);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

#visualizer {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.45);
  font-size: 0.9rem;
  color: #64748b;
  pointer-events: none;
  transition: opacity 0.3s;
}

.visualizer-status.hidden {
  opacity: 0;
}

.audio-controls {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Statement Container */
.statement-container {
  margin-bottom: 24px;
}

.statement-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.statement-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #38bdf8;
  margin-bottom: 8px;
  font-weight: 700;
}

.statement-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: #f1f5f9;
}

/* Choice Buttons */
.choices-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 16px;
}

.choice-btn {
  font-family: inherit;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 22px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.choice-icon {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.choice-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.choice-sub {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 600;
}

.choice-true {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.choice-true:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: #10b981;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px var(--success-glow);
}

.choice-false {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.choice-false:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.2) 100%);
  border-color: #ef4444;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px var(--danger-glow);
}

.choice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Feedback & Explanation */
.feedback-panel {
  margin-top: 20px;
  border-radius: 18px;
  padding: 22px;
  animation: slideIn 0.35s ease;
  border: 1px solid transparent;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-panel.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.feedback-panel.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.feedback-panel.correct .feedback-icon {
  background: #10b981;
  color: white;
}

.feedback-panel.incorrect .feedback-icon {
  background: #ef4444;
  color: white;
}

.feedback-panel.correct #feedback-title {
  color: #34d399;
  font-size: 1.3rem;
}

.feedback-panel.incorrect #feedback-title {
  color: #f87171;
  font-size: 1.3rem;
}

.explanation-content h4 {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.explanation-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 18px;
}

.btn-action {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  width: 100%;
  box-shadow: 0 6px 20px -4px var(--gold-glow);
}

.btn-action:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-2px);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 100;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 36px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: #fff;
}

.final-score-text {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.final-score-text strong {
  color: #38bdf8;
  font-size: 1.8rem;
}

#final-verdict {
  color: #94a3b8;
  margin-bottom: 24px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .title {
    font-size: 1.45rem;
  }
  
  .score-board {
    gap: 8px;
  }
  
  .score-card {
    min-width: 90px;
    padding: 8px 12px;
  }
  
  .quiz-card {
    padding: 20px 16px;
  }
  
  .choices-container {
    gap: 10px;
  }
  
  .choice-btn {
    padding: 16px 12px;
  }
  
  .choice-icon {
    font-size: 1.8rem;
  }
  
  .choice-title {
    font-size: 1.05rem;
  }
}
