* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #000; font-family: 'Oswald', sans-serif; }
#scene-container { width: 100vw; height: 100vh; }
canvas { display: block; }

/* Title Screen */
#title-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
}
.title-overlay {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.92) 0%, rgba(20,10,30,0.95) 50%, rgba(0,0,0,0.92) 100%);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.title-content { text-align: center; }
.game-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700; font-size: 8vw; line-height: 0.9;
  background: linear-gradient(180deg, #FFD700 0%, #FF8C00 40%, #FFFFFF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  text-shadow: none;
  filter: drop-shadow(0 4px 20px rgba(255,165,0,0.4));
  margin-bottom: 10px;
}
.subtitle {
  font-family: 'JetBrains Mono', monospace;
  color: #aaa; font-size: 1rem; margin-bottom: 40px;
  font-weight: 300;
}
.character-select {
  display: flex; gap: 20px; justify-content: center; margin-bottom: 30px; flex-wrap: wrap;
}
.char-card {
  background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 20px 25px; cursor: pointer; transition: all 0.3s;
  min-width: 120px;
}
.char-card:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-4px); }
.char-card.selected { border-color: #FFD700; background: rgba(255,215,0,0.1); }
.char-silhouette {
  width: 60px; height: 80px; margin: 0 auto 10px; border-radius: 30px 30px 10px 10px;
}
.char-silhouette.blue { background: linear-gradient(180deg, #4488ff, #2255aa); }
.char-silhouette.red { background: linear-gradient(180deg, #ff4444, #aa2222); }
.char-silhouette.purple { background: linear-gradient(180deg, #aa44ff, #6622aa); }
.char-name { color: #fff; font-weight: 700; font-size: 1.1rem; }
.char-role { color: #888; font-size: 0.8rem; font-weight: 300; }
.start-button {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1.3rem;
  background: linear-gradient(90deg, #FFD700, #FF8C00);
  color: #000; border: none; padding: 14px 60px; border-radius: 6px;
  cursor: pointer; letter-spacing: 0.1em; transition: all 0.3s;
  animation: pulse-glow 2s ease-in-out infinite;
}
.start-button:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(255,165,0,0.5); }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,165,0,0.3); }
  50% { box-shadow: 0 0 25px rgba(255,165,0,0.6); }
}
.settings-row {
  margin-top: 20px; color: #888; font-size: 0.85rem;
}
.settings-row select {
  background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 8px; border-radius: 4px; font-family: 'Oswald', sans-serif;
}

/* HUD */
#hud { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
#hud button, #hud select { pointer-events: all; }

#minimap-container {
  position: absolute; top: 15px; left: 15px;
  width: 180px; height: 180px; border-radius: 50%;
  overflow: hidden; border: 2px solid rgba(0,255,200,0.3);
  box-shadow: 0 0 20px rgba(0,255,200,0.15), inset 0 0 10px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.6);
}
#minimap { width: 100%; height: 100%; }
.compass-n,.compass-s,.compass-e,.compass-w {
  position: absolute; font-size: 10px; color: rgba(255,255,255,0.5);
  font-family: 'JetBrains Mono', monospace;
}
.compass-n { top: 2px; left: 50%; transform: translateX(-50%); }
.compass-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 5px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 5px; top: 50%; transform: translateY(-50%); }

#stats-panel {
  position: absolute; top: 15px; right: 15px;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 12px 18px; text-align: right;
  backdrop-filter: blur(4px);
}
#game-time {
  font-family: 'JetBrains Mono', monospace; color: #fff;
  font-size: 1.4rem; font-weight: 700;
}
#weather-icon { font-size: 1.2rem; }
#cash-display {
  font-family: 'JetBrains Mono', monospace; color: #00FF88;
  font-size: 1.2rem; font-weight: 700;
}
#char-name-display { color: #FFD700; font-weight: 600; font-size: 0.9rem; }

