@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;800;900&family=Rajdhani:wght@400;500;600;700&display=swap');

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #04101e;
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#damage-vignette, #boost-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  transition: box-shadow 0.3s ease;
}

#damage-vignette.hit {
  box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.5);
}

#boost-vignette.boosting {
  box-shadow: inset 0 0 100px rgba(6, 182, 212, 0.5);
}

#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 22px;
}

.interactive {
  pointer-events: auto;
}

.top-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.game-title-tag {
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(251, 160, 86, 0.7);
  background: none;
}

.voyage-compass-pill {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
}

.voyage-compass-pill .compass-icon {
  font-size: 14px;
  margin-right: 4px;
}

.voyage-compass-pill .pill-divider {
  color: rgba(255, 255, 255, 0.2);
  margin: 0 6px;
}

.top-right-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-badges-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.badge-pill {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-badge { color: #fde047; }
.speed-badge { color: #38bdf8; }

.nitro-bar-inline {
  display: inline-flex;
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.nitro-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #e056fd);
  border-radius: 3px;
  width: 100%;
  transition: width 0.3s;
}

.voyage-time-pill {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}

.right-sidebar {
  position: absolute;
  top: 80px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.action-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-card {
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  width: 170px;
  transition: all 0.2s;
  font-family: inherit;
}

.action-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

.action-card:focus {
  outline: none;
}

.radar-wrapper {
  width: 100px;
  height: 100px;
}

.radar-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.72);
  position: relative;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.radar-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.radio-dispatch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 90px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.radio-dispatch.show { opacity: 1; }

.dispatch-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.dispatch-title {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 2px;
  color: #94a3b8;
}

.dispatch-body {
  font-size: 12px;
  color: #e2e8f0;
}

.stunt-popup {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(251, 160, 86, 0.3);
  border-radius: 14px;
  padding: 14px 28px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s;
}
.stunt-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.stunt-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: bold;
  color: #fde047;
}

.stunt-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.combo-meter {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #fde047;
  padding: 6px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.combo-meter.show { opacity: 1; }

.radio-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #fbbf24;
  padding: 6px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.radio-banner.show { opacity: 1; }

.grapple-prompt {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #00f2fe;
  padding: 6px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.grapple-prompt.show { opacity: 1; }

.bottom-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.nautical-dial-widget {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.dial-compass-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  background: rgba(0, 0, 0, 0.3);
}

.dial-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #fbbf24;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.dial-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 22px;
  background: #ef4444;
  transform-origin: bottom center;
  transform: translate(-50%, -100%);
  z-index: 1;
  border-radius: 1px;
}

.dial-ticks .tick {
  position: absolute;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.tick-n { top: 2px; left: 50%; transform: translateX(-50%); }
.tick-e { right: 2px; top: 50%; transform: translateY(-50%); }
.tick-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.tick-w { left: 2px; top: 50%; transform: translateY(-50%); }

.dial-telemetry {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speed-number-wrap {
  display: flex;
  align-items: baseline;
}

.speed-big {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #f8fafc;
}

.speed-unit-tag {
  font-size: 9px;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-left: 4px;
}

.dial-sub-info {
  font-size: 10px;
  color: #64748b;
  display: flex;
  align-items: center;
}

.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 4px;
}

.dial-score-row {
  font-size: 10px;
}

.score-lbl {
  color: #64748b;
  margin-right: 4px;
}

.score-val {
  color: #fde047;
  font-weight: 700;
}

.controls-pill {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 6px 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  gap: 6px;
  align-items: center;
}

.ctrl-k {
  color: rgba(255, 255, 255, 0.6);
}

.ctrl-sep {
  color: rgba(255, 255, 255, 0.15);
}

.hull-compact {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.hull-label {
  color: #94a3b8;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 1px;
}

.hull-bar-bg {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.hull-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  border-radius: 3px;
  width: 100%;
  transition: width 0.3s;
}

.hull-pct {
  color: #00f2fe;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content, .modal, .end-modal {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px 40px;
  max-width: 550px;
  text-align: center;
}

.main-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 40px rgba(0, 242, 254, 0.3);
  margin: 0;
}

.title-sub {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 4px;
}

.game-badge {
  font-size: 10px;
  letter-spacing: 3px;
  color: #fbbf24;
  margin-bottom: 8px;
  display: block;
}

.mission-brief {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  margin: 12px 0;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 16px 0;
}

.ctrl-item {
  font-size: 12px;
  color: #94a3b8;
  text-align: left;
}

.k {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  color: #e2e8f0;
  font-weight: 700;
  margin-right: 6px;
  display: inline-block;
}

.btn-launch {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: none;
  color: white;
  padding: 12px 32px;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-launch:hover {
  transform: scale(1.02);
  box-shadow: 0 0 24px rgba(2, 132, 199, 0.4);
}

.tip-text {
  font-size: 11px;
  color: #475569;
  margin-top: 10px;
}

.end-icon {
  font-size: 48px;
}

.end-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin: 10px 0;
}

.end-score {
  font-size: 14px;
  color: #fbbf24;
}

.stats-summary {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-box .val {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
}

.stat-box .lbl {
  font-size: 9px;
  letter-spacing: 2px;
  color: #64748b;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ------------------------------------------------------------------
   HUD patch: styles for panels that were added to index.html without
   matching CSS (hull/nitro panel, action row, legend, weapon dock,
   modal cards, dev tuner).
------------------------------------------------------------------- */
#end-game-modal { display: none; }

.status-panel,
.weapon-card,
.faction-legend,
.modal-card,
.dev-card {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-panel {
  width: 250px;
  border-radius: 14px;
  padding: 10px 14px 12px;
  color: #e2e8f0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.panel-tag { color: #94a3b8; }
.badge { color: #64748b; font-size: 10px; }
.status-value { color: #00f2fe; font-family: 'Orbitron', sans-serif; font-size: 12px; }
.status-value-boost { color: #e056fd; font-family: 'Orbitron', sans-serif; font-size: 10px; }

.bar-bg {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill,
.bar-fill-boost {
  position: relative;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  transition: width 0.2s linear;
}

.bar-fill-boost { background: linear-gradient(90deg, #a855f7, #ff007f); }

.bar-gloss {
  position: absolute;
  inset: 0 0 50% 0;
  background: rgba(255, 255, 255, 0.18);
}

.wanted-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.wanted-label { font-size: 10px; letter-spacing: 2px; color: #94a3b8; font-weight: 700; }
.wanted-stars { display: flex; gap: 3px; }
.wanted-stars .star { font-size: 15px; color: rgba(255, 255, 255, 0.15); transition: color 0.2s, text-shadow 0.2s; }
.wanted-stars .star.active { color: #fbbf24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }

.top-actions-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  font-family: 'Rajdhani', sans-serif;
  cursor: pointer;
}

.btn-icon {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-icon:hover { background: rgba(30, 41, 59, 0.9); border-color: rgba(255, 255, 255, 0.2); }

.btn-primary,
.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.9);
}

.btn-primary { background: linear-gradient(135deg, #0284c7, #0369a1); }

.radar-wrapper { width: auto; height: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.radar-frame { width: 132px; height: 132px; box-shadow: 0 0 18px rgba(56, 189, 248, 0.25); }

.faction-legend {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px 10px;
  border-radius: 10px;
  padding: 6px 10px;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #cbd5e1;
}

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.police { background: #3b82f6; }
.dot.gang { background: #ef4444; }
.dot.pirate { background: #f59e0b; }
.dot.haven { background: #22c55e; }

.weapon-dock { display: flex; gap: 8px; align-items: flex-end; }

.weapon-card {
  width: 96px;
  border-radius: 12px;
  padding: 8px 8px 7px;
  text-align: center;
  color: #e2e8f0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.weapon-card.active { border-color: rgba(0, 242, 254, 0.45); }
.wep-key { font-size: 9px; letter-spacing: 1px; color: #64748b; font-weight: 700; }
.wep-icon { font-size: 20px; line-height: 1.3; }
.wep-name { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.wep-ammo { font-size: 9px; color: #94a3b8; margin-top: 2px; }

.wep-cooldown {
  height: 3px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.cd-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #00f2fe, #38bdf8); }

.modal-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 20px;
  padding: 30px 38px;
  max-width: 620px;
  width: calc(100vw - 48px);
  box-sizing: border-box;
  text-align: center;
  color: #e2e8f0;
}

.start-card .main-title { font-size: 40px; letter-spacing: 2px; }
.start-card .title-sub { margin-top: 6px; }

#dev-tuner-panel {
  position: fixed;
  top: 70px;
  left: 22px;
  z-index: 200;
  width: 320px;
}

.dev-card { border-radius: 14px; padding: 14px 16px; color: #e2e8f0; font-size: 13px; }
.dev-section { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.dev-section h4 { margin: 0 0 4px; color: #fbbf24; font-size: 12px; letter-spacing: 1px; }
.dev-section input[type="range"] { width: 100%; accent-color: #00f2fe; }

@media (max-width: 900px) {
  .controls-pill, .faction-legend, .voyage-compass-pill { display: none; }
  .status-panel { width: 190px; }
  .weapon-card { width: 72px; }
}
