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

body {
  background: #1a1a2e;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

/* Token Modal */
#token-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #2a2a4e;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
  color: #6bff6b;
  margin-bottom: 16px;
  font-weight: 500;
}

.modal-content p {
  margin-bottom: 12px;
  color: #aaa;
}

.modal-content .hint {
  font-size: 12px;
  color: #666;
}

.modal-content .hint a {
  color: #6bff6b;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 14px;
  margin: 16px 0;
}

.modal-content input::placeholder {
  color: #666;
}

.modal-content button {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  background: #6bff6b;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-content button:hover {
  background: #8fff8f;
}

/* Main App */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Mapbox Container */
#map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Three.js Canvas Overlay */
#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Controls Panel */
#controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

#time-display {
  font-size: 32px;
  font-weight: 300;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  color: #6bff6b;
}

#playback-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

#play-pause {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #6bff6b;
  color: #1a1a2e;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.2s;
}

#play-pause:hover {
  transform: scale(1.1);
  background: #8fff8f;
}

#play-pause:active {
  transform: scale(0.95);
}

#speed-controls {
  display: flex;
  gap: 4px;
}

.speed-btn {
  padding: 8px 12px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.speed-btn.active {
  background: #6bff6b;
  color: #1a1a2e;
}

#scrubber-container {
  width: 400px;
}

#scrubber {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
}

#scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #6bff6b;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

#scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#scrubber-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #666;
}

/* Legend */
#legend {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

#legend h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  color: #6bff6b;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #aaa;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

/* Map Controls Hint */
#map-hint {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
  color: #888;
  z-index: 100;
}

/* Station Tooltip */
#station-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 6px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 200;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#tooltip-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

#tooltip-waiting {
  font-size: 12px;
  color: #aaa;
}

/* Mapbox overrides */
.mapboxgl-ctrl-logo {
  opacity: 0.5;
}

.mapboxgl-ctrl-attrib {
  opacity: 0.5;
  font-size: 10px !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #controls {
    width: calc(100% - 40px);
    padding: 12px 16px;
  }

  #scrubber-container {
    width: 100%;
  }

  #time-display {
    font-size: 24px;
  }

  #legend {
    top: auto;
    bottom: 140px;
    right: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  #legend h3 {
    width: 100%;
    margin-bottom: 4px;
  }

  #map-hint {
    display: none;
  }
}
