/* Royal Cup controls: proportions follow the 1806 x 871 reference. */
.game-hud {
  position: absolute;
  inset: 0;
  container-type: size;
  pointer-events: none;
  color: #fffef7;
  font-family: var(--label);
  --hud-gold: #ffd04a;
  --hud-edge: #f4df83;
  --hud-surface: linear-gradient(145deg, #232015ed, #090a08f5 55%, #11120bf5);
}

.hud-layout {
  position: absolute;
  inset: 0;
  --hud-unit: min(0.05537099cqw, 0.11481056cqh);
}

.game-hud button {
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
}

.game-hud button:focus-visible {
  outline: calc(3 * var(--hud-unit)) solid #fff8c9;
  outline-offset: calc(5 * var(--hud-unit));
}

.game-hud .hud-panel {
  background: var(--hud-surface);
  border: calc(1.7 * var(--hud-unit)) solid var(--hud-edge);
  box-shadow:
    inset 0 0 calc(12 * var(--hud-unit)) #f9cc3a0b,
    0 calc(3 * var(--hud-unit)) calc(8 * var(--hud-unit)) #1a10094d,
    0 0 calc(10 * var(--hud-unit)) #ffce4d24;
}

.game-hud svg {
  display: block;
  flex-shrink: 0;
}

.game-hud kbd {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: calc(1.5 * var(--hud-unit)) solid #f5dc74;
  border-radius: calc(4 * var(--hud-unit));
  background: linear-gradient(#181910, #070805);
  box-shadow: inset 0 0 calc(3 * var(--hud-unit)) #ffe49038;
  color: #fffef4;
  font-family: var(--label);
  font-weight: 500;
  line-height: 1;
}

.race-info {
  position: absolute;
  left: calc(39 * var(--hud-unit));
  top: calc(21 * var(--hud-unit));
  width: calc(220 * var(--hud-unit));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  filter: drop-shadow(
    0 calc(2 * var(--hud-unit)) calc(3 * var(--hud-unit)) #0003
  );
}

.position-panel {
  height: calc(125 * var(--hud-unit));
  border-radius: calc(21 * var(--hud-unit));
  padding: calc(10 * var(--hud-unit)) calc(25 * var(--hud-unit));
}

.position-panel small {
  display: block;
  color: #fff3b5;
  font: 500 calc(21 * var(--hud-unit))/1.25 var(--label);
}

.position-panel strong {
  display: flex;
  align-items: baseline;
  gap: calc(15 * var(--hud-unit));
  margin-top: calc(-5 * var(--hud-unit));
  font: italic 800 calc(85 * var(--hud-unit))/0.98 var(--number);
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 calc(2 * var(--hud-unit)) calc(2 * var(--hud-unit)) #0008;
}

.position-panel strong b {
  color: var(--hud-gold);
  font-weight: 800;
}

.position-panel strong span {
  font-size: calc(68 * var(--hud-unit));
  color: #fff;
}

.hud-line {
  height: calc(50 * var(--hud-unit));
  margin-top: calc(-1 * var(--hud-unit));
  border-radius: calc(20 * var(--hud-unit));
  display: flex;
  align-items: center;
  gap: calc(22 * var(--hud-unit));
  padding: 0 calc(14 * var(--hud-unit));
  font: 500 calc(24 * var(--hud-unit))/1 var(--label);
  white-space: nowrap;
}

.hud-line > svg {
  width: calc(30 * var(--hud-unit));
  height: calc(30 * var(--hud-unit));
  color: #fff3b5;
}

.hud-line-label {
  color: #ffd26b;
}

.hud-line b {
  font-weight: 500;
}

.hud-checkpoint {
  gap: calc(8 * var(--hud-unit));
  font-size: calc(18 * var(--hud-unit));
}

.hud-timer {
  gap: calc(22 * var(--hud-unit));
  font-size: calc(26 * var(--hud-unit));
  font-weight: 600;
  letter-spacing: calc(0.4 * var(--hud-unit));
}

.hud-timer svg {
  color: #fff;
}

.hud-timer time {
  font-variant-numeric: tabular-nums;
}

.freeride-title {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--hud-unit));
  height: calc(125 * var(--hud-unit));
  padding: calc(15 * var(--hud-unit));
  border-radius: calc(21 * var(--hud-unit));
  font: 500 calc(26 * var(--hud-unit))/1.2 var(--label);
  color: #fff3b5;
}

