:root {
  --paper: #f6f4ec;
  --concrete: #d9ddd6;
  --dashboard: #1c2725;
  --dashboard-raised: #293632;
  --ink: #23312b;
  --parking-green: #447c56;
  --safety-yellow: #e1bb56;
  --brake-red: #b75045;
  --muted: #626e66;
  --line: #d5d9cf;
  --control-line: #53615b;
  --control-text: #e9eee8;
  --control-muted: #afbab0;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.6 system-ui,
    -apple-system,
    "Malgun Gothic",
    sans-serif;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf7;
  color: var(--ink);
  padding: 10px 16px;
  min-height: 44px;
}
button:hover:not(:disabled) {
  background: #e8ece2;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
[role="slider"]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--safety-yellow);
  outline-offset: 2px;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.primary {
  background: var(--parking-green);
  border-color: var(--parking-green);
  color: #fff;
}
.primary:hover:not(:disabled) {
  background: #345f41;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 50;
}
.skip:focus {
  top: 8px;
  padding: 8px;
  background: var(--paper);
}
.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
}
.brand img {
  object-fit: contain;
}
.back {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 24px;
}
.heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.heading-row h1 {
  font-size: 26px;
  letter-spacing: -0.8px;
  margin: 0;
}
.heading-row p {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
}
.heading-row > span {
  font-size: 12px;
  color: var(--muted);
}
.simulator {
  position: relative;
  overflow: hidden;
  border: 1px solid #37463f;
  border-radius: 10px;
  background: var(--dashboard);
}
.sim-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 4px 20px;
  background: var(--dashboard);
  color: var(--control-text);
  border-bottom: 1px solid var(--control-line);
}
.floor-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  line-height: 1.2;
}
.floor-badge span {
  font-size: 11px;
  color: var(--control-muted);
}
.sim-actions {
  display: flex;
  gap: 4px;
}
.sim-actions button {
  background: transparent;
  color: var(--control-text);
  border-color: transparent;
  font-size: 12px;
  padding: 8px 12px;
}
.sim-actions button:hover:not(:disabled) {
  background: var(--dashboard-raised);
}
.viewport {
  height: clamp(280px, calc(100svh - 322px), 560px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.world {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.mission {
  position: absolute;
  top: 16px;
  left: 16px;
  max-width: min(440px, calc(100% - 200px));
  padding: 10px 12px;
  background: #f6f4eced;
  border: 1px solid #fffdf780;
  border-radius: 6px;
  pointer-events: none;
}
.mission b {
  font-size: 13px;
  display: block;
}
.mission small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #536358;
  line-height: 1.45;
}
.mini-map {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px;
  background: #1c2725eb;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  pointer-events: none;
}
body[data-map="closed"] .mini-map {
  display: none;
}
.mini-map span {
  display: block;
  color: var(--control-text);
  font-size: 10px;
  padding-bottom: 4px;
}
.mini-map canvas {
  display: block;
  width: 146px;
  height: 126px;
}
.view-tabs {
  display: flex;
  gap: 4px;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px;
  background: #1c2725ed;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  white-space: nowrap;
}
.view-tabs button {
  padding: 6px 12px;
  min-width: 56px;
  background: transparent;
  color: var(--control-text);
  border-color: transparent;
  font-size: 12px;
}
.view-tabs button[aria-pressed="true"] {
  background: #e8eddf;
  color: var(--ink);
}
.view-tabs #map-toggle {
  border-left: 1px solid var(--control-line);
  border-radius: 0 4px 4px 0;
}
.view-tabs #map-toggle[aria-pressed="true"] {
  color: var(--safety-yellow);
  background: var(--dashboard-raised);
}
.view-tabs button:hover:not(:disabled):not([aria-pressed="true"]) {
  background: #3b4941;
}
.camera-label {
  position: absolute;
  right: 16px;
  bottom: 24px;
  color: var(--control-text);
  background: #1c2725e0;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
  pointer-events: none;
}
.parking-progress {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  color: #eaf1dc;
  background: #315d41ed;
  border: 1px solid #8fb093;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.parking-progress:empty {
  display: none;
}
.clearance {
  position: absolute;
  left: 12px;
  bottom: 70px;
  display: grid;
  grid-template-columns: repeat(4, 54px);
  gap: 1px;
  background: #26332eea;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  padding: 4px;
  pointer-events: none;
  color: var(--control-text);
  font-variant-numeric: tabular-nums;
}
.clearance[hidden],
.continue-run[hidden],
.checkpoint-note[hidden] {
  display: none;
}
.clearance span {
  display: grid;
  gap: 2px;
  padding: 3px 4px;
  white-space: nowrap;
}
.clearance small {
  font-size: 10px;
  opacity: 0.8;
}
.clearance b {
  font-size: 11px;
  font-weight: 600;
}
.clearance [data-level="near"] b {
  color: #f3ce70;
}
.clearance [data-level="danger"] {
  background: #6c3029;
  border-radius: 2px;
}
.clearance [data-level="danger"] b {
  color: #ffded4;
}
.continue-run {
  background: #e7eedb;
  color: var(--ink);
}
.checkpoint-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 12px 0 4px;
}
@media (max-width: 760px), (orientation: landscape) and (max-height: 600px) {
  .clearance {
    left: 8px;
    bottom: 68px;
    grid-template-columns: repeat(4, 46px);
    padding: 3px;
  }
}
.cockpit {
  touch-action: none;
  display: grid;
  grid-template-columns: 300px minmax(190px, 1fr) 250px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 20px;
  padding: 16px 24px;
  color: var(--control-text);
  border-top: 1px solid var(--control-line);
}
.instruments {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  gap: 20px;
  align-items: center;
}
.meters {
  display: flex;
  align-items: center;
  gap: 16px;
}
.speed {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.speed > strong {
  font:
    500 36px/1 ui-monospace,
    monospace;
  font-variant-numeric: tabular-nums;
}
.speed small {
  color: var(--control-muted);
  font-size: 10px;
}
.gear {
  color: var(--safety-yellow);
  font:
    600 32px/1 ui-monospace,
    monospace;
}
.trip {
  display: flex;
  flex-direction: column;
  color: var(--control-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.steering {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.steering > button,
#center-wheel {
  color: var(--control-text);
  background: var(--dashboard-raised);
  border-color: var(--control-line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.steering > button {
  width: 48px;
  padding: 4px;
  min-height: 56px;
  font-size: 24px;
}
.steering-main {
  --wheel-size: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.wheel-touch {
  width: var(--wheel-size);
  height: var(--wheel-size);
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  border-radius: 50%;
}
.wheel-touch.dragging {
  cursor: grabbing;
}
.wheel {
  position: absolute;
  display: grid;
  place-items: center;
  inset: 4px;
  border: 9px solid #9aa79c;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 0 2px #48594d,
    0 0 0 2px #101b16;
  pointer-events: none;
  will-change: transform;
}
.wheel:before,
.wheel:after {
  content: "";
  position: absolute;
  background: #839286;
  border-radius: 2px;
}
.wheel:before {
  width: 100%;
  height: 8px;
  top: calc(50% - 4px);
}
.wheel:after {
  width: 8px;
  height: 50%;
  bottom: 0;
  left: calc(50% - 4px);
}
.wheel i {
  width: 40%;
  height: 32%;
  border-radius: 30%;
  background: var(--dashboard-raised);
  border: 1px solid #89998b;
  z-index: 1;
}
.wheel-mark {
  position: absolute;
  top: -9px;
  left: calc(50% - 3px);
  width: 6px;
  height: 9px;
  background: var(--safety-yellow);
}
#wheel-angle {
  position: absolute;
  inset: calc(50% - 8px) 0 auto;
  text-align: center;
  color: var(--control-text);
  font:
    10px/16px ui-monospace,
    monospace;
  pointer-events: none;
}
#center-wheel {
  padding: 4px 12px;
  font-size: 11px;
  min-height: 44px;
}
.drive-panel {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gears {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  gap: 8px;
}
.gears button {
  touch-action: none;
  flex: 1;
  position: relative;
  padding: 6px 4px;
  min-width: 48px;
  color: var(--control-text);
  background: var(--dashboard-raised);
  border-color: var(--control-line);
  font:
    600 18px/1.3 ui-monospace,
    monospace;
}
.gears small {
  display: inline;
  font:
    11px/1.3 system-ui,
    sans-serif;
  margin-left: 6px;
}
.gears kbd {
  position: absolute;
  top: -8px;
  right: 4px;
  border: 0;
  font-size: 9px;
  min-width: 16px;
  color: var(--control-muted);
  background: var(--dashboard);
}
.gears button[aria-pressed="true"] {
  background: #e9d7a3;
  color: #283527;
  border-color: #e9d7a3;
}
.gears button[data-ready="true"] {
  background: #d7e7bd;
  color: #273a24;
  border-color: #d7e7bd;
}
.pedals {
  display: flex;
  gap: 12px;
  align-items: end;
}
.pedals button {
  flex: 1;
  height: 80px;
  padding: 12px 8px;
  border-color: var(--control-line);
  background: #3d4944;
  color: var(--control-text);
  font-size: 13px;
  font-weight: 600;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pedals .accelerator {
  height: 104px;
  background: #3a5944;
}
.pedals button:before {
  content: "";
  display: block;
  height: 16px;
  margin: 0 12px 8px;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 4px,
    #d0dbd144 4px 6px
  );
}
.pedals kbd {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  padding: 0;
  font-size: 10px;
  background: transparent;
  border: 0;
  color: var(--control-muted);
}
.cockpit button.held {
  background: #d9c68f !important;
  border-color: #f1dc9c !important;
  color: var(--ink) !important;
}
.cockpit button:hover:not(:disabled):not([aria-pressed="true"]):not(.held) {
  background: #3d4e43;
  color: var(--control-text);
}
.gears button[aria-pressed="true"]:hover {
  background: #e9d7a3;
}
kbd {
  display: inline-block;
  padding: 0 5px;
  min-width: 22px;
  border: 1px solid #5d6b62;
  border-radius: 4px;
  background: #26352e;
  color: var(--control-text);
  font:
    11px/20px ui-monospace,
    monospace;
  text-align: center;
}
.keyboard-guide {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  font-size: 11px;
  color: var(--control-muted);
  line-height: 2;
}
.keyboard-guide strong {
  display: none;
}
.keyboard-guide kbd {
  margin: 0 2px;
}
.keyboard-guide small {
  font-size: 10px;
  display: block;
  text-align: center;
}
.notice {
  min-height: 32px;
  padding: 6px 16px;
  background: #25382b;
  color: #e6dbb4;
  font-size: 12px;
  text-align: center;
  border-top: 1px solid #3a4b40;
}
.overlay {
  position: absolute;
  inset: 56px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #101d1766;
  z-index: 6;
}
.start-sheet,
.pause-sheet,
.result-sheet,
.settings-sheet {
  width: min(560px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
}
.start-sheet {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  max-height: min(740px, 100%);
  margin-right: auto;
}
.eyebrow {
  color: var(--parking-green);
  font-size: 11px;
}
.start-sheet h2,
.result-sheet h2,
.pause-sheet h2,
.settings-sheet h2 {
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.7px;
}
.start-sheet > p,
.result-sheet > p,
.pause-sheet > p,
.settings-sheet > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.start-sheet > p {
  margin: 4px 0;
}
.start-rule {
  display: block;
  margin: 8px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--brake-red);
}
.course-list {
  display: grid;
  gap: 6px;
  min-height: 80px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 12px 0;
  padding-right: 4px;
}
.course-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 12px;
  min-height: 56px;
  background: #fffdf7;
}
.course-list button[aria-pressed="true"] {
  background: #e5ebde;
  border-color: #819278;
}
.course-list em {
  width: 28px;
  flex-shrink: 0;
  color: #60765c;
  font:
    500 14px ui-monospace,
    monospace;
}
.course-list b {
  display: block;
  font-size: 12px;
}
.course-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.start-actions {
  display: grid;
  gap: 8px;
  flex-shrink: 0;
}
.start-actions button {
  width: 100%;
}
.start-sheet .fine,
.fine {
  font-size: 11px;
  color: var(--muted);
}
.result-sheet,
.pause-sheet {
  text-align: center;
}
.result-sheet .score {
  font-size: 60px;
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 16px 0;
}
.result-sheet .score small {
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px 0;
  margin: 16px 0;
  border-block: 1px solid var(--line);
}
.result-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.result-stats b {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.result-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.result-buttons button {
  font-size: 12px;
}
.record-note,
.status-text {
  color: var(--muted);
  font-size: 12px;
}
.status-text:empty {
  display: none;
}
.result-sheet[data-outcome="crashed"] h2 {
  color: var(--brake-red);
}
.pause-sheet {
  max-width: 360px;
}
.pause-sheet button {
  width: 100%;
  margin-top: 8px;
}
#settings-overlay {
  z-index: 8;
}
.sheet-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.sheet-heading h2 {
  font-size: 20px;
}
.sheet-heading button {
  font-size: 12px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.setting-row b {
  font-size: 13px;
}
.setting-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.setting-row button {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
}
.setting-row button[aria-pressed="true"] {
  background: #e1e9d6;
  border-color: #8b9c7c;
}
.key-help {
  margin: 12px 0 0;
}
.key-help div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.key-help dt {
  color: var(--ink);
  font-weight: 600;
}
.key-help dd {
  margin: 0;
  color: var(--muted);
}
.guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin: 40px 0;
}
.guide h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
.guide p,
.guide li {
  font-size: 13px;
  color: var(--muted);
}
.guide ol {
  padding-left: 20px;
}
.guide li {
  margin: 8px 0;
}
.guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.guide th,
.guide td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 12px;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
details p {
  margin-bottom: 0;
}
.ad-zone {
  margin: 32px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.ad-zone > small {
  font-size: 10px;
  color: var(--muted);
}
.more-games {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.more-games h2 {
  font-size: 17px;
}
.more-games a {
  display: inline-block;
  padding: 12px 20px 12px 0;
  font-size: 13px;
}
footer {
  max-width: 1280px;
  margin: auto;
  padding: 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.simulator.expanded {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.expanded .sim-top,
.expanded .cockpit,
.expanded .notice {
  flex-shrink: 0;
}
.expanded .viewport {
  flex: 1;
  height: auto;
  min-height: 160px;
}
body.sim-expanded {
  overflow: hidden;
}
@media (min-width: 761px) and (max-width: 1050px) and (min-height: 601px) {
  .cockpit {
    grid-template-columns: 228px minmax(160px, 1fr) 200px;
    padding: 12px;
    gap: 4px 8px;
  }
  .steering {
    gap: 4px;
  }
  .steering-main {
    --wheel-size: 116px;
  }
  .gears small {
    display: none;
  }
  .keyboard-guide {
    font-size: 10px;
  }
  .keyboard-guide kbd {
    min-width: 16px;
    padding: 0 2px;
    margin: 0;
  }
  .camera-label {
    display: none;
  }
}
@media (max-width: 760px),
  (orientation: landscape) and (max-height: 600px) and (max-width: 1200px) {
  main {
    padding: 16px 12px;
  }
  .site-header {
    padding: 12px 16px;
  }
  .heading-row {
    margin-bottom: 12px;
  }
  .heading-row h1 {
    font-size: 21px;
  }
  .heading-row p {
    font-size: 12px;
  }
  .heading-row > span {
    display: none;
  }
  .simulator {
    height: min(760px, calc(100svh - 160px));
    min-height: 460px;
    display: flex;
    flex-direction: column;
  }
  body:is([data-mode="driving"], [data-mode="paused"], [data-mode="result"]) {
    overflow: hidden;
  }
  body:is([data-mode="driving"], [data-mode="paused"], [data-mode="result"])
    .simulator,
  .simulator.expanded {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    z-index: 30;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
      env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .sim-top {
    min-height: 48px;
    height: 48px;
    flex-shrink: 0;
    padding: 0 12px;
    gap: 8px;
  }
  .floor-badge {
    font-size: 20px;
  }
  .floor-badge span {
    display: none;
  }
  .sim-actions button {
    min-height: 44px;
    padding: 4px 12px;
    font-size: 12px;
  }
  .viewport,
  .expanded .viewport {
    flex: 1;
    min-height: 120px;
    height: auto;
  }
  .mission {
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 8px 10px;
  }
  .mission b {
    font-size: 12px;
  }
  .mission small {
    font-size: 11px;
  }
  body[data-map="open"] .mission {
    max-width: calc(100% - 144px);
  }
  .mini-map {
    top: 12px;
    right: 12px;
    padding: 6px;
  }
  .mini-map canvas {
    width: 106px;
    height: 92px;
  }
  .mini-map span {
    max-width: 106px;
    font-size: 10px;
    line-height: 1.3;
  }
  .view-tabs {
    bottom: 8px;
    padding: 3px;
    gap: 2px;
    max-width: calc(100% - 16px);
  }
  .view-tabs button {
    min-height: 44px;
    min-width: 48px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .camera-label {
    display: none;
  }
  .cockpit,
  .expanded .cockpit {
    flex-shrink: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 44px 144px;
    height: 208px;
    min-height: 0;
    padding: 8px 16px 12px;
    gap: 0 20px;
  }
  .instruments {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    gap: 8px;
  }
  .meters {
    gap: 12px;
  }
  .speed > strong {
    font-size: 25px;
  }
  .gear {
    font-size: 22px;
  }
  .trip {
    display: none;
  }
  .drive-panel,
  .steering-main {
    display: contents;
  }
  .gears {
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
    align-self: center;
  }
  .gears button {
    min-height: 44px;
    min-width: 0;
    padding: 4px;
    font-size: 17px;
  }
  .gears small {
    display: inline;
    font-size: 10px;
    margin-left: 3px;
  }
  .steering {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 44px 52px 44px;
    grid-template-rows: 100px 44px;
    justify-content: center;
    gap: 0;
  }
  .wheel-touch {
    --wheel-size: 104px;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }
  .wheel {
    border-width: 8px;
  }
  .wheel-mark {
    top: -8px;
    height: 8px;
  }
  .steering > button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
  }
  .steering > button:first-child {
    grid-column: 1;
    grid-row: 2;
  }
  .steering > button:last-child {
    grid-column: 3;
    grid-row: 2;
  }
  #center-wheel {
    grid-column: 2;
    grid-row: 2;
    min-height: 44px;
    padding: 2px;
    font-size: 10px;
    border-color: transparent;
    background: transparent;
  }
  .pedals {
    grid-column: 2;
    grid-row: 2;
    gap: 8px;
    height: 136px;
    align-items: end;
  }
  .pedals button {
    min-width: 0;
    height: 96px;
    padding: 12px 4px;
    font-size: 12px;
  }
  .pedals .accelerator {
    height: 120px;
  }
  .pedals button:before {
    height: 24px;
    margin: 0 8px 12px;
  }
  .gears kbd,
  .pedals kbd,
  .keyboard-guide {
    display: none;
  }
  .notice {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    padding: 0;
    border: 0;
  }
  .parking-progress {
    bottom: 72px;
    font-size: 12px;
  }
  .overlay {
    inset: 48px 0 0;
    padding: 12px;
  }
  .start-sheet,
  .result-sheet,
  .pause-sheet,
  .settings-sheet {
    padding: 20px;
  }
  .start-sheet {
    width: 100%;
    margin: auto;
    max-height: 100%;
  }
  .start-sheet h2 {
    font-size: 21px;
  }
  .start-sheet > p {
    font-size: 12px;
  }
  .course-list {
    min-height: 60px;
    max-height: none;
    flex: 1;
    margin: 8px 0 12px;
  }
  .start-sheet .fine {
    font-size: 10px;
  }
  .result-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .result-sheet .score {
    font-size: 48px;
  }
  .result-buttons button {
    flex: 1 0 calc(50% - 8px);
  }
  .setting-row {
    gap: 8px;
  }
  .setting-row b {
    font-size: 12px;
  }
  .setting-row small {
    max-width: 160px;
  }
  .guide {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 28px 0;
  }
  footer {
    padding: 20px 16px;
    gap: 12px;
  }
}
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1200px) {
  .simulator {
    min-height: 0;
    height: 100svh;
  }
  .sim-top {
    min-height: 44px;
    height: 44px;
  }
  .cockpit,
  .expanded .cockpit {
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 1fr) minmax(
        200px,
        1fr
      );
    grid-template-rows: 1fr;
    height: 148px;
    padding: 4px 20px 8px;
    gap: 12px;
  }
  .steering {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    gap: 8px;
  }
  .steering-main {
    display: flex;
    --wheel-size: 88px;
    gap: 0;
  }
  .wheel-touch {
    --wheel-size: 88px;
  }
  #center-wheel {
    min-height: 44px;
  }
  .instruments {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    gap: 4px;
  }
  .trip {
    display: flex;
    flex-direction: row;
    gap: 8px;
    font-size: 10px;
  }
  .drive-panel {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .gears {
    flex-direction: column;
    width: 44px;
    gap: 0;
    flex-shrink: 0;
  }
  .gears button {
    min-height: 44px;
    padding: 0;
  }
  .gears small {
    display: none;
  }
  .pedals {
    height: 116px;
    flex: 1;
    gap: 8px;
  }
  .pedals button {
    height: 76px;
  }
  .pedals .accelerator {
    height: 104px;
  }
  .pedals button:before {
    height: 16px;
    margin-bottom: 8px;
  }
  .mission {
    top: 8px;
    left: 12px;
    padding: 6px 10px;
  }
  .mission small {
    margin-top: 0;
  }
  .mini-map {
    top: 8px;
  }
  .mini-map canvas {
    width: 90px;
    height: 72px;
  }
  .mini-map span {
    max-width: 90px;
  }
  .view-tabs {
    bottom: 4px;
    left: auto;
    right: 8px;
    transform: none;
  }
  .view-tabs button {
    min-height: 44px;
  }
  .overlay {
    inset: 44px 0 0;
    padding: 8px 16px;
  }
  .start-sheet {
    max-width: 600px;
    padding: 12px 16px;
  }
  .start-sheet h2 {
    margin: 0;
    font-size: 20px;
  }
  .start-sheet .eyebrow,
  #selected-description,
  #load-status,
  #best {
    display: none;
  }
  .start-rule {
    margin: 4px 0;
  }
  .course-list {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 4px 0 8px;
  }
  .course-list button {
    min-height: 48px;
    padding: 4px 8px;
  }
  .course-list small {
    font-size: 10px;
  }
  .result-sheet {
    padding: 12px 20px;
  }
  .result-sheet h2 {
    font-size: 22px;
    margin: 0;
  }
  .result-sheet > p {
    margin: 8px 0;
  }
  .result-stats {
    grid-template-columns: repeat(4, 1fr);
    margin: 8px 0;
    padding: 8px 0;
  }
  .result-buttons button {
    flex: initial;
  }
  .result-sheet .score {
    font-size: 36px;
    margin: 8px 0;
  }
  .pause-sheet {
    padding: 16px;
  }
}
@media (max-width: 360px) {
  .cockpit,
  .expanded .cockpit {
    padding-inline: 8px;
    column-gap: 12px;
  }
  .view-tabs button {
    padding-inline: 6px;
  }
  .setting-row {
    flex-wrap: wrap;
  }
  .setting-row small {
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* A short shift-lock message stays above the camera controls on every screen. */
.gear-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

.simulator:fullscreen,
.simulator:-webkit-full-screen {
  background: var(--dashboard);
  width: 100%;
  height: 100dvh;
}
