:root {
  color-scheme: dark;
  font-family: Impact, "Arial Black", "Arial Narrow", ui-sans-serif, system-ui, sans-serif;
  background: #171615;
  color: #fff2b8;
  --speedfx: 0;
  --speedfx-opacity: 0;
  --hud-yellow: #ffd232;
  --hud-orange: #f29d18;
  --hud-black: rgb(0 0 0 / 72%);
  --garage-width: 300px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #30343a;
}

#startMenu {
  position: fixed;
  inset: 0;
  z-index: 10;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 38%, rgb(255 194 45 / 17%), transparent 34%),
    rgb(5 7 10 / 92%);
  backdrop-filter: blur(8px);
}

#startMenu[hidden] {
  display: none;
}

.start-menu-box {
  width: min(440px, 100%);
  max-height: 100%;
  padding: clamp(24px, 6vw, 42px);
  overflow-y: auto;
  box-sizing: border-box;
  border: 2px solid rgb(255 210 50 / 58%);
  border-radius: 8px;
  background: linear-gradient(155deg, #17140f 0%, #090a0d 72%);
  box-shadow: 0 20px 70px rgb(0 0 0 / 82%), 0 0 28px rgb(255 190 35 / 18%);
}

.start-menu-kicker {
  margin: 0 0 6px;
  color: #d4cec0;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.start-menu-kicker strong {
  color: var(--hud-yellow);
}

.start-menu-box h1 {
  margin: 0 0 24px;
  color: var(--hud-yellow);
  font-size: clamp(34px, 10vw, 58px);
  line-height: 1;
  text-shadow: 3px 3px 0 #000, 0 0 16px rgb(255 202 46 / 38%);
  text-transform: uppercase;
}

.start-menu-retry {
  display: inline-block;
  margin: 0 0 18px;
  color: var(--hud-yellow);
  font-weight: 700;
}

.start-menu-retry:focus-visible {
  outline: 2px solid var(--hud-yellow);
  outline-offset: 3px;
}

.start-menu-actions {
  display: grid;
  gap: 10px;
}

.start-menu-actions button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgb(255 210 50 / 28%);
  border-radius: 6px;
  background: #2a2723;
  color: #fff2b8;
  cursor: pointer;
  text-align: left;
}

.start-menu-actions button:hover,
.start-menu-actions button:focus-visible {
  border-color: var(--hud-yellow);
  background: #3a2d13;
  outline: 2px solid rgb(255 210 50 / 42%);
  outline-offset: 2px;
}

.start-menu-actions span {
  color: var(--hud-orange);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-menu-actions button:disabled {
  border-color: rgb(255 255 255 / 10%);
  background: #181715;
  color: #77736a;
  cursor: not-allowed;
}

.start-menu-actions button:disabled span {
  color: #77736a;
}

.fatal-webgl {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  background: #05070b;
  color: #eef5ff;
  text-align: center;
}

.fatal-webgl strong {
  font-size: 28px;
}

.fatal-webgl span {
  color: #9fb0c8;
}

#game::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    repeating-linear-gradient(0deg, rgb(0 0 0 / 4%) 0 1px, transparent 2px 5px),
    radial-gradient(circle at 50% 45%, rgb(255 216 122 / 8%), transparent 30%),
    radial-gradient(circle at 50% 50%, transparent 42%, rgb(0 0 0 / 46%) 100%),
    linear-gradient(180deg, rgb(95 120 160 / 9%), transparent 36%, rgb(255 176 54 / 14%) 100%);
  mix-blend-mode: multiply;
  opacity: 0.58;
}

#game::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: 1;
  pointer-events: none;
  opacity: var(--speedfx-opacity);
  background:
    radial-gradient(ellipse at 50% 70%, rgb(255 202 88 / 16%), transparent 26%),
    repeating-linear-gradient(90deg, transparent 0 34px, rgb(255 215 104 / 12%) 35px 36px, transparent 37px 70px);
  filter: blur(10px);
  transform: perspective(620px) rotateX(58deg) scaleY(1.9);
}

#game.cinematic-off::before,
#game.cinematic-off::after {
  opacity: 0;
}

#hud {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 3;
}

