/* Math Quest: Bright & Clean Academic Theme */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Noto+Sans+KR:wght@300;400;500;600;700;900&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-indigo: #4f46e5;
  --accent-sky: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle, bright, cheerful ambient glows */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -120px;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.math-font {
  font-family: 'Fira Code', monospace;
}

/* Crisp Clean Glass Cards */
.glass-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

.glass-panel-elevated {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Stage Navigation Buttons */
.stage-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.stage-btn:hover {
  transform: translateX(3px);
  border-color: #6366f1;
  background: #f5f3ff;
}
.stage-btn.active {
  border-color: #4f46e5;
  background: linear-gradient(90deg, #eef2ff 0%, #ffffff 100%);
  box-shadow: inset 4px 0 0 #4f46e5, 0 2px 4px rgba(79, 70, 229, 0.1);
}
.stage-btn.completed .stage-check {
  color: #059669;
}

/* Option Buttons */
.option-btn {
  transition: all 0.2s ease;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1e293b;
}
.option-btn:hover:not(:disabled) {
  background: #f5f3ff;
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}
.option-btn.selected-correct {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #065f46 !important;
  box-shadow: 0 0 15px rgba(5, 150, 105, 0.25);
}
.option-btn.selected-wrong {
  background: #fff1f2 !important;
  border-color: #e11d48 !important;
  color: #9f1239 !important;
  box-shadow: 0 0 15px rgba(225, 29, 72, 0.25);
}

/* Pulse animation for combo */
@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px #d97706); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 8px #f59e0b); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px #d97706); }
}
.combo-active {
  animation: pulse-glow 1.2s infinite;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Modal animations */
.modal-overlay {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal-box {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.hidden .modal-box {
  transform: scale(0.95) translateY(10px);
}
