/* Plan de la carte (src/render/map-plan.js), ouvert par le panneau du départ (25 nov. 2026).
   Un écran lumineux, comme celui du panneau : violet profond, liseré cyan, noms sur des étiquettes. */
.map-plan {
  --plan-text-shadow: 0 2px 4px rgba(37, 19, 56, .75);
  position: fixed;
  inset: 0;
  width: min(calc(100vw - 132px), calc((100vh - 150px) * 2.09), 1180px);
  width: min(calc(100vw - 132px), calc((100dvh - 150px) * 2.09), 1180px);
  height: fit-content;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f6edf1;
  overflow: visible;
}
.map-plan::backdrop { background: #0b0a1666; }
body:has(.map-plan[open]) .controls { visibility: hidden; }
.map-plan-frame {
  box-sizing: border-box;
  padding: 14px 16px 16px;
  border: 2px solid #9be6f2;
  border-radius: 6px;
  background: #1b1633;
  box-shadow: 0 0 0 1px #0b0a16, 0 0 26px #9be6f240, 0 18px 50px #0b0a16aa;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
.map-plan[data-open] .map-plan-frame { opacity: 1; transform: none; }
.map-plan-frame:focus { outline: none; }
.map-plan-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.map-plan-header h2 { margin: 0; font: 700 15px/1.2 "Segoe UI", sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #f5ecd7; }
.map-plan-key { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1.2 "Segoe UI", sans-serif; color: #d8d0ee; }
.map-plan-key i { width: 10px; height: 10px; border-radius: 50%; background: #9be6f2; box-shadow: 0 0 0 2px #1b1633, 0 0 0 3px #9be6f2; }
.map-plan-map { position: relative; width: 100%; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px #9be6f22e; }
.map-plan-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-plan-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 7px;
  border-radius: 12px;
  background: #1b1633e6;
  box-shadow: inset 0 0 0 1.5px var(--place, #d9d2ee);
  color: #f6edf1;
  font: 600 13px/1.2 "Segoe UI", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.map-plan-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--place, #d9d2ee); }
.map-plan-label[data-place="clairiere"] { transform: translate(-50%, -50%); background: #1b1633b3; }
.map-plan-number { display: none; }
.map-plan-here-label {
  position: absolute;
  transform: translate(-50%, 14px);
  padding: 3px 8px;
  border-radius: 10px;
  background: #9be6f2;
  color: #1b1633;
  font: 700 12px/1.2 "Segoe UI", sans-serif;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #1b1633;
  pointer-events: none;
}
.map-plan-legend { display: none; }
.map-plan-pulse { transform-box: fill-box; transform-origin: center; animation: map-plan-pulse 1.8s ease-out infinite; }
@keyframes map-plan-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3); opacity: 0; } }
/* Croix : à droite du coin supérieur droit du cadre, un peu au-dessus (comme la galerie et les fiches) ;
   sur un écran étroit, au-dessus du coin. */
.map-plan .map-plan-close {
  position: absolute;
  z-index: 1;
  left: min(calc(100% + 4px), calc((100vw + 100%) / 2 - 52px));
  top: -39px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f6edf1;
  box-shadow: none;
  text-shadow: var(--plan-text-shadow);
  font: 300 42px/1 "Segoe UI", sans-serif;
  opacity: 0;
  transition: opacity .2s .1s;
}
.map-plan[data-open] .map-plan-close { opacity: 1; }
.map-plan .map-plan-close:hover { background: transparent; color: #fff; }
.map-plan .map-plan-close:focus-visible { outline: 2px solid #9be6f2; outline-offset: 3px; }
/* Écran étroit : numéros sur le plan, noms dans la légende. */
@media (max-width: 760px) {
  .map-plan { width: calc(100vw - 24px); margin-top: max(56px, calc((100dvh - 100%) / 2)); }
  .map-plan-frame { padding: 12px 12px 14px; }
  .map-plan-label, .map-plan-label[data-place="clairiere"] { transform: translate(-50%, -50%); gap: 0; padding: 0; width: 20px; height: 20px; justify-content: center; border-radius: 50%; background: var(--place, #d9d2ee); box-shadow: 0 0 0 2px #1b1633; color: #1b1633; font-size: 11px; }
  .map-plan-label:not([data-place="clairiere"]) { transform: translate(-50%, calc(-100% - 2px)); }
  .map-plan-label::before, .map-plan-name { display: none; }
  .map-plan-number { display: inline; font-weight: 800; }
  .map-plan-here-label { padding: 2px 6px; font-size: 10px; transform: translate(-50%, 9px); }
  .map-plan-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 12px 2px 0; padding: 0; list-style: none; counter-reset: place; font: 500 12px/1.3 "Segoe UI", sans-serif; color: #e9e2f6; }
  .map-plan-legend li { counter-increment: place; display: flex; align-items: center; gap: 7px; }
  .map-plan-legend li::before { content: counter(place); flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--place, #d9d2ee); color: #1b1633; font-weight: 800; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .map-plan-frame, .map-plan-close { transition: none; } .map-plan-pulse { animation: none; opacity: 0; } }
