:root {
  --bg: #0b0f1a;
  --panel-bg: rgba(13, 17, 30, 0.72);
  --panel-border: rgba(126, 211, 33, 0.28);
  --text-dim: #a9b4cc;
  --text: #ffffff;
  --accent: #7ed321;
  --map-active-glow: rgba(126, 211, 33, 0.55);
  --mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  font-family: var(--sans);
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.map-object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(11, 15, 26, 0.15) 0%, rgba(11, 15, 26, 0.55) 70%, rgba(11, 15, 26, 0.85) 100%);
  pointer-events: none;
}

.map-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 140px 40px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* --- Titre du site --- */
.site-title {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: 620px;
  pointer-events: none;
  z-index: 1;
}

.site-title h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.site-title p {
  margin: 10px 0 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* --- Colonne de gauche : regroupe la roulette et la fiche pays --- */
.left-stack {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 2;
}

/* --- Panneau roulette --- */
.wheel-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  backdrop-filter: blur(6px);
  padding: 7px 0 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.wheel-panel-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
  padding: 0 10px 6px;
  border-bottom: 1px solid rgba(126, 211, 33, 0.12);
  margin-bottom: 6px;
}

.country-search {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 6px;
  padding: 5px 6px;
  background: rgba(11, 15, 26, 0.6);
  border: 1px solid rgba(126, 211, 33, 0.2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  outline: none;
  transition: border-color 0.2s ease;
}

.country-search::placeholder {
  color: var(--text-dim);
}

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

.wheel-viewport {
  position: relative;
  height: 135px;
  overflow: hidden;
  cursor: ns-resize;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

.wheel-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 27px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(126, 211, 33, 0.35);
  border-bottom: 1px solid rgba(126, 211, 33, 0.35);
  pointer-events: none;
}

.wheel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wheel-list li {
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, font-weight 0.2s ease;
  user-select: none;
}

.wheel-list li::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wheel-list li.active {
  color: var(--text);
  font-weight: 600;
  text-shadow: 0 0 10px var(--map-active-glow);
}

.wheel-list li.active::before {
  opacity: 1;
  box-shadow: 0 0 5px var(--map-active-glow);
}

.wheel-list li.no-match {
  color: var(--text-dim);
  font-style: italic;
  cursor: default;
}

.wheel-hint {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-align: center;
  padding-top: 6px;
  opacity: 0.5;
}

/* --- Fiche pays --- */
.country-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  padding: 16px 18px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

.card-country-name {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.card-meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  line-height: 1.6;
}

.card-amount-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-amount-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.card-amount-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(126, 211, 33, 0.55);
}

.card-divider {
  height: 1px;
  margin: 16px 0 12px;
  background: rgba(126, 211, 33, 0.18);
}

.card-section-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.age-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.age-row {
  display: grid;
  grid-template-columns: 58px 1fr 46px;
  align-items: center;
  gap: 8px;
}

.age-label {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.age-bar-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.age-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(126, 211, 33, 0.55), var(--accent));
  border-radius: 4px;
}

.age-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.card-empty {
  display: none;
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ==========================================================
   VERSION MOBILE
   La carte garde ses proportions naturelles (paysage) au lieu
   d'être étirée sur toute la hauteur de l'écran (ce qui
   l'écrasait en une bande minuscule). Elle est fixée en haut
   comme une bannière, sur toute la largeur.
   ========================================================== */
@media (max-width: 640px) {

  html, body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
  }

  .stage {
    height: auto;
    min-height: 100vh;
    padding-bottom: 60px;
  }

  .map-object {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: auto;
    aspect-ratio: 784.077 / 458.627;
    inset: auto;
    z-index: 0;
  }

  .map-overlay,
  .map-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vw * 458.627 / 784.077);
    inset: auto;
    z-index: 0;
  }

  .site-title {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    max-width: 100%;
    width: 100%;
    padding: 24px 24px 0;
    z-index: 1;
  }

  .site-title h1 {
    font-size: 22px;
  }

  .site-title p {
    font-size: 8px;
    padding: 0 12px;
    line-height: 1.5;
  }

  .left-stack {
    position: relative;
    top: 0;
    left: 0;
    width: 88%;
    max-width: 300px;
    margin: 16px auto 0;
    padding: 0;
    gap: 10px;
    z-index: 1;
  }

  .wheel-viewport {
    height: 130px;
  }

  .country-card {
    padding: 14px 16px 16px;
  }

  .card-country-name {
    font-size: 22px;
  }

  .card-amount-value {
    font-size: 22px;
  }

  .card-amount-row {
    margin-top: 10px;
  }

  .card-divider {
    margin: 12px 0 10px;
  }

  .age-bars {
    gap: 8px;
  }

}