/*
 * ═══════════════════════════════════════════════════════════════════
 * SWEET SPOT — Feuille de styles partagée
 * Utilisée par index.html (visiteurs) et editor.html (éditeur)
 * ═══════════════════════════════════════════════════════════════════
 */


/* ── Variables de design ──────────────────────────────────────────
   Toutes les couleurs et polices sont définies ici en un seul endroit.
   Pour changer le thème, modifiez ces valeurs.
   ────────────────────────────────────────────────────────────────── */
:root {
  /* Fonds */
  --bg:       #080c10;   /* fond principal (très sombre) */
  --surface:  #0f1520;   /* fond panneau latéral */
  --surface2: #161f2e;   /* fond éléments secondaires */

  /* Bordures et textes */
  --border: rgba(180, 200, 255, 0.1);
  --text:   #d8e4f0;
  --muted:  rgba(216, 228, 240, 0.4);  /* texte atténué */

  /* Couleur dorée — accent principal */
  --gold:     #c8a96e;
  --gold-dim: rgba(200, 169, 110, 0.12);  /* fond doré très léger */
  --gold-b:   rgba(200, 169, 110, 0.3);   /* bordure dorée */

  /* Couleurs fonctionnelles */
  --danger: #e05555;  /* rouge suppression */
  --green:  #4ade80;  /* vert confirmation */
  --blue:   #60a5fa;  /* bleu édition */

  /* Polices */
  --mono:  'DM Mono', monospace;           /* interface, données */
  --serif: 'Cormorant Garamond', serif;    /* titres, noms de lieux */

  /* Dimensions */
  --sidebar-w: 340px;  /* largeur du panneau latéral sur desktop */
}


/* ── Reset minimal ────────────────────────────────────────────────
   Supprime les marges par défaut du navigateur et adopte
   box-sizing: border-box (le padding est inclus dans la largeur).
   ────────────────────────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  height: 100vh;
  display: flex;
  overflow: hidden;  /* empêche le scroll de la page entière */
}


/* ══════════════════════════════════════════════════════════════════
   CARTE LEAFLET
   ══════════════════════════════════════════════════════════════════ */

/* La carte occupe tout l'espace restant à gauche de la sidebar */
#map {
  flex: 1;
  height: 100vh;
}

/* Filtre CSS appliqué sur les tuiles OpenStreetMap pour un rendu sombre */
.leaflet-tile {
  filter: saturate(0.3) brightness(0.28) hue-rotate(200deg);
}

/* Boutons zoom de Leaflet — adaptés au thème sombre */
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Popup Leaflet au clic sur un marqueur */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 2px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7) !important;
}
.leaflet-popup-content {
  color: var(--text) !important;
  font-family: var(--mono) !important;
  font-size: 0.66rem !important;
  margin: 9px 12px !important;
}
.leaflet-popup-tip        { background: var(--surface) !important; }
.leaflet-popup-close-button { color: var(--muted) !important; }

/* Contenu de la popup : nom, date, description */
.popup-name {
  font-family: var(--serif);
  font-size: 0.97rem;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.popup-meta {
  color: var(--muted);
  font-size: 0.57rem;
}
.popup-desc {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 200px;
}


/* ══════════════════════════════════════════════════════════════════
   MARQUEURS SUR LA CARTE
   ══════════════════════════════════════════════════════════════════ */

/* Marqueur de base : cercle coloré */
.map-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.6);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.map-marker:hover {
  transform: scale(1.2);
}

/* Animation pulsante quand un son est en lecture */
.map-marker.playing {
  animation: markerPulse 0.6s ease-in-out infinite alternate;
}
@keyframes markerPulse {
  from { box-shadow: 0 0 4px 2px currentColor; }
  to   { box-shadow: 0 0 16px 6px currentColor; }
}

/* Anneau qui s'étend vers l'extérieur en permanence */
.map-marker::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  animation: ring 2.8s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(2);    opacity: 0; }
}

/* Marqueur temporaire (point en cours de placement dans l'éditeur) */
.temp-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(200,169,110,0.15);
  border: 2px dashed var(--gold);
  animation: tempPulse 1s ease-in-out infinite alternate;
}
@keyframes tempPulse {
  from { transform: scale(0.9); opacity: 0.7; }
  to   { transform: scale(1.1); opacity: 1; }
}

