* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #050811;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #eef4ff;
}
#game-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh; display: block;
}
.hidden { display: none !important; }

.glass {
  background: rgba(8, 12, 22, 0.80);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.hud {
  position: fixed; inset: 0; pointer-events: none; z-index: 10;
}
.hud-top-left {
  position: absolute; top: 16px; left: 18px;
  padding: 12px 16px; min-width: 280px;
  border-left: 3px solid #ff3b4e;
}
.wanted-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 12px;
}
.wanted-row .label {
  font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #9ab0cf;
}
.stars { display: flex; gap: 4px; font-size: 20px; }
.star { color: rgba(255, 255, 255, 0.18); transition: transform 0.2s, color 0.2s; }
.star.active {
  color: #ffcf33;
  text-shadow: 0 0 10px rgba(255, 207, 51, 0.75);
  transform: scale(1.08);
}

.stat-grid {
  display: flex; gap: 18px; align-items: flex-end;
}
.sub-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: #879ab8;
}
.val {
  font-size: 22px; font-weight: 800; line-height: 1.15;
}
.val.green { color: #39f29b; }
.val.cyan { color: #38c8ff; }

.hud-top-right {
  position: absolute; top: 16px; right: 18px;
  padding: 12px 16px; width: 270px;
  border-right: 3px solid #2b8dff;
}
.bar-group { margin-bottom: 9px; }
.bar-hdr {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  color: #a9bbd6; margin-bottom: 4px;
}
.bar-track {
  width: 100%; height: 9px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.10); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 100%; border-radius: 99px;
  transition: width 0.08s linear;
}
.bar-fill.hp { background: linear-gradient(90deg, #ff3c4f, #39f29b); }
.bar-fill.nitro { background: linear-gradient(90deg, #1b8cff, #48f5ff); }

.right-actions {
  display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
}
.mph-pill {
  font-size: 15px; font-weight: 800; letter-spacing: 1px; color: #ffffff;
}
.mini-btn {
  pointer-events: auto; cursor: pointer;
  background: rgba(255, 255, 255, 0.10); color: #dbe9ff;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px;
  padding: 4px 9px; font-size: 11px; font-weight: 700;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.22); }

.callout {
  position: absolute; top: 108px; left: 50%; transform: translateX(-50%);
  font-size: 26px; font-weight: 900; letter-spacing: 1.5px;
  color: #ffdc47; text-shadow: 0 3px 16px rgba(0, 0, 0, 0.9);
  opacity: 0; transition: opacity 0.2s;
}
.callout.show { opacity: 1; }

.busted-wrap {
  position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%);
  width: min(360px, 82vw); padding: 10px 14px;
  background: rgba(45, 8, 14, 0.88);
  border: 1px solid rgba(255, 65, 82, 0.75); border-radius: 10px;
  text-align: center;
}
.busted-title {
  font-size: 12px; font-weight: 900; letter-spacing: 2px;
  color: #ff6b78; margin-bottom: 6px;
}
.busted-track {
  width: 100%; height: 10px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.15); overflow: hidden;
}
.busted-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, #ff7a2b, #ff243d);
}

.controls-bar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 99px;
  background: rgba(7, 10, 18, 0.72);
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: #b7c8e2;
  white-space: nowrap;
}

.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(10, 15, 30, 0.45), rgba(4, 6, 12, 0.82));
}
.card {
  width: min(540px, 92vw); padding: 32px 30px; text-align: center;
  border-top: 3px solid #2b8dff;
}
.card.danger { border-top-color: #ff3449; }
.siren-badge {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 45, 65, 0.25), rgba(40, 130, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #79c7ff;
  margin-bottom: 12px;
}
h1 {
  font-size: 42px; font-weight: 900; letter-spacing: 2px; margin-bottom: 10px;
}
h1 span { color: #ff3c52; text-shadow: 0 0 22px rgba(255, 60, 82, 0.45); }
h2 { font-size: 36px; font-weight: 900; letter-spacing: 2px; margin-bottom: 18px; }
.tagline {
  font-size: 14px; line-height: 1.5; color: #b5c6e0; margin-bottom: 20px;
}
.load-status {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #54d3ff;
  margin-bottom: 14px;
}
.primary-btn {
  width: 100%; padding: 15px 20px; border: none; border-radius: 10px;
  background: linear-gradient(90deg, #ff3449, #2b8dff);
  color: #ffffff; font-size: 18px; font-weight: 900; letter-spacing: 1.5px;
  cursor: pointer; transition: transform 0.12s, filter 0.12s;
}
.primary-btn:disabled { opacity: 0.45; cursor: wait; }
.primary-btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.1); }
.hint-line {
  margin-top: 14px; font-size: 12px; color: #8da2c2;
}
.go-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 22px; text-align: left;
}
.go-stats > div {
  background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 10px 14px;
}
.go-stats span {
  display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; color: #8da2c2;
}
.go-stats strong {
  font-size: 22px; font-weight: 900; color: #ffffff;
}
