/* GLACIERS — interface.
   Charte : nuit polaire (#0a1426), glace (#8fd3ff), neige (#f4fbff), et les trois strates du logo —
   ocre des calcaires (#e0a458), lilas du socle (#b9a6ff), ardoise (#4f6d9c). Verre dépoli sur la 3D,
   police Outfit, icônes au trait de 1,8 px, toujours accompagnées d'un libellé ou d'une bulle. */
:root {
  --nuit: #0a1426; --verre: rgba(13, 26, 48, 0.62); --verre-fort: rgba(10, 21, 40, 0.92);
  --bord: rgba(214, 234, 255, 0.13); --bord-fort: rgba(214, 234, 255, 0.3);
  --texte: #f3f8ff; --doux: #bccbe2; --pale: #8798b8;
  --glace: #8fd3ff; --neige: #f4fbff; --ocre: #e0a458; --lilas: #b9a6ff; --ardoise: #4f6d9c; --braise: #ff8a6a;
  --actif: rgba(143, 211, 255, 0.17); --actif-bord: rgba(143, 211, 255, 0.42);
  --rayon: 16px; --ombre: 0 14px 40px rgba(2, 8, 20, 0.42), inset 0 1px 0 rgba(255,255,255,.07);
  --police: "Outfit", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --haut: 60px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--texte); font: 14px/1.45 var(--police); -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #34557f 0%, #87aad0 46%, #dbe6f1 72%, #c3d1df 100%); }
