/* Carte des Mystères — 4 thèmes (?theme=a|b|c|d) sur la même structure. */
@font-face { font-family: "Anton"; src: url(fonts/Anton-Regular.ttf); font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-ExtraBold.ttf); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Regular.otf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Medium.otf); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-SemiBold.otf); font-weight: 600; font-display: swap; }
@font-face { font-family: "Yellowtail"; src: url(fonts/Yellowtail-Regular.ttf); font-display: swap; }

:root {
  --fond: #0b0716; --panneau: rgba(17, 11, 34, .82); --bord: rgba(255, 255, 255, .10);
  --texte: #f4effc; --doux: #a99cc4; --accent: #ff4fb3; --accent2: #7b5cff; --accent3: #2ec5ff;
  --verifier: #ffb84d; --vu: #3ee6a8; --faux: #ff5d6c; --rayon: 18px; --flou: blur(18px) saturate(1.4);
  --titre: "Anton", Impact, sans-serif; --corps: "Inter", system-ui, sans-serif; --ombre: 0 18px 50px rgba(0, 0, 0, .45);
  --epingle: linear-gradient(140deg, var(--accent), var(--accent2)); --halo: var(--accent);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--texte); font: 14px/1.45 var(--corps); -webkit-font-smoothing: antialiased; }
#map { position: fixed; inset: 0; background: var(--fond); }
/* Fond de la carte = couleur de la mer (avant filtre de thème), pour qu'un trou de chargement ne fasse jamais du noir. */
#map.leaflet-container { background: rgb(44, 102, 165); }
.theme-a #map.leaflet-container { background: rgb(94, 129, 179); }
.theme-d #map.leaflet-container { background: #06231f; }
.sans-secours #map.leaflet-container { background: var(--fond); }
#map.viseur { cursor: crosshair; }
/* Évite les fines lignes entre tuiles aux zooms intermédiaires (chevauchement d'un demi-pixel). */
.leaflet-container img.leaflet-tile { width: 256.6px !important; height: 256.6px !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent3); }

