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

body {
  background: #0a0a12;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
}

#ui {
  position: fixed;
  top: 20px;
  left: 20px;
  max-width: 280px;
  z-index: 10;
  transition: opacity 0.3s;
}

#info h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

#info p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6px;
}

#info .muted {
  color: #888;
  font-size: 11px;
}

#timeline {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}

#timeline-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

#timeline-progress {
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #ffaa00);
  border-radius: 4px;
  transition: width 0.1s;
}

#timeline-marker {
  position: absolute;
  top: -2px;
  width: 4px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.1s;
}

#timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: #888;
}

#stats {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}

.stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.stat:last-child {
  margin-bottom: 0;
}

.stat .label {
  color: #888;
}

.stat.isotope {
  font-family: 'SF Mono', Monaco, monospace;
}

#legend {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
  transition: opacity 0.3s;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #888;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

#side-labels {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  pointer-events: none;
  z-index: 5;
}

#far-label, #near-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

#buttons button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#buttons button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #ui {
    max-width: calc(100% - 80px);
  }

  #side-labels {
    padding: 0 10px;
  }

  #far-label, #near-label {
    font-size: 11px;
    letter-spacing: 1px;
  }

  #legend {
    max-width: calc(100% - 100px);
  }
}

/* Dark scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
