@font-face { font-family: 'Titan One'; src: url('fonts/titan-one.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo2-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo2-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Pacifico'; src: url('fonts/pacifico.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --accent: #f2832c;
  --gold: #e3b23c;
  --neon: #e3b23c;
  --plum: #5b2a4e;
  --rust: #9c3d2a;
  --teal: #4f8a86;
  --ink: #f6e7c6;
  --dim: #c9ae86;
  --dark: #2a1a14;
  --panel: rgba(42, 26, 20, 0.82);
  --panel2: rgba(72, 38, 32, 0.78);
  --stroke: rgba(227, 178, 60, 0.42);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: var(--dark); color: var(--ink);
  font-family: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: none;
}
body { position: fixed; inset: 0; }
#app { position: fixed; inset: 0; overflow: hidden; }
#app::after {
  content: "";
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse 118% 92% at 50% 48%, rgba(42, 26, 20, 0) 54%, rgba(42, 26, 20, 0.34) 100%);
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: none; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; inset: 0; z-index: 10; pointer-events: none;
  padding: calc(12px + var(--safe-t)) calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
  font-family: 'Baloo 2', sans-serif;
}
.hud.hidden { display: none; }
.panelStripe {
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 16px, var(--gold) 16px 32px, var(--rust) 32px 48px, var(--plum) 48px 64px);
}
.miniMap {
  position: absolute; left: calc(16px + var(--safe-l)); top: calc(14px + var(--safe-t));
  width: 148px; height: 148px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(42,26,20,0.78), rgba(42,26,20,0.55));
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(42,26,20,0.8), inset 0 0 22px rgba(42,26,20,0.65), 0 8px 24px rgba(42,26,20,0.4);
  overflow: hidden;
}
.miniMap canvas { width: 100%; height: 100%; display: block; }
.compassN {
  position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  font-family: 'Titan One', sans-serif; font-size: 12px; color: var(--gold); z-index: 2;
  text-shadow: 0 1px 2px var(--dark); pointer-events: none;
}
.radarLabel {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  font-size: 7px; letter-spacing: 2px; color: rgba(246, 231, 198, 0.65); white-space: nowrap;
}
.scorePanel {
  position: absolute; right: calc(16px + var(--safe-r)); top: calc(14px + var(--safe-t));
  min-width: 176px; padding: 8px 14px 10px;
  background: linear-gradient(150deg, rgba(72,38,32,0.9), rgba(42,26,20,0.84));
  border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.6), 0 8px 22px rgba(42,26,20,0.4);
}
.scorePanel::after {
  content: ""; display: block; height: 5px; margin: 7px -6px -5px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 14px, var(--gold) 14px 28px, var(--rust) 28px 42px, var(--plum) 42px 56px);
  border-radius: 3px;
}
.scoreTop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.scoreLabel { font-size: 10px; letter-spacing: 2.4px; color: var(--gold); font-weight: 700; }
.scoreNum { font-family: 'Titan One', sans-serif; font-size: 27px; line-height: 1; color: var(--ink); text-shadow: 2px 2px 0 var(--plum); }
.bestRow { font-size: 9px; letter-spacing: 1.8px; color: var(--dim); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.bestRow span { color: var(--ink); font-weight: 700; }
.bestRow .clock { margin-left: auto; color: var(--gold); font-variant-numeric: tabular-nums; }
.iconRow {
  position: absolute; right: calc(16px + var(--safe-r)); top: calc(112px + var(--safe-t));
  display: flex; gap: 8px; pointer-events: auto;
}
.iconBtn {
  pointer-events: auto; width: 40px; height: 34px;
  border: 2px solid var(--gold); border-radius: 9px;
  background: rgba(42,26,20,0.85); color: var(--ink);
  font-family: 'Baloo 2', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer;
}
.iconBtn:hover { background: var(--plum); color: var(--gold); }
.iconBtn.off { color: var(--dim); text-decoration: line-through; }

/* hull gauge */
.hullGauge {
  position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(16px + var(--safe-b));
  width: 256px; padding: 8px 12px 10px;
  background: linear-gradient(155deg, rgba(72,38,32,0.92), rgba(42,26,20,0.88));
  border: 3px solid var(--gold); border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.65), 0 10px 30px rgba(42,26,20,0.45);
}
.hullGauge::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 5px; height: 5px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 14px, var(--gold) 14px 28px, var(--rust) 28px 42px, var(--plum) 42px 56px);
  border-radius: 3px;
}
.gaugeFace { position: relative; height: 96px; margin-top: 6px; }
.gaugeSvg { width: 100%; height: 100%; display: block; overflow: visible; }
.gaugeNeedle {
  position: absolute; left: 50%; bottom: 8px; width: 4px; height: 62px; margin-left: -2px;
  background: linear-gradient(180deg, var(--ink), var(--rust));
  border-radius: 3px; transform-origin: 50% 100%;
  transform: rotate(0deg);
  box-shadow: 0 0 5px rgba(42,26,20,0.9);
}
.gaugeRead {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 3px; pointer-events: none;
}
.hpNum { font-family: 'Titan One', sans-serif; font-size: 33px; line-height: 1; color: var(--ink); text-shadow: 2px 2px 0 var(--plum); }
.hpUnit { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); }
.gaugeFoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -2px; }
.carName {
  font-family: 'Pacifico', cursive; font-size: 21px; color: var(--gold);
  text-shadow: 2px 2px 0 var(--plum); transform: rotate(-2deg); white-space: nowrap;
}
.carBadge {
  font-family: 'Titan One', sans-serif; font-size: 10px; color: var(--ink);
  background: var(--plum); border: 2px solid var(--gold); border-radius: 50%;
  width: 29px; height: 29px; display: grid; place-items: center;
}
.gaugeBoost { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.boostLabel { font-size: 7.5px; letter-spacing: 1.6px; color: var(--dim); font-weight: 700; }
.boostTrack { flex: 1; height: 5px; background: rgba(246,231,198,0.13); border-radius: 3px; overflow: hidden; }
.boostFill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 3px; transition: width 0.12s linear; }
.boostFill.empty { background: var(--rust); }
.gaugeShield { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.shieldLabel { font-size: 7.5px; letter-spacing: 1.6px; color: #8fd8c6; font-weight: 700; }
.shieldTrack { flex: 1; height: 6px; background: rgba(143,216,198,0.13); border: 1px solid rgba(143,216,198,0.35); border-radius: 3px; overflow: hidden; }
.shieldFill { height: 100%; width: 100%; background: linear-gradient(90deg, #4f8a86, #9fe8d8); border-radius: 3px; transition: width 0.12s linear; box-shadow: 0 0 8px rgba(159,232,216,0.5); }
.shieldFill.empty { background: rgba(143,216,198,0.16); box-shadow: none; }

/* weapons cartridges */
.weaponsPanel {
  position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b));
  display: flex; gap: 10px; pointer-events: none;
}
.weaponSlot {
  width: 138px; padding: 8px 11px 9px;
  background: linear-gradient(160deg, rgba(72,38,32,0.92), rgba(42,26,20,0.9));
  border: 3px solid var(--gold); border-radius: 13px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.65), 0 10px 26px rgba(42,26,20,0.4);
  position: relative;
}
.weaponSlot::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 5px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, var(--gold) 10px 20px, var(--rust) 20px 30px, var(--plum) 30px 40px);
  border-radius: 2px;
}
.slotTop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slotIcon { width: 44px; height: 26px; color: var(--gold); }
.slotIcon svg { width: 100%; height: 100%; display: block; }
.slotAmmo { font-family: 'Titan One', sans-serif; font-size: 30px; line-height: 1; color: var(--ink); text-shadow: 2px 2px 0 var(--plum); }
.rocketSlot .slotAmmo { color: var(--gold); }
.slotLabel { margin-top: 3px; font-size: 8px; letter-spacing: 1.8px; color: var(--dim); font-weight: 700; }
.weaponSlot.pop { animation: slotPop 0.5s cubic-bezier(.2,1.6,.4,1); }
@keyframes slotPop { 0% { transform: scale(1); } 35% { transform: scale(1.13) rotate(-1deg); } 70% { transform: scale(0.97); } 100% { transform: scale(1); } }

