/* Driving controls: quiet surfaces, clear hierarchy, two-thumb layout. */
:root {
  --drive-surface: #111c2ded;
  --drive-text: #f4f7fb;
  --drive-muted: #b9c7d8;
  --drive-line: #526174;
  --drive-accent: #72e3bd;
  --drive-focus: #ffe09a;
  --drive-space: 8px;
  --drive-radius: 16px;
  --drive-edge: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
  --drive-bottom: max(16px, env(safe-area-inset-bottom));
}
button:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid var(--drive-focus); outline-offset: 4px;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
#in-game-hud { inset-inline: var(--drive-edge) !important; top: 64px !important; }
.hud-top-bar {
  background: var(--drive-surface) !important; border-color: var(--drive-line);
  border-radius: var(--drive-radius) !important; padding: 8px 12px !important;
  gap: 16px !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  box-shadow: none; flex-wrap: nowrap !important;
}
.hud-label { color: var(--drive-muted); font-size: 12px !important; }
.hud-val { font-size: 18px !important; font-variant-numeric: tabular-nums; }
.health-box { min-width: 80px !important; }
.health-track { margin-block-start: 4px; }
.pause-pill-btn { min-height: 44px; min-width: 48px; color: var(--drive-text); font-size: 14px !important; }
#steering-wheel-container {
  left: auto !important; right: auto !important; inset-inline-end: var(--drive-edge) !important;
  bottom: var(--drive-bottom) !important; width: 160px !important; height: 160px !important;
}
.wheel-touch-arrow { min-height: 44px; min-width: 64px; font-size: 14px; bottom: 0; padding: 8px; }
#pedals-control-stack {
  left: auto !important; right: auto !important; inset-inline-start: var(--drive-edge) !important;
  bottom: var(--drive-bottom) !important; display: grid; grid-template-columns: 72px 80px;
  grid-template-rows: 48px 96px; gap: var(--drive-space);
}
.pedal-action-btn {
  width: 100% !important; height: 100% !important; min-height: 44px;
  padding: 8px !important; gap: 4px; border-radius: var(--drive-radius);
  background: var(--drive-surface); border: 1px solid var(--drive-line);
  box-shadow: none; backdrop-filter: none; flex-direction: column; justify-content: center;
  color: var(--drive-text); transition: background .12s, transform .12s;
}
#btn-pedal-gas { grid-column: 1; grid-row: 2; border-color: var(--drive-accent); }
#btn-pedal-brake { grid-column: 2; grid-row: 2; }
#btn-pedal-handbrake { grid-column: 1 / 3; grid-row: 1; flex-direction: row; }
.pedal-treads, .pedal-glow-strip { display: none; }
.pedal-visual-art { width: 24px; height: 24px; flex: 0 0 24px; }
.pedal-svg-icon { width: 24px; height: 24px; }
.pedal-content { align-items: center; }
.pedal-main-text { font-size: 14px !important; line-height: 1.4; color: var(--drive-text); }
.pedal-sub-text { font-size: 12px !important; color: var(--drive-muted); line-height: 1.3; }
.pedal-action-btn.active, .pedal-action-btn:active, .wheel-touch-arrow.active {
  background: #24534b; border-color: var(--drive-accent); transform: scale(.96); box-shadow: none;
}
#speedo-container {
  left: 50% !important; right: auto !important; bottom: var(--drive-bottom) !important;
  width: 124px !important; height: 124px !important; transform: translateX(-50%); filter: none;
}
.touch-zone-guide { opacity: .45; }
@media (hover: hover) {
  .pedal-action-btn:hover { background: #28384b; border-color: var(--drive-text); }
}
@media (max-width: 600px) {
  #in-game-hud { top: 44px !important; }
  .hud-top-bar { width: 100%; gap: 8px !important; padding: 8px !important; justify-content: space-between; }
  .hud-label { font-size: 12px !important; }
  .hud-val { font-size: 16px !important; }
  .health-box { min-width: 64px !important; max-width: 100px; }
  #steering-wheel-container { width: 132px !important; height: 132px !important; }
  #pedals-control-stack { grid-template-columns: 64px 64px; grid-template-rows: 44px 80px; }
  #speedo-container { bottom: calc(var(--drive-bottom) + 144px) !important; width: 96px !important; height: 96px !important; left: 64px !important; }
  .pedal-sub-text { display: none; }
  .web-header { padding-inline: var(--drive-edge) !important; }
}
@media (max-width: 360px) {
  .combo-box { display: none; }
  #steering-wheel-container { width: 112px !important; height: 112px !important; }
  #pedals-control-stack { grid-template-columns: 56px 56px; }
  .wheel-touch-arrow { min-width: 56px; font-size: 12px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  #steering-wheel-container { width: 120px !important; height: 120px !important; }
  #pedals-control-stack { grid-template-rows: 44px 64px; }
  #speedo-container { width: 100px !important; height: 100px !important; }
  .pedal-sub-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pedal-action-btn, .wheel-touch-arrow, #speedo-active-arc { transition: none; }
  .pulse-green { animation: none; }
}

/* Keep touch feedback at the edges, clear of the player vehicle. */
.touch-zone-guide { display: none; }

/* Real player labels remain above the scene and below driving controls. */
#multiplayer-nametags-container { z-index: 250; }
.nametag-pill { border: 1px solid var(--drive-accent); background: var(--drive-surface); box-shadow: none; backdrop-filter: none; padding: 4px 8px; gap: 2px; border-radius: 8px; }
.nametag-header { margin: 0; }
.nametag-name { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.nametag-badge-real { font-size: 10px; }
.nametag-speed { display: none; }
.nametag-dist { font-size: 10px; color: var(--drive-muted); }
