:root {
  --paper: #edeee7;
  --ink: #19201d;
  --muted: #747a71;
  --orange: #ff663b;
  --line: #d4d8ce;
  --mono: "Courier New", monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  font: inherit;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
header {
  height: 100px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5.7%;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.7px;
}
.brand small {
  display: block;
  font: 10px var(--mono);
  letter-spacing: 3.5px;
  margin-top: 3px;
}
.brand-mark {
  font-size: 45px;
  position: relative;
  font-weight: 900;
  line-height: 1;
}
.brand-mark span {
  font-size: 23px;
  position: absolute;
  right: -3px;
  bottom: 3px;
  color: var(--orange);
}
.edition {
  font: 11px var(--mono);
  letter-spacing: 1px;
}
.edition span {
  margin: 0 18px;
  color: #9a9e95;
}
.icon-button {
  background: none;
  border: 1px solid #bbc1b5;
  padding: 10px 13px;
  font: 10px var(--mono);
  letter-spacing: 1px;
}
.icon-button span {
  color: var(--muted);
  margin-left: 12px;
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 36px 5.7% 0;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 10px var(--mono);
  letter-spacing: 1.5px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}
.eyebrow-right {
  margin-left: auto;
  color: var(--muted);
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 29px;
}
h1 {
  font-size: clamp(45px, 7.5vw, 111px);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.95;
  margin: 0;
}
h1 > span:first-child {
  color: var(--orange);
  margin-left: 0.14em;
}
.title-star {
  display: inline-block;
  color: var(--orange);
  font-size: 0.64em;
  vertical-align: top;
  margin: 0 0 0 0.2em;
  line-height: 1.2;
}
.title-row p {
  font-size: 13px;
  color: #798075;
  margin: 18px 0 0;
}
.title-row p strong {
  color: var(--ink);
  font-weight: 400;
}
.stamp {
  border: 1px solid #acb4a5;
  padding: 13px 17px;
  transform: rotate(4deg);
  font: 15px var(--mono);
  line-height: 1.3;
  flex-shrink: 0;
  margin-left: 30px;
}
.stamp b {
  font-size: 17px;
}
.stamp span {
  display: block;
  font-size: 8px;
  border-top: 1px solid #bbc1b5;
  margin-top: 6px;
  padding-top: 6px;
  letter-spacing: 1px;
}
.game-shell {
  background: #1e2420;
  border: 1px solid #29312b;
  box-shadow: 0 8px 0 #d7dbd0;
}
.game-top,
.game-bottom {
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #acb5a5;
  font: 10px var(--mono);
  letter-spacing: 0.7px;
}
.game-top > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.game-top b {
  font-size: 10px;
  font-weight: 400;
  color: #e1e7d9;
}
.divider {
  color: #58604f;
  margin: 0 7px;
}
.small-button {
  background: none;
  border: 1px solid #505a48;
  color: #d4dbcd;
  font-size: 15px;
  margin-left: 8px;
  width: 26px;
  height: 25px;
}
.small-button:disabled {
  opacity: 0.3;
  cursor: default;
}
.arena-wrap {
  position: relative;
  aspect-ratio: 2.12;
  overflow: hidden;
  background: #424437;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
.arena-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23ffffff' filter='url(%23n)' opacity='.7' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
.arena-caption {
  position: absolute;
  bottom: 15px;
  left: 21px;
  right: 21px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font: 8px var(--mono);
  color: #a6ac8d;
  letter-spacing: 1px;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(90deg, #18201888, #18201855, #18201888);
  color: var(--paper);
  padding: 22px;
}
.menu-tag {
  font: 9px var(--mono);
  letter-spacing: 2.2px;
  color: #d3d8bd;
  border: 1px solid #85907370;
  padding: 7px 11px;
  margin-bottom: 16px;
}
h2 {
  font-size: clamp(28px, 4.5vw, 65px);
  line-height: 0.97;
  letter-spacing: -2.5px;
  margin: 0;
  font-weight: 950;
}
h2 em {
  font-style: normal;
  color: var(--orange);
}
.screen p {
  font-size: 12px;
  color: #c4cbb7;
  margin: 17px 0 23px;
}
.primary-button {
  background: var(--orange);
  color: #1b211b;
  border: 0;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 800;
  min-width: 240px;
  box-shadow: 4px 4px 0 #10170f80;
  transition:
    transform 0.12s,
    background 0.12s;
}
.primary-button:hover {
  background: #ff825b;
  transform: translateY(-2px);
}
.primary-button span {
  float: right;
  font-size: 20px;
  line-height: 14px;
  margin-left: 34px;
}
.menu-hint {
  margin-top: 18px;
  font: 8px var(--mono);
  letter-spacing: 1px;
  color: #b8c1a4;
}
.menu-hint span {
  margin: 0 9px;
  color: var(--orange);
}
.game-bottom {
  height: 41px;
  font-size: 9px;
}
.game-bottom > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.game-bottom b {
  color: #dfe5d6;
}
.player-chip {
  width: 14px;
  height: 7px;
  background: var(--orange);
  display: inline-block;
  margin-right: 6px;
}
.under-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 39px;
  margin-bottom: 38px;
}
.under-grid article {
  padding: 0 30px;
  border-left: 1px solid var(--line);
  position: relative;
}
.under-grid article:first-child {
  border: 0;
  padding-left: 0;
}
.under-grid article:last-child {
  padding-right: 30px;
}
.card-number {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: var(--muted);
}
h3 {
  font-size: 15px;
  letter-spacing: -0.4px;
  margin: 15px 0 12px;
}
.under-grid p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 280px;
  margin: 0;
}
.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
kbd {
  font: 9px var(--mono);
  border: 1px solid #c3cab9;
  background: #e1e5d8;
  padding: 4px 6px;
  color: #394332;
  white-space: nowrap;
}
.repair-icon {
  position: absolute;
  right: 0;
  top: 40px;
  border: 1px solid #bec8af;
  color: #859474;
  font: 25px var(--mono);
  width: 27px;
  height: 27px;
  text-align: center;
  transform: rotate(8deg);
}
footer {
  border-top: 1px solid var(--line);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 8px var(--mono);
  letter-spacing: 0.7px;
  color: #87907e;
}
footer b {
  font-weight: 400;
  color: #444f3b;
}
footer .live-dot {
  width: 4px;
  height: 4px;
  margin-left: 7px;
}
.hud {
  position: absolute;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  color: #eff1e4;
}
.hud > div {
  width: 140px;
}
.hud span {
  font: 8px var(--mono);
  letter-spacing: 1px;
}
.hud b {
  font: 11px var(--mono);
}
.meter {
  height: 6px;
  background: #171f16b0;
  border: 1px solid #717c5860;
  margin: 7px 0;
}
.meter i {
  height: 100%;
  display: block;
  width: 100%;
  background: var(--orange);
  transition: width 0.1s;
}
.boost-meter {
  text-align: right;
}
.boost-meter .meter i {
  background: #d0de86;
}
.hud .hud-center {
  text-align: center;
  width: 60px;
}
.hud-center b {
  font-size: 28px;
  display: block;
  line-height: 1;
}
.hud-center span {
  font-size: 7px;
}
.impact-text {
  position: absolute;
  top: 27%;
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
  font: bold 24px var(--mono);
  color: #ffbc6a;
  text-shadow: 2px 2px #273021;
}
.touch-controls {
  position: absolute;
  bottom: 35px;
  left: 14px;
  right: 14px;
  justify-content: space-between;
  pointer-events: none;
  user-select: none;
}
.touch-controls > div {
  display: flex;
  gap: 7px;
}
.touch-controls button {
  width: 50px;
  height: 50px;
  border: 1px solid #b8c1a45c;
  background: #172317bb;
  color: #e7eddc;
  border-radius: 10px;
  font: bold 12px var(--mono);
  touch-action: none;
  pointer-events: auto;
}
.touch-controls button.active {
  background: var(--orange);
  color: var(--ink);
}
.touch-controls .nitro {
  background: #ff663bc7;
  color: #19201d;
}
.touch-controls {
  display: none;
}
@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
  .menu-hint {
    font-size: 7px;
  }
}
@media (max-width: 800px) {
  header {
    height: 77px;
    padding: 0 5%;
  }
  .edition {
    display: none;
  }
  main {
    padding: 25px 5% 0;
  }
  .stamp {
    display: none;
  }
  .title-row {
    margin: 20px 0 25px;
  }
  .title-row p {
    font-size: 11px;
  }
  h1 {
    font-size: 10.8vw;
  }
  .arena-wrap {
    aspect-ratio: 1.45;
  }
  .under-grid {
    gap: 20px;
    grid-template-columns: 1fr 1fr;
  }
  .under-grid article {
    padding: 0 0 0 20px;
  }
  .under-grid article:last-child {
    display: none;
  }
  .game-top,
  .game-bottom {
    padding: 0 12px;
    font-size: 8px;
  }
  .game-top b {
    font-size: 8px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .eyebrow-right {
    font-size: 7px;
  }
  .game-bottom > span:last-child {
    display: none;
  }
  .arena-caption span:last-child {
    display: none;
  }
  h2 {
    font-size: 6.5vw;
  }
  .screen p {
    font-size: 10px;
  }
  .menu-tag {
    font-size: 7px;
  }
  .hud > div {
    width: 105px;
  }
  .hud {
    left: 15px;
    right: 15px;
  }
  footer span:nth-child(2) {
    display: none;
  }
}
@media (max-width: 480px) {
  .arena-wrap {
    aspect-ratio: 0.94;
  }
  .eyebrow-right {
    display: none;
  }
  .screen {
    padding: 10px;
  }
  h2 {
    font-size: 9vw;
  }
  .primary-button {
    min-width: 220px;
  }
  .screen p {
    max-width: 230px;
    line-height: 1.6;
  }
  .menu-hint {
    max-width: 210px;
    line-height: 1.7;
  }
  .under-grid {
    grid-template-columns: 1fr;
    margin-top: 30px;
    gap: 24px;
  }
  .under-grid article {
    border: 0;
    padding: 0;
  }
  .under-grid article:nth-child(2) {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .under-grid p {
    max-width: none;
  }
  .brand {
    font-size: 15px;
  }
  .brand small {
    font-size: 8px;
  }
  .brand-mark {
    font-size: 36px;
  }
  .hud {
    top: 15px;
  }
  .hud > div {
    width: 90px;
  }
  .arena-caption {
    bottom: 12px;
    font-size: 6px;
  }
  .title-star {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .primary-button {
    transition: none;
  }
}
/* Season 02: garage, readable HUD, career and immersive play. */
.header-actions {
  display: flex;
  gap: 8px;
}
.menu-tag {
  margin-bottom: 12px;
}
.screen p {
  margin: 14px 0 16px;
}
.setup-summary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 16px;
  font: 10px var(--mono);
  color: #e1e8d2;
}
.setup-summary span {
  padding: 5px 8px;
  border: 1px solid #b9c69e55;
  background: #1c271d88;
}
.secondary-button {
  border: 1px solid #a4b18c66;
  background: #1a251b80;
  color: #e1e9d4;
  min-width: 240px;
  padding: 10px 18px;
  font: 10px var(--mono);
  letter-spacing: 1px;
  margin-top: 10px;
}
.secondary-button:hover {
  background: #46543c;
}
.text-button {
  border: 0;
  background: none;
  color: #c4d2b5;
  text-decoration: underline;
  font-size: 11px;
  margin-top: 15px;
}
.primary-button {
  min-height: 46px;
}
.menu-hint {
  margin-top: 12px;
  font-size: 9px;
}
.hud {
  top: 17px;
  left: 20px;
  right: 20px;
}
.hud > div {
  width: 160px;
  background: #18261bba;
  padding: 9px 11px;
  border: 1px solid #bac99c22;
  border-radius: 3px;
}
.hud span {
  font-size: 10px;
}
.hud b {
  font-size: 16px;
  font-weight: bold;
}
.hud .hud-center {
  width: 70px;
  background: #17251a99;
  padding: 7px;
  border: 0;
}
.hud-center b {
  font-size: 32px;
}
.hud-center span {
  font-size: 8px;
}
.meter {
  height: 8px;
  margin: 7px 0;
}
.meter i {
  transition: none;
}
.hud small {
  font: 8px var(--mono);
  color: #b3c19d;
}
.hud .health-panel.low {
  border-color: #ff795c;
  box-shadow: inset 0 0 20px #f44e2322;
}
.health-panel.low .meter i {
  background: #ffac83;
}
#shield-status {
  display: block;
  color: #cfbdff;
  font-size: 8px;
  margin-top: 4px;
}
.match-strip {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 112px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  pointer-events: none;
  font: 10px var(--mono);
  color: #e5edda;
  text-shadow: 1px 1px #17251a;
}
.match-strip > span {
  background: #19271cb0;
  padding: 5px 8px;
  border-radius: 2px;
}
#combo {
  color: #ffd58e;
  min-width: 45px;
  text-align: center;
}
#combo:empty {
  display: none;
}
.impact-text {
  top: 34%;
  font-size: 24px;
}
.arena-caption {
  color: #ced8bd;
  font-size: 8px;
  background: #1c291b88;
  padding: 4px 7px;
  bottom: 10px;
  left: 12px;
  right: 12px;
}
.screen {
  z-index: 3;
}
.hud,
.match-strip,
.impact-text {
  z-index: 2;
}
.touch-controls {
  z-index: 2;
}
.arena-caption {
  z-index: 1;
}
.result-screen {
  overflow-y: auto;
  justify-content: flex-start;
}
.round-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: min(430px, 95%);
  margin: 0 0 15px;
}
.round-stats div {
  padding: 9px;
  background: #172519ab;
  border: 1px solid #a7b38a44;
}
.round-stats b {
  display: block;
  font: bold 20px var(--mono);
  color: #f0eede;
}
.round-stats span {
  font: 8px var(--mono);
  color: #abbc93;
}
.earned-badges {
  font: 10px var(--mono);
  color: #d4e69c;
  margin-bottom: 10px;
}
#cup-standings {
  width: min(430px, 95%);
  margin-bottom: 12px;
}
#cup-standings table {
  border-collapse: collapse;
  width: 100%;
  font: 10px var(--mono);
  background: #17251ac9;
  text-align: left;
}
#cup-standings th,
#cup-standings td {
  padding: 5px 10px;
  border-bottom: 1px solid #87997022;
}
#cup-standings .you {
  color: var(--orange);
}
#cup-standings caption {
  text-align: left;
  font: 9px var(--mono);
  padding: 5px;
  color: #b6c59f;
}
.result-screen h2 {
  font-size: clamp(27px, 3.4vw, 48px);
}
.result-screen .menu-tag {
  margin-bottom: 10px;
}
.result-screen p {
  margin: 12px 0;
}
.result-screen .secondary-button {
  margin-top: 7px;
}
.result-screen .menu-hint {
  margin-top: 8px;
}
.result-screen.cup-result .round-stats {
  margin-bottom: 9px;
}
.result-screen.cup-result h2 {
  font-size: 32px;
}
.result-screen.cup-result .menu-tag {
  display: none;
}
.game-top button {
  min-width: 30px;
}
.game-top {
  gap: 10px;
}
#phase {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#car-name {
  color: #dce6ce;
}
.game-shell:fullscreen,
.game-shell.focus-mode {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #1c261d;
  border: 0;
}
.game-shell:fullscreen .arena-wrap,
.game-shell.focus-mode .arena-wrap {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.game-shell.focus-mode {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.game-shell:fullscreen .game-top,
.game-shell.focus-mode .game-top {
  padding-top: env(safe-area-inset-top);
  height: calc(43px + env(safe-area-inset-top));
  flex-shrink: 0;
}
.game-shell:fullscreen .game-bottom,
.game-shell.focus-mode .game-bottom {
  height: calc(35px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
}
.game-shell:fullscreen .screen h2,
.game-shell.focus-mode .screen h2 {
  font-size: clamp(30px, 7vh, 70px);
}
dialog {
  border: 1px solid #bbc4b0;
  background: var(--paper);
  color: var(--ink);
  max-width: 900px;
  width: calc(100% - 40px);
  max-height: 90dvh;
  padding: 28px;
  box-shadow: 0 20px 100px #0008;
}
dialog::backdrop {
  background: #131c16cc;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  font-size: 30px;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin-top: 10px;
}
.close-button {
  flex-shrink: 0;
  border: 1px solid #b6bfac;
  background: none;
  width: 38px;
  height: 38px;
  font-size: 27px;
}
.close-button:hover {
  background: #d9e0ce;
}
fieldset {
  border: 0;
  margin: 0 0 22px;
  padding: 0;
}
legend {
  font: 10px var(--mono);
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: #617052;
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.option {
  background: #e3e7dc;
  border: 1px solid #c4cdb9;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  position: relative;
  min-height: 110px;
}
.option:hover {
  background: #dce3d1;
}
.option[aria-pressed="true"] {
  border: 2px solid #dc6239;
  background: #f3e7d9;
  padding: 13px;
}
.option[aria-pressed="true"]:after {
  content: "✓";
  position: absolute;
  right: 9px;
  top: 8px;
  color: #be4822;
  font-weight: bold;
}
.option b {
  font-size: 14px;
  display: block;
  margin: 0 0 8px;
  padding-right: 12px;
}
.option p {
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
  color: #68745e;
}
.car-preview {
  height: 50px;
  display: block;
  margin-bottom: 8px;
}
.car-preview svg {
  width: 90px;
  height: 50px;
}
.car-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 9px;
  margin-top: 12px;
  font: 8px var(--mono);
  color: #5c694f;
}
.stat-track {
  align-self: center;
  height: 5px;
  background: #c9d2bf;
}
.stat-track i {
  display: block;
  background: #687d54;
  height: 100%;
}
.arena-swatch {
  display: block;
  height: 38px;
  margin-bottom: 10px;
  border: 5px solid #8e9576;
  background: #566043;
  position: relative;
}
.arena-swatch:after {
  content: "";
  position: absolute;
  left: 31%;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 3px solid #2d392c;
  border-radius: 50%;
  box-shadow: 50px 2px 0 -1px #2d392c;
}
.arena-swatch.foundry {
  background: #3d4748;
  border-color: #7a8785;
}
.arena-swatch.dustbowl {
  background: #7d6747;
  border-color: #aa966d;
}
.garage-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.difficulty-options {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.difficulty-options button {
  padding: 9px 10px;
  background: #e0e5d7;
  border: 1px solid #c1cbb4;
  font: 10px var(--mono);
}
.difficulty-options button[aria-pressed="true"] {
  background: #233325;
  color: #e8eddc;
}
.paint-options {
  display: flex;
  gap: 7px;
}
.paint-options button {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  outline: 1px solid #adb9a1;
}
.paint-options button[aria-pressed="true"] {
  border: 3px solid #243324;
  outline: 2px solid var(--orange);
}
.dialog-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.dialog-footer > span {
  font-size: 11px;
  color: #737f66;
  max-width: 220px;
}
.dialog-footer .primary-button {
  min-width: 220px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.settings-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 12px;
  background: #e0e6d7;
  min-height: 50px;
}
.settings-grid label small {
  font-size: 10px;
  line-height: 1.5;
  color: #69775c;
  flex-basis: 100%;
}
.settings-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #d75c33;
}
.settings-grid input[type="range"] {
  width: 130px;
  accent-color: #d75c33;
}
.settings-grid select {
  max-width: 100%;
  padding: 8px;
  background: var(--paper);
  border: 1px solid #bbc5ae;
  color: var(--ink);
}
.control-guide {
  margin: 22px 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.control-guide p {
  font-size: 12px;
  line-height: 1.7;
  color: #657456;
}
.control-guide b {
  color: #2d3e28;
  margin-right: 5px;
}
.local-note {
  font-size: 11px;
  color: #748369;
}
.career {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-bottom: 30px;
}
.career-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.career-heading h3 {
  margin: 10px 0 20px;
  font-size: 21px;
}
.career-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.career h4 {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #6d7c60;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.career h4 span {
  float: right;
  font-size: 8px;
}
#career-totals {
  display: flex;
  gap: 26px;
  font: 9px var(--mono);
  text-align: center;
  color: #6c7b5f;
}
#career-totals b {
  display: block;
  font-size: 24px;
  color: #23321f;
  margin-bottom: 5px;
}
#records {
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 11px;
}
#records li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d8ded0;
  padding: 10px 0;
  gap: 10px;
}
#records li > span:first-child {
  font: 10px var(--mono);
  color: #8e9c80;
}
#records li b {
  margin-left: auto;
  font-family: var(--mono);
}
#records li small {
  display: block;
  color: #7c8970;
  font-size: 9px;
  margin-top: 4px;
}
.empty-record {
  color: #7c8970;
  line-height: 1.7;
  padding: 10px 0;
  font-size: 12px;
}
#badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.badge {
  padding: 10px;
  border: 1px solid #cbd4bf;
  color: #8a957e;
  font-size: 10px;
  background: #e3e8db;
}
.badge b {
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
}
.badge span {
  font-size: 9px;
  line-height: 1.5;
  display: block;
}
.badge.earned {
  color: #435a33;
  background: #dce6cc;
  border-color: #9cad86;
}
.badge.earned b:before {
  content: "✓ ";
  color: #5e7d3b;
}
#storage-warning {
  font: 11px var(--mono);
  color: #93612b;
}
.touch-controls button {
  width: 45px;
  height: 48px;
  font-size: 10px;
}
.touch-controls > div {
  gap: 5px;
}
.touch-controls {
  left: 12px;
  right: 12px;
  bottom: 35px;
  align-items: flex-end;
}
.stick-group {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #17261dcc;
  border: 1px solid #d1e4b555;
  touch-action: none;
  pointer-events: auto;
  display: none !important;
}
.stick-group > span {
  position: absolute;
  top: 31px;
  left: 31px;
  width: 44px;
  height: 44px;
  border: 1px solid #d6e3c677;
  border-radius: 50%;
  background: #b5cba13b;
  box-shadow: 0 3px 6px #0003;
}
.stick-group small {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font: 8px var(--mono);
  color: #cad8bb;
  pointer-events: none;
}
.touch-controls[data-scheme="stick"] .stick-group {
  display: block !important;
}
.touch-controls[data-scheme="stick"] .buttons-group {
  display: none;
}
.touch-controls[data-scheme="stick"] .pedals button {
  width: 60px;
  height: 60px;
}
.noscript {
  padding: 20px;
  text-align: center;
}
.game-shell:fullscreen dialog {
  max-height: 90vh;
}
.game-shell.focus-mode dialog {
  position: fixed;
}
@media (max-width: 800px) {
  .header-actions {
    gap: 5px;
  }
  .icon-button {
    font-size: 9px;
    padding: 9px;
  }
  .icon-button span {
    margin-left: 5px;
  }
  .menu-hint {
    font-size: 8px;
  }
  .career-grid {
    gap: 22px;
  }
  .career-heading h3 {
    font-size: 17px;
  }
  #career-totals {
    gap: 14px;
  }
  .under-grid {
    grid-template-columns: 1fr 1fr;
  }
  .option {
    padding: 10px;
  }
  .option[aria-pressed="true"] {
    padding: 9px;
  }
  .option b {
    font-size: 12px;
  }
  .hud > div {
    width: 130px;
  }
  .hud b {
    font-size: 14px;
  }
  .hud span {
    font-size: 9px;
  }
  .hud-center b {
    font-size: 29px;
  }
  .hud small {
    display: none;
  }
  .match-strip {
    font-size: 9px;
    top: 104px;
  }
  .game-top {
    padding: 0 10px;
    font-size: 8px;
  }
  .game-top > div {
    gap: 6px;
  }
  .divider {
    margin: 0 3px;
  }
  .result-screen.cup-result .round-stats {
    display: none;
  }
  .result-screen.cup-result h2 {
    font-size: 28px;
  }
}
@media (max-width: 480px) {
  header {
    padding: 0 5%;
    height: 77px;
  }
  .header-actions .icon-button {
    font-size: 8px;
    padding: 8px;
  }
  .header-actions .icon-button span {
    margin-left: 4px;
  }
  .brand {
    font-size: 14px;
  }
  .brand small {
    font-size: 7px;
  }
  .arena-wrap {
    aspect-ratio: 0.79;
  }
  .screen h2 {
    font-size: 8vw;
  }
  .screen p {
    font-size: 10px;
    margin: 13px 0;
    max-width: 240px;
  }
  .setup-summary {
    font-size: 8px;
    max-width: 270px;
    gap: 5px;
    margin-bottom: 13px;
  }
  .primary-button {
    min-width: 220px;
  }
  .secondary-button {
    min-width: 220px;
    font-size: 9px;
  }
  .menu-tag {
    font-size: 7px;
    letter-spacing: 1.2px;
  }
  .hud {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .hud > div {
    width: 100px;
    padding: 8px;
  }
  .hud .hud-center {
    width: 55px;
    padding: 6px 0;
  }
  .hud b {
    font-size: 13px;
  }
  .hud-center b {
    font-size: 28px;
  }
  .hud span {
    font-size: 8px;
  }
  .hud-center span {
    font-size: 7px;
  }
  .match-strip {
    left: 10px;
    right: 10px;
    top: 95px;
    font-size: 8px;
    gap: 5px;
  }
  .match-strip > span {
    padding: 5px;
  }
  .impact-text {
    font-size: 17px;
    top: 36%;
  }
  .game-top {
    font-size: 7px;
  }
  .game-top b {
    font-size: 7px;
  }
  #arena-name {
    display: none;
  }
  .divider {
    display: none;
  }
  .game-top button {
    margin-left: 2px;
    width: 27px;
    min-width: 27px;
  }
  .game-bottom {
    font-size: 8px;
  }
  .under-grid {
    grid-template-columns: 1fr;
  }
  .under-grid article:last-child {
    display: block;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
  }
  .under-grid p {
    font-size: 12px;
  }
  .repair-icon {
    right: 6px;
    top: 43px;
  }
  .key-row {
    gap: 6px;
    font-size: 10px;
  }
  dialog {
    width: calc(100% - 20px);
    padding: 17px;
    max-height: 94dvh;
  }
  .dialog-heading h2 {
    font-size: 25px;
  }
  .dialog-heading {
    margin-bottom: 20px;
  }
  .option-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .option {
    min-height: 0;
    padding: 12px;
  }
  .option[aria-pressed="true"] {
    padding: 11px;
  }
  .option b {
    font-size: 14px;
  }
  .option p {
    font-size: 11px;
  }
  .car-preview {
    float: left;
    width: 80px;
    margin: 0 14px 0 0;
    height: 55px;
  }
  .car-preview svg {
    width: 80px;
  }
  .car-stats {
    clear: both;
    padding-top: 9px;
    grid-template-columns: 50px 1fr;
    font-size: 8px;
    gap: 4px;
  }
  .arena-swatch {
    float: left;
    width: 80px;
    margin: 0 14px 0 0;
  }
  .arena-swatch:after {
    box-shadow: 20px 2px 0 -1px #2d392c;
  }
  .garage-bottom {
    flex-direction: column;
    gap: 0;
  }
  .dialog-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .dialog-footer > span {
    max-width: none;
  }
  .dialog-footer .primary-button {
    width: 100%;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .settings-grid label {
    font-size: 12px;
  }
  .career-heading {
    display: block;
  }
  #career-totals {
    justify-content: space-between;
    margin: 15px 0 20px;
  }
  .career-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #badges {
    gap: 7px;
  }
  .round-stats {
    gap: 5px;
    width: 95%;
    margin-bottom: 10px;
  }
  .round-stats div {
    padding: 8px 3px;
  }
  .round-stats b {
    font-size: 16px;
  }
  .round-stats span {
    font-size: 7px;
  }
  .result-screen {
    padding: 15px 8px;
  }
  .result-screen h2 {
    font-size: 30px;
  }
  .result-screen p {
    font-size: 10px;
  }
  .result-screen .menu-tag {
    font-size: 6px;
  }
  .earned-badges {
    font-size: 9px;
  }
  .arena-caption {
    font-size: 6px;
    bottom: 7px;
  }
  .touch-controls {
    left: 10px;
    right: 10px;
  }
  .touch-controls button {
    width: 42px;
    height: 47px;
  }
  .touch-controls > div {
    gap: 4px;
  }
  .result-screen.cup-result h2 {
    font-size: 25px;
  }
  .result-screen.cup-result p {
    margin: 9px 0;
  }
  .result-screen.cup-result .menu-hint {
    font-size: 7px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .game-shell:fullscreen .screen,
  .game-shell.focus-mode .screen {
    padding: 10px;
  }
  .game-shell:fullscreen .screen h2,
  .game-shell.focus-mode .screen h2 {
    font-size: 30px;
  }
  .game-shell:fullscreen .menu-tag,
  .game-shell.focus-mode .menu-tag {
    display: none;
  }
  .game-shell:fullscreen .result-screen .round-stats,
  .game-shell.focus-mode .result-screen .round-stats {
    display: none;
  }
  .screen p {
    margin: 8px 0;
  }
  .screen .secondary-button {
    margin-top: 5px;
  }
  .menu-hint {
    margin-top: 6px;
  }
  .touch-controls {
    bottom: 27px;
  }
  .hud {
    top: 8px;
  }
  .match-strip {
    top: 90px;
  }
  .game-shell:fullscreen .game-bottom,
  .game-shell.focus-mode .game-bottom {
    display: none;
  }
}

