/* ============================================================
   VERRAMAZING RACE — Global Styles
   Colors: Gold #d9ad27 | Black #000000 | White #ffffff
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --gold: #d9ad27;
  --gold-dark: #b8911e;
  --gold-light: #f0c94a;
  --black: #000000;
  --black-soft: #0d0d0d;
  --black-card: #111111;
  --black-card2: #1a1a1a;
  --white: #ffffff;
  --grey: #888888;
  --grey-light: #cccccc;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 30px rgba(217,173,39,0.3);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--black-soft);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

.gold-text { color: var(--gold); }
.white-text { color: var(--white); }
.grey-text { color: var(--grey); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217,173,39,0.2);
  padding: 1rem 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 0.75rem; }
.nav-logo img { height: 40px; width: auto; }
.nav-logo-text { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--white); }
.nav-links a:hover { color: var(--gold); }
.nav-team-badge {
  background: var(--gold);
  color: var(--black);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--gold);
  color: var(--black);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gold-light);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-2px);
}
.btn-dark {
  background: var(--black-card2);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-dark:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: var(--gold);
}
.btn-danger {
  background: var(--error);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-lg { padding: 1rem 2.5rem; font-size: 1.15rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ── Cards ── */
.card {
  background: var(--black-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-gold {
  border-color: rgba(217,173,39,0.4);
  box-shadow: var(--shadow-gold);
}
.card-header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.card-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--gold); }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--grey-light); text-transform: uppercase; letter-spacing: 0.05em; }
.form-input, .form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--black-card2);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,173,39,0.2);
}
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-error { color: var(--error); font-size: 0.85rem; font-weight: 600; }
.form-success { color: var(--success); font-size: 0.85rem; font-weight: 600; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../hero.jpg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
  transform: scale(1.05);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(217,173,39,0.1) 50%, rgba(0,0,0,0.8) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.hero-logo { height: 80px; width: auto; margin: 0 auto 2rem; }
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}
.hero-subtitle {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--gold);
  margin: 1rem 0 2rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-cta { font-size: 1.2rem; padding: 1.1rem 3rem; }

/* ── Passport Stamps ── */
.passport-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--gold);
  transform: rotate(-15deg);
  opacity: 0.7;
  flex-shrink: 0;
}

/* ── Page Header ── */
.page-header {
  padding: 7rem 0 3rem;
  background: linear-gradient(180deg, var(--black-soft) 0%, var(--black-card) 100%);
  border-bottom: 1px solid rgba(217,173,39,0.2);
}
.page-header-inner { display: flex; align-items: center; gap: 1.5rem; }
.page-breadcrumb { font-size: 0.85rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.page-title-main { color: var(--white); }

/* ── Countdown Timer ── */
.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 0.05em;
  color: var(--white);
  transition: color 0.5s ease;
  text-shadow: 0 0 40px rgba(217,173,39,0.4);
}
.timer-display.warning { color: var(--warning); text-shadow: 0 0 40px rgba(245,158,11,0.5); }
.timer-display.danger { color: var(--error); text-shadow: 0 0 40px rgba(239,68,68,0.6); animation: pulse-red 0.5s infinite alternate; }
@keyframes pulse-red { from { opacity: 1; } to { opacity: 0.7; } }

.timer-colon { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.timer-card {
  background: var(--black-card);
  border: 2px solid rgba(217,173,39,0.3);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.timer-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--grey); margin-bottom: 0.5rem; }
.timer-controls { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Quiz ── */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.quiz-progress-dot {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  transition: background var(--transition);
}
.quiz-progress-dot.active { background: var(--gold); }
.quiz-progress-dot.done { background: var(--success); }

.quiz-question-num { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.5rem; }
.quiz-question-text { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; margin-bottom: 2rem; line-height: 1.4; }

.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--black-card2);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
}
.quiz-option:hover:not(:disabled) { border-color: var(--gold); background: rgba(217,173,39,0.08); }
.quiz-option.selected { border-color: var(--gold); background: rgba(217,173,39,0.12); }
.quiz-option.correct { border-color: var(--success); background: rgba(34,197,94,0.12); }
.quiz-option.incorrect { border-color: var(--error); background: rgba(239,68,68,0.12); }
.quiz-option:disabled { cursor: not-allowed; opacity: 0.7; }

.quiz-option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.quiz-option.selected .quiz-option-letter,
.quiz-option:hover:not(:disabled) .quiz-option-letter { background: var(--gold); color: var(--black); }

