/* Carte des niveaux (2026-11-22). DA claire, sous la capsule .island (z-index 25). */
:root { --map-ink: #2b2a2e; --map-bg: #f4f2ee; --map-muted: #5f5b6b; --map-idle: #c9c3b6; }

/* La liste des niveaux reste dans la page pour les lecteurs d'ecran, mais ne s'affiche plus. */
.sidebar { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%); padding: 0 !important; transform: none !important; border: 0 !important; box-shadow: none !important; }
.shell { display: block !important; }
.scrim { display: none !important; }
/* Le bouton menu ouvre la carte : visible partout (dans la capsule, .island garde la main). */
.top .menu-btn { display: inline-grid !important; place-items: center; }

.map { position: fixed; inset: 0; z-index: 22; background: var(--map-bg); color: var(--map-ink); font-family: var(--sans); }
.map[hidden] { display: none; }
.map-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.map-view:active { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

.map-head { position: absolute; z-index: 3; top: 0; left: 0; right: 0; box-sizing: border-box; background: var(--map-bg); box-shadow: 0 3px 10px rgba(43,42,46,.14);
  padding: calc(var(--safe-top, 0px) + var(--hud-header-top, 12px)) var(--hud-header-right, 16px) 10px var(--hud-header-left, 16px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
html[data-fold="vertical"] .map-title { max-width: calc(var(--fold-start) - var(--hud-header-left, 16px) - 140px); }
.map-title { display: flex; flex-direction: column; min-width: 0; }
.map-title b { font: 800 17px/1.2 var(--sans); }
.map-count { font: 600 13px/1.3 var(--sans); color: var(--map-muted); }
.map-close, .map-reset { pointer-events: auto; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--map-ink); background: #fff; color: var(--map-ink); font: 700 15px var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex: none; }
.map-close:active, .map-reset:active { background: #e9e5dc; }
.map-reset { position: absolute; left: 0; top: 0; width: 200px; justify-content: center; border-width: 1px; border-color: var(--map-idle); font-weight: 600; font-size: 14px; color: var(--map-muted); }
.map-close:focus-visible, .map-reset:focus-visible, .station:focus-visible .dot { outline: 3px solid var(--lav); outline-offset: 3px; }

/* Bande du pli : rien d'interactif dedans, on la masque. */
.map-fold { display: none; position: absolute; z-index: 2; background: repeating-linear-gradient(45deg, #e4dfd3 0 6px, #ece8df 6px 12px); }
html[data-fold="vertical"] .map-fold { display: block; top: 0; bottom: 0; left: var(--fold-start); width: calc(var(--fold-end) - var(--fold-start)); }
html[data-fold="horizontal"] .map-fold { display: block; left: 0; right: 0; top: var(--fold-start); height: calc(var(--fold-end) - var(--fold-start)); }

.map-region { position: absolute; border-radius: 36px; background: rgba(255,255,255,.55); border: 2px dashed var(--map-idle); padding: 18px 24px; pointer-events: none; }
.map-region h3 { margin: 0; font: 800 18px/1.2 var(--sans); }
.map-region p { margin: 2px 0 0; font: 600 14px/1.35 var(--sans); color: var(--map-muted); max-width: 150px; }

.map-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.map-line { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke: var(--map-idle); }
.map-line.done { stroke: var(--map-ink); }
.map-line.live, .map-line.next { stroke: var(--lav); }
.map-line.bonus { stroke-dasharray: 2 12; }

.station { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; -webkit-tap-highlight-color: transparent; }
.station:disabled { cursor: not-allowed; }
.station .dot { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 800 20px var(--sans); background: #fff; border: 3px solid var(--map-ink); color: var(--map-ink); box-sizing: border-box; }
.station .name { font: 700 13px/1.25 var(--sans); max-width: 116px; text-align: center; color: var(--map-ink); }
.station.done .dot { background: var(--map-ink); color: #fff; }
.station.locked .dot { background: #dcd8d0; border-color: #a29c8e; color: #5f5b6b; }
.station.locked .name { color: var(--map-muted); font-weight: 600; }
.station.current .dot { box-shadow: 0 0 0 4px var(--map-bg), 0 0 0 8px var(--lav); }
.station.bonus .dot { border-style: dashed; }
.station:active:not(:disabled) .dot { transform: scale(.94); }
.station.next .dot { animation: map-pulse 1.8s ease-in-out infinite; }
@keyframes map-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(143,132,232,.55); } 50% { box-shadow: 0 0 0 10px rgba(143,132,232,0); } }
.station.next.current .dot { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .station.next .dot { animation: none; box-shadow: 0 0 0 5px rgba(143,132,232,.5); }
  .station .dot, .map * { transition: none !important; }
}
/* La carte ouverte masque le tutoriel du niveau en cours (main, anneau) ; le focus d'une
   station se voit sur son rond (focus-visible), pas en cadre autour du bouton. */
body.map-open .tuto-hand, body.map-open .tuto-ring, body.map-open .tuto-confetti { display: none !important; }
.station:focus { outline: none; }
/* Le nom d'une station reste lisible quand une ligne passe derriere. */
.station .name { background: #f9f8f5; padding: 1px 6px; border-radius: 8px; }
