/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at top, rgba(18, 70, 110, 0.9), transparent 40%),
    linear-gradient(180deg, #050b11 0%, #0b1220 38%, #060b13 100%);
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 255, 255, 0.08), transparent 35%),
    linear-gradient(315deg, rgba(255, 120, 0, 0.07), transparent 30%);
  pointer-events: none;
  z-index: 0;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(31, 78, 112, 0.28), rgba(4, 8, 16, 0.9));
}

#game-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
  z-index: 1;
}

canvas { display: block; }

/* ===== ROOM DIALOG ===== */
.room-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 12, 15, 0.85);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.room-dialog {
  width: min(100%, 400px);
  padding: 28px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 16px;
  color: #f2f4eb;
  background: linear-gradient(145deg, #1a2530, #0d1520);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  direction: rtl;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.room-dialog h2 {
  margin-bottom: 24px;
  font-size: 24px;
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.room-dialog label {
  display: block;
  margin-bottom: 8px;
  color: #a0b0c0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.room-dialog input {
  width: 100%;
  height: 54px;
  border: 2px solid rgba(0, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0 16px;
  outline: none;
  color: #00ffff;
  background: rgba(0, 0, 0, 0.4);
  direction: ltr;
  font: 700 22px 'Trebuchet MS', monospace;
  letter-spacing: 4px;
  text-align: center;
  transition: all 0.2s ease;
}

.room-dialog input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15), 0 0 30px rgba(0, 255, 255, 0.1);
  background: rgba(0, 20, 30, 0.6);
}

.room-dialog-error {
  min-height: 22px;
  margin-top: 10px;
  color: #ff6b6b;
  font-size: 12px;
  text-align: center;
}

.room-dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.room-dialog-actions button {
  min-height: 48px;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font: 700 15px 'Trebuchet MS', sans-serif;
  transition: all 0.15s ease;
}

.room-dialog-cancel {
  background: rgba(60, 70, 80, 0.6);
}

.room-dialog-cancel:hover {
  background: rgba(80, 90, 100, 0.7);
}

.room-dialog-submit {
  color: #001a1a !important;
  background: linear-gradient(180deg, #00ffff, #00cccc);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.3);
}

.room-dialog-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 255, 0.4);
}

