@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0c1113;
  --paper: #f4efe3;
  --muted: rgba(244, 239, 227, 0.62);
  --amber: #e9a33c;
  --amber-hot: #f6bd62;
  --line: rgba(244, 239, 227, 0.16);
  --panel: rgba(11, 16, 18, 0.6);
  --panel-solid: rgba(13, 18, 20, 0.92);
  --sea: #2c6f84;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0c1113;
  color: var(--paper);
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

.scrims {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 8, 10, 0.42) 0%, rgba(5, 8, 10, 0) 18%),
    linear-gradient(0deg, rgba(5, 8, 10, 0.42) 0%, rgba(5, 8, 10, 0) 22%);
}

button { font: inherit; color: inherit; }

#topbar {
  position: absolute;
  top: calc(16px + var(--safe-t));
  left: calc(20px + var(--safe-l));
  right: calc(20px + var(--safe-r));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.brand-city {
  font-family: "Bebas Neue", sans-serif;
  font-size: 30px;
  letter-spacing: 0.16em;
  line-height: 0.9;
}

.brand-sub {
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.discover {
  display: flex;
  align-items: baseline;
  gap: 2px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 14, 16, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.discover-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 20px;
  color: var(--paper);
}
.discover-total { color: var(--muted); font-size: 12px; }
.discover-sep { font-size: 11px; color: var(--muted); margin: 0 1px; }
.discover-label { text-transform: uppercase; font-size: 10px; letter-spacing: 0.16em; margin-left: 6px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 14, 16, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  position: relative;
  padding: 0;
}
.icon-btn:hover { background: rgba(30, 38, 42, 0.7); border-color: rgba(244, 239, 227, 0.3); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; fill: var(--paper); opacity: 0.9; }
.qmark { font-size: 17px; font-weight: 600; color: var(--paper); }
.icon-btn .sound-off {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 16, 0.58);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}
.icon-btn .sound-off::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 1.5px;
  background: var(--paper);
  transform: translate(-50%, -50%) rotate(-45deg);
}
.icon-btn.muted .sound-off { opacity: 1; }

/* minimap */
#minimapCard {
  position: absolute;
  top: calc(74px + var(--safe-t));
  right: calc(20px + var(--safe-r));
  width: 166px;
  height: 166px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(9, 13, 15, 0.46);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  z-index: 14;
  transition: opacity 0.3s;
}
#minimapCard.hidden { opacity: 0; pointer-events: none; }
#minimap { width: 100%; height: 100%; display: block; }
.minimap-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(244, 239, 227, 0.5);
  pointer-events: none;
}

/* speedometer */
body:not(.driving) #speedoCard,
body:not(.driving) #keyHint,
body:not(.driving) #landmarks { opacity: 0; }
#speedoCard, #keyHint, #landmarks { transition: opacity 0.5s ease; }

#speedoCard {
  position: absolute;
  right: calc(24px + var(--safe-r));
  bottom: calc(22px + var(--safe-b));
  width: 198px;
  padding: 14px 18px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  z-index: 15;
}

.gauge { position: absolute; inset: 6px 8px auto; width: calc(100% - 16px); height: auto; }
.gauge-track, .gauge-fill { fill: none; stroke-linecap: round; }
.gauge-track { stroke: rgba(244, 239, 227, 0.14); stroke-width: 3; }
.gauge-fill { stroke: var(--amber); stroke-width: 3; stroke-dasharray: 157; stroke-dashoffset: 157; filter: drop-shadow(0 0 5px rgba(233, 163, 60, 0.5)); }

.speed-row { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.speed-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 58px;
  line-height: 0.9;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 78px;
}
.speed-unit { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.gear-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 239, 227, 0.12);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
#gear { color: var(--amber); font-weight: 600; letter-spacing: 0.1em; }
.gear-sep { width: 1px; height: 10px; background: rgba(244, 239, 227, 0.2); }
#streetName { overflow: hidden; text-overflow: ellipsis; }

