* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #182e42;
  color: #fff;
  font:
    16px system-ui,
    sans-serif;
  overflow: hidden;
}
button,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button,
select {
  border: 1px solid #ffffff38;
  color: inherit;
  background: #223043;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
}
button {
  cursor: pointer;
  font-weight: 750;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #ffcf57;
}
button:hover {
  filter: brightness(1.16);
}
[hidden] {
  display: none !important;
}
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#menu {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: linear-gradient(
    90deg,
    #0c1522f5 0%,
    #101a28ec 27%,
    #14223544 58%,
    transparent 78%
  );
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4vw;
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 750;
}
a {
  color: inherit;
  text-decoration: none;
}
.brand {
  border: 1px solid #ffffff56;
  padding: 7px 14px;
  border-radius: 30px;
  letter-spacing: 0.02em;
}
.garage {
  margin: 2vh 0 24px 5vw;
  width: min(400px, 89vw);
}
small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.17em;
  font-weight: 850;
  color: #ffcf78;
}
h1 {
  font-size: clamp(46px, 7.2vh, 84px);
  line-height: 0.85;
  letter-spacing: -0.075em;
  margin: 12px 0 10px;
  font-weight: 1000;
  font-style: italic;
  text-shadow: 0 2px 8px #0c152260;
}
h1 i {
  color: #ffc04f;
  font-size: 0.6em;
}
p {
  color: #d3dee6;
  font-size: 14px;
  margin: 10px 0 15px;
}
nav,
.modes,
.fieldrow,
.swatches {
  display: flex;
  gap: 7px;
}
nav {
  border-bottom: 1px solid #ffffff30;
  margin-bottom: 12px;
}
nav button {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 8px 8px;
}
nav .active {
  border-color: #ffcf65;
}
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.modes button {
  font-size: 13px;
}
.modes .active {
  color: #172136;
  background: #ffe1a1;
  border-color: #ffcd64;
}
.fieldrow {
  margin: 10px 0;
}
label {
  flex: 1;
  display: block;
  font-size: 11px;
  font-weight: 750;
  color: #d2dce3;
}
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 14px;
  color: white;
}
.preview {
  position: relative;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  background: #223043;
}
.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview div {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #091424b8, transparent);
  padding: 15px;
}
.preview strong {
  font-size: 20px;
}
.primary {
  background: #ffbf4d;
  color: #1b2330;
  border: none;
  width: 100%;
  padding: 12px;
}
.swatches {
  margin: 16px 0;
}
.swatches button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
}
.swatches .active {
  outline: 3px solid white;
}
#stats p {
  display: flex;
  justify-content: space-between;
}
progress,
input {
  accent-color: #ffc052;
}
#volumes label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}
.top,
#meters,
#map {
  position: absolute;
  background: #101d2ddd;
  border: 1px solid #fff4;
  border-radius: 14px;
}
.top {
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 14px;
}
.top b {
  font-size: 20px;
}
.top button {
  padding: 5px 9px;
}
#map {
  right: 12px;
  top: 12px;
  width: 135px;
  height: 110px;
}
#meters {
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  padding: 5px 14px;
  font-size: 12px;
}
#speed {
  font-size: 25px;
}
#item {
  margin-left: 8px;
}
#turbo {
  display: block;
  width: 100%;
  height: 5px;
}
#count {
  position: absolute;
  top: 33%;
  width: 100%;
  text-align: center;
  font-weight: 1000;
  font-style: italic;
  color: #ffe4a0;
  font-size: clamp(34px, 9vw, 110px);
  text-shadow: 0 3px 14px #172b3a;
  pointer-events: none;
}
#touch {
  pointer-events: none;
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 10px;
  right: 10px;
  display: none;
  justify-content: space-between;
  align-items: end;
}
#touch div {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px;
}
#touch button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  background: #152537c9;
  min-height: 44px;
  min-width: 48px;
}
#touch button:last-child[data-key="gas"] {
  background: #2e764be8;
}
dialog {
  border: 1px solid #ffffff40;
  background: #142237;
  color: #fff;
  border-radius: 20px;
  width: min(390px, 92vw);
  max-height: 88dvh;
  padding: 24px;
}
dialog::backdrop {
  background: #08132490;
}
#actions {
  display: grid;
  gap: 7px;
}
dialog table {
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin: 12px 0;
}
dialog td:last-child {
  text-align: right;
}
dialog h2 {
  margin: 5px 0;
}
.hints {
  line-height: 1.5;
}
#hud {
  font-variant-numeric: tabular-nums;
}
@media (pointer: coarse), (max-width: 760px) {
  #touch {
    display: flex;
  }
  #meters {
    bottom: 110px;
  }
  #map {
    width: 85px;
    height: 72px;
  }
  .top {
    gap: 7px;
    padding: 6px;
  }
  .top small {
    font-size: 8px;
  }
  .top b {
    font-size: 15px;
  }
}
@media (max-width: 560px) {
  header span {
    display: none;
  }
  .garage {
    margin: 22vh auto 16px;
    background: #142235d9;
    border-radius: 18px;
    padding: 14px;
  }
  #menu {
    background: linear-gradient(0deg, #10203070, transparent);
  }
  h1 {
    font-size: 39px;
  }
  h1 br {
    display: none;
  }
  #map {
    top: 78px;
  }
  header {
    padding: 8px 12px;
  }
  .preview {
    height: 65px;
  }
}
@media (max-height: 520px) and (min-width: 561px) {
  header {
    padding: 5px 3vw;
  }
  .garage {
    margin: 5px 0 10px 3vw;
    width: 355px;
  }
  h1 {
    font-size: 36px;
  }
  h1 br {
    display: none;
  }
  .preview {
    height: 48px;
  }
  .preview div {
    padding: 4px 10px;
  }
  .garage p {
    margin: 4px 0;
  }
  .fieldrow {
    margin: 5px 0;
  }
  nav {
    margin-bottom: 5px;
  }
  #meters {
    bottom: 8px;
  }
}
