/* ═══════════════════════════════════════════════
   TERRASPHERE — Geography Trivia
   ═══════════════════════════════════════════════ */

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

:root {
  --bg-primary: #070720;
  --bg-secondary: #0e0e30;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent-purple: #6c63ff;
  --accent-teal: #00e0c7;
  --accent-gold: #ffd166;
  --success: #06d6a0;
  --error: #ef476f;
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Animated Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 224, 199, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(239, 71, 111, 0.05) 0%, transparent 50%);
  animation: bgPulse 12s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes bgPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ── Vignette ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 5;
  pointer-events: none;
}

/* ── Background World Map ── */
#bg-map {
  position: fixed;
  inset: -10%;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: bgMapDrift 60s ease-in-out infinite alternate;
}

#bg-map svg {
  width: 120%;
  height: auto;
}

#bg-map svg path {
  fill: rgba(140, 160, 255, 0.02) !important;
  stroke: rgba(140, 160, 255, 0.07) !important;
  stroke-width: 0.5 !important;
}

@keyframes bgMapDrift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-1%, 0.5%) scale(1.02); }
  100% { transform: translate(0.5%, -0.5%) scale(1); }
}

/* ── Stars ── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite alternate;
  opacity: 0;
}

@keyframes twinkle {
  0% { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: var(--max-opacity); transform: scale(1.2); }
}

/* ── Screens ── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 20px;
  overflow-y: auto;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

.screen-inner {
  width: 100%;
  max-width: 800px;
  padding: 20px 0;
}

.back-btn {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.back-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.screen-title {
  font-size: 2rem;
  font-weight: 900;
  margin: 20px 0 4px;
}

.screen-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* ══════════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════════ */

.home-content {
  text-align: center;
  max-width: 480px;
  animation: fadeInUp 0.8s ease;
}

.globe-wrapper {
  margin-bottom: 16px;
}

.globe {
  font-size: 80px;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(108, 99, 255, 0.3));
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

.title {
  font-size: 3.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-teal) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 32px;
}

.home-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.home-stat {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  backdrop-filter: blur(10px);
}

.home-stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-teal);
}

.home-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(108, 99, 255, 0.5);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 12px 24px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-icon {
  font-size: 1.1rem;
}

/* ══════════════════════════════════════
   CONTINENT SELECT
   ══════════════════════════════════════ */

.continent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.continent-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.continent-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: var(--radius);
}

.continent-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.continent-card:hover::before {
  opacity: 0.08;
}

.continent-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
}

.continent-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.continent-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.continent-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.continent-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.continent-progress {
  width: 48px;
  height: 48px;
  position: relative;
}

.continent-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.continent-progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 3;
}

.continent-progress-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.continent-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

/* ══════════════════════════════════════
   QUIZ SCREEN
   ══════════════════════════════════════ */

.quiz-container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 0.5s ease;
}

/* Quiz Header */
.quiz-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.quiz-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-teal));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.quiz-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-gold);
  transition: transform 0.2s;
}

.score-value.bump {
  animation: scoreBump 0.3s ease;
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

/* Streak Banner */
.streak-banner {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.15), rgba(255, 69, 0, 0.1));
  border: 1px solid rgba(255, 165, 0, 0.25);
  border-radius: var(--radius-xs);
  padding: 8px 20px;
  font-weight: 800;
  font-size: 0.95rem;
  animation: streakPulse 0.5s ease;
  backdrop-filter: blur(8px);
}

@keyframes streakPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* Timer */
.timer-container {
  position: relative;
  width: 72px;
  height: 72px;
}

.timer-ring {
  width: 100%;
  height: 100%;
}

#timer-circle {
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
}

.timer-warning {
  color: var(--error) !important;
}

.timer-warning #timer-circle,
.timer-container.timer-warning #timer-circle {
  stroke: var(--error) !important;
}

/* Question Card */
.question-card {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.question-card.correct-flash {
  animation: correctFlash 0.5s ease;
}

.question-card.wrong-flash {
  animation: wrongFlash 0.5s ease;
}

@keyframes correctFlash {
  0%, 100% { border-color: var(--glass-border); }
  50% { border-color: var(--success); box-shadow: 0 0 30px rgba(6, 214, 160, 0.2); }
}

@keyframes wrongFlash {
  0%, 100% { border-color: var(--glass-border); }
  50% { border-color: var(--error); box-shadow: 0 0 30px rgba(239, 71, 111, 0.2); }
}

.question-type-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-teal);
  background: rgba(0, 224, 199, 0.1);
  padding: 4px 14px;
  border-radius: 20px;
}