/* landmark labels */
#landmarks { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.marker {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(10, 14, 16, 0.5);
  border: 1px solid rgba(244, 239, 227, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(244, 239, 227, 0.9);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.25s;
  will-change: transform, opacity;
}
.marker.show { opacity: 1; }
.marker .m-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(233, 163, 60, 0.16);
  flex: none;
}
.marker .m-dist { color: rgba(244, 239, 227, 0.5); font-size: 10px; margin-left: 1px; }
.marker.visited.show { opacity: 0.55; }
.marker.visited .m-dot { background: #8fc6a8; box-shadow: none; }

/* touch */
#touch { display: none; }
.touch-cluster { position: absolute; bottom: calc(18px + var(--safe-b)); display: flex; gap: 12px; z-index: 16; }
.touch-cluster.steer { left: calc(18px + var(--safe-l)); }
.touch-cluster.pedals { right: calc(18px + var(--safe-r)); flex-direction: column; gap: 10px; align-items: flex-end; }
.tbtn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 227, 0.22);
  background: rgba(11, 16, 18, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  touch-action: none;
  color: var(--paper);
  padding: 0;
}
.tbtn svg { width: 26px; height: 26px; fill: currentColor; opacity: 0.9; }
.tbtn.gas { background: rgba(233, 163, 60, 0.26); border-color: rgba(233, 163, 60, 0.5); }
.tbtn:active, .tbtn.on { background: rgba(244, 239, 227, 0.26); }
.tbtn.gas:active, .tbtn.gas.on { background: rgba(233, 163, 60, 0.55); }

body.has-touch #touch { display: block; }
body.has-touch #keyHint { display: none; }
body:not(.driving) #touch { opacity: 0; pointer-events: none; }
#touch { transition: opacity 0.4s; }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-keys { display: none; }
  .hint-touch { display: flex; }
}

/* key hint */
#keyHint {
  position: absolute;
  left: calc(24px + var(--safe-l));
  bottom: calc(22px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(244, 239, 227, 0.54);
  z-index: 13;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
#keyHint b {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-right: 2px;
  border: 1px solid rgba(244, 239, 227, 0.25);
  border-radius: 5px;
  font-weight: 500;
  font-size: 10px;
  color: rgba(244, 239, 227, 0.8);
}

/* toast */
#toast {
  position: absolute;
  left: 50%;
  bottom: calc(120px + var(--safe-b));
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(12, 18, 20, 0.82);
  border: 1px solid rgba(233, 163, 60, 0.35);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 40;
  white-space: nowrap;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast b { color: var(--amber-hot); font-weight: 600; }

/* panels */
.panel {
  position: absolute;
  top: 50%;
  right: calc(24px + var(--safe-r));
  transform: translateY(-50%);
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid rgba(244, 239, 227, 0.16);
  background: var(--panel-solid);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  z-index: 50;
  scrollbar-width: thin;
}
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-kicker {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
}
.panel h2 {
  margin: 2px 0 0;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.panel .close { width: 34px; height: 34px; font-size: 22px; line-height: 1; border-radius: 50%; flex: none; }
.panel-lead { margin: 14px 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 42ch; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.panel-block h3 {
  margin: 0 0 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 239, 227, 0.5);
}
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; color: rgba(244, 239, 227, 0.85); }
.keys li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.keys li span { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11px; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(244, 239, 227, 0.24);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(244, 239, 227, 0.05);
  font-family: inherit;
  font-size: 10.5px;
  color: var(--paper);
}
.panel-note { margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: rgba(244, 239, 227, 0.42); }
.places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.places li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: rgba(244, 239, 227, 0.55);
  transition: color 0.3s;
}
.places li .p-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 227, 0.3);
  flex: none;
}
.places li.found { color: var(--paper); }
.places li.found .p-dot { background: #8fc6a8; border-color: #8fc6a8; }
.places li .p-dist { margin-left: auto; font-size: 10px; color: rgba(244, 239, 227, 0.38); }
.panel-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; border-color: rgba(244, 239, 227, 0.22); color: var(--paper); }
.btn.ghost:hover { border-color: rgba(244, 239, 227, 0.45); }
.btn.solid { background: var(--amber); color: #1a1206; font-weight: 600; }
.btn.solid:hover { background: var(--amber-hot); }
.panel-foot { margin-top: 18px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244, 239, 227, 0.28); }

