.racing-hud {
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-left: max(22px, env(safe-area-inset-left));
  --safe-right: max(22px, env(safe-area-inset-right));
  --safe-bottom: max(22px, env(safe-area-inset-bottom));
  color: #f7f3e8;
  background: linear-gradient(
    0deg,
    #10272c2b,
    transparent 22%,
    transparent 80%,
    #0a21222b
  );
  user-select: none;
  -webkit-user-select: none;
}
.racing-hud::before {
  display: none;
}
.hud-item {
  position: absolute;
  transform-origin: top left;
}
.hud-map {
  top: var(--safe-top);
  left: var(--safe-left);
  width: 177px;
  filter: drop-shadow(0 2px 5px #051b2766);
}
.minimap-button {
  position: relative;
  display: block;
  width: 177px;
  height: 160px;
  padding: 0;
  background: #182b2ec9;
  border: 1px solid #f4f1e78c;
  overflow: hidden;
}
.minimap-button canvas {
  position: static !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.minimap-button > svg {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.minimap-north {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #f4f1e755;
  padding: 2px 4px;
}
.hud-map .gps-copy {
  display: block;
  margin: 0;
  padding: 8px 10px;
  background: #172e32d9;
  border: 1px solid #e8ebdf44;
  border-top: 0;
}
.hud-map .gps-copy b {
  font: 700 15px var(--condensed);
  letter-spacing: 0.6px;
}
.hud-map .gps-copy span {
  display: block;
  font-size: 8px;
  margin-top: 3px;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-compass {
  top: var(--safe-top);
  left: calc(50% - 215px);
  width: 430px;
  text-align: center;
  text-shadow: 0 1px 4px #12292c;
}
.compass-ticks {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 25px;
  background: repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 19px,
      #f2f2df50 19px,
      #f2f2df50 20px
    )
    bottom/100% 6px no-repeat;
  border-bottom: 1px solid #e4ebd73d;
  padding-bottom: 9px;
  font: 600 10px var(--condensed);
}
.compass-ticks b {
  color: var(--mint);
  font-weight: 700;
  min-width: 65px;
}
.compass-ticks i {
  height: 6px;
  width: 1px;
  background: #f1f2de90;
}
.compass-pointer {
  position: absolute;
  left: calc(50% - 5px);
  top: 19px;
  font-size: 14px;
  color: var(--accent);
}
.racing-hud .world-label {
  position: static;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 8px;
  letter-spacing: 1.5px;
}
.hud-race {
  top: 244px;
  left: var(--safe-left);
  width: 177px;
  text-shadow: 0 1px 4px #0b262dcc;
}
.racing-hud .race-status {
  position: static;
  width: auto;
}
.racing-hud .race-status strong {
  font-size: 43px;
}
.racing-hud .race-status strong small {
  font-size: 21px;
}
.racing-hud .race-status > div > span {
  font-size: 15px;
  line-height: 1;
}
.racing-hud .race-status p {
  font-size: 8px;
  margin: 10px 0;
  padding-bottom: 7px;
  gap: 8px;
}
#free-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#free-status[hidden],
.race-status[hidden] {
  display: none;
}
#free-status small {
  font: 700 10px var(--condensed);
  letter-spacing: 1.3px;
  color: var(--mint);
}
#free-status b {
  font: 700 19px var(--condensed);
  letter-spacing: 0.1px;
}
#free-status > span {
  font-size: 7px;
  letter-spacing: 1px;
}
.hud-quick-actions {
  top: var(--safe-top);
  right: var(--safe-right);
  display: flex;
  align-items: center;
  gap: 14px;
}
.hud-quick-actions > span {
  font-size: 7px;
  letter-spacing: 1px;
  opacity: 0.8;
}
.hud-quick-actions button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background: #1930348c;
  border: 1px solid #e2ecda28;
}
.hud-quick-actions svg {
  width: 16px;
  height: 16px;
}
.hud-quick-actions kbd {
  font-size: 7px;
  padding: 0;
  border: 0;
  background: none;
}
.hud-telemetry {
  left: var(--safe-left);
  bottom: calc(var(--safe-bottom) + 34px);
  width: 215px;
  filter: drop-shadow(0 1px 3px #0d292bcc);
}
.hud-telemetry > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hud-telemetry svg {
  width: 28px;
  height: 28px;
}
.hud-telemetry b {
  font: 700 15px var(--condensed);
  display: block;
  letter-spacing: 0.6px;
}
.hud-telemetry #hud-car-name {
  display: block;
  font-size: 7px;
  letter-spacing: 0.7px;
  margin-top: 4px;
}
.telemetry-grip {
  height: 3px;
  margin-top: 11px;
  background: #e8efda30;
}
.telemetry-grip i {
  display: block;
  height: 100%;
  background: var(--mint);
  width: 100%;
  transition: width 0.1s;
}
.telemetry-foot {
  display: flex;
  gap: 11px;
  font-size: 8px;
  letter-spacing: 0.8px;
  margin-top: 8px;
}
.telemetry-foot #tcs,
.telemetry-foot #abs {
  opacity: 0.55;
}
.telemetry-foot #tcs.active,
.telemetry-foot #abs.active {
  color: #ffb68b;
  opacity: 1;
}
.drift-chain {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 12px;
  color: #e5b58d;
  font: 700 italic 24px var(--condensed);
}
.racing-hud .speedometer {
  bottom: calc(var(--safe-bottom) + 15px);
  right: var(--safe-right);
  width: 215px;
  height: 178px;
  filter: drop-shadow(0 1px 4px #0c242ba3);
}
.racing-hud .speedometer > svg {
  position: absolute;
  inset: 0;
  width: 215px;
  height: 165px;
}
.racing-hud .rpm-track,
.racing-hud #rpm-arc {
  stroke-width: 3;
}
.racing-hud #rpm-arc {
  stroke: var(--mint);
}
.racing-hud .instruments {
  position: absolute;
  left: 17px;
  top: 66px;
  bottom: auto;
  right: 9px;
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: center;
}
.racing-hud .instruments > div {
  border-right: 1px solid #e8f0d550;
  padding-right: 12px;
  text-align: center;
}
.racing-hud #gear {
  font: 600 33px var(--condensed);
  color: var(--mint);
}
.racing-hud .instruments > div small {
  display: block;
  font-size: 6px;
  letter-spacing: 1px;
}
.racing-hud #speed {
  font: 600 68px/0.9 var(--condensed);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.racing-hud .instruments .unit {
  position: absolute;
  right: 23px;
  top: 66px;
  font-size: 8px;
  letter-spacing: 1.5px;
}
.speed-top {
  position: absolute;
  top: 24px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 13px;
  font-size: 7px;
  letter-spacing: 1px;
}
.speed-top b {
  font-weight: 400;
}
.speed-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-size: 6px;
  letter-spacing: 1.4px;
}
.speed-bottom i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint);
}
.racing-hud .drive-controls {
  position: absolute;
  left: var(--safe-left);
  right: auto;
  bottom: var(--safe-bottom);
  font-size: 8px;
  gap: 17px;
  transform: none;
  margin: 0;
  width: auto;
  justify-content: flex-start;
}
.racing-hud .drive-controls kbd {
  font-size: 7px;
}
.racing-hud #countdown {
  pointer-events: none;
  z-index: 5;
}
.racing-hud .touch-controls,
.touch-look {
  display: none;
}
.racing-hud.touch-mode .touch-controls {
  display: contents;
}
.racing-hud.touch-mode .drive-controls,
.racing-hud.touch-mode #hud-actions {
  display: none;
}
.touch-mode .touch-look {
  display: block;
  position: absolute;
  left: 23%;
  top: 20%;
  width: 54%;
  height: 71%;
  pointer-events: auto;
  touch-action: none;
  z-index: 1;
}
.touch-stick {
  position: absolute !important;
  left: calc(var(--safe-left) + 23px);
  bottom: calc(var(--safe-bottom) + 15px);
  width: 136px;
  height: 136px;
  border: 1px solid #f4f1e78c;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #152d3222 0 33%,
    #1a343b42 34% 65%,
    #f1f6e80d 66%
  );
  pointer-events: auto;
  touch-action: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.touch-stick::before,
