@font-face {
  font-family: Race;
  src: url(assets/fonts/display.woff2) format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url(assets/fonts/condensed.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: DM;
  src: url(assets/fonts/sans.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #102f38;
  --teal: #164957;
  --yellow: #ffce39;
  --cream: #fff8e8;
  --rail: clamp(24px, 5.2vw, 95px);
}
* {
  box-sizing: border-box;
}
html,
body,
#game {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #112e38;
}
#game {
  position: relative;
  height: 100dvh;
  font:
    500 16px/1.4 DM,
    system-ui,
    sans-serif;
  color: var(--ink);
  isolation: isolate;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 4px solid #ffb50c;
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
button svg,
i svg,
span svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}
i {
  font-style: normal;
}
[hidden] {
  display: none !important;
}
#track,
#backdrop,
#shell,
#hud,
#loader,
#modal {
  position: absolute;
  inset: 0;
}
#track {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#backdrop {
  background: #225f76 url(assets/ui/cover.webp) no-repeat center center/cover;
  transition: opacity 0.3s;
}
#backdrop:after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(4, 28, 40, 0.83),
      rgba(5, 31, 42, 0.64) 21%,
      rgba(7, 38, 50, 0.08) 50%,
      transparent 70%
    ),
    linear-gradient(0deg, rgba(4, 30, 41, 0.44), transparent 25%);
}
#shell {
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
#shell button,
#shell .selection {
  pointer-events: auto;
}
#top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 var(--rail);
  padding: clamp(14px, 3.5vh, 36px) 0;
  color: white;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: inherit;
  padding: 3px 0;
  font:
    italic 900 clamp(23px, 2vw, 35px) / 1 Race,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.035em;
}
.checkflag {
  display: inline-block;
  width: 29px;
  height: 21px;
  transform: skew(-15deg);
  background: repeating-conic-gradient(currentColor 0% 25%, transparent 0% 50%) 50% / 12px 12px;
}
.utility {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-button {
  height: 43px;
  width: 43px;
  appearance: none;
  padding: 0;
  flex: none;
  border: 1px solid #ffffff7a;
  background: #133944b3;
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}
.icon-button:hover,
.link-button:hover {
  background: #285561;
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
.home {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--rail) clamp(15px, 5vh, 50px);
}
.home-group {
  width: clamp(230px, 30vw, 420px);
  color: var(--cream);
  animation: enter 0.4s ease-out both;
}
h1 {
  margin: 0 0 clamp(25px, 4.8vh, 60px);
  transform: rotate(-5deg);
  transform-origin: center left;
  user-select: none;
  letter-spacing: -0.045em;
  font:
    italic 900 clamp(82px, min(10.6vw, 16vh), 180px) / 0.75 Race,
    Impact,
    sans-serif;
  -webkit-text-stroke: 1px #fdf9e9;
  filter: drop-shadow(1px 6px 0 #143641) drop-shadow(1px 2px 0 #102b31);
}
h1 span,
h1 strong {
  display: block;
  font: inherit;
}
h1 strong {
  font-size: 1.23em;
  color: var(--yellow);
  -webkit-text-stroke: 1px var(--yellow);
  letter-spacing: -0.055em;
  margin-left: -0.035em;
  margin-top: 0.085em;
}
.mode-list {
  display: grid;
  gap: 12px;
  max-width: 340px;
}
.mode {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 0;
  border-radius: 9px;
  padding: 14px 20px;
  font:
    700 clamp(21px, 2vw, 30px) / 1 Barlow,
    sans-serif;
  box-shadow: 0 4px 0 #041e28a0;
  transition:
    transform 0.17s,
    background 0.17s;
}
.mode:hover,
.cta:hover {
  transform: translateY(-2px);
}
.mode:active,
.cta:active {
  transform: translateY(2px);
}
.mode > i:last-child {
  margin-left: auto;
  font-size: 0.74em;
}
.mode.primary,
.cta {
  background: var(--yellow);
  color: var(--ink);
}
.mode.secondary {
  background: #f8f4e8ed;
  color: var(--ink);
}
.link-button {
  margin: 20px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 5px 3px;
  color: #fff;
  font:
    700 17px Barlow,
    sans-serif;
}
body:is([data-screen='drivers'], [data-screen='courses']) #backdrop {
  background: #f5eddc;
}
body:is([data-screen='drivers'], [data-screen='courses']) #backdrop:after {
  background:
    repeating-linear-gradient(-39deg, transparent 0 65px, #61533105 66px 67px),
    radial-gradient(ellipse at 82% 24%, #fffef9 0, transparent 65%);
}
body:is([data-screen='drivers'], [data-screen='courses']) #top {
  color: var(--ink);
}
body:is([data-screen='drivers'], [data-screen='courses']) .icon-button {
  color: var(--ink);
  background: #fffaf0;
  border-color: #c8ccbf;
}
.selection {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(4px, 2.5vh, 30px) var(--rail) max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.select-wrap {
  width: min(100%, 1300px);
  margin: auto;
  animation: enter 0.28s ease-out;
}
.select-head,
.selection-foot,
.dialog-actions,
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.select-head {
  margin-bottom: clamp(12px, 2.8vh, 32px);
  align-items: flex-end;
}
h2,
h3,
p {
  margin: 0;
}
.select-head h2,
.dialog h2 {
  font:
    italic 900 clamp(36px, 5vw, 80px) / 0.95 Race,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.025em;
}
.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font:
    700 17px Barlow,
    sans-serif;
  background: var(--ink);
  color: white;
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 9px;
}
.back,
.quiet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #28434c40;
  border-radius: 7px;
  padding: 9px 14px;
  font:
    700 18px Barlow,
    sans-serif;
}
.back:hover,
.quiet:hover {
  background: #d4dfdb;
}
.grid {
  display: grid;
  gap: clamp(9px, 1.3vw, 22px);
}
.grid.drivers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.circuits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choice {
  position: relative;
  text-align: left;
  padding: 0;
  border: 2px solid #26434a33;
  border-radius: 12px;
  background: #fffaf0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform 0.19s,
    border-color 0.19s,
    box-shadow 0.19s;
}
.choice:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
}
.choice.selected {
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.choice.selected:after {
  content: '✓';
  position: absolute;
  right: 9px;
  top: 9px;
  font: bold 15px/25px system-ui;
  text-align: center;
  width: 25px;
  height: 25px;
  background: var(--ink);
  color: white;
  border: 2px solid #fff;
  border-radius: 50%;
}
.choice:disabled {
  opacity: 0.55;
}
.portrait {
  height: clamp(100px, 19vw, 280px);
  max-height: 33vh;
  display: grid;
  place-items: center;
  width: 100%;
  background: var(--tint);
  overflow: hidden;
}
.portrait img {
  width: 103%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.3s;
}
.choice.selected .portrait img {
  transform: scale(1.035);
}
.track-image {
  width: 100%;
  height: clamp(105px, 15vw, 230px);
  max-height: 31vh;
  object-fit: cover;
}
.choice-info {
  padding: clamp(10px, 1.4vw, 22px);
  display: block;
}
.choice-info b {
  display: block;
  font:
    italic 900 clamp(23px, 3vw, 48px) / 1 Race,
    sans-serif;
  text-transform: uppercase;
}
.choice-info small {
  font:
    500 clamp(12px, 1.1vw, 16px) / 1.4 DM,
    sans-serif;
  color: #4b5c5c;
}
.selection-foot {
  margin-top: clamp(15px, 3.4vh, 40px);
}
.selection-note {
  max-width: 64%;
  color: #40565b;
  font-size: clamp(12px, 1.25vw, 17px);
}
.cta {
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: 8px;
  font:
    700 22px/1 Barlow,
    sans-serif;
  padding: 13px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  transition: transform 0.17s;
  white-space: nowrap;
}
#loader {
  z-index: 9;
  background: #102e38;
  color: #fffaf0;
  display: grid;
  place-items: center;
}
.loader-body {
  text-align: center;
  width: min(330px, 65vw);
}
.loader-body strong {
  display: block;
  font:
    italic 900 58px/1.1 Race,
    sans-serif;
  text-transform: uppercase;
}
.loader-body .checkflag {
  color: #ffcd3d;
}
.load-track {
  overflow: hidden;
  height: 5px;
  background: #47616a;
  border-radius: 4px;
  margin: 22px 0 10px;
}
.load-track i {
  display: block;
  height: 100%;
  transform: translateX(calc(var(--progress, 12%) - 100%));
  background: var(--yellow);
  transition: transform 0.18s;
}
.loader-body p {
  font-size: 14px;
}
body[data-screen='race'] #backdrop,
body[data-screen='race'] #shell {
  display: none;
}
#hud {
  pointer-events: none;
  color: white;
  display: flex;
}
.pane {
  position: relative;
  flex: 1;
  min-width: 0;
  container-type: inline-size;
}
.pane + .pane {
  border-left: 3px solid #fff9;
}
.telemetry,
.item-hud,
.timing,
.race-prompt,
.ranking,
.minimap,
.race-toast {
  position: absolute;
}
.item-hud {
  left: clamp(10px, 1.55cqw, 25px);
  top: max(16px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 9px;
}
.chip,
.timing {
  background: #132e39dd;
  border: 1px solid #ffffff78;
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px #17232430;
}
.item-slot {
  position: relative;
  width: clamp(54px, 9.4cqw, 144px);
  aspect-ratio: 1;
  height: auto;
  display: grid;
  place-items: center;
  border: clamp(2px, .22cqw, 4px) solid #f4ebd7;
  border-radius: 15%;
  background: linear-gradient(154deg, #514654, #302b34 39%, #24252c 72%, #403940);
  box-shadow: inset 0 0 0 2px #655d5c, inset 0 2px 5px #c9c5c75c, 0 2px 4px #171e2491;
}
.item-slot[data-binding]::after {
  content: attr(data-binding);
  position: absolute;
  right: 3%;
  bottom: 3%;
  padding: 1px 4px;
  border: 1px solid #fff8;
  border-radius: 4px;
  background: #272b31ed;
  color: #fff9e9;
  font: 700 clamp(10px, .92cqw, 14px)/1.1 Barlow, sans-serif;
}
.item-slot svg {
  width: 32px;
  height: 32px;
}
.item-copy b,
.item-copy small {
  display: block;
}
.item-copy {
  opacity: 0;
  transition: opacity .18s;
  color: white;
  text-shadow:
    0 1px 5px #123,
    0 1px 2px #123;
  font:
    700 19px/1.05 Barlow,
    sans-serif;
}
.item-copy.visible { opacity: 1; }
.item-copy small {
  font-size: 14px;
  margin-top: 4px;
}
.telemetry {
  left: clamp(10px, 2vw, 32px);
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  gap: 7px;
  align-items: center;
}
.chip {
  padding: 8px 13px;
  font:
    700 24px/1 Barlow,
    sans-serif;
}
.chip small {
  opacity: 0.93;
  font:
    700 13px/1 Barlow,
    sans-serif;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.ranking {
  bottom: max(12px, env(safe-area-inset-bottom));
  right: clamp(12px, 2vw, 32px);
  font: italic 850 clamp(31px, 4.35vw, 70px) / .98 DM, sans-serif;
  color: #fffefa;
  letter-spacing: -.07em;
  padding-right: .08em;
  -webkit-text-stroke: .018em currentColor;
  text-shadow: 0 2px 1px #24323dba, 0 2px 7px #17222f9c;
}
.chip.lap {
  color: #fffefa;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  font: italic 850 clamp(24px, 2.9vw, 44px)/1 DM, sans-serif;
  letter-spacing: -.055em;
  -webkit-text-stroke: .014em currentColor;
  text-shadow: 0 2px 1px #202b38b5, 0 2px 6px #18202b9c;
}
.chip.lap small {
  font: inherit;
  margin-right: .26em;
  opacity: 1;
}
.chip.speed {
  font-size: clamp(13px, 1.3vw, 19px);
  padding: 5px 7px;
  margin-left: 5px;
  border: 0;
  background: #152a3499;
}
.chip.speed small { font-size: .62em; margin: 0; }
@media (max-height: 500px) {
  .chip.lap {font-size: 19px}
  .chip.speed {font-size: 13px; margin-left: 0; padding: 3px 5px}
  .ranking {font-size: 30px}
}
.minimap {
  width: clamp(65px, 9vw, 140px);
  height: clamp(75px, 12vw, 175px);
  bottom: 18%;
  right: 1.2%;
  opacity: 0.96;
}
.race-prompt {
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  font:
    italic 900 clamp(58px, 9vw, 150px) / 1 Race,
    sans-serif;
  color: #ffdb43;
  text-shadow:
    0 5px 0 #17343b,
    0 8px 12px #153a4244;
  white-space: nowrap;
}
.race-prompt.finish {
  font-size: clamp(30px, 5vw, 80px);
}
.race-toast {
  bottom: 13%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font:
    italic 900 clamp(17px, 2.2vw, 35px) Race,
    sans-serif;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 #17343b,
    0 1px 5px #142d37;
}
#pause {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(17px, env(safe-area-inset-right));
  z-index: 2;
}
#modal {
  z-index: 5;
  background: #09232ec4;
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 12px;
}
.dialog {
  background: var(--cream);
  border: 2px solid #142f38;
  box-shadow: 0 6px 0 #10273280;
  border-radius: 16px;
  width: min(490px, 95vw);
  max-height: 94dvh;
  overflow: auto;
  padding: clamp(18px, 3vw, 35px);
  animation: enter 0.2s ease;
}
.dialog h2 {
  font-size: clamp(36px, 4vw, 60px);
  margin-bottom: 17px;
}
.dialog .row-head {
  margin: 10px 0;
}
.dialog-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 18px;
}
.dialog .cta {
  font-size: 19px;
}
.control-tabs {
  display: flex;
  gap: 5px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.control-tabs button {
  background: #e6e7d9;
  border: 0;
  border-radius: 5px;
  padding: 5px 10px;
  font: 700 16px Barlow;
}
.control-tabs button.active {
  background: var(--ink);
  color: white;
}
.guide {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 15px;
  font-size: 14px;
  align-items: center;
}
.guide dt {
  font-weight: bold;
}
.guide dd {
  margin: 0;
  text-align: right;
}
.guide-note {
  font-size: 13px;
  color: #506163;
  margin: 13px 0;
}
.result-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 7px;
  border-bottom: 1px solid #14313621;
}
.result-row.human {
  background: #ffdf7a66;
}
.result-row > b {
  font: italic 900 25px Race;
}
.result-row small {
  color: #56676a;
}
#touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.steer-zone {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  touch-action: none;
  pointer-events: auto;
  --cue-color: #83e8dc;
  --cue-delay: 0s;
  --cue-edge: linear-gradient(to right, #66ddc94d, transparent 46%);
}
.steer-zone[data-touch='right'] {
  left: 50%;
  --cue-color: #ffdb55;
  --cue-delay: -.7s;
  --cue-edge: linear-gradient(to left, #ffdc504d, transparent 46%);
}
.show-steering-hint .steer-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cue-edge);
  animation: steer-side 1.4s var(--cue-delay) ease-in-out infinite;
}
@keyframes steer-side {
  0%, 56%, 100% { opacity: 0; }
  22%, 34% { opacity: 1; }
}
.steer-hint {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  border: 1px solid #f5fff69c;
  border-radius: 9px;
  color: #fff9e7;
  background: #112e42ef;
  font: italic 900 clamp(14px, 2.2vw, 22px)/1 Race, sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
}
.show-steering-hint .steer-hint { display: flex; }
.steer-hint i {
  color: var(--cue-color);
  font-size: 1.2em;
  animation: steer-tap 1.4s var(--cue-delay) ease-in-out infinite;
}
@keyframes steer-tap {
  0%, 56%, 100% { transform: translateY(-2px) rotate(-8deg); }
  22%, 34% { transform: translateY(2px) scale(.84); }
}
@media (prefers-reduced-motion: reduce) {
  .steer-hint i { animation: none; }
  .show-steering-hint .steer-zone::before { content: none; }
}
@media (any-pointer: coarse) {
  #game, #game * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
#game { --pedal-size: 54px; }
.touch-cluster {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(11px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.touch-cluster button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  height: var(--pedal-size);
  min-width: var(--pedal-size);
  border-radius: 16px;
  border: 1.5px solid #fff9;
  color: white;
  background: #163844b8;
  display: grid;
  place-items: center;
  font: 700 16px Barlow;
}
#touch-item {
  width: calc(var(--pedal-size) * 1.15);
  height: calc(var(--pedal-size) * 1.15);
  padding: 0;
  border: 0;
  background: transparent;
}
#touch-item .item-slot { width: 100%; height: 100%; pointer-events: none; }
#touch-item.pressed .item-slot { transform: scale(.95); filter: brightness(1.25); }
.touch-cluster .pressed {
  background: #ffcf41;
  color: #18373f;
}
#rotate {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #12323cf5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--cream);
}
#rotate strong {
  font: italic 900 32px Race;
}
#rotate svg {
  width: 64px;
  height: 64px;
  color: var(--yellow);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  :root {
    --rail: clamp(18px, 4.5vw, 60px);
  }
  #top {
    padding: 9px 0;
  }
  .icon-button {
    width: 34px;
    height: 34px;
  }
  .home {
    padding-bottom: 10px;
  }
  .home-group {
    width: 245px;
  }
  h1 {
    font-size: min(14vw, 16.4vh);
    margin-bottom: 18px;
  }
  .mode {
    padding: 9px 15px;
    font-size: 20px;
  }
  .mode-list {
    gap: 8px;
  }
  .link-button {
    margin-top: 9px;
  }
  .select-head {
    margin-bottom: 8px;
  }
  .select-head h2 {
    font-size: 32px;
  }
  .portrait {
    max-height: 29vh;
  }
  .player-tag {
    font-size: 13px;
    margin: 0 0 3px;
    padding: 2px 6px;
  }
  .choice-info {
    padding: 6px 10px;
  }
  .choice-info b {
    font-size: 24px;
  }
  .selection-foot {
    margin-top: 9px;
  }
  .cta {
    padding: 8px 15px;
    font-size: 18px;
  }
  .item-slot {
    width: 39px;
    height: 39px;
  }
  .item-slot svg {
    width: 24px;
  }
  .item-copy {
    font-size: 15px;
  }
  .item-hud {
    top: 8px;
  }
  .minimap {
    height: 70px;
    width: 65px;
    bottom: 22%;
  }
  #pause {
    top: 8px;
  }
  .chip {
    font-size: 18px;
    padding: 6px 7px;
  }
  .chip small {
    font-size: 11px;
  }
  .dialog {
    padding: 15px 24px;
  }
  .dialog h2 {
    margin-bottom: 9px;
  }
  .dialog-actions {
    margin-top: 10px;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  #backdrop {
    background-position: 65% center;
  }
  #backdrop:after {
    background: linear-gradient(0deg, #102f3bed 4%, #102f3b90 45%, transparent 75%);
  }
  .home {
    align-items: flex-end;
  }
  .home-group {
    width: 100%;
  }
  .mode-list {
    max-width: none;
  }
  .grid.drivers {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid.circuits {
    grid-template-columns: 1fr;
  }
  .circuits .choice {
    flex-direction: row;
    align-items: center;
  }
  .track-image {
    width: 45%;
    height: 75px;
  }
  .portrait {
    height: 18vh;
  }
  .selection-foot {
    align-items: flex-end;
  }
  .select-head h2 {
    font-size: 37px;
  }
  .selection-note {
    font-size: 12px;
  }
  .cta {
    font-size: 17px;
    padding: 10px 12px;
  }
  .chip {
    font-size: 13px;
  }
}
body.touch-racing .ranking {
  bottom: calc(max(11px, env(safe-area-inset-bottom)) + var(--pedal-size) * 1.15 + 6px);
}
body.touch-racing .telemetry {
  bottom: 78px;
}
body.touch-racing .minimap {
  bottom: auto;
  top: 17%;
  width: 66px;
  height: 84px;
}
body.touch-racing .race-toast {
  bottom: 26%;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:after,
  *:before {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.item-slot img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}
@media (max-height: 325px) and (orientation: landscape) {
  #top {
    padding: 5px 0;
  }
  .icon-button {
    width: 30px;
    height: 30px;
  }
  .wordmark {
    font-size: 19px;
  }
  .home {
    align-items: center;
    padding: 0 var(--rail) 8px;
  }
  .home-group {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 24px;
    width: min(53%, 450px);
  }
  h1 {
    font-size: clamp(45px, 9.6vh, 76px);
    margin: 0;
  }
  .mode-list {
    gap: 6px;
  }
  .mode {
    padding: 7px 9px;
    font-size: 17px;
    gap: 6px;
  }
  .link-button {
    grid-column: 2;
    font-size: 14px;
    margin: 5px 0 0;
  }
  .selection {
    padding-top: 0;
    padding-bottom: 6px;
  }
  .select-head {
    align-items: center;
    margin-bottom: 6px;
  }
  .select-head > div {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .select-head h2 {
    font-size: 26px;
  }
  .player-tag {
    margin: 0;
  }
  .back {
    padding: 4px 8px;
  }
  .portrait,
  .track-image {
    height: 25vh;
  }
  .choice-info {
    padding: 4px 9px;
  }
  .choice-info b {
    font-size: 20px;
  }
  .choice-info small {
    font-size: 11px;
  }
  .selection-foot {
    margin-top: 8px;
  }
  .selection-note {
    font-size: 11.5px;
  }
  .cta {
    font-size: 16px;
    padding: 6px 12px;
  }
  .touch-cluster button {
    font-size: 14px;
  }
  #game { --pedal-size: 43px; }
  .touch-cluster {
    gap: 5px;
  }
  body.touch-racing .telemetry {
    bottom: 58px;
  }
}

.start-hint {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 7px;
  background: #102f3bd9;
  box-shadow: 0 2px 4px #0002;
  color: white;
  font:
    700 clamp(13px, 1.4vw, 19px) Barlow,
    sans-serif;
}
.drift-meter {
  position: absolute;
  bottom: max(65px, calc(env(safe-area-inset-bottom) + 55px));
  left: clamp(10px, 2vw, 32px);
  width: 92px;
  padding: 2px 7px 6px;
  border-radius: 5px;
  color: white;
  background: #102f3be0;
  font:
    700 14px Barlow,
    sans-serif;
  text-align: center;
}
.drift-meter i {
  display: block;
  background: linear-gradient(90deg, var(--spark) var(--charge), #64777d var(--charge));
  height: 3px;
  margin-top: 1px;
}
body.touch-racing .drift-meter {
  left: 50%;
  transform: translateX(-50%);
  bottom: max(8px, env(safe-area-inset-bottom));
}
@media (max-width: 640px) {
  .start-hint {
    font-size: 12px;
  }
}

#modal > .win-celebration,
#modal .podium-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#modal > .win-celebration { z-index: 0; }
#modal .podium-confetti { z-index: 1; }

body[data-screen='race']:has(#modal[data-dialog]) :is(#hud, #pause) {
  visibility: hidden;
}