.brand,
.telemetry,
#garage,
.pause-box,
#mapPanel,
#raceDirector {
  background: linear-gradient(180deg, rgb(0 0 0 / 78%), rgb(0 0 0 / 54%));
  border: 2px solid rgb(255 210 50 / 28%);
  box-shadow: 0 5px 0 rgb(0 0 0 / 72%), 0 0 22px rgb(255 180 36 / 12%);
  backdrop-filter: blur(5px);
}

.brand {
  min-width: 172px;
  padding: 10px 12px;
  border-radius: 6px;
  transform: skewX(-3deg);
}

.brand strong {
  display: block;
  line-height: 1.1;
  color: var(--hud-yellow);
  text-shadow: 2px 2px 0 #000, 0 0 10px rgb(255 202 46 / 38%);
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #d4cec0;
  font-size: 12px;
}

#gameVersion {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hud-orange);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

#gameVersion:hover,
#gameVersion:focus-visible {
  color: var(--hud-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#changelogDialog {
  width: min(620px, calc(100vw - 28px));
  height: min(78dvh, 720px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 2px solid rgb(255 210 50 / 58%);
  border-radius: 8px;
  background: linear-gradient(155deg, #17140f 0%, #090a0d 72%);
  color: #eee7d5;
  box-shadow: 0 20px 70px rgb(0 0 0 / 82%), 0 0 28px rgb(255 190 35 / 18%);
}

#changelogDialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  pointer-events: auto;
}

#changelogDialog::backdrop {
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(5px);
}

#fullscreenMapDialog {
  width: min(1120px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  border: 2px solid rgb(255 210 50 / 58%);
  border-radius: 8px;
  background: #090d11;
  color: #eee7d5;
  box-shadow: 0 20px 70px rgb(0 0 0 / 88%);
}

#fullscreenMapDialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#fullscreenMapDialog::backdrop {
  background: rgb(0 0 0 / 82%);
  backdrop-filter: blur(5px);
}

.fullscreen-map-header,
.fullscreen-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgb(255 181 35 / 12%), transparent);
}

.fullscreen-map-header {
  border-bottom: 1px solid rgb(255 210 50 / 28%);
}

.fullscreen-map-header h2 {
  margin: 2px 0 0;
  color: var(--hud-yellow);
  font-size: clamp(20px, 4vw, 30px);
  text-transform: uppercase;
}

.fullscreen-map-kicker {
  color: var(--hud-orange);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fullscreen-map-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgb(255 210 50 / 44%);
  border-radius: 5px;
  background: rgb(255 255 255 / 7%);
  color: #fff1bd;
  font-size: 27px;
  cursor: pointer;
}

.fullscreen-map-stage {
  position: relative;
  min-height: 0;
  display: grid;
  padding: 8px;
}

.fullscreen-map-attribution {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 3px;
  background: rgb(9 13 17 / 88%);
  font: 11px/1.3 Arial, sans-serif;
}

.fullscreen-map-attribution a {
  color: #fff1bd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fullscreen-map-attribution a:focus-visible {
  outline: 2px solid #55dfff;
  outline-offset: 2px;
}

#fullscreenMapStaticCanvas,
#fullscreenMapCanvas {
  width: 100%;
  height: 100%;
  min-height: 220px;
  grid-area: 1 / 1;
}

#fullscreenMapStaticCanvas {
  display: block;
  pointer-events: none;
}

#fullscreenMapCanvas {
  display: block;
  border: 1px solid rgb(255 210 50 / 25%);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: manipulation;
}

#fullscreenMapCanvas:focus-visible {
  border-color: #55dfff;
  outline: 3px solid rgb(85 223 255 / 58%);
  outline-offset: -4px;
}

.fullscreen-map-footer {
  align-items: flex-end;
  border-top: 1px solid rgb(255 210 50 / 28%);
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.fullscreen-map-footer p {
  max-width: 62ch;
  margin: 0;
  color: #cfc8b6;
}

.fullscreen-map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fullscreen-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fullscreen-map-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.map-legend-player { background: #40ff9f; }
.map-legend-waypoint { background: #ffd232; }

#openFullscreenMap {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 4px 7px;
  border: 1px solid rgb(255 210 50 / 45%);
  border-radius: 4px;
  background: rgb(0 0 0 / 78%);
  color: var(--hud-yellow);
  font-size: 11px;
  cursor: pointer;
}

#openFullscreenMap:disabled {
  border-color: rgb(255 255 255 / 18%);
  color: #777;
  cursor: not-allowed;
}

.changelog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgb(255 210 50 / 28%);
  background: linear-gradient(90deg, rgb(255 181 35 / 12%), transparent);
}

