/* =========================
   RDR2 PALETTE (cuir / laiton / parchemin / saloon)
========================= */
:root{
  /* Fond général (charbon/cuir) */
  --bg-0:#070604;     /* presque noir */
  --bg-1:#0c0906;     /* cuir sombre */
  --bg-2:#14100b;     /* chocolat fumé */
  --bg-3:#1a150f;     /* panneau */

  /* Parchemin (légère lueur) */
  --parch-0:#f2e5c9;  /* texte principal */
  --parch-1:#e3d2b0;  /* texte doux */
  --parch-2:#cbb58c;  /* texte secondaire */

  /* Laiton / doré (accent) */
  --brass-0:#c7a04e;  /* doré principal */
  --brass-1:#a9802f;  /* doré sombre */
  --brass-2:#e2c37a;  /* doré clair */

  /* Saloon / bordeaux (accent 2) */
  --wine-0:#6e2323;   /* rouge sombre */
  --wine-1:#3a1212;   /* rouge brûlé */

  /* Traits / bordures */
  --line-0: rgba(199,160,78,.46); /* laiton */
  --line-1: rgba(199,160,78,.22);

  /* Effets */
  --glow: rgba(199,160,78,.38);
  --shadow-0: 0 18px 40px rgba(0,0,0,.62);
  --shadow-1: 0 10px 18px rgba(0,0,0,.42);
  --radius: 18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  color:var(--parch-0);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(199,160,78,.10), transparent 60%),
    radial-gradient(900px 650px at 82% 88%, rgba(110,35,35,.12), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.013) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--bg-0), var(--bg-2));
  font-family: "Crimson Text", serif;
  text-rendering: optimizeLegibility;
}

/* =========================
   NAV (cuir + laiton)
========================= */
.menu-nav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-0);
  background:
    radial-gradient(800px 220px at 50% 0%, rgba(199,160,78,.08), transparent 60%),
    linear-gradient(180deg, rgba(10,8,6,.96), rgba(18,14,10,.92));
  position: static;
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
}

.menu-nav a{
  text-decoration:none;
  color:var(--parch-0);
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(199,160,78,.38);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: var(--shadow-1);
  font-size: 14px;
  font-family: "Cinzel", serif;
  letter-spacing: .35px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.menu-nav a:hover{
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(199,160,78,.18), rgba(255,255,255,.02));
  border-color: rgba(226,195,122,.70);
  box-shadow: 0 12px 22px rgba(0,0,0,.52);
}

.nav-logo{
  padding: 6px 10px !important;
  display:flex;
  align-items:center;
  border-radius: 14px !important;
}

.nav-logo-img{
  height: 40px;
  width: auto;
  display:block;
  filter: sepia(.55) contrast(1.1) brightness(.90);
}

/* =========================
   HEURE (western)
========================= */
.heure-banner{
  text-align:center;
  padding: 14px 18px 6px;
  font-family: "Rye", serif;
  letter-spacing: 2px;
  font-size: clamp(36px, 5vw, 64px);
  color: var(--parch-0);
  text-shadow: 0 3px 0 rgba(0,0,0,.62);
}

/* =========================
   LAYOUT
========================= */
.page{
  padding: 18px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items:start;
}
.page > section:first-child{ order:2; }
.page > section:last-child{ order:1; }

@media (max-width: 980px){
  .page{ grid-template-columns: 1fr; }
  .page > section:first-child,
  .page > section:last-child{ order: initial; }
}

/* =========================
   PANELS (cuir + vignette + filet laiton)
========================= */
.panel{
  border-radius: var(--radius);
  background:
    radial-gradient(900px 600px at 18% 12%, rgba(199,160,78,.10), transparent 60%),
    radial-gradient(900px 600px at 85% 90%, rgba(110,35,35,.08), transparent 62%),
    linear-gradient(180deg, rgba(19,15,11,.78), rgba(28,22,16,.86));
  border: 1px solid var(--line-0);
  box-shadow: var(--shadow-0);
  overflow:hidden;
  position: relative;
}

.panel::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid var(--line-1);
  pointer-events:none;
}

.panelTitle{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  font-family:"Cinzel", serif;
  letter-spacing:.7px;
  background:
    linear-gradient(180deg, rgba(199,160,78,.16), rgba(0,0,0,0));
  border-bottom: 1px solid rgba(199,160,78,.34);
  color: var(--parch-0);
}

.panelTitle small{
  font-family:"Crimson Text", serif;
  opacity:.92;
  color: var(--parch-1);
}

/* =========================
   MAP
========================= */
#map{
  width: 100%;
  height: min(60vh, 680px);
  overflow:hidden;
  display:block;
}

.leaflet-container{ max-width:100%; max-height:100%; }

/* Leaflet controls (cuir + laiton) */
.leaflet-control-zoom a{
  background: rgba(10,8,6,.88) !important;
  border-color: rgba(199,160,78,.52) !important;
  color: var(--parch-0) !important;
  box-shadow: var(--shadow-1) !important;
}
.leaflet-control-zoom a:hover{
  background: rgba(199,160,78,.16) !important;
}

/* Sous la map */
.map-actions{
  padding: 12px 14px 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  text-align:center;
}

.charbon-banner{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(199,160,78,.34);
  background:
    radial-gradient(650px 120px at 50% 0%, rgba(199,160,78,.08), transparent 60%),
    rgba(8,7,5,.52);
  color: var(--parch-0);
  font-weight: 700;
  font-family: "Cinzel", serif;
  letter-spacing: .25px;
}

.copy-under-map{
  width: min(520px, 100%);
  font-family:"Cinzel", serif;
  letter-spacing: .2px;
}

