* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1622;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #ffffff;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.hud-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-card {
  background: rgba(10, 22, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 105px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hud-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fd3ff;
  margin-bottom: 2px;
}

.hud-value {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
}

.hud-value.gold {
  color: #ffd166;
}

.hud-value.green {
  color: #4ade80;
}

#hud-actions {
  pointer-events: auto;
  display: flex;
  gap: 8px;
}

.hud-btn {
  background: rgba(15, 32, 50, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.hud-btn:hover {
  background: rgba(28, 58, 88, 0.95);
  transform: translateY(-1px);
}

#zone-banner {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(14, 116, 144, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s ease;
}

#status-pills {
  position: fixed;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(12, 29, 46, 0.72), rgba(5, 12, 20, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.overlay.hidden {
  display: none;
}

.panel {
  max-width: 720px;
  width: 100%;
  background: rgba(13, 27, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.badge {
  display: inline-block;
  background: rgba(255, 209, 102, 0.16);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #ffffff, #ffd166, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 640px) {
  .vehicle-grid {
    grid-template-columns: 1fr;
  }
}

.vehicle-card {
  background: rgba(22, 42, 64, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.vehicle-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}

.vehicle-card.selected {
  border-color: #ffd166;
  background: rgba(34, 62, 92, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.2);
}

.vehicle-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.vehicle-perk {
  font-size: 12px;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 6px;
}

.vehicle-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.4);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.controls-hint {
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
}

/* Mobile / On-Screen Controls */
#touch-controls {
  position: fixed;
  bottom: 18px;
  left: 0;
  width: 100%;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 12;
}

.control-cluster {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.ctrl-btn {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.ctrl-btn:active {
  background: rgba(245, 158, 11, 0.85);
  transform: scale(0.95);
}

.ctrl-btn.wide {
  width: auto;
  padding: 0 16px;
  font-size: 13px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 22px;
}

.stat-box {
  background: rgba(22, 42, 64, 0.75);
  border-radius: 12px;
  padding: 12px;
}

.stat-box .label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
}

.stat-box .val {
  font-size: 20px;
  font-weight: 800;
  color: #ffd166;
  margin-top: 4px;
}