/* speed */
.speedPanel { position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); text-align: center; opacity: 0.95; }
.speedValue { font-family: 'Titan One', sans-serif; font-size: 25px; line-height: 1; color: var(--ink); text-shadow: 2px 2px 0 var(--plum); font-variant-numeric: tabular-nums; }
.speedUnit { font-size: 9px; letter-spacing: 2px; color: var(--gold); margin-left: 5px; font-family: 'Baloo 2', sans-serif; font-weight: 700; }
.speedTrack { width: 146px; height: 4px; background: rgba(246,231,198,0.13); margin: 6px auto 0; border-radius: 2px; overflow: hidden; }
.speedFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 2px; transition: width 0.12s linear; }

/* floating rival */
.rivalFloat {
  position: absolute; display: none; z-index: 12; width: 156px; text-align: center;
  transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 2px 5px rgba(42,26,20,0.7));
}
.rivalFloat.show { display: block; }
.rivalFloatName {
  display: inline-block; font-size: 8px; font-weight: 700; letter-spacing: 1.8px; color: var(--ink);
  background: rgba(42,26,20,0.82); border: 1px solid var(--gold); border-radius: 6px; padding: 1px 7px;
}
.rivalFloatBar { height: 9px; margin-top: 3px; background: rgba(42,26,20,0.82); border: 1.5px solid var(--gold); border-radius: 5px; overflow: hidden; }
.rivalFloatFill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--accent) 55%, var(--rust)); transition: width 0.15s linear; }
.rivalFloatShield { height: 5px; margin-top: 2px; background: rgba(42,26,20,0.82); border: 1px solid rgba(143,216,198,0.55); border-radius: 4px; overflow: hidden; }
.rivalFloatShieldFill { height: 100%; width: 100%; background: linear-gradient(90deg, #4f8a86, #9fe8d8); transition: width 0.15s linear; }
.rivalFloatPin { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--rust); margin: -1px auto 0; }

/* duel health panel */
.duelPanel {
  display: none !important;
  position: absolute; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; width: min(430px, 40vw);
  padding: 6px 10px 7px; background: linear-gradient(160deg, rgba(72,38,32,0.86), rgba(42,26,20,0.82));
  border: 2px solid var(--gold); border-radius: 11px; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.55), 0 8px 22px rgba(42,26,20,0.35);
}
.duelSide { flex: 1; min-width: 0; }
.duelSideRival { text-align: right; }
.duelName { font-size: 7.5px; letter-spacing: 1.4px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duelVs { font-family: 'Titan One', sans-serif; font-size: 11px; color: var(--gold); text-shadow: 1px 1px 0 var(--plum); }
.duelBar { position: relative; height: 8px; margin-top: 3px; background: rgba(42,26,20,0.8); border: 1px solid rgba(227,178,60,0.6); border-radius: 4px; overflow: hidden; }
.duelHull { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width 0.15s linear; }
.duelSideRival .duelHull { margin-left: auto; background: linear-gradient(90deg, var(--rust), var(--accent)); }
.duelShield { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #9fe8d8; opacity: 0.85; transition: width 0.15s linear; }
.duelSideRival .duelShield { left: auto; right: 0; }

/* offscreen pointer */
.offScreen {
  position: absolute; display: none; z-index: 12; align-items: center; gap: 6px;
  transform: translate(-50%, -50%);
  background: rgba(42,26,20,0.86); border: 2px solid var(--rust); border-radius: 18px;
  padding: 3px 10px 3px 7px; font-size: 8px; font-weight: 700; letter-spacing: 1.6px; color: var(--ink);
  box-shadow: 0 4px 14px rgba(42,26,20,0.5); pointer-events: none;
}
.offScreen.show { display: flex; }
.offArrow { color: var(--accent); font-size: 13px; line-height: 1; display: inline-block; }

/* reticle */
.reticle {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; pointer-events: none; z-index: 12; opacity: 0.96;
  filter: drop-shadow(0 2px 3px rgba(42,26,20,0.85));
}
.reticle svg { width: 100%; height: 100%; display: block; }

/* banner / flashes */
.waveBanner {
  position: absolute; top: 14%; left: 50%;
  transform: translate(-50%, -50%) rotate(-2deg) scale(0.9);
  font-family: 'Titan One', sans-serif; font-size: clamp(20px, 3.4vw, 40px);
  letter-spacing: 2px; color: var(--ink); text-align: center; white-space: nowrap;
  text-shadow: 3px 3px 0 var(--plum), 6px 6px 0 rgba(42,26,20,0.7), 0 0 46px rgba(242,131,44,0.5);
  opacity: 0; pointer-events: none;
}
.waveBanner.show { animation: bannerIn 1.9s cubic-bezier(.2,.8,.2,1) forwards; }
.waveBanner.clear { color: var(--gold); text-shadow: 3px 3px 0 var(--plum), 6px 6px 0 rgba(42,26,20,0.7), 0 0 46px rgba(227,178,60,0.5); }
.waveBanner.small { font-size: clamp(14px, 2vw, 22px); letter-spacing: 1px; top: 12%; }
.waveBanner.small.show { animation-duration: 1.3s; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-2deg) scale(0.75); }
  14% { opacity: 1; transform: translate(-50%, -50%) rotate(-2deg) scale(1.04); }
  24% { transform: translate(-50%, -50%) rotate(-2deg) scale(1); }
  76% { opacity: 1; transform: translate(-50%, -50%) rotate(-2deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-2deg) scale(1.08); }
}
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 46%, rgba(156,61,42,0.0) 60%, rgba(156,61,42,0.5) 100%); opacity: 0; transition: opacity 0.25s ease; }
.damageFlash { position: absolute; inset: 0; pointer-events: none; background: rgba(242,131,44,0.22); opacity: 0; transition: opacity 0.3s ease; }