.quiz-lockout {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  margin-top: 1rem;
  color: var(--error);
  font-weight: 600;
}
.quiz-lockout.visible { display: flex; }
.quiz-lockout-timer { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; }

/* ── Video Challenge ── */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-answer-form { display: flex; flex-direction: column; gap: 1rem; }

/* ── Photo Challenge ── */
.photo-challenge {
  background: rgba(217,173,39,0.08);
  border: 1px solid rgba(217,173,39,0.25);
  border-radius: var(--radius);
  padding: 2rem;
}
.photo-challenge-icon { font-size: 3rem; margin-bottom: 1rem; }
.photo-challenge h3 { color: var(--gold); margin-bottom: 0.75rem; }
.photo-challenge-instruction { color: rgba(255,255,255,0.9); line-height: 1.7; margin-bottom: 1.5rem; }
.teams-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  background: rgba(100,100,255,0.15);
  border: 1px solid rgba(100,100,255,0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9b9bff;
  margin-bottom: 1.5rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
}
.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── Challenge Steps ── */
.challenge-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.challenge-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.challenge-step.active {
  background: rgba(217,173,39,0.15);
  border-color: var(--gold);
  color: var(--gold);
}
.challenge-step.done {
  background: rgba(34,197,94,0.12);
  border-color: var(--success);
  color: var(--success);
}

/* ── Leaderboard ── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.leaderboard-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-family: var(--font-head);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}
.leaderboard-table tr:hover td { background: rgba(217,173,39,0.05); }
.leaderboard-table tr.first td { background: rgba(217,173,39,0.08); }
.leaderboard-rank {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
}
.leaderboard-rank.rank-1 { color: #ffd700; }
.leaderboard-rank.rank-2 { color: #c0c0c0; }
.leaderboard-rank.rank-3 { color: #cd7f32; }
.team-name-cell { font-weight: 600; }
.team-code { font-size: 0.75rem; color: var(--grey); margin-top: 0.2rem; }

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-racing { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.status-finished { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.status-failed { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.status-detour { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.status-lobby { background: rgba(139,139,139,0.15); color: #9ca3af; border: 1px solid rgba(139,139,139,0.3); }

/* ── Lightbox / Modal ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox-overlay.visible { display: flex; }
.lightbox {
  background: var(--black-card);
  border: 1px solid rgba(217,173,39,0.3);
  border-radius: 20px;
  padding: 3rem;
  max-width: 560px;
  width: 100%;
  text-align: center;
  animation: lightbox-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), var(--shadow-gold);
}
@keyframes lightbox-in {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.lightbox-icon { font-size: 4rem; margin-bottom: 1rem; display: block; }
.lightbox h2 { margin-bottom: 1rem; }
.lightbox p { color: rgba(255,255,255,0.8); margin-bottom: 2rem; line-height: 1.7; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Puzzle ── */
.puzzle-wrapper {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.puzzle-pieces-tray {
  min-width: 200px;
  background: var(--black-card2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1rem;
}
.puzzle-pieces-tray h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey); margin-bottom: 1rem; }
.tray-pieces { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }

.puzzle-board {
  position: relative;
  width: 450px;
  height: 300px;
  background: rgba(255,255,255,0.03);
  border: 2px dashed rgba(217,173,39,0.3);
  border-radius: var(--radius);
  overflow: visible;
}
.puzzle-board.complete {
  border-color: var(--success);
  box-shadow: 0 0 30px rgba(34,197,94,0.3);
}

.puzzle-slot {
  position: absolute;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  transition: all var(--transition);
}
.puzzle-slot.drag-over { border-color: var(--gold); background: rgba(217,173,39,0.1); }
.puzzle-slot.filled { border-color: var(--success); border-style: solid; }