/* Shared standings and expanded motor pool. */
.board-intro,
#board-status {
  color: var(--muted, #b2b5a4);
  line-height: 1.5;
}
.board-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin: 24px 0;
}
.board-filters label {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 140px;
  font: 11px monospace;
  text-transform: uppercase;
}
.board-filters select,
#driver-name {
  background: #18211c;
  border: 1px solid #67735d;
  color: #eeeedb;
  padding: 12px;
  border-radius: 3px;
  font: inherit;
  max-width: 100%;
}
.board-filters .secondary-button {
  margin: 0;
}
.board-table {
  overflow-x: auto;
}
.board-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.board-table th {
  color: #586348;
  font: 11px monospace;
}
.board-table th,
.board-table td {
  padding: 14px 9px;
  border-bottom: 1px solid #394133;
}
.board-table td:nth-child(4) {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.board-table .podium td:first-child {
  color: #b64620;
  font-weight: bold;
}
.board-table td:nth-child(2) {
  overflow-wrap: anywhere;
}
#score-submit {
  width: min(440px, 100%);
  margin: 12px auto 0;
  text-align: left;
}
#score-submit label {
  display: block;
  font: 10px monospace;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.submit-row {
  display: flex;
  gap: 8px;
}
#driver-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}
.submit-row .secondary-button {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
}
#submit-status {
  font: 11px/1.5 monospace;
  max-width: 440px;
  margin: 10px auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 600px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
  }
  .header-actions .icon-button {
    font-size: 9px;
    padding: 7px;
  }
  .board-table th,
  .board-table td {
    padding: 10px 5px;
    font-size: 11px;
  }
  .board-table th:last-child,
  .board-table td:last-child {
    display: none;
  }
  .board-filters {
    gap: 8px;
  }
  .board-filters label {
    min-width: 110px;
  }
  .result-screen {
    justify-content: flex-start;
  }
}
