:root {
  color-scheme: light;
  --navy:        #1a2535;
  --navy-light:  #2d3f5a;
  --blue:        #2b6cb0;
  --green:       #27ae60;
  --green-light: #d4edda;
  --red:         #e74c3c;
  --red-light:   #fde8e6;
  --cream:       #f5f2ed;
  --white:       #ffffff;
  --border:      #e2ddd8;
  --muted:       #718096;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--navy);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leaflet-interactive:focus { outline: none; }

/* ── Overlay (config + résultat) ─────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 37, 53, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.hidden { display: none; }

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.card h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.card .subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Config ───────────────────────────────────────────────────────────────── */

.config-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  margin-bottom: 10px;
}

.opt-group {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.opt-btn {
  flex: 1;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  transition: all 0.15s;
  white-space: nowrap;
}

.opt-btn:hover  { border-color: var(--blue); color: var(--blue); }
.opt-btn.active { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ── Boutons ──────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  padding: 11px 28px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--navy-light); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  padding: 11px 24px;
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  margin-left: 8px;
}

.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* ── Header de jeu ────────────────────────────────────────────────────────── */

.game-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
  z-index: 10;
}

.back-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}
.back-link:hover { color: #fff; }

.game-title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  letter-spacing: 0.02em;
}

#progress {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}

#score-display {
  font-size: 0.85rem;
  color: #6fcf97;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ── Zone question ────────────────────────────────────────────────────────── */

#question-area {
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-align: center;
}

.question-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.question-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.01em;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */

#map { flex: 1; }

/* ── Footer de jeu ────────────────────────────────────────────────────────── */

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-top: 1px solid var(--border);
  min-height: 62px;
  flex-shrink: 0;
}

.feedback {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  line-height: 1.4;
}

.feedback.correct { background: var(--green-light); color: var(--green); }
.feedback.wrong   { background: var(--red-light);   color: var(--red);   }
.feedback.empty   { background: transparent; color: transparent; }

/* ── Résultat ─────────────────────────────────────────────────────────────── */

.result-emoji  { font-size: 2.8rem; margin-bottom: 12px; }
.result-score  { font-size: 2.4rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.result-pct    { font-size: 1rem; color: var(--muted); margin-bottom: 28px; }
.result-actions { display: flex; justify-content: center; gap: 8px; }