.touch-stick::after {
  content: "";
  position: absolute;
  background: #e8f2df44;
}
.touch-stick::before {
  width: 1px;
  height: 80%;
}
.touch-stick::after {
  width: 80%;
  height: 1px;
}
.stick-label {
  position: absolute;
  bottom: 12px;
  font-size: 7px;
  letter-spacing: 2px;
  opacity: 0.85;
}
#stick-knob {
  position: absolute;
  width: 51px;
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2e8da33;
  border: 1px solid #eff6e7b3;
  box-shadow: inset 0 0 15px #f1f9e51a !important;
  z-index: 2;
  will-change: transform;
}
#stick-knob svg {
  width: 29px;
  height: 29px;
}
.touch-button {
  position: absolute !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #f4f1e78c !important;
  border-radius: 50% !important;
  background: #17303966 !important;
  color: #f7f5e9;
  width: 58px;
  height: 58px;
  touch-action: none;
  z-index: 3;
  padding: 8px !important;
  transition:
    background 0.08s,
    border-color 0.08s;
}
.touch-button svg {
  width: 25px;
  height: 25px;
}
.touch-button span {
  font:
    600 7px Barlow,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.touch-button.is-held,
.touch-stick.is-held {
  background-color: #b8d6c54d !important;
  border-color: #d6f1d2 !important;
}
.touch-button.is-held svg {
  color: #d5f8d8;
}
#touch-throttle {
  right: calc(var(--safe-right) + 13px);
  bottom: calc(var(--safe-bottom) + 6px);
  width: 83px;
  height: 102px;
  border-radius: 30px !important;
  background: #6c9b8766 !important;
}
#touch-throttle svg {
  width: 32px;
  height: 32px;
}
#touch-brake {
  right: calc(var(--safe-right) + 113px);
  bottom: calc(var(--safe-bottom) + 6px);
  width: 76px;
  height: 76px;
}
#touch-handbrake {
  right: calc(var(--safe-right) + 49px);
  bottom: calc(var(--safe-bottom) + 128px);
  width: 65px;
  height: 65px;
}
#touch-lookback {
  right: calc(var(--safe-right) + 145px);
  bottom: calc(var(--safe-bottom) + 103px);
  width: 49px;
  height: 49px;
}
#touch-camera {
  right: calc(var(--safe-right) + 12px);
  top: calc(var(--safe-top) + 66px);
  width: 43px;
  height: 43px;
}
#touch-reset {
  right: calc(var(--safe-right) + 71px);
  top: calc(var(--safe-top) + 66px);
  width: 43px;
  height: 43px;
}
#touch-map {
  right: calc(var(--safe-right) + 66px);
  top: var(--safe-top);
  width: 43px;
  height: 43px;
}
#touch-pause {
  right: calc(var(--safe-right) + 12px);
  top: var(--safe-top);
  width: 43px;
  height: 43px;
}
#touch-camera span,
#touch-reset span,
#touch-map span,
#touch-pause span {
  display: none;
}
#touch-camera svg,
#touch-reset svg,
#touch-map svg,
#touch-pause svg {
  width: 20px;
  height: 20px;
}
#touch-left,
#touch-right {
  display: none;
  bottom: calc(var(--safe-bottom) + 16px);
  width: 64px;
  height: 64px;
}
#touch-left {
  left: var(--safe-left);
}
#touch-right {
  left: calc(var(--safe-left) + 83px);
}
#touch-left span,
#touch-right span {
  display: none;
}
.button-steering #touch-stick {
  display: none;
}
.button-steering #touch-left,
.button-steering #touch-right {
  display: flex;
}
.touch-look-hint {
  position: absolute;
  bottom: var(--safe-bottom);
  left: calc(50% - 115px);
  font-size: 6px;
  letter-spacing: 1.2px;
  opacity: 0.6;
}
.touch-mode .speedometer {
  width: 174px;
  height: 146px;
  right: calc(var(--safe-right) + 28px);
  bottom: calc(var(--safe-bottom) + 228px);
}
.touch-mode .speedometer > svg {
  width: 174px;
  height: 135px;
}
.touch-mode .instruments {
  top: 52px;
  left: 12px;
  right: 6px;
  gap: 10px;
}
.touch-mode #speed {
  font-size: 52px;
}
.touch-mode #gear {
  font-size: 28px;
}
.touch-mode .instruments .unit {
  top: 53px;
  right: 16px;
  font-size: 7px;
}
.touch-mode .speed-top {
  top: 19px;
  font-size: 6px;
  gap: 9px;
}
.touch-mode .speed-bottom {
  font-size: 5px;
  letter-spacing: 1px;
}
.touch-mode .hud-telemetry {
  bottom: calc(var(--safe-bottom) + 185px);
  width: 177px;
}
.touch-mode .hud-telemetry b {
  font-size: 12px;
}
.touch-mode .hud-telemetry #hud-car-name {
  font-size: 6px;
}
.touch-mode .hud-telemetry svg {
  width: 23px;
  height: 23px;
}
.touch-mode .telemetry-foot {
  font-size: 7px;
}
.layout-stage {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: #0d242a21;
  z-index: 20;
}
.layout-lobby {
  background:
    linear-gradient(#122a3288, #122a32bb),
    url("../image/lobby/hero-day-atra-v1.webp") center/cover;
}
.layout-stage .hud {
  pointer-events: none;
}
.layout-stage .hud-editable {
  pointer-events: auto !important;
  outline: 1px dashed #dce9d48c;
  outline-offset: 4px;
  cursor: move;
  touch-action: none;
  z-index: 5;
  min-height: 25px;
}
.layout-stage .hud-editable * {
  pointer-events: none !important;
}
.layout-stage .hud-selected {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.layout-stage .hud-editable::after {
  content: attr(data-edit-label);
  position: absolute;
  left: 0;
  top: -16px;
  white-space: nowrap;
  font-size: 7px;
  letter-spacing: 0.5px;
  background: #173437c9;
  color: var(--ivory);
  padding: 2px 4px;
}
.layout-hidden {
  outline-style: dotted !important;
}
.layout-stage .touch-look,
.layout-stage .touch-look-hint,
.layout-stage .drive-controls {
  display: none;
}
.layout-stage .hud-editable#hud-race #free-status {
  display: none;
}
.layout-stage .hud-editable#hud-race .race-status {
  display: block !important;
}
.layout-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      #edecd729 50%,
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      0deg,
      transparent calc(50% - 0.5px),
      #edecd729 50%,
      transparent calc(50% + 0.5px)
    );
}
.layout-panel {
  position: absolute;
  left: calc(50% - 145px);
  top: 110px;
  width: 290px;
  background: #173035f5;
  border: 1px solid #d0dfc457;
  z-index: 10;
  pointer-events: auto;
  padding: 16px;
  color: var(--ivory);
}
.layout-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: var(--mint);
}
.layout-panel-title button {
  background: none;
  border: 1px solid #c5d8c454;
  width: 24px;
  height: 24px;
}
.layout-panel h2 {
  font: 700 26px var(--condensed);
  margin: 12px 0 16px;
}
.layout-panel label {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  margin: 12px 0;
}
.layout-panel select {
  display: block;
  width: 100%;
  margin-top: 6px;
  color: var(--ivory);
  background: #243f42;
  border: 1px solid #cad9c444;
  padding: 8px;
  font-size: 10px;
}
.layout-panel input[type="range"] {
  display: block;
  width: 100%;
  margin: 11px 0 4px;
}
.layout-panel output {
  float: right;
  color: var(--mint);
}
.layout-panel .layout-visible {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 17px;
  letter-spacing: 0.3px;
}
.layout-visible input {
  accent-color: var(--mint);
}
.layout-panel p {
  font-size: 9px;
  line-height: 1.6;
  color: #c0d2c2;
}
.layout-nudges {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.layout-nudges button {
  width: 30px;
  height: 25px;
  background: #bfd6c51a;
  border: 1px solid #cad9c444;
}
.layout-panel.collapsed .layout-panel-body {
  display: none;
}
.layout-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 55px;
  background: #10282dec;
  border-top: 1px solid #cad9c444;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 10px 22px;
  z-index: 11;
  pointer-events: auto;
}
.layout-footer > span {
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--mint);
  margin-right: auto;
}
.layout-footer select,
.layout-footer button {
  font-size: 9px;
  padding: 9px 13px;
  color: var(--ivory);
  background: #244348;
  border: 1px solid #c3dac34d;
}
.layout-footer #editor-save {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
@media (max-height: 580px) and (min-width: 701px) {
  .racing-hud {
    --safe-top: max(10px, env(safe-area-inset-top));
    --safe-left: max(14px, env(safe-area-inset-left));
    --safe-right: max(14px, env(safe-area-inset-right));
    --safe-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .touch-mode .hud-map {
    width: 125px;
  }
  .touch-mode .minimap-button {
    width: 125px;
    height: 103px;
  }
  .touch-mode .hud-map .gps-copy {
    padding: 5px 7px;
  }
  .touch-mode .gps-copy b {
    font-size: 11px;
  }
  .touch-mode .gps-copy span {
    font-size: 6px;
  }
  .touch-mode .hud-race {
    top: 151px;
    left: 158px;
    width: 138px;
  }
  .touch-mode .race-status strong {
    font-size: 28px;
  }
  .touch-mode .race-status > div > span {
    font-size: 11px;
  }
  .touch-mode .race-status p {
    font-size: 6px;
    margin: 6px 0;
    padding-bottom: 5px;
  }
  .touch-mode #free-status small {
    font-size: 8px;
  }
  .touch-mode #free-status b {
    font-size: 13px;
  }
  .touch-mode #free-status > span {
    font-size: 6px;
  }
  .hud-compass {
    left: calc(50% - 145px);
    width: 290px;
  }
  .compass-ticks {
    font-size: 8px;
  }
  .racing-hud .world-label {
    font-size: 6px;
    margin-top: 13px;
    letter-spacing: 1px;
  }
  .touch-mode .hud-telemetry {
    left: 158px;
    bottom: var(--safe-bottom);
    width: 145px;
  }
  .touch-mode .hud-telemetry svg {
    width: 19px;
    height: 19px;
  }
  .touch-mode .hud-telemetry b {
    font-size: 10px;
  }
  .touch-mode .hud-telemetry #hud-car-name {
    font-size: 5px;
  }
  .touch-mode .telemetry-grip {
    margin-top: 7px;
  }
  .touch-mode .telemetry-foot {
    font-size: 6px;
    margin-top: 5px;
  }
  .touch-mode .speedometer {
    width: 138px;
    height: 112px;
    right: 142px;
    bottom: var(--safe-bottom);
  }
  .touch-mode .speedometer > svg {
    width: 138px;
    height: 109px;
  }
  .touch-mode #speed {
    font-size: 43px;
  }
  .touch-mode #gear {
    font-size: 22px;
  }
  .touch-mode .instruments {
    top: 43px;
    gap: 8px;
    left: 6px;
    right: 4px;
  }
  .touch-mode .instruments .unit {
    top: 43px;
    right: 12px;
    font-size: 6px;
  }
  .touch-mode .speed-top {
    top: 16px;
    font-size: 5px;
    gap: 7px;
  }
  .touch-mode .speed-bottom {
    display: none;
  }
  .touch-stick {
    width: 110px;
    height: 110px;
    left: var(--safe-left);
    bottom: var(--safe-bottom);
  }
  #stick-knob {
    width: 42px;
    height: 42px;
  }
  #stick-knob svg {
    width: 25px;
    height: 25px;
  }
  .touch-button {
    width: 46px;
    height: 46px;
  }
  .touch-button svg {
    width: 21px;
    height: 21px;
  }
  .touch-button span {
    font-size: 6px;
  }
  #touch-throttle {
    width: 65px;
    height: 86px;
    right: var(--safe-right);
    bottom: var(--safe-bottom);
    border-radius: 24px !important;
  }
  #touch-brake {
    width: 57px;
    height: 57px;
    right: calc(var(--safe-right) + 76px);
    bottom: var(--safe-bottom);
  }
  #touch-handbrake {
    width: 51px;
    height: 51px;
    right: calc(var(--safe-right) + 3px);
    bottom: calc(var(--safe-bottom) + 99px);
  }
  #touch-lookback {
    width: 42px;
    height: 42px;
    right: calc(var(--safe-right) + 72px);
    bottom: calc(var(--safe-bottom) + 76px);
  }
  #touch-camera,
  #touch-reset,
  #touch-map,
  #touch-pause {
    width: 35px;
    height: 35px;
  }
  #touch-camera,
  #touch-reset {
    top: calc(var(--safe-top) + 48px);
  }
  #touch-camera,
  #touch-pause {
    right: var(--safe-right);
  }
  #touch-reset,
  #touch-map {
    right: calc(var(--safe-right) + 48px);
  }
  .touch-look-hint {
    bottom: 15px;
    font-size: 5px;
    left: calc(50% - 72px);
  }
  .layout-panel {
    top: 62px;
    left: calc(50% - 120px);
    width: 240px;
    padding: 11px;
  }
  .layout-panel h2 {
    font-size: 19px;
    margin: 6px 0;
  }
  .layout-panel label {
    font-size: 7px;
    margin: 7px 0;
  }
  .layout-panel select {
    font-size: 8px;
    padding: 4px;
  }
  .layout-panel input[type="range"] {
    margin: 7px 0 0;
  }
  .layout-panel .layout-visible {
    margin: 8px 0;
  }
  .layout-panel p {
    font-size: 7px;
    margin: 5px 0;
  }
  .layout-panel h2,
  .layout-panel .layout-nudges {
    display: none;
  }
  .layout-footer {
    min-height: 42px;
    padding: 6px 12px;
  }
  .layout-footer button,
  .layout-footer select {
    font-size: 8px;
    padding: 7px 9px;
  }
}
@media (max-width: 700px) {
  .racing-hud {
    --safe-top: max(14px, env(safe-area-inset-top));
    --safe-left: max(14px, env(safe-area-inset-left));
    --safe-right: max(14px, env(safe-area-inset-right));
    --safe-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .hud-map {
    width: 130px;
  }
  .minimap-button {
    width: 130px;
    height: 120px;
  }
  .hud-map .gps-copy {
    padding: 6px 8px;
  }
  .hud-map .gps-copy b {
    font-size: 12px;
  }
  .hud-map .gps-copy span {
    font-size: 6px;
  }
  .hud-compass {
    top: calc(var(--safe-top) + 55px);
    left: calc(50% - 40px);
    width: 180px;
  }
  .compass-ticks {
    font-size: 7px;
  }
  .compass-ticks > span:first-child,
  .compass-ticks > span:last-child {
    display: none;
  }
  .racing-hud .world-label {
    font-size: 6px;
    letter-spacing: 0.6px;
  }
  .hud-race {
    top: 200px;
    width: 160px;
  }
  .hud-telemetry {
    width: 170px;
  }
  .touch-mode .hud-telemetry {
    bottom: calc(var(--safe-bottom) + 190px);
    width: 158px;
  }
  .touch-mode .speedometer {
    right: var(--safe-right);
    bottom: calc(var(--safe-bottom) + 238px);
    width: 155px;
    height: 131px;
  }
  .touch-mode .speedometer > svg {
    width: 155px;
    height: 121px;
  }
  .touch-mode .instruments {
    top: 47px;
    left: 9px;
    gap: 8px;
  }
  .touch-mode #speed {
    font-size: 47px;
  }
  .touch-mode .instruments .unit {
    top: 49px;
    right: 13px;
  }
  .touch-mode .speed-top {
    top: 18px;
    font-size: 5px;
  }
  .touch-stick {
    width: 115px;
    height: 115px;
    left: var(--safe-left);
    bottom: calc(var(--safe-bottom) + 18px);
  }
  #stick-knob {
    width: 45px;
    height: 45px;
  }
  .touch-look-hint {
    bottom: calc(var(--safe-bottom) + 1px);
    font-size: 5px;
    left: 18px;
  }
  #touch-throttle {
    width: 66px;
    height: 93px;
    right: var(--safe-right);
  }
  #touch-brake {
    width: 60px;
    height: 60px;
    right: calc(var(--safe-right) + 81px);
  }
  #touch-handbrake {
    width: 57px;
    height: 57px;
    right: calc(var(--safe-right) + 8px);
    bottom: calc(var(--safe-bottom) + 125px);
  }
  #touch-lookback {
    width: 46px;
    height: 46px;
    right: calc(var(--safe-right) + 85px);
    bottom: calc(var(--safe-bottom) + 90px);
  }
  #touch-camera,
  #touch-reset,
  #touch-map,
  #touch-pause {
    width: 36px;
    height: 36px;
  }
  #touch-camera,
  #touch-reset {
    top: calc(var(--safe-top) + 107px);
  }
  #touch-map,
  #touch-reset {
    right: calc(var(--safe-right) + 49px);
  }
  #touch-pause,
  #touch-camera {
    right: var(--safe-right);
  }
  .layout-panel {
    top: 260px;
    width: 220px;
    left: calc(50% - 110px);
    padding: 12px;
  }
  .layout-panel h2 {
    font-size: 21px;
    margin: 8px 0;
  }
  .layout-panel label {
    margin: 9px 0;
    font-size: 7px;
  }
  .layout-panel p {
    font-size: 8px;
  }
  .layout-footer {
    flex-wrap: wrap;
    padding: 9px 12px;
    gap: 6px;
  }
  .layout-footer > span {
    display: none;
  }
  .layout-footer select {
    flex: 1;
  }
  .layout-footer select,
  .layout-footer button {
    font-size: 8px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .telemetry-grip i {
    transition: none;
  }
}