#wanted-panel {
  position: absolute; top: 210px; left: 15px;
  background: rgba(0,0,0,0.6); border-radius: 8px; padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.wanted-label { color: #888; font-size: 0.6rem; letter-spacing: 0.15em; margin-bottom: 2px; }
#wanted-stars { font-size: 1.3rem; letter-spacing: 2px; }
.star { color: #333; transition: all 0.3s; }
.star.active { color: #FFD700; text-shadow: 0 0 10px #FFD700; }
.star.active.pulse { animation: star-pulse 0.5s ease-in-out infinite; }
@keyframes star-pulse {
  0%, 100% { text-shadow: 0 0 10px #FFD700; }
  50% { text-shadow: 0 0 20px #ff4444, 0 0 30px #ff4444; }
}

#info-panel {
  position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); border-radius: 10px; padding: 10px 24px;
  border: 1px solid rgba(0,255,200,0.15); min-width: 200px; text-align: center;
  backdrop-filter: blur(4px);
}
#vehicle-name, #weapon-name { color: #fff; font-size: 0.9rem; font-weight: 600; }
#speed-display { font-family: 'JetBrains Mono', monospace; color: #00FF88; font-size: 1.1rem; }
.speed-bar-container, .stamina-bar-container {
  width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 6px;
}
.speed-bar { height: 100%; background: linear-gradient(90deg, #00FF88, #FFD700); border-radius: 2px; width: 0%; transition: width 0.1s; }
.stamina-bar { height: 100%; background: linear-gradient(90deg, #4488ff, #00ccff); border-radius: 2px; width: 100%; transition: width 0.1s; }

#controls-help {
  position: absolute; bottom: 15px; right: 15px;
  color: rgba(255,255,255,0.4); font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  transition: opacity 0.5s;
}

#crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.5); font-size: 20px; font-weight: 100;
  font-family: 'JetBrains Mono', monospace;
}

#damage-flash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(255,0,0,0.4) 100%);
  pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 99;
}
#police-flash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0; z-index: 98;
}

/* Mission Panel */
#mission-panel {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.85); border: 1px solid rgba(255,215,0,0.3);
  border-radius: 10px; padding: 20px; width: 280px;
  pointer-events: all; backdrop-filter: blur(8px);
}
.mission-title { color: #FFD700; font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.mission-desc { color: #ccc; font-size: 0.8rem; margin-bottom: 10px; font-weight: 300; }
.mission-reward { color: #00FF88; font-family: 'JetBrains Mono', monospace; font-size: 1rem; margin-bottom: 15px; }
.mission-btn {
  font-family: 'Oswald', sans-serif; border: none; padding: 8px 20px;
  border-radius: 4px; cursor: pointer; font-weight: 600; margin-right: 8px;
}
.mission-btn.accept { background: #FFD700; color: #000; }
.mission-btn.decline { background: rgba(255,255,255,0.1); color: #888; }

#active-mission {
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); border-left: 3px solid #FFD700;
  padding: 8px 16px; border-radius: 0 6px 6px 0;
}
#active-mission-text { color: #fff; font-size: 0.85rem; }
#mission-timer { color: #ff4444; font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; margin-top: 4px; }

#toast {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #FFD700; padding: 10px 24px;
  border-radius: 6px; font-size: 0.9rem; border: 1px solid rgba(255,215,0,0.3);
  transition: opacity 0.5s; z-index: 200;
}

#radio-display {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); border: 1px solid rgba(0,255,200,0.2);
  border-radius: 8px; padding: 8px 20px; text-align: center;
}
#radio-station { color: #00ccff; font-size: 0.85rem; font-weight: 600; }
#radio-song { color: #888; font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; }

/* Pause */
#pause-menu, #stats-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 500;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.pause-overlay, .stats-overlay { text-align: center; }
.pause-overlay h2, .stats-overlay h2 {
  color: #FFD700; font-size: 2.5rem; margin-bottom: 30px; letter-spacing: 0.1em;
}
.pause-btn {
  display: block; margin: 10px auto; font-family: 'Oswald', sans-serif;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; padding: 12px 50px; font-size: 1rem; border-radius: 6px;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.05em;
}
.pause-btn:hover { background: rgba(255,215,0,0.15); border-color: #FFD700; color: #FFD700; }
#stats-content {
  color: #ccc; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  text-align: left; margin: 0 auto 20px; max-width: 300px;
}
#stats-content div { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
#stats-content span { color: #00FF88; float: right; }

/* Mobile Controls */
#mobile-controls {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 200px;
  pointer-events: none; z-index: 150;
}
#joystick-area {
  position: absolute; bottom: 20px; left: 30px; pointer-events: all;
}
#joystick-base {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2);
  position: relative;
}
#joystick-thumb {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
#mobile-buttons {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; gap: 10px; pointer-events: all; flex-wrap: wrap; width: 130px; justify-content: flex-end;
}
.mobile-btn {
  width: 55px; height: 55px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
  font-size: 1.2rem; cursor: pointer; color: #fff;
}

#footer-link {
  position: fixed; bottom: 3px; left: 50%; transform: translateX(-50%);
  z-index: 50; font-size: 0.6rem; font-family: 'JetBrains Mono', monospace;
  opacity: 0.3;
}
#footer-link a { color: #888; text-decoration: none; }
#footer-link a:hover { color: #FFD700; }

@media (max-width: 768px) {
  #minimap-container { width: 120px; height: 120px; }
  .game-title { font-size: 14vw; }
  .char-card { padding: 12px 15px; min-width: 90px; }
  #controls-help { display: none; }
  #info-panel { bottom: 210px; }
}