/* ---------- Panneau ---------- */
#panneau {
  position: fixed; z-index: 1000; top: 16px; left: 16px; bottom: 16px; width: 372px; display: flex; flex-direction: column;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou);
  border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden;
}
.entete { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 18px 10px; }
.marque-petit { display: block; font: 600 11px/1 var(--corps); letter-spacing: .16em; text-transform: uppercase; color: var(--doux); margin-bottom: 6px; }
h1 { margin: 0; font: 400 30px/1 var(--titre); letter-spacing: .01em; text-transform: uppercase; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2) 55%, var(--accent3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icone { background: transparent; border: 1px solid var(--bord); border-radius: 10px; width: 34px; height: 34px; font-size: 18px; line-height: 1; color: var(--doux); }
.recherche { padding: 4px 18px 12px; }
.recherche input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid var(--bord); color: var(--texte);
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a99cc4' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 13px center;
  font: 500 14px var(--corps); outline: none;
}
.recherche input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.onglets { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--bord); }
.onglets button { flex: 1; background: none; border: 0; padding: 10px 4px 11px; color: var(--doux); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--accent); }
.onglets b { font-weight: 600; font-size: 11px; color: var(--doux); margin-left: 3px; }
.contenu { flex: 1; overflow: auto; padding: 12px 12px 16px; }
.onglet { display: none; } .onglet.actif { display: block; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 4px 12px; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--bord); background: rgba(255, 255, 255, .04); font-size: 12px; font-weight: 600; color: var(--doux); }
.puce.actif { color: var(--texte); background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
.puce i { width: 8px; height: 8px; border-radius: 50%; } .puce small { opacity: .6; font-weight: 500; }
.liste { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.item:hover { background: rgba(255, 255, 255, .07); }
.texte { flex: 1; min-width: 0; } .texte b { display: block; font-weight: 600; } .texte small { display: block; color: var(--doux); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discrete .texte small { white-space: normal; }
.pastille { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 400 15px var(--titre); color: #fff; background: var(--epingle); box-shadow: 0 0 14px color-mix(in srgb, var(--halo) 55%, transparent); }
.liste .pastille[style] { width: 12px; height: 12px; box-shadow: none; margin: 0 9px; }
.pastille.vide { background: transparent; border: 1.5px dashed var(--doux); color: var(--doux); box-shadow: none; }
.etat { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.statut-a_verifier.etat { color: var(--verifier); background: color-mix(in srgb, var(--verifier) 14%, transparent); }
.statut-vu.etat { color: var(--vu); background: color-mix(in srgb, var(--vu) 14%, transparent); }
.statut-faux.etat { color: var(--faux); background: color-mix(in srgb, var(--faux) 14%, transparent); }
.soustitre { margin: 18px 10px 6px; font: 600 11px var(--corps); letter-spacing: .14em; text-transform: uppercase; color: var(--doux); }
.aide { color: var(--doux); font-size: 13px; margin: 2px 10px 12px; }
.etapes .item { counter-increment: none; }
.bouton { margin: 14px 4px 0; width: calc(100% - 8px); padding: 11px; border: 0; border-radius: 12px; font-weight: 700; color: #fff; background: var(--epingle); }
.interrupteur { display: flex; gap: 8px; align-items: center; margin: 2px 6px 12px; font-weight: 500; }
.credits { padding: 10px 18px 14px; font-size: 10.5px; line-height: 1.45; color: var(--doux); border-top: 1px solid var(--bord); }
.credits a { color: inherit; }
#panneau.replie .recherche, #panneau.replie .onglets, #panneau.replie .contenu, #panneau.replie .credits { display: none; }
#panneau.replie { bottom: auto; }

/* ---------- Fiche ---------- */
#fiche {
  position: fixed; z-index: 1001; top: 16px; right: 16px; width: 380px; max-height: calc(100% - 32px); overflow: auto; padding: 18px 20px 16px;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou);
  border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
}
#fiche[hidden] { display: none; }
#fermer-fiche { position: absolute; top: 14px; right: 14px; }
.fiche-type { font: 700 11px var(--corps); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
#fiche h2 { margin: 6px 30px 2px 0; font: 400 24px/1.05 var(--titre); text-transform: uppercase; }
.fiche-lieu { color: var(--doux); margin-bottom: 12px; }
.etat.grand { display: inline-block; font-size: 12px; padding: 5px 11px; margin-bottom: 8px; }
.ligne { padding: 8px 0; border-top: 1px solid var(--bord); line-height: 1.45; }
.ligne span { display: block; font: 600 11px var(--corps); letter-spacing: .1em; text-transform: uppercase; color: var(--doux); margin-bottom: 3px; }
.ligne p { margin: 0; }
.precision, .note { margin-top: 6px; font-size: 11.5px; color: var(--doux); }

/* ---------- Outils ---------- */
#outils { position: fixed; z-index: 1000; right: 64px; bottom: 16px; display: flex; gap: 8px; align-items: center; }
.fonds { display: flex; padding: 3px; border-radius: 12px; background: var(--panneau); backdrop-filter: var(--flou); border: 1px solid var(--bord); }
.fonds button { border: 0; background: none; padding: 7px 11px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--doux); }
.fonds button.actif { background: rgba(255, 255, 255, .14); color: var(--texte); }
.fonds button:disabled { opacity: .5; cursor: not-allowed; }
.bouton-outil, #coords { padding: 9px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--panneau); backdrop-filter: var(--flou); border: 1px solid var(--bord); color: var(--doux); }
.bouton-outil.actif { color: #fff; background: var(--accent); border-color: var(--accent); }
#coords { font-variant-numeric: tabular-nums; min-width: 132px; text-align: center; }
#toast { position: fixed; z-index: 1100; left: 50%; bottom: 72px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #000c; color: #fff; font-weight: 600; max-width: 90vw; word-break: break-all; }
.leaflet-bar a { background: var(--panneau) !important; color: var(--texte) !important; border-color: var(--bord) !important; backdrop-filter: var(--flou); }
.leaflet-control-zoom { border: 1px solid var(--bord) !important; border-radius: 12px !important; overflow: hidden; margin: 0 16px 16px 0 !important; }

/* ---------- Repères ---------- */
.icone-dossier { background: none; border: 0; }
.epingle { position: relative; width: 34px; height: 44px; }
.epingle .tete {
  position: absolute; left: 2px; top: 0; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--epingle); border: 2px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .45), 0 0 18px var(--halo);
  display: grid; place-items: center; color: #fff; font: 400 15px var(--titre);
}
.epingle .tete { line-height: 1; }
.epingle .tete::first-line { }
.epingle .halo { position: absolute; left: 7px; bottom: 0; width: 20px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(2px); }
.epingle.statut-a_verifier .tete { border-style: dashed; }
.epingle.en-mission .halo { background: var(--halo); animation: pouls 1.8s ease-out infinite; filter: none; opacity: .7; }
@keyframes pouls { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
.epingle .tete > * { transform: rotate(45deg); }
.trajet { stroke: var(--accent3); filter: drop-shadow(0 0 4px var(--accent3)); }
.infobulle { background: var(--panneau) !important; color: var(--texte) !important; border: 1px solid var(--bord) !important; border-radius: 10px !important; box-shadow: var(--ombre) !important; font: 500 12px var(--corps); backdrop-filter: var(--flou); }
.infobulle::before { display: none; }
.infobulle.forte { font-weight: 700; }
.bulle-placement .leaflet-popup-content-wrapper, .bulle-placement .leaflet-popup-tip { background: var(--panneau); color: var(--texte); }

/* ===================== THÈME A — Néon nuit (identité de la chaîne) ===================== */
/* Filtre posé sur chaque image (et sur le masque d'eau) plutôt que sur tout le volet : moins d'à-coups en zoomant (mesuré 58 → 60 images/s). */
.theme-a .leaflet-tile-pane img.leaflet-tile, .theme-a .leaflet-masque-pane { filter: invert(1) hue-rotate(185deg) brightness(.78) contrast(1.08) saturate(.85); }

/* ===================== THÈME B — Dossier d'enquête (papier, encre, punaises) ===================== */
.theme-b {
  --fond: #e9dfc8; --panneau: rgba(250, 244, 230, .94); --bord: rgba(60, 40, 20, .18); --texte: #2a1d12; --doux: #7a6650;
  --accent: #c8102e; --accent2: #8f0c22; --accent3: #1f4e8c; --verifier: #b86e00; --vu: #2e7d32; --faux: #c8102e;
  --flou: none; --rayon: 4px; --titre: "Anton", Impact, sans-serif; --corps: "Inter", Georgia, serif;
  --ombre: 0 2px 0 rgba(60, 40, 20, .15), 0 14px 30px rgba(60, 40, 20, .25);
  --epingle: radial-gradient(circle at 35% 30%, #ff5a6e, #c8102e 55%, #7a0716); --halo: rgba(200, 16, 46, .4);
}
.theme-b .leaflet-tile-pane { filter: sepia(.6) saturate(.65) contrast(.95) brightness(1.03); }
.theme-b #panneau { background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(31, 78, 140, .07) 27px 28px); }
.theme-b h1 em { background: none; color: var(--accent); -webkit-text-fill-color: var(--accent); }
.theme-b .marque-petit, .theme-b .ligne span, .theme-b .fiche-type, .theme-b .soustitre { font-family: ui-monospace, "Courier New", monospace; letter-spacing: .08em; }
.theme-b #fiche { transform: rotate(.6deg); }
.theme-b #fiche::before { content: "DOSSIER"; position: absolute; top: 16px; right: 60px; padding: 2px 8px; border: 2px solid var(--accent); color: var(--accent); font: 700 12px ui-monospace, monospace; letter-spacing: .2em; transform: rotate(-8deg); opacity: .8; }
.theme-b .epingle .tete { border-radius: 50%; transform: none; width: 22px; height: 22px; left: 6px; top: 8px; border: 0; font-size: 0; box-shadow: 0 3px 4px rgba(0,0,0,.4); }
.theme-b .epingle .halo { left: 9px; }
.theme-b .trajet { stroke: #c8102e; filter: none; }
.theme-b .pastille { box-shadow: none; }
.theme-b .puce.actif { background: #2a1d12; color: #f4ecd8; }
.theme-b .bouton { background: #2a1d12; }

/* ===================== THÈME C — Mode clair (même identité que le sombre) ===================== */
.theme-c {
  --fond: #dce8f3; --panneau: rgba(255, 255, 255, .88); --bord: rgba(40, 20, 80, .10); --texte: #1a1033; --doux: #6b6385;
  --accent: #e8259a; --accent2: #6d3df2; --accent3: #0a9fe0; --verifier: #c46a00; --vu: #08996b; --faux: #d62f45;
  --ombre: 0 12px 34px rgba(40, 20, 80, .16); --halo: rgba(232, 37, 154, .45);
}
.theme-c .puce.actif { background: #1a1033; color: #fff; border-color: #1a1033; }
.theme-c .recherche input { background-color: rgba(40, 20, 80, .05); }
.theme-c .infobulle { color: var(--texte) !important; }

/* ===================== THÈME D — Radar GPS du jeu ===================== */
.theme-d {
  --fond: #03100f; --panneau: rgba(3, 18, 17, .86); --bord: rgba(87, 255, 214, .16); --texte: #e6fff8; --doux: #6fb3a3;
  --accent: #57ffd6; --accent2: #00a3ff; --accent3: #ffe14d; --verifier: #ffe14d; --vu: #57ffd6; --rayon: 6px;
  --corps: ui-monospace, "SF Mono", Menlo, monospace; --halo: #57ffd6;
  --epingle: linear-gradient(140deg, #ffe14d, #ff9f1c);
}
.theme-d .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.62) contrast(1.6) sepia(1) hue-rotate(115deg) saturate(1.8); }
.theme-d h1 em { background: none; color: var(--accent); -webkit-text-fill-color: var(--accent); text-shadow: 0 0 14px rgba(87, 255, 214, .6); }
.theme-d #panneau, .theme-d #fiche { border-color: rgba(87, 255, 214, .3); }
.theme-d .epingle .tete { color: #1a1300; }
.theme-d .trajet { stroke: #ffe14d; filter: drop-shadow(0 0 5px #ffe14d); }
.theme-d .bouton { color: #02110f; }


/* ---------- Régions en un clic ---------- */
.regions { display: flex; gap: 6px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.regions::-webkit-scrollbar { display: none; }
.region { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 999px; border: 1px solid var(--bord); background: rgba(127,127,127,.08); font-size: 12px; font-weight: 600; white-space: nowrap; }
.region i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; background: var(--epingle); }
.region:hover { border-color: var(--accent); }

/* ---------- Suggestions de recherche ---------- */
.recherche { position: relative; }
.suggestions { position: absolute; z-index: 5; left: 18px; right: 18px; top: calc(100% - 6px); margin: 0; padding: 6px; list-style: none; border-radius: 14px;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border: 1px solid var(--bord); box-shadow: var(--ombre); max-height: 50vh; overflow: auto; }
.theme-a .suggestions { background: rgba(20, 13, 40, .97); } .theme-c .suggestions { background: rgba(255, 255, 255, .98); }
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.suggestions li.choisi, .suggestions li:hover { background: rgba(127, 127, 127, .14); }
.suggestions li.vide { color: var(--doux); cursor: default; }
.suggestions .point { flex: none; width: 10px; height: 10px; border-radius: 50%; margin: 0 6px; }
.pastille.petite { width: 22px; height: 22px; font-size: 12px; }
.region-p { font-family: var(--corps); font-weight: 700; font-size: 11px; }

/* ---------- Progression ---------- */
.progression { margin: 0 8px 12px; }
.prog-texte { font-size: 12px; color: var(--doux); margin-bottom: 6px; } .prog-texte b { color: var(--texte); font-size: 14px; }
.barre { height: 6px; border-radius: 99px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--epingle); border-radius: 99px; transition: width .3s; }
.item.fait .texte b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--texte) 40%, transparent); opacity: .7; }
.item.fait .pastille { background: var(--vu); box-shadow: none; }
.item.fait .etat { color: var(--vu); background: color-mix(in srgb, var(--vu) 14%, transparent); }
.distance { flex: none; font-size: 12px; font-weight: 700; color: var(--accent3); }
.puces-actions { margin: 0 8px 8px; font-size: 12px; color: var(--doux); }
.lien-bouton { background: none; border: 0; padding: 0; color: var(--accent3); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lien-bouton.danger { color: var(--faux); margin: 12px 6px 0; }
.bouton.secondaire { background: rgba(127, 127, 127, .14); color: var(--texte); border: 1px solid var(--bord); }
.rangee { display: flex; gap: 8px; } .rangee .bouton { flex: 1; margin-left: 0; margin-right: 0; width: auto; }
.fichier { position: relative; text-align: center; cursor: pointer; } .fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.soustitre.premier { margin-top: 4px; }
.raccourcis kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--bord); font: 600 11px var(--corps); text-align: center; background: rgba(127,127,127,.1); }
.note-pastille { background: #ffd166 !important; color: #3a2a00 !important; box-shadow: none !important; font-family: var(--corps); }

/* ---------- Fiche : trouvé, média, spoiler ---------- */
.trouve-bouton.fait { background: var(--vu); color: #052a1d; }
.fiche-image { width: 100%; border-radius: 12px; margin: 6px 0 10px; display: block; }
.vignette-short { position: relative; display: block; margin: 6px 0 10px; border-radius: 12px; overflow: hidden; }
.vignette-short img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.vignette-short span { position: absolute; left: 10px; bottom: 10px; padding: 6px 10px; border-radius: 99px; background: rgba(0,0,0,.72); color: #fff; font-weight: 700; font-size: 12px; }
.spoiler { filter: blur(6px); cursor: pointer; user-select: none; transition: filter .2s; }
em.interne { font-style: normal; font-size: 9px; letter-spacing: .08em; padding: 1px 5px; border-radius: 4px; background: rgba(255, 184, 77, .2); color: var(--verifier); margin-left: 4px; }
.poignee { display: none; }

/* ---------- Carte : bulles, sélection, noms, notes, moi ---------- */
.bulle { background: none; border: 0; }
.bulle span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font: 700 12px var(--corps); color: #fff;
  background: color-mix(in srgb, var(--accent2) 82%, transparent); border: 2px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 4px color-mix(in srgb, var(--accent2) 25%, transparent); cursor: pointer; transition: transform .15s; }
.bulle span:hover { transform: scale(1.08); }
.anneau-selection { background: none; border: 0; pointer-events: none; }
.anneau-selection span { position: absolute; inset: 6px; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 18px var(--accent); animation: anneau 1.6s ease-in-out infinite; }
@keyframes anneau { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.05); } }
.epingle.choisie .tete { box-shadow: 0 0 0 4px #fff, 0 0 26px var(--halo); }
.epingle.trouve .tete { background: var(--vu); border-style: solid; }
.etiquette { background: none; border: 0; pointer-events: none; }
.etiquette span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--titre); text-transform: uppercase; letter-spacing: .06em; color: var(--texte);
  text-shadow: 0 0 3px var(--fond), 0 0 3px var(--fond), 0 0 8px var(--fond), 0 0 12px var(--fond); }
.et-region span { font-size: 22px; letter-spacing: .1em; }
.et-zone span { font-size: 15px; opacity: .92; }
.et-quartier span { font-family: var(--corps); font-weight: 700; font-size: 12px; letter-spacing: .12em; opacity: .85; }
.icone-note, .icone-ici { background: none; border: 0; }
.note-epingle { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #ffd166; color: #3a2a00; font-weight: 700; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.ici { position: relative; width: 22px; height: 22px; border-radius: 50%; background: #2e8bff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: grab; }
.ici span { position: absolute; inset: -10px; border-radius: 50%; background: rgba(46, 139, 255, .25); animation: pouls 2s ease-out infinite; }
#bandeau-viseur { position: fixed; z-index: 1003; left: 50%; top: 16px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-radius: 14px;
  background: var(--accent); color: #fff; font-weight: 600; box-shadow: var(--ombre); max-width: calc(100vw - 32px); }
#bandeau-viseur[hidden] { display: none; } #bandeau-viseur .lien-bouton { color: #fff; }
.form-note textarea { width: 100%; min-width: 220px; border-radius: 10px; border: 1px solid var(--bord); padding: 8px; font: 14px var(--corps); background: rgba(127,127,127,.08); color: var(--texte); resize: vertical; }
.form-note .bouton { margin-top: 8px; padding: 8px; }

/* ---------- Boutons de zoom ---------- */
.zoom-boutons { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border: 1px solid var(--bord); box-shadow: var(--ombre); }
.zoom-boutons button { width: 40px; height: 40px; border: 0; background: none; font-size: 20px; font-weight: 600; color: var(--texte); }
.zoom-boutons button + button { border-top: 1px solid var(--bord); }
.zoom-boutons button:hover { background: rgba(127,127,127,.14); }

/* ---------- Version publique : outils internes absents ---------- */
.public #placer, .public #coords { display: none !important; }

/* ---------- Mode manette (gros boutons pour jouer avec la carte à côté) ---------- */
.manette .item { padding: 14px 10px; } .manette .puce, .manette .region { padding: 9px 14px; font-size: 14px; }
.manette .zoom-boutons button { width: 56px; height: 56px; font-size: 26px; }
.manette .bouton, .manette .bouton-outil { padding: 14px; font-size: 15px; }
.manette .icone { width: 44px; height: 44px; }
.manette #fiche { font-size: 16px; }
@media (pointer: coarse) { .item { min-height: 48px; } .puce, .region { min-height: 36px; } }

/* ---------- Bouton « Note » posé sur la carte, au-dessus du zoom ---------- */
.bouton-carte { position: fixed; z-index: 1000; right: 16px; bottom: 106px; height: 40px; padding: 0 12px; display: flex; gap: 6px; align-items: center; border-radius: 12px;
  background: #ffd166; color: #3a2a00; border: 1px solid rgba(0,0,0,.15); font-weight: 700; font-size: 13px; box-shadow: var(--ombre); }
.bouton-carte:hover { filter: brightness(1.05); }
.bouton-ici { bottom: 154px; background: #2e8bff; color: #fff; }
.bouton-ici.actif, .viseur-ici .bouton-ici { box-shadow: 0 0 0 3px #fff, var(--ombre); }
/* ---------- Roue dentée et options ---------- */
.roue { position: fixed; z-index: 1002; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border: 1px solid var(--bord); color: var(--texte); box-shadow: var(--ombre); transition: transform .2s; }
.roue:hover { transform: rotate(30deg); } .roue.actif { color: #fff; background: var(--accent); border-color: var(--accent); }
.options-boite { position: fixed; z-index: 1003; top: 66px; right: 16px; width: 330px; max-height: calc(100% - 82px); overflow: auto; padding: 16px 18px 18px;
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.theme-a .options-boite { background: rgba(20, 13, 40, .96); } .theme-c .options-boite { background: rgba(255, 255, 255, .97); }
.options-boite[hidden] { display: none; }
.options-boite > .icone { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; font-size: 16px; }
.options-boite .interrupteur { margin-left: 0; margin-right: 0; }
.options-boite .bouton { margin-left: 0; margin-right: 0; width: 100%; }
.segment { display: flex; padding: 3px; border-radius: 12px; background: rgba(127,127,127,.14); margin: 4px 0 10px; }
.segment button { flex: 1; padding: 7px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: 13px; color: var(--doux); }
.segment button.actif { background: var(--accent); color: #fff; }
.credits { margin-top: 14px; font-size: 12px; line-height: 1.5; color: var(--doux); }
.credits summary { cursor: pointer; font: 600 11px var(--corps); letter-spacing: .14em; text-transform: uppercase; color: var(--texte); }
.credits p { margin: 8px 0 0; } .credits a { color: inherit; }
.raccourcis-bouton { right: 66px; }
.raccourcis-boite { width: 360px; }
.liste-raccourcis { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 6px 0 4px; font-size: 13px; align-items: center; }
.liste-raccourcis dt { font-weight: 600; white-space: nowrap; color: var(--texte); } .liste-raccourcis dd { margin: 0; color: var(--doux); }
.liste-raccourcis kbd { display: inline-block; min-width: 20px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--bord); border-bottom-width: 2px; font: 600 12px var(--corps); text-align: center; background: rgba(127,127,127,.1); }
/* Pas de clavier sur téléphone ou tablette : le bouton raccourcis n'y apparaît pas. */
@media (hover: none) and (pointer: coarse) { .raccourcis-bouton, .raccourcis-boite { display: none !important; } }
/* Fiche ouverte (ordinateur) : roue, zoom et outils se rangent à sa gauche, la fiche prend toute la hauteur. */
@media (min-width: 721px) {
  body.fiche-ouverte .roue, body.fiche-ouverte .options-boite { right: 412px; }
  body.fiche-ouverte .raccourcis-bouton { right: 462px; }
  body.fiche-ouverte .zoom-boutons, body.fiche-ouverte .bouton-carte { right: 412px; }
  body.fiche-ouverte #outils { right: 460px; }
}
/* Fenêtre étroite (volet d'aperçu Hermes, petit écran) : pas la place pour le panneau ET la fiche.
   Tant que la fiche est ouverte, le panneau de gauche s'efface ; il revient quand on la ferme. */
@media (min-width: 721px) and (max-width: 1380px) {
  body.fiche-ouverte #panneau { display: none; }
  body.fiche-ouverte #outils .fonds { display: none; }
}

/* ---------- Crédits ---------- */
.credits-boite { position: fixed; z-index: 1002; right: 64px; bottom: 70px; width: 340px; padding: 16px 18px; font-size: 12px; line-height: 1.5; color: var(--doux);
  background: var(--panneau); backdrop-filter: var(--flou); -webkit-backdrop-filter: var(--flou); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.credits-boite[hidden] { display: none; }
.credits-boite h3 { margin: 0 0 8px; font: 600 11px var(--corps); letter-spacing: .14em; text-transform: uppercase; color: var(--texte); }
.credits-boite p { margin: 0; } .credits-boite a { color: inherit; }
.credits-boite .icone { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; font-size: 16px; }

/* ---------- Mobile : panneau en feuille du bas, fiche à tirer du doigt ---------- */
@media (max-width: 720px) {
  #panneau { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62vh; }
  #panneau .entete { padding: 12px 14px 6px; }
  #panneau.replie .recherche { display: block; }
  #panneau.replie .regions { display: flex; }
  #panneau.replie { max-height: none; bottom: 8px; }
  h1 { font-size: 22px; } .marque-petit { font-size: 10px; margin-bottom: 4px; }
  .recherche { padding: 2px 14px 10px; } .regions { padding: 0 14px 10px; }
  .suggestions { top: auto; bottom: calc(100% + 4px); left: 14px; right: 14px; }
  #fiche { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: none; border-radius: 22px 22px 0 0; padding: 8px 18px 24px; transition: height .25s ease; }
  #fiche.glisse { transition: none; }
  #fiche h2 { font-size: 22px; }
  .poignee { display: flex; justify-content: center; padding: 6px 0 10px; cursor: grab; touch-action: none; }
  .poignee span { width: 44px; height: 5px; border-radius: 99px; background: var(--doux); opacity: .5; }
  #fermer-fiche { top: 12px; }
  body.fiche-ouverte #panneau { display: none; }
  body.fiche-ouverte .zoom-boutons { display: none; }
  #outils { right: 8px; left: auto; bottom: auto; top: calc(8px + env(safe-area-inset-top)); }
  #outils .fonds, #coords, #placer { display: none; }
  .zoom-boutons { bottom: auto; top: calc(58px + env(safe-area-inset-top)); right: 8px; }
  .roue { top: calc(8px + env(safe-area-inset-top)); right: 8px; }
  .bouton-carte { bottom: auto; top: calc(148px + env(safe-area-inset-top)); right: 8px; }
  .bouton-ici { top: calc(196px + env(safe-area-inset-top)); }
  body.fiche-ouverte .bouton-carte { display: none; }
  .options-boite { top: calc(58px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; max-height: calc(100% - 74px); }
  body.fiche-ouverte .roue { display: none; }
  .credits-boite { left: 8px; right: 8px; width: auto; top: calc(56px + env(safe-area-inset-top)); bottom: auto; }
  #bandeau-viseur { top: auto; bottom: 16px; }
  .theme-b #fiche { transform: none; }
}
/* Capture : on cache le curseur de coordonnées vide. */
.capture #coords { visibility: hidden; }

/* Fiche : le bouton « Marquer comme trouvé » reste visible même si le texte est long. */
#fiche-contenu .trouve-bouton { position: sticky; bottom: 0; margin-top: 10px; box-shadow: 0 -8px 16px -6px rgba(0,0,0,.25); }

.retirer-ici { display: block; margin: 2px 8px 6px auto; }
.bulle-moi { display: flex; align-items: center; gap: 12px; } .bulle-moi .bouton { margin: 0; width: auto; padding: 7px 12px; }

/* Bulle du clic sur la carte : infos de l'endroit + actions */
.menu-ici { display: flex; flex-direction: column; gap: 8px; }
.menu-titre { font: 400 17px/1.1 var(--titre); text-transform: uppercase; letter-spacing: .04em; padding-right: 14px; }
.menu-proche { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--bord); background: rgba(127,127,127,.08); color: var(--texte); font-size: 13px; font-weight: 600; }
.menu-proche small { color: var(--doux); font-weight: 500; margin-left: auto; white-space: nowrap; }
.menu-proche .point { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-actions .bouton { margin: 0; width: auto; flex: 1 1 auto; padding: 8px 10px; font-size: 13px; }

.point-interro { font: 700 19px/1 var(--corps); }

/* Le sélecteur de fond (Communauté / Officielle) ne doit jamais passer sur le panneau de gauche :
   s'il n'y a pas la place entre le panneau et les boutons de droite, on le cache. */
@media (min-width: 721px) and (max-width: 1240px) { #outils .fonds { display: none; } }

/* ---------- Mode teaser (vidéos avant la carte officielle) : fond néon, aucune image de carte ---------- */
body.teaser #map.leaflet-container { background: radial-gradient(ellipse 90% 70% at 50% 42%, #3a1a6e 0%, #1a0c38 45%, #08040f 100%); }
body.teaser.theme-c #map.leaflet-container { background: radial-gradient(ellipse 90% 70% at 50% 42%, #ffffff 0%, #f1e8ff 50%, #dccdf7 100%); }
.grille { stroke: rgba(160, 120, 255, .22); fill: none; }
.grille.forte { stroke: rgba(255, 79, 179, .45); filter: drop-shadow(0 0 3px rgba(255, 79, 179, .8)); }
.theme-c .grille { stroke: rgba(110, 60, 200, .16); } .theme-c .grille.forte { stroke: rgba(214, 51, 148, .35); filter: none; }

/* « de Vice City » en écriture néon, à la suite du titre */
.h1-suite { display: block; margin-top: 2px; font: 400 26px/1 "Yellowtail", cursive; text-transform: none; letter-spacing: 0; color: var(--accent); text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }

/* Liens discrets vers nos réseaux, sous le titre */
.reseaux { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font: 500 11.5px var(--corps); }
.reseaux a { color: var(--doux); text-decoration: none; }
.reseaux a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.reseaux a + a::before { content: "·"; margin-right: 12px; color: var(--doux); opacity: .6; }
@media (max-width: 720px) { #panneau.replie .reseaux { display: none; } }

/* Bords des masques adoucis : pas de rectangle visible dans les dégradés de la mer */
.fond-v15 .masque-rect { filter: blur(5px); }