/* veils */
.veil {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}
.veil[hidden] { display: none; }

#loading {
  background:
    radial-gradient(120% 90% at 70% 10%, rgba(44, 111, 132, 0.35) 0%, rgba(9, 13, 15, 0.92) 55%),
    #0a0f11;
  z-index: 70;
  transition: opacity 0.6s ease;
}
#loading.fade { opacity: 0; pointer-events: none; }
.load-inner { width: min(420px, 90vw); text-align: left; }
.load-mark {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(46px, 9vw, 78px);
  line-height: 0.9;
  letter-spacing: 0.16em;
  color: var(--paper);
}
.load-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: 2px;
}
.load-bar {
  height: 2px;
  margin: 30px 0 14px;
  background: rgba(244, 239, 227, 0.14);
  overflow: hidden;
}
.load-bar i { display: block; height: 100%; width: 0%; background: var(--amber); transition: width 0.4s ease; }
.load-status { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

.start-veil {
  z-index: 65;
  place-items: end start;
  padding: 0;
  background:
    radial-gradient(110% 80% at 72% 20%, rgba(10, 16, 18, 0) 0%, rgba(8, 12, 14, 0.35) 70%),
    linear-gradient(0deg, rgba(6, 10, 12, 0.8) 0%, rgba(6, 10, 12, 0.12) 52%, rgba(6, 10, 12, 0) 78%);
}
.start-card {
  position: relative;
  padding: 0 24px calc(46px + var(--safe-b)) calc(28px + var(--safe-l));
  max-width: 640px;
}
.start-kicker {
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.start-card h1 {
  margin: 0 0 14px;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: clamp(76px, 12vw, 150px);
  line-height: 0.82;
  letter-spacing: 0.03em;
  text-shadow: 0 12px 50px rgba(0, 0, 0, 0.5);
}
.start-lead {
  margin: 0 0 26px;
  max-width: 42ch;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.55;
  color: rgba(244, 239, 227, 0.78);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px 15px 26px;
  background: var(--amber);
  color: #1a1206;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(233, 163, 60, 0.28);
  transition: background 0.2s, transform 0.2s;
}
.start-btn:hover { background: var(--amber-hot); transform: translateY(-1px); }
.start-btn:active { transform: scale(0.98); }
.start-btn svg { width: 16px; height: 16px; fill: currentColor; }
.start-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: rgba(244, 239, 227, 0.55);
}
.start-hint b { color: rgba(244, 239, 227, 0.86); font-weight: 500; }
.start-hint .dot { opacity: 0.5; }
.start-credit {
  position: absolute;
  right: calc(24px + var(--safe-r));
  bottom: calc(26px + var(--safe-b));
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 239, 227, 0.4);
}

#error { background: #0a0f11; text-align: center; z-index: 90; }
#error .load-inner { text-align: center; }
#error .load-title { letter-spacing: 0.08em; text-transform: none; color: var(--paper); font-size: 30px; margin-bottom: 10px; }
#error .load-status { text-transform: none; letter-spacing: 0.02em; font-size: 13px; line-height: 1.5; }

@media (max-width: 900px) {
  .brand-city { font-size: 24px; }
  .brand-sub { font-size: 10px; }
  #minimapCard { width: 132px; height: 132px; top: calc(66px + var(--safe-t)); }
  .panel { right: 12px; left: 12px; width: auto; top: auto; bottom: calc(12px + var(--safe-b)); transform: none; max-height: 82vh; }
  .panel-grid { grid-template-columns: 1fr; gap: 18px; }
  body:not(.driving) #speedoCard,
body:not(.driving) #keyHint,
body:not(.driving) #landmarks { opacity: 0; }
#speedoCard, #keyHint, #landmarks { transition: opacity 0.5s ease; }

#speedoCard { width: 158px; padding: 12px 15px 10px; }
  .speed-num { font-size: 48px; min-width: 64px; }
}

