@import url("../analytics.css");
:root {
  --ink: #233c48;
  --sub: #667c82;
  --paper: #f3f0e4;
  --line: #cbd2c5;
  --mint: #c8e6af;
  --gold: #e7c68b;
  --coral: #d88c73;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Noto Sans Thai",
    sans-serif;
  color: var(--ink);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #aabda5;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  color: inherit;
  background: none;
}
button:disabled {
  cursor: default;
  opacity: 0.42;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #e8ac65;
  outline-offset: 3px;
}
button:hover:not(:disabled) {
  filter: brightness(1.06);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#lobby,
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#lobby > * {
  pointer-events: auto;
}
.brand {
  position: absolute;
  top: 37px;
  left: 40px;
  pointer-events: none !important;
}
.edition {
  font-size: 8px;
  letter-spacing: 1.8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
}
.edition b {
  background: var(--ink);
  color: var(--paper);
  padding: 4px 6px;
  letter-spacing: 1px;
}
.square-mark {
  font-size: 19px;
  line-height: 22px;
  font-weight: 400;
  border: 1px solid var(--ink);
  width: 24px;
  text-align: center;
}
.brand h1 {
  margin: 19px 0 10px;
  font-size: clamp(36px, 5.2vw, 65px);
  line-height: 0.92;
  letter-spacing: -2.8px;
  font-weight: 850;
  position: relative;
}
.brand h1 span {
  color: #f4efda;
  text-shadow: 1px 2px 0 #526d62;
}
.brand h1 i {
  position: absolute;
  font-size: 55px;
  right: -62px;
  bottom: 0;
  font-weight: 300;
  font-style: normal;
}
.brand p {
  font-size: 12px;
  letter-spacing: 0.3px;
  margin: 0;
  color: #36574e;
}
.top-tools {
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.top-tools select {
  appearance: none;
  border: 1px solid #c7cdbb;
  outline: none;
  border-radius: 7px;
  background: var(--paper);
  font-size: 12px;
  padding: 12px 15px;
  color: var(--ink);
  box-shadow: 0 3px 9px #30483310;
}
.icon-btn {
  min-width: 42px;
  min-height: 42px;
  border-radius: 7px;
  background: var(--paper);
  font-size: 22px;
}
.side-nav {
  position: absolute;
  right: 30px;
  top: 108px;
  display: grid;
  gap: 7px;
  width: 205px;
}
.side-nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: #f3f0e4ed;
  padding: 13px 15px;
  border: 1px solid #f9f6e9;
  border-radius: 7px;
  box-shadow: 0 4px 15px #284d3710;
  font-size: 13px;
  font-weight: 650;
  transition: transform 0.15s;
}
.side-nav button:hover {
  transform: translateX(-4px);
}
.nav-icon {
  width: 24px;
  font-size: 25px;
  color: #5a7c76;
}
.side-nav i {
  margin-left: auto;
  font-style: normal;
  color: #87998a;
}
.launch-panel {
  position: absolute;
  bottom: 53px;
  left: 40px;
  width: 360px;
  padding: 22px 24px;
  background: var(--paper);
  border-radius: 10px;
  border: 1px solid #fffaf0;
  box-shadow: 0 14px 48px #223d3223;
}
.launch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--sub);
}
.text-btn {
  padding: 7px 0;
  font-size: 11px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #54786d;
  min-height: 30px;
}
.launch-panel h2 {
  font-size: 25px;
  letter-spacing: -0.8px;
  margin: 17px 0 8px;
}
.launch-panel p {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.65;
  max-width: 270px;
  margin: 0 0 20px;
}
.launch-bottom {
  display: flex;
  align-items: center;
  gap: 17px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  padding: 15px 20px;
  font-weight: 750;
  font-size: 13px;
  min-height: 48px;
}
.primary span + span {
  font-size: 23px;
  line-height: 15px;
}
.launch-bottom .primary {
  min-width: 166px;
}
.control-note {
  font-size: 9px;
  line-height: 1.8;
  color: var(--sub);
  white-space: pre-line;
}
.next-goal {
  position: absolute;
  bottom: 72px;
  right: 32px;
  width: 208px;
  padding: 17px;
  background: #f3f0e4e8;
  border-radius: 9px;
  border: 1px solid #ffffff60;
}
.next-goal #nextGoalText {
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0;
}
.thin-progress,
.objective-progress {
  height: 3px;
  background: #b7c6ae;
  border-radius: 4px;
  overflow: hidden;
}
.thin-progress i,
.objective-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #637e62;
  transition: width 0.3s;
}
.next-goal .text-btn {
  font-size: 10px;
  margin-top: 6px;
}
footer {
  position: absolute;
  left: 40px;
  bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 9px;
  color: #334d43;
}
footer a {
  color: inherit;
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.pause-help { display:flex;flex-wrap:wrap;gap:12px 24px;border-top:1px solid #c0ccbc;margin-top:18px;padding-top:12px; }
.pause-help a { color:inherit;min-height:44px;display:inline-flex;align-items:center;font-size:13px;text-underline-offset:4px; }
.version {
  margin-left: 12px;
  opacity: 0.6;
  font-size: 8px;
  letter-spacing: 1px;
}
#loading {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  z-index: 50;
}
.brand-small {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}
.loading-line {
  height: 2px;
  background: var(--mint);
  width: 180px;
  margin-top: 25px;
  animation: load 1s infinite alternate;
}
#loading p {
  font-size: 11px;
  opacity: 0.6;
}
#error {
  position: fixed;
  inset: 10%;
  background: var(--paper);
  padding: 40px;
  z-index: 100;
}
#error button {
  padding: 15px;
  background: var(--mint);
}
@keyframes load {
  from {
    transform: scaleX(0.2);
  }
  to {
    transform: scaleX(1);
  }
}
.objective-panel {
  position: absolute;
  top: 20px;
  left: 22px;
  width: 266px;
  padding: 12px 15px;
  border-radius: 8px;
  background: #f3f0e4ec;
  box-shadow: 0 4px 22px #1b3f3814;
  pointer-events: auto;
}
.objective-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
}
.objective-line button {
  font-size: 15px;
  min-width: 35px;
  min-height: 32px;
  margin: -10px -6px;
}
.objective-panel strong {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin: 9px 0 11px;
}
.objective-panel small {
  display: block;
  font-size: 9px;
  color: var(--sub);
  margin-top: 7px;
}
.pursuit-status {
  position: absolute;
  top: 27px;
  right: 27px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f5f1d9;
  background: #294452db;
  border: 1px solid #d8dfb23d;
  padding: 7px 11px;
  border-radius: 8px;
}
.pursuit-status > span:first-child {
  font-size: 26px;
  font-weight: 750;
}
.star-symbol {
  font-size: 24px;
  color: #e8c17d;
}
.pursuit-status small {
  max-width: 100px;
  font-size: 10px;
}
.driver-status {
  position: absolute;
  bottom: 55px;
  left: 28px;
  width: 155px;
  filter: drop-shadow(0 1px 1px #faf7e390);
}
.speed {
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.speed b {
  font-size: 58px;
  font-weight: 750;
  letter-spacing: -4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.speed span {
  font-size: 10px;
  letter-spacing: 1px;
  color: #33574f;
}
.condition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin: 8px 0 5px;
}
.condition-row strong {
  font-weight: 650;
}
.meter {
  height: 5px;
  background: #e8e8d7b0;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 0 #ffffff40;
}
.meter i {
  height: 100%;
  display: block;
  background: #3a7863;
  width: 100%;
}
.meter.nitro {
  height: 3px;
}
.meter.nitro i {
  background: #54869a;
}
#hearts {
  color: #765952;
  font-size: 10px;
  letter-spacing: 3px;
}
#flightHud {
  background: #f3f0e4e8;
  padding: 7px;
  border-radius: 4px;
  font-size: 10px;
  margin-top: 8px;
}
.keyboard-hint {
  position: absolute;
  bottom: 18px;
  left: 28px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #36584c;
}
kbd {
  font: inherit;
  font-size: 9px;
  border: 1px solid #8b9e8b;
  padding: 3px 5px;
  border-radius: 3px;
  background: #f4f0e397;
}
.waypoint {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  filter: drop-shadow(0 2px 1px #354f3b55);
  color: #fff6cf;
}
.waypoint b {
  display: block;
  font-size: 33px;
  line-height: 40px;
}
.waypoint span {
  display: block;
  background: #314d55df;
  border: 1px solid #e8cf9a;
  color: #fff2cd;
  border-radius: 4px;
  font-size: 10px;
  padding: 5px 8px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-pad {
  position: absolute;
  right: 25px;
  bottom: 24px;
  display: flex;
  align-items: end;
  gap: 8px;
  pointer-events: auto;
}
.action-pad button {
  position: relative;
  background: #f4f0e5ec;
  border: 1px solid #fff4d8;
  border-radius: 11px;
  width: 62px;
  height: 64px;
  box-shadow: 0 3px 9px #34533a18;
  touch-action: none;
  user-select: none;
}
.action-pad b {
  display: block;
  font-size: 21px;
  font-weight: 700;
  line-height: 29px;
}
.action-pad small {
  font-size: 8px;
  letter-spacing: 0.2px;
}
.action-pad i {
  position: absolute;
  top: -5px;
  right: -3px;
  font-size: 9px;
  font-style: normal;
  background: var(--ink);
  color: #f5e6b6;
  border-radius: 10px;
  padding: 2px 5px;
}
.action-pad i:empty {
  display: none;
}
.action-pad button:disabled {
  opacity: 0.55;
}
.action-pad .boost-button {
  height: 79px;
  width: 70px;
  background: #cce5b4;
  border-color: #e9f3da;
}
.secret-button {
  pointer-events: auto;
  position: absolute;
  right: 30px;
  top: 80px;
  border-radius: 6px;
  padding: 9px 13px;
  color: #e3d8fd;
  background: #5b4b6b;
  font-size: 10px;
}
.follow-hint {
  position: absolute;
  bottom: 20px;
  left: 25px;
  font-size: 10px;
  color: #385e4e;
}
.arrow-pad {
  position: absolute;
  bottom: 19px;
  left: 18px;
  width: 169px;
  height: 110px;
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(3, 53px);
  grid-template-rows: repeat(2, 50px);
  gap: 4px;
}
.arrow-pad button {
  background: #f3f0e4df;
  border: 1px solid #fff5dd;
  border-radius: 10px;
  font-size: 27px;
  touch-action: none;
}
.arrow-pad .up {
  grid-column: 2;
  grid-row: 1;
}
.arrow-pad .left {
  grid-column: 1;
  grid-row: 2;
}
.arrow-pad .down {
  grid-column: 2;
  grid-row: 2;
}
.arrow-pad .right {
  grid-column: 3;
  grid-row: 2;
}
#touchControls {
  display: none;
}
.action-pad button:active,
.arrow-pad button:active {
  background: #cde3b5;
}
#toast {
  position: fixed;
  left: 50%;
  top: 145px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 7px;
  background: #283e48e8;
  color: #f4edd2;
  font-size: 12px;
  text-align: center;
  max-width: min(460px, 90vw);
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 4px 20px #2a473526;
}
#cinematic {
  position: fixed;
  inset: 0;
  border-top: 40px solid #1b3037;
  border-bottom: 40px solid #1b3037;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 35px;
  color: #fff3d7;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.5px;
  text-shadow: 0 3px 10px #203b34;
  z-index: 9;
}
dialog {
  border: 0;
  color: var(--ink);
  background: var(--paper);
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 25px 90px #182f3c40;
  max-width: min(850px, 92vw);
  width: 850px;
  max-height: 86dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #1e383a70;
  backdrop-filter: blur(5px);
}
.panel-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  padding: 24px 28px 17px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: 27px;
  margin: 7px 0 0;
  letter-spacing: -0.7px;
}
.panel-head .icon-btn {
  font-size: 29px;
  border: 1px solid var(--line);
  background: none;
}
#panelContent {
  padding: 22px 28px 30px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tabs button,