.copyright-under-map{
  width: 100%;
  padding-top: 4px;
  opacity: .9;
  color: var(--parch-2);
  font-size: 14px;
  font-family: "Crimson Text", serif;
}

/* =========================
   CONTENU / FORMULAIRES
========================= */
.main-content{
  padding: 14px;
}

h2{
  margin: 6px 0 10px;
  font-family:"Rye", serif;
  letter-spacing: 1px;
  color: var(--parch-0);
  text-shadow: 0 2px 0 rgba(0,0,0,.62);
}

label{
  display:block;
  margin: 10px 0 6px;
  font-size: 15px;
  color: var(--parch-1);
  font-family:"Cinzel", serif;
  letter-spacing: .25px;
}

select,
input[type="time"],
input[type="number"]{
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(199,160,78,.34);
  background:
    radial-gradient(600px 120px at 30% 0%, rgba(199,160,78,.07), transparent 62%),
    rgba(9,7,5,.62);
  color: var(--parch-0);
  outline:none;
  font-family:"Crimson Text", serif;
  font-size: 16px;
}

select:focus,
input:focus{
  box-shadow: 0 0 0 3px rgba(199,160,78,.20);
  border-color: rgba(226,195,122,.72);
}

/* Boutons (cuir + laiton + touche wine au hover) */
button{
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(199,160,78,.40);
  background:
    radial-gradient(700px 140px at 50% 0%, rgba(199,160,78,.10), transparent 64%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  cursor:pointer;
  font-size: 14px;
  color: var(--parch-0);
  box-shadow: var(--shadow-1);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

button:hover{
  transform: translateY(-1px);
  background:
    radial-gradient(700px 140px at 50% 0%, rgba(110,35,35,.16), transparent 64%),
    linear-gradient(180deg, rgba(199,160,78,.16), rgba(255,255,255,.02));
  border-color: rgba(226,195,122,.80);
  box-shadow: 0 14px 26px rgba(0,0,0,.55);
}

/* =========================
   TABLEAU
========================= */
#resumeTrajet{
  margin-top: 12px;
}

#resumeTrajet h3{
  font-family:"Cinzel", serif;
  letter-spacing:.45px;
  color: var(--parch-0);
}

table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#tableauHoraires thead th{
  position: sticky;
  top: 0;
  background:
    radial-gradient(800px 180px at 50% 0%, rgba(199,160,78,.12), transparent 60%),
    linear-gradient(180deg, rgba(199,160,78,.12), rgba(9,7,5,.92));
  border-bottom: 1px solid rgba(199,160,78,.38);
  font-family:"Cinzel", serif;
  letter-spacing:.7px;
  padding: 12px 10px;
  text-align:left;
  color: var(--parch-0);
  font-size: 16px;
}

#tableauHoraires tbody td{
  border-bottom: 1px solid rgba(199,160,78,.14);
  padding: 11px 10px;
  color: var(--parch-1);
  font-size: 16px;
  line-height: 1.45;
  font-family:"Crimson Text", serif;
}

#tableauHoraires tbody td:first-child{
  font-weight: 700;
  color: var(--parch-0);
}

/* Hover : léger “wine” */
tbody tr:hover{
  background: rgba(110,35,35,.10);
}

/* =========================
   GARE ACTUELLE : contour laiton + pulsation
========================= */
@keyframes pulseGoldRow {
  0%{
    box-shadow:
      inset 0 0 0 2px rgba(199,160,78,.55),
      0 0 0 rgba(199,160,78,0);
  }
  50%{
    box-shadow:
      inset 0 0 0 2px rgba(226,195,122,.95),
      0 0 18px rgba(199,160,78,.42);
  }
  100%{
    box-shadow:
      inset 0 0 0 2px rgba(199,160,78,.55),
      0 0 0 rgba(199,160,78,0);
  }
}

.gare-active td{
  background:
    radial-gradient(650px 120px at 50% 0%, rgba(199,160,78,.14), transparent 62%),
    rgba(110,35,35,.12) !important;
  color: var(--parch-0) !important;
  animation: pulseGoldRow 1.25s ease-in-out infinite;
  border-top: 1px solid rgba(199,160,78,.28);
  border-bottom: 1px solid rgba(199,160,78,.28);
}

.gare-active td:first-child{
  border-left: 1px solid rgba(199,160,78,.42);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.gare-active td:last-child{
  border-right: 1px solid rgba(199,160,78,.42);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Info sous le tableau */
#prochaineGareInfo{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(199,160,78,.28);
  background:
    radial-gradient(700px 150px at 50% 0%, rgba(199,160,78,.08), transparent 64%),
    rgba(9,7,5,.52);
  color: var(--parch-0);
  font-family: "Cinzel", serif;
  letter-spacing: .2px;
}

#prochaineGareInfo .muted{
  font-family:"Crimson Text", serif;
  color: var(--parch-2);
  letter-spacing: 0;
}

/* Sélection texte */
::selection{
  background: rgba(199,160,78,.28);
  color: var(--parch-0);
}

/* ✅ Gare de départ après départ (visible, sans pulsation) */
.gare-recent td{
  background: rgba(199,160,78,.07) !important;
  color: var(--parch-0) !important;
  box-shadow: inset 0 0 0 1px rgba(199,160,78,.35);
}
.gare-recent td:first-child{
  border-left: 1px solid rgba(199,160,78,.35);
}
.gare-recent td:last-child{
  border-right: 1px solid rgba(199,160,78,.35);
}

/* ✅ Gares déjà passées : retirées du tableau */
.gare-passee{ display:none !important; }
