@font-face {
  font-family: 'Red Hat Display';
  src: url('../vendor/fonts/red-hat-display.ttf') format('truetype');
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../vendor/fonts/playfair-display.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --font-ui: 'Red Hat Display', Arial, sans-serif;
  --font-editorial: 'Playfair Display', Georgia, serif;
}
html, body { font-family: var(--font-ui); }
button, kbd { font-family: var(--font-ui); }
button, button * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* A floating navigation bar, with a quiet center and clear actions. */
.topbar {
  top: 18px;
  left: 28px;
  right: 28px;
  height: 78px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  border: 1px solid #ffffffcc;
  border-radius: 18px;
  background: #fbfbf3ed;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px #0d2b261c, inset 0 1px 0 #ffffff;
}
.brand { justify-self: start; gap: 12px; }
.brand-icon {
  width: 46px;
  height: 46px;
  font-size: 32px;
  border-radius: 13px;
  background: linear-gradient(145deg, #315b45, #183e32);
  box-shadow: inset 0 1px 0 #ffffff20, 0 3px 9px #183e321a;
}
.brand strong { font-size: 25px; font-weight: 700; line-height: 1.12; }
.brand small {
  margin-top: 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #536d5f;
}
.location {
  display: flex;
  gap: 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.25px;
  white-space: nowrap;
}
.live-dot { width: 7px; height: 7px; background: #64854e; }
.separator { margin: 0 1px; padding: 0 3px; color: #819180; opacity: .65; }
.location-mode {
  padding: 7px 10px;
  border: 1px solid #d9e4cb;
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: 1.25px;
  color: #536d43;
  background: #eaf0dc;
}
.top-actions { justify-self: end; gap: 9px; }
.top-actions button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid #d9dfd2;
  border-radius: 10px;
  background: #f5f6eb;
  font-size: 15px;
  transition: background .18s, border-color .18s;
}
.top-actions button span {
  margin-left: 7px;
  font-size: 12px;
  font-weight: 600;
}
.top-actions button:hover { border-color: #9caf8b; background: #e9efdb; }

/* Display serif for names; the sans serif carries labels and controls. */
.explore h1 {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: clamp(42px, 4.5vw, 64px);
  letter-spacing: -2px;
  line-height: 1.06;
}
.explore p { font-size: 13px; font-weight: 500; }
.eyebrow { font-weight: 700; }
.fleet-header h2, #help h2, #loading h2 {
  font-family: var(--font-editorial);
  letter-spacing: -.7px;
  font-weight: 500;
}
.challenge h2 { font-size: 14px; font-weight: 700; }
.challenge p { font-size: 11px; }
.challenge-bottom button { font-size: 11px; }

/* A readable vehicle identity, followed by controls and a distinct fleet rail. */
.garage {
  padding: 20px 24px 16px;
  border-radius: 20px;
  background: rgb(251 251 243 / 68%);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  box-shadow: 0 12px 42px #102a2626;
}
.garage.is-tucked { pointer-events: none; }
.garage-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.garage-identity { min-width: 0; }
.garage-identity > .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 2px;
  color: #496050;
}
.garage .eyebrow b {
  margin: 0;
  padding: 4px 9px;
  border: 1px solid #dce5d0;
  border-radius: 5px;
  background: #eaf0df;
  color: #4d6749;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .9px;
}
.garage h2 {
  margin: 6px 0 5px;
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: 35px;
  line-height: 1.15;
  letter-spacing: -1px;
}
.garage p { font-size: 12px; line-height: 1.5; font-weight: 500; }
.garage-actions { gap: 10px; }
.garage-actions > span {
  display: inline;
  margin-right: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.1px;
}
#camera-button {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f1f4e6;
  font-size: 20px;
}
#garage-toggle {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 9px #254b3c16;
}
#garage-toggle span { margin-left: 18px; font-size: 17px; }
#garage-toggle:hover { background: #173d2e; }
.vehicle-interactions { margin-top: 14px; padding-top: 13px; }
.vehicle-interactions > div:first-child { margin-bottom: 9px; gap: 14px; }
.vehicle-interactions .eyebrow { font-size: 9px; letter-spacing: 1.6px; }
#vehicle-interaction-hint { font-size: 11px; }
#vehicle-actions { gap: 7px; padding-bottom: 4px; }
#vehicle-actions button {
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}
#vehicle-actions button:hover { background: #e5edda; }
.quick-fleet {
  margin-top: 13px;
  padding-top: 12px;
  padding-bottom: 3px;
  border-top: 1px solid var(--line);
  gap: 9px;
  scrollbar-color: #b6c5a7 transparent;
}
.quick-card {
  min-width: 174px;
  min-height: 62px;
  padding: 9px 11px;
  gap: 10px;
  border-radius: 11px;
  background: #f6f7ed;
  transition: background .18s, border-color .18s;
}
.quick-card.active {
  border-color: #738d50;
  background: #e6edcf;
  box-shadow: inset 0 0 0 1px #738d5020;
}
.quick-card:hover { border-color: #8da478; background: #edf2e1; }
.quick-card img { width: 48px; height: 38px; flex-shrink: 0; border-radius: 6px; }
.quick-card strong { font-size: 11px; font-weight: 700; line-height: 1.25; }
.quick-card small { font-size: 10px; line-height: 1.3; margin-top: 4px; }
.fleet-card strong { font-size: 13px; }
.fleet-card small { font-size: 11px; }
.filters button { font-size: 12px; font-weight: 600; }

/* Garage height changes with the selected name and the loaded fonts. */
.minimap { bottom: calc(var(--garage-clearance, 320px) + 18px); }
.telemetry { bottom: calc(var(--garage-clearance, 320px) + 52px); }
.drive-hints { bottom: calc(var(--garage-clearance, 320px) + 15px); }
#touch-controls { bottom: calc(var(--touch-anchor, var(--garage-clearance, 320px)) + 17px); }
#touch-controls button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#touch-controls button::selection { background: transparent; }

@media (max-width: 1120px) {
  .topbar { gap: 14px; padding: 0 18px; }
  .location { font-size: 9px; gap: 8px; letter-spacing: .8px; }
  .brand small { font-size: 8px; letter-spacing: 1.3px; }
  .top-actions button { padding: 9px 12px; }
  .garage-actions > span { display: none; }
  #vehicle-interaction-hint { font-size: 10px; }
}
@media (max-width: 760px) {
  .topbar {
    top: 12px;
    left: 12px;
    right: 12px;
    height: 110px;
    padding: 11px 12px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 45px 1fr;
    column-gap: 8px;
    row-gap: 5px;
    border-radius: 15px;
  }
  .brand { gap: 8px; }
  .brand-icon { width: 34px; height: 38px; border-radius: 10px; font-size: 27px; }
  .brand strong { font-size: 19px; }
  .brand small { margin-top: 5px; font-size: 6px; letter-spacing: 1.1px; white-space: nowrap; }
  .location { display: flex; grid-row: 2; grid-column: 1 / -1; justify-content: center; font-size: 9px; gap: 9px; letter-spacing: 1px; }
  .location-mode { font-size: 8px; padding: 5px 8px; }
  .live-dot { width: 5px; height: 5px; }
  .top-actions { grid-row: 1; grid-column: 2; gap: 5px; }
  .top-actions button { min-height: 35px; padding: 7px 8px; font-size: 12px; border-radius: 8px; }
  .top-actions button span { display: inline; margin-left: 3px; font-size: 10px; }
  .explore { top: 147px; }
  .explore h1 { font-size: 37px; letter-spacing: -1.2px; line-height: 1.07; }
  .challenge { top: 146px; }
  .challenge h2 { font-size: 11px; }
  .challenge p { font-size: 9px; }
  .challenge-bottom button { font-size: 10px; }
  #help { top: 133px; }
  #notice { top: 129px; }
  .garage { left: 10px; right: 10px; bottom: 10px; padding: 14px 14px 11px; border-radius: 17px; }
  .garage-heading { gap: 10px; align-items: center; }
  .garage-identity > .eyebrow { font-size: 8px; letter-spacing: 1.25px; gap: 7px; flex-wrap: wrap; row-gap: 5px; }
  .garage .eyebrow b { font-size: 7px; letter-spacing: .5px; padding: 4px 6px; }
  .garage h2 { font-size: 26px; line-height: 1.13; letter-spacing: -.7px; margin-top: 8px; }
  .garage p { font-size: 10px; line-height: 1.5; }
  .garage-actions { gap: 6px; }
  #camera-button { width: 33px; height: 36px; font-size: 17px; border-radius: 8px; }
  #garage-toggle { min-height: 36px; padding: 9px 10px; font-size: 10px; border-radius: 8px; }
  #garage-toggle span { margin-left: 5px; font-size: 13px; }
  .vehicle-interactions { margin-top: 11px; padding-top: 11px; }
  .vehicle-interactions .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
  #vehicle-actions button { padding: 8px 10px; font-size: 10px; }
  .quick-fleet { margin-top: 10px; padding-top: 10px; gap: 7px; }
  .quick-card { min-width: 157px; min-height: 58px; padding: 8px 9px; gap: 8px; }
  .quick-card img { width: 42px; height: 34px; }
  .quick-card strong { font-size: 10px; }
  .quick-card small { font-size: 9px; }
  .minimap { bottom: calc(var(--garage-clearance, 300px) + 78px); }
  .telemetry { bottom: calc(var(--garage-clearance, 300px) + 99px); }
  #touch-controls { bottom: calc(var(--touch-anchor, var(--garage-clearance, 300px)) + 17px); }
}
@media (max-width: 760px) and (max-height: 740px) {
  .explore, .minimap { display: none; }
  .challenge { top: 136px; }
  .telemetry { bottom: calc(var(--garage-clearance, 300px) + 78px); }
}
@media (max-height: 560px) {
  .topbar { top: 8px; height: 58px; }
  .brand-icon { width: 32px; height: 34px; font-size: 25px; }
  .brand strong { font-size: 19px; }
  .brand small { font-size: 6px; }
  .garage { padding-top: 10px; padding-bottom: 8px; }
  .garage h2 { font-size: 24px; margin-top: 3px; }
  .garage p { font-size: 10px; }
  .garage-identity > .eyebrow { font-size: 8px; }
  .vehicle-interactions { margin-top: 7px; padding-top: 7px; }
  .quick-fleet { margin-top: 7px; padding-top: 7px; }
  .quick-card { min-height: 48px; padding-top: 5px; padding-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .top-actions button, .quick-card { transition: none; }
}
@media (max-width: 360px) {
  .brand { gap: 6px; }
  .brand-icon { width: 29px; height: 34px; font-size: 24px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 5.5px; letter-spacing: .7px; }
  .top-actions { gap: 4px; }
  .top-actions button { padding: 7px 6px; font-size: 11px; }
  .top-actions button span { margin-left: 2px; font-size: 9px; }
  .garage-heading { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .garage-actions { justify-content: flex-end; }
}
@media (min-width: 761px) and (max-height: 760px) {
  .garage { padding: 14px 20px 11px; }
  .garage h2 { font-size: 29px; margin: 4px 0; }
  .garage p { font-size: 11px; }
  .garage-identity > .eyebrow { font-size: 9px; }
  .vehicle-interactions { margin-top: 10px; padding-top: 10px; }
  .vehicle-interactions > div:first-child { margin-bottom: 7px; }
  #vehicle-actions button { padding: 6px 10px; font-size: 10px; }
  .quick-fleet { margin-top: 10px; padding-top: 9px; }
  .quick-card { min-height: 52px; padding: 6px 9px; }
  .quick-card img { width: 42px; height: 32px; }
  .explore h1 { font-size: 44px; margin: 12px 0; }
  .explore .area-tag { display: none; }
  .minimap { width: 174px; padding: 10px; }
  #map { height: 70px; }
}
@media (min-width: 761px) and (max-height: 680px) {
  .explore, .minimap { display: none; }
}
@media (max-width: 760px) and (max-height: 560px) {
  .topbar { height: 88px; grid-template-rows: 36px 1fr; padding: 8px 12px; }
  .challenge, .telemetry { display: none; }
}
/* Keep only the useful scene controls; branding lives in the loader/favicon. */
.playground-tools {
  position: absolute;
  z-index: 6;
  top: 24px;
  left: 28px;
  right: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-self: auto;
}
.playground-tools button,
.playground-tools a {
  min-height: 44px;
  padding: 11px 16px;
  background: #fbfbf3f2;
  border: 1px solid #ffffffb3;
  border-radius: 11px;
  box-shadow: 0 4px 18px #102a2620;
  backdrop-filter: blur(14px);
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.playground-tools button span { display: inline; font-size: 12px; margin-left: 7px; }
#help { top: 82px; left: 28px; right: auto; }
#notice { top: 30px; }
.challenge { top: 24px; }
.loader-logo {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  border-radius: 28px;
  filter: drop-shadow(0 12px 18px #15382e26);
}
@media (max-width: 760px) {
  .playground-tools { top: 14px; left: 14px; gap: 7px; }
  .playground-tools button,
  .playground-tools a { min-height: 40px; padding: 9px 12px; font-size: 14px; }
  .playground-tools button span { font-size: 11px; margin-left: 5px; }
  #help { left: 14px; top: 66px; width: calc(100% - 28px); }
  #notice { top: 65px; }
  .challenge { top: 72px; }
  .loader-logo { width: 112px; height: 112px; border-radius: 24px; }
}
/* Shared borderless glass surfaces across the playground. */
:root { --glass-surface: rgb(251 251 243 / 48%); }
.panel, .garage, dialog, .quick-card, .fleet-card, .playground-tools button, .playground-tools a {
  background: var(--glass-surface);
  border: 0;
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  box-shadow: 0 8px 28px #102a261a;
}
.panel, dialog { --muted: #3c5147; }
.garage-identity > .eyebrow { color: #294a38; }
.quick-card.active, .fleet-card[aria-pressed=true] {
  background: rgb(217 235 157 / 48%);
  box-shadow: 0 4px 16px #254b3c24;
}
.quick-card:hover, .fleet-card:hover, .playground-tools button:hover, .playground-tools a:hover {
  background: rgb(251 251 243 / 58%);
}
.quick-card.active:hover, .fleet-card[aria-pressed=true]:hover {
  background: rgb(217 235 157 / 58%);
}
.vehicle-interactions, .quick-fleet, .challenge-bottom { border-color: #15382e1a; }
/* Give vehicle choices and part controls clear, readable button states. */
.quick-card, .fleet-card { position: relative; color: #102f25; }
.quick-card {
  min-width: 208px;
  min-height: 80px;
  padding: 12px 15px;
  gap: 12px;
  border-radius: 13px;
  box-shadow: 0 4px 16px #102a261c;
}
.quick-card img { width: 64px; height: 48px; border-radius: 8px; }
.quick-card strong { font-size: 13px; font-weight: 800; line-height: 1.3; }
.quick-card small { margin-top: 5px; font-size: 11px; font-weight: 600; color: #355346; }
.quick-card > span:last-child { padding-right: 8px; }
.quick-card.active, .fleet-card[aria-pressed=true] {
  background: rgb(22 61 45 / 92%);
  color: #fffced;
  box-shadow: 0 6px 20px #102a2633;
}
.quick-card.active strong, .fleet-card[aria-pressed=true] strong { color: #fffced; }
.quick-card.active small, .fleet-card[aria-pressed=true] small { color: #deebce; }
.quick-card.active::after, .fleet-card[aria-pressed=true]::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9eb9d;
  color: #163d2d;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}
.quick-card:hover, .fleet-card:hover {
  background: rgb(251 251 243 / 70%);
  box-shadow: 0 5px 18px #102a2626;
}
.quick-card.active:hover, .fleet-card[aria-pressed=true]:hover { background: rgb(22 61 45 / 98%); }
.fleet-card strong { font-size: 14px; font-weight: 800; }
.fleet-card small { font-weight: 600; }
#vehicle-actions { gap: 8px; padding-bottom: 6px; }
#vehicle-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  background: rgb(27 66 49 / 88%);
  color: #fffced;
  box-shadow: 0 3px 10px #102a2620;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
#vehicle-actions button:hover { background: #173e2d; }
#vehicle-actions button[aria-pressed]::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #ffffff66;
}
#vehicle-actions button[aria-pressed=true] { background: #d9eb9d; color: #153b29; }
#vehicle-actions button[aria-pressed=true]::before { background: #315b32; }
#vehicle-actions button[aria-pressed=true]:hover { background: #e5f3b8; }
@media (max-width: 760px) {
  .quick-card { min-width: 190px; min-height: 72px; padding: 10px 12px; gap: 10px; }
  .quick-card img { width: 56px; height: 44px; }
  .quick-card strong { font-size: 12px; }
  .quick-card small { font-size: 10px; }
  #vehicle-actions button { min-height: 36px; font-size: 11px; padding: 9px 12px; scroll-snap-align: start; }
  #vehicle-actions {
    scroll-snap-type: x proximity;
    margin-right: -14px;
    padding-right: 18px;
    mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  }
}
@media (max-height: 760px) and (min-width: 761px) {
  .quick-card { min-height: 68px; padding: 9px 12px; }
  .quick-card img { width: 56px; height: 42px; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Phone HUD: tools on their own row, the map under them, speed above the touch controls. */
@media (max-width: 760px) {
  .challenge,
  .quick-fleet { display: none; }
  .playground-tools {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    flex-wrap: nowrap;
    z-index: 7;
  }
  .playground-tools button,
  .playground-tools a {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
  }
  .playground-tools button span { font-size: 12px; margin-left: 4px; }
  .challenge,
  .minimap { top: calc(max(10px, env(safe-area-inset-top)) + 50px); }
  .challenge {
    left: 10px;
    right: auto;
    width: calc(100% - 156px);
    padding: 12px;
    z-index: 4;
  }
  .challenge-heading { margin: 8px 0; gap: 8px; }
  .challenge h2 { font-size: 13px; }
  .challenge p { font-size: 11px; }
  .challenge-bottom { padding-top: 8px; }
  .minimap {
    right: 10px;
    bottom: auto;
    left: auto;
    width: 126px;
    padding: 8px;
    z-index: 4;
  }
  #map { height: 76px; margin: 4px 0; }
  .telemetry {
    left: 14px;
    bottom: calc(var(--garage-clearance, 300px) + 80px);
    max-width: 42%;
    z-index: 3;
  }
  .telemetry #speed { font-size: 40px; letter-spacing: -2px; }
  .gear { padding: 5px 7px; font-size: 11px; }
  #touch-controls {
    left: 10px;
    right: 10px;
    bottom: calc(var(--touch-anchor, var(--garage-clearance, 300px)) + 16px);
    z-index: 5;
  }
  #touch-controls button { width: 48px; height: 48px; }
  .garage { bottom: max(10px, env(safe-area-inset-bottom)); }
  .garage-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "eyebrow actions" "name actions" "category category";
    align-items: center;
    gap: 6px 10px;
  }
  .garage-identity { display: contents; }
  .garage-identity > .eyebrow { grid-area: eyebrow; }
  .garage h2 { grid-area: name; margin-top: 0; }
  .garage-identity > p { grid-area: category; }
  .garage-actions { grid-area: actions; align-self: center; }
  #help {
    top: calc(max(10px, env(safe-area-inset-top)) + 50px);
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100% - var(--garage-clearance, 300px) - 70px);
    overflow: auto;
    z-index: 8;
  }
}
@media (max-width: 760px) and (max-height: 740px) {
  .minimap { display: none; }
  .challenge { width: min(230px, calc(100% - 20px)); }
}
@media (max-width: 760px) and (max-height: 560px) {
  .challenge, .telemetry { display: none; }
}
@media (max-width: 380px) {
  .playground-tools button span { display: none; }
  .challenge { width: calc(100% - 138px); }
  .minimap { width: 108px; }
  #map { height: 64px; }
}
