@font-face {
  font-family: Barlow;
  src: url("./assets/ui.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Race;
  src: url("./assets/display.woff") format("woff");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #181d1b;
  --cream: #f4efe0;
  --red: #ef5138;
  --line: #e5dfcc3d;
  --safeT: max(17px, env(safe-area-inset-top));
  --safeB: max(17px, env(safe-area-inset-bottom));
  font-family: Barlow, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  overscroll-behavior: none;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#app {
  position: relative;
  isolation: isolate;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus-visible,
select:focus-visible {
  outline: 3px solid #ffca77;
  outline-offset: 3px;
}
button:active {
  filter: brightness(0.84);
}
button:disabled {
  cursor: wait;
  opacity: 0.68;
}
button[hidden],
[hidden] {
  display: none !important;
}
.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
#world,
.screen,
#hud,
.overlay,
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#world,
#hud,
#touch {
  touch-action: none;
}
#world {
  display: block;
}
#garage {
  overflow: hidden;
  background: #292924;
}
.cover {
  background-image:
    linear-gradient(0deg, #131816ad, transparent 46%),
    linear-gradient(90deg, #151a17d6 0%, #171b1992 26%, #181b1819 57%, transparent 76%),
    url("./assets/paddock.webp");
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.garage-head {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(4.8vw, env(safe-area-inset-left));
  right: max(3.5vw, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.marque {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px #0008;
}
.marque b {
  font-weight: 600;
  color: #ded7c9;
}
.strakes {
  display: flex;
  align-items: center;
  gap: 3px;
  transform: skewX(-26deg);
}
.strakes i {
  display: block;
  width: 7px;
  height: 19px;
  background: var(--red);
}
.strakes i:first-child {
  width: 3px;
}
.strakes i:nth-child(2) {
  width: 5px;
}
.icon {
  height: 43px;
  width: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #e4decd60;
  background: #202421ae;
  border-radius: 50%;
  color: var(--cream);
}
.icon:hover,
.minor:hover,
.text-btn:hover {
  background-color: #454640;
}
.garage-body {
  position: absolute;
  left: max(6.1vw, env(safe-area-inset-left));
  bottom: clamp(58px, 13.2vh, 164px);
  max-width: min(610px, 69vw);
}
.location,
.sheet-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  font-size: 11px;
}
.location svg {
  width: 15px;
  height: 15px;
  color: #f69b7f;
}
.location span {
  opacity: 0.48;
}
.garage-body h1 {
  font:
    italic 800 clamp(86px, 11.9vw, 190px) / 0.86 Race,
    Impact,
    sans-serif;
  letter-spacing: -0.032em;
  white-space: nowrap;
  margin: 14px 0 30px -0.04em;
  text-shadow: 0 2px 20px #1b17152b;
}
.garage-body h1 em {
  color: #ff6548;
  font: inherit;
}
.mode-tabs {
  display: inline-flex;
  border-bottom: 1px solid #efe4ce65;
  gap: 23px;
}
.mode-tabs button {
  background: none;
  padding: 0 0 9px;
  color: #dbd5c6;
  font-size: 17px;
  font-weight: 650;
  position: relative;
}
.mode-tabs button[aria-pressed="true"] {
  color: #fff5de;
}
.mode-tabs button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
}
.event-spec {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 17px 0 25px;
  font-size: 14px;
  color: #dbd5c8;
  letter-spacing: 0.03em;
}
.event-spec span + span::before {
  content: "·";
  margin-right: 14px;
  color: #baafa1;
}
.event-spec b {
  font-weight: 700;
  color: #fff6e6;
}
.garage-actions,
.sheet-actions,
.race-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary,
.minor,
.text-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  min-height: 49px;
  padding: 0 20px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
}
.primary {
  min-width: 156px;
  justify-content: space-between;
  background: var(--red);
  color: #171b19;
}
.primary:hover {
  background: #ff7252;
}
.primary svg {
  width: 21px;
}
.minor {
  background: #202522b5;
  color: #f3ecda;
  border: 1px solid #f5eddb55;
}
.minor svg {
  width: 18px;
}
.text-btn {
  background: none;
  color: #c4c3b5;
  min-height: 36px;
}
.track-card {
  position: absolute;
  right: 4.8vw;
  bottom: max(33px, 5.2vh);
  width: 156px;
  display: flex;
  align-items: flex-end;
  flex-flow: column;
  gap: 8px;
  text-shadow: 0 1px 6px #000;
}
.track-card div {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.track-card b {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #d6cbbb;
}
.track-card canvas {
  width: 103px;
  height: 68px;
}
.track-card span {
  white-space: nowrap;
}
#loading {
  font-size: 12px;
  position: absolute;
  top: 100%;
  margin-top: 9px;
  color: #ddd2bd;
}
#hud {
  pointer-events: none;
  user-select: none;
  padding: var(--safeT) 22px var(--safeB);
}
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.dark-panel {
  background: linear-gradient(120deg, #19211ff0, #202723c7);
  border: 1px solid #cfc7b641;
  border-radius: 5px;
  color: #fcf6e6;
}
.timing {
  display: flex;
  padding: 9px 13px 8px;
  gap: 15px;
  border-left: 3px solid var(--red);
}
.timing > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.timing > div + div {
  border-left: 1px solid #ddcfb836;
  padding-left: 14px;
}
.timing small,
#lapClock span,
.tele-bottom,
.gear small,
.result-stats small,
#turnDistance {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #d0cdbb;
}
.timing b {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.timing strong {
  font:
    italic 800 30px/0.98 Race,
    Impact,
    sans-serif;
}
.timing i {
  font:
    600 13px Barlow,
    Arial;
  color: #d0cabb;
}
.race-actions {
  pointer-events: auto;
}
.race-actions .icon {
  border-radius: 5px;
  background: #19211fd9;
}
#lapClock {
  position: absolute;
  top: calc(var(--safeT) + 68px);
  left: 22px;
  padding: 7px 10px;
  min-width: 98px;
  display: grid;
  gap: 1px;
}
#lapClock b {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}
#lapClock small {
  color: #cfcebc;
  font-size: 10px;
}
.tele-bottom {
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  letter-spacing: 0.1em;
}
#mapPanel {
  position: absolute;
  bottom: var(--safeB);
  left: 23px;
  filter: drop-shadow(0 1px 3px #21201b);
}
#raceMap {
  width: 150px;
  height: 99px;
}
#telemetry {
  position: absolute;
  bottom: var(--safeB);
  right: 22px;
  padding: 7px 13px 9px;
  min-width: 162px;
  border-top: 2px solid #f4e7cd;
}
.speed-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.speed-line > b {
  font:
    italic 800 60px/0.95 Race,
    Impact,
    sans-serif;
  font-variant-numeric: tabular-nums;
  min-width: 65px;
}
.speed-line > span {
  font-size: 11px;
  text-transform: uppercase;
}
.gear {
  align-self: center;
  margin-left: auto;
  display: grid;
  justify-items: center;
  gap: 1px;
}
.gear strong {
  font: italic 800 23px/1 Race;
  border: 1px solid #babca6;
  border-radius: 3px;
  padding: 1px 5px 2px;
}
.gear small {
  font-size: 7px;
}
.tach {
  height: 4px;
  margin-top: 5px;
  background: #83847864;
  position: relative;
  overflow: hidden;
}
.tach div {
  height: 100%;
  width: 100%;
  transform: scaleX(0.12);
  transform-origin: left;
  background: linear-gradient(90deg, #d5d6ba 45%, #e4a55f 78%, #fc583b 95%);
}
.tach::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 7%, #252a25 7% 8%);
}
#corner,
#flag,
#lights {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
#corner {
  top: var(--safeT);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 8px;
  color: #faf4e5;
  background: #1a211ecf;
  border: 1px solid var(--line);
  border-radius: 4px;
}
#turnSign {
  font-size: 29px;
  line-height: 1;
  color: #ffd6a2;
}
#corner > div {
  display: grid;
  gap: 1px;
  text-align: left;
  white-space: nowrap;
}
#turnName {
  font-size: 16px;
}
#turnDistance {
  font-size: 8px;
}
#flag {
  bottom: calc(var(--safeB) + 28px);
  padding: 6px 11px;
  border-radius: 2px;
  background: #202622d9;
  color: #ffd3a0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
