:root {
  --night: #050816;
  --ink: #F4F1FF;
  --muted: #A9B2D6;
  --glass: rgba(13, 19, 46, 0.72);
  --glass-strong: rgba(11, 16, 40, 0.86);
  --line: rgba(255, 255, 255, 0.13);
  --gold: #FFD54A;
  --orange: #FF9F43;
  --coral: #FF5D73;
  --sky: #5EC8FF;
  --mint: #4ADE9B;
  --violet: #B98CFF;

  --tone-perfect: #4ADE9B;
  --tone-great: #9BE46B;
  --tone-good: #FFD54A;
  --tone-ok: #FFB13D;
  --tone-far: #FF8A4C;
  --tone-lost: #FF5D73;

  --radius: 24px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  background: var(--night);
  color: var(--ink);
  font-family: 'Quicksand', system-ui, sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------- l'espace */

.space {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 12% 8%, rgba(76, 92, 220, 0.32), transparent 70%),
    radial-gradient(ellipse 55% 45% at 88% 92%, rgba(170, 60, 190, 0.26), transparent 70%),
    radial-gradient(ellipse 40% 35% at 85% 15%, rgba(40, 140, 200, 0.16), transparent 70%),
    radial-gradient(ellipse at 50% 50%, #0b1233 0%, var(--night) 75%);
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: grab;
}
.stage.dragging { cursor: grabbing; }
.is-aim .stage { cursor: crosshair; }
.is-aim .stage.dragging { cursor: grabbing; }

.globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.globe-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.marker {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  pointer-events: none;
  transition: opacity 0.15s linear;
}

/* ---------------------------------------------------------- épingle du joueur */

.pin-svg {
  position: absolute;
  width: 32px;
  height: 44px;
  left: -16px;
  top: -43px;
  overflow: visible;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 100%;
}
.pin-svg path { fill: var(--coral); stroke: #fff; stroke-width: 1.8; }
.pin-svg circle { fill: #fff; }
.pin-svg .shine { fill: rgba(255, 255, 255, 0.45); }

.pin-shadow {
  position: absolute;
  width: 16px;
  height: 6px;
  left: -8px;
  top: -3px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.6), transparent 70%);
}

.pin.drop .pin-svg { animation: pinDrop 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.pin.drop .pin-shadow { animation: pinShadow 0.6s ease-out both; }

@keyframes pinDrop {
  0%   { transform: translateY(-80px) scale(0.9); opacity: 0; }
  55%  { transform: translateY(0) scale(1.08, 0.88); opacity: 1; }
  75%  { transform: translateY(-6px) scale(0.97, 1.04); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes pinShadow {
  0%   { transform: scale(0.2); opacity: 0; }
  55%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

.pin.mini .pin-svg { width: 18px; height: 25px; left: -9px; top: -24px; }
.pin.mini .pin-shadow { width: 10px; height: 4px; left: -5px; top: -2px; }

/* ---------------------------------------------------------- la vraie ville */

.city-pin .core,
.city-pin .pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  left: -8px;
  top: -8px;
  border-radius: 50%;
}
.city-pin .core {
  background: radial-gradient(circle at 35% 35%, #FFF6C8, var(--gold) 55%, #E8A317);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.35), 0 0 22px rgba(255, 213, 74, 0.9);
}
.city-pin .pulse {
  border: 2px solid var(--gold);
  animation: pulse 2.2s ease-out infinite;
}
.city-pin .pulse.p2 { animation-delay: 1.1s; }
@keyframes pulse {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(4.2); opacity: 0; }
}

.city-pin .tag {
  position: absolute;
  left: 14px;
  top: -16px;
  white-space: nowrap;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1.5px solid rgba(255, 213, 74, 0.75);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.city-pin.drop .core { animation: popIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.city-pin.drop .tag { animation: tagIn 0.5s 0.15s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes tagIn { from { opacity: 0; transform: translateX(-10px) scale(0.8); } to { opacity: 1; transform: none; } }

.city-pin.mini .core { width: 11px; height: 11px; left: -5.5px; top: -5.5px; border-width: 2px; }
.city-pin.mini .pulse { width: 11px; height: 11px; left: -5.5px; top: -5.5px; }
.city-pin.mini .pulse.p2 { display: none; }
.city-pin.mini .tag { font-size: 12px; left: 10px; top: -12px; padding: 1px 8px; }

.dist-tag span {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #2B1A00;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(255, 159, 67, 0.45);
  animation: popIn 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* ---------------------------------------------------------- points dorés (mode Monuments) */

.spot .spot-core,
.spot .spot-ring {
  position: absolute;
  width: 28px;
  height: 28px;
  left: -14px;
  top: -14px;
  border-radius: 50%;
}
.spot .spot-core {
  display: grid;
  place-items: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  color: #3A2600;
  background: radial-gradient(circle at 35% 30%, #FFF6C8, var(--gold) 55%, #E8A317);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.3), 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 213, 74, 0.6);
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.25s, box-shadow 0.25s;
}
.spot .spot-ring {
  border: 2px solid var(--gold);
  animation: spotPulse 2.4s ease-out infinite;
}
@keyframes spotPulse {
  from { transform: scale(1); opacity: 0.85; }
  to   { transform: scale(2.1); opacity: 0; }
}
.spot .tag {
  position: absolute;
  left: 22px;
  top: -14px;
  display: none;
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1.5px solid var(--tone);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.spot.selected .spot-core {
  transform: scale(1.3);
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #FF9BAA, var(--coral) 60%, #D63A55);
  box-shadow: 0 0 0 4px rgba(255, 93, 115, 0.35), 0 0 26px rgba(255, 93, 115, 0.85);
  animation: spotPick 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.spot.selected .spot-ring { border-color: var(--coral); }
@keyframes spotPick { 0% { transform: scale(0.8); } 60% { transform: scale(1.45); } 100% { transform: scale(1.3); } }

.spot.wrong .spot-core { animation: spotShake 0.6s ease-in-out; background: var(--coral); color: #fff; }
@keyframes spotShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.spot.filled { --tone: var(--mint); }
.spot.filled.missed { --tone: var(--tone-far); }
.spot.filled .spot-ring { display: none; }
.spot.filled .spot-core {
  width: 36px;
  height: 36px;
  left: -18px;
  top: -18px;
  font-size: 19px;
  background: var(--glass-strong);
  border-color: var(--tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 30%, transparent), 0 6px 16px rgba(0, 0, 0, 0.5);
  animation: popIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.spot.filled .tag { display: block; animation: tagIn 0.45s 0.1s cubic-bezier(0.3, 1.4, 0.5, 1) both; }

/* ---------------------------------------------------------- barre du haut */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.glass, .back, .hud, .icon-btn, .zoom button, .coords, .toast {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s;
}
.back:hover { background: rgba(255, 255, 255, 0.14); }

.hud {
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
}
.hud b {
  color: var(--ink);
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
}
.hud-round span { color: var(--muted); }
.hud-total b { color: var(--gold); }
.hud-total i { font-style: normal; }

.dots {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dots li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.3s, transform 0.3s;
}
.dots li.current {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  animation: dotPulse 1.4s ease-in-out infinite;
}
@keyframes dotPulse { 50% { transform: scale(1.3); } }
.dots li.done { transform: scale(1.05); }
.tone-perfect { --tone: var(--tone-perfect); }
.tone-great   { --tone: var(--tone-great); }
.tone-good    { --tone: var(--tone-good); }
.tone-ok      { --tone: var(--tone-ok); }
.tone-far     { --tone: var(--tone-far); }
.tone-lost    { --tone: var(--tone-lost); }
.dots li.done { background: var(--tone); }

.icon-btn {
  flex: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  transition: background 0.2s;
}
.hud:not([hidden]) + .icon-btn { margin-left: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------------------------------------------------------- zoom, coordonnées */

.zoom {
  position: fixed;
  right: 18px;
  top: 50%;
  translate: 0 -50%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoom button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.zoom button:hover { background: rgba(255, 255, 255, 0.16); }
.zoom button:active { transform: scale(0.92); }
#zoomHome { font-size: 19px; }
.is-intro .zoom, .is-loading .zoom { display: none; }

.coords {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 15;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.coords.show { opacity: 1; }

/* ---------------------------------------------------------- chargement */

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, #0b1233, var(--night) 70%);
  transition: opacity 0.6s, visibility 0.6s;
}
.loader.hide { opacity: 0; visibility: hidden; }
.loader p {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  color: var(--muted);
}
.loader-orbit {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  animation: spin 3s linear infinite;
}
.loader-orbit span { font-size: 54px; animation: spin 3s linear infinite reverse; }
.loader-orbit i {
  position: absolute;
  top: -14px;
  left: 50%;
  margin-left: -13px;
  font-size: 26px;
  font-style: normal;
  transform: rotate(45deg);
}
@keyframes spin { to { rotate: 360deg; } }

/* ---------------------------------------------------------- panneaux */

.panel {
  position: fixed;
  z-index: 10;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.panel.enter { animation: panelIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes panelIn {
  from { opacity: 0; translate: 0 28px; }
  to   { opacity: 1; translate: 0 0; }
}

.kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
}

/* --- accueil */
.title {
  margin: 0 0 10px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  background: linear-gradient(95deg, #FFE98A 0%, var(--gold) 30%, var(--orange) 62%, var(--coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-pin {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.72em;
  vertical-align: 0.08em;
  color: initial;
  -webkit-text-fill-color: initial;
  animation: titlePin 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes titlePin {
  0%, 60%, 100% { transform: translateY(0); }
  70% { transform: translateY(-14px) rotate(-8deg); }
  80% { transform: translateY(0) scale(1.1, 0.9); }
  88% { transform: translateY(-4px); }
}

.lead {
  margin: 0 0 18px;
  font-size: 16.5px;
  line-height: 1.5;
  color: #D9DDF5;
}
.lead strong { color: #fff; }

.howto {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.howto li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}
.howto span { font-size: 22px; line-height: 1.2; }
.howto p { margin: 0; font-size: 14.5px; line-height: 1.45; color: #CBD1EE; }
.howto strong { color: #fff; }

.modes { display: grid; gap: 12px; margin-bottom: 18px; }
.modes-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 6px 2px -2px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.modes-group:first-child { margin-top: 0; }
.modes-group small {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mode {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 213, 74, 0.45);
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.18), rgba(255, 159, 67, 0.08));
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.mode:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(255, 186, 74, 0.25);
}
.mode:active { transform: translateY(0) scale(0.98); }
.mode-hard {
  border-color: rgba(185, 140, 255, 0.5);
  background: linear-gradient(135deg, rgba(185, 140, 255, 0.2), rgba(255, 93, 115, 0.1));
}
.mode-hard:hover { border-color: var(--violet); box-shadow: 0 12px 32px rgba(185, 140, 255, 0.25); }
.mode-wonder {
  border-color: rgba(74, 222, 155, 0.5);
  background: linear-gradient(135deg, rgba(74, 222, 155, 0.2), rgba(94, 200, 255, 0.1));
}
.mode-wonder:hover { border-color: var(--mint); box-shadow: 0 12px 32px rgba(74, 222, 155, 0.25); }
.mode-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.1);
}
.mode-text { flex: 1; display: grid; gap: 2px; }
.mode-text strong { font-family: 'Baloo 2', sans-serif; font-size: 20px; line-height: 1.1; }
.mode-text small { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.mode-best {
  flex: none;
  font-size: 12px;
  text-align: right;
  color: var(--muted);
  line-height: 1.3;
}
.mode-best b { color: var(--gold); font-size: 14px; }

/* --- classement */
.board { margin-top: 20px; }
.board-title {
  margin: 0 0 8px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.board-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.board-tabs button {
  flex: 1;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.board-tabs button.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.board-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.board-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}
.board-rank { width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-km { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.board-list li.board-empty { justify-content: center; color: var(--muted); }

/* --- boutons */
.actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}
.btn small { font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 700; opacity: 0.75; }
.btn.primary {
  color: #2B1A00;
  background: linear-gradient(135deg, #FFE27A, var(--gold) 40%, var(--orange));
  box-shadow: 0 10px 26px rgba(255, 159, 67, 0.35), 0 -3px 0 rgba(0, 0, 0, 0.12) inset;
}
.btn.primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255, 159, 67, 0.5), 0 -3px 0 rgba(0, 0, 0, 0.12) inset; }
.btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.42; cursor: default; filter: saturate(0.4); }
.btn.wide { width: 100%; margin-top: 18px; }

/* Le bouton pour continuer reste toujours visible en bas du panneau. */
.sticky-actions {
  position: sticky;
  bottom: -26px;
  z-index: 2;
  margin: 18px -26px -26px;
  padding: 14px 26px 22px;
  background: linear-gradient(to bottom, rgba(12, 17, 42, 0), rgba(12, 17, 42, 0.92) 30%);
}
.sticky-actions .btn.wide { margin-top: 0; }

/* --- viser */
.play { text-align: center; }
.ask {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
}
.ask-city {
  margin: 2px 0 2px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 4px 24px rgba(94, 200, 255, 0.35);
}
.ask-country {
  margin: 0;
  font-size: 17px;
  color: #D9DDF5;
}
.tip {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.tip b { color: #fff; font-variant-numeric: tabular-nums; }
.tip .clue {
  display: block;
  margin-bottom: 6px;
  font-style: normal;
  font-size: 16px;
  line-height: 1.45;
  color: #F1F3FF;
}
.tip .clue::before { content: '« '; color: var(--gold); }
.tip .clue::after { content: ' »'; color: var(--gold); }
.kind-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 213, 74, 0.16);
  border: 1px solid rgba(255, 213, 74, 0.45);
  color: #FFE9A3;
}
.kind-badge.kind-nature {
  background: rgba(74, 222, 155, 0.14);
  border-color: rgba(74, 222, 155, 0.45);
  color: #B8F5D8;
}
.tip span { font-size: 13px; }
.gold { color: var(--gold) !important; }

.fi {
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  vertical-align: -0.1em;
}

/* --- résultat */
.verdict {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 2px 12px;
}
.verdict-emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 42px;
  background: color-mix(in srgb, var(--tone, var(--gold)) 22%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone, var(--gold)) 50%, transparent);
  transform: scale(0);
}
.verdict.show .verdict-emoji { animation: popIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
.verdict-label {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  color: var(--tone, var(--gold));
  opacity: 0;
}
.verdict-label.pop { animation: tagIn 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }
.verdict-km {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  color: var(--muted);
}
.verdict-km b {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.verdict-penalty { margin: 0; font-size: 13px; color: var(--orange); }
.compare {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(94, 200, 255, 0.1);
  font-size: 14px;
  line-height: 1.4;
  color: #CFEAFF;
}

.city-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.city-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.city-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 34px;
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.3), rgba(255, 93, 115, 0.25));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.city-head h3 {
  margin: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.05;
}
.city-head p { margin: 2px 0 0; font-size: 15px; color: #D9DDF5; }

.city-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.city-facts div {
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}
.city-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.city-facts dd { margin: 0; font-size: 14px; line-height: 1.3; font-variant-numeric: tabular-nums; }

.city-habitat {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(74, 222, 155, 0.12);
  border: 1px solid rgba(74, 222, 155, 0.3);
  font-size: 14.5px;
  color: #CFF7E3;
}
.city-habitat b { color: #fff; }

.city-hemi {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--sky);
  font-size: 13.5px;
  line-height: 1.45;
  color: #CFEAFF;
}

.dyk-title {
  margin: 0 0 8px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  color: var(--gold);
}
.dyk { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.dyk li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
  line-height: 1.5;
  color: #E6E8F7;
}
.dyk li::before { content: '✨'; position: absolute; left: 0; top: 0; }

/* --- fin */
.end { text-align: center; }
.rank-emoji {
  display: inline-block;
  font-size: 64px;
  line-height: 1.1;
  animation: rankIn 0.8s cubic-bezier(0.3, 1.6, 0.5, 1) both, float 3s 0.8s ease-in-out infinite;
}
@keyframes rankIn { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
@keyframes float { 50% { transform: translateY(-6px); } }
.rank-title {
  margin: 4px 0 4px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 1.1;
  background: linear-gradient(95deg, #FFE98A, var(--orange), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rank-text { margin: 0 0 14px; font-size: 15px; color: #D9DDF5; line-height: 1.45; }
.end-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: 'Baloo 2', sans-serif;
  color: var(--muted);
}
.end-total b {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 30px rgba(255, 213, 74, 0.35);
}
.end-best { margin: 6px 0 16px; font-size: 14px; color: var(--muted); }
.end > .actions { margin: 0 0 18px; }
.end-best b { color: var(--mint); }

.recap {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  text-align: left;
}
.recap button {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-left: 4px solid var(--tone);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 15px;
  transition: background 0.2s, transform 0.15s;
}
.recap button:hover { background: rgba(255, 255, 255, 0.11); transform: translateX(3px); }
.recap-n {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
}
.recap-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-name i { font-style: normal; font-size: 13px; }
.recap-km { color: var(--tone); font-weight: 700; font-variant-numeric: tabular-nums; }
.recap-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.score-form { margin-top: 18px; text-align: left; }
.score-form label { display: block; margin-bottom: 8px; font-size: 14px; color: #D9DDF5; }
.score-row { display: flex; gap: 8px; }
.score-row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
}
.score-row input::placeholder { color: var(--muted); }
.score-row .btn { flex: none; }
.score-msg { margin: 12px 0 0; font-weight: 700; }
.score-msg.ok { color: var(--mint); }
.score-msg.ko { color: var(--coral); }

/* ---------------------------------------------------------- photos des lieux */

.photo { margin: 0; }
.photo-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 70%) 0 0 / 300% 100%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.photo.loading .photo-btn { animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.photo-btn::before {
  /* La même photo, floutée, remplit le cadre : la vraie photo est montrée
     en entier par-dessus, sans couper la tête des animaux. */
  content: '';
  position: absolute;
  inset: -24px;
  background: var(--photo, none) center / cover;
  filter: blur(18px) brightness(0.65) saturate(1.2);
}
.photo-btn img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s, opacity 0.4s;
}
.photo.loading img { opacity: 0; }
.photo-btn:hover img { transform: scale(1.05); }
.photo-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  color: #fff;
  background: rgba(5, 8, 22, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.photo figcaption {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo figcaption a, .lightbox a { color: inherit; }

.ask-photo { height: 150px; margin-bottom: 12px; }
.ask-photo .photo-btn { height: calc(100% - 19px); }
.card-photo { height: 190px; margin: -4px -4px 16px; }
.card-photo .photo-btn { height: calc(100% - 19px); }

/* Sur grand écran : la photo à gauche, la question à droite. */
@media (min-width: 900px) {
  .play.has-photo {
    display: grid;
    grid-template-columns: 220px 1fr;
    column-gap: 20px;
    align-items: start;
    width: min(700px, calc(100vw - 180px));
    text-align: left;
  }
  .play.has-photo > * { grid-column: 2; }
  .play.has-photo .ask-photo {
    grid-column: 1;
    grid-row: 1 / span 5;
    height: 100%;
    min-height: 190px;
    margin: 0;
  }
  .play.has-photo .actions { margin-top: 14px; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(56px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(3, 5, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.lightbox figure {
  margin: 0;
  max-width: min(1000px, 100%);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 190px);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: popIn 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.lightbox figcaption { display: grid; gap: 4px; text-align: center; }
.lightbox figcaption strong { font-family: 'Baloo 2', sans-serif; font-size: 22px; }
.lightbox figcaption span { font-size: 15px; color: #D9DDF5; }
.lightbox figcaption small { font-size: 12px; color: var(--muted); }
.lightbox-close {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  font-size: 18px;
}

.intro-foot { margin: 16px 0 0; text-align: center; font-size: 13px; }
.intro-foot a { color: var(--muted); }

/* ---------------------------------------------------------- toast & confettis */

.toast {
  position: fixed;
  left: 50%;
  top: calc(76px + var(--safe-top));
  z-index: 40;
  translate: -50% -20px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, translate 0.3s;
}
.toast.show { opacity: 1; translate: -50% 0; }

.confetti {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

/* ---------------------------------------------------------- grand écran */

@media (min-width: 900px) {
  .intro {
    left: 36px;
    top: 50%;
    width: 450px;
    max-height: calc(100dvh - 110px);
    transform: translateY(-46%);
  }
  .play {
    left: 50%;
    bottom: 26px;
    width: min(560px, calc(100vw - 180px));
    transform: translateX(-50%);
  }
  .result, .end {
    right: 26px;
    top: 82px;
    bottom: 26px;
    width: 410px;
  }
  .is-reveal .zoom, .is-end .zoom { right: auto; left: 18px; }
}

/* ---------------------------------------------------------- téléphone */

@media (max-width: 899px) {
  .panel {
    left: 10px;
    right: 10px;
    bottom: calc(10px + var(--safe-bottom));
    padding: 20px 18px;
    border-radius: 22px;
  }
  .intro { max-height: 66dvh; }
  .sticky-actions { bottom: -20px; margin: 14px -18px -20px; padding: 12px 18px 16px; }
  .result { max-height: 56dvh; }
  .end { max-height: 64dvh; }
  .play { padding: 16px 16px 14px; }

  .zoom { top: calc(76px + var(--safe-top)); translate: none; right: 12px; }
  .zoom button { width: 42px; height: 42px; font-size: 20px; }
  .coords { display: none; }

  .hud { gap: 10px; padding: 0 14px; }
  .back span { display: none; }
  .back { padding: 0 14px; }

  .title { font-size: 2.3rem; }
  .lead { font-size: 15px; margin-bottom: 14px; }
  .howto { gap: 6px; }
  .howto li { padding: 8px 12px; }
  .howto p { font-size: 13.5px; }

  .ask-city { font-size: 2rem; }
  .ask-country { font-size: 16px; }
  .tip { margin-top: 8px; font-size: 13px; }
  .tip .clue { font-size: 14.5px; margin-bottom: 4px; }
  .card-photo { height: 120px; margin-bottom: 12px; }

  /* Monuments et Safari : une carte compacte pour laisser la place au globe.
     Petite vignette à gauche du nom (on la touche pour l'agrandir), la
     devinette et le bouton en dessous. */
  .play.has-photo {
    display: grid;
    grid-template-columns: 76px 1fr;
    column-gap: 12px;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
  }
  .play.has-photo > * { grid-column: 1 / -1; }
  .play.has-photo .ask { display: none; }
  .play.has-photo .ask-photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 76px;
    height: 76px;
    margin: 0;
  }
  .play.has-photo .ask-photo .photo-btn { height: 100%; border-radius: 14px; }
  .play.has-photo .ask-photo img { object-fit: cover; }
  .play.has-photo .ask-photo figcaption { display: none; }
  .play.has-photo .photo-zoom { width: 22px; height: 22px; right: 4px; bottom: 4px; font-size: 12px; }
  .play.has-photo .ask-city { grid-column: 2; align-self: end; margin: 0; font-size: 1.45rem; line-height: 1.15; }
  .play.has-photo .ask-country { grid-column: 2; align-self: start; margin-top: 4px; }
  .play.has-photo .kind-badge { padding: 2px 10px; font-size: 12px; }
  .play.has-photo .tip { margin-top: 10px; }
  .play.has-photo .tip .clue { font-size: 14px; line-height: 1.35; }
  .play.has-photo .tip-action { font-size: 12px; }
  .play.has-photo .actions { margin-top: 10px; }
  .play.has-photo .btn { min-height: 44px; }

  .result:has(.card-photo:not([hidden])) { max-height: 48dvh; }
  .result:has(.card-photo:not([hidden])) .verdict { padding-bottom: 8px; }
  .result:has(.card-photo:not([hidden])) .verdict-emoji { width: 50px; height: 50px; font-size: 28px; border-radius: 14px; }
  .result:has(.card-photo:not([hidden])) .verdict-label { font-size: 19px; }
  .result:has(.card-photo:not([hidden])) .verdict-km b { font-size: 30px; }
  .result:has(.card-photo:not([hidden])) .compare { margin-bottom: 12px; padding: 8px 12px; font-size: 13px; }
  .actions { margin-top: 12px; }
  .btn { min-height: 48px; font-size: 17px; padding: 10px 14px; }
  .btn small { font-size: 11px; }

  .verdict-emoji { width: 62px; height: 62px; font-size: 34px; border-radius: 18px; }
  .verdict-km b { font-size: 38px; }
  .city-head h3 { font-size: 24px; }
  .city-icon { width: 52px; height: 52px; font-size: 28px; }
  .rank-emoji { font-size: 52px; }
  .rank-title { font-size: 27px; }
  .end-total b { font-size: 46px; }
}

@media (max-width: 520px) {
  .dots { display: none; }
  .hud-total span { display: none; }

  .mode { flex-wrap: wrap; gap: 4px 12px; padding: 12px 14px; }
  .mode-icon { width: 44px; height: 44px; font-size: 24px; border-radius: 14px; }
  .mode-text strong { font-size: 18px; }
  .mode-text small { font-size: 12.5px; }
  .mode-best:not(:empty) { flex-basis: 100%; padding-left: 56px; text-align: left; }
  .mode-best br { display: none; }

  .spot .tag { font-size: 11px; padding: 0 7px; left: 18px; top: -11px; }
  .spot.filled .spot-core { width: 30px; height: 30px; left: -15px; top: -15px; font-size: 16px; }
  .city-pin .tag { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