.room-dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* ===== 3D RACE CANVAS ===== */
.race-3d-canvas {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ===== RACE INTERFACE ===== */
.race-interface {
  position: fixed;
  inset: 0;
  z-index: 21;
  direction: ltr;
  color: #ffffff;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, rgba(5, 8, 14, 0.08), rgba(5, 8, 14, 0.2));
}

/* ===== TOP BAR ===== */
.race-topbar {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.race-exit {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  background: rgba(10, 15, 20, 0.8);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  transition: all 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.race-exit:hover {
  background: rgba(255, 60, 60, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.race-exit:active {
  transform: scale(0.95);
}

.race-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
}

.race-brand b {
  color: #00ffff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.race-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #001a1a;
  background: linear-gradient(135deg, #00ffff, #00aaff);
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
}

.race-mode {
  margin-left: auto;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(10, 15, 20, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #00ffff;
  backdrop-filter: blur(10px);
}

/* ===== STATUS ===== */
.race-status {
  position: absolute;
  top: 80px;
  left: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.race-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.9);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== START BUTTON ===== */
.race-start {
  position: absolute;
  top: 45%;
  left: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 20px 56px;
  transform: translate(-50%, -50%);
  color: #001a1a;
  background: linear-gradient(135deg, #73ffae 0%, #00d98a 20%, #00c6ff 100%);
  box-shadow:
    0 16px 50px rgba(0, 220, 150, 0.45),
    0 0 25px rgba(0, 198, 255, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font: 800 20px 'Trebuchet MS', sans-serif;
  letter-spacing: 2px;
  pointer-events: auto;
  transition: all 0.2s ease;
  animation: glow 2s infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 10px 40px rgba(0, 255, 136, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 10px 60px rgba(0, 255, 136, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
}

.race-start:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.race-start:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.race-start[hidden] { display: none; }

/* ===== LEADERBOARD ===== */
.race-leaderboard {
  position: absolute;
  top: 80px;
  right: 20px;
  width: 260px;
  padding: 18px;
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 25, 35, 0.9), rgba(8, 15, 22, 0.92));
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.race-leaderboard h2 {
  margin-bottom: 12px;
  color: #00ffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.race-leaderboard h2::before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00ffff, #00aaff);
}

.race-leaderboard ol {
  display: grid;
  gap: 6px;
  list-style: none;
}

.race-leaderboard li {
  display: grid;
  grid-template-columns: 28px 1fr 45px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.race-leaderboard li:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
}

.race-leaderboard li:nth-child(2) {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent);
}

.race-leaderboard li:nth-child(3) {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), transparent);
}

.race-leaderboard li span:first-child {
  color: #708090;
  font-weight: 700;
  font-size: 12px;
}

.race-leaderboard li span:nth-child(2) {
  color: #e0e8f0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-leaderboard li span:last-child {
  color: #00ffff;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
}

.race-leaderboard li.is-player {
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.race-leaderboard li.is-player span {
  color: #00ff88 !important;
  font-weight: 800;
}

/* ===== SPEED PANEL ===== */
.race-speed-panel {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 220px;
  padding: 20px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(12, 18, 27, 0.9), rgba(8, 15, 22, 0.96));
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.speed-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.speed-value strong {
  font-size: 62px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff, #00ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.5));
  transition: all 0.1s ease;
}

.speed-value span {
  color: #708090;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.boost-label {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.boost-label span:first-child {
  color: #ffcc00;
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.boost-label span:last-child {
  color: #e0e8f0;
}

.boost-track {
  height: 8px;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.boost-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff6600, #ffcc00, #00ff88);
  border-radius: 4px;
  transition: width 120ms linear;
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.6);
}

.race-lap {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #a0b0c0;
  font-size: 12px;
  font-weight: 600;
}

.race-lap span { direction: rtl; }

.race-lap b {
  font-weight: 800;
  color: #00ffff;
  letter-spacing: 1px;
}

/* ===== CONTROLS ===== */
.race-controls { display: contents; }
.race-control { display: none; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 700px) {
  .race-topbar {
    top: 12px;
    left: 12px;
    right: 12px;
    gap: 10px;
  }

  .race-exit {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .race-brand {
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .race-brand-mark {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .race-mode {
    padding: 6px 10px;
    font-size: 9px;
  }

  .race-status {
    top: 60px;
    left: 60px;
    padding: 8px 14px;
    font-size: 11px;
  }

  .race-leaderboard {
    top: 60px;
    right: 12px;
    width: 175px;
    padding: 12px;
  }

  .race-leaderboard h2 {
    margin-bottom: 8px;
    font-size: 10px;
  }

  .race-leaderboard ol { gap: 4px; }

  .race-leaderboard li {
    grid-template-columns: 22px 1fr 36px;
    gap: 5px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .race-speed-panel {
    left: 12px;
    bottom: 14px;
    width: 155px;
    padding: 14px;
  }

  .speed-value strong { font-size: 46px; }

  .speed-value span { font-size: 9px; }

  .boost-label {
    margin-top: 12px;
    font-size: 9px;
  }

  .boost-track { height: 6px; }

  .race-lap {
    margin-top: 10px;
    padding-top: 10px;
    font-size: 10px;
  }

  .race-control {
    position: absolute;
    bottom: 24px;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, rgba(25, 35, 45, 0.9), rgba(12, 18, 25, 0.95));
    cursor: pointer;
    touch-action: none;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    font-size: 28px;
    font-weight: 800;
    transition: all 0.1s ease;
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.4),
      inset 0 2px 0 rgba(255, 255, 255, 0.08);
  }

  .race-control.is-pressed {
    transform: scale(0.9);
    background: linear-gradient(145deg, rgba(0, 200, 255, 0.6), rgba(0, 150, 200, 0.7));
    box-shadow:
      0 0 30px rgba(0, 200, 255, 0.5),
      inset 0 2px 0 rgba(255, 255, 255, 0.2);
  }

  .steer-left { right: 160px; }
  .steer-right { right: 88px; }

  .accelerate {
    right: 18px;
    bottom: 98px;
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
  }

  .accelerate.is-pressed {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.6), rgba(0, 200, 100, 0.7));
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
  }

  .brake-control {
    right: 88px;
    bottom: 98px;
    font-size: 22px;
    color: #ff6b6b;
    border-color: rgba(255, 100, 100, 0.4);
  }

  .brake-control.is-pressed {
    background: linear-gradient(145deg, rgba(255, 100, 100, 0.6), rgba(200, 50, 50, 0.7));
    box-shadow: 0 0 30px rgba(255, 100, 100, 0.5);
  }

  .boost-control {
    right: 18px;
    font-size: 10px;
    font-weight: 800;
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.4);
    letter-spacing: 0.5px;
  }

  .boost-control.is-pressed {
    background: linear-gradient(145deg, rgba(255, 204, 0, 0.6), rgba(200, 150, 0, 0.7));
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
    color: #000;
  }
}

/* ===== SMALL MOBILE ===== */
@media (max-width: 400px) {
  .race-speed-panel {
    width: 135px;
    padding: 12px;
  }

  .speed-value strong { font-size: 40px; }

  .race-leaderboard {
    width: 155px;
    padding: 10px;
  }

  .race-control {
    width: 58px;
    height: 58px;
    font-size: 25px;
  }

  .steer-left { right: 145px; }
  .steer-right { right: 80px; }
  .accelerate { right: 14px; bottom: 90px; }
  .brake-control { right: 80px; bottom: 90px; }
  .boost-control { right: 14px; }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .race-speed-panel {
    width: 170px;
    padding: 12px;
    bottom: 10px;
  }

  .speed-value strong { font-size: 44px; }

  .boost-label { margin-top: 10px; }

  .race-lap { margin-top: 8px; padding-top: 8px; }

  .race-leaderboard {
    top: 55px;
    width: 190px;
    padding: 10px;
  }

  .race-status {
    top: 55px;
    left: 65px;
  }

  .race-control {
    width: 55px;
    height: 55px;
    bottom: 12px;
    font-size: 22px;
  }

  .steer-left { right: 135px; }
  .steer-right { right: 72px; }
  .accelerate { right: 12px; bottom: 75px; }
  .brake-control { right: 72px; bottom: 75px; }
  .boost-control { right: 12px; }
}

/* ===== THREE-DIMENSIONAL GARAGE ===== */
.garage-preview-canvas {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
}

.garage-interface {
  position: fixed;
  inset: 0;
  z-index: 21;
  color: #f4f5ed;
  direction: ltr;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  pointer-events: none;
}

.race-cockpit {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.race-cockpit::before {
  position: absolute;
  right: -8%;
  bottom: -12vh;
  left: -8%;
  height: min(30vh, 260px);
  border-top: 2px solid rgba(190, 222, 223, 0.22);
  background: linear-gradient(180deg, rgba(38, 49, 49, 0.85), #101616 42%, #080c0d);
  clip-path: polygon(0 34%, 18% 16%, 38% 6%, 62% 6%, 82% 16%, 100% 34%, 100% 100%, 0 100%);
  content: '';
}

.cockpit-wheel {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: clamp(108px, 11vw, 148px);
  aspect-ratio: 1;
  border: 13px solid #101616;
  border-radius: 50%;
  background: radial-gradient(circle, #263333 0 17%, #101616 18% 34%, transparent 35%);
  box-shadow: 0 0 0 2px rgba(190, 222, 223, 0.2), 0 8px 24px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}

.cockpit-wheel::before,
.cockpit-wheel::after {
  position: absolute;
  top: 40%;
  left: 42%;
  width: 16%;
  height: 64%;
  border-radius: 4px;
  background: #101616;
  content: '';
}

.cockpit-wheel::after {
  transform: rotate(90deg);
}

.garage-header {
  position: absolute;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.garage-back {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(239, 245, 233, 0.3);
  border-radius: 4px;
  color: #fff;
  background: rgba(16, 24, 23, 0.76);
  cursor: pointer;
  font-size: 25px;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.garage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.garage-brand b { color: #e8aa3c; }

.garage-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 3px;
  color: #17211e;
  background: #e8aa3c;
  font-weight: 900;
}

.garage-wallet {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  border: 1px solid rgba(244, 245, 237, 0.24);
  border-radius: 3px;
  padding: 9px 13px;
  background: rgba(16, 24, 23, 0.76);
  font-size: 12px;
  pointer-events: auto;
}

.garage-wallet span:first-child { color: #bdc8bf; }
.garage-wallet strong { color: #e8aa3c; font-size: 15px; }
.garage-wallet span:last-child { color: #87968c; font-weight: 700; }

.garage-detail {
  position: absolute;
  left: 28px;
  bottom: 30px;
  width: min(420px, calc(100vw - 420px));
  padding: 20px;
  border: 1px solid rgba(239, 245, 233, 0.18);
  border-radius: 4px;
  background: rgba(17, 26, 24, 0.86);
  direction: rtl;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.garage-eyebrow {
  color: #e8aa3c;
  font-size: 10px;
  font-weight: 800;
}

.garage-detail h1 {
  margin-top: 5px;
  font-size: 30px;
  line-height: 1.15;
}

.garage-detail > p:not(.garage-feedback) {
  margin-top: 7px;
  color: #bac5bc;
  font-size: 13px;
}

.garage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.garage-stat { display: grid; gap: 5px; }
.garage-stat span { color: #aab7ae; font-size: 10px; }
.garage-stat strong { font-size: 17px; }
.garage-stat i { height: 3px; background: rgba(255, 255, 255, 0.14); }
.garage-stat i b { display: block; height: 100%; background: #56cfb2; }

.garage-action {
  width: 100%;
  min-height: 46px;
  margin-top: 17px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  color: #17211e;
  background: #e8aa3c;
  cursor: pointer;
  font: 800 14px 'Trebuchet MS', sans-serif;
  pointer-events: auto;
}

.garage-action:disabled { cursor: default; opacity: 0.62; }
.garage-feedback { min-height: 14px; margin-top: 7px; color: #e8aa3c; font-size: 11px; }

.garage-catalog {
  position: absolute;
  top: 78px;
  right: 22px;
  bottom: 22px;
  width: 355px;
  padding: 15px;
  border: 1px solid rgba(239, 245, 233, 0.18);
  border-radius: 4px;
  background: rgba(17, 26, 24, 0.88);
  direction: rtl;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.garage-catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.garage-catalog-heading h2 { font-size: 15px; }
.garage-catalog-heading span { color: #9cac9f; font-size: 11px; }

.garage-car-list {
  display: grid;
  gap: 7px;
  max-height: calc(100% - 34px);
  overflow-y: auto;
  scrollbar-color: #68766d transparent;
}

.garage-car-option {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 65px;
  border: 1px solid rgba(239, 245, 233, 0.12);
  border-radius: 3px;
  padding: 9px;
  color: #f4f5ed;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  direction: ltr;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}

.garage-car-option:hover,
.garage-car-option.is-previewing {
  border-color: rgba(86, 207, 178, 0.64);
  background: rgba(86, 207, 178, 0.1);
}

.garage-car-swatch {
  width: 30px;
  height: 16px;
  border-radius: 8px 12px 4px 4px;
  background: var(--car-color);
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.22), 0 0 12px color-mix(in srgb, var(--car-color), transparent 65%);
}

.garage-car-option-copy { display: grid; min-width: 0; gap: 4px; }
.garage-car-option-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.garage-car-option-copy small { overflow: hidden; color: #9caaa1; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.garage-car-status { color: #e8aa3c; font-size: 10px; font-weight: 700; white-space: nowrap; }
.garage-car-option[aria-pressed="true"] .garage-car-status { color: #56cfb2; }

@media (max-width: 760px) {
  .garage-header { top: 10px; left: 12px; right: 12px; gap: 9px; }
  .garage-back { width: 38px; height: 38px; }
  .garage-brand { gap: 7px; font-size: 10px; }
  .garage-brand-mark { width: 30px; height: 30px; }
  .garage-wallet { gap: 5px; padding: 8px; font-size: 10px; }
  .garage-wallet strong { font-size: 13px; }
  .garage-detail { top: 62px; left: 12px; right: 12px; bottom: auto; width: auto; padding: 13px; }
  .garage-detail h1 { font-size: 22px; }
  .garage-detail > p:not(.garage-feedback) { margin-top: 4px; font-size: 11px; }
  .garage-stats { gap: 8px; margin-top: 10px; }
  .garage-stat span { font-size: 9px; }
  .garage-stat strong { font-size: 14px; }
  .garage-stat i { height: 2px; }
  .garage-action { min-height: 38px; margin-top: 10px; font-size: 12px; }
  .garage-feedback { min-height: 12px; margin-top: 4px; font-size: 10px; }
  .garage-catalog { top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; height: 29vh; min-height: 190px; padding: 10px; }
  .garage-catalog-heading { margin-bottom: 7px; }
  .garage-catalog-heading h2 { font-size: 13px; }
  .garage-car-list { grid-template-columns: 1fr 1fr; gap: 5px; max-height: calc(100% - 25px); }
  .garage-car-option { grid-template-columns: 25px minmax(0, 1fr); min-height: 54px; gap: 6px; padding: 7px; }
  .garage-car-swatch { width: 23px; height: 12px; }
  .garage-car-option-copy strong { font-size: 10px; }
  .garage-car-option-copy small { font-size: 8px; }
  .garage-car-status { grid-column: 2; font-size: 9px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .garage-detail { top: 72px; bottom: 12px; width: 330px; padding: 12px; }
  .garage-detail h1 { font-size: 22px; }
  .garage-stats { margin-top: 9px; }
  .garage-catalog { top: 68px; bottom: 12px; width: 300px; }
  .garage-car-option { min-height: 52px; }
}