* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #070b14; color: #f1f5fb;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#load-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(circle at 50% 42%, #13233d 0%, #070b14 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity 0.45s ease;
}
#load-overlay.hidden { opacity: 0; pointer-events: none; }
.load-title { font-size: 28px; font-weight: 800; letter-spacing: 0.22em; color: #f6c453; }
.load-sub { font-size: 12px; letter-spacing: 0.14em; color: #9cb4d4; text-transform: uppercase; }
.load-track { width: min(320px, 78vw); height: 6px; background: rgba(255,255,255,0.12); border-radius: 99px; overflow: hidden; }
#load-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #f6c453, #ff7a3d); transition: width 0.12s; }
#load-text { font-size: 11px; color: #8ea5c4; }

.hud-panel {
  background: rgba(10, 16, 28, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#hud-top-left {
  position: fixed; top: 12px; left: 12px; z-index: 20;
  padding: 10px 14px; min-width: 210px; max-width: min(300px, 54vw);
}
.hud-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.brand-name { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; color: #f6c453; }
#hud-district { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: #7cd4ff; background: rgba(124,212,255,0.12); padding: 2px 7px; border-radius: 99px; }
#hud-mission-title { font-size: 13px; font-weight: 700; color: #fff; }
#hud-mission-detail { font-size: 11px; color: #a9bed8; margin-top: 2px; line-height: 1.3; }

#hud-top-right {
  position: fixed; top: 12px; right: 12px; z-index: 20;
  padding: 10px 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.hud-stat-row { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; }
#hud-clock { color: #8fd3ff; font-variant-numeric: tabular-nums; }
#hud-score { color: #f6c453; font-variant-numeric: tabular-nums; }
#hud-stars { color: #ff4f5e; font-size: 15px; letter-spacing: 2px; }
.time-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chip-btn {
  background: rgba(255, 255, 255, 0.08); color: #dce7f5;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 7px;
  padding: 4px 8px; font-size: 10px; font-weight: 700; cursor: pointer;
}
.chip-btn:hover, .chip-btn.active { background: #f6c453; color: #0a101c; border-color: #f6c453; }

#hud-bottom-right {
  position: fixed; bottom: 14px; right: 14px; z-index: 20;
  padding: 10px 16px; display: flex; align-items: baseline; gap: 6px;
}
#hud-speed { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; line-height: 1; }
.speed-unit { font-size: 11px; font-weight: 700; color: #8da6c8; letter-spacing: 0.1em; }

#hud-bottom-center {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 6px 8px; display: flex; gap: 6px; align-items: center;
}

#hud-toast {
  position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: rgba(12, 19, 34, 0.88); border: 1px solid rgba(246, 196, 83, 0.55);
  color: #fff6dc; padding: 8px 16px; border-radius: 99px; font-size: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  max-width: min(520px, 88vw); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#hud-toast.show { opacity: 1; }

#touch-controls { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.touch-pad { position: fixed; bottom: 14px; display: flex; gap: 8px; pointer-events: auto; }
#touch-left { left: 12px; }
#touch-right { right: 12px; }
.t-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(10, 16, 28, 0.72); border: 1px solid rgba(255,255,255,0.22);
  color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.t-btn.active { background: #f6c453; color: #0a101c; }

@media (max-width: 820px) {
  #touch-controls { display: block; }
  #hud-bottom-center { bottom: 72px; padding: 4px 6px; gap: 4px; }
  #hud-bottom-right { bottom: 72px; right: 10px; padding: 6px 10px; }
  #hud-speed { font-size: 20px; }
  #hud-top-left { padding: 7px 9px; min-width: 140px; max-width: 46vw; }
  #hud-top-right { padding: 7px 9px; max-width: 48vw; }
  .chip-btn { padding: 3px 6px; font-size: 9px; }
  #hud-toast { top: 118px; font-size: 11px; }
}
