:root {
  --bone: #f4ede4;
  --amber: #e8a96a;
  --sand: #c97b45;
  --slate: #2b2c30;
  --shade: #141519;
  --sky: #a9bcc9;
  --pearl: #f2f2ef;
  --crimson: #d2301e;
  --display: "Big Shoulders", "Arial Narrow", sans-serif;
  --text: "Archivo", system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --pad: clamp(16px, 3.2vw, 56px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0c0d0f;
  color: var(--bone);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
}

body { position: fixed; inset: 0; }

#world {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #1b1713;
}
#world canvas { display: block; width: 100%; height: 100%; }
#grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

#fade {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #0c0d0f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#fade.is-on { opacity: 1; pointer-events: auto; }

#flare {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: 0.85;
  transition: opacity 0.6s ease;
}
.flare-core {
  display: none;
  position: absolute;
  width: 5.5vmax;
  height: 5.5vmax;
  margin: -2.75vmax 0 0 -2.75vmax;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,250,235,0.38) 0%,
    rgba(255,226,178,0.14) 16%,
    rgba(255,178,104,0.04) 38%,
    rgba(255,150,70,0.01) 60%,
    rgba(255,150,70,0) 76%);
  filter: blur(4px);
}
.flare-veil {
  display: none;
  position: absolute;
  width: 50vmax;
  height: 28vmax;
  margin: -14vmax 0 0 -25vmax;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255,214,160,0.05) 0%,
    rgba(255,190,120,0.02) 28%,
    rgba(255,170,100,0.006) 50%,
    rgba(255,170,100,0) 68%);
}
.flare-streak {
  position: absolute;
  width: 36vmax;
  height: 1.2vmax;
  margin: -0.6vmax 0 0 -18vmax;
  background: radial-gradient(ellipse at center,
    rgba(255,238,208,0.16) 0%,
    rgba(255,208,150,0.04) 26%,
    rgba(255,190,120,0.008) 56%,
    rgba(255,190,120,0) 72%);
  filter: blur(3px);
}
.flare-ghost {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.36;
}
.flare-ghost.g1 { width: 4.2vmax; height: 4.2vmax; background: radial-gradient(circle, rgba(255,214,164,0.22) 0%, rgba(255,214,164,0.04) 55%, transparent 70%); }
.flare-ghost.g2 { width: 2.1vmax; height: 2.1vmax; background: radial-gradient(circle, rgba(214,232,255,0.2) 0%, transparent 68%); }
.flare-ghost.g3 { width: 7vmax; height: 7vmax; background: radial-gradient(circle, rgba(255,196,140,0.1) 0%, transparent 66%); }

/* ---------------- title ---------------- */

#title {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
#title.is-hidden {
  opacity: 0;
  transform: translateY(-1.5vh);
  pointer-events: none;
}
#title.is-hidden .plate, #title.is-hidden .start { pointer-events: none; }

