/* Original tactile controls. Hit areas remain larger than the visible metal/rubber faces. */
#steering {
  left: max(22px, calc(env(safe-area-inset-left) + 12px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  display: block;
  width: 166px;
}
#wheel {
  width: 166px;
  height: 166px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
#wheel:focus-visible {
  outline: 2px solid #f8d69a;
  outline-offset: 2px;
}
#wheel.dragging {
  cursor: grabbing;
}
.wheel-face {
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(var(--wheel-angle, 0deg));
  transition: transform 100ms ease-out;
  filter: drop-shadow(0 3px 2px #10223b66);
}
#wheel.dragging .wheel-face {
  transition: none;
}
.wheel-caption {
  display: block;
  text-align: center;
  color: #fff0cd;
  text-shadow: 0 1px 2px #243b56;
  font-size: 10px;
  line-height: 15px;
  margin-top: -2px;
}
.right-controls {
  right: max(25px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  gap: 9px;
}
#drive-console {
  align-items: flex-end;
  gap: 12px;
}
#gear-selector {
  width: 49px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  margin-bottom: 28px;
  border: 1px solid #9ba7a6;
  border-radius: 9px;
  background: linear-gradient(120deg, #57636d, #24333e);
  box-shadow:
    0 3px 0 #172d41,
    inset 0 1px #c9cfbf;
}
#gear-selector button {
  position: relative;
  min-width: 44px;
  min-height: 45px;
  margin-left: -3px;
  border-radius: 5px;
  border: 1px solid #8d9993;
  background: linear-gradient(#394852, #192b39);
  box-shadow:
    inset 0 1px #7b8c8d,
    0 2px #112332;
  color: #a9b7b7;
  padding: 3px;
}
#gear-selector b {
  display: block;
  font:
    700 20px/21px ui-monospace,
    monospace;
}
#gear-selector small {
  display: block;
  font-size: 8px;
  line-height: 10px;
}
#gear-selector button.selected {
  color: #ffe7a6;
  border-color: #ecd49a;
  background: linear-gradient(#605f50, #303e42);
  text-shadow: 0 0 8px #ffcf7b80;
  box-shadow:
    inset 0 2px 3px #172d3a,
    0 0 6px #e8c77844;
}
#gear-selector button.selected::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe3a0;
  box-shadow: 0 0 5px #ffd188;
}
#pedals {
  display: flex;
  align-items: flex-end;
  gap: 13px;
}
#controls #pedals .pedal {
  position: relative;
  width: 84px;
  height: 142px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent !important;
  box-shadow: none;
  color: #fff0d5;
  transform: none;
  -webkit-tap-highlight-color: transparent;
}
#controls #pedals .accelerator {
  width: 62px;
}
.pedal-face {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 29px;
  height: 87px;
  transform-origin: bottom;
  transition:
    transform 50ms,
    filter 50ms;
}
.accelerator .pedal-face {
  height: 119px;
}
.pedal-face img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px #10243c80);
}
#pedals .pedal.pressed .pedal-face,
#pedals .pedal.engaged .pedal-face {
  transform: translateY(5px) scaleY(0.94);
  filter: brightness(1.25);
}
.pedal-label {
  position: absolute;
  bottom: 0;
  left: -3px;
  right: -3px;
  font-size: 12px;
  line-height: 14px;
  text-shadow: 0 1px 2px #223a57;
}
#pedals .pedal-label small {
  font-size: 8px;
  line-height: 11px;
  letter-spacing: 1px;
  color: #f3e2c0;
}
#vehicle-info {
  bottom: 225px;
  left: 24px;
}
#desktop-help {
  left: 210px;
  right: 260px;
  font-size: 9px;
}
@media (max-height: 550px) and (orientation: landscape) {
  #desktop-help {
    display: none;
  }
  #steering {
    width: 132px;
    bottom: max(13px, calc(env(safe-area-inset-bottom) + 6px));
  }
  #wheel {
    width: 132px;
    height: 132px;
  }
  .wheel-caption {
    font-size: 8px;
    line-height: 12px;
  }
  .right-controls {
    gap: 4px;
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 6px));
  }
  #drive-console {
    gap: 9px;
  }
  #controls #pedals .pedal {
    width: 73px;
    height: 116px;
  }
  #controls #pedals .accelerator {
    width: 51px;
  }
  #pedals {
    gap: 10px;
  }
  .pedal-face {
    height: 72px;
    bottom: 24px;
  }
  .accelerator .pedal-face {
    height: 94px;
  }
  .pedal-label {
    font-size: 10px;
    line-height: 11px;
  }
  #pedals .pedal-label small {
    font-size: 7px;
    line-height: 10px;
  }
  #gear-selector {
    margin-bottom: 23px;
    padding: 3px;
    width: 46px;
    gap: 3px;
  }
  #gear-selector button {
    margin-left: -2px;
    min-height: 44px;
  }
  #gear-selector b {
    font-size: 18px;
    line-height: 19px;
  }
  #vehicle-info {
    bottom: 176px;
    left: max(24px, calc(env(safe-area-inset-left) + 12px));
    font-size: 9px;
  }
  #jobs {
    max-height: calc(100dvh - 254px);
  }
  #interact {
    min-width: 142px;
  }
}
@media (max-width: 670px) and (orientation: landscape) {
  #steering {
    left: max(10px, calc(env(safe-area-inset-left) + 6px));
    width: 112px;
  }
  #wheel {
    width: 112px;
    height: 112px;
  }
  .right-controls {
    right: max(12px, calc(env(safe-area-inset-right) + 6px));
  }
  #drive-console {
    gap: 6px;
  }
  #controls #pedals .pedal {
    width: 62px;
    height: 104px;
  }
  #controls #pedals .accelerator {
    width: 46px;
  }
  .accelerator .pedal-face {
    height: 85px;
  }
  .pedal-face {
    height: 62px;
  }
  #vehicle-info {
    bottom: 155px;
  }
}
