/* Mode sombre « course de nuit ». (chargé après 03-components.css, l'ordre compte pour la cascade) */

/* ---------- Mode sombre (bouton manuel, mémorisé) : « course de nuit » ---------- */
:root[data-theme='dark'] {
  color-scheme: dark;
  --accent: #ff7a1a;
  --accent-50: #3a2414;
  --accent-strong: #ff9447;
  --on-accent: #121314;
  --danger: #ff4b55;
  --danger-text: #ff8a90;
  --danger-50: #3a1c1e;
  --ink: #eeeae1;
  --hunter: #4fa3c4;
  --hunter-50: #15303a;
  --hunter-text: #8cc8de;
  --warn-text: #e3c27e;
  --warn-50: #352d1e;
  --ok: #5fbf85;
  --ok-text: #9cddb5;
  --ok-50: #1c3125;
  --gold: #e0b040;
  --sky: #6aa8f0;

  --bg: #121314;
  --surface: #1b1d1f;
  --surface-2: #24272a;
  --line: #2f3236;
  --text: #eeeae1;
  --muted: #8e8a80;
  --spectator: #7d8287;
  --rally: #5aa3cc;

  /* événements trop sombres pour le fond de nuit : version éclaircie */
  --ev-decoy: #f06595;
  --ev-invisible: #9599b8;
  --ev-silence: #a8a49a;
  --ev-power: #9d7bf0;
  --ev-chat: #5b9cf0;
  --ev-master: #44474a; /* pastille sombre : le picto blanc reste lisible */

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
}
:root[data-theme='dark'] .switch input:checked + span::after {
  background: var(--bg);
}
:root[data-theme='dark'] .modal {
  background: rgba(0, 0, 0, 0.65);
}
:root[data-theme='dark'] .fab.follow:active {
  background: #fff;
}

/* Carte : tuiles du plan OSM assombries par filtre (le satellite n'est pas touché) */
:root[data-theme='dark'] #map {
  background: #191b1d;
}
:root[data-theme='dark'] .tiles-plan {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.35);
}
:root[data-theme='dark'] .leaflet-container .leaflet-control-attribution {
  background: rgba(18, 19, 20, 0.75);
  color: var(--muted);
}
:root[data-theme='dark'] .leaflet-control-attribution a {
  color: var(--text);
}
:root[data-theme='dark'] .pin {
  box-shadow:
    0 0 0 2.5px #121314,
    0 1px 4px rgba(0, 0, 0, 0.5);
}
:root[data-theme='dark'] .pic {
  filter: drop-shadow(0 0 1.2px #121314) drop-shadow(0 0 1.2px #121314);
}
:root[data-theme='dark'] .pin-label.old,
:root[data-theme='dark'] .obj-pin b {
  text-shadow:
    0 0 3px #121314,
    0 0 3px #121314;
}