/* Marqueurs plus grands sur mobile pour faciliter le tap */
@media (max-width: 699px) {
  .map-marker { width: 26px; height: 26px; }
}


/* ══════════════════════════════════════════════════════════════════
   PANNEAU LATÉRAL (sidebar)
   ══════════════════════════════════════════════════════════════════ */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

/* ── En-tête sidebar ── */
.sidebar-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(200,169,110,0.06), transparent);
  flex-shrink: 0;
}
.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.header-titles h1 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}
.header-titles h1 em {
  color: var(--gold);
  font-style: italic;
}
.header-titles .tagline {
  margin-top: 3px;
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Boutons éditeur / visiteur ── */
.mode-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
}
.mode-btn {
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-btn.active         { background: var(--gold); color: var(--bg); font-weight: 500; }
.mode-btn.active.visitor { background: #2d6a4f; color: #d8f3dc; }

/* ── Onglets (Ajouter / Liste) ── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab {
  flex: 1;
  padding: 10px 0;
  font-size: 0.59rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--mono);
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Panneaux de contenu ── */
.panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
}
.panel.active { display: flex; }

/* Masquer les éléments réservés à l'éditeur en mode visiteur */
body.visitor-mode .editor-only { display: none !important; }


/* ══════════════════════════════════════════════════════════════════
   LISTE DES POINTS (panneau "Points")
   ══════════════════════════════════════════════════════════════════ */

#panel-list { gap: 0; }

/* Message affiché quand la liste est vide */
.list-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.9;
}
.list-empty .big {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--border);
}

/* Chaque ligne de la liste */
.point-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.point-item:hover { background: rgba(255,255,255,0.02); }

