* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; color: #fff; }
canvas { display: block; width: 100%; height: 100%; }

/* Loading overlay */
#loading {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.95);
  transition: opacity 0.5s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.loading-inner { text-align: center; }
.loading-inner h1 { font-size: 2.5rem; letter-spacing: 0.3em; margin-bottom: 1rem; color: #6af; }
.loading-inner p { font-size: 1rem; color: #aaa; margin-bottom: 1.5rem; }
.spinner {
  width: 40px; height: 40px; margin: 0 auto;
  border: 3px solid rgba(100,170,255,0.2); border-top-color: #6af;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; padding: 1rem; }
#hud > * { pointer-events: auto; }

#hud-top-left { position: absolute; top: 1rem; left: 1rem; }
.hud-title { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.15em; color: #6af; }
#hud-top-left div { font-size: 0.85rem; color: #ccc; margin-top: 0.2rem; }

#hud-top-right { position: absolute; top: 1rem; right: 1rem; text-align: right; }
#hud-top-right div { font-size: 0.85rem; color: #ccc; margin-top: 0.2rem; }

#hud-bottom {
  position: absolute; bottom: 1rem; left: 1rem; right: 1rem;
  background: rgba(0,0,0,0.6); border-radius: 8px; padding: 0.6rem 1rem;
}
#timeline-controls {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem;
}
#timeline-controls button {
  background: none; border: 1px solid rgba(100,170,255,0.4); color: #6af;
  border-radius: 4px; padding: 0.2rem 0.5rem; cursor: pointer; font-size: 0.8rem;
}
#timeline-controls button:hover { background: rgba(100,170,255,0.15); }
#speed-label { font-size: 0.8rem; color: #6af; margin-left: 0.5rem; min-width: 3em; }

#timeline {
  width: 100%; appearance: none; height: 6px; border-radius: 3px;
  background: rgba(100,170,255,0.2); outline: none; cursor: pointer;
}
#timeline::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #6af; cursor: pointer;
}
#timeline::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #6af; border: none; cursor: pointer;
}

#timeline-labels {
  display: flex; justify-content: space-between; font-size: 0.7rem; color: #888; margin-top: 0.2rem;
}