.keysHint {
  position: absolute; left: 50%; top: calc(118px + var(--safe-t)); transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center; white-space: nowrap;
  font-size: 9px; letter-spacing: 1.2px; color: rgba(246,231,198,0.62);
  background: rgba(42,26,20,0.45); border-radius: 12px; padding: 4px 12px;
}
.keysHint b { color: var(--gold); font-weight: 700; }

/* touch */
.touchUi { display: none; }
body.touch .touchUi { display: block; }
body.touch .keysHint { display: none; }
body.touch .speedPanel { display: none; }
body.touch .weaponsPanel { display: none; }
body.touch .reticle { display: none; }
.stickZone {
  position: absolute; left: calc(20px + var(--safe-l)); bottom: calc(20px + var(--safe-b));
  width: 132px; height: 132px; border-radius: 50%; pointer-events: auto; touch-action: none;
}
.stickBase {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(42,26,20,0.62), rgba(42,26,20,0.35));
  border: 3px solid var(--gold); box-shadow: inset 0 0 26px rgba(42,26,20,0.55);
}
.stickRing { position: absolute; inset: 15px; border-radius: 50%; border: 1px dashed rgba(246,231,198,0.24); }
.stickKnob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #f6c46a, var(--accent) 55%, var(--rust));
  border: 2px solid var(--ink); box-shadow: 0 0 20px rgba(242,131,44,0.5);
  transition: transform 0.04s linear;
}
.touchActions {
  position: absolute; right: calc(20px + var(--safe-r)); bottom: calc(20px + var(--safe-b));
  display: grid; grid-template-columns: 62px 94px; grid-template-rows: 58px 94px;
  align-items: end; justify-items: end; gap: 10px; pointer-events: auto;
}
.actionBtn {
  pointer-events: auto; touch-action: none; border-radius: 50%;
  font-family: 'Titan One', sans-serif; font-weight: 400; letter-spacing: 1px; color: var(--ink);
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 40% 30%, #d98a3d, #7a3a22 70%);
  box-shadow: 0 0 20px rgba(42,26,20,0.55), inset 0 0 18px rgba(42,26,20,0.4);
  text-shadow: 1px 2px 0 rgba(42,26,20,0.8);
}
.actionBtn:active, .actionBtn.held { transform: scale(0.94); filter: brightness(1.18); }
.fireBtn { width: 94px; height: 94px; font-size: 15px; grid-column: 2; grid-row: 2; background: radial-gradient(circle at 40% 30%, #f2832c, #9c3d2a 72%); }
.rocketBtn { width: 66px; height: 66px; font-size: 9px; grid-column: 2; grid-row: 1; background: radial-gradient(circle at 40% 30%, #e3b23c, #8a5a1c 72%); }
.driftBtn { width: 58px; height: 58px; font-size: 8px; grid-column: 1; grid-row: 1; background: radial-gradient(circle at 40% 30%, #7aa39c, #3e5f5a 72%); }
.rocketBtn .badge {
  position: absolute; top: -5px; right: -4px; min-width: 22px; height: 22px; padding: 0 4px;
  border-radius: 11px; background: var(--dark); border: 2px solid var(--gold);
  color: var(--ink); font-family: 'Titan One', sans-serif; font-size: 11px; line-height: 18px; text-align: center;
}
.rocketBtn .badge.empty { color: var(--rust); border-color: var(--rust); }
body.touch .hullGauge { top: calc(118px + var(--safe-t)); bottom: auto; left: calc(12px + var(--safe-l)); width: 146px; padding: 4px 7px 6px; }
body.touch .miniMap { width: 98px; height: 98px; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); }
body.touch .compassN { font-size: 9px; }
body.touch .scorePanel { min-width: 128px; padding: 6px 10px 8px; }
body.touch .scoreNum { font-size: 21px; }
body.touch .iconRow { top: calc(96px + var(--safe-t)); }
body.touch .iconBtn { width: 34px; height: 30px; }
body.touch .gaugeFace { height: 52px; }
body.touch .hpNum { font-size: 20px; }
body.touch .gaugeNeedle { height: 34px; bottom: 5px; }
body.touch .carName { font-size: 14px; }
body.touch .gaugeBoost { margin-top: 1px; }
body.touch .hpUnit { font-size: 7px; }
body.touch .carBadge { width: 21px; height: 21px; font-size: 7px; }
body.touch .boostLabel { font-size: 6px; }
body.touch .actionBtn { border-width: 2px; }

/* ---------- overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; overflow-y: auto;
  padding: calc(20px + var(--safe-t)) calc(20px + var(--safe-r)) calc(20px + var(--safe-b)) calc(20px + var(--safe-l));
  background:
    radial-gradient(ellipse at 50% 36%, rgba(91,42,78,0.16), rgba(42,26,20,0.56) 70%),
    linear-gradient(180deg, rgba(42,26,20,0.2), rgba(42,26,20,0.5));
  backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px);
}
.overlay.hidden { display: none; }
.startInner { width: min(900px, 100%); text-align: center; position: relative; padding: 8px 0; }
.eyebrow { font-size: clamp(9px, 1.25vw, 12px); letter-spacing: 0.42em; color: var(--gold); font-weight: 700; margin-bottom: 8px; text-shadow: 0 2px 0 rgba(42,26,20,0.6); }
h1 {
  margin: 0; font-family: 'Titan One', sans-serif; font-weight: 400;
  font-size: clamp(38px, 8.6vw, 94px); line-height: 0.94; letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--rust), 8px 8px 0 rgba(42,26,20,0.85), 0 0 46px rgba(242,131,44,0.42);
  transform: rotate(-1deg);
}
.titleStripe {
  width: min(560px, 82%); height: 11px; margin: 16px auto 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 30px, var(--gold) 30px 60px, var(--rust) 60px 90px, var(--plum) 90px 120px);
  border-radius: 5px; box-shadow: 0 3px 0 rgba(42,26,20,0.6);
  transform: rotate(-1deg);
}
.tagline { margin-top: 12px; font-size: clamp(9px, 1.45vw, 13px); letter-spacing: 0.42em; color: var(--gold); font-weight: 700; }
.blurb { max-width: 62ch; margin: 12px auto 0; font-size: clamp(12px, 1.45vw, 15px); line-height: 1.45; color: var(--dim); }

/* garage / vehicle select */
.garage {
  margin: 16px auto 0; width: 100%; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 8px 12px; padding: 10px;
  background: linear-gradient(155deg, rgba(72,38,32,0.78), rgba(42,26,20,0.82));
  border: 2px solid var(--stroke); border-top: 4px solid var(--accent); border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.4), 0 12px 30px rgba(42,26,20,0.32);
}
.garageStage {
  position: relative; min-height: 196px; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 72%, rgba(227,178,60,0.18), rgba(42,26,20,0) 62%),
    linear-gradient(180deg, rgba(91,42,78,0.22), rgba(42,26,20,0.5));
  border: 1.5px solid rgba(227,178,60,0.28);
}
#vehiclePreview { width: 100%; height: 100%; display: block; }
.garageCount {
  position: absolute; left: 9px; top: 8px; font-family: 'Titan One', sans-serif;
  font-size: 10px; letter-spacing: 1.4px; color: var(--gold);
  background: rgba(42,26,20,0.7); border: 1px solid rgba(227,178,60,0.5);
  border-radius: 5px; padding: 2px 7px;
}
.garageInfo { padding: 2px 4px 0; display: flex; flex-direction: column; min-width: 0; }
.garageKicker { font-size: 8px; letter-spacing: 2.4px; color: var(--gold); font-weight: 700; }
.garageName {
  font-family: 'Titan One', sans-serif; font-size: clamp(22px, 3vw, 34px); line-height: 1.02;
  color: var(--ink); text-shadow: 2px 2px 0 var(--plum); margin-top: 2px;
}
.garageTag { margin-top: 2px; font-size: 9px; letter-spacing: 2.2px; color: var(--accent); font-weight: 700; }
.garageBlurb { margin: 7px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--dim); }
.statBars { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.statBar { display: flex; align-items: center; gap: 7px; }
.statBar span { flex: 0 0 58px; font-size: 7.5px; letter-spacing: 1.4px; color: var(--dim); font-weight: 700; }
.barTrack { flex: 1; height: 6px; background: rgba(246,231,198,0.11); border-radius: 3px; overflow: hidden; }
.barTrack i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 3px; transition: width 0.22s ease; }
.statBar:nth-child(3) .barTrack i { background: linear-gradient(90deg, var(--rust), var(--accent)); }
.statBar:nth-child(4) .barTrack i { background: linear-gradient(90deg, #4f8a86, #9fe8d8); }
.garageNav { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 2px; }
.garageArrow {
  pointer-events: auto; width: 32px; height: 26px; border: 2px solid var(--gold); border-radius: 7px;
  background: rgba(42,26,20,0.8); color: var(--ink); font-size: 11px; line-height: 1; cursor: pointer;
}
.garageArrow:hover { background: var(--plum); color: var(--gold); }
.garageDots { display: flex; align-items: center; gap: 6px; }
.garageDot {
  pointer-events: auto; width: 9px; height: 9px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--gold); background: rgba(42,26,20,0.7); cursor: pointer;
}
.garageDot.active { background: var(--accent); box-shadow: 0 0 8px rgba(242,131,44,0.8); transform: scale(1.18); }
.quickControls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 12px auto 0; font-size: 10px; color: var(--dim); letter-spacing: 0.4px; }
.quickControls b { color: var(--ink); font-size: 8.5px; letter-spacing: 1px; background: rgba(91,42,78,0.65); border: 1px solid var(--gold); border-radius: 4px; padding: 1px 5px; }
.allOnly { display: inline; }
.surviveHint { margin-top: 7px; font-size: 9px; letter-spacing: 0.8px; color: rgba(201,174,134,0.8); }
.surviveHint b { color: var(--gold); }
.dotSep { color: rgba(227,178,60,0.45); margin: 0 3px; }
.controlsCard { display: flex; gap: 10px; margin: 22px auto 0; width: 100%; text-align: left; }
.controlsCol {
  flex: 1; background: rgba(42,26,20,0.72); border: 2px solid var(--stroke); border-top: 4px solid var(--accent);
  border-radius: 12px; padding: 10px 12px 11px;
}
.ctrlTitle { font-size: 9px; letter-spacing: 2.6px; color: var(--gold); margin-bottom: 7px; font-weight: 700; }
.ctrlLine { display: flex; align-items: baseline; gap: 9px; font-size: 11.5px; color: #e8d5b4; line-height: 1.35; margin-top: 5px; }
.key {
  flex: 0 0 auto; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--ink);
  background: rgba(91,42,78,0.65); border: 1px solid var(--gold); border-radius: 5px; padding: 2px 6px; white-space: nowrap;
}
.point { flex: 0 0 auto; color: var(--gold); font-weight: 700; font-size: 10px; letter-spacing: 0.5px; }
.touchOnly { display: none; }
body.touch .touchOnly { display: block; }
body.touch .desktopOnly { display: none; }
.btn {
  margin-top: 22px; pointer-events: auto; position: relative; display: inline-block; padding: 0;
  border: none; background: transparent; cursor: pointer; font-family: 'Baloo 2', sans-serif;
  transform: rotate(-1.5deg); filter: drop-shadow(0 8px 18px rgba(42,26,20,0.45));
}
.btn span {
  display: block; padding: 15px 42px 13px;
  font-family: 'Titan One', sans-serif; font-size: clamp(13px, 1.8vw, 17px); letter-spacing: 0.16em;
  color: var(--dark); background: linear-gradient(180deg, #f6d27a, var(--gold) 55%, #c18a28);
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.35), 0 5px 0 var(--rust);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:hover span { filter: brightness(1.09); }
.btn:active span { transform: translateY(2px); box-shadow: inset 0 0 0 2px rgba(42,26,20,0.35), 0 2px 0 var(--rust); }
.menuBest { margin-top: 14px; font-size: 10px; letter-spacing: 2.6px; color: var(--dim); }
.menuBest span { color: var(--ink); font-weight: 700; font-size: 13px; }
.cornerMark { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(227,178,60,0.4); pointer-events: none; }
.cornerMark.tl { left: 22px; top: 22px; border-right: none; border-bottom: none; }
.cornerMark.tr { right: 22px; top: 22px; border-left: none; border-bottom: none; }
.cornerMark.bl { left: 22px; bottom: 22px; border-right: none; border-top: none; }
.cornerMark.br { right: 22px; bottom: 22px; border-left: none; border-top: none; }

.panelBig {
  width: min(560px, 100%); position: relative; text-align: center;
  background: linear-gradient(150deg, rgba(72,38,32,0.97), rgba(42,26,20,0.98));
  border: 3px solid var(--gold); border-radius: 18px;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: inset 0 0 0 4px rgba(42,26,20,0.75), 0 30px 80px rgba(42,26,20,0.65);
}
.panelBig::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -10px; height: 10px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 18px, var(--gold) 18px 36px, var(--rust) 36px 54px, var(--plum) 54px 72px);
  border-radius: 5px;
}
.panelBig::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -10px; height: 10px;
  background: repeating-linear-gradient(90deg, var(--plum) 0 18px, var(--rust) 18px 36px, var(--gold) 36px 54px, var(--accent) 54px 72px);
  border-radius: 5px;
}
.narrowPanel { width: min(520px, 100%); }
h2 {
  margin: 2px 0 0; font-family: 'Titan One', sans-serif; font-weight: 400;
  font-size: clamp(34px, 7.4vw, 58px); letter-spacing: 0.02em; line-height: 1;
  color: var(--ink); text-shadow: 3px 3px 0 var(--rust), 6px 6px 0 rgba(42,26,20,0.8), 0 0 40px rgba(242,131,44,0.35);
}
h2.wasted { color: var(--ink); text-shadow: 3px 3px 0 var(--rust), 6px 6px 0 rgba(42,26,20,0.8), 0 0 40px rgba(156,61,42,0.5); }
h2.victory { color: var(--gold); text-shadow: 3px 3px 0 var(--rust), 6px 6px 0 rgba(42,26,20,0.8), 0 0 46px rgba(227,178,60,0.5); }
.statsGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.stat { background: rgba(246,231,198,0.055); border: 1.5px solid var(--stroke); border-radius: 10px; padding: 10px 6px 9px; }
.statLabel { display: block; font-size: 8px; letter-spacing: 2px; color: var(--dim); }
.statValue { display: block; margin-top: 4px; font-family: 'Titan One', sans-serif; font-size: clamp(18px, 3.2vw, 26px); color: var(--ink); text-shadow: 2px 2px 0 var(--plum); font-variant-numeric: tabular-nums; }
.bestLine { margin-top: 16px; font-size: 10px; letter-spacing: 2.6px; color: var(--dim); }
.bestLine span { color: var(--ink); font-weight: 700; }
.smallBlurb { margin-top: 12px; font-size: 12.5px; }
.overHint { margin-top: 10px; font-size: 9px; letter-spacing: 2.2px; color: rgba(201,174,134,0.62); }
.helpGrid { margin-top: 20px; text-align: left; display: flex; flex-direction: column; gap: 9px; }
.helpRow { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; line-height: 1.45; color: #e8d5b4; }
.helpRow .key { min-width: 64px; text-align: center; }
.helpRow span:last-child { color: var(--dim); }
.winPanel { border-color: var(--gold); }

/* settings */
.settingsPanel { width: min(620px, 100%); }
.settingsGrid { margin-top: 20px; display: flex; flex-direction: column; gap: 15px; text-align: left; }
.settingRow { background: rgba(246,231,198,0.045); border: 1.5px solid var(--stroke); border-radius: 10px; padding: 9px 13px 11px; }
.settingTop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.settingLabel { font-size: 9px; letter-spacing: 2.4px; color: var(--gold); font-weight: 700; }
.settingValue { font-size: 11px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.settingRange {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 9px; margin: 10px 0 0; border-radius: 5px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  border: 1.5px solid rgba(42,26,20,0.65); outline: none; cursor: pointer;
}
.settingRange::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 21px; height: 21px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0c8, var(--gold) 62%, #b07a1f);
  border: 2px solid var(--dark); box-shadow: 0 2px 6px rgba(42,26,20,0.6); cursor: pointer;
}
.settingRange::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0c8, var(--gold) 62%, #b07a1f);
  border: 2px solid var(--dark); box-shadow: 0 2px 6px rgba(42,26,20,0.6); cursor: pointer;
}
.settingChoices { justify-content: flex-start; margin-top: 9px; }
.settingToggleRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggleBtn {
  pointer-events: auto; cursor: pointer; min-width: 66px;
  font-family: 'Baloo 2', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1.8px;
  padding: 5px 14px 4px; border-radius: 7px; color: var(--dim);
  background: rgba(42,26,20,0.85); border: 1.5px solid rgba(227,178,60,0.45);
}
.toggleBtn.on { color: var(--dark); background: linear-gradient(180deg, #f6d27a, var(--gold) 60%, #c18a28); border-color: var(--ink); box-shadow: 0 0 10px rgba(227,178,60,0.4); }
.settingsBtn span {
  background: linear-gradient(180deg, #9fe8d8, #4f8a86 55%, #2f5d5a);
  color: var(--dark); padding-left: 28px; padding-right: 28px;
}
.resultBtns { margin-top: 18px; }

/* loader */
.loader {
  position: absolute; inset: 0; z-index: 50; background: var(--dark);
  display: grid; place-content: center; gap: 14px; transition: opacity 0.45s ease;
}
.loader.gone { opacity: 0; pointer-events: none; }
.loaderText { text-align: center; font-family: 'Titan One', sans-serif; font-size: 18px; letter-spacing: 2px; color: var(--gold); }
.loaderBar { width: 210px; height: 5px; background: rgba(246,231,198,0.12); border-radius: 3px; overflow: hidden; }
.loaderBar i { display: block; height: 100%; width: 40%; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, var(--gold) 14px 28px); animation: loadSlide 1.1s ease-in-out infinite; }
@keyframes loadSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .miniMap { width: 118px; height: 118px; }
  .scorePanel { min-width: 140px; }
  .hullGauge { width: 216px; }
  .weaponSlot { width: 116px; }
  .slotAmmo { font-size: 25px; }
  .slotIcon { width: 36px; }
  .keysHint { display: none; }
}
@media (max-height: 800px) and (orientation: landscape) {
  h1 { font-size: clamp(34px, 7.2vw, 74px); }
  .titleStripe { margin-top: 10px; height: 8px; }
  .tagline { margin-top: 6px; }
  .blurb { display: none; }
  .garage { margin-top: 10px; }
  .garageStage { min-height: 150px; }
  .garageName { font-size: 27px; }
  .garageBlurb { font-size: 10.5px; line-height: 1.3; margin-top: 5px; }
  .statBars { gap: 3px; padding-top: 5px; }
  .quickControls { margin-top: 8px; }
  .surviveHint { display: none; }
  .btn { margin-top: 10px; }
  .btn span { padding: 12px 34px 10px; }
  .menuBest { margin-top: 6px; }
}
@media (max-width: 720px), (max-height: 530px) {
  .miniMap { width: 104px; height: 104px; }
  .scoreNum { font-size: 22px; }
  .hullGauge { width: 198px; }
  .gaugeFace { height: 76px; }
  .hpNum { font-size: 27px; }
  .carName { font-size: 18px; }
  .weaponSlot { width: 108px; padding: 6px 8px 8px; }
  .speedValue { font-size: 20px; }
  .speedTrack { width: 110px; }
  .waveBanner { letter-spacing: 1px; }
  .controlsCard { flex-direction: column; gap: 7px; margin-top: 16px; }
  .ctrlLine { font-size: 10.5px; }
  .garage { grid-template-columns: 1fr; gap: 7px; padding: 8px; }
  .garageStage { min-height: 148px; }
  .garageInfo { padding: 0 2px; }
  .garageBlurb { margin-top: 5px; }
  .statBars { padding-top: 6px; }
  .garageName { font-size: 25px; }
  .quickControls { gap: 5px 10px; margin-top: 9px; font-size: 9px; }
  .surviveHint { font-size: 8px; }
  .duelPanel { display: none; }
  .statsGrid { gap: 5px; }
  .stat { padding: 8px 3px 7px; }
  .statLabel { font-size: 7.5px; letter-spacing: 1.4px; }
  .btn span { padding: 12px 28px 10px; }
  .cornerMark { display: none; }
  .keysHint { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .overlay { align-items: start; }
  .startInner { padding-top: 2px; }
  h1 { font-size: clamp(30px, 7.4vh, 52px); }
  .titleStripe { margin-top: 8px; height: 7px; }
  .tagline { margin-top: 5px; }
  .blurb { display: none; }
  .garage { margin-top: 8px; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); padding: 7px; gap: 6px 10px; }
  .garageStage { min-height: 118px; }
  .garageName { font-size: 22px; }
  .garageBlurb { display: none; }
  .statBars { padding-top: 4px; gap: 3px; }
  .statBar span { flex-basis: 50px; font-size: 6.5px; }
  .garageNav { padding-top: 0; }
  .quickControls { margin-top: 7px; font-size: 9px; }
  .surviveHint { display: none; }
  .controlsCard { margin-top: 10px; flex-direction: row; }
  .ctrlLine { font-size: 10px; margin-top: 3px; }
  .btn { margin-top: 10px; }
  .btn span { padding: 10px 28px 9px; }
  .menuBest { margin-top: 6px; }
  .helpGrid { margin-top: 12px; gap: 6px; }
  .helpRow { font-size: 11px; }
  .panelBig { padding: 18px 24px; }
  .eyebrow { margin-bottom: 4px; }
  .miniMap { width: 92px; height: 92px; }
  .iconRow { top: calc(94px + var(--safe-t)); }
  .hullGauge { width: 190px; bottom: calc(10px + var(--safe-b)); }
  .gaugeFace { height: 62px; }
  .gaugeFoot { margin-top: 0; }
  .carName { font-size: 17px; }
  .weaponsPanel { bottom: calc(10px + var(--safe-b)); }
  .touchActions { transform: scale(0.92); transform-origin: bottom right; }
  .duelPanel { display: none; }
}
@media (orientation: portrait) and (max-width: 600px) {
  .miniMap { width: 94px; height: 94px; }
  .scorePanel { min-width: 120px; padding: 5px 9px 7px; }
  .scoreNum { font-size: 19px; }
  .scoreLabel { font-size: 8px; letter-spacing: 1.5px; }
  .bestRow { font-size: 7.5px; letter-spacing: 1px; gap: 3px; }
  .iconRow { top: calc(92px + var(--safe-t)); gap: 5px; }
  .iconBtn { width: 32px; height: 28px; font-size: 8px; }
  .hullGauge { width: 166px; }
  .gaugeFace { height: 64px; }
  .hpNum { font-size: 22px; }
  .carName { font-size: 15px; }
  .carBadge { width: 24px; height: 24px; font-size: 8px; }
  .gaugeBoost { margin-top: 2px; }
  .gaugeFoot { gap: 4px; }
  .speedPanel { display: none; }
  .keysHint { display: none; }
  .stickZone { width: 116px; height: 116px; }
  .stickKnob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .touchActions { grid-template-columns: 54px 82px; grid-template-rows: 52px 82px; gap: 8px; }
  .fireBtn { width: 82px; height: 82px; font-size: 13px; }
  .rocketBtn { width: 56px; height: 56px; font-size: 8px; }
  .driftBtn { width: 50px; height: 50px; font-size: 7px; }
  .statsGrid { grid-template-columns: repeat(2, 1fr); }
  .blurb { font-size: 12.5px; }
  h1 { font-size: clamp(30px, 9vw, 46px); }
  .titleStripe { height: 8px; margin-top: 10px; }
  .tagline { font-size: 8px; letter-spacing: 0.28em; }
  .controlsCard { margin-top: 14px; }
}
@media (pointer: coarse) { #scene { cursor: default; } }
.hullGauge.critical { border-color: #d84a2f; box-shadow: inset 0 0 0 2px rgba(42,26,20,0.65), 0 0 26px rgba(216,74,47,0.45); }
.hullGauge.critical .hpNum { color: #ffb08a; }
.hullGauge.critical .gaugeNeedle { background: linear-gradient(180deg, #ffd0a0, #d84a2f); }

/* ---------- modes, maps, match HUD ---------- */
.modeBar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  margin: 12px auto 0; width: 100%;
}
.pickGroup { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pickLabel { font-size: 8px; letter-spacing: 2.2px; color: var(--gold); font-weight: 700; }
.pickRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.pickBtn {
  pointer-events: auto; cursor: pointer; font-family: 'Baloo 2', sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.7px;
  padding: 4px 9px 3px; border-radius: 6px;
  color: var(--dim); background: rgba(42,26,20,0.72);
  border: 1.5px solid rgba(227,178,60,0.4);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pickBtn:hover { color: var(--ink); border-color: var(--gold); }
.pickBtn.active { color: var(--dark); background: linear-gradient(180deg, #f6d27a, var(--gold)); border-color: var(--ink); box-shadow: 0 0 10px rgba(227,178,60,0.45); }
.modeNote { margin: 7px auto 0; max-width: 76ch; font-size: 10.5px; line-height: 1.35; letter-spacing: 0.3px; color: var(--dim); }
.modeNote b { color: var(--gold); font-weight: 700; }
.modeNote .noteLine { display: block; }
.startBtns { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.startBtns .btn { margin-top: 0; }
.exitBtn span {
  background: linear-gradient(180deg, #c9ae86, #9a7f5e 55%, #6d563c);
  color: var(--dark); padding-left: 26px; padding-right: 26px;
}
.matchPanel {
  position: absolute; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%);
  min-width: 210px; padding: 7px 18px 8px; text-align: center;
  background: linear-gradient(150deg, rgba(72,38,32,0.9), rgba(42,26,20,0.84));
  border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.6), 0 8px 22px rgba(42,26,20,0.4);
  pointer-events: none;
}
.matchMode { font-size: 8px; letter-spacing: 2.4px; color: var(--gold); font-weight: 700; }
.matchScore { margin-top: 1px; font-family: 'Titan One', sans-serif; font-size: 19px; line-height: 1.1; color: var(--ink); text-shadow: 2px 2px 0 var(--plum); font-variant-numeric: tabular-nums; }
.matchTime { margin-top: 1px; font-size: 9px; letter-spacing: 1.8px; color: var(--dim); font-variant-numeric: tabular-nums; }
.flagRow { display: flex; justify-content: center; gap: 8px; margin-top: 3px; }
.flagChip {
  font-size: 8px; font-weight: 700; letter-spacing: 0.8px;
  padding: 1px 6px 2px; border-radius: 4px; border: 1px solid currentColor;
}
.flagChip.blue { color: #8fd6ff; }
.flagChip.red { color: #ff9a7a; }
.flagChip.carried { background: rgba(255,255,255,0.1); }
@media (max-width: 720px), (max-height: 560px) {
  .modeBar { margin-top: 7px; gap: 5px 10px; }
  .pickBtn { font-size: 8px; padding: 3px 6px 2px; }
  .pickLabel { display: none; }
  .modeNote { margin-top: 4px; font-size: 9px; }
  .matchPanel { min-width: 168px; padding: 5px 10px 6px; }
  .matchScore { font-size: 16px; }
  .matchMode { font-size: 7px; letter-spacing: 1.6px; }
  .matchTime { font-size: 8px; }
  .startBtns { gap: 7px; margin-top: 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .modeNote { display: none; }
}

@media (max-width: 720px) {
  #startScreen .blurb { display: none; }
  .garageStage { min-height: 128px; }
  .matchPanel { left: auto; right: calc(10px + var(--safe-r)); transform: none; min-width: 148px; padding: 5px 9px 6px; }
  .matchScore { font-size: 15px; }
  .scorePanel { display: none; }
  .iconRow { top: calc(102px + var(--safe-t)); right: calc(10px + var(--safe-r)); }
  .miniMap { width: 96px; height: 96px; }
}
@media (max-width: 420px) {
  .matchPanel { min-width: 132px; padding: 4px 7px 5px; }
  .matchMode { font-size: 6.5px; letter-spacing: 1.2px; }
  .matchScore { font-size: 13px; }
  .flagChip { font-size: 6.5px; padding: 1px 4px; }
}
.menuSound {
  pointer-events: auto; cursor: pointer; margin-top: 6px;
  font-family: 'Baloo 2', sans-serif; font-size: 8px; font-weight: 700; letter-spacing: 1.8px;
  padding: 4px 10px 3px; border-radius: 6px; color: var(--dim);
  background: rgba(42,26,20,0.72); border: 1.5px solid rgba(227,178,60,0.4);
}
.menuSound:hover { color: var(--ink); border-color: var(--gold); }
.menuSound.off { color: var(--dim); text-decoration: line-through; }
.menuFoot { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.menuFoot .menuBest { margin-top: 0; }
.menuFoot .menuSound { margin-top: 0; }
@media (max-height: 560px) and (orientation: landscape) {
  #startScreen .eyebrow, #startScreen .tagline, #startScreen .modeNote { display: none; }
  #startScreen h1 { font-size: clamp(26px, 7.2vh, 46px); }
  #startScreen .titleStripe { margin-top: 5px; height: 6px; }
  #startScreen .modeBar { margin-top: 5px; }
  #startScreen .garage { margin-top: 5px; padding: 5px 7px; gap: 4px 9px; }
  #startScreen .garageStage { min-height: 84px; }
  #startScreen .garageName { font-size: 20px; }
  #startScreen .garageKicker, #startScreen .garageBlurb { display: none; }
  #startScreen .statBars { gap: 2px; padding-top: 2px; }
  #startScreen .quickControls { display: none; }
  #startScreen .startBtns { margin-top: 6px; }
  #startScreen .startBtns .btn span { padding: 8px 24px 7px; font-size: 12px; }
  #startScreen .menuFoot { margin-top: 3px; }
  #startScreen .menuBest { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) {
  #startScreen .garageStage { min-height: 62px; }
  #startScreen .statBars, #startScreen .garageTag { display: none; }
  #startScreen .garageNav { padding-top: 0; }
  #startScreen .pickBtn { font-size: 8px; padding: 2px 5px 1px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  #startScreen .garageStage { height: 84px; min-height: 0; }
  #startScreen #vehiclePreview { height: 84px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  #startScreen .modeNote { display: block; margin-top: 3px; font-size: 8.5px; line-height: 1.2; }
  #startScreen .modeNote .noteLine { display: inline; }
  #startScreen .modeNote .noteLine + .noteLine::before { content: "  /  "; color: rgba(227,178,60,0.7); }
  #startScreen .statBars { display: flex; gap: 2px; padding-top: 3px; }
  #startScreen .garageTag { display: block; font-size: 8px; }
  #startScreen .quickControls { display: flex; margin-top: 5px; font-size: 8px; gap: 4px 10px; }
  #startScreen .quickControls b { font-size: 7px; padding: 1px 4px; }
  #startScreen .menuBest { display: inline; }
  #startScreen .garageStage { height: 96px; }
  #startScreen #vehiclePreview { height: 96px; }
}

/* ---------- special power ---------- */
.specialSlot {
  width: 132px;
  border-color: #b06ad8;
  background: linear-gradient(160deg, rgba(58,32,66,0.94), rgba(34,22,38,0.92));
}
.specialSlot::after {
  background: repeating-linear-gradient(90deg, #b06ad8 0 10px, var(--gold) 10px 20px, #6ad8ff 20px 30px, var(--plum) 30px 40px);
}
.specialSlot .slotIcon { color: #d7a6ff; }
.specialAmmo { color: #d7a6ff; font-size: 25px; }
.specialSlot.ready {
  border-color: #e2a8ff;
  box-shadow: inset 0 0 0 2px rgba(42,26,20,0.65), 0 0 22px rgba(176,106,216,0.65);
}
.specialSlot.ready::before {
  content: "READY";
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 7px; letter-spacing: 1.6px; font-weight: 700; color: #2a1a14;
  background: #e2a8ff; border-radius: 4px; padding: 1px 6px;
}
.specialBtn {
  width: 58px; height: 58px; font-size: 7.5px; grid-column: 1; grid-row: 2;
  background: radial-gradient(circle at 40% 30%, #b06ad8, #4b2a5e 72%);
  border-color: #e2a8ff; opacity: 0.5;
}
.specialBtn.ready { opacity: 1; box-shadow: 0 0 24px rgba(176,106,216,0.75), inset 0 0 18px rgba(42,26,20,0.4); }
.specialBtn:disabled { filter: grayscale(0.5); }
@media (max-width: 900px) { .specialSlot { width: 110px; } .specialAmmo { font-size: 22px; } }
@media (max-width: 720px) { .specialSlot { width: 100px; } .specialAmmo { font-size: 20px; } }
@media (max-height: 560px) and (orientation: landscape) { .specialBtn { width: 50px; height: 50px; font-size: 7px; } }

.garageSpecial {
  margin-top: 5px; font-size: 8.5px; letter-spacing: 1.5px; font-weight: 700;
  color: #d7a6ff; text-transform: uppercase;
}
.garageSpecial b { color: #fff0ff; }

/* Compact start screen for short landscape phones: keep the garage and the start button on screen. */
@media (max-height: 620px) and (orientation: landscape) {
  #startScreen { padding: 6px calc(12px + var(--safe-r)) 6px calc(12px + var(--safe-l)); }
  #startScreen .startInner { padding: 0; width: min(1000px, 100%); }
  #startScreen .eyebrow,
  #startScreen .tagline,
  #startScreen .blurb,
  #startScreen .modeNote,
  #startScreen .quickControls,
  #startScreen .menuFoot { display: none !important; }
  #startScreen h1 { font-size: clamp(22px, 5.6vh, 40px); text-shadow: 3px 3px 0 var(--rust), 5px 5px 0 rgba(42,26,20,0.85); }
  #startScreen .titleStripe { margin-top: 4px; height: 5px; }
  #startScreen .modeBar { margin-top: 4px; gap: 3px 8px; }
  #startScreen .pickLabel { font-size: 7px; }
  #startScreen .pickBtn { font-size: 8px; padding: 2px 6px 1px; }
  #startScreen .garage { margin-top: 4px; padding: 5px 7px; gap: 4px 9px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  #startScreen .garageStage { height: 92px; min-height: 0; }
  #startScreen #vehiclePreview { height: 92px; }
  #startScreen .garageKicker,
  #startScreen .garageBlurb,
  #startScreen .garageTag,
  #startScreen .statBars { display: none !important; }
  #startScreen .garageName { font-size: 17px; }
  #startScreen .garageInfo { justify-content: center; }
  #startScreen .garageNav { padding-top: 0; }
  #startScreen .garageArrow { width: 26px; height: 22px; }
  #startScreen .garageDots { gap: 4px; }
  #startScreen .garageDot { width: 7px; height: 7px; }
  #startScreen .startBtns { margin-top: 4px; gap: 6px; }
  #startScreen .startBtns .btn span { padding: 6px 18px 5px; font-size: 11px; }
}

#scene { filter: saturate(1.12) contrast(1.04); }
