/* World map time-lapse (/map/history). Standalone page, canvas-rendered. */
.map-history {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.map-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.map-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
}

.map-history-title i { opacity: 0.6; }

.map-history-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.map-history-stage {
  position: relative;
  background: var(--cloud-bg2);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.map-history-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
}

/* Date sits over the canvas so the grid keeps the full width. */
.map-history-date {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.map-history-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text);
  opacity: 0.7;
}

/* Controls, counts and legend share one panel: on the page background they sat
   directly on the scenic grass and were barely readable. */
.map-history-panel {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--cloud-bg2);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.map-history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-history-play {
  flex: 0 0 auto;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-history-scrub {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: #ffd76a;
  cursor: pointer;
}

.map-history-speed {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 8px;
}

.map-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text);
  opacity: 0.75;
}

.map-history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
  font-size: 0.82rem;
  color: var(--text);
}

.map-history-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-history-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.map-history-legend-empty { opacity: 0.6; }

@media (max-width: 560px) {
  .map-history { padding: 10px; }
  .map-history-controls { flex-wrap: wrap; }
  .map-history-scrub { order: 3; flex-basis: 100%; }
}

/* Entry point on the world map page. */
.map-history-cta-section {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.map-history-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.map-history-cta small {
  opacity: 0.7;
  font-size: 0.75rem;
  font-weight: 400;
}

@media (max-width: 480px) {
  .map-history-cta small { flex-basis: 100%; }
}
