/* ═══════════════════════════════════════════════════════════
   2026 Plate Spotter: Soccer Road Trip — Styles
   Cartoonish, kid-friendly, skinnable via CSS variables
   ═══════════════════════════════════════════════════════════

   ⚠️  CRITICAL: iPhone SE (375x667) SCROLLING RULES — DO NOT BREAK:
   1. .view MUST have overflow-y: auto (line ~160)
   2. .home-container MUST NOT have height:100% or min-height:100%
   3. #view-home MUST have overflow-y: auto !important
   4. @media (max-height: 750px) MUST set justify-content: flex-start
   ANY change to overflow/height on .view, .screen, .home-container,
   .pick-team-container MUST be tested on iPhone SE viewport.
   ═══════════════════════════════════════════════════════════ */

/* Local fonts — no external CDN requests (COPPA compliant) */
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo2-devanagari.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Quicksand';
  src: url('assets/fonts/quicksand-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

/* ── CSS Variables (overridden by skin at boot) ── */
:root {
  /* Primary palette: dark navy base with green as accent, not background */
  --bg-primary:     #0F1B2D;
  --bg-secondary:   #0A1220;
  --bg-gradient-from: #0F1B2D;
  --bg-gradient-to:   #162540;
  --accent:         #FFD700;
  --accent-light:   #FFF3B0;
  --accent-dark:    #C5A200;
  --text-primary:   #F0F4F8;
  --text-secondary: #8BA4BD;
  --text-dark:      #1A1A1A;
  --card-bg:        #FFFFFF;
  --card-border:    #E8E8E8;
  --success:        #34D399;
  --error:          #FF5252;
  --warning:        #FF9800;
  --nav-bg:         rgba(10, 18, 32, 0.95);
  --collected:      #34D399;
  --uncollected:    #3D4F65;
  --map-stroke:     rgba(255,255,255,0.5);
  --quiz-correct:   #34D399;
  --quiz-wrong:     #FF6B6B;

  /* Surface colors — cards and content areas pop off the dark bg */
  --surface-1:      rgba(255, 255, 255, 0.07);
  --surface-2:      rgba(255, 255, 255, 0.12);
  --surface-3:      rgba(255, 255, 255, 0.18);

  /* ── Fun color palette ── */
  --green:          #34D399;
  --green-soft:     rgba(52, 211, 153, 0.15);
  --blue:           #60A5FA;
  --blue-soft:      rgba(96, 165, 250, 0.15);
  --blue-dark:      #2C5F8A;
  --orange:         #FB923C;
  --orange-soft:    rgba(251, 146, 60, 0.15);
  --coral:          #FF6B6B;
  --coral-soft:     rgba(255, 107, 107, 0.12);
  --purple:         #A78BFA;
  --purple-soft:    rgba(167, 139, 250, 0.15);
  --teal:           #2DD4BF;
  --teal-soft:      rgba(45, 212, 191, 0.15);
  --pink:           #F472B6;
  --pink-soft:      rgba(244, 114, 182, 0.12);
  --sky:            #38BDF8;
  --sky-soft:       rgba(56, 189, 248, 0.12);

  --nav-height: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Quicksand', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}

/* ── App Shell ── */
.app-shell {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--bg-gradient-from), var(--bg-gradient-to));
  position: relative;
  overflow: hidden;
}

/* Subtle soccer ball background pattern */
.app-shell::before {
  content: '⚽';
  position: absolute;
  font-size: 300px;
  opacity: 0.03;
  top: -60px;
  right: -80px;
  z-index: 0;
  pointer-events: none;
  animation: spin-slow 60s linear infinite;
}

.app-shell::after {
  content: '⚽';
  position: absolute;
  font-size: 200px;
  opacity: 0.025;
  bottom: 60px;
  left: -50px;
  z-index: 0;
  pointer-events: none;
  animation: spin-slow 45s linear infinite reverse;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── View System ── */
.screen {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom, 0px));
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.view.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 1;
}

.view.exit-left {
  opacity: 0;
  transform: translateX(-30px);
  pointer-events: none;
}

/* Back navigation — slide in from left */
.view.enter-from-left {
  transform: translateX(-30px);
}

.view.exit-right {
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
}

/* ── Scroll Body ── */
.scroll-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  padding-bottom: calc(16px + var(--safe-bottom));
}

.scroll-body::-webkit-scrollbar { display: none; }

/* ── Bottom Nav Bar ── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  /* Include the safe-area inset in the height so icons stay centered in the
     --nav-height content zone instead of being pushed up above the inset. */
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.1);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  min-width: 56px;
}

.nav-tab .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-tab.active {
  color: var(--accent);
}

.nav-tab[data-view='view-map'].active { color: var(--sky); }
.nav-tab[data-view='view-collection'].active { color: var(--orange); }
.nav-tab[data-view='view-teams'].active { color: var(--green); }
.nav-tab[data-view='view-quiz-hub'].active { color: var(--orange); }
.nav-tab[data-view='view-settings'].active { color: var(--text-secondary); }

.nav-tab:active {
  transform: scale(0.9);
}

/* ── Header Bar ── */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  flex-shrink: 0;
}

.map-team-flag {
  font-size: 22px;
  flex-shrink: 0;
}

.header-title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-score {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,140,66,0.2));
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(255,215,0,0.3);
}

/* ── Home Screen ── */
.home-wagon {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 440px;
  height: auto;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  padding-top: 10vh;
  text-align: center;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  z-index: 1;
  position: relative;
}

/* Force all onboarding views to scroll */
#view-home {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
#view-pick-language,
#view-pick-team {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* On short screens, don't center — let content flow from top so it scrolls */
@media (max-height: 750px) {
  .home-container {
    justify-content: flex-start !important;
    padding-top: 12px;
    gap: 10px;
  }
  .home-mascot { font-size: 40px !important; }
  .home-title { font-size: 20px !important; }
  .home-subtitle { font-size: 12px !important; }
  .home-tagline { font-size: 11px !important; }
  .age-selector { gap: 6px; }
  .age-btn { padding: 10px 6px !important; font-size: 12px !important; min-height: 40px !important; }
  .start-btn { padding: 12px !important; font-size: 14px !important; margin-top: 8px !important; }

  .pick-team-container {
    justify-content: flex-start !important;
    padding-top: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pick-team-icon { font-size: 30px !important; margin-bottom: 2px; }
  .pick-team-title { font-size: 16px !important; }
  .pick-team-subtitle { font-size: 11px !important; }
}

/* iPhone SE and very short screens: guarantee scroll */
@media (max-height: 700px) {
  .view { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  .home-container { justify-content: flex-start !important; min-height: auto !important; padding-top: 12px; }
  .pick-team-container { justify-content: flex-start !important; min-height: auto !important; padding-top: 12px; }
}

.home-mascot {
  font-size: 80px;
  animation: bounce 2s infinite;
}

.home-title {
  font-family: 'Baloo 2', cursive;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.home-subtitle {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: -8px;
}

.home-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 280px;
}

/* Floating soccer balls on home screen */
.soccer-float {
  position: absolute;
  font-size: 24px;
  opacity: 0.15;
  pointer-events: none;
  animation: float-up 8s ease-in-out infinite;
}

.soccer-float:nth-child(1) { left: 8%; top: 15%; animation-delay: 0s; font-size: 20px; }
.soccer-float:nth-child(2) { right: 10%; top: 20%; animation-delay: 2s; font-size: 28px; }
.soccer-float:nth-child(3) { left: 15%; bottom: 25%; animation-delay: 4s; font-size: 18px; }
.soccer-float:nth-child(4) { right: 12%; bottom: 30%; animation-delay: 1s; font-size: 22px; }
.soccer-float:nth-child(5) { left: 50%; top: 8%; animation-delay: 3s; font-size: 16px; }
.soccer-float:nth-child(6) { right: 25%; top: 65%; animation-delay: 5s; font-size: 26px; }

@keyframes float-up {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.12; }
  25% { transform: translateY(-15px) rotate(90deg); opacity: 0.18; }
  50% { transform: translateY(-8px) rotate(180deg); opacity: 0.12; }
  75% { transform: translateY(-20px) rotate(270deg); opacity: 0.16; }
}

.age-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  margin-top: 8px;
}

.age-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.age-btn:nth-child(1) { border-color: rgba(96, 165, 250, 0.5); background: var(--blue-soft); }
.age-btn:nth-child(2) { border-color: rgba(251, 146, 60, 0.5); background: var(--orange-soft); }
.age-btn:nth-child(3) { border-color: rgba(167, 139, 250, 0.5); background: var(--purple-soft); }
.age-btn:nth-child(4) { border-color: rgba(244, 114, 182, 0.5); background: var(--pink-soft); }

.age-btn:active {
  transform: scale(0.95);
}

.age-btn.selected {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.15);
}

.age-btn .age-emoji {
  font-size: 32px;
}

.age-btn .age-label {
  font-weight: 700;
  font-size: 15px;
}

.age-btn .age-range {
  font-size: 12px;
  color: var(--text-secondary);
}

.start-btn {
  width: 100%;
  max-width: 340px;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: var(--bg-primary);
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(255, 140, 66, 0.3);
}

.start-btn:active {
  animation: tapBounce 0.3s ease;
}

.start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Map View ── */
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  flex-shrink: 0;
}

.progress-bar-wrap {
  width: 100%;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--orange), var(--coral));
  border-radius: 6px;
  transition: width 0.5s ease;
  position: relative;
}

/* Soccer ball at end of progress bar */
.progress-fill::after {
  content: '⚽';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
  font-weight: 600;
}

/* ── Team Picker (onboarding) ── */
.pick-team-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Onboarding scroll handled above with #view-home */

.pick-team-icon {
  font-size: 50px;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

.pick-team-title {
  font-family: 'Baloo 2', cursive;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.pick-team-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.pick-team-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 400px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.pick-team-grid::-webkit-scrollbar { display: none; }

.pick-flag-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 4px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: var(--surface-1);
  cursor: pointer;
  transition: all 0.2s;
}

.pick-flag-btn:active {
  animation: tapBounce 0.3s ease;
}

.pick-flag-btn .flag-emoji {
  font-size: 32px;
}

.pick-flag-btn .flag-code {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.pick-flag-btn.detected-lang {
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.3);
  position: relative;
}
.pick-flag-btn.detected-lang .flag-code {
  color: var(--accent);
}
.detected-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: var(--bg);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pick-team-skip {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px;
  text-decoration: underline;
  flex-shrink: 0;
  margin-top: 8px;
}

/* ── Country Tabs ── */
.country-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.country-tabs .route-header-link {
  margin-left: auto;
  flex-shrink: 0;
}

.country-tab {
  flex: 1 1 auto;
  padding: 8px 12px;
  min-width: 0;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.country-tab.active {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent);
}

.country-tab[data-country='us'].active {
  border-color: var(--blue);
  background: rgba(74, 144, 217, 0.15);
  color: var(--sky);
}

.country-tab[data-country='ca'].active {
  border-color: var(--coral);
  background: rgba(255, 107, 107, 0.12);
  color: var(--coral);
}

.country-tab[data-country='mx'].active {
  border-color: var(--teal);
  background: rgba(45, 212, 191, 0.12);
  color: var(--teal);
}

.country-tab:active {
  transform: scale(0.95);
}

/* ── Search Bar ── */
.search-bar-wrap {
  padding: 0 16px 8px;
  flex-shrink: 0;
  position: relative;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 8px 14px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--accent);
}