.freeride-title svg {
  width: calc(36 * var(--hud-unit));
  height: calc(36 * var(--hud-unit));
  color: var(--hud-gold);
}

.game-pause-button {
  position: static;
  margin-top: calc(-1 * var(--hud-unit));
  width: calc(220 * var(--hud-unit));
  height: calc(50 * var(--hud-unit));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(19 * var(--hud-unit));
  border-radius: calc(16 * var(--hud-unit));
  font: 500 calc(23 * var(--hud-unit))/1 var(--label);
}

.game-pause-button svg {
  width: calc(27 * var(--hud-unit));
  height: calc(27 * var(--hud-unit));
  color: #ffe18a;
}

.game-pause-button kbd {
  width: calc(47 * var(--hud-unit));
  height: calc(30 * var(--hud-unit));
  font-size: calc(19 * var(--hud-unit));
}

.minimap-wrap {
  position: absolute;
  top: calc(17 * var(--hud-unit));
  right: calc(18 * var(--hud-unit));
  width: calc(294 * var(--hud-unit));
  height: calc(294 * var(--hud-unit));
  padding: calc(6 * var(--hud-unit));
  border: calc(4 * var(--hud-unit)) solid #ffd46b;
  border-radius: 50%;
  background: #0c0f08;
  box-shadow:
    0 0 0 calc(2 * var(--hud-unit)) #252214,
    inset 0 0 0 calc(1 * var(--hud-unit)) #fff2b0,
    0 calc(3 * var(--hud-unit)) calc(12 * var(--hud-unit)) #0008;
}

.minimap-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: calc(1.5 * var(--hud-unit)) solid #fff4bb;
  border-radius: 50%;
  background: #31591c;
}

.map-button {
  position: absolute;
  right: calc(24 * var(--hud-unit));
  bottom: calc(19 * var(--hud-unit));
  width: calc(44 * var(--hud-unit));
  height: calc(44 * var(--hud-unit));
  display: grid;
  place-items: center;
  padding: 0 0 calc(3 * var(--hud-unit));
  border: calc(2 * var(--hud-unit)) solid #f9d766;
  border-radius: 50%;
  background: #0e1109f5;
  color: #ffe69b !important;
  font:
    400 calc(37 * var(--hud-unit))/1 Arial,
    sans-serif;
  box-shadow: 0 calc(2 * var(--hud-unit)) calc(5 * var(--hud-unit)) #0008;
}

.objective {
  position: absolute;
  top: calc(278 * var(--hud-unit));
  right: calc(44 * var(--hud-unit));
  width: calc(231 * var(--hud-unit));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.objective-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(9 * var(--hud-unit));
  min-width: calc(151 * var(--hud-unit));
  min-height: calc(39 * var(--hud-unit));
  max-width: 100%;
  padding: calc(5 * var(--hud-unit)) calc(13 * var(--hud-unit));
  border-radius: calc(23 * var(--hud-unit));
  font: 500 calc(19 * var(--hud-unit))/1.15 var(--label);
  text-align: center;
}

.objective-icon svg {
  width: calc(28 * var(--hud-unit));
  height: calc(28 * var(--hud-unit));
  color: var(--hud-gold);
}

.objective p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(15 * var(--hud-unit));
  width: 100%;
  min-height: calc(43 * var(--hud-unit));
  margin-top: calc(-1 * var(--hud-unit));
  padding: calc(6 * var(--hud-unit)) calc(14 * var(--hud-unit));
  border-radius: calc(24 * var(--hud-unit));
  font: 500 calc(18 * var(--hud-unit))/1.2 var(--label);
  text-transform: uppercase;
}

.objective p svg {
  width: calc(27 * var(--hud-unit));
  height: calc(27 * var(--hud-unit));
  color: #fff0a8;
}

.steering {
  position: absolute;
  left: calc(40 * var(--hud-unit));
  bottom: calc(41 * var(--hud-unit));
  width: calc(360 * var(--hud-unit));
  height: calc(81 * var(--hud-unit));
  display: grid;
  grid-template-columns: 1fr calc(2 * var(--hud-unit)) 1fr;
  align-items: center;
  padding: calc(10 * var(--hud-unit)) calc(18 * var(--hud-unit));
  border-radius: calc(45 * var(--hud-unit));
}

