* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  width: 100%;
  height: 100%;
  background: #020617;
  color: #f8fafc;
  overflow: hidden;
}

#map {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Bandeau du dernier relevé (toujours en haut au centre, priorité visuelle) */
.last-update-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid #334155;
  padding: 8px 18px;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.75rem, 2.2vw, 0.95rem);
  font-weight: bold;
  color: #f8fafc;
  pointer-events: none;
  max-width: 92vw;
  white-space: nowrap;
}
.last-update-banner .time-badge {
  color: #38bdf8;
}

/* Carte d'info : condensée par défaut, encore plus petite sur mobile */
.info-card {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid #334155;
  padding: 10px 12px;
  border-radius: 10px;
  width: 240px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  font-size: 0.78rem;
}
.info-card h3 {
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.status-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.status-text {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: bold;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn {
  width: 100%;
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.75rem;
}
.btn:hover {
  background: #dc2626;
}
.btn:disabled {
  background: #64748b;
  cursor: not-allowed;
}

.legend {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.68rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-active {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}
.dot-recent {
  background: #ea580c;
}
.dot-medium {
  background: #991b1b;
}
.dot-old {
  background: #451a03;
  opacity: 0.6;
}

/* Panneau chronologie, toujours en bas, centré */
.timeline-card {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid #334155;
  padding: 10px 14px;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}
.time-display {
  font-size: clamp(0.8rem, 2.2vw, 1rem);
  font-weight: bold;
  color: #f59e0b;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-play {
  background: #3b82f6;
  width: 64px;
  padding: 6px 4px;
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.btn-play:hover {
  background: #2563eb;
}
.slider {
  flex-grow: 1;
  accent-color: #f59e0b;
  cursor: pointer;
  height: 22px;
}

.leaflet-popup-content {
  font-size: 0.75rem;
  line-height: 1.35;
  margin: 8px 10px;
}
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

/* --- Adaptation mobile / petits écrans --- */
@media (max-width: 640px) {
  .info-card {
    width: 44vw;
    max-width: 200px;
    right: 8px;
    font-size: 0.68rem;
    padding: 6px 12px;
    top: 46px;
    font-size: 0.68rem;
  }
  .info-card h3 {
    font-size: 0.72rem;
  }
  .legend {
    font-size: 0.6rem;
    gap: 3px;
  }
  .dot {
    width: 8px;
    height: 8px;
  }
  .last-update-banner {
    padding: 6px 12px;
    top: 8px;
  }
  .timeline-card {
    width: 94%;
    padding: 8px 10px;
    bottom: 10px;
  }
  .btn-play {
    width: 54px;
    font-size: 0.68rem;
  }
}

@media (max-height: 480px) {
  .info-card {
    display: none;
  } /* évite l'encombrement en paysage sur petit mobile */
}

/* --- Ajout : mini-terminal de logs de chargement API --- */
.terminal-log {
  position: absolute;
  top: 12px;
  right: 262px;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  width: 260px;
  max-height: 160px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.65rem;
  line-height: 1.5;
  color: #38bdf8;
  transition: opacity 0.4s ease;
}
.term-caret {
  display: inline-block;
  animation: term-blink 1s step-end infinite;
}
@keyframes term-blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .terminal-log {
    top: auto;
    bottom: 96px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 100px;
  }
}