.search-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.search-clear {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 16px;
  right: 16px;
  background: #1A2840;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.search-results.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:active {
  background: rgba(255,255,255,0.1);
}

.search-result-abbr {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  min-width: 30px;
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.search-result-status {
  font-size: 12px;
}

/* Highlighted state on map */
.map-container svg path.highlighted {
  fill: var(--accent) !important;
  stroke: var(--accent-dark) !important;
  stroke-width: 3 !important;
  animation: pulse-highlight 1s ease-in-out 3;
}

.map-container svg circle.highlighted {
  fill: var(--accent) !important;
  stroke: var(--accent-dark) !important;
  stroke-width: 2 !important;
  animation: pulse-highlight 1s ease-in-out 3;
}

@keyframes pulse-highlight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#view-map {
  overflow: visible !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.map-container {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  touch-action: manipulation;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.map-container svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}

.map-container svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}

/* State paths (have IDs like CA, TX) */
.map-container svg path[id] {
  fill: var(--uncollected);
  stroke: var(--map-stroke);
  cursor: pointer;
  transition: fill 0.3s ease;
}

.map-container svg path[id].collected,
.map-container svg g.collected > path {
  /* fill set dynamically via JS flag-color gradient */
  stroke: var(--accent) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.4));
}

.map-container svg path[id]:active {
  opacity: 0.7;
  filter: brightness(1.3);
}

/* Border paths between US states (classes like al-fl) — make invisible */
.map-container svg > g.state > path:not([id]) {
  fill: none !important;
  stroke: none !important;
  pointer-events: none;
}

/* All SVG paths inside the map get default uncollected fill */
.map-container svg path {
  fill: var(--uncollected);
  stroke: var(--map-stroke);
  transition: fill 0.3s ease;
}

/* Stadium map markers */
.stadium-marker {
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.stadium-marker circle {
  animation: stadiumPulse 3s ease-in-out infinite;
}

@keyframes stadiumPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Separator lines (AK/HI inset boxes) — hide */
.map-container svg .separator1,
.map-container svg .separator2 {
  stroke: none !important;
  fill: none !important;
  display: none;
}

/* DC circle */
.map-container svg circle[id] {
  fill: var(--uncollected);
  stroke: var(--map-stroke) !important;
  cursor: pointer;
  transition: fill 0.3s ease;
}

.map-container svg circle[id].collected {
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
}

.map-hint {
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── State Card View ── */
.state-card-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  gap: 12px;
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn:active { transform: scale(0.9); }

.state-name {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 700;
  flex: 1;
}

.state-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Baloo 2', cursive;
}

.state-badge.spotted {
  background: var(--success);
  color: white;
}

.state-badge.not-spotted {
  background: rgba(255,255,255,0.15);
  color: var(--text-secondary);
}

/* State hero: flag + plate side by side */
.state-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 16px 8px;
  padding: 20px 16px;
  background: var(--surface-2);
  border-radius: 20px;
  flex-shrink: 0;
}

.state-flag-wrap {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-flag-img {
  width: 110px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}

.plate-visual-compact {
  flex-shrink: 0;
}

.plate-frame-v2 {
  padding: 10px 20px;
  border: 3px solid #555;
  border-radius: 8px;
  text-align: center;
  min-width: 130px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
  position: relative;
}

.plate-frame-v2::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  pointer-events: none;
}

.plate-top-text {
  font-family: 'Baloo 2', cursive;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
}

.plate-main-text {
  font-family: 'Baloo 2', cursive;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin: 2px 0;
}

.plate-slogan {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.plate-desc-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 16px 12px;
  font-style: italic;
}

/* Info cards */
.info-card {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
}

.info-card:nth-child(odd) {
  border-left-color: var(--blue);
}

.info-card:nth-child(3n) {
  border-left-color: var(--orange);
}

.info-card-title {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.info-card:nth-child(odd) .info-card-title {
  color: var(--blue);
}

.info-card:nth-child(3n) .info-card-title {
  color: var(--orange);
}

.fact-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

.fact-bullet {
  flex-shrink: 0;
  font-size: 18px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.info-value {
  color: var(--text-primary);
  font-weight: 700;
}

/* Action buttons */
.action-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
  margin-bottom: 10px;
}

.action-btn:active { animation: tapBounce 0.3s ease; }

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.25);
}

.action-btn.secondary {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.action-btn.spotted {
  background: linear-gradient(135deg, var(--success), var(--teal));
  color: white;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.25);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Quiz View ── */
.quiz-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  gap: 12px;
  flex-shrink: 0;
}

.quiz-progress {
  flex: 1;
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text-secondary);
}

.quiz-question-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 24px;
  position: relative;
}

/* Decorative soccer balls in quiz background */
.quiz-question-container::before {
  content: '⚽';
  position: absolute;
  top: 10%;
  right: 8%;
  font-size: 40px;
  opacity: 0.06;
  animation: bounce 3s ease-in-out infinite;
  pointer-events: none;
}

.quiz-question-container::after {
  content: '⚽';
  position: absolute;
  bottom: 15%;
  left: 6%;
  font-size: 30px;
  opacity: 0.05;
  animation: bounce 4s ease-in-out infinite 1s;
  pointer-events: none;
}

.quiz-question {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.3;
  max-width: 360px;
}

.quiz-translation-note {
  background: rgba(245, 166, 35, 0.15);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  animation: fadeIn 0.5s ease;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.quiz-option {
  padding: 16px 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quiz-option:nth-child(1) { border-left: 4px solid var(--blue); }
.quiz-option:nth-child(2) { border-left: 4px solid var(--orange); }
.quiz-option:nth-child(3) { border-left: 4px solid var(--purple); }
.quiz-option:nth-child(4) { border-left: 4px solid var(--pink); }

.quiz-option:active { transform: scale(0.97); }

.quiz-option.correct {
  border-color: var(--quiz-correct);
  background: rgba(52, 211, 153, 0.25);
  color: var(--quiz-correct);
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-option.wrong {
  border-color: var(--quiz-wrong);
  background: rgba(255, 107, 107, 0.25);
  color: var(--quiz-wrong);
  animation: shake 0.5s ease;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-option.show-correct {
  border-color: var(--quiz-correct);
  background: rgba(102, 187, 106, 0.15);
}

.quiz-feedback {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  min-height: 28px;
}

.did-you-know {
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  padding: 8px 14px;
  margin-top: 8px;
  text-align: left;
  line-height: 1.4;
  animation: fadeInUp 0.4s ease;
}

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

/* ── Quiz Results ── */
.results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  gap: 16px;
}

.results-emoji {
  font-size: 72px;
  animation: bounce 1s ease;
}

.results-title {
  font-family: 'Baloo 2', cursive;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.results-score {
  font-size: 18px;
  color: var(--text-primary);
}

.results-message {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 280px;
}

.results-points {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
}

.results-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-top: 12px;
}

/* ── Collection View ── */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.collection-section-header {
  grid-column: 1 / -1;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 8px 8px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  margin-bottom: 4px;
  border-radius: 8px 8px 0 0;
}

.collection-section-header:nth-of-type(1) { color: var(--sky); border-bottom-color: rgba(74, 144, 217, 0.3); }
.collection-section-header:nth-of-type(2) { color: var(--coral); border-bottom-color: rgba(255, 107, 107, 0.3); }
.collection-section-header:nth-of-type(3) { color: var(--teal); border-bottom-color: rgba(45, 212, 191, 0.3); }

.collection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 90px;
}

.collection-card {
  animation: slideInUp 0.4s ease backwards;
}

.collection-card:nth-child(2) { animation-delay: 0.02s; }
.collection-card:nth-child(3) { animation-delay: 0.04s; }
.collection-card:nth-child(4) { animation-delay: 0.06s; }
.collection-card:nth-child(5) { animation-delay: 0.08s; }
.collection-card:nth-child(6) { animation-delay: 0.10s; }
.collection-card:nth-child(7) { animation-delay: 0.12s; }
.collection-card:nth-child(8) { animation-delay: 0.14s; }
.collection-card:nth-child(9) { animation-delay: 0.16s; }
.collection-card:nth-child(10) { animation-delay: 0.18s; }

.collection-card:active { animation: tapBounce 0.3s ease; }

.collection-card.collected {
  border-color: var(--collected);
  background: var(--green-soft);
}

.collection-card.not-collected {
  opacity: 0.5;
}

.collection-flag {
  width: 40px;
  height: auto;
  border-radius: 3px;
  margin-bottom: 4px;
  border: 1px solid rgba(255,255,255,0.15);
}

.collection-card.not-collected .collection-flag {
  filter: grayscale(1) opacity(0.5);
}

.collection-abbr {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 700;
}

.collection-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
}

.collection-check {
  font-size: 14px;
  margin-top: 2px;
}

/* ── Settings View ── */
.settings-section {
  margin-bottom: 24px;
}

.settings-label {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-1);
  border-radius: 12px;
  margin-bottom: 8px;
}

.settings-row-label {
  font-size: 15px;
  font-weight: 600;
}

.toggle-btn {
  width: 52px;
  height: 30px;
  border: none;
  border-radius: 15px;
  background: rgba(255,255,255,0.2);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-btn.on {
  background: var(--success);
}

.toggle-btn::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}

.toggle-btn.on::after {
  transform: translateX(22px);
}

.reset-btn {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--error);
  border-radius: 12px;
  background: rgba(255, 82, 82, 0.1);
  color: var(--error);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.reset-btn:active { transform: scale(0.96); }

/* ── Team Cards ── */
.my-team-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, var(--green-soft), var(--teal-soft));
  border: 2px solid var(--green);
  border-radius: 16px;
  margin-bottom: 16px;
  cursor: pointer;
}