/* Pastille de couleur */
.item-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bloc texte (nom + métadonnées) */
.item-info { flex: 1; min-width: 0; }
.item-name {
  font-size: 0.79rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta {
  font-size: 0.57rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Petit point de statut de chargement audio */
.load-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}
.load-dot.loading { background: var(--gold); animation: dotPulse 1s ease-in-out infinite alternate; }
.load-dot.ready   { background: var(--green); }
@keyframes dotPulse { from { opacity: 0.3; } to { opacity: 1; } }

/* Description courte (2 lignes max) */
.item-desc {
  font-size: 0.61rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Boutons d'action (écouter, centrer, modifier, supprimer) */
.item-actions { display: flex; gap: 4px; }


/* ══════════════════════════════════════════════════════════════════
   BOUTONS GÉNÉRIQUES
   ══════════════════════════════════════════════════════════════════ */

/* Petit bouton icône (carré) */
.icon-btn {
  width: 28px; height: 28px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover          { color: var(--text);  border-color: rgba(180,200,255,0.3); }
.icon-btn.danger:hover   { color: var(--danger); border-color: var(--danger); }
.icon-btn.play-btn:hover { color: var(--gold);   border-color: var(--gold); }
.icon-btn.edit-btn:hover { color: var(--blue);   border-color: var(--blue); }

/* Gros bouton texte */
.btn {
  padding: 9px 15px;
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.18s;
  border: 1px solid;
}
.btn-primary          { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 500; }
.btn-primary:hover    { background: #dab97e; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ghost            { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover      { color: var(--text); border-color: rgba(180,200,255,0.25); }

/* Rangée de deux boutons côte à côte */
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }


/* ══════════════════════════════════════════════════════════════════
   BARRE DE LECTURE (player bar)
   Fixée en bas de l'écran, cachée par défaut (translateY 100%)
   ══════════════════════════════════════════════════════════════════ */

#player-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 8px 18px 10px;
  gap: 6px;
  z-index: 2000;
  transform: translateY(100%);     /* cachée par défaut */
  transition: transform 0.3s ease;
}
#player-bar.visible { transform: translateY(0); }  /* apparaît à la lecture */

/* Ligne du haut : pastille + nom + icône onde */
.player-top  { display: flex; align-items: center; gap: 11px; }
.player-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.player-name {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-meta { font-size: 0.56rem; color: var(--muted); letter-spacing: 0.07em; white-space: nowrap; }

/* Animation de barres représentant le son */
.waveform { display: flex; align-items: center; gap: 3px; height: 17px; flex-shrink: 0; }
.wave-bar {
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  animation: wavebar 0.5s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 5px;  animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.08s; }
.wave-bar:nth-child(3) { height: 17px; animation-delay: 0.04s; }
.wave-bar:nth-child(4) { height: 12px; animation-delay: 0.12s; }
.wave-bar:nth-child(5) { height: 5px;  animation-delay: 0.06s; }
@keyframes wavebar { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }

/* Barre de progression cliquable */
.player-progress { display: flex; align-items: center; gap: 8px; }
.progress-time {
  font-size: 0.56rem; color: var(--muted);
  min-width: 30px; text-align: center; flex-shrink: 0;
}
.progress-track {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; cursor: pointer;
  transition: height 0.12s; position: relative;
}
.progress-track:hover { height: 5px; }
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(to right, var(--gold), #e8c98e);
  width: 0%; pointer-events: none; position: relative;
}
/* Petit cercle qui apparaît au survol de la barre */
.progress-fill::after {
  content: '';
  position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); opacity: 0; transition: opacity 0.12s;
}
.progress-track:hover .progress-fill::after { opacity: 1; }

/* Contrôle de volume */
.player-volume { display: flex; align-items: center; gap: 6px; }
.vol-icon {
  font-size: 0.77rem; cursor: pointer; flex-shrink: 0;
  user-select: none; color: var(--muted); transition: color 0.15s;
  width: 16px; text-align: center; line-height: 1;
}
.vol-icon:hover { color: var(--text); }
#vol-slider { width: 68px; flex-shrink: 0; }
#vol-slider.boosted::-webkit-slider-thumb { background: #f5a623; }  /* curseur orange si > 100% */
.vol-pct { font-size: 0.54rem; color: var(--muted); min-width: 30px; text-align: right; flex-shrink: 0; }
.vol-pct.boosted { color: #f5a623; }  /* texte orange si > 100% */


/* ══════════════════════════════════════════════════════════════════
   TOAST (notification temporaire)
   ══════════════════════════════════════════════════════════════════ */

#toast {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%) translateY(-60px);  /* caché au-dessus */
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.66rem; letter-spacing: 0.06em;
  border-radius: 2px;
  z-index: 5000;
  transition: transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show    { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: rgba(74,222,128,0.4); color: var(--green); }
#toast.warning { border-color: rgba(200,169,110,0.4); color: var(--gold); }
#toast.error   { border-color: rgba(224,85,85,0.4);  color: var(--danger); }


/* ══════════════════════════════════════════════════════════════════
   ÉCRAN DE CHARGEMENT (overlay au démarrage)
   ══════════════════════════════════════════════════════════════════ */

#load-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  transition: opacity 0.4s ease;
}
#load-overlay.fade { opacity: 0; pointer-events: none; }

.load-logo { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; }
.load-logo em { color: var(--gold); font-style: italic; }
.load-sub  { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.load-bar-wrap {
  width: 180px; height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 1px; overflow: hidden;
}
.load-bar {
  height: 100%; background: var(--gold);
  width: 0%; transition: width 0.3s ease; border-radius: 1px;
}
.load-status { font-size: 0.6rem; color: var(--muted); letter-spacing: 0.06em; }


/* ══════════════════════════════════════════════════════════════════
   FORMULAIRES (champs texte, date, textarea, slider)
   ══════════════════════════════════════════════════════════════════ */

.field-group { display: flex; flex-direction: column; gap: 5px; }

label {
  font-size: 0.57rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Champs texte et date */
input[type="text"],
input[type="date"] {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.77rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  border-radius: 2px;
  color-scheme: dark;  /* adapte le sélecteur de date au thème sombre */
}
input[type="text"]:focus,
input[type="date"]:focus { border-color: var(--gold-b); }

/* Zone de texte multiligne */
textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.73rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  border-radius: 2px;
  resize: vertical;
  min-height: 68px;
  line-height: 1.5;
}
textarea:focus { border-color: var(--gold-b); }

.char-count { font-size: 0.55rem; color: var(--muted); text-align: right; }

/* Slider (range input) */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 2px;
  background: var(--border);
  outline: none; border: none; padding: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer; border: none;
}

/* Pastilles de choix de couleur */
.color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.color-preset {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.color-preset:hover    { transform: scale(1.2); }
.color-preset.selected { border-color: white; transform: scale(1.15); }

/* Zone de dépôt de fichier audio */
.audio-drop {
  border: 1.5px dashed var(--border);
  border-radius: 2px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.audio-drop:hover,
.audio-drop.dragover { border-color: var(--gold); background: var(--gold-dim); }
.audio-drop input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.audio-drop .drop-icon { font-size: 1.3rem; margin-bottom: 4px; }
.audio-drop .drop-text { font-size: 0.65rem; color: var(--muted); line-height: 1.5; }
.audio-drop .drop-text strong { color: var(--gold); }

/* Affichage après chargement d'un fichier audio */
.audio-loaded {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-b);
  border-radius: 2px;
  padding: 8px 10px;
}
.audio-loaded .fname {
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.65rem;
}

/* Étiquette d'étape numérotée (① ② ③) */
.step-label {
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

/* Encadré d'aide (astuce carte, coordonnées) */
.map-hint {
  background: var(--gold-dim);
  border: 1px solid var(--gold-b);
  border-radius: 2px;
  padding: 9px 12px;
  font-size: 0.67rem;
  line-height: 1.5;
}
.coords-display {
  font-size: 0.69rem; color: var(--gold);
  margin-top: 4px; font-weight: 500; min-height: 1.1em;
}


/* ══════════════════════════════════════════════════════════════════
   MODALE D'ÉDITION
   ══════════════════════════════════════════════════════════════════ */

/* Fond semi-transparent derrière la modale */
#edit-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
#edit-overlay.open { opacity: 1; pointer-events: all; }

#edit-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 320px; max-width: calc(100vw - 32px);
  max-height: 90vh; overflow-y: auto;
  border-radius: 3px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  transform: translateY(12px);
  transition: transform 0.2s;
}
#edit-overlay.open #edit-modal { transform: translateY(0); }

.modal-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(200,169,110,0.05), transparent);
}
.modal-header h2             { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.modal-header h2 em          { color: var(--gold); font-style: italic; }
.modal-body                  { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-footer                { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.modal-footer .btn           { flex: 1; }

/* Section audio dans la modale (audio actuel + option remplacement) */
.audio-replace       { display: flex; flex-direction: column; gap: 6px; }
.audio-current {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.63rem; color: var(--muted);
  padding: 7px 9px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 2px;
}
.audio-current .ac-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replace-btn {
  font-size: 0.59rem; color: var(--gold); cursor: pointer;
  letter-spacing: 0.07em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 2px;
  background: none; border: none; font-family: var(--mono); padding: 0;
}
.replace-btn:hover { color: #dab97e; }


/* ══════════════════════════════════════════════════════════════════
   SCROLLBAR PERSONNALISÉE
   ══════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }


/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE (< 700px)
   Sur petit écran, la sidebar devient un tiroir coulissant en bas.
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 699px) {

  body { flex-direction: column; }

  /* La carte remplit tout l'écran */
  #map { width: 100%; height: 100vh; flex: none; }

  /* La sidebar se fixe en bas, avec seulement 56px visibles par défaut */
  #sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%; min-width: 0;
    height: auto; max-height: 65vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    z-index: 1500;
    transform: translateY(calc(100% - 56px));  /* ne montre que l'en-tête */
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  }
  #sidebar.open { transform: translateY(0); }

  /* Poignée de drag visuelle en haut du tiroir */
  .sidebar-header::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 0 auto 10px;
  }
  .sidebar-header {
    padding: 8px 16px 10px;
    cursor: pointer;
  }
  .header-titles .tagline { display: none; }

  /* Player bar au-dessus du tiroir */
  #player-bar { bottom: 56px; }

  /* Éléments plus grands pour faciliter le tactile */
  .point-item { padding: 14px 16px; }
  .icon-btn   { width: 34px; height: 34px; font-size: 0.85rem; }

  /* Modale pleine largeur */
  #edit-modal { width: calc(100vw - 24px); }
}