.changelog-kicker {
  color: var(--hud-orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.changelog-header h2 {
  margin: 4px 0 0;
  color: var(--hud-yellow);
  font-size: clamp(20px, 4vw, 29px);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
}

.changelog-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgb(255 210 50 / 34%);
  border-radius: 5px;
  background: rgb(255 255 255 / 5%);
  color: #fff1bd;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.changelog-close:hover,
.changelog-close:focus-visible {
  border-color: var(--hud-yellow);
  background: rgb(255 210 50 / 14%);
}

.changelog-list {
  min-height: 0;
  padding: 4px 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.changelog-list article {
  padding: 17px 0 13px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.changelog-list article:last-child {
  border-bottom: 0;
}

.changelog-list h3 {
  margin: 0 0 9px;
  color: #fff4bd;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.changelog-list h3 span {
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--hud-orange);
  color: #15100a;
  font-size: 9px;
  text-transform: uppercase;
  vertical-align: 2px;
}

.changelog-list ul {
  margin: 0;
  padding-left: 20px;
  color: #d5cebd;
  font-size: 13px;
  line-height: 1.55;
}

.changelog-professional {
  padding: 14px;
  border: 1px solid rgb(255 210 50 / 18%);
  border-radius: 6px;
  background: rgb(255 255 255 / 3%);
}

.changelog-professional h4 {
  margin: 0 0 8px;
  color: var(--hud-yellow);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.changelog-professional p,
.changelog-details p {
  margin: 0 0 12px;
  color: #ddd5c2;
  font-size: 13px;
  line-height: 1.55;
}

.changelog-details {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 6px;
  background: rgb(0 0 0 / 18%);
}

.changelog-details summary {
  padding: 11px 13px;
  color: #fff0b8;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  user-select: none;
}

.changelog-details summary:hover,
.changelog-details summary:focus-visible {
  background: rgb(255 210 50 / 8%);
  outline: none;
}

.changelog-details[open] summary {
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  background: rgb(255 210 50 / 6%);
}

.changelog-details > div {
  padding: 13px;
}

.changelog-plain dl {
  margin: 0;
}

.changelog-plain dt {
  margin-top: 11px;
  color: var(--hud-yellow);
  font-size: 13px;
  font-weight: 800;
}

.changelog-plain dt:first-child {
  margin-top: 0;
}

.changelog-plain dd {
  margin: 3px 0 0;
  color: #d5cebd;
  font-size: 13px;
  line-height: 1.5;
}

.changelog-technical {
  border-color: rgb(93 185 255 / 22%);
}

.changelog-technical summary {
  color: #b9dcff;
}

.telemetry {
  min-height: 48px;
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, auto));
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  font-style: italic;
  transform: none;
  backdrop-filter: none;
  margin-right: 174px;
}

#mapPanel {
  position: fixed;
  left: 14px;
  bottom: 14px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  padding: 10px;
  z-index: 3;
  pointer-events: none;
  border-width: 4px;
  border-color: rgb(255 218 68 / 62%);
  box-shadow: 0 0 0 4px rgb(0 0 0 / 70%), 0 0 22px rgb(255 210 50 / 24%);
}

#raceDirector {
  position: fixed;
  top: 84px;
  right: 328px;
  left: auto;
  transform: skewX(-5deg);
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 6px;
  z-index: 3;
  pointer-events: none;
  text-transform: uppercase;
  font-style: italic;
}

#raceDirector.active {
  display: flex;
}

#raceDirector #navDirectionArrow {
  display: none;
  width: 0;
  min-width: 0;
  height: 0;
  border-right: 11px solid transparent;
  border-bottom: 25px solid var(--hud-yellow);
  border-left: 11px solid transparent;
  filter: drop-shadow(0 0 5px rgb(255 210 50 / 70%));
  transform-origin: 50% 55%;
}

#navDirectionArrow.visible {
  display: block;
}