.my-team-flag { font-size: 40px; }
.my-team-info { flex: 1; }
.my-team-label { font-size: 11px; color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.my-team-name { font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 700; }
.my-team-nickname { font-size: 13px; color: var(--text-secondary); }
.my-team-change {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.team-section-header {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 0 6px;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-1);
  border-radius: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.team-card:active { transform: scale(0.98); }
.team-card.my-team { border: 2px solid var(--green); background: var(--green-soft); }

.team-card-flag { font-size: 28px; flex-shrink: 0; }
.team-card-info { flex: 1; min-width: 0; }
.team-card-name { font-family: 'Baloo 2', cursive; font-size: 15px; font-weight: 700; }
.team-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.team-card-arrow { font-size: 20px; color: var(--text-secondary); flex-shrink: 0; }

.team-pick-btn {
  padding: 6px 14px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: rgba(255, 215, 0, 0.1);
  color: var(--accent);
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.team-pick-btn:active { transform: scale(0.9); }

/* Team Detail */
.team-hero {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface-2);
  border-radius: 20px;
  margin-bottom: 16px;
}

.team-hero-flag { font-size: 64px; margin-bottom: 8px; }
.team-hero-nickname { font-family: 'Baloo 2', cursive; font-size: 22px; font-weight: 700; color: var(--accent); }
.team-hero-ranking { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.team-hero-colors { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }

.kit-color-chip {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-primary);
}

.player-card {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.player-card:last-child { border-bottom: none; }
.player-name { font-family: 'Baloo 2', cursive; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.player-pos { font-size: 12px; color: var(--blue); font-weight: 700; margin-top: 2px; }
.player-fact { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

/* ── Stadium Cards ── */
.stadium-section-header {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 0 6px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  margin-bottom: 6px;
}

.stadium-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid var(--purple);
}

.stadium-card:nth-child(3n) { border-left-color: var(--blue); }
.stadium-card:nth-child(3n+1) { border-left-color: var(--orange); }

.stadium-card:active { transform: scale(0.98); }

.stadium-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.stadium-card-info {
  flex: 1;
  min-width: 0;
}

.stadium-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.stadium-card-city {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stadium-card-capacity {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}

.stadium-card-arrow {
  font-size: 22px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stadium-hero {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface-2);
  border-radius: 20px;
  margin-bottom: 16px;
}

.stadium-hero-icon {
  font-size: 64px;
  margin-bottom: 8px;
}

.stadium-hero-capacity {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Daily Challenge ── */
.daily-challenge-card {
  background: linear-gradient(135deg, var(--orange-soft), var(--purple-soft));
  border: 2px solid var(--orange);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}

.daily-challenge-card.completed {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green-soft), var(--teal-soft));
}

.daily-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-icon { font-size: 32px; flex-shrink: 0; }

.daily-info { flex: 1; }

.daily-title {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.daily-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.daily-play-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), var(--accent));
  color: var(--bg-primary);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

.daily-play-btn:active { transform: scale(0.95); }

.daily-stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.daily-stat { display: flex; flex-direction: column; gap: 2px; }

.daily-stat-val {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.daily-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Quiz Hub ── */
.hub-section-title {
  font-family: 'Baloo 2', cursive;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 10px;
}

.hub-section-title:first-child { margin-top: 0; }

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 2px solid rgba(255,255,255,0.06);
  text-align: center;
}

.achievement-card.earned {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.08);
  animation: glowPulse 2s ease-in-out 1;
}

.achievement-card.earned .achievement-emoji {
  animation: pop 0.5s ease 0.3s;
}

.achievement-card.locked {
  opacity: 0.5;
}

.achievement-emoji { font-size: 26px; }

.achievement-name {
  font-family: 'Baloo 2', cursive;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.achievement-req {
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.hub-packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.hub-pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  background: var(--surface-1);
  cursor: pointer;
  transition: all 0.2s;
}

.hub-pack-card:active { transform: scale(0.95); }

.hub-pack-card.perfect {
  background: var(--green-soft);
  border-color: var(--green) !important;
}

.hub-pack-emoji { font-size: 30px; }

.hub-pack-name {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.hub-pack-score {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.hub-stadiums-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--blue);
  border-radius: 14px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}

.hub-stadiums-btn:active { transform: scale(0.97); }
.hub-stadiums-btn span:last-child { margin-left: auto; color: var(--text-secondary); }

/* ── Flag Challenge Game ── */
.flag-challenge-btn {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--purple);
  border-radius: 16px;
  background: var(--purple-soft);
  color: var(--purple);
  font-family: 'Baloo 2', cursive;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.flag-challenge-btn:active { transform: scale(0.96); }

.quiz-packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.quiz-pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  background: var(--surface-1);
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-pack-card:active { transform: scale(0.95); }

.quiz-pack-emoji { font-size: 28px; }

.quiz-pack-name {
  font-family: 'Baloo 2', cursive;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.flag-game-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  gap: 12px;
  flex-shrink: 0;
}

.flag-game-score-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  background: var(--purple-soft);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

#fg-streak-label {
  font-size: 11px;
  color: var(--purple);
  font-weight: 700;
  text-transform: uppercase;
}

.flag-game-streak {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
}

.flag-game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 16px;
}

.flag-game-prompt {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.flag-game-display {
  font-size: 100px;
  line-height: 1;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.flag-game-timer {
  width: 100%;
  max-width: 360px;
  height: 6px;
  background: var(--surface-1);
  border-radius: 3px;
  overflow: hidden;
}

.flag-game-timer-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.flag-game-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.fg-option {
  padding: 14px 12px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.fg-option:active { transform: scale(0.95); }

.fg-option.correct {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.fg-option.wrong {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: var(--coral);
}

.fg-option.show-correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.fg-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.flag-game-feedback {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  min-height: 28px;
}

.flag-game-stats {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.fg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fg-stat-val {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.fg-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Stub / Coming Soon ── */
.stub-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 16px;
  padding: 24px;
}

.stub-emoji {
  font-size: 64px;
}

.stub-title {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.stub-message {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 280px;
}

/* ── Player Profiles ── */
.players-header {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.player-row.active {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.08);
}

.player-row:active { transform: scale(0.98); }

.player-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.player-row-info { flex: 1; }

.player-row-name {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
}

.player-row-active {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.player-edit-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
}

.add-player-btn {
  width: 100%;
  padding: 14px;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 14px;
  background: none;
  color: var(--text-secondary);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}

.add-player-btn:active { transform: scale(0.97); }

.players-hint {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
}

/* ── Share Card ── */
.share-card {
  background: linear-gradient(160deg, #0F1B2D, #1E3A5F);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}

.share-card-header {
  margin-bottom: 16px;
}

.share-card-logo {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.share-card-player {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.share-card-avatar { font-size: 36px; }

.share-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.share-card-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 16px;
}

.share-stat { text-align: center; }

.share-stat-val {
  font-family: 'Baloo 2', cursive;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.share-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.share-card-flags {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.share-card-team {
  font-size: 15px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}

.share-card-footer {
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
  margin-top: 4px;
}

/* ── Spot Celebration ── */
.celebration-card {
  background: linear-gradient(160deg, #0F1B2D, #1E3A5F);
  border: 2px solid var(--accent);
  border-radius: 24px;
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-emoji {
  font-size: 64px;
  animation: bounce 1s ease infinite;
}

.celebration-title {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin: 12px 0 4px;
}

.celebration-points {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  color: var(--green);
  font-weight: 700;
}

.spot-cel-skip {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  padding: 8px;
  text-decoration: underline;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 24px;
}

.modal-card {
  background: var(--bg-primary);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.modal-title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  margin-bottom: 16px;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.modal-btn.cancel {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.modal-btn.confirm {
  background: var(--accent);
  color: var(--bg-primary);
}

.modal-btn:active { animation: tapBounce 0.3s ease; }

/* ── Confetti ── */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) scale(0.5);
  }
}

.confetti-soccer {
  background: none !important;
  font-size: 20px;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
}

/* ── Bounce Animation ── */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ── Pulse Animation ── */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ── Shake (wrong answer) ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

/* ── Pop (correct answer / achievement unlock) ── */
@keyframes pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  50% { transform: scale(0.95); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ── Slide In from bottom (staggered entrance) ── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scale bounce for buttons ── */
@keyframes tapBounce {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── Glow pulse for achievements ── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
  50% { box-shadow: 0 0 20px 8px rgba(255, 215, 0, 0.3); }
}

/* ── Progress bar bounce at end ── */
@keyframes progressBounce {
  0% { transform: scaleX(1); }
  50% { transform: scaleX(1.02); }
  100% { transform: scaleX(1); }
}

/* ── Quick Mute Button ── */
/* Bottom-left so it never collides with the per-screen top-right header badges
   (score / "Spotted"). Sits in the corner freed by the archived Car Party FAB,
   just above the nav bar. */
.quick-mute-btn {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 18, 32, 0.8);
  backdrop-filter: blur(8px);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
  line-height: 44px;
  text-align: center;
  padding: 0;
}


/* ── Toast / Notification ── */
.toast {
  position: fixed;
  top: calc(20px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-100px) scale(0.8);
  background: linear-gradient(135deg, #1E3A5F, #0F1B2D);
  color: var(--text-primary);
  padding: 14px 28px;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(255, 215, 0, 0.1);
  z-index: 10000;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: none;
  text-align: center;
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

/* ── Responsive ── */
@media (min-width: 768px) {
  .home-title { font-size: 42px; }
  .home-mascot { font-size: 100px; }
  .age-selector { max-width: 420px; }
  .quiz-question { font-size: 26px; }
  .quiz-options { max-width: 460px; }
  .collection-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════
   iPad Split View & Responsive Layout Optimizations
   ═══════════════════════════════════════════════════════════ */

/* ── General: Ensure touch targets meet Apple HIG (44x44px) ── */
@media (pointer: coarse) {
  .back-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .nav-tab {
    min-width: 44px;
    min-height: 44px;
  }
  .country-tab {
    min-height: 44px;
  }
  .search-clear {
    min-width: 44px;
    min-height: 44px;
  }
  .toggle-btn {
    min-width: 52px;
    min-height: 44px;
  }
  .quiz-option {
    min-height: 44px;
  }
  .fg-option {
    min-height: 44px;
  }
  .team-card {
    min-height: 44px;
  }
  .stadium-card {
    min-height: 44px;
  }
  .collection-card {
    min-height: 44px;
  }
  .player-edit-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .modal-btn {
    min-height: 44px;
  }
  .pick-flag-btn {
    min-height: 44px;
  }
  .bonus-claim-btn { min-height: 44px; min-width: 44px; }
  .carparty-player-chip { min-height: 44px; }
  .carparty-end-fab { min-height: 44px; }
  .bonus-item { min-height: 44px; }
  .age-btn { min-height: 44px; min-width: 44px; }
  .start-btn { min-height: 44px; }
  .action-btn { min-height: 44px; }
  .hub-stadiums-btn { min-height: 44px; }
}

/* ── Apple Pencil hover states ── */
@media (hover: hover) and (pointer: fine) {
  .nav-tab:hover {
    color: var(--accent);
    transform: scale(1.05);
  }
  .collection-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
  }
  .team-card:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
  }
  .stadium-card:hover {
    background: var(--surface-3);
    transform: translateY(-1px);
  }
  .quiz-option:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: var(--surface-3);
  }
  .fg-option:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: var(--surface-3);
  }
  .hub-pack-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .quiz-pack-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 140, 66, 0.3);
  }
  .country-tab:hover {
    background: var(--surface-2);
  }
  .hub-stadiums-btn:hover {
    background: var(--surface-2);
  }
  .pick-flag-btn:hover {
    border-color: var(--accent);
    background: var(--surface-2);
  }
  .age-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .player-row:hover {
    background: var(--surface-2);
  }
}

/* ── Prevent horizontal scroll in all split views ── */
@media (max-width: 550px) {
  .app-shell,
  .view,
  .scroll-body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .map-container svg {
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════
   1. iPad Slide Over / Split View Narrow (< 400px wide, > 700px tall)
   Basically phone width but much taller — iPad Slide Over (~320px)
   or 30% side of 70/30 Split View (~310px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 399px) and (min-height: 700px) {
  /* Tighter nav */
  .nav-bar {
    height: 64px;
  }
  .nav-tab {
    padding: 6px 6px;
    font-size: 9px;
    min-width: 44px;
    gap: 1px;
  }
  .nav-tab .nav-icon {
    font-size: 18px;
  }

  /* Smaller headers */
  .header-title {
    font-size: 16px;
  }
  .header-bar {
    padding: 8px 12px;
    padding-top: calc(8px + var(--safe-top));
  }
  .map-header {
    padding: 8px 12px;
    padding-top: calc(8px + var(--safe-top));
  }
  .state-name {
    font-size: 18px;
  }

  /* Reduce map padding to maximize map area */
  .map-container {
    padding: 4px 6px;
  }
  .map-hint {
    font-size: 11px;
    padding: 4px;
  }

  /* Compact progress bar */
  .progress-bar-wrap {
    padding: 0 12px 8px;
  }
  .progress-label {
    font-size: 11px;
  }

  /* Country tabs compact */
  .country-tabs {
    padding: 0 12px 6px;
    gap: 4px;
  }
  .country-tab {
    padding: 6px 8px;
    font-size: 12px;
  }

  /* Search compact */
  .search-bar-wrap {
    padding: 0 12px 6px;
  }

  /* Quiz options stack vertically */
  .quiz-options {
    max-width: 100%;
  }
  .quiz-question {
    font-size: 18px;
    max-width: 100%;
  }
  .quiz-question-container {
    padding: 16px 12px;
    gap: 16px;
  }

  /* Flag game options stack to single column */
  .flag-game-options {
    grid-template-columns: 1fr;
    max-width: 280px;
  }
  .flag-game-display {
    font-size: 72px;
  }
  .flag-game-body {
    padding: 12px;
    gap: 12px;
  }

  /* Collection single column */
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
  }

  /* Compact state card hero */
  .state-hero {
    margin: 0 12px 6px;
    padding: 14px 12px;
    gap: 10px;
    flex-direction: column;
  }
  .state-flag-wrap {
    width: 90px;
  }
  .state-flag-img {
    width: 80px;
  }
  .plate-main-text {
    font-size: 28px;
  }

  /* Compact scroll body */
  .scroll-body {
    padding: 12px;
  }

  /* Achievements grid compact */
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  /* Quiz packs single column on very narrow */
  .quiz-packs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  /* Hub packs single column */
  .hub-packs-grid {
    grid-template-columns: 1fr;
  }

  /* Home screen compact */
  .home-title {
    font-size: 24px;
  }
  .home-subtitle {
    font-size: 15px;
  }
  .home-mascot {
    font-size: 60px;
  }
  .home-container {
    padding: 16px;
    gap: 14px;
  }
  .age-selector {
    max-width: 280px;
    gap: 8px;
  }
  .start-btn {
    max-width: 280px;
    font-size: 17px;
    padding: 14px;
  }

  /* Team picker compact */
  .pick-team-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 100%;
  }
  .pick-flag-btn .flag-emoji {
    font-size: 26px;
  }

  /* Header score compact */
  .header-score {
    padding: 4px 10px;
    font-size: 13px;
  }

  /* Results compact */
  .results-emoji {
    font-size: 56px;
  }
  .results-title {
    font-size: 22px;
  }
}

/* ═══════════════════════════════════════════════════════════
   2. iPad Split View Medium (400-550px width)
   50/50 split (~507px) or the narrow side of an
   uneven split on smaller iPads
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 400px) and (max-width: 550px) {
  /* 2-column grid for collection */
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
  }

  /* Compact stadium cards */
  .stadium-card {
    padding: 10px 12px;
    gap: 10px;
  }
  .stadium-card-icon {
    font-size: 24px;
  }
  .stadium-card-name {
    font-size: 14px;
  }

  /* Reduce hero section */
  .state-hero {
    padding: 16px 14px;
    gap: 12px;
  }
  .state-flag-wrap {
    width: 100px;
  }
  .state-flag-img {
    width: 90px;
  }

  /* Team cards compact */
  .team-card {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Quiz options stay stacked but a bit narrower */
  .quiz-options {
    max-width: 340px;
  }
  .quiz-question {
    font-size: 20px;
  }

  /* Flag game 2-column still works at this width */
  .flag-game-options {
    max-width: 340px;
  }

  /* Home screen slightly reduced */
  .home-title {
    font-size: 28px;
  }
  .home-mascot {
    font-size: 70px;
  }

  /* Map padding */
  .map-container {
    padding: 6px 10px;
  }

  /* Quiz packs 2-column */
  .quiz-packs-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Hub packs 2-column */
  .hub-packs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════
   2b. iPad Portrait (551-1023px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 551px) and (max-width: 1023px) {
  /* iPad portrait mode */
  .quiz-option { font-size: 16px; padding: 14px 18px; }
  .collection-grid { grid-template-columns: repeat(3, 1fr); }
  .quiz-question { font-size: 20px; }
  .state-name { font-size: 22px; }
  .info-card-title { font-size: 17px; }
  .hub-pack-card { min-width: 140px; }
  .team-picker-grid { grid-template-columns: repeat(7, 1fr); }
  .bingo-grid { max-width: 400px; }
}

/* ═══════════════════════════════════════════════════════════
   3. iPad Landscape Full (min-width: 1024px)
   Standard iPad landscape (1024x768)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* 3-4 column grids for collection */
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }

  /* Teams list as cards in a grid */
  #teams-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-content: start;
  }
  #teams-list .team-section-header {
    grid-column: 1 / -1;
  }
  #teams-list .my-team-banner {
    grid-column: 1 / -1;
  }

  /* Stadiums in 2 columns */
  #stadiums-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-content: start;
  }
  #stadiums-list .stadium-section-header {
    grid-column: 1 / -1;
  }

  /* Larger map with more breathing room */
  .map-container {
    padding: 12px 24px;
  }
  .map-hint {
    font-size: 14px;
    padding: 10px;
  }

  /* Wider quiz answer area — 2x2 grid instead of stacked */
  .quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 600px;
  }
  .quiz-question {
    font-size: 28px;
    max-width: 500px;
  }
  .quiz-question-container {
    padding: 32px 24px;
  }

  /* Flag game options wider */
  .flag-game-options {
    max-width: 500px;
    gap: 12px;
  }
  .flag-game-display {
    font-size: 120px;
  }

  /* Bigger home screen elements */
  .home-title {
    font-size: 46px;
  }
  .home-subtitle {
    font-size: 20px;
  }
  .home-mascot {
    font-size: 110px;
  }
  .home-tagline {
    font-size: 17px;
    max-width: 380px;
  }
  .age-selector {
    max-width: 480px;
    gap: 14px;
  }
  .start-btn {
    max-width: 480px;
    font-size: 22px;
  }

  /* State card hero side-by-side with more room */
  .state-hero {
    padding: 24px 20px;
    gap: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  .state-flag-img {
    width: 130px;
  }

  /* Info cards wider */
  .info-card {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Results wider */
  .results-buttons {
    max-width: 400px;
  }
  .results-title {
    font-size: 34px;
  }
  .results-emoji {
    font-size: 84px;
  }

  /* Achievement grid 4+ columns */
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px;
  }

  /* Quiz packs 3 column */
  .quiz-packs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* Hub packs 3 column */
  .hub-packs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* Team picker wider grid */
  .pick-team-grid {
    grid-template-columns: repeat(8, 1fr);
    max-width: 600px;
    gap: 10px;
  }

  /* Wider celebration card */
  .celebration-card {
    max-width: 420px;
  }

  /* Wider share card */
  .share-card {
    max-width: 500px;
    margin: 0 auto;
  }

  /* Header elements larger */
  .header-title {
    font-size: 24px;
  }
  .header-score {
    font-size: 17px;
    padding: 8px 18px;
  }

  /* Scroll body more padding */
  .scroll-body {
    padding: 20px 24px;
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  /* Team detail hero wider */
  .team-hero {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Stadium hero wider */
  .stadium-hero {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Daily challenge card wider */
  .daily-challenge-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ═══════════════════════════════════════════════════════════
   4. iPad Pro (min-width: 1194px)
   iPad Pro 12.9" landscape (1194x834) and larger
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1194px) {
  /* 4-column grids */
  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
  }

  /* Even bigger fonts for readability at arm's length */
  .header-title {
    font-size: 26px;
  }
  .home-title {
    font-size: 52px;
  }
  .home-subtitle {
    font-size: 22px;
  }
  .home-mascot {
    font-size: 120px;
  }
  .home-tagline {
    font-size: 18px;
    max-width: 420px;
  }
  .state-name {
    font-size: 28px;
  }

  /* Larger quiz text */
  .quiz-question {
    font-size: 30px;
    max-width: 560px;
  }
  .quiz-option {
    font-size: 18px;
    padding: 18px 24px;
  }
  .quiz-options {
    max-width: 660px;
    gap: 14px;
  }

  /* Flag game bigger */
  .flag-game-display {
    font-size: 140px;
  }
  .flag-game-options {
    max-width: 560px;
  }
  .fg-option {
    font-size: 16px;
    padding: 16px 14px;
  }

  /* Teams 3-column */
  #teams-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stadiums 3-column */
  #stadiums-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hub packs 4-column */
  .hub-packs-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Quiz packs 4-column */
  .quiz-packs-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Achievements 5+ columns */
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  }

  /* Map even more breathing room */
  .map-container {
    padding: 16px 32px;
  }

  /* Wider content areas */
  .scroll-body {
    padding: 24px 32px;
    padding-bottom: calc(24px + var(--safe-bottom));
  }

  /* Team picker wider */
  .pick-team-grid {
    grid-template-columns: repeat(10, 1fr);
    max-width: 700px;
  }

  /* Larger info cards */
  .info-card {
    padding: 20px;
    max-width: 800px;
  }
  .info-card-title {
    font-size: 18px;
  }
  .fact-item {
    font-size: 15px;
  }

  /* Results screen */
  .results-title {
    font-size: 38px;
  }
  .results-emoji {
    font-size: 96px;
  }
  .results-buttons {
    max-width: 440px;
  }

  /* Progress bar slightly taller */
  .progress-bar {
    height: 14px;
  }
  .progress-label {
    font-size: 14px;
  }

  /* Navigation slightly larger */
  .nav-tab .nav-icon {
    font-size: 24px;
  }
  .nav-tab {
    font-size: 13px;
  }

  /* Bingo cell name larger */
  .bingo-cell-name { font-size: 14px; }

  /* Celebration card larger */
  .celebration-card {
    max-width: 460px;
    padding: 36px 28px;
  }
  .celebration-title {
    font-size: 28px;
  }

  /* Age buttons larger */
  .age-btn {
    padding: 20px 16px;
  }
  .age-btn .age-emoji {
    font-size: 36px;
  }
  .age-btn .age-label {
    font-size: 17px;
  }

  /* Daily challenge wider */
  .daily-challenge-card {
    max-width: 700px;
  }
  .daily-title {
    font-size: 20px;
  }

  /* Bingo grid wider on iPad landscape */
  .bingo-grid { max-width: 500px; }

  /* Bingo cell name larger */
  .bingo-cell-name { font-size: 13px; }

  /* Nav labels larger */
  .nav-tab { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   5. SVG map scaling — ensure proper fit in all widths
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 550px) {
  .map-container svg {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }
}

@media (min-width: 1024px) {
  .map-container svg {
    max-width: 900px;
    margin: 0 auto;
  }
}

@media (min-width: 1194px) {
  .map-container svg {
    max-width: 1000px;
  }
}


/* ═══════════════════════════════════════════════════════════
   TOURNAMENT BRACKET
   ═══════════════════════════════════════════════════════════ */

.tournament-bracket-btn {
  border-color: var(--accent) !important;
  background: rgba(255, 215, 0, 0.08) !important;
}

/* Tab switcher */
.tourn-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  justify-content: center;
}
.tourn-tab {
  flex: 1;
  max-width: 160px;
  padding: 10px 20px;
  border: 2px solid var(--surface-2);
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tourn-tab.active {
  background: var(--accent);
  color: var(--text-dark);
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.3);
}

/* Group Stage Grid */
.group-stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 12px 24px;
}

.group-card {
  background: var(--surface-1);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.group-card:active {
  transform: scale(0.97);
}
.group-card.expanded {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: var(--surface-2);
}
.group-card.group-has-my-team {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.group-letter {
  font-family: 'Baloo 2', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}
.group-expand-icon {
  font-size: 12px;
  color: var(--text-secondary);
}

.group-card-teams {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.group-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.group-team-flag {
  font-size: 20px;
  line-height: 1;
}
.group-team-name {
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* My team gold highlight */
.my-team-highlight {
  color: var(--accent) !important;
  font-weight: 700 !important;
}
.group-team-row.my-team-highlight {
  background: rgba(255, 215, 0, 0.12);
  border-radius: 8px;
}

/* Group matches (expanded view) */
.group-matches {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-3);
}
.group-matches-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.group-match-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-1);
}
.group-match-row:last-child {
  border-bottom: none;
}
.group-match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.group-match-vs {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: var(--coral);
  font-size: 12px;
}
.group-match-info {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Knockout Bracket ── */
.knockout-bracket {
  padding: 12px;
}

.ko-final-section {
  text-align: center;
  margin-bottom: 24px;
}
.ko-final-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 20px 16px;
  margin-bottom: 12px;
}
.ko-final-label {
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}
.ko-final-date {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 12px;
}
.ko-final-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}
.ko-team-slot {
  flex: 1;
  text-align: center;
}
.ko-vs {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--coral);
}
.ko-vs.small {
  font-size: 14px;
}
.ko-team-slot.small {
  font-size: 13px;
}

.ko-third-card {
  background: var(--surface-1);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
  padding: 12px;
}
.ko-third-label {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
}
.ko-tbd {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 12px;
}

/* Knockout rounds */
.ko-round {
  margin-bottom: 20px;
}
.ko-round-label {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin-bottom: 10px;
  padding: 6px 16px;
  background: var(--surface-1);
  border-radius: 20px;
  display: inline-block;
  margin-left: 50%;
  transform: translateX(-50%);
}
.ko-round-matches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ko-match {
  background: var(--surface-1);
  border: 1.5px solid var(--surface-2);
  border-radius: 12px;
  padding: 10px;
  position: relative;
}
.ko-match-id {
  font-family: 'Baloo 2', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ko-match-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ko-match-team {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  background: var(--surface-2);
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ko-match-played {
  border-color: var(--green);
}
.ko-match-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  padding: 2px 0;
  font-family: 'Baloo 2', sans-serif;
}
.ko-winner {
  background: rgba(78, 205, 196, 0.2);
  border: 1px solid var(--green);
  font-weight: 800;
}
.ko-match-info {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}

.ko-connector {
  display: none; /* Hidden for mobile, could be shown on desktop */
}

/* Bracket connector lines between paired matches on larger screens */
@media (min-width: 480px) {
  .ko-round-matches {
    gap: 10px;
  }
  .ko-match-top {
    border-right: 3px solid var(--accent);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .ko-match-bottom {
    border-right: 3px solid var(--accent);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .ko-match-top::after,
  .ko-match-bottom::after {
    content: '';
    position: absolute;
    right: -15px;
    width: 12px;
    height: 2px;
    background: var(--accent);
  }
  .ko-match-top::after {
    bottom: 50%;
  }
  .ko-match-bottom::after {
    top: 50%;
  }
}


/* ═══════════════════════════════════════════════════════════
   HEAD-TO-HEAD COMPARISON
   ═══════════════════════════════════════════════════════════ */

.h2h-compare-btn {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(96, 165, 250, 0.15)) !important;
  border: 2px solid var(--coral) !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

/* Team selectors at top */
.h2h-selectors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 16px;
  animation: h2hSlideIn 0.5s ease;
}

@keyframes h2hSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes h2hTeam1Enter {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes h2hTeam2Enter {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes h2hVsPop {
  0% { opacity: 0; transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.h2h-team-select {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  background: var(--surface-1);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.h2h-team-select:active {
  transform: scale(0.95);
}
.h2h-team-select.h2h-selected {
  border-color: var(--accent);
  background: var(--surface-2);
}
.h2h-team1 {
  animation: h2hTeam1Enter 0.4s ease;
}
.h2h-team2 {
  animation: h2hTeam2Enter 0.4s ease 0.15s both;
}

.h2h-flag {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}
.h2h-name {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.h2h-vs-badge {
  font-family: 'Baloo 2', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--coral);
  background: var(--surface-2);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--coral);
  flex-shrink: 0;
  animation: h2hVsPop 0.5s ease 0.3s both;
}

/* Animate cards entrance */
.h2h-animate {
  animation: h2hCardIn 0.4s ease;
}
@keyframes h2hCardIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rivalry card */
.h2h-rivalry-card {
  margin: 0 12px 16px;
  padding: 16px;
  background: var(--surface-1);
  border: 2px solid var(--coral);
  border-radius: 16px;
}
.h2h-rivalry-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--coral);
  text-align: center;
  margin-bottom: 12px;
}
.h2h-rivalry-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}
.h2h-rivalry-stat {
  text-align: center;
}
.h2h-rivalry-num {
  font-family: 'Baloo 2', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.h2h-rivalry-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.h2h-wins1 .h2h-rivalry-num { color: var(--blue); }
.h2h-wins2 .h2h-rivalry-num { color: var(--orange); }

/* Win/draw/loss bar */
.h2h-rivalry-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface-3);
}
.h2h-bar-fill {
  transition: width 0.6s ease;
}
.h2h-bar1 { background: var(--blue); }
.h2h-bar-draw { background: var(--text-secondary); }
.h2h-bar2 { background: var(--orange); }

.h2h-fun-fact {
  font-size: 13px;
  color: var(--accent-light);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255, 215, 0, 0.06);
  border-radius: 10px;
  margin-bottom: 6px;
}
.h2h-last-met {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Stats comparison card */
.h2h-stats-card {
  margin: 0 12px 16px;
  padding: 16px;
  background: var(--surface-1);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
}
.h2h-stats-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
  text-align: center;
  margin-bottom: 12px;
}

.h2h-stat-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}
.h2h-stat-row:last-child {
  border-bottom: none;
}
.h2h-stat-val {
  flex: 1;
  text-align: center;
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.h2h-stat-val.h2h-winner {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.h2h-stat-label {
  flex: 1.2;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Facts card */
.h2h-facts-card {
  margin: 0 12px 24px;
  padding: 16px;
  background: var(--surface-1);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
}
.h2h-facts-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
  text-align: center;
  margin-bottom: 12px;
}
.h2h-fact-item {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 8px;
}
.h2h-fact-item:last-child {
  margin-bottom: 0;
}

/* Team Picker for H2H */
.h2h-picker {
  padding: 12px;
}
.h2h-picker-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
}
.h2h-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.h2h-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1.5px solid var(--surface-2);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.h2h-picker-btn:active {
  transform: scale(0.96);
  border-color: var(--accent);
}
.h2h-picker-flag {
  font-size: 22px;
}
.h2h-picker-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════
   RTL (Right-to-Left) Support — Arabic (ar) & Persian/Farsi (fa)
   All rules scoped under [dir="rtl"] so LTR is unaffected.
   ═══════════════════════════════════════════════════════════ */

/* ── Font ── */
[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Quicksand', -apple-system, sans-serif;
}

/* ── Global text alignment ── */
[dir="rtl"] .header-title,
[dir="rtl"] .state-name,
[dir="rtl"] .settings-label,
[dir="rtl"] .info-card-title,
[dir="rtl"] .quiz-question,
[dir="rtl"] .daily-title,
[dir="rtl"] .daily-subtitle,
[dir="rtl"] .fact-item,
[dir="rtl"] .info-row,
[dir="rtl"] .quiz-option,
[dir="rtl"] .settings-row-label,
[dir="rtl"] .collection-section-header,
[dir="rtl"] .map-hint,
[dir="rtl"] .progress-label,
[dir="rtl"] .achievement-name,
[dir="rtl"] .achievement-req,
[dir="rtl"] .hub-pack-name,
[dir="rtl"] .flag-game-prompt {
  text-align: right;
}

/* Centered items stay centered in RTL */
[dir="rtl"] .celebration-card,
[dir="rtl"] .results-container,
[dir="rtl"] .pick-team-container,
[dir="rtl"] .home-container {
  text-align: center;
}

/* ── Nav bar — uses space-around so naturally works, but ensure icon order ── */
[dir="rtl"] .nav-bar {
  direction: rtl;
}

/* ── Header bar — flex with space-between auto-flips in RTL ── */
[dir="rtl"] .header-bar,
[dir="rtl"] .map-header {
  direction: rtl;
}

/* ── State card header — back btn should be on the right ── */
[dir="rtl"] .state-card-header {
  flex-direction: row-reverse;
}

/* ── Back button — mirror the arrow ── */
[dir="rtl"] .back-btn {
  transform: scaleX(-1);
}
[dir="rtl"] .back-btn:active {
  transform: scaleX(-1) scale(0.9);
}

/* ── Quiz header — close btn on right, progress on left ── */
[dir="rtl"] .quiz-header {
  flex-direction: row-reverse;
}

/* ── Flag game header — flip layout ── */
[dir="rtl"] .flag-game-header {
  flex-direction: row-reverse;
}
[dir="rtl"] .flag-game-score-wrap {
  margin-left: 0;
  margin-right: auto;
}

/* ── Search bar — icon and input flip ── */
[dir="rtl"] .search-bar {
  flex-direction: row-reverse;
}
[dir="rtl"] .search-input {
  text-align: right;
}
[dir="rtl"] .search-input::placeholder {
  text-align: right;
}

/* ── Country tabs — flow RTL ── */
[dir="rtl"] .country-tabs {
  flex-direction: row-reverse;
}

/* ── Progress bar — fill from right ── */
[dir="rtl"] .progress-fill {
  margin-left: auto;
  margin-right: 0;
  background: linear-gradient(270deg, var(--accent), var(--orange), var(--coral));
  border-radius: 6px;
}
/* Soccer ball at leading edge (left in RTL) */
[dir="rtl"] .progress-fill::after {
  right: auto;
  left: -8px;
  transform: translateY(-50%) scaleX(-1);
}

/* ── Quiz options — border accent moves to right side ── */
[dir="rtl"] .quiz-option {
  text-align: right;
  border-left: none;
}
[dir="rtl"] .quiz-option:nth-child(1) { border-left: none; border-right: 4px solid var(--blue); }
[dir="rtl"] .quiz-option:nth-child(2) { border-left: none; border-right: 4px solid var(--orange); }
[dir="rtl"] .quiz-option:nth-child(3) { border-left: none; border-right: 4px solid var(--purple); }
[dir="rtl"] .quiz-option:nth-child(4) { border-left: none; border-right: 4px solid var(--pink); }

/* ── Collection grid — flows RTL naturally with CSS grid, just set direction ── */
[dir="rtl"] .collection-grid {
  direction: rtl;
}

/* ── Daily challenge card — flip the top row ── */
[dir="rtl"] .daily-top {
  flex-direction: row-reverse;
}
[dir="rtl"] .daily-info {
  text-align: right;
}

/* ── Settings rows — label/value swap ── */
[dir="rtl"] .settings-row {
  flex-direction: row-reverse;
}

/* ── Hub stadiums button — flip icon/text/chevron ── */
[dir="rtl"] .hub-stadiums-btn {
  flex-direction: row-reverse;
}
[dir="rtl"] .hub-stadiums-btn span:last-child {
  margin-left: 0;
  margin-right: auto;
}

/* ── Fact items (privacy, info cards) — flip bullet + text ── */
[dir="rtl"] .fact-item {
  flex-direction: row-reverse;
  text-align: right;
}

/* ── Info rows — flip label/value ── */
[dir="rtl"] .info-row {
  flex-direction: row-reverse;
}

/* ── Team picker grid — flows RTL naturally with CSS grid ── */
[dir="rtl"] .pick-team-grid {
  direction: rtl;
}

/* ── Score display — flip icon/number ── */
[dir="rtl"] .header-score {
  flex-direction: row-reverse;
}

/* ── Toggle button — mirror knob position ── */
[dir="rtl"] .toggle-btn::after {
  left: auto;
  right: 3px;
}
[dir="rtl"] .toggle-btn.on::after {
  transform: translateX(-22px);
}

/* ── Toast — stays centered, just ensure RTL text ── */
[dir="rtl"] .toast {
  direction: rtl;
}

/* ── Celebration overlay — RTL text for buttons ── */
[dir="rtl"] .celebration-card {
  direction: rtl;
}

/* ── Modal ── */
[dir="rtl"] .modal-card {
  direction: rtl;
}
[dir="rtl"] .modal-input {
  text-align: right;
}

/* ── Results view ── */
[dir="rtl"] .results-container {
  direction: rtl;
}

/* ── Quiz feedback ── */
[dir="rtl"] .quiz-feedback {
  direction: rtl;
}

/* ── Scroll body — ensure RTL direction propagates ── */
[dir="rtl"] .scroll-body {
  direction: rtl;
}

/* ── Flag game stats — stay centered but RTL labels ── */
[dir="rtl"] .flag-game-stats {
  direction: rtl;
}

/* ── Flag game options ── */
[dir="rtl"] .flag-game-options {
  direction: rtl;
}

/* ── Map team flag — sits at the start (right in RTL) ── */
[dir="rtl"] .map-team-flag {
  order: 2;
}
[dir="rtl"] .map-header .header-title {
  order: 1;
}
[dir="rtl"] .map-header .header-score {
  order: 0;
}

/* ── Achievements grid — flows RTL naturally ── */
[dir="rtl"] .achievements-grid {
  direction: rtl;
}

/* ── Share card ── */
[dir="rtl"] .share-card-footer {
  text-align: right;
}

/* ── Player rows — flip layout ── */
[dir="rtl"] .player-row {
  direction: rtl;
}

/* ── Baloo 2 override for RTL headings ── */
[dir="rtl"] .header-title,
[dir="rtl"] .state-name,
[dir="rtl"] .celebration-title,
[dir="rtl"] .results-title,
[dir="rtl"] .daily-title,
[dir="rtl"] .info-card-title,
[dir="rtl"] .settings-label,
[dir="rtl"] .hub-pack-name,
[dir="rtl"] .achievement-name {
  font-family: 'Noto Sans Arabic', 'Baloo 2', cursive;
}

/* ── Home screen RTL ── */
[dir="rtl"] .home-container {
  direction: rtl;
}
[dir="rtl"] .age-selector {
  direction: rtl;
}

/* ── Reset button ── */
[dir="rtl"] .reset-btn {
  direction: rtl;
}

/* ── Ensure SVG map is not flipped ── */
[dir="rtl"] .map-container {
  direction: ltr;
}

/* ═══════════════════════════════════════════════════════════
   Kid-Friendly Animations — subtle, GPU-accelerated, accessible
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Map pulse on unspotted states ── */
@keyframes mapPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.map-container svg path[id]:not(.collected) {
  animation: mapPulse 3s ease-in-out infinite;
}

.map-container svg circle[id]:not(.collected) {
  animation: mapPulse 3s ease-in-out infinite;
}

/* ── 2. Star sparkle on correct quiz answer ── */
@keyframes starSparkle {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(20deg); opacity: 1; }
  100% { transform: scale(0) rotate(45deg); opacity: 0; }
}

.quiz-option.correct {
  position: relative;
}

.quiz-option.correct::before,
.quiz-option.correct::after {
  content: '⭐';
  position: absolute;
  font-size: 18px;
  animation: starSparkle 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}

.quiz-option.correct::before {
  top: -8px;
  right: 12px;
  animation-delay: 0.1s;
}

.quiz-option.correct::after {
  top: -6px;
  left: 16px;
  font-size: 14px;
  animation-delay: 0.25s;
}

/* ── 4. Card flip for collection items ── */
.collection-card.collected {
  perspective: 600px;
}

.collection-card.collected.card-flip {
  animation: cardFlip 0.6s ease-in-out;
}

@keyframes cardFlip {
  0% { transform: perspective(600px) rotateY(0deg); }
  50% { transform: perspective(600px) rotateY(90deg); }
  100% { transform: perspective(600px) rotateY(0deg); }
}

/* ── 5. Progress bar shimmer ── */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-fill {
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2.5s ease-in-out infinite;
  pointer-events: none;
}

/* ── 6. Trophy wiggle on achievements ── */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-8deg); }
  30% { transform: rotate(6deg); }
  45% { transform: rotate(-4deg); }
  60% { transform: rotate(2deg); }
  75% { transform: rotate(-1deg); }
}

