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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Share Tech Mono', monospace;
  color: #00f0ff;
  cursor: crosshair;
}

#scene-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
}

#scene-container canvas {
  display: block;
}

/* Welcome Modal */
#welcome-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: radial-gradient(ellipse at center, #0a0a2a 0%, #000008 70%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 1.5s ease;
}

#welcome-modal.fade-out {
  opacity: 0;
  pointer-events: none;
}

#welcome-content {
  text-align: center;
  position: relative;
}

.welcome-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(32px, 7vw, 72px);
  letter-spacing: 0.15em;
  background: linear-gradient(180deg, #00f0ff 0%, #0066ff 50%, #aa00ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 8px;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% { filter: brightness(1) drop-shadow(0 0 20px rgba(0,240,255,0.3)); }
  100% { filter: brightness(1.2) drop-shadow(0 0 40px rgba(0,240,255,0.6)); }
}

.welcome-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 2.5vw, 22px);
  letter-spacing: 0.3em;
  color: #4488aa;
  margin-bottom: 16px;
}

.welcome-tagline {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(11px, 1.5vw, 15px);
  color: #556677;
  margin-bottom: 40px;
}

#begin-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: #00f0ff;
  background: transparent;
  border: 1px solid #00f0ff;
  padding: 14px 48px;
  cursor: pointer;
  transition: all 0.4s ease;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

#begin-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.15), transparent);
  transition: left 0.5s ease;
}

#begin-btn:hover {
  background: rgba(0,240,255,0.1);
  box-shadow: 0 0 30px rgba(0,240,255,0.3), inset 0 0 30px rgba(0,240,255,0.05);
}

#begin-btn:hover::before {
  left: 100%;
}

.welcome-controls {
  margin-top: 32px;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.welcome-controls span {
  font-size: 11px;
  color: #334455;
  letter-spacing: 0.1em;
}

/* HUD */
#hud {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 100;
}

.hud-panel {
  background: rgba(6, 8, 30, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 12px 16px;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  position: absolute;
}

.hud-dim { color: #4488aa; font-size: 11px; line-height: 1.6; }
.hud-bright { color: #00f0ff; font-size: 14px; font-family: 'Orbitron', sans-serif; font-weight: 700; }

#hud-top-left {
  top: 16px; left: 16px;
  min-width: 200px;
}

#hud-top-right {
  top: 16px; right: 16px;
}

#hud-bottom-center {
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  text-align: center;
}

#speed-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 3px;
  margin-top: 6px;
  position: relative;
  overflow: visible;
}

#speed-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #aa00ff);
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s ease;
  box-shadow: 0 0 10px rgba(0,240,255,0.5);
}

#speed-bar-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: #334455;
}

#hud-bottom-left {
  bottom: 48px;
  left: 16px;
}

#hud-bottom-right {
  bottom: 48px;
  right: 16px;
  text-align: center;
}

#time-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: center;
}

.time-btn {
  font-family: 'Share Tech Mono', monospace;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #00f0ff;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.time-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 10px rgba(0,240,255,0.3);
}

/* Search Panel */
#search-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(6, 8, 30, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 20px;
  min-width: 340px;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  z-index: 200;
}

#search-input {
  width: 100%;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #00f0ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
}

#search-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 15px rgba(0,240,255,0.2);
}

#search-results {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

.search-result-item {
  padding: 6px 8px;
  cursor: pointer;
  color: #4488aa;
  font-size: 12px;
  border-bottom: 1px solid rgba(0,240,255,0.05);
  transition: all 0.15s;
}

.search-result-item:hover {
  background: rgba(0, 240, 255, 0.1);
  color: #00f0ff;
}

/* Info Card */
#info-card {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: rgba(6, 8, 30, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 20px;
  min-width: 260px;
  max-width: 300px;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateY(-50%) translateX(40px); opacity: 0; }
  to { transform: translateY(-50%) translateX(0); opacity: 1; }
}

/* Footer */
#footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #223344;
  padding: 6px;
  z-index: 100;
  pointer-events: auto;
}

#footer a {
  color: #336677;
  text-decoration: none;
}

#footer a:hover {
  color: #00f0ff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.3); border-radius: 2px; }

/* Mobile adjustments */
@media (max-width: 768px) {
  #hud-top-right { display: none; }
  #hud-bottom-left { display: none; }
  #hud-bottom-center { min-width: 200px; }
  .hud-panel { padding: 8px 10px; }
  #search-panel { min-width: 280px; }
  #info-card { min-width: 220px; max-width: 250px; }
}