.pill {
  padding: 11px 16px;
  min-height: 42px;
  background: #e5e7d9;
  color: #5b746d;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
}
.tabs button.active,
.pill.active {
  background: var(--ink);
  color: var(--paper);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 7px 0 20px;
  font-size: 12px;
  color: var(--sub);
}
.summary-row strong {
  color: var(--ink);
  font-size: 17px;
}
.car-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.car-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #eeeddf;
  padding: 13px;
  position: relative;
}
.car-card.selected {
  border: 2px solid #6d9b7d;
  padding: 12px;
}
.car-card .rarity {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #7a857a;
}
.car-card h3 {
  font-size: 13px;
  margin: 8px 0 6px;
  letter-spacing: -0.3px;
}
.car-svg {
  width: 100%;
  height: 85px;
  display: block;
  margin-top: 4px;
}
.car-card p {
  font-size: 10px;
  line-height: 1.6;
  color: var(--sub);
  margin: 4px 0 10px;
}
.card-actions {
  display: flex;
  gap: 5px;
}
.card-actions button {
  background: #dce6d0;
  border-radius: 5px;
  font-size: 10px;
  padding: 10px 9px;
  min-height: 37px;
  flex: 1;
}
.card-actions button.secondary {
  background: #e3e3d6;
  flex: 0;
}
.stat-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-bars div {
  font-size: 8px;
  color: var(--sub);
}
.stat-bars i {
  display: block;
  height: 3px;
  width: 100%;
  background: #d0d7c7;
  margin: 5px 0 9px;
}
.stat-bars b {
  display: block;
  height: 100%;
  background: #768e77;
}
.driver-head {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.driver-pixel {
  width: 23px;
  height: 28px;
  background: #cdab86;
  box-shadow:
    0 -8px 0 0 #405562,
    0 28px 0 9px var(--outfit, #7f9b8c),
    -13px 30px 0 0 var(--outfit, #7f9b8c),
    13px 30px 0 0 var(--outfit, #7f9b8c);
  margin-top: -25px;
}
.muted {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.75;
}
.section-title {
  font-size: 17px;
  letter-spacing: -0.4px;
  margin: 25px 0 12px;
}
.reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.reward-row p {
  margin: 5px 0;
  color: var(--sub);
  font-size: 11px;
}
.reward-row button,
.setting-row select {
  background: #dce5ce;
  border-radius: 5px;
  padding: 11px 15px;
  font-size: 11px;
  border: 0;
  min-height: 40px;
  white-space: nowrap;
}
.reward-row code {
  display: inline-block;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 2px;
  padding: 8px 10px;
  background: #e5dfd4;
  border-radius: 4px;
  margin-top: 8px;
}
.draw-machine {
  border-radius: 12px;
  background: #dfe3d4;
  text-align: center;
  padding: 30px;
  max-width: 440px;
  margin: auto;
}
.machine-icon {
  margin: 12px auto 25px;
  background: #536f71;
  border: 8px solid #8d9c8b;
  border-radius: 15px;
  width: 150px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e6cf9a;
  font-size: 52px;
  box-shadow:
    inset 0 0 0 6px #34575d,
    0 8px 0 #cad0bd;
}
.draw-machine .primary {
  width: 100%;
  margin: 10px 0;
  justify-content: center;
}
.draw-result {
  padding: 20px;
  border-radius: 8px;
  background: #e7ebda;
  margin: 15px 0;
  text-align: center;
  font-size: 16px;
}
.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.stage-grid button {
  height: 75px;
  border-radius: 7px;
  background: #e2e5d7;
  border: 1px solid #ccd4c4;
  font-size: 22px;
  font-weight: 700;
}
.stage-grid button.done {
  background: #cedfbe;
}
.stage-grid button.active {
  border: 2px solid #537b62;
  background: #e8e6cd;
}
.stage-grid small {
  display: block;
  font-size: 8px;
  font-weight: 400;
  margin-top: 5px;
}
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mode-card {
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  font-size: 16px;
  background: #eaeade;
}
.mode-card strong {
  display: block;
  margin: 7px 0;
}
.mode-card small {
  font-size: 11px;
  line-height: 1.65;
  color: var(--sub);
  display: block;
}
.mode-card.active {
  border: 2px solid #678768;
  background: #dfe7cd;
}
.mode-icon {
  font-size: 28px;
  display: block;
  color: #698775;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.setting-row select {
  max-width: 170px;
  outline: none;
  background: #e0e4d4;
}
.setting-row a {
  color: #587c6d;
  font-size: 12px;
}
.result-title {
  font-size: 36px !important;
}
.result-stats {
  display: flex;
  gap: 25px;
  margin: 24px 0;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  flex-wrap: wrap;
}
.result-stats div {
  flex: 1;
  min-width: 80px;
}
.result-stats b {
  display: block;
  font-size: 26px;
  letter-spacing: -1px;
}
.result-stats small {
  font-size: 10px;
  color: var(--sub);
}
.result-buttons {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.result-buttons .primary {
  flex: 1;
  justify-content: center;
}
.result-buttons .pill {
  flex: 1;
}
.auto-next {
  width: 100%;
  font-size: 11px;
  margin-top: 20px;
  color: var(--sub);
  min-height: 40px;
}
.highlight {
  padding: 13px 16px;
  background: #dce9cd;
  border-left: 3px solid #6b976d;
  font-size: 12px;
  margin: 12px 0;
}
.secret-panel {
  border: 1px solid #c8b9d3;
  background: #e6deeb;
  padding: 18px;
  border-radius: 9px;
  margin: 12px 0;
}
.secret-panel h3 {
  margin: 0 0 7px;
}
.secret-panel code {
  font-size: 16px;
  letter-spacing: 3px;
  display: block;
  margin: 13px 0;
}
.secret-panel p {
  font-size: 12px;
  color: #76657e;
  line-height: 1.6;
}
#inspectOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
#inspectOverlay button {
  pointer-events: auto;
}
#inspectOverlay > div {
  position: absolute;
  left: 30px;
  bottom: 35px;
}
#inspectOverlay h2 {
  font-size: 32px;
  margin-bottom: 8px;
}
#inspectOverlay p {
  font-size: 12px;
  color: var(--sub);
}
#analyticsConsent {
  z-index: 45;
  max-width: 340px;
  bottom: 18px;
  right: 18px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 12px/1.6 inherit;
}
#analyticsConsent p {
  font-size: 11px;
}
#analyticsConsent button {
  font-size: 11px;
  padding: 10px;
  border-radius: 5px;
  background: #d5e3c7;
  margin-right: 8px;
}
@media (pointer: coarse), (max-width: 700px) {
  #touchControls {
    display: block;
  }
  .keyboard-hint {
    display: none;
  }
  .driver-status {
    bottom: 155px;
  }
  .action-pad {
    bottom: max(22px, env(safe-area-inset-bottom));
    right: 18px;
  }
  .follow-hint {
    bottom: 30px;
  }
  .arrow-pad {
    bottom: max(19px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 700px) {
  .brand {
    top: max(23px, env(safe-area-inset-top));
    left: 21px;
  }
  .brand h1 {
    font-size: 41px;
    letter-spacing: -1.8px;
    margin-top: 12px;
  }
  .brand h1 i {
    font-size: 36px;
    right: -38px;
  }
  .edition {
    font-size: 6px;
    letter-spacing: 1px;
    gap: 6px;
  }
  .square-mark {
    font-size: 15px;
    width: 19px;
    line-height: 17px;
  }
  .edition b {
    padding: 3px 5px;
  }
  .brand p {
    font-size: 10px;
  }
  .top-tools {
    right: 17px;
    top: max(20px, env(safe-area-inset-top));
    gap: 5px;
  }
  .top-tools select {
    font-size: 10px;
    padding: 10px;
  }
  .top-tools .icon-btn {
    min-width: 35px;
    min-height: 35px;
    font-size: 18px;
  }
  .side-nav {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: calc(207px + env(safe-area-inset-bottom));
    width: auto;
    display: flex;
    gap: 6px;
  }
  .side-nav button {
    flex: 1;
    justify-content: center;
    gap: 7px;
    padding: 11px 8px;
    font-size: 10px;
    border-radius: 6px;
  }
  .nav-icon {
    font-size: 17px;
    width: auto;
  }
  .side-nav i {
    display: none;
  }
  .launch-panel {
    left: 18px;
    right: 18px;
    bottom: calc(36px + env(safe-area-inset-bottom));
    width: auto;
    padding: 16px 18px;
    border-radius: 9px;
  }
  .launch-panel h2 {
    font-size: 22px;
    margin: 8px 0 4px;
  }
  .launch-panel p {
    font-size: 10px;
    max-width: 100%;
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .launch-bottom {
    gap: 15px;
  }
  .launch-bottom .primary {
    min-width: 0;
    flex: 1;
    font-size: 12px;
    padding: 12px 16px;
    min-height: 46px;
  }
  .control-note {
    font-size: 8px;
    max-width: 80px;
  }
  .launch-top .eyebrow {
    font-size: 8px;
  }
  .launch-top .text-btn {
    font-size: 9px;
    padding: 0;
    min-height: 20px;
  }
  .next-goal {
    display: none;
  }
  footer {
    left: 20px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    font-size: 8px;
    gap: 10px;
  }
  .version {
    display: none;
  }
  .objective-panel {
    left: 12px;
    top: max(12px, env(safe-area-inset-top));
    width: 180px;
    padding: 9px 11px;
  }
  .objective-panel strong {
    font-size: 10px;
    margin: 6px 0 8px;
  }
  .objective-panel .eyebrow {
    font-size: 8px;
  }
  .objective-panel small {
    font-size: 8px;
  }
  .objective-line button {
    min-width: 34px;
    min-height: 34px;
  }
  .pursuit-status {
    right: 12px;
    top: max(12px, env(safe-area-inset-top));
    padding: 6px 9px;
    gap: 5px;
  }
  .pursuit-status > span:first-child {
    font-size: 23px;
  }
  .pursuit-status small {
    max-width: 66px;
    font-size: 8px;
  }
  .driver-status {
    left: 17px;
    width: 116px;
    bottom: 150px;
  }
  .speed b {
    font-size: 42px;
    letter-spacing: -2px;
  }
  .speed span {
    font-size: 8px;
  }
  .condition-row {
    font-size: 8px;
    margin-top: 5px;
  }
  .meter {
    height: 4px;
  }
  .condition-row #hearts {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .action-pad {
    right: 13px;
    bottom: max(25px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 55px 65px;
    gap: 7px;
  }
  .action-pad button {
    width: 55px;
    height: 53px;
    border-radius: 10px;
  }
  .action-pad b {
    font-size: 18px;
    line-height: 23px;
  }
  .action-pad small {
    font-size: 7px;
  }
  .action-pad .boost-button {
    width: 65px;
    height: 53px;
    grid-column: 2;
    grid-row: 2;
  }
  .action-pad #weaponButton {
    grid-row: 2;
    grid-column: 1;
  }
  .secret-button {
    top: 70px;
    right: 12px;
    padding: 8px;
    font-size: 9px;
  }
  .waypoint span {
    font-size: 8px;
    padding: 4px 6px;
  }
  .waypoint b {
    font-size: 28px;
  }
  .follow-hint {
    left: 18px;
    bottom: 55px;
    font-size: 9px;
    max-width: 120px;
  }
  .arrow-pad {
    width: 156px;
    grid-template-columns: repeat(3, 49px);
    grid-template-rows: repeat(2, 48px);
    left: 12px;
    gap: 3px;
    bottom: 20px;
  }
  .arrow-pad button {
    font-size: 24px;
  }
  .panel-head {
    padding: 20px 18px 15px;
  }
  .panel-head h2 {
    font-size: 24px;
  }
  #panelContent {
    padding: 18px 18px 24px;
  }
  dialog {
    max-width: calc(100vw - 20px);
    max-height: 88dvh;
    border-radius: 12px;
  }
  .car-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .car-card {
    padding: 10px;
  }
  .car-card.selected {
    padding: 9px;
  }
  .car-card h3 {
    font-size: 12px;
  }
  .car-card p {
    font-size: 9px;
  }
  .car-svg {
    height: 68px;
  }
  .card-actions button {
    font-size: 9px;
    padding: 10px 5px;
    min-height: 42px;
  }
  .tabs {
    gap: 5px;
  }
  .tabs button {
    font-size: 10px;
    padding: 10px 12px;
    min-height: 40px;
  }
  .stage-grid {
    gap: 6px;
  }
  .stage-grid button {
    height: 64px;
    font-size: 19px;
  }
  .stage-grid small {
    font-size: 7px;
  }
  .mode-cards {
    grid-template-columns: 1fr;
  }
  .mode-card {
    padding: 14px;
    display: grid;
    grid-template-columns: 35px 1fr;
    gap: 0 12px;
  }
  .mode-card small {
    grid-column: 2;
  }
  .mode-icon {
    grid-row: span 2;
  }
  .mode-card strong {
    font-size: 15px;
  }
  .reward-row {
    font-size: 11px;
    gap: 10px;
  }
  .reward-row button {
    font-size: 10px;
    padding: 10px;
  }
  .reward-row p {
    font-size: 10px;
  }
  .result-title {
    font-size: 29px !important;
  }
  .result-stats {
    gap: 12px;
  }
  .result-stats b {
    font-size: 23px;
  }
  .result-buttons .primary {
    font-size: 12px;
    padding: 14px;
  }
  .setting-row {
    font-size: 12px;
  }
  .setting-row select {
    font-size: 11px;
  }
  .draw-machine {
    padding: 20px;
  }
  #toast {
    top: 132px;
    font-size: 11px;
    max-width: 90vw;
  }
  #cinematic {
    font-size: 22px;
    border-width: 28px;
  }
  #analyticsConsent {
    left: 12px;
    right: 12px;
    bottom: 10px;
    max-width: none;
  }
  #inspectOverlay {
    padding: 20px;
  }
  #inspectOverlay > div {
    left: 22px;
    bottom: 25px;
  }
  #inspectOverlay h2 {
    font-size: 25px;
  }
}
@media (max-height: 560px) and (min-width: 650px) {
  .brand {
    top: 22px;
    left: 26px;
  }
  .brand h1 {
    font-size: 38px;
    margin-top: 10px;
  }
  .brand p {
    font-size: 10px;
  }
  .launch-panel {
    bottom: 35px;
    left: 26px;
    padding: 16px 19px;
    width: 330px;
  }
  .launch-panel h2 {
    margin: 8px 0 4px;
    font-size: 21px;
  }
  .launch-panel p {
    margin-bottom: 12px;
    font-size: 10px;
  }
  .launch-bottom .primary {
    min-height: 42px;
    padding: 12px 17px;
  }
  .side-nav {
    right: 20px;
    top: 85px;
    width: 180px;
  }
  .side-nav button {
    padding: 10px 13px;
  }
  .next-goal {
    bottom: 40px;
    right: 20px;
    padding: 12px;
    width: 180px;
  }
  .next-goal .eyebrow {
    font-size: 7px;
  }
  .next-goal #nextGoalText {
    font-size: 10px;
    margin: 7px 0;
  }
  .driver-status {
    bottom: 145px;
    left: 22px;
    width: 115px;
  }
  .speed b {
    font-size: 38px;
  }
  .objective-panel {
    width: 225px;
  }
  .pursuit-status {
    top: 18px;
  }
  .action-pad {
    display: flex;
    bottom: 20px;
  }
  .action-pad button {
    width: 57px;
    height: 55px;
  }
  .action-pad .boost-button {
    height: 68px;
  }
  .brand h1 i {
    font-size: 35px;
    right: -40px;
  }
}

/* Compact contrast backing keeps gauges legible against all biomes. */
.driver-status {
  background: #f3f0e4e8;
  padding: 9px 12px 11px;
  border-radius: 9px;
  filter: none;
  box-shadow: 0 3px 15px #193d3414;
}
.keyboard-hint {
  background: #f3f0e4cf;
  padding: 4px 7px;
  border-radius: 4px;
}
.follow-hint {
  background: #f3f0e4cc;
  padding: 6px 8px;
  border-radius: 5px;
}