@media (max-width: 620px) {
  #topbar { top: calc(12px + var(--safe-t)); left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r)); }
  .brand-city { font-size: 21px; letter-spacing: 0.12em; }
  .brand-sub { letter-spacing: 0.26em; }
  .discover { height: 34px; padding: 0 11px; }
  .icon-btn { width: 34px; height: 34px; }
  #minimapCard { width: 108px; height: 108px; top: calc(60px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
  .minimap-label { display: none; }
  #keyHint { display: none; }
  .start-card { padding-left: calc(20px + var(--safe-l)); padding-right: 20px; padding-bottom: calc(30px + var(--safe-b)); }
  .start-card h1 { font-size: clamp(68px, 19vw, 104px); }
  .start-lead { font-size: 14px; max-width: 34ch; }
  .start-credit { display: none; }
  .start-hint { font-size: 10.5px; }
  #toast { bottom: calc(278px + var(--safe-b)); font-size: 12px; }
}

/* touch devices: put the speedo in the free space above the pedal cluster */
@media (pointer: coarse) {
  #keyHint { display: none; }
  body.has-touch body:not(.driving) #speedoCard,
body:not(.driving) #keyHint,
body:not(.driving) #landmarks { opacity: 0; }
#speedoCard, #keyHint, #landmarks { transition: opacity 0.5s ease; }

#speedoCard {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(12px + var(--safe-b));
    width: 146px;
    padding: 10px 13px 9px;
  }
  body.has-touch .speed-num { font-size: 42px; min-width: 56px; }
  body.has-touch .speed-row { margin-top: 4px; }
  body.has-touch .gear-row { margin-top: 6px; padding-top: 6px; font-size: 9px; }
  body.has-touch .gauge { inset: 4px 6px auto; width: calc(100% - 12px); opacity: 0.8; }
}

@media (max-width: 620px) and (pointer: coarse) {
  body.has-touch body:not(.driving) #speedoCard,
body:not(.driving) #keyHint,
body:not(.driving) #landmarks { opacity: 0; }
#speedoCard, #keyHint, #landmarks { transition: opacity 0.5s ease; }

#speedoCard {
    bottom: calc(194px + var(--safe-b));
    left: calc(14px + var(--safe-l));
    transform: none;
    width: 126px;
    padding: 8px 12px 8px;
    background: rgba(11, 16, 18, 0.5);
  }
  body.has-touch .speed-num { font-size: 36px; min-width: 48px; }
  body.has-touch .speed-unit { font-size: 9px; }
  body.has-touch .gear-row { display: none; }
  .tbtn { width: 66px; height: 66px; }
}

@media (max-height: 520px) {
  #minimapCard { width: 104px; height: 104px; }
  .start-card { padding-bottom: calc(22px + var(--safe-b)); }
  .start-card h1 { font-size: clamp(56px, 11vh, 92px); margin-bottom: 8px; }
  .start-lead { font-size: 12.5px; margin-bottom: 14px; max-width: 56ch; }
  .start-btn { padding: 11px 18px; }
  .start-hint { margin-top: 10px; }
  body:not(.driving) #speedoCard,
body:not(.driving) #keyHint,
body:not(.driving) #landmarks { opacity: 0; }
#speedoCard, #keyHint, #landmarks { transition: opacity 0.5s ease; }

#speedoCard { width: 140px; padding: 9px 13px; }
  .speed-num { font-size: 40px; min-width: 54px; }
  #keyHint { display: none; }
}

@media (max-width: 380px) {
  .tbtn { width: 58px; height: 58px; }
  .touch-cluster { gap: 8px; }
  .brand-city { font-size: 18px; }
  .discover-label { display: none; }
}