.puzzle-piece {
  cursor: grab;
  border-radius: 8px;
  user-select: none;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.puzzle-piece:active { cursor: grabbing; }
.puzzle-piece.dragging { opacity: 0.6; transform: scale(1.05); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.puzzle-piece.placed { cursor: default; border: 2px solid var(--success); }
.puzzle-piece-inner {
  width: 120px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.8rem;
  text-align: center;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Puzzle piece colors per leg */
.piece-1 .puzzle-piece-inner { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.piece-2 .puzzle-piece-inner { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.piece-3 .puzzle-piece-inner { background: linear-gradient(135deg, #2980b9, #3498db); }
.piece-4 .puzzle-piece-inner { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.piece-5 .puzzle-piece-inner { background: linear-gradient(135deg, #d35400, #e67e22); }

/* ── Puzzle Collection (on leg pages) ── */
.piece-collection {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}
.piece-icon {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid rgba(255,255,255,0.1);
  opacity: 0.3;
  transition: all var(--transition);
  position: relative;
}
.piece-icon.earned { opacity: 1; border-color: var(--gold); box-shadow: 0 0 15px rgba(217,173,39,0.3); }
.piece-icon.current { opacity: 1; animation: glow-piece 1.5s ease-in-out infinite alternate; }
@keyframes glow-piece {
  from { box-shadow: 0 0 10px rgba(217,173,39,0.4); }
  to { box-shadow: 0 0 30px rgba(217,173,39,0.8); border-color: var(--gold-light); }
}

/* ── Country Banner ── */
.country-banner {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.country-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45);
  transform: scale(1.05);
}
.country-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%);
}
.country-banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}
.country-flag { font-size: 3rem; margin-right: 1rem; }
.country-info {}
.country-leg { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold); margin-bottom: 0.25rem; }
.country-name { font-family: var(--font-head); font-size: 2.5rem; font-weight: 900; color: var(--white); }

/* ── Race Hub Specific ── */
.race-hub-header {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1008 50%, #0a0a0a 100%);
  border-bottom: 2px solid var(--gold);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.hub-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }

.stat-card {
  background: var(--black-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey); margin-top: 0.25rem; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-soft);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.login-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(217,173,39,0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(217,173,39,0.05) 0%, transparent 50%);
}
.login-card {
  background: var(--black-card);
  border: 1px solid rgba(217,173,39,0.2);
  border-radius: 20px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--shadow-gold);
}
.login-logo { height: 60px; width: auto; margin: 0 auto 1.5rem; display: block; }
.login-title { font-family: var(--font-head); font-size: 1.5rem; text-align: center; margin-bottom: 0.5rem; }
.login-subtitle { text-align: center; color: var(--grey); font-size: 0.9rem; margin-bottom: 2rem; }
.login-tabs { display: flex; gap: 0; margin-bottom: 2rem; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.login-tab {
  flex: 1;
  padding: 0.625rem;
  background: transparent;
  border: none;
  color: var(--grey);
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.login-tab.active {
  background: var(--gold);
  color: var(--black);
}

/* ── Detour Page ── */
.detour-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #1a0a00 0%, #0d0d0d 100%);
  padding: 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detour-card {
  max-width: 700px;
  width: 100%;
}
.detour-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(217,173,39,0.1));
  border: 2px solid rgba(245,158,11,0.4);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}
.detour-icon { font-size: 4rem; margin-bottom: 0.75rem; display: block; }
.detour-title { font-family: var(--font-head); font-size: 2rem; font-weight: 900; color: var(--warning); }
.detour-subtitle { color: rgba(255,255,255,0.7); margin-top: 0.5rem; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  from { background-position: -200% center; }
  to { background-position: 200% center; }
}

.fade-in { animation: fadeIn 0.5s ease forwards; }
.slide-in { animation: slideIn 0.4s ease forwards; }
.bounce { animation: bounce 2s ease infinite; }

.gold-shimmer {
  background: linear-gradient(90deg, var(--gold) 25%, var(--gold-light) 50%, var(--gold) 75%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Confetti ── */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Alert / Toast ── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--error); }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: var(--info); }

/* ── Loading Spinner ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(217,173,39,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 8000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.loading-overlay.visible { display: flex; }

/* ── Dividers ── */
.divider { height: 1px; background: rgba(255,255,255,0.08); margin: 2rem 0; }
.divider-gold { background: linear-gradient(to right, transparent, rgba(217,173,39,0.4), transparent); }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.visible { display: block !important; }
.full-width { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--black-soft); }
::-webkit-scrollbar-thumb { background: rgba(217,173,39,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(217,173,39,0.5); }

/* ── Footer ── */
footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--grey);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .puzzle-board { width: 320px; height: 220px; }
  .timer-display { font-size: 3rem; }
  .login-card { padding: 2rem 1.5rem; }
  .lightbox { padding: 2rem 1.5rem; }
  .challenge-steps { gap: 0.35rem; }
  .challenge-step { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .timer-display { font-size: 2.5rem; }
  .country-name { font-size: 1.8rem; }
}