#raceDirector div {
  min-width: 92px;
}

#raceDirector b {
  display: block;
  color: var(--hud-yellow);
  font-size: 19px;
  line-height: 1;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px rgb(255 212 50 / 55%);
}

#raceDirector span {
  display: block;
  margin-top: 5px;
  color: #f0e7ca;
  font-size: 9px;
  letter-spacing: 1px;
}

#raceDirector .leaderboard {
  max-width: 190px;
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid rgb(255 210 50 / 22%);
  color: #e8f4ff;
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#minimap {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  filter: sepia(0.55) saturate(1.2) contrast(1.08);
}

.telemetry span {
  color: #eee2c1;
  font-size: 11px;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #000;
}

.telemetry b {
  color: var(--hud-yellow);
  display: block;
  font-size: 18px;
  line-height: 1.05;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgb(255 210 50 / 40%);
}

.telemetry span:nth-child(2) {
  position: fixed;
  right: 22px;
  bottom: 28px;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 4px solid rgb(255 214 61 / 78%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 58%, rgb(255 178 34 / 34%), transparent 34%),
    conic-gradient(from -40deg, rgb(255 210 62 / 66%), rgb(255 198 38 / 14%), rgb(0 0 0 / 0), rgb(255 198 38 / 54%)),
    rgb(0 0 0 / 58%);
  box-shadow: 0 0 0 4px rgb(0 0 0 / 64%), 0 0 18px rgb(255 190 24 / 18%), inset 0 0 26px rgb(255 255 255 / 9%);
}

.telemetry span:nth-child(2) b {
  font-size: 25px;
  color: #fff4a0;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgb(255 190 35 / 75%);
}

#dataAttribution {
  position: fixed;
  left: 12px;
  bottom: 8px;
  z-index: 4;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgb(7 16 24 / 78%);
  font-size: 11px;
}

#dataAttribution a {
  color: #dbe9ee;
}

#garage {
  position: fixed;
  top: 88px;
  right: 14px;
  width: min(var(--garage-width), calc(100vw - 28px));
  border-radius: 6px;
  opacity: 0.92;
  overflow: hidden;
  z-index: 3;
  transition: transform 160ms ease, opacity 160ms ease;
}

#game.racing #garage,
#game.driving #garage {
  transform: none;
  opacity: 0.58;
}

#game.racing #garage:hover,
#game.racing #garage:focus-within,
#game.driving #garage:hover,
#game.driving #garage:focus-within {
  transform: translateX(0);
  opacity: 0.96;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.tabs button,
.panel button,
.google {
  min-height: 36px;
  border: 0;
  color: #f5e7bf;
  background: #2a2723;
  cursor: pointer;
}

.tabs button {
  background: transparent;
  color: #d6caa8;
}

.tabs button.active {
  background: #3a2d13;
  color: var(--hud-yellow);
}

.panel {
  display: none;
  padding: 12px;
  gap: 10px;
  max-height: min(62vh, 470px);
  overflow: auto;
}

.panel.active {
  display: grid;
}

label {
  display: grid;
  gap: 6px;
  color: #c4ccd8;
  font-size: 12px;
}

.toggle {
  min-height: 34px;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
}

.graphics-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
}

.graphics-toggles .toggle {
  min-height: 28px;
  padding: 3px 0;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff3c4;
  background: #1b1917;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--hud-yellow);
}

input[type="color"] {
  padding: 2px;
}

#raceStatus,
#lobbyPlayers {
  min-height: 32px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
}

#lobbyPlayers {
  color: #9fb1c8;
}

#raceOverlay {
  position: fixed;
  left: 50%;
  top: 11%;
  transform: translateX(-50%);
  width: min(260px, calc(100vw - 28px));
  z-index: 4;
  padding: 10px 14px;
  border: 3px solid rgb(255 212 45 / 62%);
  border-radius: 6px;
  background: rgb(0 0 0 / 62%);
  box-shadow: 0 0 0 4px rgb(0 0 0 / 60%), 0 18px 45px rgb(0 0 0 / 45%);
  color: var(--hud-yellow);
  backdrop-filter: blur(5px);
  text-shadow: 2px 2px 0 #000;
}

#raceOverlay.hidden {
  display: none;
}