.achievement-card.earned .achievement-emoji {
  animation: wiggle 0.8s ease-in-out 0.3s;
}

/* ── 7. Streak fire animation ── */
@keyframes fireGrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

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

.daily-stat-val .streak-fire,
.flag-game-streak .streak-fire {
  display: inline-block;
  animation: fireGrow 1.5s ease-in-out infinite;
}

.streak-fire.streak-hot {
  animation: fireGrowFast 0.8s ease-in-out infinite;
}

.streak-fire.streak-blazing {
  animation: fireGrowFast 0.5s ease-in-out infinite;
  filter: brightness(1.3);
}

/* ── 8. Stamp effect on spotting ── */
@keyframes stampDown {
  0% {
    transform: scale(2.5) rotate(-12deg);
    opacity: 0;
  }
  60% {
    transform: scale(0.95) rotate(1deg);
    opacity: 1;
  }
  80% {
    transform: scale(1.05) rotate(-0.5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.celebration-card.stamp-in {
  animation: stampDown 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.celebration-title.stamp-in {
  animation: stampDown 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
}

/* ── 9. Progress bar shimmer (collection view) ── */
/* Reuses the shimmer keyframe from #5 above — applied via .progress-fill::before */

/* ── 10. Quiz option hover glow ── */
.quiz-option:not(.disabled):hover,
.quiz-option:not(.disabled):focus {
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25), 0 0 4px rgba(255, 215, 0, 0.15);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

/* ── 3. Score counter roll — handled by JS, but add transition for smoothness ── */
.score-rolling {
  display: inline-block;
  transition: transform 0.1s ease-out;
}

@keyframes scoreRollDigit {
  0% { transform: translateY(30%); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

.score-rolling {
  animation: scoreRollDigit 0.15s ease-out;
}

/* ═══════════════════════════════════════════════════════════
   Plate Bingo
   ═══════════════════════════════════════════════════════════ */
.bingo-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.bingo-status {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px;
  max-width: 360px;
  margin: 0 auto 16px;
}

.bingo-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 3px solid var(--surface-3);
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.bingo-cell:active {
  transform: scale(0.95);
}

.bingo-cell-abbr {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  z-index: 1;
}

.bingo-cell-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Unmarked cell — faded */
.bingo-cell.unmarked {
  opacity: 0.55;
}

/* Marked cell — bright with check */
.bingo-cell.marked {
  border-color: var(--green);
  background: var(--green-soft);
  opacity: 1;
}

.bingo-cell.marked .bingo-cell-abbr {
  color: var(--green);
}

.bingo-cell.marked::after {
  content: '\2713';
  position: absolute;
  font-size: 52px;
  font-weight: 900;
  color: rgba(52, 211, 153, 0.35);
  z-index: 0;
  line-height: 1;
}

/* FREE center square */
.bingo-cell.free {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.12);
  opacity: 1;
}

.bingo-cell.free .bingo-cell-abbr {
  font-size: 16px;
  color: var(--accent);
}

.bingo-cell.free::before {
  content: '\2B50';
  font-size: 28px;
  position: absolute;
  top: 6px;
}

/* Winning line glow */
.bingo-cell.win-line {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.25);
  animation: bingo-glow 1.2s ease-in-out infinite alternate;
}

@keyframes bingo-glow {
  from { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
  to   { box-shadow: 0 0 20px rgba(255, 215, 0, 0.7), 0 0 40px rgba(255, 215, 0, 0.3); }
}

/* Stamp-in animation for marking a square */
@keyframes bingo-stamp {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.bingo-cell.just-marked {
  animation: bingo-stamp 0.4s ease-out;
}

/* Bingo win banner */
.bingo-win-banner {
  text-align: center;
  padding: 16px;
  margin: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
  border: 2px solid var(--accent);
}

.bingo-win-title {
  font-family: 'Baloo 2', cursive;
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(255,215,0,0.3);
}

.bingo-win-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 8px 0;
}

.bingo-win-stat {
  text-align: center;
}

.bingo-win-stat-val {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.bingo-win-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.bingo-win-msg {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
  margin-top: 4px;
}

.bingo-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 16px 16px;
}

.bingo-actions .action-btn {
  flex: 1;
  max-width: 180px;
}

/* ═══════════════════════════════════════════════════════════
   Accessibility: respect user motion preferences
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .map-container svg path[id]:not(.collected),
  .map-container svg circle[id]:not(.collected),
  .quiz-option.correct::before,
  .quiz-option.correct::after,
  .collection-card.collected.card-flip,
  .progress-fill::before,
  .achievement-card.earned .achievement-emoji,
  .daily-stat-val .streak-fire,
  .flag-game-streak .streak-fire,
  .streak-fire.streak-hot,
  .streak-fire.streak-blazing,
  .celebration-card.stamp-in,
  .celebration-title.stamp-in,
  .score-rolling,
  .bingo-cell.just-marked,
  .bingo-cell.win-line {
    animation: none !important;
  }

  .quiz-option:not(.disabled):hover,
  .quiz-option:not(.disabled):focus {
    box-shadow: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   Co-Pilot Challenge
   ═══════════════════════════════════════════════════════════ */

/* Setup screen */
.copilot-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 20px;
}

.copilot-setup-icon {
  font-size: 64px;
  animation: copilotBounce 1.5s ease-in-out infinite;
}

@keyframes copilotBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.copilot-setup-title {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.copilot-setup-subtitle {
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -12px;
}

.copilot-players {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.copilot-player-card {
  flex: 1;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: 16px;
  border: 3px solid;
  background: var(--surface-1);
  transition: transform 0.2s;
}

.copilot-player-card:active { transform: scale(0.95); }

.copilot-player-card.navigator { border-color: var(--blue); }
.copilot-player-card.driver { border-color: var(--orange); }

.copilot-player-emoji { font-size: 40px; }

.copilot-player-role {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
}

.copilot-player-card.navigator .copilot-player-role { color: var(--blue); }
.copilot-player-card.driver .copilot-player-role { color: var(--orange); }

.copilot-player-tier {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 20px;
}

.copilot-swap-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--purple);
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.copilot-swap-btn:active { transform: scale(0.95); }

.copilot-start-btn {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s;
  margin-top: 8px;
}

.copilot-start-btn:active { transform: scale(0.95); }

/* Turn banner */
.copilot-turn-banner {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 12px 0;
  animation: copilotSlideIn 0.4s ease-out;
}

.copilot-turn-banner.navigator {
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
}

.copilot-turn-banner.driver {
  background: linear-gradient(135deg, #F97316, #FB923C);
}

@keyframes copilotSlideIn {
  from { transform: translateY(-20px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Round indicator */
.copilot-round-label {
  text-align: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Scoreboard (during game) */
.copilot-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin: 0 0 8px;
  border-radius: 12px;
  background: var(--surface-1);
}

.copilot-sb-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.copilot-sb-name {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.copilot-sb-score {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
}

.copilot-sb-player.navigator .copilot-sb-score { color: var(--blue); }
.copilot-sb-player.driver .copilot-sb-score { color: var(--orange); }

.copilot-sb-vs {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Question area in co-pilot mode */
.copilot-question-wrap {
  padding: 0 4px;
}

.copilot-question {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 16px 8px;
  line-height: 1.3;
}

.copilot-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 4px;
}

.copilot-option {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--surface-3);
  border-radius: 14px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.copilot-option:active:not(.disabled) { transform: scale(0.97); }
.copilot-option.correct { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.copilot-option.wrong { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.copilot-option.show-correct { border-color: var(--green); background: var(--green-soft); }
.copilot-option.disabled { pointer-events: none; opacity: 0.7; }

.copilot-feedback {
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  min-height: 28px;
  margin-top: 12px;
}

/* Results screen */
.copilot-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 16px;
}

.copilot-results-emoji {
  font-size: 72px;
  animation: copilotBounce 1.5s ease-in-out infinite;
}

.copilot-results-title {
  font-family: 'Baloo 2', cursive;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
}

.copilot-results-scores {
  display: flex;
  gap: 24px;
  margin: 8px 0;
}

.copilot-result-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 3px solid;
  background: var(--surface-1);
  min-width: 120px;
}

.copilot-result-player.navigator { border-color: var(--blue); }
.copilot-result-player.driver { border-color: var(--orange); }
.copilot-result-player.winner { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); border-color: var(--accent); }

.copilot-result-emoji { font-size: 32px; }
.copilot-result-name {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.copilot-result-detail {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.copilot-result-pts {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
}

.copilot-result-player.navigator .copilot-result-pts { color: var(--blue); }
.copilot-result-player.driver .copilot-result-pts { color: var(--orange); }
.copilot-result-player.winner .copilot-result-pts { color: var(--accent); }

.copilot-play-again-btn {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s;
}

.copilot-play-again-btn:active { transform: scale(0.95); }

.copilot-done-btn {
  padding: 10px 24px;
  border: 2px solid var(--surface-3);
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Co-Pilot featured card in Quiz Hub */
.copilot-hub-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 3px solid;
  border-image: linear-gradient(135deg, var(--blue), var(--orange)) 1;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(251, 146, 60, 0.1));
  cursor: pointer;
  transition: transform 0.2s;
  margin-bottom: 16px;
}

/* Fix border-radius with border-image (use outline trick) */
.copilot-hub-card {
  border: none;
  outline: 3px solid var(--blue);
  outline-offset: -3px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(251, 146, 60, 0.12));
}

.copilot-hub-card:active { transform: scale(0.97); }

.copilot-hub-emoji { font-size: 36px; }

.copilot-hub-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.copilot-hub-title {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.copilot-hub-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.copilot-hub-arrow {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ═══════════ BONUS FINDS ═══════════ */

/* Floating Action Button on map */
.bonus-fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom, 0px));
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 3px solid rgba(255,255,255,0.3);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
  cursor: pointer;
  z-index: 20;
  animation: bonus-fab-bounce 3s ease-in-out infinite;
  transition: transform 0.15s;
}
.bonus-fab:active {
  transform: scale(0.9);
}

@keyframes bonus-fab-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Daily Bonus section at top */
.bonus-daily-section {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.1));
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 16px;
  padding: 14px;
  margin: 0 16px 16px;
}
.bonus-daily-header {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
  text-align: center;
}
.bonus-daily-items {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.bonus-daily-card {
  background: var(--surface-2);
  border: 2px solid rgba(255,215,0,0.5);
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
  min-width: 90px;
  flex: 1;
  max-width: 120px;
  box-shadow: 0 0 12px rgba(255,215,0,0.2);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.bonus-daily-card:active {
  transform: scale(0.95);
}
.bonus-daily-card.claimed {
  opacity: 0.6;
  border-color: var(--success);
}
.bonus-daily-emoji {
  font-size: 28px;
  line-height: 1.2;
}
.bonus-daily-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}
.bonus-daily-pts {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}

/* Bonus stats summary */
.bonus-stats-bar {
  display: flex;
  gap: 8px;
  margin: 0 16px 12px;
  flex-wrap: wrap;
}
.bonus-stat-pill {
  background: var(--surface-1);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}
.bonus-stat-pill span {
  color: var(--accent);
}

/* Category sections */
.bonus-category {
  margin: 0 16px 12px;
}
.bonus-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-1);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.bonus-category-header:active {
  background: var(--surface-2);
}
.bonus-category-icon {
  font-size: 24px;
}
.bonus-category-name {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
}
.bonus-category-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 12px;
}
.bonus-category-chevron {
  font-size: 16px;
  color: var(--text-secondary);
  transition: transform 0.25s;
}
.bonus-category.open .bonus-category-chevron {
  transform: rotate(90deg);
}

/* Item list inside category */
.bonus-items {
  display: none;
  padding: 8px 0 0;
  gap: 8px;
  flex-direction: column;
}
.bonus-category.open .bonus-items {
  display: flex;
}

/* Individual item card */
.bonus-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-1);
  border-radius: 12px;
  transition: transform 0.1s;
}
.bonus-item:active {
  transform: scale(0.98);
}
.bonus-item-emoji {
  font-size: 28px;
  min-width: 36px;
  text-align: center;
}
.bonus-item-info {
  flex: 1;
}
.bonus-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.bonus-item-pts {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.bonus-item-pts.daily-double {
  color: var(--accent);
}

/* Claim button */
.bonus-claim-btn {
  background: linear-gradient(135deg, var(--green), #22C55E);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s, opacity 0.15s;
}
.bonus-claim-btn:active {
  transform: scale(0.92);
}

/* Claimed state */
.bonus-claimed-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--success);
  white-space: nowrap;
}
.bonus-claimed-count {
  background: var(--green-soft);
  color: var(--green);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

/* Claim celebration animation */
@keyframes bonus-claim-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.bonus-item.just-claimed {
  animation: bonus-claim-pop 0.4s ease-out;
}

/* ═══════════════════════════════════════════════════════════
   CAR PARTY MODE
   ═══════════════════════════════════════════════════════════ */

/* ── Floating Player Selector Bar on Map ── */
.carparty-player-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(10, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carparty-player-bar::-webkit-scrollbar { display: none; }

.carparty-player-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--surface-1);
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.carparty-player-chip.active {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
  transform: scale(1.05);
}

.carparty-player-chip:active { transform: scale(0.95); }

.carparty-chip-avatar {
  font-size: 18px;
  line-height: 1;
}

.carparty-chip-name {
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carparty-chip-pts {
  font-size: 11px;
  color: var(--accent);
  background: rgba(255, 215, 0, 0.15);
  padding: 1px 6px;
  border-radius: 8px;
}

/* ── Scoreboard FAB ── */
.carparty-scoreboard-fab {
  position: absolute;
  bottom: calc(60px + var(--safe-bottom, 0px));
  right: 16px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(10, 18, 32, 0.9);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.carparty-scoreboard-fab:active { transform: scale(0.9); }

/* ── End Trip FAB ── */
.carparty-end-fab {
  position: absolute;
  bottom: calc(60px + var(--safe-bottom, 0px));
  left: 16px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid var(--coral);
  background: rgba(10, 18, 32, 0.9);
  color: var(--coral);
  font-family: 'Baloo 2', cursive;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.carparty-end-fab:active { transform: scale(0.9); }

/* ── Car Party Setup ── */
.carparty-setup-header {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}

.carparty-setup-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

.carparty-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.carparty-setup-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--surface-1);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.carparty-setup-player.selected {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.carparty-setup-player.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.carparty-setup-player.active {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.1);
}

.carparty-setup-player:active { transform: scale(0.95); }

.carparty-setup-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.carparty-setup-name {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.carparty-setup-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carparty-start-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.carparty-active-players {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

/* ── Scoreboard ── */
.carparty-sb-duration {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.carparty-sb-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-left-width: 4px;
  border-radius: 14px;
  margin-bottom: 8px;
}

.carparty-sb-rank {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-secondary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.carparty-sb-card:first-child .carparty-sb-rank {
  color: var(--accent);
}

.carparty-sb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.carparty-sb-info { flex: 1; min-width: 0; }

.carparty-sb-name {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.carparty-sb-mvp {
  font-size: 12px;
  color: var(--accent);
  background: rgba(255, 215, 0, 0.15);
  padding: 1px 8px;
  border-radius: 8px;
  margin-left: 4px;
}

.carparty-sb-stats {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.carparty-sb-points {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.carparty-sb-points small {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.carparty-sb-total {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-1);
  border-radius: 12px;
}

/* ── Trip Summary ── */
.carparty-summary-celebration {
  text-align: center;
  font-size: 64px;
  margin-bottom: 8px;
  animation: carparty-bounce 0.6s ease-out;
}

@keyframes carparty-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.carparty-summary-duration {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.carparty-awards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.carparty-award {
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.carparty-award.gold {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--accent);
}

.carparty-award.blue {
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--blue);
}

.carparty-award.purple {
  background: rgba(167, 139, 250, 0.1);
  border-color: var(--purple);
}

.carparty-award-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.carparty-award-title {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.carparty-award-player {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.carparty-award-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
}

.carparty-award-value {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.carparty-summary-players {
  margin-top: 16px;
}

/* When car party is active, push bonus FAB up so it doesn't overlap scoreboard FAB */
.bonus-fab.carparty-active {
  bottom: 112px;
}

/* ── Desktop/Mac scrolling fix ── */
/* On larger viewports, allow views to scroll if content overflows */
@media (min-width: 768px) {
  .view {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Car Party FAB (fixed above nav) ── */
.carparty-fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom, 0px));
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #4ecdc4, #2ab7a9);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 28px;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 4px 15px rgba(78,205,196,0.4);
  transition: all 0.2s ease;
  animation: carpartyPulse 3s ease-in-out infinite;
}
.carparty-fab:active {
  transform: scale(0.95);
}
.carparty-fab-emoji {
  font-size: 20px;
}
.carparty-fab-label {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}
@keyframes carpartyPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(78,205,196,0.4); }
  50% { box-shadow: 0 4px 25px rgba(78,205,196,0.6); }
}

/* ── Car Party Tutorial Overlay ── */
.carparty-tutorial {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}
.tutorial-card {
  background: var(--surface-primary, #1a2a3a);
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
}
.tutorial-emoji {
  font-size: 56px;
  margin-bottom: 12px;
}
.tutorial-title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tutorial-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}
.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.tutorial-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}
.tutorial-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ═══ Multiplayer Overlay ═══ */
#mp-overlay {
  position: absolute;
  top: calc(60px + var(--safe-top, 0px));
  right: 8px;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 8px 12px;
  z-index: 50;
  cursor: pointer;
  border: 1px solid var(--border);
  min-width: 100px;
}

/* ═══ Multiplayer Leaderboard ═══ */
.mp-lb-category {
  margin-bottom: 20px;
}
.mp-lb-category-title {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.mp-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-1);
  border-radius: 12px;
  margin-bottom: 6px;
}
.mp-lb-row.first {
  background: linear-gradient(135deg, rgba(245,166,35,0.15), rgba(245,166,35,0.05));
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(255,215,0,0.2);
}
.mp-lb-medal { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.mp-lb-name { flex: 1; font-weight: 700; color: var(--text-primary); font-size: 15px; }
.mp-lb-stat { font-weight: 700; color: var(--accent); font-size: 16px; flex-shrink: 0; }

/* ═══ Route Planner ═══ */

/* Route header link — sits in country tabs row */
.route-header-link {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  background: var(--surface-primary);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.route-header-link:active {
  background: rgba(255,255,255,0.1);
}

/* Route banner at top of map */
.route-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.9), rgba(96,165,250,0.9));
  backdrop-filter: blur(8px);
  color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  border-bottom: 2px solid rgba(255,255,255,0.2);
}
.route-banner-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.route-banner-close {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Route state highlight on SVG map */
.route-state path,
path.route-state {
  stroke: var(--accent) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 4px var(--accent));
}
g.route-state path {
  stroke: var(--accent) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 4px var(--accent));
}

/* Route planner body styles */
.route-input-section {
  padding: 16px;
}
.route-input-wrap {
  margin-bottom: 16px;
}
.route-input-label {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.route-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--surface-2);
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.route-input:focus {
  border-color: var(--accent);
}
.route-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}
.route-suggestions {
  background: var(--bg-secondary);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 160px;
  overflow-y: auto;
  display: none;
}
.route-suggestions.visible {
  display: block;
}
.route-suggestion {
  padding: 10px 14px;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--surface-1);
}
.route-suggestion:last-child {
  border-bottom: none;
}
.route-suggestion:active {
  background: var(--surface-2);
}
.route-show-btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.1s;
}
.route-show-btn:active {
  transform: scale(0.97);
}
.route-show-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Route results */
.route-result {
  margin: 16px;
  padding: 20px;
  background: var(--surface-1);
  border-radius: 16px;
  border: 2px solid rgba(96,165,250,0.3);
}
.route-result-title {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.route-states-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.route-state-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: white;
  background: var(--surface-2);
}
.route-state-pill.spotted {
  background: var(--collected);
}
.route-state-pill.start {
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
}
.route-state-pill.end {
  background: linear-gradient(135deg, #F472B6, #DB2777);
}
.route-arrow {
  color: var(--text-secondary);
  font-size: 14px;
}
.route-progress-text {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.route-progress-bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 16px;
}
.route-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--collected), #60A5FA);
  border-radius: 5px;
  transition: width 0.3s ease;
}
.route-action-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.route-action-btns .action-btn {
  flex: 1;
}
.route-clear-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--coral);
  background: transparent;
  color: var(--coral);
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.route-clear-btn:active {
  background: var(--coral-soft);
}

/* Sync Quiz Podium */
.sync-podium { display:flex; align-items:flex-end; justify-content:center; gap:8px; height:200px; margin-bottom:16px; }
.sync-podium-spot { display:flex; flex-direction:column; align-items:center; opacity:0; transform:translateY(40px); animation:podiumRise 0.5s ease-out forwards; }
@keyframes podiumRise { to { opacity:1; transform:translateY(0); } }
@keyframes barGrow { from { width:0%; } }
.podium-bar { width:80px; border-radius:8px 8px 0 0; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding-top:8px; }
@media (prefers-reduced-motion: reduce) { .sync-podium-spot { opacity:1; transform:none; animation:none; } }

/* ── Dramatic Quiz Results ── */
@keyframes dramaticPodiumRise {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes goldGlow {
  0% { box-shadow: 0 0 0 rgba(245,166,35,0); }
  50% { box-shadow: 0 0 30px rgba(245,166,35,0.6); }
  100% { box-shadow: 0 0 15px rgba(245,166,35,0.3); }
}
@keyframes drumroll {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@keyframes slamIn {
  0% { transform: scale(3); opacity: 0; }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dramatic-overlay {
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.98);
  display: flex; align-items: center; justify-content: center;
  z-index: 450;
  backdrop-filter: blur(12px);
  overflow-y: auto;
}
.dramatic-overlay .dramatic-inner {
  max-width: 380px; width: 92%; text-align: center;
  padding: 24px 0;
}

.dramatic-drumroll {
  font-size: 28px; font-weight: 800;
  color: var(--text-muted);
  font-family: 'Baloo 2', cursive;
  animation: drumroll 0.5s ease-in-out infinite;
}
.dramatic-reveal {
  font-size: 36px; font-weight: 800;
  color: var(--accent);
  font-family: 'Baloo 2', cursive;
  animation: slamIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

.dramatic-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 6px; height: 240px; margin: 20px 0 16px; position: relative;
}
.dramatic-podium-spot {
  display: flex; flex-direction: column; align-items: center;
  animation: dramaticPodiumRise 0.6s ease-out forwards;
  opacity: 0;
}
.dramatic-podium-spot.third { animation-delay: 0.3s; }
.dramatic-podium-spot.second { animation-delay: 0.6s; }
.dramatic-podium-spot.first { animation-delay: 1.2s; }
.dramatic-podium-spot .podium-avatar { font-size: 20px; margin-bottom: 2px; }
.dramatic-podium-spot .podium-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  font-family: 'Baloo 2', cursive; margin-bottom: 2px;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dramatic-podium-spot .podium-score {
  font-size: 11px; color: var(--text-secondary); margin-bottom: 4px;
}
.dramatic-podium-spot .podium-bar {
  width: 90px; border-radius: 10px 10px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  font-family: 'Baloo 2', cursive; padding-top: 10px;
}
.dramatic-podium-spot.first .podium-bar {
  background: linear-gradient(180deg, #FFD700, #F5A623);
  height: 140px;
  animation: goldGlow 2s ease-in-out infinite;
}
.dramatic-podium-spot.second .podium-bar {
  background: linear-gradient(180deg, #C0C0C0, #9CA3AF);
  height: 100px;
}
.dramatic-podium-spot.third .podium-bar {
  background: linear-gradient(180deg, #CD7F32, #A0522D);
  height: 70px;
}

.dramatic-stats-card {
  background: var(--surface-secondary);
  border-radius: 12px; padding: 12px 14px;
  margin-bottom: 8px; text-align: left;
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
}
.dramatic-stats-card .stats-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.dramatic-stats-card .stats-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  font-family: 'Baloo 2', cursive;
}
.dramatic-stats-card .stats-rank {
  font-size: 12px; color: var(--accent); font-weight: 700;
}
.dramatic-stats-card .stats-detail {
  font-size: 11px; color: var(--text-secondary);
}

.dramatic-reactions {
  display: flex; gap: 8px; justify-content: center;
  margin: 16px 0;
}
.dramatic-reactions button {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 14px;
  font-size: 13px; cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.15s, background 0.15s;
}
.dramatic-reactions button:active {
  transform: scale(0.92);
  background: var(--accent);
  color: #000;
}

@media (prefers-reduced-motion: reduce) {
  .dramatic-podium-spot { opacity: 1; transform: none; animation: none; }
  .dramatic-drumroll { animation: none; }
  .dramatic-reveal { opacity: 1; animation: none; }
  .dramatic-stats-card { opacity: 1; animation: none; }
}

/* ── Car Party Illustration ── */
.car-party-illustration { user-select: none; }
.car-bouncing {
  animation: carBounce 2s ease-in-out infinite;
}
@keyframes carBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-3px) rotate(-0.5deg); }
  75% { transform: translateY(-2px) rotate(0.5deg); }
}
.car-celebrating {
  animation: carCelebrate 0.5s ease-in-out 3;
}
@keyframes carCelebrate {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-8px) rotate(-2deg); }
  75% { transform: translateY(-5px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .car-bouncing, .car-celebrating { animation: none; }
}

/* Quiz Hub scroll hint */
.quiz-scroll-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px;
  opacity: 1;
  transition: opacity 0.3s;
  animation: scrollHintPulse 2s ease-in-out infinite;
}
@keyframes scrollHintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   First-Play Tutorial Overlay
   ═══════════════════════════════════════════════════════════ */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 501;
  pointer-events: none;
}
.tutorial-overlay > * {
  pointer-events: auto;
}
.tutorial-overlay-clear {
  background: rgba(0,0,0,0.4);
}
.tutorial-bubble {
  background: var(--surface-primary, #1E293B);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  text-align: center;
  max-width: 260px;
}
.tutorial-arrow {
  text-align: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  padding: 8px;
  animation: tutorialBounce 1s ease-in-out infinite;
}
@keyframes tutorialBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.tutorial-glow {
  animation: tutorialPulse 1.5s ease-in-out infinite !important;
}
@keyframes tutorialPulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--accent)); opacity: 0.8; }
  50% { filter: drop-shadow(0 0 12px var(--accent)); opacity: 1; }
}
.tutorial-highlight {
  animation: tutorialPulse 1s ease-in-out infinite;
  box-shadow: 0 0 20px var(--accent) !important;
}
.tutorial-got-it {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Baloo 2', cursive;
}