.question-flag {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.question-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.fun-fact {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
  padding: 8px 16px;
  background: rgba(255, 209, 102, 0.08);
  border-radius: var(--radius-xs);
  line-height: 1.4;
  width: 100%;
}

/* Answers Grid */
.answers-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-btn {
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.answer-btn:hover:not(.disabled) {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

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

.answer-btn.correct {
  background: rgba(6, 214, 160, 0.15);
  border-color: var(--success);
  color: var(--success);
  animation: popIn 0.3s ease;
}

.answer-btn.wrong {
  background: rgba(239, 71, 111, 0.12);
  border-color: var(--error);
  color: var(--error);
  animation: shake 0.4s ease;
}

.answer-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.answer-btn.reveal {
  border-color: var(--success);
  color: var(--success);
  opacity: 1 !important;
  background: rgba(6, 214, 160, 0.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes popIn {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════
   RESULTS SCREEN
   ══════════════════════════════════════ */

.results-container {
  width: 100%;
  max-width: 560px;
  text-align: center;
  animation: fadeInUp 0.6s ease;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px 0;
}

.results-container::-webkit-scrollbar {
  width: 4px;
}
.results-container::-webkit-scrollbar-track {
  background: transparent;
}
.results-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.results-header {
  margin-bottom: 28px;
}

.results-title {
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.results-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px 8px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: statFadeIn 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes statFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-teal);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

/* Results Review */
.results-review {
  margin-bottom: 28px;
  text-align: left;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid transparent;
}

.review-item.review-correct {
  border-color: rgba(6, 214, 160, 0.15);
}

.review-item.review-wrong {
  border-color: rgba(239, 71, 111, 0.15);
}

.review-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.review-question {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.review-answer {
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.review-answer.review-answer-correct {
  color: var(--success);
}

.review-answer.review-answer-wrong {
  color: var(--error);
}

.results-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Confetti ── */
#confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confettiFall var(--fall-duration) linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% { opacity: 1; }
  100% {
    transform: translateY(105vh) rotate(var(--rotation)) scale(0.5);
    opacity: 0;
  }
}

/* ══════════════════════════════════════
   UTILITIES & ANIMATIONS
   ══════════════════════════════════════ */

.hidden {
  display: none !important;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.question-enter {
  animation: questionEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes questionEnter {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.answer-enter {
  animation: answerEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes answerEnter {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════════════════════════════════
   WORLD MAP SCREEN
   ══════════════════════════════════════ */

.map-screen-inner {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  padding: 16px 0;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.map-stats {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.map-stats strong {
  color: var(--accent-teal);
  font-weight: 800;
  font-size: 1.1rem;
}

.map-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#world-map-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#world-map-wrapper svg {
  display: block;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#world-map-wrapper path {
  fill: rgba(255, 255, 255, 0.035);
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.4;
  transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
  cursor: pointer;
}

#world-map-wrapper path:hover {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.25);
}

#world-map-wrapper path.mastered {
  stroke-width: 0.6;
}

#world-map-wrapper path.mastered:hover {
  filter: brightness(1.3);
}

.map-tooltip {
  position: absolute;
  background: rgba(10, 10, 40, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(12px);
  min-width: 160px;
  transition: opacity 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.map-tooltip-name {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.map-tooltip-capital {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.map-tooltip-status {
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 700;
}

.map-tooltip-status.mastered { color: var(--success); }
.map-tooltip-status.unmastered { color: var(--text-muted); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   PAUSE OVERLAY
   ══════════════════════════════════════ */

.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 32, 0.85);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.2s ease;
}

.pause-overlay.hidden {
  display: none !important;
}

.pause-modal {
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.pause-modal h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.pause-info {
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 1.05rem;
}

.pause-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.pause-btn {
  font-size: 0.85rem !important;
  padding: 8px 16px !important;
  line-height: 1;
  letter-spacing: 0.3px;
}

.quiz-paused .question-card,
.quiz-paused .answers-grid,
.quiz-paused .timer-container,
.quiz-paused .streak-banner {
  filter: blur(20px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.25s ease;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .title {
    font-size: 2.4rem;
  }

  .globe {
    font-size: 60px;
  }

  .btn {
    width: 100%;
    max-width: 320px;
  }

  .continent-grid {
    grid-template-columns: 1fr;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .results-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .question-text {
    font-size: 1.15rem;
  }

  .quiz-container {
    gap: 12px;
  }

  .question-card {
    padding: 20px 16px;
    min-height: 120px;
  }

  .screen-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 380px) {
  .title {
    font-size: 2rem;
  }

  .home-stats {
    flex-direction: column;
    align-items: center;
  }

  .results-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 1.2rem;
  }
}
