/* =========================================================================
   Rejeu de la saison de chasse — bouton film + popup carte + contrôles
   Desktop / tablette uniquement (masqué sur mobile <= 600px)
   ========================================================================= */

/* --- Bouton film (à gauche du sélecteur de langues) --- */
.replay-film-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-right: 8px;
  border: none;
  background-color: rgba(0, 0, 0, 0.2);
  color: #ffece0;
  cursor: pointer;
  border-radius: 30px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.replay-film-btn:hover {
  background-color: rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.replay-film-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  color: #F2F3AE;
}
[data-theme="dark"] .replay-film-btn {
  background-color: rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .replay-film-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Masqué sur mobile : desktop/tablette uniquement */
@media (max-width: 600px) {
  .replay-film-btn { display: none !important; }
}

/* --- Overlay / modal --- */
#replayModal {
  z-index: 12000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#replayModal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.replay-modal-content {
  position: relative;
  width: min(1200px, 95vw);
  height: min(850px, 92vh);
  display: flex;
  flex-direction: column;
  background: #14110f;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(65, 26, 18, 0.95), rgba(40, 16, 10, 0.95));
  color: #ffece0;
  flex: 0 0 auto;
}
.modal-title #replayPeriod {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}
.modal-title #replayPeriod {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.9;
}
#replayClose {
  background: transparent;
  border: none;
  color: #ffd9c4;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.15s ease;
}
#replayClose:hover { color: #ffffff; }

/* --- Carte --- */
.replay-modal-body {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.replay-map {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  background: #0d0b0a;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* --- Encart date + compteur (superposé haut-gauche de la carte) --- */
.replay-info {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  padding: 10px 14px;
  background: rgba(20, 17, 15, 0.82);
  color: #ffece0;
  border: 1px solid rgba(255, 180, 130, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  min-width: 190px;
}
body:not([data-theme="dark"]) .replay-info {
  background: rgba(255, 255, 255, 0.92);
  color: #2a1108;
  border: 1px solid rgba(160, 40, 10, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.replay-date {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}
.replay-count {
  margin-top: 4px;
  font-size: 0.9rem;
  opacity: 0.9;
}
.replay-count .n { font-weight: 700; color: #fdef49; }

/* Légende */
.replay-legend {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(20, 17, 15, 0.82);
  color: #ffece0;
  border-radius: 10px;
  font-size: 0.78rem;
  pointer-events: none;
}
body:not([data-theme="dark"]) .replay-legend {
  background: rgba(255, 255, 255, 0.92);
  color: #2a1108;
}
.replay-legend-item { display: flex; align-items: center; gap: 6px; }
.replay-legend-item .legend-color {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
}

/* --- Barre de contrôles (bas) --- */
.replay-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #0d0b0a;
  color: #ffece0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
body:not([data-theme="dark"]) .replay-controls {
  background: #f5f5f5;
  color: #2a1108;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 180, 130, 0.28);
  background: rgba(65, 26, 18, 0.5);
  color: #ffece0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.replay-btn:hover { background: rgba(120, 50, 30, 0.6); }
.replay-btn:active { transform: scale(0.94); }
.replay-btn svg { width: 20px; height: 20px; display: block; }

/* Scrubber (timeline) */
.replay-scrubber {
  flex: 0 1 auto;
  width: 300px;
  max-width: 300px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #fdef49 0%, #FE7924 60%, #a0280a 100%);
  outline: none;
  cursor: pointer;
}
.replay-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #a0280a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.replay-scrubber::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #a0280a;
  cursor: pointer;
}

/* Presets de vitesse */
.replay-speed {
  display: flex;
  align-items: center;
  gap: 4px;
}
.replay-speed-btn {
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 180, 130, 0.28);
  background: transparent;
  color: #ffece0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.15s ease;
  background: rgba(65, 26, 18, 0.5);
}
.replay-speed-btn:hover { background: rgba(120, 50, 30, 0.5); }
.replay-speed-btn.active {
  background: rgba(65, 26, 18, 0.5);;
  color: #ffece0;
  font-weight: 700;
}

.replay-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  color: #ffece0;
  background: rgba(20, 17, 15, 0.85);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}
.replay-loading.show { display: block; }

@media (max-width: 600px) {
  #replayModal { display: none !important; }
}


.flatpickr-day.today {
    border-color: #f2f3ae !important;
    background: #f2f3ae !important;
    color: black !important;
}

.flatpickr-day.selected {
  border-color: #599056 !important;
  background: #599056 !important;
  color: black !important;  
}
