*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---- Preloader ---- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0f;
  transition: opacity 0.5s ease;
}
#preloader.preloader-done {
  opacity: 0;
  pointer-events: none;
}
.preloader-inner {
  text-align: center;
  width: 320px;
}
.preloader-title {
  font-family: 'Racing Sans One', 'Orbitron', sans-serif;
  font-size: 42px;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 4px;
}
.preloader-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  color: #e63946;
  letter-spacing: 6px;
  margin-bottom: 32px;
}
.preloader-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}
.preloader-bar {
  height: 100%;
  width: 0%;
  background: #e63946;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.preloader-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ---- Start Screen ---- */
#hud-start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(10,10,30,0.85) 50%, rgba(0,0,0,0.8) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
  pointer-events: auto;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

#hud-start-screen.start-hidden {
  opacity: 0;
  pointer-events: none;
}

.start-stripe {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, #e63946 0, #e63946 20px, #fff 20px, #fff 40px);
}

.start-stripe-top { top: 0; }
.start-stripe-bottom { bottom: 0; }

.start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.start-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px 48px;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.start-flag-row {
  display: flex;
  gap: 0;
}

.flag-check {
  width: 12px;
  height: 10px;
  background: #fff;
  display: block;
}

.flag-check.dark {
  background: #1a1a1a;
}

.start-title {
  font-family: 'Racing Sans One', 'Orbitron', sans-serif;
  font-size: 72px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 6px;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(230,57,70,0.3), 0 2px 0 rgba(0,0,0,0.3);
  margin: 8px 0 2px;
  line-height: 1;
}

.start-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 8px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.start-name-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.start-name-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.start-name-input {
  width: 260px;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 2px;
}

.start-name-input:focus {
  border-color: #e63946;
  box-shadow: 0 0 20px rgba(230,57,70,0.2);
}

.start-name-input::placeholder {
  color: rgba(255,255,255,0.15);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
}

.start-race-btn {
  margin-top: 24px;
  padding: 14px 56px;
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  background: #e63946;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}

.start-race-btn:hover {
  background: #d62839;
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(230,57,70,0.4);
}

.start-race-btn:active {
  transform: translateY(0);
}

.start-prompt {
  margin-top: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.25);
  letter-spacing: 2px;
}

.start-controls-grid {
  margin-top: 28px;
  display: flex;
  gap: 32px;
}

.ctrl-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.ctrl-label {
  margin-left: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}

.key.narrow { min-width: 22px; padding: 0 3px; }
.key.wide { min-width: 52px; }

/* ---- Pause Overlay ---- */
#hud-pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 18;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#hud-pause-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.pause-text {
  font-family: 'Racing Sans One', 'Orbitron', sans-serif;
  font-size: 64px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 0 40px rgba(230,57,70,0.3);
}

.pause-hint {
  margin-top: 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  letter-spacing: 2px;
}

.pause-controls {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.pause-controls-grid {
  display: flex;
  gap: 40px;
}

/* ---- HUD Overlay ---- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  z-index: 10;
  -webkit-font-smoothing: antialiased;
}

/* Speed-dependent vignette */
#hud-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.5) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ---- Speed block - bottom left ---- */
#hud-speed-block {
  position: absolute;
  bottom: 28px;
  left: 28px;
  background: rgba(10, 10, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 20px 12px;
  min-width: 120px;
}

#hud-speed-val {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

#hud-speed-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

#hud-speed-bar-track {
  margin-top: 10px;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

#hud-speed-bar {
  height: 100%;
  width: 0%;
  background: #4ade80;
  border-radius: 2px;
  transition: width 0.12s ease, background 0.3s ease;
}

/* ---- Center block - top center ---- */
#hud-center {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: rgba(10, 10, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 24px 12px;
}

#hud-lap {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

#hud-timer {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

#hud-cps {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.cp-dot.passed {
  background: #4ade80;
  border-color: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.5);
}

/* ---- Best lap - bottom right ---- */
#hud-best {
  position: absolute;
  bottom: 28px;
  right: 28px;
  text-align: right;
  background: rgba(10, 10, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 18px;
}

#hud-best-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

#hud-best-val {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ---- Countdown ---- */
#hud-countdown {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Racing Sans One', 'Orbitron', sans-serif;
  font-weight: 400;
  pointer-events: none;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
  -webkit-text-stroke: 2px rgba(0,0,0,0.3);
}

#hud-countdown.cd-num {
  font-size: 160px;
  color: #fff;
  animation: countPulse 0.85s ease-out;
  text-shadow: 0 0 60px rgba(230,57,70,0.4), 0 4px 30px rgba(0,0,0,0.6);
}

#hud-countdown.cd-go {
  font-size: 120px;
  color: #4ade80;
  animation: countPulse 0.7s ease-out;
  text-shadow: 0 0 60px rgba(74,222,128,0.5), 0 4px 30px rgba(0,0,0,0.6);
  letter-spacing: 8px;
}

@keyframes countPulse {
  0%   { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
}

/* ---- Center message ---- */
#hud-msg {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

#hud-msg.show {
  opacity: 1;
}

/* ---- Race Results ---- */
#hud-results {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#hud-results.show {
  opacity: 1;
}

.res-card {
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 32px 44px;
  min-width: 320px;
  text-align: center;
}

.res-title {
  font-size: 28px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.res-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 16px 0;
}

.res-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.res-row.res-best {
  color: #4ade80;
  font-weight: 700;
}