#lights {
  top: 28%;
  background: #18201fda;
  border: 1px solid #fff4ca50;
  padding: 10px 15px 7px;
  border-radius: 5px;
}
.bulbs {
  display: flex;
  gap: 6px;
}
.bulbs i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #494b42;
  box-shadow: inset 0 1px 3px #121610;
}
.bulbs i.on {
  background: #ff6547;
  box-shadow: 0 0 9px #f3341f;
}
.bulbs i.go {
  background: #a8e68b;
}
#signal {
  display: block;
  font: italic 800 32px/1 Race;
  margin-top: 4px;
}
#touch {
  display: none;
  position: absolute;
  bottom: var(--safeB);
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.steering,
.pedals {
  display: flex;
  align-items: center;
  gap: 6px;
}
#touch button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: grid;
  place-items: center;
  width: 53px;
  height: 52px;
  border-radius: 7px;
  background: #1a211ed9;
  color: #f4eddb;
  border: 1px solid #e7e1cf79;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}
#touch .brake {
  border-color: #ef8c6c;
  color: #ffd0b8;
}
#touch button[data-held="true"] {
  background: #e45a3e;
  color: #191c19;
}
#touch .gas {
  color: #c6edb8;
  border-color: #b4d799;
}
.flip {
  transform: scaleX(-1);
}
.overlay {
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 15px max(12px, env(safe-area-inset-bottom));
  background: #121817ad;
  backdrop-filter: blur(4px);
  z-index: 8;
}
.sheet {
  width: min(100%, 395px);
  max-height: 100%;
  overflow: auto;
  background: #212722;
  color: #f4eedd;
  border: 1px solid #89907c74;
  border-top: 3px solid var(--red);
  border-radius: 6px;
  padding: 24px 25px 21px;
  box-shadow: 0 12px 60px #0005;
}
.sheet-kicker {
  font-size: 9px;
  color: #c2c3ad;
}
.sheet h2 {
  font:
    italic 800 48px/0.98 Race,
    Impact,
    sans-serif;
  letter-spacing: -0.02em;
  margin: 6px 0 18px;
}
.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid #d3ccaf29;
  font-size: 14px;
}
.option select {
  font: inherit;
  background: #343c33;
  border: 1px solid #ced0b34b;
  border-radius: 3px;
  padding: 4px 5px;
}
.controls-help {
  font-size: 12px;
  color: #d4d0bb;
  line-height: 1.75;
  margin: 13px 0 5px;
}
.fingers {
  display: none;
}
kbd {
  font: inherit;
  color: #fff9ea;
  background: #394038;
  border: 1px solid #9f9f8655;
  border-radius: 2px;
  padding: 0 3px;
}
.sheet-actions {
  flex-wrap: wrap;
  margin-top: 17px;
}
.sheet-actions .primary {
  justify-content: center;
  min-width: 124px;
}
.sheet-actions .minor {
  min-width: 105px;
}
.result-stats {
  display: flex;
  gap: 26px;
}
.result-stats > div {
  display: grid;
  gap: 3px;
}
.result-stats b {
  font-size: 19px;
}
.result-stats small {
  font-size: 9px;
}
#standings {
  padding: 0;
  list-style: none;
  margin: 13px 0 4px;
}
#standings li {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #cccfb32b;
  padding: 4px 0;
  font-size: 12px;
}
#standings li.me {
  color: #ff9c77;
}
#standings li span:last-child {
  margin-left: auto;
  color: #cfccb9;
  font-variant-numeric: tabular-nums;
}
#standings i {
  width: 5px;
  height: 11px;
  transform: skewX(-15deg);
}
#record {
  color: #e5c894;
  font-size: 12px;
  margin: 9px 0 0;
}
@media (pointer: coarse) {
  #touch {
    display: flex;
  }
  #telemetry {
    bottom: calc(var(--safeB) + 63px);
  }
  #mapPanel {
    bottom: calc(var(--safeB) + 68px);
  }
  .keys {
    display: none;
  }
  .fingers {
    display: block;
  }
  #flag {
    bottom: calc(var(--safeB) + 69px);
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  .cover {
    background-image:
      linear-gradient(0deg, #151a17 3%, #171c19fa 21%, #171c19d9 33%, #181b164c 54%, transparent 75%),
      url("./assets/paddock.webp");
    background-size:
      cover,
      auto 68%;
    background-position:
      center,
      76% top;
    background-repeat: no-repeat;
    background-color: #222623;
  }
  .garage-head {
    left: 21px;
    right: 18px;
    top: var(--safeT);
  }
  .marque {
    font-size: 10px;
    gap: 8px;
  }
  .strakes i {
    height: 16px;
  }
  .garage-body {
    left: 24px;
    right: 20px;
    max-width: none;
    bottom: max(7.3vh, env(safe-area-inset-bottom));
  }
  .garage-body h1 {
    font-size: clamp(82px, 23.5vw, 133px);
    margin: 9px 0 21px;
  }
  .location {
    font-size: 9px;
    letter-spacing: 0.13em;
  }
  .mode-tabs button {
    font-size: 16px;
  }
  .event-spec {
    margin: 14px 0 20px;
  }
  .garage-actions .primary {
    min-width: 139px;
  }
  .track-card {
    display: none;
  }
  #hud {
    padding: var(--safeT) 12px;
  }
  .timing {
    padding: 6px 8px 5px;
    gap: 8px;
  }
  .timing > div + div {
    padding-left: 8px;
  }
  .timing strong {
    font-size: 25px;
  }
  .timing small {
    font-size: 8px;
  }
  .race-actions {
    gap: 5px;
  }
  .race-actions .icon {
    width: 38px;
    height: 38px;
  }
  #lapClock {
    left: 12px;
    top: calc(var(--safeT) + 55px);
    min-width: 87px;
  }
  #corner {
    top: calc(var(--safeT) + 53px);
    left: auto;
    right: 12px;
    transform: none;
  }
  #mapPanel {
    left: 13px;
  }
  #raceMap {
    width: 89px;
    height: 69px;
  }
  #telemetry {
    right: 13px;
    min-width: 116px;
    padding: 5px 8px;
  }
  .speed-line > b {
    font-size: 43px;
    min-width: 48px;
  }
  .tele-bottom {
    font-size: 7px;
  }
  #flag {
    bottom: calc(var(--safeB) + 137px);
    white-space: nowrap;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .garage-head {
    top: 10px;
    left: 24px;
    right: 20px;
  }
  .garage-body {
    left: 4.8vw;
    bottom: 24px;
  }
  .garage-body h1 {
    font-size: clamp(55px, 16vh, 82px);
    margin: 5px 0 11px;
  }
  .event-spec {
    margin: 8px 0 12px;
  }
  .garage-actions button {
    min-height: 39px;
  }
  .location {
    font-size: 9px;
  }
  .track-card {
    bottom: 18px;
  }
  .mode-tabs button {
    font-size: 14px;
    padding-bottom: 5px;
  }
  #raceMap {
    width: 87px;
    height: 57px;
  }
  #telemetry {
    min-width: 105px;
    padding: 4px 7px;
  }
  .speed-line > b {
    font-size: 34px;
    min-width: 45px;
  }
  .tele-bottom {
    font-size: 7px;
  }
  .sheet {
    padding: 13px 20px;
  }
  .sheet h2 {
    font-size: 32px;
    margin: 4px 0 9px;
  }
  .option {
    min-height: 31px;
  }
  .sheet-actions {
    margin-top: 8px;
  }
  .sheet-actions button {
    min-height: 34px;
  }
  #lights {
    top: 17%;
  }
  #touch button {
    height: 43px;
    width: 53px;
  }
}
#cockpitArt {
  position: absolute;
  left: 50%;
  top: 88%;
  width: max(108vw, 100vh);
  transform: translate(-50%, calc(-57% + var(--dive, 0px))) rotate(var(--bank, 0deg));
  transform-origin: 50% 57%;
  will-change: transform;
  pointer-events: none;
  z-index: -1;
}
#hud {
  isolation: isolate;
}
#cockpitArt img {
  width: 100%;
  height: auto;
  display: block;
}
#bikeDash {
  position: absolute;
  left: 41.3%;
  top: 50.8%;
  width: 16.5%;
  height: 13.2%;
  padding: 0.8% 1%;
  color: #e3eaca;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1vw;
  container-type: inline-size;
}
#bikeDash > i {
  height: 12%;
  width: 100%;
  background: linear-gradient(90deg, #b6c7a6 50%, #e9bb61 75%, #df5a35);
  transform: scaleX(var(--rev, 0.12));
  transform-origin: left;
}
#bikeDash > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5%;
}
#bikeDash b {
  font:
    italic 800 36cqw/0.97 Race,
    Impact,
    sans-serif;
  letter-spacing: -0.04em;
}
#bikeDash small {
  font-size: 8cqw;
}
#bikeDash strong {
  font:
    italic 800 20cqw/0.95 Race,
    Impact,
    sans-serif;
  border: 1px solid #d8debf8a;
  padding: 0 3%;
}
@media (max-width: 650px) and (orientation: portrait) {
  #cockpitArt {
    top: 80%;
    width: min(175vw, 770px);
  }
}