.title-copy {
  position: absolute;
  top: clamp(14px, 4vh, 54px);
  left: var(--pad);
  width: min(46vw, 560px);
  text-shadow: 0 1px 22px rgba(38, 24, 14, 0.5);
}
.emblem-row { margin-bottom: -0.6vw; }
.emblem {
  width: clamp(78px, 12vw, 170px);
  height: auto;
  margin-left: clamp(-6px, -0.5vw, 0px);
  opacity: 0.96;
  filter: drop-shadow(0 2px 12px rgba(30, 16, 8, 0.35));
}
.wordmark { margin: 0; line-height: 0; }
.wordmark img {
  width: clamp(210px, 27vw, 470px);
  height: auto;
  display: block;
  filter: saturate(1.03) contrast(1.04);
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, rgba(0,0,0,0.2) 100%);
  mask-image: linear-gradient(to bottom, #000 88%, rgba(0,0,0,0.2) 100%);
}
.tagline {
  margin: clamp(10px, 1.8vh, 20px) 0 0;
  font-size: clamp(11px, 1.05vw, 15px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.82);
  font-weight: 500;
}
.keys {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 0.45vw, 8px);
  margin-top: clamp(12px, 2.2vh, 26px);
}
.keys img {
  height: clamp(22px, 2.4vw, 34px);
  width: auto;
  filter: drop-shadow(0 2px 3px rgba(20, 14, 8, 0.45));
}
.keys img.wide { height: clamp(20px, 2.2vw, 31px); }
.keymask {
  margin: clamp(8px, 1.2vh, 14px) 0 0;
  font-size: clamp(9px, 0.82vw, 11.5px);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.66);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55em;
}
.keymask span { width: 1px; height: 9px; background: rgba(244, 237, 228, 0.28); display: inline-block; align-self: center; }
.start {
  pointer-events: auto;
  margin-top: clamp(14px, 2.4vh, 28px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(19px, 2.1vw, 30px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  text-shadow: 0 2px 18px rgba(30, 16, 8, 0.55);
}
.start::after {
  content: "";
  width: 0.72em;
  height: 0.72em;
  border-right: 2px solid var(--crimson);
  border-bottom: 2px solid var(--crimson);
  transform: translateY(-0.06em) rotate(-45deg);
  filter: drop-shadow(0 0 6px rgba(210, 48, 30, 0.4));
}
.start:hover { color: #fff8ec; }
.start:focus-visible { outline: 1px solid rgba(244,237,228,0.6); outline-offset: 6px; }
.choose-hint {
  margin: 0.7em 0 0;
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.04em;
  color: rgba(244, 237, 228, 0.55);
  max-width: 34ch;
}

/* ---------------- plates ---------------- */

.plates {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(14px, 3.2vh, 34px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.1vw, 18px);
  pointer-events: none;
  z-index: 22;
}
.plate {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  height: clamp(58px, 7.4vh, 88px);
  padding: 0;
  border: 0;
  background: #1a1b1e;
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  color: var(--bone);
  box-shadow: 0 10px 28px rgba(10, 8, 6, 0.38), 0 1px 0 rgba(255,255,255,0.06) inset;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s ease, filter 0.35s ease;
  text-align: left;
}
.plate-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: -1;
  filter: brightness(0.4) saturate(0.55) contrast(1.05);
  opacity: 0.92;
  transition: filter 0.35s ease, opacity 0.35s ease;
}
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 9px;
  border: 1px solid rgba(244, 237, 228, 0.14);
  transition: border-color 0.35s ease;
}
.plate-name {
  display: flex;
  flex-direction: column;
  padding-left: clamp(18px, 2vw, 30px);
  line-height: 0.88;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(18px, 1.9vw, 27px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: rgba(244, 237, 228, 0.9);
  transition: color 0.35s ease;
}
.plate-name b { font-weight: 700; }
.plate-mark {
  position: absolute;
  left: clamp(7px, 0.75vw, 11px);
  top: 50%;
  width: 3px;
  height: 46%;
  transform: translateY(-50%);
  background: var(--crimson);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 10px rgba(210, 48, 30, 0.55);
}
.plate:hover, .plate:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(10, 8, 6, 0.5);
  outline: none;
}
.plate:hover .plate-bg { filter: brightness(0.62) saturate(0.75); }
.plate.is-current { transform: translateY(-3px); }
.plate.is-current .plate-bg { filter: brightness(0.92) saturate(0.86) contrast(1.02); opacity: 1; }
.plate.is-current .plate-name { color: #231c17; }
.plate.is-current::after { border-color: rgba(210, 48, 30, 0.75); box-shadow: 0 0 0 1px rgba(210,48,30,0.25); }
.plate.is-current .plate-mark { opacity: 1; }
.plate.is-current:hover { transform: translateY(-7px); }

/* ---------------- hud ---------------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#hud.is-on { opacity: 1; }
#hud.is-select .hud-left, #hud.is-select .hud-help { display: none; }
body.is-title #touch { display: none; }

.hud-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(12, 12, 14, 0.55) 0%, rgba(12, 12, 14, 0.22) 13%, rgba(12,12,14,0) 30%),
    radial-gradient(120% 80% at 50% 110%, rgba(10,10,12,0.28) 0%, transparent 60%);
}

.dial {
  position: absolute;
  right: clamp(10px, 2.4vw, 46px);
  bottom: clamp(14px, 3.4vh, 40px);
  width: clamp(212px, 23vw, 372px);
  aspect-ratio: 871 / 692;
  filter: drop-shadow(0 8px 26px rgba(8, 6, 5, 0.35));
}
.dial::before {
  content: "";
  position: absolute;
  inset: -14%;
  background: radial-gradient(ellipse at 50% 42%, rgba(15, 14, 15, 0.55) 0%, rgba(15,14,15,0.28) 38%, rgba(15,14,15,0) 68%);
  border-radius: 50%;
}
.dial-plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.24;
  mix-blend-mode: screen;
  filter: blur(0.6px);
  pointer-events: none;
}
.dial-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dial-readout {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  width: 58%;
  text-align: center;
  color: rgba(244, 237, 228, 0.92);
}
.dial-speed {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 1;
  text-shadow: 0 0 18px rgba(255, 224, 178, 0.18);
}
.dial-unit {
  font-family: var(--mono);
  font-size: clamp(7px, 0.66vw, 10px);
  letter-spacing: 0.24em;
  white-space: nowrap;
  margin-top: 0.4em;
  color: rgba(244, 237, 228, 0.55);
}
.dial-gear {
  position: absolute;
  right: -4%;
  top: 24%;
  transform: translateX(100%);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1;
  color: rgba(244, 237, 228, 0.9);
  border-left: 1px solid rgba(244, 237, 228, 0.28);
  padding-left: 0.4em;
}
.dial-charge {
  margin: clamp(9px, 1.2vh, 14px) auto 0;
  width: 58%;
  height: 3px;
  background: rgba(244, 237, 228, 0.18);
  overflow: hidden;
}
.dial-charge i {
  display: block;
  height: 100%;
  width: 86%;
  background: linear-gradient(to right, rgba(244,237,228,0.55), rgba(255,246,230,0.95));
  transition: width 0.4s linear;
}
.dial-charge-label {
  font-family: var(--mono);
  font-size: clamp(6px, 0.52vw, 8.5px);
  letter-spacing: 0.22em;
  margin-top: 0.5em;
  color: rgba(244, 237, 228, 0.4);
}
.dial-charge-label span { color: rgba(244,237,228,0.7); }

.hud-left {
  position: absolute;
  left: clamp(14px, 2.6vw, 48px);
  bottom: clamp(52px, 8vh, 90px);
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  align-items: flex-start;
}
.hud-brand { display: flex; align-items: center; gap: 0.6em; opacity: 0.8; }
.hud-brand img { width: 26px; height: auto; opacity: 0.9; }
.hud-brand span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  color: rgba(244, 237, 228, 0.66);
}
.hud-indicators { display: flex; gap: 10px; align-items: center; }
.hud-indicators img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.3;
  filter: brightness(1.4);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.hud-indicators img.on { opacity: 0.92; filter: brightness(1.6) drop-shadow(0 0 4px rgba(255,220,170,0.4)); }
.hud-map {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 6px 10px;
  border: 1px solid rgba(244, 237, 228, 0.16);
  background: rgba(18, 17, 18, 0.28);
  backdrop-filter: blur(3px);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: clamp(7px, 0.58vw, 9.5px);
  letter-spacing: 0.12em;
  color: rgba(244, 237, 228, 0.62);
}
.hud-map b { font-weight: 500; color: rgba(244,237,228,0.86); letter-spacing: 0.16em; }
.hud-map em { font-style: normal; color: rgba(244,237,228,0.45); }
.map-line { width: 30px; height: 1px; background: rgba(244,237,228,0.24); position: relative; display: inline-block; }
.map-dot { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--crimson); margin-left: 12px; box-shadow: 0 0 6px rgba(210,48,30,0.7); }

.hud-help {
  position: absolute;
  right: clamp(12px, 2.4vw, 44px);
  top: clamp(12px, 2.4vh, 26px);
  max-width: min(60vw, 640px);
  text-align: right;
  font-family: var(--mono);
  font-size: clamp(7px, 0.56vw, 9.5px);
  letter-spacing: 0.14em;
  color: rgba(244, 237, 228, 0.5);
  text-shadow: 0 1px 8px rgba(10,8,6,0.6);
}
.hud-cam {
  position: absolute;
  right: clamp(12px, 2.4vw, 44px);
  bottom: clamp(14px, 3.4vh, 40px);
  display: none;
}

/* ---------------- cockpit ---------------- */

#cockpit {
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#cockpit.is-on { opacity: 1; }
.windscreen-dust {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 48% at 50% 44%, transparent 40%, rgba(60, 40, 24, 0.10) 78%, rgba(34, 22, 14, 0.4) 100%),
    radial-gradient(ellipse 30% 20% at 18% 30%, rgba(255, 238, 210, 0.08), transparent 70%),
    radial-gradient(ellipse 24% 14% at 82% 24%, rgba(255, 226, 186, 0.06), transparent 75%);
  mix-blend-mode: normal;
}
.wiper {
  position: absolute;
  left: 6%;
  bottom: -2%;
  width: 46%;
  height: 62%;
  border-radius: 999px;
  border-right: 2px solid rgba(220, 206, 186, 0.06);
  border-top: 1px solid rgba(230, 216, 196, 0.05);
  transform-origin: 8% 100%;
  filter: blur(2px);
}
.wiper.w1 { transform: rotate(-26deg); }
.wiper.w2 { transform: rotate(-8deg); opacity: 0.6; }

.cockpit-pillar {
  position: absolute;
  top: -10%;
  width: 17%;
  height: 90%;
  background: linear-gradient(to bottom, rgba(14, 14, 16, 0.96), rgba(22, 20, 20, 0.88) 55%, rgba(30, 25, 22, 0.55) 84%, rgba(30,25,22,0) 100%);
  filter: blur(0.4px);
}
.cockpit-pillar.left { left: -3%; clip-path: polygon(0 0, 34% 0, 100% 100%, 0 100%); }
.cockpit-pillar.right { right: -3%; clip-path: polygon(66% 0, 100% 0, 100% 100%, 0 100%); }
.cockpit-roof {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12%;
  background: linear-gradient(to bottom, rgba(12, 12, 14, 0.94), rgba(12,12,14,0));
}
.dash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background:
    linear-gradient(to top, #0d0e10 0%, #141416 42%, #1c1a19 72%, rgba(28,26,25,0) 100%);
  clip-path: polygon(0 32%, 16% 26%, 38% 22%, 50% 20%, 62% 22%, 84% 26%, 100% 32%, 100% 100%, 0 100%);
}
.dash-screen {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: min(19vw, 250px);
  aspect-ratio: 2.15 / 1;
  border-radius: 6px;
  border: 1px solid rgba(120, 116, 108, 0.35);
  background: linear-gradient(160deg, #17181a 0%, #0a0b0d 70%);
  box-shadow: 0 0 0 4px rgba(7,7,8,0.75), 0 6px 26px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dash-screen canvas { width: 100%; height: 100%; display: block; }
.dash-wheel {
  position: absolute;
  left: 50%;
  bottom: -14%;
  transform: translateX(-50%);
  width: 34%;
  height: 44%;
  border-radius: 50%;
  border: 10px solid #121214;
  background: radial-gradient(ellipse at 50% 30%, #1b1b1e 0%, #0b0b0d 70%);
  box-shadow: 0 -4px 18px rgba(0,0,0,0.5) inset;
}
.mirror {
  position: absolute;
  left: 50%;
  top: 7%;
  transform: translateX(-50%);
  width: 13%;
  height: 5.2%;
  border-radius: 40% 40% 42% 42% / 55% 55% 45% 45%;
  background: linear-gradient(165deg, #2b2b2d 0%, #131315 60%);
  border: 2px solid #101012;
  box-shadow: 0 5px 14px rgba(0,0,0,0.45);
}
.mirror::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 40%;
  background: linear-gradient(to bottom, rgba(232, 169, 106, 0.5), rgba(120, 88, 58, 0.35) 40%, rgba(40, 36, 32, 0.7));
  opacity: 0.8;
}

/* ---------------- touch ---------------- */

#touch {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: none;
}
@media (pointer: coarse) {
  #touch { display: block; }
}
.touch-steer, .touch-pedals {
  position: absolute;
  bottom: clamp(74px, 12vh, 120px);
  display: flex;
  gap: 14px;
  pointer-events: none;
}
.touch-steer { left: clamp(14px, 3vw, 34px); }
.touch-pedals { right: clamp(14px, 3vw, 34px); }
#touch button {
  pointer-events: auto;
  width: clamp(52px, 8vw, 66px);
  height: clamp(52px, 8vw, 66px);
  border-radius: 50%;
  border: 1px solid rgba(244, 237, 228, 0.26);
  background: rgba(16, 15, 16, 0.24);
  backdrop-filter: blur(3px);
  color: rgba(244, 237, 228, 0.78);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#touch button.on, #touch button:active { background: rgba(210, 48, 30, 0.35); }
.touch-fly {
  position: absolute;
  left: 50%;
  bottom: clamp(74px, 12vh, 120px);
  transform: translateX(-50%);
  pointer-events: none;
}
#touch .touch-fly button {
  width: clamp(76px, 11vw, 98px);
  height: clamp(42px, 5.6vw, 52px);
  border-radius: 999px;
  letter-spacing: 0.2em;
  font-size: 10px;
}

.loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(244, 237, 228, 0.72);
  display: flex;
  align-items: center;
  gap: 0.9em;
  transition: opacity 0.5s ease;
}
.loading span {
  width: 26px;
  height: 1px;
  background: rgba(244,237,228,0.4);
  position: relative;
  overflow: hidden;
}
.loading span::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 40%;
  height: 100%;
  background: var(--crimson);
  animation: load 1.2s ease-in-out infinite;
}
@keyframes load { 0% { left: -40%; } 100% { left: 100%; } }
.loading.is-gone { opacity: 0; pointer-events: none; }

