/* Leonida Map : thème « coucher de soleil sur Leonida » (même palette que winfordfa.fr). Polices OFL dans fonts/. */
@font-face { font-family: "Anton"; src: url("../fonts/anton-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Yellowtail"; src: url("../fonts/yellowtail-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("../fonts/rajdhani-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #12032a; --bg-2: #1a0638; --bg-3: #24083f;
  --txt: #fbefff; --txt-2: #d9c6ea; --txt-3: #bfa9d3;
  --rose: #ff3f8e; --rose-2: #ff8fd0; --cyan: #22e5ff; --or: #ffd56e; --orange: #ff8d47; --jaune: #fff3a0;
  --violet: #b03cff; --vert: #3dffa8;
  --ligne: rgba(255, 122, 200, .24); --ligne-2: rgba(255, 122, 200, .5);
  --soleil: linear-gradient(90deg, #ffd56e, #ff8d47 45%, #ff3f8e);
  --titre: linear-gradient(180deg, #fff3a0 10%, #ffb347 38%, #ff4f8b 68%, #c06bff 100%);
  --verre: rgba(26, 6, 56, .82);
  --f-titre: "Anton", Impact, "Arial Narrow", sans-serif;
  --f-ui: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --f-texte: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --haut: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: #0b0220; color: var(--txt); font-family: var(--f-texte); font-size: 16px;
  line-height: 1.5; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--rose-2); }
a:hover { color: var(--jaune); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
h2 { font-family: var(--f-ui); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 14px;
  margin: 22px 0 8px; color: #dffcff; text-shadow: 0 0 6px rgba(34, 229, 255, .7); }
.discret { color: var(--txt-3); font-size: 14px; margin: 4px 0; }

/* ───── Barre du haut ───── */
.barre {
  position: fixed; inset: 0 0 auto; z-index: 20; height: calc(var(--haut) + env(safe-area-inset-top)); display: flex;
  align-items: center; gap: 12px; padding: env(safe-area-inset-top) 14px 0;
  background: linear-gradient(180deg, rgba(18, 3, 42, .96), rgba(18, 3, 42, .72)); border-bottom: 1px solid var(--ligne);
  backdrop-filter: blur(10px);
}
.logo { margin: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.logo-script { font-family: "Yellowtail", cursive; font-weight: 400; font-size: 34px; line-height: 1; background: var(--titre);
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 8px rgba(255, 63, 142, .55)); }
.logo-script.petit { font-size: 30px; }
.logo-bloc { font-family: var(--f-titre); font-size: 22px; letter-spacing: .08em; text-transform: uppercase; color: #dffcff;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--cyan); }

.progression { flex: 1; min-width: 0; max-width: 340px; margin-left: auto; }
.prog-texte { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-ui); font-weight: 700; letter-spacing: .06em; }
.prog-texte strong { font-family: var(--f-titre); font-weight: 400; font-size: 20px; color: var(--jaune); }
.prog-texte span { color: var(--txt-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-barre { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 3px; }
.prog-barre span { display: block; height: 100%; width: 0; background: var(--soleil); box-shadow: 0 0 10px var(--rose);
  transition: width .5s ease; }

/* ───── Boutons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--ligne-2); background: rgba(255, 63, 142, .08); color: var(--txt);
  font-family: var(--f-ui); font-weight: 700; letter-spacing: .05em; white-space: nowrap;
}
.btn:hover { border-color: var(--rose-2); background: rgba(255, 63, 142, .18); }
.btn-plein { background: var(--soleil); color: #2a0430; border-color: transparent; box-shadow: 0 0 16px rgba(255, 63, 142, .45); }
.btn-plein:hover { filter: brightness(1.08); background: var(--soleil); }
.btn.petit { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.danger { border-color: rgba(255, 90, 90, .5); }
.rond {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ligne-2);
  background: var(--verre); font-family: var(--f-ui); font-weight: 700; font-size: 18px; backdrop-filter: blur(8px);
}
.rond:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 229, 255, .45); }
.ligne-btn { display: flex; flex-wrap: wrap; gap: 8px; }
.ligne-btn.fin { justify-content: flex-end; margin-top: 16px; }

/* ───── Carte ───── */
.vue { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none;
  background: radial-gradient(120% 90% at 75% 85%, #2a0a4a, #0b0220 70%); }
.vue.glisse { cursor: grabbing; }
.vue.mode-ajout { cursor: crosshair; }
.scene { position: absolute; left: 0; top: 0; width: 1000px; height: 1254px; transform-origin: 0 0; --inv: 1; will-change: transform; }
.fond { width: 1000px; height: 1254px; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.calque { position: absolute; inset: 0; }

.pin {
  --c: var(--rose); position: absolute; padding: 0; border: 0; background: none; transform: translate(-50%, -100%) scale(var(--inv));
  transform-origin: 50% 100%; display: flex; flex-direction: column; align-items: center; touch-action: none;
}
.pin-icone {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: rgba(26, 6, 56, .92); border: 2px solid var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 8px rgba(255, 255, 255, .08);
  font-size: 16px; line-height: 1; transition: transform .15s ease;
}
.pin-emoji { display: block; transform: rotate(45deg); font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.pin:hover .pin-icone, .pin.choisi .pin-icone { transform: rotate(-45deg) scale(1.18); }
.pin.choisi .pin-icone { background: var(--c); box-shadow: 0 0 22px var(--c), 0 0 4px #fff; }
.pin.trouve .pin-icone { opacity: .55; filter: grayscale(.4); }
.pin.trouve::after {
  content: "✓"; position: absolute; top: -6px; right: -8px; width: 18px; height: 18px; display: grid; place-items: center;
  border-radius: 50%; background: var(--vert); color: #04261a; font-size: 12px; font-weight: 800; box-shadow: 0 0 8px var(--vert);
}
.pin-perso .pin-icone { border-style: dashed; }

/* Régions : grand nom néon, pas d'épingle */
.pin-region { transform: translate(-50%, -50%) scale(var(--inv)); transform-origin: 50% 50%; }
.pin-region .pin-icone { display: none; }
.pin-nom {
  font-family: var(--f-titre); font-size: clamp(12px, calc(12px * var(--zoom, 1)), 26px); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: #fff6d8; text-shadow: 0 0 2px #fff, 0 0 10px var(--c), 0 0 22px var(--rose), 0 2px 0 rgba(0, 0, 0, .5);
}
.pin-region:hover .pin-nom, .pin-region.choisi .pin-nom { color: #fff; text-shadow: 0 0 4px #fff, 0 0 16px var(--c), 0 0 30px var(--rose); }

/* ───── Zoom, coordonnées, bandeau ───── */
.zoom { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 15; display: grid; gap: 8px; }
.coords { position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 15; font-family: var(--f-ui);
  font-weight: 600; font-size: 13px; color: var(--txt-3); letter-spacing: .06em; pointer-events: none; }
.bandeau {
  position: fixed; left: 50%; top: calc(var(--haut) + 14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 25;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--verre);
  border: 1px solid var(--cyan); box-shadow: 0 0 18px rgba(34, 229, 255, .4); font-family: var(--f-ui); font-weight: 700;
  width: max-content; max-width: calc(100% - 32px);
}

/* ───── Panneau ───── */
.panneau {
  position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); padding: calc(14px + env(safe-area-inset-top)) 18px 24px;
  overflow-y: auto; background: linear-gradient(180deg, rgba(36, 8, 63, .97), rgba(18, 3, 42, .97)); border-right: 1px solid var(--ligne-2);
  box-shadow: 0 0 40px rgba(0, 0, 0, .5); transform: translateX(-105%); transition: transform .25s ease; overscroll-behavior: contain;
}
.panneau.ouvert { transform: none; }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.champ {
  width: 100%; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--ligne-2); background: rgba(11, 2, 32, .7);
  color: var(--txt); font: inherit;
}
.champ:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(34, 229, 255, .2); }
textarea.champ { resize: vertical; }
.option { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 15px; cursor: pointer; }
.option input, .cat input { width: 18px; height: 18px; accent-color: var(--rose); }
.categories { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.cat {
  --c: var(--rose); display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.cat:hover { background: rgba(255, 255, 255, .05); border-color: var(--ligne); }
.cat-emoji { width: 26px; text-align: center; filter: drop-shadow(0 0 4px var(--c)); }
.cat-nom { flex: 1; }
.cat-compte { font-family: var(--f-ui); font-weight: 700; color: var(--c); font-size: 14px; }
.liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liens a { text-decoration: none; font-family: var(--f-ui); font-weight: 700; letter-spacing: .04em; }
.mention { margin-top: 22px; font-size: 13px; color: var(--txt-3); }

/* ───── Fiche d'un lieu ───── */
.fiche {
  --c: var(--rose); position: fixed; z-index: 25; right: 14px; top: calc(var(--haut) + 14px + env(safe-area-inset-top));
  width: min(380px, calc(100% - 28px)); padding: 16px 18px 18px; border-radius: 18px; background: var(--verre);
  border: 1px solid var(--c); box-shadow: 0 0 24px color-mix(in srgb, var(--c) 45%, transparent); backdrop-filter: blur(12px);
}
.fiche h2 { font-family: var(--f-titre); font-weight: 400; font-size: 28px; letter-spacing: .03em; text-transform: none; margin: 2px 40px 8px 0;
  background: var(--titre); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.fiche p { margin: 0 0 10px; }
.fiche-cat { font-family: var(--f-ui); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; color: var(--c); }
.fiche .fermer { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; font-size: 15px; }
.fiche.est-trouve { border-color: var(--vert); }

/* ───── Dialogues et messages ───── */
.dialogue {
  width: min(440px, calc(100% - 32px)); padding: 20px; border-radius: 18px; border: 1px solid var(--ligne-2);
  background: linear-gradient(180deg, #24083f, #1a0638); color: var(--txt); box-shadow: 0 0 40px rgba(255, 63, 142, .3);
}
.dialogue::backdrop { background: rgba(5, 0, 15, .65); backdrop-filter: blur(3px); }
.dialogue h2 { margin-top: 0; font-size: 16px; }
.dialogue label { display: grid; gap: 4px; margin-bottom: 12px; font-family: var(--f-ui); font-weight: 600; }
.dialogue label.option { display: flex; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 40; transform: translate(-50%, 140%);
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--verre); border: 1px solid var(--cyan);
  font-family: var(--f-ui); font-weight: 700; opacity: 0; transition: transform .25s ease, opacity .25s ease; pointer-events: none;
  overflow-wrap: anywhere;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

/* ───── Téléphone ───── */
@media (max-width: 720px) {
  :root { --haut: 58px; }
  .barre { gap: 8px; padding-inline: 10px; }
  .logo-bloc { display: none; }
  .logo-script { font-size: 28px; }
  #btnAjouter span[data-t] { display: none; }
  #btnAjouter { padding: 0 12px; }
  .rond { width: 40px; height: 40px; }
  .fiche { left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-height: 55vh; overflow-y: auto; }
  .coords { display: none; }
  .zoom { bottom: auto; top: calc(var(--haut) + 12px + env(safe-area-inset-top)); right: 10px; }
}
@media (max-width: 380px) {
  .prog-texte span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
