*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a12; }

#map { width: 100%; height: 100%; }

/* ── HUD ── */
#hud {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  background: rgba(8, 8, 18, 0.70);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
  color: #d0d8f0;
  user-select: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* time display */
#time-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
#time-label {
  font-size: 22px;
  font-weight: 700;
  color: #7eb8f7;
  letter-spacing: 0.5px;
  min-width: 80px;
}
#era-label {
  font-size: 12px;
  color: rgba(180,190,220,0.55);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* transport controls */
#controls {
  display: flex;
  gap: 8px;
}
#controls button {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #c8d4f0;
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
#controls button:hover { background: rgba(255,255,255,0.14); }
#controls button:active { background: rgba(255,255,255,0.20); }
#btn-play { min-width: 44px; text-align: center; }

/* slider */
#slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slider-end-label { font-size: 10px; color: rgba(180,190,220,0.45); white-space: nowrap; }

#time-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7eb8f7;
  border: 2px solid rgba(8,8,18,0.8);
  cursor: grab;
}
#time-slider:active::-webkit-slider-thumb { cursor: grabbing; }

/* status / cache bar */
#status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 14px;
}
#cache-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  cursor: default;
}
#cache-bar {
  height: 100%;
  width: 0%;
  background: rgba(126,184,247,0.45);
  border-radius: 2px;
  transition: width 0.3s ease;
}
#status-label {
  font-size: 10px;
  color: rgba(180,190,220,0.45);
  min-width: 90px;
  text-align: right;
  white-space: nowrap;
}

/* speed control */
#speed-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#speed-row label { font-size: 11px; color: rgba(180,190,220,0.50); }
#speed-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7eb8f7;
  border: 2px solid rgba(8,8,18,0.8);
  cursor: grab;
}
#speed-slider:active::-webkit-slider-thumb { cursor: grabbing; }
#speed-label { font-size: 11px; color: rgba(180,190,220,0.45); min-width: 38px; text-align: right; }

/* model picker */
#model-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#model-row label { font-size: 11px; color: rgba(180,190,220,0.50); }
#model-select {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: #c8d4f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
#model-select:focus { border-color: rgba(126,184,247,0.4); }
#model-select option { background: #0d0d20; }