.steering button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(24 * var(--hud-unit));
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: calc(24 * var(--hud-unit));
  background: transparent;
}

.steering button:first-child {
  padding-right: calc(26 * var(--hud-unit));
}

.steering button:last-child {
  padding-left: calc(30 * var(--hud-unit));
}

.steering button svg {
  width: calc(43 * var(--hud-unit));
  height: calc(48 * var(--hud-unit));
  color: var(--hud-gold);
}

.steering kbd {
  width: calc(44 * var(--hud-unit));
  height: calc(44 * var(--hud-unit));
  font-size: calc(29 * var(--hud-unit));
}

.steering-divider {
  width: 100%;
  height: calc(44 * var(--hud-unit));
  background: linear-gradient(#5f605c, #85867d, #54564d);
}

.stamina-panel {
  position: absolute;
  left: 50%;
  bottom: calc(33 * var(--hud-unit));
  transform: translateX(-50%);
  width: calc(712 * var(--hud-unit));
  height: calc(106 * var(--hud-unit));
  display: flex;
  align-items: center;
  gap: calc(19 * var(--hud-unit));
  padding: calc(17 * var(--hud-unit)) calc(27 * var(--hud-unit))
    calc(17 * var(--hud-unit)) calc(20 * var(--hud-unit));
  border-radius: calc(32 * var(--hud-unit));
  border-width: calc(2.5 * var(--hud-unit)) !important;
  border-color: #f4cf61 !important;
  box-shadow:
    inset 0 0 calc(8 * var(--hud-unit)) #ffdc341a,
    0 calc(2 * var(--hud-unit)) calc(10 * var(--hud-unit)) #eab43d77,
    0 calc(3 * var(--hud-unit)) calc(8 * var(--hud-unit)) #0006 !important;
}

.bolt svg {
  width: calc(60 * var(--hud-unit));
  height: calc(78 * var(--hud-unit));
  color: var(--hud-gold);
  filter: drop-shadow(
    0 calc(2 * var(--hud-unit)) calc(1 * var(--hud-unit)) #0008
  );
}

.stamina-track {
  flex: 1;
  height: calc(53 * var(--hud-unit));
  padding: calc(4 * var(--hud-unit));
  border: calc(3 * var(--hud-unit)) solid #fff0a3;
  border-radius: calc(29 * var(--hud-unit));
  background: #080b07;
  box-shadow: 0 0 0 calc(1 * var(--hud-unit)) #000;
  overflow: hidden;
}

.stamina-main {
  position: relative;
  height: 100%;
  border-radius: calc(21 * var(--hud-unit));
  overflow: hidden;
  background: linear-gradient(#30322f, #20221f);
}

.stamina-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(105deg, #ffd14b, #ffce45 65%, #ffe16c);
  transition: width 0.12s linear;
}

.stamina-segments {
  position: absolute;
  inset: 0;
}

.stamina-segments i {
  position: absolute;
  top: -15%;
  height: 130%;
  width: calc(4 * var(--hud-unit));
  transform: skewX(-15deg);
  background: #0b0d08;
}

.stamina-segments i:nth-child(1) {
  left: 16.6667%;
}
.stamina-segments i:nth-child(2) {
  left: 33.3333%;
}
.stamina-segments i:nth-child(3) {
  left: 50%;
}
.stamina-segments i:nth-child(4) {
  left: 66.6667%;
}
.stamina-segments i:nth-child(5) {
  left: 83.3333%;
}

.low-stamina .stamina-fill {
  background: linear-gradient(105deg, #ffae38, #f48228);
}

.ride-actions {
  position: absolute;
  right: calc(213 * var(--hud-unit));
  bottom: calc(38 * var(--hud-unit));
  display: flex;
  gap: calc(16 * var(--hud-unit));
}

.ride-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: calc(124 * var(--hud-unit));
  height: calc(107 * var(--hud-unit));
  padding: calc(11 * var(--hud-unit)) calc(17 * var(--hud-unit));
  border-radius: calc(25 * var(--hud-unit));
}

.ride-action > svg {
  width: calc(56 * var(--hud-unit));
  height: calc(43 * var(--hud-unit));
  color: var(--hud-gold);
}

.ride-action[data-action="jump"] > svg {
  width: calc(64 * var(--hud-unit));
}

.ride-action kbd {
  width: calc(68 * var(--hud-unit));
  height: calc(32 * var(--hud-unit));
  font-size: calc(21 * var(--hud-unit));
}

.game-hud button:is(:hover, :active, .active) {
  filter: brightness(1.14);
}

.game-hud .ride-action:is(:active, .active),
.steering button:active {
  background: linear-gradient(145deg, #70521cee, #2d250df5);
  box-shadow: inset 0 0 calc(16 * var(--hud-unit)) #ffcf4a40;
}

.speedometer {
  position: absolute;
  right: calc(21 * var(--hud-unit));
  bottom: calc(21 * var(--hud-unit));
  width: calc(164 * var(--hud-unit));
  height: calc(164 * var(--hud-unit));
  display: grid;
  place-items: center;
  border: calc(3 * var(--hud-unit)) solid #ffd46a;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #24241c, #0a0c08 70%);
  box-shadow:
    0 0 0 calc(2 * var(--hud-unit)) #252214,
    inset 0 0 0 calc(4 * var(--hud-unit)) #070a05,
    0 calc(3 * var(--hud-unit)) calc(10 * var(--hud-unit)) #0006;
}

.speedometer > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.speed-track {
  fill: none;
  stroke: #fff0aa;
  stroke-width: 1.5;
}

.speed-active {
  fill: none;
  stroke: #ffd148;
  stroke-width: 3;
  stroke-dasharray: 0 478;
  transition: stroke-dasharray 0.12s linear;
}

.major-tick {
  stroke: #fff2c0;
  stroke-width: 1.5;
}

.minor-tick {
  stroke: #c8b36a;
  stroke-width: 1;
}

.speed-label {
  position: relative;
  margin-top: calc(4 * var(--hud-unit));
  text-align: center;
  text-shadow: 0 calc(2 * var(--hud-unit)) calc(2 * var(--hud-unit)) #0008;
}

.speed-label strong {
  display: block;
  font: italic 800 calc(68 * var(--hud-unit))/0.98 var(--number);
  color: #fff;
  letter-spacing: 0;
}

.speed-label small {
  display: block;
  font: 500 calc(21 * var(--hud-unit))/1.1 var(--label);
}

.hud-hidden
  :is(
    .race-info > :not(.game-pause-button),
    .minimap-wrap,
    .objective,
    .stamina-panel,
    .speedometer
  ) {
  display: none;
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font: italic 900 calc(154 * var(--hud-unit))/1 var(--number);
  text-shadow: 0 calc(5 * var(--hud-unit)) calc(10 * var(--hud-unit)) #0007;
  color: #fff;
}

.jump-notice {
  position: absolute;
  left: 50%;
  top: calc(170 * var(--hud-unit));
  transform: translateX(-50%);
  display: none;
  max-width: 50%;
  padding: calc(9 * var(--hud-unit)) calc(22 * var(--hud-unit));
  border: calc(1.5 * var(--hud-unit)) solid var(--hud-edge);
  border-radius: calc(16 * var(--hud-unit));
  background: var(--hud-surface);
  color: #fff3b5;
  font: 500 calc(20 * var(--hud-unit))/1.2 var(--label);
  text-align: center;
}

.jump-notice.visible {
  display: block;
}

/* Portrait keeps the same controls within thumb reach, on two bottom rows. */
@media (max-aspect-ratio: 4/5) {
  .hud-layout {
    --hud-unit: clamp(0.42px, 0.12cqh, 0.7px);
  }
  .race-info {
    left: 12px;
    top: 12px;
  }
  .game-pause-button {
    width: 100%;
  }
  .minimap-wrap {
    right: 12px;
    top: 12px;
    width: min(40cqw, 190px);
    height: min(40cqw, 190px);
  }
  .objective {
    right: 12px;
    top: calc(min(40cqw, 190px) - 4px);
    width: min(calc(100% - 180px), 205px);
  }
  .objective-header {
    font-size: 12px;
  }
  .objective p {
    font-size: 11px;
    gap: 6px;
  }
  .stamina-panel {
    left: 12px;
    bottom: 100px;
    width: calc(100% - 24px);
    height: 56px;
    transform: none;
    padding: 7px 13px;
    gap: 9px;
    border-radius: 19px;
  }
  .bolt svg {
    width: 30px;
    height: 42px;
  }
  .stamina-track {
    height: 29px;
    padding: 3px;
    border-width: 2px;
  }
  .steering {
    left: 12px;
    bottom: 24px;
    width: calc(100% - 212px);
    min-width: 96px;
    height: 58px;
    padding: 6px;
  }
  .steering button {
    gap: 0;
    justify-content: space-around;
  }
  .steering button:first-child,
  .steering button:last-child {
    padding: 0;
  }
  .steering button svg {
    width: 23px;
    height: 27px;
  }
  .steering kbd {
    width: 23px;
    height: 28px;
    font-size: 18px;
  }
  .steering-divider {
    height: 30px;
  }
  .ride-actions {
    right: 94px;
    bottom: 24px;
    gap: 7px;
  }
  .ride-action {
    width: 46px;
    height: 58px;
    padding: 5px 3px;
    border-radius: 14px;
  }
  .ride-action > svg {
    width: 30px;
    height: 26px;
  }
  .ride-action[data-action="jump"] > svg {
    width: 35px;
  }
  .ride-action kbd {
    width: 37px;
    height: 20px;
    font-size: 12px;
  }
  .speedometer {
    right: 12px;
    bottom: 19px;
    width: 73px;
    height: 73px;
  }
  .speed-label strong {
    font-size: 31px;
  }
  .speed-label small {
    font-size: 11px;
  }
  .jump-notice {
    top: 44%;
    max-width: 85%;
  }
}

.pause-shade {
  position: absolute;
  inset: 0;
  background: #080d16a6;
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
}

.pause-panel {
  width: 490px;
  min-height: 460px;
  background: #fff;
  padding: 36px 41px;
  border-top: 7px solid var(--pink);
}

.pause-panel h1 {
  font: 400 57px var(--display);
  margin: 12px 0 25px;
}

.pause-panel .action {
  display: block;
  text-align: left;
  width: 100%;
  margin: 8px 0;
  padding: 12px 17px;
}

.results-panel {
  width: 710px;
  background: #fff;
  padding: 40px 48px;
  border-top: 8px solid var(--pink);
}

.results-panel h1 {
  font: 800 italic 65px/1 var(--number);
  margin: 17px 0;
}

.result-number {
  font: 400 115px/1 var(--display);
  color: var(--pink);
}

.results-metrics {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.results-metrics strong {
  font: 400 31px var(--display);
  display: block;
}

.results-metrics span {
  font: 500 13px var(--label);
  letter-spacing: 1px;
  color: #777;
}

.standings {
  border-top: 1px solid #ccc;
  padding-top: 12px;
  font: 14px/1.8 var(--body);
}

.standings .player {
  color: var(--pink);
  font-weight: bold;
}

.expanded-map {
  width: 760px;
  height: 760px;
  background: #fff;
  border: 4px solid #fff;
  position: relative;
}

.expanded-map canvas {
  width: 752px;
  height: 752px;
}

.expanded-map .map-close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: #111;
  color: white;
  padding: 10px 17px;
  font: 500 17px var(--label);
}

.expanded-map .map-label {
  position: absolute;
  left: 24px;
  top: 24px;
  color: white;
  background: #111b;
  padding: 10px 15px;
  font: 600 21px var(--label);
}

/* Generated ivory-and-gold HUD assets on transparent circular touch controls. */
.game-hud {
  --control-size: clamp(52px, 6.2vmin, 88px);
}

.game-hud .steering {
  display: flex;
  gap: 12px;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.game-hud .round-control,
.game-hud .steering .round-control {
  display: grid;
  place-items: center;
  flex: 0 0 var(--control-size);
  width: var(--control-size);
  height: var(--control-size);
  min-width: 44px;
  min-height: 44px;
  padding: 3px;
  border: 1px solid #f4df8390;
  border-radius: 50%;
  background: #09130e30;
  box-shadow:
    inset 0 0 12px #fff8e910,
    0 3px 10px #0004;
  backdrop-filter: blur(3px);
  transition:
    background 0.12s,
    box-shadow 0.12s,
    transform 0.12s;
}

.game-hud .round-control:is(:active, .active) {
  background: #f3c75f30;
  box-shadow:
    inset 0 0 16px #ffd36a50,
    0 0 18px #f3c75f55;
  transform: scale(0.95);
}

.riding-icon {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("../assets/ui/riding-controls-v2.webp");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #0008);
}

.riding-icon-left {
  background-position: 0 0;
}

.riding-icon-right {
  background-position: 100% 0;
}

.riding-icon-sprint {
  background-position: 0 100%;
}

.riding-icon-jump {
  background-position: 100% 100%;
}

.game-hud .ride-actions {
  right: clamp(150px, 15vmin, 225px);
  bottom: max(22px, env(safe-area-inset-bottom));
  gap: 12px;
  align-items: center;
}

.game-hud .speedometer {
  right: max(18px, env(safe-area-inset-right));
  bottom: 18px;
  width: clamp(110px, 13vmin, 180px);
  height: clamp(110px, 13vmin, 180px);
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px #0007);
}

.speed-dial-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

#speed-needle {
  position: absolute;
  left: calc(50% - 1.5px);
  bottom: 50%;
  width: 3px;
  height: 30%;
  border-radius: 3px;
  background: linear-gradient(#fff8e9, #f3c75f);
  transform-origin: 50% 100%;
  transform: rotate(-135deg);
  box-shadow: 0 0 5px #ffcd6699;
  transition: transform 0.08s linear;
}

.game-hud .speed-label {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 53%;
  margin: 0;
  padding: 2px;
  border-radius: 9px;
  background: #07171038;
  line-height: 1;
  text-shadow: 0 2px 5px #000;
}

.game-hud .speed-label strong {
  font-size: clamp(28px, 4vmin, 49px);
  line-height: 1;
}

.game-hud .speed-label small {
  font-size: clamp(10px, 1.3vmin, 14px);
  line-height: 1.2;
}

.game-hud .stamina-panel {
  bottom: 27px;
  width: clamp(160px, 25vw, 460px);
  height: 48px;
  padding: 8px 12px;
  border-radius: 26px;
  background: #09130e4d;
  box-shadow: none;
  backdrop-filter: blur(3px);
}

.game-hud .stamina-track {
  height: 26px;
}

.game-hud .bolt svg {
  width: 22px;
  height: 30px;
}

@media (max-width: 650px) {
  .game-hud {
    --control-size: 54px;
  }
  .game-hud .steering {
    gap: 8px;
    left: 12px;
    bottom: 22px;
  }
  .game-hud .ride-actions {
    right: 12px;
    bottom: 22px;
    gap: 8px;
  }
  .game-hud .speedometer {
    right: 12px;
    bottom: 94px;
    width: 104px;
    height: 104px;
  }
  .game-hud .stamina-panel {
    left: 12px;
    bottom: 102px;
    transform: none;
    width: calc(100% - 140px);
    height: 38px;
    padding: 5px 9px;
    gap: 7px;
  }
  .game-hud .stamina-track {
    height: 23px;
  }
  .game-hud .bolt svg {
    width: 18px;
    height: 26px;
  }
}

@media (max-height: 500px) and (min-width: 651px) {
  .game-hud {
    --control-size: 50px;
  }
  .game-hud .ride-actions {
    right: 136px;
  }
  .game-hud .speedometer {
    width: 108px;
    height: 108px;
  }
  .game-hud .stamina-panel {
    width: 25vw;
    height: 36px;
    bottom: 22px;
  }
}

.game-hud .round-control {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.game-hud .round-control > .riding-icon {
  position: absolute;
  inset: 3px;
  width: auto;
  height: auto;
}

.game-hud .game-pause-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 7px;
  margin-top: 8px;
  border: 1px solid #f4df8390;
  border-radius: 50%;
  background: #09130e30;
  box-shadow: 0 3px 10px #0004;
  backdrop-filter: blur(3px);
}

.game-pause-button > img,
.map-button > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.game-hud .map-button {
  width: 38px;
  height: 38px;
  right: 13%;
  bottom: 7%;
  padding: 7px;
  background: #09130e55;
  border: 1px solid #f4df8390;
  box-shadow: 0 3px 10px #0004;
  backdrop-filter: blur(3px);
}

/* Larger riding controls and a single transparent ivory-and-gold HUD surface. */
.game-hud {
  --control-size: clamp(80px, 10vmin, 112px);
  --dial-size: clamp(160px, 18vmin, 220px);
}

.game-hud .steering {
  left: max(24px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  gap: 16px;
}

.game-hud .ride-actions {
  right: calc(var(--dial-size) + 50px);
  bottom: max(24px, env(safe-area-inset-bottom));
  gap: 16px;
}

.game-hud .round-control {
  border-width: 1.5px;
}

.game-hud .round-control > .riding-icon {
  inset: 2px;
}

.game-hud .speedometer {
  width: var(--dial-size);
  height: var(--dial-size);
  right: max(24px, env(safe-area-inset-right));
  bottom: 20px;
}

.game-hud .speed-label strong {
  font-size: clamp(42px, 5.2vmin, 65px);
}

.game-hud .speed-label small {
  font-size: clamp(12px, 1.6vmin, 18px);
}

.game-hud .stamina-panel {
  bottom: 38px;
  width: clamp(340px, 36vw, 630px);
  height: 68px;
  padding: 10px 17px;
  gap: 13px;
  border: 1.5px solid #f4df8390 !important;
  border-radius: 36px;
  background: #09130e30;
  backdrop-filter: blur(3px);
  box-shadow:
    inset 0 0 12px #fff8e910,
    0 3px 10px #0004 !important;
}

.game-hud .stamina-track {
  height: 38px;
  padding: 5px;
  border-width: 2px;
  background: #09130e66;
  box-shadow: none;
}

.game-hud .bolt svg {
  width: 33px;
  height: 44px;
  color: #f5d68c;
}

.game-hud .race-info {
  left: 24px;
  top: 20px;
  width: clamp(190px, 16vw, 260px);
  gap: 8px;
}

.game-hud .race-info > .hud-panel {
  margin: 0;
  background: #09130e30;
  border: 1px solid #f4df8390;
  box-shadow:
    inset 0 0 12px #fff8e910,
    0 3px 10px #0004;
  backdrop-filter: blur(3px);
  text-shadow: 0 2px 5px #0009;
}

.game-hud .race-info > .position-panel {
  height: 116px;
  padding: 12px 20px;
  border-radius: 24px;
}

.game-hud .position-panel small {
  font-size: 18px;
  color: #fff2c7;
  letter-spacing: 1px;
}

.game-hud .position-panel strong {
  font-size: 82px;
  gap: 13px;
  margin-top: 0;
}

.game-hud .position-panel strong span {
  font-size: 64px;
}

.game-hud .race-info > .hud-line {
  height: 48px;
  border-radius: 26px;
  padding: 0 15px;
  gap: 15px;
  font-size: 24px;
}

.game-hud .race-info > .hud-line svg {
  width: 29px;
  height: 29px;
  color: #f5d68c;
}

.game-hud .race-info > .hud-timer {
  font-size: 26px;
  gap: 14px;
}

.game-hud .race-info > .game-pause-button {
  width: 64px;
  height: 64px;
  padding: 12px;
  margin-top: 4px;
  border-radius: 50%;
}

.game-hud .map-button {
  width: 46px;
  height: 46px;
  padding: 9px;
}

@media (max-width: 1200px) and (min-width: 651px) {
  .game-hud .stamina-panel {
    left: 24px;
    transform: none;
    bottom: calc(var(--control-size) + 46px);
    width: calc(100% - var(--dial-size) - 72px);
    height: 60px;
  }
  .game-hud .stamina-track {
    height: 34px;
  }
}

@media (max-width: 650px) {
  .game-hud {
    --control-size: clamp(64px, 18vw, 76px);
    --dial-size: 126px;
  }
  .game-hud .steering {
    left: 12px;
    bottom: max(22px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .game-hud .ride-actions {
    right: 12px;
    bottom: max(22px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .game-hud .stamina-panel {
    left: 12px;
    transform: none;
    bottom: calc(var(--control-size) + 42px);
    width: calc(100% - 24px);
    height: 58px;
    padding: 8px 14px;
    gap: 12px;
  }
  .game-hud .stamina-track {
    height: 34px;
  }
  .game-hud .bolt svg {
    width: 28px;
    height: 38px;
  }
  .game-hud .speedometer {
    right: 12px;
    bottom: calc(var(--control-size) + 118px);
  }
  .game-hud .speed-label strong {
    font-size: 40px;
  }
  .game-hud .speed-label small {
    font-size: 12px;
  }
  .game-hud .race-info {
    left: 12px;
    top: 12px;
    width: min(44vw, 205px);
    gap: 6px;
  }
  .game-hud .race-info > .position-panel {
    height: 100px;
    padding: 10px 12px;
    border-radius: 21px;
  }
  .game-hud .position-panel small {
    font-size: 15px;
  }
  .game-hud .position-panel strong {
    font-size: 68px;
    gap: 10px;
  }
  .game-hud .position-panel strong span {
    font-size: 52px;
  }
  .game-hud .race-info > .hud-line {
    height: 40px;
    padding: 0 10px;
    gap: 9px;
    font-size: 21px;
  }
  .game-hud .race-info > .hud-line svg {
    width: 25px;
    height: 25px;
  }
  .game-hud .race-info > .hud-timer {
    font-size: 22px;
    gap: 8px;
  }
  .game-hud .race-info > .game-pause-button {
    width: 58px;
    height: 58px;
    padding: 11px;
    margin-top: 4px;
  }
  .game-hud .objective {
    width: calc(100% - min(44vw, 205px) - 36px);
  }
  .game-hud .map-button {
    width: 40px;
    height: 40px;
    padding: 8px;
  }
}

@media (max-width: 360px) {
  .game-hud .position-panel strong {
    font-size: 62px;
    gap: 8px;
  }
  .game-hud .position-panel strong span {
    font-size: 48px;
  }
  .game-hud .race-info > .hud-timer {
    font-size: 20px;
    gap: 5px;
  }
  .game-hud .race-info > .hud-line svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-height: 500px) and (min-width: 480px) {
  .game-hud {
    --control-size: 70px;
    --dial-size: 140px;
  }
  .game-hud .steering,
  .game-hud .ride-actions {
    bottom: 18px;
    gap: 12px;
  }
  .game-hud .ride-actions {
    right: 178px;
  }
  .game-hud .speedometer {
    bottom: 16px;
    right: 16px;
  }
  .game-hud .stamina-panel {
    left: 24px;
    transform: none;
    width: calc(100% - var(--dial-size) - 72px);
    bottom: 106px;
    height: 54px;
    padding: 7px 12px;
  }
  .game-hud .stamina-track {
    height: 31px;
  }
  .game-hud .bolt svg {
    width: 26px;
    height: 36px;
  }
  .game-hud .race-info {
    left: 12px;
    top: 10px;
    width: 170px;
    gap: 5px;
  }
  .game-hud .race-info > .position-panel {
    height: 76px;
    padding: 6px 12px;
    border-radius: 18px;
  }
  .game-hud .position-panel small {
    font-size: 12px;
  }
  .game-hud .position-panel strong {
    font-size: 53px;
    gap: 12px;
  }
  .game-hud .position-panel strong span {
    font-size: 43px;
  }
  .game-hud .race-info > .hud-line {
    height: 32px;
    padding: 0 10px;
    gap: 10px;
    font-size: 18px;
  }
  .game-hud .race-info > .hud-line svg {
    width: 22px;
    height: 22px;
  }
  .game-hud .race-info > .hud-timer {
    font-size: 20px;
  }
  .game-hud .race-info > .game-pause-button {
    position: absolute;
    top: 0;
    right: -62px;
    width: 50px;
    height: 50px;
    padding: 10px;
    margin: 0;
  }
  .game-hud .map-button {
    width: 34px;
    height: 34px;
    padding: 6px;
  }
  .game-hud .minimap-wrap {
    width: 118px;
    height: 118px;
    right: 12px;
    top: 10px;
  }
  .game-hud .objective {
    width: 160px;
    right: 12px;
    top: 123px;
  }
  .game-hud .objective-header {
    font-size: 12px;
  }
  .game-hud .objective p {
    font-size: 11px;
    gap: 6px;
  }
}

/* Keep the ride meter off the centered horse in short landscape play. */
@media (max-height: 500px) and (min-width: 480px) {
  .game-hud .stamina-panel {
    left: 24px;
    top: 198px;
    bottom: auto;
    transform: none;
    width: min(29vw, 240px);
    height: 32px;
    padding: 3px 8px;
    gap: 6px;
  }
  .game-hud .stamina-track {
    height: 20px;
    padding: 2px;
    border-width: 1.5px;
  }
  .game-hud .bolt svg {
    width: 18px;
    height: 24px;
  }
}