body.grotte { background: #020304; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--glace); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }
small { color: var(--pale); font-size: 11.5px; }
.espace { flex: 1; }
body.echelle-large [data-seul="local"], body.echelle-local [data-seul="large"] { display: none !important; }

#vue3d { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; outline: none; cursor: crosshair; }
#vue3d:active { cursor: grabbing; }
#etiquettes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.etiq { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 6px rgba(0,0,0,.8), 0 1px 2px #000; translate: -50% -100%; padding-bottom: 8px; will-change: transform; }
.etiq::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 7px; background: rgba(255,255,255,.75); }
.etiq small { color: #dbe6f6; font-weight: 500; }
.etiq.grotte { color: #ffd9a8; }
.etiq.massif { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #fff3df; font-weight: 700; padding-bottom: 0; }
.etiq.massif::after, .etiq.passe::after { display: none; }
.etiq.sommet { color: #eaf6ff; }
.etiq.passe { font-style: italic; color: #ffe2a0; padding-bottom: 0; }
.etiq.porte { pointer-events: auto; cursor: pointer; padding: 4px 10px 4px 8px; margin-top: -6px; border-radius: 999px; background: rgba(224,164,88,.92); color: #1d1206; text-shadow: none; display: flex; gap: 6px; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.etiq.porte small { color: #3d2a12; }
.etiq.porte::after { bottom: -7px; background: rgba(224,164,88,.95); }
.etiq.porte:hover { background: #f2bd76; }

/* ── verre ── */
.barre, .panneau, .temps, .fiche, dialog, .carte-chargement, .hud > div {
  background: var(--verre); border: 1px solid var(--bord); backdrop-filter: blur(18px) saturate(1.35); -webkit-backdrop-filter: blur(18px) saturate(1.35); box-shadow: var(--ombre);
}

/* ── barre du haut ── */
.barre { position: fixed; top: 12px; left: 12px; right: 12px; height: var(--haut); border-radius: var(--rayon); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 9px; z-index: 20; }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; margin-right: 4px; }
.logo { width: 40px; height: 40px; flex: none; }
.nom { display: flex; flex-direction: column; line-height: 1.05; }
.nom b { font-weight: 800; letter-spacing: .16em; font-size: 15.5px; }
.nom small { font-size: 10.5px; letter-spacing: .06em; color: var(--glace); margin-top: 3px; }
.echelles, .onglets { display: flex; gap: 3px; background: rgba(0,0,0,.2); border-radius: 12px; padding: 3px; }
.echelles button, .onglets button { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 12px; border-radius: 9px; color: var(--doux); font-weight: 600; white-space: nowrap; }
.echelles button[aria-pressed="true"] { background: rgba(224, 164, 88, .2); color: #fff; box-shadow: inset 0 0 0 1px rgba(224,164,88,.5); }
.echelles button[aria-pressed="true"] .ico { color: var(--ocre); }
.onglets button[aria-selected="true"] { background: var(--actif); color: #fff; box-shadow: inset 0 0 0 1px var(--actif-bord); }
.onglets button[aria-selected="true"] .ico { color: var(--glace); }
.echelles button:hover, .onglets button:hover { color: #fff; }
.bouton-ico { display: flex; align-items: center; gap: 7px; border: 1px solid var(--bord); background: rgba(255,255,255,.04); padding: 8px 12px; border-radius: 10px; color: var(--doux); font-weight: 600; }
.bouton-ico.seul-ico { padding: 8px 9px; }
.bouton-ico:hover, .bouton-ico[aria-pressed="true"] { color: #fff; border-color: var(--bord-fort); background: rgba(255,255,255,.08); }

/* ── panneau des calques ── */
.panneau { position: fixed; top: calc(var(--haut) + 24px); left: 12px; width: 292px; max-height: calc(100vh - var(--haut) - 190px); overflow: auto; border-radius: var(--rayon); padding: 4px 6px 10px; z-index: 15; scrollbar-width: thin; }
.panneau.replie { display: none; }
.panneau details { border-bottom: 1px solid var(--bord); padding: 2px 8px 10px; }
.panneau details:last-child { border-bottom: 0; }
.panneau summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--pale); margin: 10px 0 6px; font-weight: 700; }
.panneau summary::-webkit-details-marker { display: none; }
.panneau summary::after { content: ""; width: 7px; height: 7px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate .2s; }
.panneau details:not([open]) summary::after { rotate: -45deg; translate: 0 0; }
.panneau summary:hover { color: var(--texte); }
.segments { display: flex; gap: 3px; background: rgba(0,0,0,.2); border-radius: 10px; padding: 3px; margin-bottom: 6px; }
.segments button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 8px; color: var(--doux); font-weight: 600; font-size: 13px; }
.segments button[aria-pressed="true"] { background: var(--actif); color: #fff; box-shadow: inset 0 0 0 1px var(--actif-bord); }
.bascule { display: flex; align-items: center; gap: 9px; padding: 5px 4px; cursor: pointer; border-radius: 8px; }
.bascule:hover { background: rgba(255,255,255,.04); }
.bascule input { accent-color: var(--glace); width: 16px; height: 16px; margin: 0; }
.bascule .ico { width: 17px; height: 17px; color: var(--glace); }
.reglage { display: grid; grid-template-columns: 84px 1fr 30px; align-items: center; gap: 8px; padding: 3px 4px; color: var(--doux); font-size: 13px; }
.reglage input { width: 100%; accent-color: var(--glace); }
.reglage output { text-align: right; color: #fff; font-variant-numeric: tabular-nums; }
.legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.legende li { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; }
.legende i { width: 16px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.legende small { white-space: nowrap; font-variant-numeric: tabular-nums; }
.note { color: var(--pale); font-size: 11.5px; margin: 8px 0 0; }

/* ── le temps ── */
.temps { position: fixed; left: 50%; translate: -50% 0; bottom: 28px; width: min(960px, calc(100vw - 24px)); border-radius: var(--rayon); padding: 10px 16px 9px 10px;
  display: grid; grid-template-columns: auto 210px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; z-index: 15; }
.commandes { grid-row: span 2; display: flex; align-items: center; gap: 4px; }
.lecture { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--actif-bord); background: rgba(143,211,255,.18); display: grid; place-items: center; color: #fff; }
.lecture:hover { background: rgba(143,211,255,.32); }
.lecture .ico { width: 20px; height: 20px; }
.petit { width: 30px; height: 30px; border-radius: 9px; border: 0; background: none; color: var(--doux); display: grid; place-items: center; }
.petit:hover { background: rgba(255,255,255,.08); color: #fff; }
.date { grid-row: span 2; display: flex; flex-direction: column; min-width: 0; }
.date strong { font-size: 23px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.date span { color: var(--ocre); font-size: 13px; font-weight: 600; line-height: 1.25; }
.curseur { position: relative; padding-top: 2px; }
#courbe { display: block; width: 100%; height: 30px; }
.curseur input { width: 100%; accent-color: var(--glace); margin: -3px 0 0; position: relative; }
.jalons { position: relative; height: 17px; font-size: 10.5px; color: var(--pale); }
.jalons span { position: absolute; translate: -50% 0; white-space: nowrap; cursor: pointer; top: 1px; padding: 0 2px; }
.jalons span:hover { color: #fff; }
.jalons span:first-child { translate: 0 0; } .jalons span:last-child { translate: -100% 0; }
.mesures { grid-column: 3; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--doux); min-height: 17px; }
.mesures span { display: inline-flex; align-items: center; gap: 5px; }
.mesures .ico { width: 14px; height: 14px; color: var(--glace); }
.mesures b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── repères à l'écran ── */
.hud { position: fixed; right: 12px; bottom: 28px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 14; pointer-events: none; }
.hud > div { border-radius: 12px; }
.boussole { width: 52px; height: 52px; padding: 5px; border-radius: 50% !important; }
.boussole svg { width: 100%; height: 100%; overflow: visible; }
.boussole circle { fill: none; stroke: var(--bord-fort); }
.boussole .n { fill: var(--braise); } .boussole .s { fill: var(--doux); opacity: .6; }
.boussole text { font-size: 7px; font-weight: 800; fill: var(--texte); text-anchor: middle; }
#aiguille { transform-origin: 20px 20px; }
.echelle-barre { padding: 6px 10px 5px; font-size: 11px; color: var(--doux); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.echelle-barre i { display: block; height: 5px; border: 1.5px solid var(--texte); border-top: 0; min-width: 20px; }
.pointeur { padding: 5px 10px; font-size: 11.5px; color: var(--doux); font-variant-numeric: tabular-nums; min-width: 150px; text-align: right; }
.pointeur:empty { display: none; }
body.grotte .hud .boussole, body.grotte .hud .echelle-barre { display: none; }

/* ── fiche ── */
.fiche { position: fixed; top: calc(var(--haut) + 24px); right: 12px; width: 340px; max-height: calc(100vh - var(--haut) - 280px); overflow: auto; border-radius: var(--rayon); padding: 14px 16px; z-index: 16; scrollbar-width: thin; }
.fiche h3 { margin: 0 26px 2px 0; font-size: 18px; }
.fiche h4 { margin: 14px 0 5px; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--pale); }
.fiche p { margin: 4px 0; color: var(--doux); }
.fiche a { color: var(--glace); }
.fiche .fermer { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--doux); padding: 4px; border-radius: 8px; }
.fiche .fermer:hover { background: rgba(255,255,255,.08); color: #fff; }
.fiche .col { display: grid; grid-template-columns: 12px 1fr auto; gap: 7px; align-items: center; font-size: 12.5px; margin: 2px 0; }
.fiche .col i { width: 12px; height: 12px; border-radius: 3px; }
.fiche .attente { color: var(--pale); font-style: italic; }
.fiche .source { font-size: 11px; color: var(--pale); }
.fiche .chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 4px; }
.fiche .chiffres div { background: rgba(255,255,255,.05); border: 1px solid var(--bord); border-radius: 10px; padding: 6px 9px; }
.fiche .chiffres b { display: block; font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.fiche .chiffres small { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.fiche .action { margin-top: 10px; width: 100%; border: 1px solid rgba(224,164,88,.55); background: rgba(224,164,88,.18); color: #fff; border-radius: 10px; padding: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ── chargement ── */
.chargement { position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; background: rgba(6, 12, 24, .6); transition: opacity .6s; }
.chargement.fini { opacity: 0; pointer-events: none; }
.carte-chargement { border-radius: var(--rayon); padding: 22px 28px; display: grid; justify-items: center; gap: 9px; min-width: 280px; text-align: center; }
.carte-chargement .logo { width: 56px; height: 56px; }
.carte-chargement strong { letter-spacing: .24em; font-size: 16px; }
.carte-chargement span { color: var(--doux); font-size: 13px; }
.jauge { width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.jauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glace), var(--lilas), var(--ocre)); transition: width .3s; }

/* ── visite guidée ── */
dialog { border-radius: var(--rayon); padding: 0; color: var(--texte); width: min(480px, calc(100vw - 24px)); background: var(--verre-fort); }
dialog::backdrop { background: rgba(4, 10, 20, .4); }
.aide-corps { padding: 20px 22px 14px; }
.aide-pas h3 { margin: 0 0 8px; font-size: 19px; display: flex; gap: 10px; align-items: center; }
.aide-pas h3 .ico { color: var(--glace); width: 24px; height: 24px; }
.aide-pas p { color: var(--doux); margin: 6px 0; }
.aide-pied { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--pale); font-size: 12px; }
.aide-pied button { border: 1px solid var(--bord); background: rgba(255,255,255,.05); border-radius: 9px; padding: 7px 14px; }
.aide-pied .primaire { background: rgba(143,211,255,.22); border-color: var(--actif-bord); color: #fff; font-weight: 600; }
.raccourcis { display: flex; align-items: center; gap: 8px; color: var(--pale); font-size: 11.5px; margin: 14px 0 0; border-top: 1px solid var(--bord); padding-top: 10px; }

.credits { position: fixed; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: rgba(230, 240, 255, .8); text-shadow: 0 1px 2px rgba(0,0,0,.75); pointer-events: none; z-index: 10; padding: 0 12px; }

/* ── la grotte ── */
body.grotte .panneau, body.grotte #b-calques { display: none; }
body.grotte::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at 50% 52%, transparent 50%, rgba(0,0,0,.5) 100%); }

@media (max-width: 1100px) {
  .nom { display: none; }
  .bouton-ico .lib { display: none; }
  .bouton-ico { padding: 8px 9px; }
}
@media (max-width: 860px) {
  :root { --haut: 52px; }
  .echelles .lib, .onglets .lib { display: none; }
  .echelles button, .onglets button { padding: 7px 9px; }
  .logo { width: 34px; height: 34px; }
  .panneau { width: calc(100vw - 24px); max-height: 44vh; }
  .temps { grid-template-columns: auto 1fr; padding: 8px 12px 8px 8px; bottom: 24px; }
  .temps .curseur, .temps .mesures { grid-column: 1 / -1; }
  .date strong { font-size: 18px; }
  .fiche { left: 12px; width: auto; top: auto; bottom: 178px; max-height: 38vh; }
  .hud { bottom: auto; top: calc(var(--haut) + 22px); }
  .pointeur, .echelle-barre { display: none; }
  .credits { font-size: 9px; }
  .jalons span:not(:first-child):not(:last-child) { font-size: 0; padding: 0 4px; }
  .jalons span:not(:first-child):not(:last-child)::before { content: ""; display: block; width: 2px; height: 7px; border-radius: 1px; background: var(--pale); }
}