#raceOverlay h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.1;
}

#raceOverlay ol {
  margin: 0;
  padding-left: 22px;
  color: #dbeafe;
}

#raceOverlay li {
  padding: 4px 0;
}

#raceOverlay .countdown {
  font-size: 44px;
  line-height: 1;
  text-align: center;
  font-weight: 800;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel button,
.google {
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  display: grid;
  place-items: center;
}

#pauseMenu {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(4 8 13 / 42%);
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  z-index: 5;
}

#pauseMenu.hidden {
  display: none;
}

.pause-box {
  width: min(620px, 100%);
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  border-radius: 6px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pause-box h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--hud-yellow);
  text-shadow: 2px 2px 0 #000;
}

.pause-actions {
  position: sticky;
  top: -18px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 12px;
  background: linear-gradient(180deg, #101314 76%, transparent);
}

.pause-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #fff2b8;
  background: #2a2723;
  cursor: pointer;
}

.pause-settings {
  display: grid;
  gap: 10px;
}

.pause-settings-section {
  border: 1px solid rgb(255 210 50 / 24%);
  border-radius: 6px;
  background: rgb(0 0 0 / 24%);
}

.pause-settings-section summary {
  padding: 11px 12px;
  color: var(--hud-yellow);
  cursor: pointer;
  font-weight: 700;
}

.pause-settings-fields {
  display: grid;
  gap: 10px;
  padding: 2px 12px 12px;
}

.pause-settings-fields .graphics-toggles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-help {
  margin: 0;
  color: #c4ccd8;
  font-size: 12px;
  line-height: 1.6;
}

.control-help kbd {
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 4px;
  padding: 1px 4px;
  color: #fff3c4;
  background: #1b1917;
}

@media (max-width: 480px) {
  .pause-box {
    padding: 14px;
  }

  .pause-actions {
    top: -14px;
    gap: 6px;
  }

  .pause-settings-fields .graphics-toggles {
    grid-template-columns: 1fr;
  }
}

#touch {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: end;
  pointer-events: none;
  z-index: 3;
}

.stick,
.pedals button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.stick {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgb(0 0 0 / 72%);
  border: 3px solid rgb(255 210 50 / 42%);
  position: relative;
}

.stick span {
  position: absolute;
  width: 54px;
  height: 54px;
  left: 39px;
  top: 39px;
  border-radius: 50%;
  background: #f1df9d;
}

.pedals {
  display: flex;
  gap: 12px;
}

.pedals button {
  width: 82px;
  height: 86px;
  border-radius: 50%;
  border: 3px solid rgb(255 210 50 / 42%);
  color: #fff5c2;
  background: rgb(24 22 20 / 86%);
  text-shadow: 2px 2px 0 #000;
}

#throttleTouch {
  background: rgb(36 111 74 / 86%);
}

#boostTouch {
  background: rgb(145 93 22 / 88%);
}

#brakeTouch {
  background: rgb(148 43 47 / 86%);
}

@media (max-width: 780px) {
  #fullscreenMapDialog {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    max-width: none;
    max-height: none;
  }

  .fullscreen-map-header,
  .fullscreen-map-footer {
    padding: 9px 10px;
  }

  .fullscreen-map-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .fullscreen-map-legend {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  #hud {
    display: grid;
  }

  .telemetry {
    justify-self: stretch;
    grid-template-columns: repeat(3, 1fr);
    margin-right: 0;
  }

  #garage {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 166px;
    width: auto;
    max-height: 38vh;
    overflow: auto;
  }

  #game.racing #garage,
  #game.driving #garage {
    transform: translateY(calc(100% - 44px));
  }

  #mapPanel {
    width: 138px;
    height: 138px;
    left: 10px;
    bottom: 166px;
  }

  #raceDirector {
    top: 78px;
    right: 10px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  #fullscreenMapDialog {
    height: calc(100dvh - 8px);
  }

  #fullscreenMapStaticCanvas,
  #fullscreenMapCanvas {
    min-height: 80px;
  }

  .fullscreen-map-header,
  .fullscreen-map-footer {
    padding-block: 5px;
  }
}

@media (pointer: fine) and (min-width: 900px) {
  #touch {
    opacity: 0;
  }
}