/* ---------------- responsive ---------------- */

@media (max-aspect-ratio: 1/1) {
  .title-copy { width: min(88vw, 520px); top: clamp(10px, 2.6vh, 28px); }
  .wordmark img { width: clamp(190px, 52vw, 340px); }
  .emblem { width: clamp(64px, 17vw, 120px); }
  .tagline { font-size: 10px; letter-spacing: 0.12em; }
  .keys img { height: 20px; }
  .keys img.wide { height: 18px; }
  .keymask { font-size: 8px; gap: 0.35em; max-width: 46ch; }
  .start { font-size: 18px; margin-top: 10px; }
  .choose-hint { display: none; }

  .plates {
    left: clamp(10px, 3vw, 22px);
    right: clamp(10px, 3vw, 22px);
    bottom: clamp(10px, 1.8vh, 18px);
    gap: 6px;
  }
  .plate { height: clamp(44px, 6vh, 58px); border-radius: 7px; }
  .plate-name { font-size: clamp(13px, 3.4vw, 18px); padding-left: 14px; line-height: 0.9; }
  .plate-mark { height: 38%; }
  .dial {
    width: clamp(150px, 34vw, 220px);
    right: clamp(6px, 2vw, 14px);
    bottom: clamp(128px, 16vh, 160px);
  }
  .dial-readout { top: 46%; }
  .dial-speed { font-size: clamp(23px, 6.4vw, 38px); }
  .dial-gear { font-size: clamp(18px, 4.4vw, 30px); right: -2%; }
  .dial-charge { width: 64%; }
  .dial-charge-label { display: none; }
  .hud-left { bottom: clamp(66px, 10vh, 92px); left: 12px; gap: 0.4em; }
  .hud-brand span { display: none; }
  .hud-map { display: none; }
  .hud-help { display: none; }
  .hud-indicators img { width: 13px; height: 13px; }
  .touch-steer, .touch-pedals { bottom: clamp(68px, 9vh, 88px); }
  .dash { height: 26%; }
  .dash-screen { width: 30vw; }
}