.res-row.res-total {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.res-lap-label {
  font-weight: 500;
}

.res-lap-time {
  font-weight: 600;
}

.res-restart {
  margin-top: 20px;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ---- Position Leaderboard ---- */
#hud-positions {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pos-entry {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  background: rgba(10, 10, 20, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  min-width: 120px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.pos-entry.pos-player {
  background: rgba(230, 57, 70, 0.2);
  border-color: rgba(230, 57, 70, 0.3);
  color: #fff;
}

.pos-rank {
  font-weight: 700;
  font-size: 15px;
  min-width: 16px;
  text-align: center;
  color: inherit;
}

.pos-bar {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pos-name {
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---- Side Settings Panel ---- */
#hud-side-panel {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 0;
  pointer-events: auto;
  z-index: 12;
}

#side-panel-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-tab {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10, 10, 20, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.side-tab:hover {
  background: rgba(40, 40, 60, 0.7);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
}

#side-panel-body {
  margin-left: 6px;
  background: rgba(10, 10, 20, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 180px;
  transition: opacity 0.25s, transform 0.25s;
  transform-origin: left center;
}

#side-panel-body.panel-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0) translateX(-10px);
}

.panel-section-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.panel-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  min-width: 44px;
}

.panel-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-top: 2px;
}

.panel-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 10px 0;
}

.panel-btn {
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 6px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.panel-btn:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
}

#side-panel-body input[type="range"] {
  width: 90px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#side-panel-body input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  border: none;
  cursor: pointer;
}

#side-panel-body input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  border: none;
  cursor: pointer;
}

/* ---- Minimap ---- */
#minimap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 160px;
  height: 160px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 11;
  pointer-events: none;
}

/* Shift best lap up when minimap is visible */
#hud-best {
  bottom: 200px;
}

/* ---- Mobile / Desktop visibility ---- */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

/* ---- Touch Controls ---- */
#touch-controls {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

#touch-steer-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 45%;
  pointer-events: auto;
  touch-action: none;
}

#touch-steer-indicator {
  position: absolute;
  left: 24px;
  bottom: 36px;
  width: 100px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#touch-steer-knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.3);
  transition: transform 0.08s ease-out, background 0.15s;
}

#touch-steer-knob.active {
  background: rgba(230, 57, 70, 0.5);
  border-color: rgba(230, 57, 70, 0.7);
}

#touch-right {
  position: absolute;
  bottom: 32px;
  right: 24px;
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.touch-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(10, 10, 20, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.touch-btn:active {
  background: rgba(230, 57, 70, 0.35);
  border-color: rgba(230, 57, 70, 0.5);
  transform: scale(0.93);
}

.touch-gas { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.25); }
.touch-gas:active { background: rgba(74, 222, 128, 0.35); border-color: rgba(74, 222, 128, 0.5); }
.touch-brake-btn { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); }
.touch-brake-btn:active { background: rgba(239, 68, 68, 0.35); border-color: rgba(239, 68, 68, 0.5); }

/* ---- Results restart button (mobile) ---- */
.res-restart-btn {
  margin-top: 20px;
  padding: 12px 44px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: #e63946;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}

/* ---- Pause buttons for mobile ---- */
.pause-resume-btn,
.pause-restart-btn {
  margin-top: 14px;
  padding: 12px 44px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s, transform 0.15s;
}

.pause-resume-btn {
  color: #fff;
  background: #e63946;
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}
.pause-resume-btn:active { transform: scale(0.95); }

.pause-restart-btn {
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.pause-restart-btn:active { transform: scale(0.95); }

/* ---- Pause settings section (mobile) ---- */
.pause-settings-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-width: 240px;
}

.pause-settings-section .panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pause-settings-section input[type="range"] {
  width: 120px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.pause-settings-section input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4ade80;
  border: none;
  cursor: pointer;
}

.pause-settings-section input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4ade80;
  border: none;
  cursor: pointer;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px), (pointer: coarse) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  #touch-controls { display: block; }

  .start-title { font-size: 36px; letter-spacing: 3px; }
  .start-sub { font-size: 10px; letter-spacing: 4px; }
  .start-badge { padding: 16px 24px; }
  .start-name-input { width: 200px; font-size: 14px; padding: 10px 14px; }
  .start-name-section { margin-top: 18px; }
  .start-race-btn { margin-top: 16px; padding: 12px 40px; font-size: 14px; }
  .flag-check { width: 8px; height: 7px; }

  #hud-speed-block {
    bottom: 110px;
    left: 16px;
    padding: 8px 12px 8px;
    min-width: 80px;
  }
  #hud-speed-val { font-size: 28px; }
  #hud-speed-label { font-size: 9px; }

  #hud-center { top: 10px; padding: 6px 14px 8px; }
  #hud-lap { font-size: 10px; }
  #hud-timer { font-size: 22px; }
  #hud-cps { margin-top: 4px; }
  .cp-dot { width: 7px; height: 7px; }

  #hud-best { bottom: 110px; right: 16px; padding: 6px 10px; }
  #hud-best-label { font-size: 9px; }
  #hud-best-val { font-size: 16px; }

  #hud-positions { top: 10px; right: 10px; }
  .pos-entry { padding: 3px 8px 3px 6px; font-size: 10px; min-width: 80px; }
  .pos-rank { font-size: 11px; }
  .pos-bar { height: 14px; }

  #minimap { width: 90px; height: 90px; bottom: 110px; right: 16px; display: none; }

  #hud-side-panel { left: 10px; top: 10px; }
  .side-tab { width: 32px; height: 32px; }
  .side-tab svg { width: 14px; height: 14px; }

  .pause-text { font-size: 36px; letter-spacing: 4px; }
  .pause-hint { font-size: 10px; }

  #hud-countdown.cd-num { font-size: 90px; }
  #hud-countdown.cd-go { font-size: 64px; }
}