@media (max-height: 680px) {
  .choose-hint { display: none; }
}

@media (max-height: 700px) and (min-aspect-ratio: 1/1) {
  .title-copy { top: 12px; }
  .emblem { width: clamp(52px, 7vw, 104px); }
  .wordmark img { width: clamp(185px, 22vw, 320px); }
  .tagline { margin-top: 8px; font-size: 11px; }
  .keys { margin-top: 8px; }
  .keys img { height: clamp(20px, 2vw, 28px); }
  .keys img.wide { height: clamp(18px, 1.8vw, 25px); }
  .keymask { margin-top: 6px; }
  .start { margin-top: 9px; font-size: 21px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .title-copy { top: 10px; }
  .wordmark img { width: clamp(170px, 21vw, 300px); }
  .emblem { width: clamp(54px, 8vw, 100px); }
  .tagline { display: none; }
  .keys { margin-top: 8px; }
  .keymask { display: none; }
  .start { font-size: 17px; margin-top: 8px; }
  .choose-hint { display: none; }
  .plate { height: clamp(46px, 9vh, 62px); }
  .hud-left { bottom: 54px; }
  .dial { width: clamp(170px, 20vw, 250px); bottom: 8px; }
  .touch-steer, .touch-pedals {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  .touch-steer { left: calc(10px + env(safe-area-inset-left, 0px)); }
  .touch-pedals { right: calc(10px + env(safe-area-inset-right, 0px)); }
  .touch-fly { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  #touch button { width: 52px; height: 52px; }
  #touch .touch-fly button { width: 78px; height: 44px; }
}

@media (pointer: coarse) and (max-height: 560px) and (orientation: landscape) {
  .hud-left { display: none; }
  .hud-help { display: none; }
  .dial {
    top: 8px;
    bottom: auto;
    right: 8px;
    width: clamp(148px, 20vw, 190px);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .flare-core { width: 4.5vmax; height: 4.5vmax; margin: -2.25vmax 0 0 -2.25vmax; }
  .flare-veil { width: 38vmax; height: 21vmax; margin: -10.5vmax 0 0 -19vmax; }
  .flare-streak { width: 28vmax; height: 1vmax; margin: -0.5vmax 0 0 -14vmax; }
}

@media (prefers-reduced-motion: reduce) {
  #title, .plate, #hud, #cockpit { transition: none; }
}
