/* The scene fills the app; the two camera modes share lifecycle and native controls. */
#app > .racing-shell {
  position: relative;
  isolation: isolate;
  padding: 0;
  background: #274634 url("/assets/racing/colombo-circuit.jpg") center/cover;
  color: #19344a;
}
#app > .racing-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #14362740;
  backdrop-filter: blur(12px);
  z-index: -1;
}
#app .racing-shell .arcade-main {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
}
#app .racing-shell .game-title-row,
#app .racing-shell .arcade-toolbar {
  display: none;
}
#app .racing-shell .arcade-stage {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#app .racing-shell .arcade-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none;
}
#app .racing-shell[data-race-players="3"] .arcade-canvas,
#app .racing-shell[data-race-players="4"] .arcade-canvas {padding-inline:32px;}
#app .racing-shell[data-race-mode="circuit"] .arcade-status {display:none;}
#app .racing-shell .site-header {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  height: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  z-index: 4;
  pointer-events: none;
}
#app .racing-shell .site-header button {
  pointer-events: auto;
}
#app .racing-shell .brand-button,
#app .racing-shell .pause-game {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 15px;
  border: 1px solid #fffc;
  background: #fffff1e8;
  color: #244159;
  box-shadow:
    0 3px 12px #112d3d35,
    inset 0 1px white;
  font-size: 0;
  padding: 0;
}
#app .racing-shell .brand-button::before {
  content: "⌂";
  font: 700 29px system-ui;
}
#app .racing-shell .brand-mark,
#app .racing-shell .brand-dot {
  display: none;
}
#app .racing-shell .pause-game::before {
  content: "Ⅱ";
  font: 800 25px system-ui;
}
#app .racing-shell .pause-game {
  position: absolute;
  right: 0;
  top: 0;
}
#app .racing-shell .pause-game[hidden] {
  display: none;
}
#app .racing-shell .all-games,
#app .racing-shell .reset-game,
#app .racing-shell .fullscreen-button {
  display: none;
}
#app .racing-shell .race-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  background: #fffff1e8;
  padding: 9px 25px;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.6px;
  box-shadow: 0 2px 12px #19344820;
  white-space: nowrap;
}
#app .racing-shell .arcade-status {
  position: absolute;
  right: 56px;
  top: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 15px;
  background: #fffff1e8;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 12px #19344820;
  white-space: nowrap;
}
#app .racing-shell[data-race-mode="circuit"] .race-title {
  display: none;
}
#app .racing-shell[data-race-mode="circuit"] .arcade-status {
  font-size: 11px;
}
#app .racing-shell .scoreboard {
  position: absolute;
  top: 54px;
  left: 0;
  display: flex;
  gap: 8px;
  max-width: 100%;
}
#app .racing-shell .score-tile {
  background: #fffff1e8;
  border: 1px solid #fff9;
  border-radius: 14px;
  padding: 7px 12px;
  gap: 7px;
  box-shadow: 0 2px 8px #19344822;
}
#app .racing-shell .score-tile strong {
  color: #244159;
}
#app .racing-shell .score-value {
  font-size: 14px;
  color: #244159;
}
#app .racing-shell .race-lives {
  font-size: 12px;
  color: var(--player);
  letter-spacing: 1px;
}
#app .racing-shell[data-race-mode="circuit"] .scoreboard {
  display: none;
}
#app .racing-shell .arcade-controls {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: block;
  margin: 0;
}
#app .racing-shell .control-panel {
  position: absolute;
  display: grid;
  grid-template-columns: 52px minmax(42px, 1fr) 52px;
  align-items: center;
  gap: 7px;
  width: 202px;
  min-height: 66px;
  padding: 7px;
  border-radius: 24px;
  background: #fffff0ec;
  border: 2px solid #fff9;
  box-shadow:
    0 4px 14px #18332355,
    inset 0 1px white;
  pointer-events: auto;
}
#app .racing-shell .control-panel button {
  padding: 0;
  min-width: 48px;
  min-height: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(#fffef8, #f5f1df);
  border: 1px solid #e7e2d1;
  color: var(--player);
  font-size: 28px;
  box-shadow: 0 3px 0 #d4cebd;
  touch-action: none;
}
#app .racing-shell .control-panel button.is-held,
#app .racing-shell .control-panel button:active {
  background: var(--player);
  color: white;
  box-shadow: 0 1px 0 #a7a18f;
  transform: translateY(2px);
}
#app .racing-shell .control-panel button:focus-visible {
  outline: 3px solid #122d53;
  outline-offset: 3px;
}
#app .racing-shell .control-panel button:disabled {
  opacity: 0.65;
  cursor: default;
}
#app .racing-shell .race-driver {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
}
#app .racing-shell .race-driver strong {
  background: var(--player);
  color: white;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 14px;
}
#app .racing-shell .race-driver span {
  font-size: 13px;
  font-weight: 800;
}
#app .racing-shell .control-panel[data-seat="1"] {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}
#app .racing-shell .control-panel[data-seat="2"] {
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}
#app .racing-shell .control-panel[data-seat="3"] {
  left: calc(max(8px, env(safe-area-inset-left)) - 67px);
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}
#app .racing-shell .control-panel[data-seat="4"] {
  right: calc(max(8px, env(safe-area-inset-right)) - 67px);
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}
#app .racing-shell[data-race-mode="solo"] .control-panel {
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: auto;
  transform: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  grid-template-columns: 74px 1fr 74px;
  pointer-events: none;
}
#app .racing-shell[data-race-mode="solo"] .control-panel button {
  pointer-events: auto;
  min-height: 66px;
  height: 66px;
  border-radius: 22px;
  background: #fffcedb8;
  border: 2px solid #fff8;
  color: #fff;
  text-shadow: 0 1px 3px #254152;
  font-size: 34px;
  box-shadow: 0 4px 18px #203d4a30;
}
#app .racing-shell[data-race-mode="solo"] .race-driver {
  visibility: hidden;
}
#app .racing-shell > .arcade-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #1c343254;
  backdrop-filter: blur(9px);
  padding: 20px;
}
#app .racing-shell > .arcade-overlay[hidden] {
  display: none;
}
#app .racing-shell > .arcade-overlay:has(> [data-racing-entry="story"]) {
  inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  align-items: safe center;
}
#app .racing-shell .arcade-overlay-card {
  width: 100%;
  min-width: 0;
  background: linear-gradient(#fffef4, #f2f5e8);
  color: #244159;
  border: 2px solid #fff9;
  border-radius: 28px;
  padding: 24px;
  max-width: 450px;
  box-shadow: 0 16px 60px #123c3c55;
}
#app .racing-shell .arcade-overlay-card h2 {
  font-size: 32px;
  color: #244159;
  letter-spacing: -1px;
}
#app .racing-shell .arcade-overlay-card p {
  font-size: 12px;
  color: #4c6570;
}
#app .racing-shell .overlay-icon {
  color: #397be6;
}
#app .racing-shell .primary {
  background: linear-gradient(#529aee, #3479cc);
  border: 2px solid #fff9;
  border-radius: 16px;
  box-shadow: 0 3px 0 #2868b4;
}
#app .racing-shell .primary:disabled {
  opacity: 0.65;
  cursor: wait;
}
#app .racing-shell .text-button {
  color: #31576a;
}
#app .racing-shell .results > div {
  color: #244159;
  border-color: #dce6db;
}
#app .racing-shell:has(> .arcade-overlay:not([hidden])) .site-header {
  visibility: hidden;
}
#app .racing-shell .countdown-number {
  color: #3b83d6;
}
@media (max-width: 600px) {
  #app .racing-shell .race-title {
    font-size: 16px;
    padding: 11px 15px;
    left: 46%;
  }
  #app .racing-shell .arcade-status {
    top: 54px;
    right: 0;
    font-size: 12px;
    min-height: 32px;
    padding: 5px 10px;
  }
  #app .racing-shell .scoreboard {
    gap: 4px;
    top: 54px;
    max-width: calc(100% - 50px);
  }
  #app .racing-shell .score-tile {
    padding: 6px;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 115px;
  }
  #app .racing-shell .score-tile strong {
    font-size: 9px;
  }
  #app .racing-shell .score-value {
    font-size: 11px;
  }
  #app .racing-shell .race-lives {
    font-size: 9px;
  }
  #app .racing-shell[data-race-mode="circuit"] .arcade-status {
    top: 48px;
  }
  #app .racing-shell .control-panel {
    width: 184px;
    grid-template-columns: 48px minmax(35px, 1fr) 48px;
    gap: 5px;
    padding: 6px;
    min-height: 62px;
  }
  #app .racing-shell .control-panel[data-seat="3"] {
    left: -56px;
  }
  #app .racing-shell .control-panel[data-seat="4"] {
    right: -56px;
  }
  #app .racing-shell .control-panel[data-seat="1"] {
    bottom: 12px;
  }
  #app .racing-shell .control-panel[data-seat="2"] {
    top: 12px;
  }
  #app .racing-shell .race-driver strong {
    font-size: 12px;
    padding: 3px 9px;
  }
  #app .racing-shell .race-driver span {
    font-size: 11px;
  }
}
@media(max-width:600px) and (orientation:portrait){
 #app .racing-shell[data-race-players="3"] .arcade-canvas,
 #app .racing-shell[data-race-players="4"] .arcade-canvas{padding-inline:40px;}
 #app .racing-shell[data-race-mode="solo"] .arcade-status{top:104px;right:50%;transform:translateX(50%);}
 #app .racing-shell[data-race-mode="solo"] .scoreboard{max-width:100%;right:0;}
 #app .racing-shell[data-race-mode="solo"] .score-tile{flex:1;max-width:none;justify-content:center;}
}
@media (max-height: 400px) {
  #app .racing-shell .race-title {
    font-size: 16px;
    padding: 11px 20px;
  }
  #app .racing-shell .scoreboard {
    top: 48px;
  }
  #app .racing-shell .score-tile {
    padding: 5px 8px;
  }
  #app .racing-shell .control-panel {
    min-height: 58px;
    padding: 5px;
    border-radius: 20px;
  }
  #app .racing-shell .control-panel[data-seat="1"] {
    bottom: 6px;
  }
  #app .racing-shell .control-panel[data-seat="2"] {
    top: 6px;
  }
  #app .racing-shell[data-race-mode="circuit"] .arcade-status {
    right: 50px;
    top: 0;
  }
  #app .racing-shell[data-race-mode="solo"] .control-panel {
    bottom: 8px;
  }
  #app .racing-shell .arcade-overlay-card {
    padding: 15px 22px;
    max-width: 500px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #app .racing-shell button {
    transition: none;
  }
}
/* Solo controls: proportional wheel and accelerator, with a compact digital instrument dial. */
#app .racing-shell[data-race-mode="solo"] {background:#adc8d1;}
#app .racing-shell[data-race-mode="solo"] .control-panel {display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;gap:12px;padding:0;}
#app .racing-shell[data-race-mode="solo"] .steering-wheel {width:clamp(140px,22vw,184px);aspect-ratio:1;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;filter:drop-shadow(0 7px 8px #07192370);border-radius:50%;}
.steering-wheel svg {width:100%;height:100%;display:block;transform:rotate(var(--wheel-angle,0deg));transition:transform .18s ease-out;}
.steering-wheel.is-steering {cursor:grabbing;}
.steering-wheel.is-steering svg {transition:none;}
.steering-wheel:focus-visible {outline:3px solid #b6ecff;outline-offset:3px;}
.wheel-shadow {fill:#0c1a2422;stroke:#07131bdd;stroke-width:23;}
.wheel-rim {fill:none;stroke:#243541;stroke-width:17;}
.wheel-stitch {fill:none;stroke:#6e8a99;stroke-width:1;stroke-dasharray:2 4;}
.wheel-spokes {fill:url(#wheel-metal);stroke:#263b49;stroke-width:1;}
.wheel-marker {fill:none;stroke:#bceeff;stroke-width:17;}
.wheel-hub {fill:#172a38;stroke:#9fb4c1;stroke-width:2;}
.wheel-emblem {fill:none;stroke:#c4e9ef;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;}
#app .racing-shell[data-race-mode="solo"] button[data-action="throttle"] {display:grid;justify-items:center;align-content:center;gap:8px;pointer-events:auto;width:76px;min-width:64px;height:104px;margin:0 2px 0 0;border:1px solid #c7e2ea8c;border-radius:22px;background:linear-gradient(150deg,#3c6475ed,#172d3be8);box-shadow:inset 0 1px #e6f9ff60,0 6px 20px #07192360;color:#edfaff;font-size:12px;font-weight:800;letter-spacing:2px;text-shadow:none;}
#app .racing-shell[data-race-mode="solo"] button[data-action="throttle"].is-held {background:linear-gradient(150deg,#62999e,#294c59);transform:translateY(3px);}
.pedal-grip {font-size:35px;line-height:1;opacity:.65;transform:scaleX(1.1);}
#app .racing-shell[data-race-mode="solo"] .scoreboard {display:none;}
#app .racing-shell[data-race-mode="solo"] .race-title {font-size:15px;letter-spacing:.08em;text-transform:uppercase;background:#142b34d9;color:#f4f0dd;box-shadow:none;}
#app .racing-shell[data-race-mode="solo"] .arcade-status {top:55px;right:0;transform:none;background:#142b34d9;color:#f4f0dd;min-height:32px;}
.driving-hud {position:absolute;right:max(18px,env(safe-area-inset-right));bottom:140px;width:156px;z-index:4;color:#f0faff;pointer-events:none;filter:drop-shadow(0 4px 8px #06121b70);}
.speed-dial {position:relative;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,#112431e8 30%,#112431ad 68%,transparent 69%);}
.speed-dial>svg {position:absolute;inset:0;width:100%;height:100%;}
.speed-track,.speed-arc {fill:none;stroke-width:5;stroke-dasharray:75 100;transform:rotate(135deg);transform-origin:72px 72px;stroke-linecap:round;}
.speed-track {stroke:#aac9dc35;}
.speed-arc {stroke:#a7eaff;stroke-dasharray:0 100;transition:stroke-dasharray .12s linear;}
.speed-tick {stroke:#c5dbe478;stroke-width:1;}
.speed-reading {position:absolute;inset:30% 0 auto;display:grid;justify-items:center;gap:4px;}
.drive-speed {font:500 44px/.95 system-ui;font-variant-numeric:tabular-nums;letter-spacing:-2px;}
.speed-reading>span {font:600 9px/1 system-ui;letter-spacing:2px;color:#b8cedb;}
.drive-gear {position:absolute;bottom:7%;left:calc(50% - 14px);width:28px;height:24px;display:grid;place-items:center;border:1px solid #c0e9f350;border-radius:7px;background:#142c3b;color:#b7efff;font:600 12px system-ui;}
.driving-hud .drive-audio {display:block;margin:-1px auto 0;font:11px system-ui;color:#d8edf6;border:1px solid #c2e8f044;border-radius:14px;background:#112431ce;min-width:88px;min-height:36px;pointer-events:auto;padding:7px 12px;}
.driving-hud .sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}
#app .racing-shell:has(> .arcade-overlay:not([hidden])) .driving-hud {visibility:hidden;}
@media(max-width:600px){.driving-hud{width:136px;bottom:136px;}.drive-speed{font-size:40px;}}
@media(max-width:380px){#app .racing-shell[data-race-mode="solo"] .control-panel{left:10px;right:10px;}#app .racing-shell[data-race-mode="solo"] .steering-wheel{width:132px;}}
@media(max-height:450px){
 #app .racing-shell[data-race-mode="solo"] .steering-wheel{width:120px;}
 #app .racing-shell[data-race-mode="solo"] button[data-action="throttle"]{height:82px;width:66px;gap:2px;}
 .driving-hud{bottom:104px;right:18px;width:116px;}.drive-speed{font-size:32px;}.driving-hud .drive-audio{min-height:30px;padding:5px 10px;}
 #app .racing-shell[data-race-mode="solo"] .arcade-status{top:50px;}
}
@media(prefers-reduced-motion:reduce){.steering-wheel svg,.speed-arc{transition:none;}}
/* Restrained colour grade for the illustration-inspired solo coastal scene. */
#app .racing-shell[data-race-mode="solo"] .arcade-canvas {
  filter: saturate(1.12) contrast(1.03);
}
.scenery-test-badge {position:absolute;z-index:3;top:calc(env(safe-area-inset-top,0px) + 66px);left:12px;padding:5px 10px;border-radius:99px;background:#123d50d9;color:#fff;font:600 11px system-ui;pointer-events:none;}
@media(max-height:500px){.scenery-test-badge{top:8px;left:145px;font-size:10px;}}
#app .racing-shell .tap-steering {display:grid;gap:8px;pointer-events:auto;justify-items:center;}
#app .racing-shell .tap-arrows {display:flex;gap:12px;}
#app .racing-shell[data-tap-steering="true"] .control-panel .tap-arrows button {width:80px;height:80px;min-height:0;min-width:64px;padding:0;border-radius:20px;border:1px solid #c7e2eaaa;background:linear-gradient(145deg,#3c6475f5,#172d3bf0);color:#f2fbff;font-size:30px;box-shadow:0 5px 14px #07192360;touch-action:none;}
#app .racing-shell[data-tap-steering="true"] .control-panel .tap-arrows button.is-held {background:#60919d;transform:translateY(2px);}
#app .racing-shell .tap-feedback {color:#fff;background:#143347c9;border-radius:20px;padding:4px 9px;font:600 11px system-ui;}
@media(max-height:500px){#app .racing-shell[data-tap-steering="true"] .control-panel .tap-arrows button{width:70px;height:66px;font-size:28px;}#app .racing-shell .tap-steering{gap:4px;}}
.drive-progress {position:absolute;top:calc(env(safe-area-inset-top,0px) + 101px);left:max(18px,env(safe-area-inset-left,0px));width:min(260px,calc(100% - 36px));height:4px;overflow:hidden;border-radius:4px;background:#f4faff45;pointer-events:none;}
.drive-progress span {display:block;width:var(--race-progress,0%);height:100%;background:#b9f3e6;}
@media(max-height:500px){.drive-progress{top:calc(env(safe-area-inset-top,0px) + 83px);height:3px;width:160px;}}

#app .race-ghost-option {
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:9px 0;
  text-align:left;
}
#app .race-ghost-option input { width:18px; height:18px; flex:none; }
#app .race-ghost-option small { display:block; line-height:1.35; }
#app .race-start-shot[data-mode="countdown"] > .arcade-overlay {
  background:none;
  backdrop-filter:none;
  align-items:start;
  padding-top:calc(env(safe-area-inset-top) + 16px);
}
#app .race-start-shot[data-mode="countdown"] .arcade-overlay-card {
  background:none;
  border:0;
  box-shadow:none;
  padding:0;
}
#app .race-start-shot[data-mode="countdown"] .arcade-overlay-card :is(h2,p) { display:none; }
#app .race-start-shot[data-mode="countdown"] .countdown-number {
  color:white;
  text-shadow:0 2px 7px #142637;
}

#app .colombo-setup { text-align:left; margin:.65rem 0; }
:is(#app,.garage-showroom) .colombo-choice { display:flex; justify-content:space-between; align-items:center; gap:.75rem; }
:is(#app,.garage-showroom) .colombo-choice select { font-size:16px; max-width:68%; }
#app .colombo-garage { margin-top:.7rem; border-block:1px solid #819ca16b; padding:.65rem 0; }
#app .colombo-garage summary { cursor:pointer; }
#app .colombo-points { float:right; }
#app .colombo-garage .colombo-choice { margin-top:.65rem; }
:is(#app,.garage-showroom) .colombo-parts > div { display:grid; grid-template-columns:1fr auto; gap:.45rem; align-items:center; padding:.35rem 0; }
:is(#app,.garage-showroom) .colombo-parts small { display:block; }
:is(#app,.garage-showroom) .colombo-parts button { width:auto; min-height:40px; padding:.4rem .55rem; }
:is(#app,.garage-showroom) .colombo-parts button:disabled { opacity:.55; }
#app .colombo-explore-setup :is(.learning-level,.race-ghost-option) { display:none; }
#app .colombo-pedals { display:flex; gap:6px; align-items:flex-end; }
#app .racing-shell[data-race-mode="solo"] button[data-action="brake"] {
  pointer-events:auto; touch-action:none; min-width:54px; height:54px; padding:0 .3rem;
  border:1px solid #c7e2ea8c; border-radius:14px; background:#4b3437; color:#fff;
  font-size:12px; font-weight:800; text-transform:uppercase;
}
#app .racing-shell[data-race-mode="solo"] button[data-action="brake"].is-held { background:#a34c45; }

#app .racing-shell[data-race-mode="solo"] button[data-action="reverse"] {
  min-width:56px; height:54px; padding:0 .35rem; color:#edfaff; background:#233f52;
  border:1px solid #c7e2ea8c; border-radius:14px; font-size:12px; font-weight:800;
  pointer-events:auto; touch-action:none;
}
#app .racing-shell[data-race-mode="solo"] button[data-action="reverse"][hidden] { display:none; }
#app .racing-shell[data-race-mode="solo"] button[data-action="reverse"].is-held { background:#3c637a; }
@media (max-width:420px) {
  #app .racing-shell[data-race-mode="solo"][data-manual-drive="true"] .control-panel { gap:6px; }
  #app .racing-shell[data-manual-drive="true"] .tap-arrows { gap:6px; }
  #app .racing-shell[data-manual-drive="true"][data-tap-steering="true"] .tap-arrows button {
    width:clamp(50px,16.8vw,70px); min-width:0; height:60px;
  }
  #app .racing-shell[data-race-mode="solo"][data-manual-drive="true"] button[data-action="throttle"] { width:64px; }
}
#app .colombo-explorer { position:absolute; z-index:5; top:calc(env(safe-area-inset-top,0px) + 114px); left:max(18px,env(safe-area-inset-left,0px)); display:grid; justify-items:start; gap:.4rem; color:#fff; text-shadow:0 1px 4px #142637; font-weight:700; pointer-events:none; }
#app .colombo-explorer button { pointer-events:auto; touch-action:none; min-height:40px; padding:.5rem .8rem; border:1px solid #f4e2b7; border-radius:12px; background:#173d48; color:white; }
#app .colombo-explorer button[aria-pressed="true"] { background:#775115; }
#app .colombo-explorer[hidden], #app .colombo-explorer button[hidden] { display:none; }

#app .colombo-garage-link { width:100%; margin-top:.65rem; display:flex; justify-content:space-between; align-items:center; }
.garage-showroom {
  position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none;
  margin:0; border:0; box-sizing:border-box; overflow:hidden;
  padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color:#f3f5f8; background:#121923; color-scheme:dark;
}
.garage-showroom[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.garage-showroom::backdrop { background:#151c25; }
.garage-showroom header {
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px;
  padding:max(10px,env(safe-area-inset-top)) 14px 10px; background:#171e28;
}
.garage-showroom h2 { margin:0; font-size:clamp(20px,4.8vw,28px); letter-spacing:-.025em; }
.garage-showroom header strong { border:1px solid #886332; border-radius:11px; color:#ffd58d; padding:.55rem .75rem; white-space:nowrap; }
.garage-showroom button {
  box-sizing:border-box; border:1px solid #536272; background:#27323f; color:inherit;
  border-radius:10px; min-height:44px; padding:.45rem .65rem; font:inherit; touch-action:manipulation;
}
.garage-showroom button:focus-visible { outline:2px solid #fff; outline-offset:-4px; }
.garage-showroom [data-garage-back],.garage-orbit button { width:44px; padding:0; font-size:27px; line-height:1; }
.garage-stage { position:relative; min-height:0; background:#1d2b35; overflow:hidden; }
.garage-stage canvas { display:block; width:100%; height:100%; touch-action:none; }
.garage-loading { position:absolute; inset:42% 12px auto; margin:0 auto; max-width:310px; background:#121923ed; border-radius:12px; padding:14px; text-align:center; }
.garage-orbit {
  position:absolute; bottom:8px; left:12px; right:12px; pointer-events:none;
  display:flex; align-items:center; justify-content:space-between;
  color:#fff; text-shadow:0 1px 5px #10151d; font-size:13px;
}
.garage-orbit button { pointer-events:auto; background:#1c2732db; }
.garage-controls { padding:10px 12px 2px; background:#151d28; min-width:0; max-height:min(48dvh,440px); overflow:auto; }
.garage-controls nav { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.garage-controls nav button { padding:0 .15rem; font-size:clamp(12px,3vw,15px); font-weight:700; }
.garage-controls nav button[aria-pressed="true"],.garage-showroom .garage-equip { background:#ffb741; color:#22201b; border-color:#ffca73; }
.garage-options { display:flex; gap:8px; overflow-x:auto; scroll-snap-type:x proximity; touch-action:pan-x; padding:9px 1px 6px; }
.garage-options button {
  scroll-snap-align:start; flex:0 0 clamp(110px,39%,210px); display:grid; justify-items:center; align-content:center;
  gap:4px; min-height:98px; line-height:1.15; padding:6px 4px; background:#27323f; font-size:13px;
}
.garage-options button[aria-pressed="true"] { border:2px solid #ffb741; }
.garage-options small { color:#e1be80; font-size:11px; }
.garage-rim { width:clamp(42px,11vw,65px); aspect-ratio:1; border-radius:50%; border:5px solid var(--rim); box-shadow:0 0 0 2px #121923, inset 0 0 0 2px #263039; background:radial-gradient(circle, var(--rim) 0 21%,transparent 22%),repeating-conic-gradient(var(--rim) 0 var(--spoke),#11171e var(--spoke) var(--pitch)); }
.garage-swatch { width:clamp(38px,10vw,60px); aspect-ratio:1; border-radius:50%; border:1px solid #b0bcc5; background:linear-gradient(156deg,#fff8,transparent 43%,#0005),var(--paint); }
.garage-bumper { width:clamp(53px,15vw,76px); aspect-ratio:2; border-radius:22% 22% 18% 18%; border:4px solid #8c9fae; background:repeating-linear-gradient(#172029 0 4px,#414e59 5px 7px); }
.garage-bumper[data-sport="true"] { border-width:2px 6px 6px; transform:perspective(40px) rotateX(-9deg); border-radius:16% 16% 36% 36%; }
.garage-showroom .garage-equip { width:100%; font-weight:800; }
.garage-showroom .garage-equip:disabled,.garage-showroom button:disabled { color:#d9e2e9; border-color:#536272; background:#27323f; opacity:.75; }
.garage-status { min-height:1em; color:#edcb8b; margin:4px 0 2px; font-size:12px; }
.garage-showroom .colombo-choice { margin-top:8px; }
.garage-showroom .colombo-stats { font-size:13px; margin:.45rem 0; }
.garage-showroom summary { cursor:pointer; min-height:36px; display:list-item; }
@media (orientation:landscape) and (max-height:650px){
  .garage-showroom[open] { grid-template-columns:minmax(0,1fr) minmax(245px,37%); grid-template-rows:auto minmax(0,1fr); }
  .garage-showroom header { grid-column:1/-1; }
  .garage-controls { max-height:none; }
}

#app .racing-shell[data-race-mode="solo"] button[data-action="nitrous"] {
  position:absolute; right:80px; bottom:60px; min-width:60px; min-height:42px;
  padding:0 .55rem; border:1px solid #8ce2fa; border-radius:14px; color:#effcff;
  background:#185575; font-size:12px; font-weight:800; pointer-events:auto; touch-action:none;
  text-transform:uppercase;
}
#app .racing-shell[data-race-mode="solo"] button[data-action="nitrous"][hidden] { display:none; }
#app .racing-shell[data-race-mode="solo"] button[data-boosting="true"] { background:#0f7795; box-shadow:0 0 14px #46d7fa70; }
.garage-orbit button { touch-action:none; }

@media(max-height:500px) {
  #app .racing-shell[data-race-mode="solo"] button[data-action="nitrous"] { right:72px; bottom:55px; min-height:40px; }
}

.garage-nitrous { display:grid; gap:6px; padding:8px 0 0; }
.garage-nitrous p,.garage-nitrous small { margin:0; font-size:13px; }
.garage-nitrous small { color:#edcb8b; }
.garage-nitrous small:empty { display:none; }
.garage-controls button[data-tab="nitrous"][aria-pressed="false"] { color:#ffce83; border-color:#886332; }
@media (orientation:landscape) and (max-height:650px) {
  .garage-controls nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

.colombo-minimap {
  width: clamp(108px, 17vw, 172px);
  --route-color: #ffd475;
  overflow: hidden;
  border: 1px solid #b5ced370;
  border-radius: 12px;
  background: #112431ec;
  box-shadow: 0 3px 10px #08161f80;
  color: #fff5df;
  text-shadow: none;
}
.colombo-minimap svg { display: block; width: 100%; height: auto; }
.minimap-roads, .minimap-route { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.minimap-roads { stroke: #8cabb6; stroke-width: 13; }
.minimap-route { stroke: var(--route-color); stroke-width: 16; }
.minimap-dreams { fill: #ffd475; }
.minimap-lotus { fill: #f08fbe; }
.minimap-player { fill: #fff; stroke: #112431; stroke-width: 7; }
@media (max-height: 500px) {
  .colombo-minimap { width: 100px; }
  #app .racing-shell:has(.colombo-minimap:not([hidden])) .colombo-explorer { top: calc(env(safe-area-inset-top, 0px) + 61px); }
}

.speed-trap-panel {
  max-width: 210px;
  padding: 6px 9px;
  border-radius: 9px;
  background: #112431ed;
  color: #fff5df;
  font: 600 12px/1.25 system-ui;
  text-shadow: none;
}
.speed-trap-panel span { display: block; color: #ffd475; }

.minimap-destination {
  display: block;
  width: calc(100% - 6px);
  margin: 0 3px 3px;
  min-height: 34px;
  color: #fff5df;
  background: #243b46;
  border: 1px solid #b5ced370;
  border-radius: 5px;
  font: 600 16px system-ui;
  pointer-events: auto;
}
.minimap-event circle { fill: #203947; stroke: #8dd8f0; stroke-width: 5; }
.minimap-event.discovered circle { fill: #16758f; }
.minimap-event text { fill: white; text-anchor: middle; dominant-baseline: middle; font: 700 34px system-ui; }

.cup-qualification {
  padding: .55rem .7rem;
  border: 1px solid #b5ced35c;
  border-radius: 10px;
}
.cup-status { display: block; font-size: .85em; font-weight: 650; }
.cup-qualification ul { display: grid; gap: .4rem; margin: .45rem 0 0; padding: 0; list-style: none; }
.cup-qualification li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .6rem; }
.cup-qualification li small { grid-column: 1 / -1; }

#app .colombo-cup-setup .learning-level,
#app .cup-rival-choice[hidden],
#app .cup-rival-style[hidden], #app .bridge-setup-choice[hidden], #app .pursuit-difficulty-choice[hidden] { display: none; }
#app .cup-rival-style, #app .cup-lock-note { margin: 0; font-size: .8rem; }

.garage-tuning-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(77px,1fr)); gap: 6px; margin: .45rem 0; }
.garage-tuning-stats div { background: #263744; border-radius: 6px; padding: .3rem .45rem; }
.garage-tuning-stats dt { font-size: .75rem; }
.garage-tuning-stats dd { margin: 0; font-weight: 650; }
.garage-tuning-stats small { display: block; font-size: .65rem; color: #ffe099; }
.garage-engine-preview { margin: .2rem 0; }
.garage-part-status { color: #ffe099; }

.drive-damage {
  box-sizing: border-box;
  padding: .35rem .42rem;
  border: 1px solid #ffc681;
  border-radius: 7px;
  background: #342626f2;
  color: #ffe1af;
  text-align: center;
  font: 650 .69rem/1.25 system-ui;
}

.minimap-service circle { fill: #1b674f; stroke: #9ce9bd; }
#app .colombo-explorer .service-stop-panel button {
  margin-top: 5px;
  min-height: 36px;
  padding: 4px 9px;
  font: inherit;
}

.minimap-target { fill: none; stroke: var(--route-color); stroke-width: 10; }
.minimap-target[hidden] { display: none; }
.minimap-caption { padding: 6px 7px 7px; font: 500 11px/1.25 system-ui; }
.minimap-caption strong { display: block; margin-bottom: 2px; color: var(--route-color); font-size: 12px; }
.destination-guide {
  box-sizing: border-box;
  width: min(390px, calc(100% - 32px));
  max-height: calc(100% - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  padding: 16px;
  border: 1px solid var(--route-color);
  border-radius: 14px;
  background: #112431;
  color: #fff5df;
  text-shadow: none;
  font: 500 14px/1.4 system-ui;
}
.destination-guide::backdrop { background: #07121bbf; }
.destination-guide h2 { margin: 0; font: 750 20px/1.2 system-ui; color: var(--route-color); }
.destination-guide p { margin: 8px 0; }
.destination-guide ul { list-style: none; margin: 10px 0; padding: 0; }
.destination-guide li {
  display: grid;
  grid-template-columns: 1fr auto 1.3fr;
  align-items: baseline;
  gap: 8px;
  padding: 5px 7px;
  border-bottom: 1px solid #b5ced350;
}
.destination-guide li span { text-align: right; }
.destination-guide li:nth-child(1) strong { color: #ffc093; }
.destination-guide li:nth-child(2) strong { color: #c9d8eb; }
.destination-guide li:nth-child(3) strong { color: #ffd475; }
.destination-guide form { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 12px; }
#app .colombo-explorer .destination-guide button { min-height: 44px; touch-action: manipulation; }
#app .colombo-explorer .destination-guide button[value="guide"] {
  background: var(--route-color);
  border-color: var(--route-color);
  color: #10222d;
  font-weight: 750;
}
@media (max-height: 500px) {
  .colombo-minimap svg { max-height: 61px; }
}

.minimap-rejoin {
  fill: none;
  stroke: var(--route-color);
  stroke-width: 11;
  stroke-dasharray: 13 12;
}
.colombo-minimap.is-overview svg { background: #172e39; }
.colombo-minimap.is-overview .minimap-roads path,
.colombo-minimap.is-overview .minimap-route,
.colombo-minimap.is-overview .minimap-rejoin {
  vector-effect: non-scaling-stroke;
  stroke-width: 1.25px;
}
.colombo-minimap.is-overview .minimap-player {
  transform-box: fill-box;
  transform-origin: center;
  scale: 2.4;
}
.minimap-contact {
  margin: 0;
  padding: 5px 7px;
  background: #644332;
  color: #fff3d7;
  font: 650 11px/1.25 system-ui;
}
.minimap-contact[hidden] { display: none; }

.free-drive-result {
  position: absolute;
  z-index: 6;
  top: calc(env(safe-area-inset-top, 0px) + 68px);
  left: 50%;
  box-sizing: border-box;
  width: max-content;
  max-width: min(76%, 360px);
  transform: translateX(-50%);
  padding: 8px 14px;
  border: 1px solid #e5c587;
  border-radius: 12px;
  background: #112431f5;
  box-shadow: 0 4px 16px #13243170;
  color: #fff6df;
  text-align: center;
  pointer-events: none;
}
.free-drive-result[hidden] { display: none; }
.free-drive-result strong { display: block; font: 750 14px/1.25 system-ui; }
.free-drive-result span { display: block; margin-top: 3px; color: #ffd475; font: 650 12px/1.25 system-ui; }

@media (max-height: 500px) {
  .free-drive-result { top: calc(env(safe-area-inset-top, 0px) + 54px); }
}
@media (orientation: portrait) and (max-width: 540px) {
  .free-drive-result {
    top: calc(env(safe-area-inset-top, 0px) + 110px);
    left: auto;
    right: 12px;
    max-width: calc(100% - 150px);
    transform: none;
  }
}

.free-drive-result button {
  pointer-events: auto;
  touch-action: manipulation;
  min-height: 44px;
  margin-top: 6px;
  padding: 5px 12px;
  border: 1px solid #e5c587;
  border-radius: 9px;
  background: #243d4e;
  color: #fff6df;
  font: 700 12px system-ui;
}
.free-drive-result button[hidden] { display: none; }

.minimap-bridge { stroke: #e6bf7a; stroke-width: 11; }
.lotus-bridge-panel {
  box-sizing: border-box;
  width: clamp(108px, 17vw, 172px);
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid #b5ced370;
  border-radius: 10px;
  background: #112431ec;
  color: #fff5df;
  font-size: 12px;
  line-height: 1.25;
  text-shadow: none;
}
.lotus-bridge-panel[hidden] { display: none; }
.lotus-bridge-panel p { margin: 0; }
#app .colombo-explorer .lotus-bridge-panel button {
  padding: 4px;
  min-height: 36px;
  border-radius: 7px;
  font-size: 12px;
}
@media (max-height: 500px) {
  .lotus-bridge-panel { width: 100px; }
}

.police-pursuit-hud {
  width: min(186px,42vw);
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  padding: 8px;
  color: #fff5df;
  background: #152535ef;
  border: 1px solid #c97b60;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.2;
  text-shadow: none;
}
.police-pursuit-hud.pursuit-capture { border-color: #ff977e; }
.police-pursuit-hud.pursuit-capture [role="status"] { color: #ffc4b3; }
.police-pursuit-hud[hidden], .pursuit-tyres:empty { display: none; }
.police-pursuit-hud small { color: #ffd299; }
.police-pursuit-hud .pursuit-tyres { color: #ffac96; }
.minimap-caption[hidden], .minimap-hide-zone[hidden], .minimap-patrols[hidden], .minimap-patrols [hidden], .minimap-pursuit-hazards [hidden], .minimap-destination[hidden] { display: none; }

.after-hours-select { display: grid; gap: 4px; }
.after-hours-select[hidden] { display: none; }
.after-hours-select select {
  width: 100%;
  min-height: 44px;
  padding-inline: 8px;
  border: 1px solid #91a8b4;
  border-radius: 8px;
  background: #f4eff7;
  color: #162936;
  font: 600 16px system-ui;
}
.after-hours-panel { width: clamp(135px, 20vw, 185px); border-color: #db9ced; }
.after-hours-panel strong { color: #efadff; }

.bamba-story-hud button { min-height:44px; padding:7px 10px; font-size:14px; }
.bamba-story-hud button[hidden] { display:none; }

#app .story-dialogue {
  position:absolute; z-index:7; left:50%; top:50%; transform:translate(-50%,-50%);
  width:min(620px,calc(100% - 32px)); max-height:calc(100dvh - 110px);
  display:grid; grid-template-columns:minmax(100px,38%) minmax(0,1fr);
  overflow:auto; border:1px solid #b9a68c; border-radius:20px;
  background:linear-gradient(135deg,#342825f5,#142735f5);
  color:#fff5df; box-shadow:0 14px 50px #0009; text-shadow:none;
}
#app .story-dialogue[hidden] { display:none; }
.story-rider-frame { display:flex; align-items:end; overflow:hidden; min-height:200px; }
.story-rider-frame img { width:100%; height:auto; object-fit:contain; transform-origin:50% 90%; }
.story-dialogue-copy { padding:20px 16px 20px 8px; align-self:center; min-width:0; }
.story-dialogue-copy strong { font-size:18px; }
.story-subtitle { font-size:16px; line-height:1.5; margin:12px 0; }
.story-voice-status { display:block; min-height:2.4em; color:#d9d1c5; }
.story-dialogue-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
#app .story-dialogue button { min-height:44px; padding:9px 12px; font-size:14px; touch-action:manipulation; color:#fff5df; background:#263c49; border:1px solid #b3b8b4; border-radius:10px; }
#app .story-dialogue button:disabled { opacity:.5; }
#app .story-dialogue [data-story-continue] { background:#f1bb68; color:#24282b; font-weight:800; }
#app .story-dialogue [data-story-skip] { background:transparent; }
@keyframes story-rider-speaking {
  0%,100% { transform:rotate(-.35deg) translateY(0); }
  45% { transform:rotate(.35deg) translateY(-2px); }
  70% { transform:rotate(0) translateY(-1px); }
}
.story-dialogue[data-speaking="true"] img { animation:story-rider-speaking 1.6s ease-in-out infinite; }
@media (max-width:420px) {
  #app .story-dialogue { grid-template-columns:minmax(0,1fr); }
  .story-rider-frame { min-height:150px; height:150px; justify-content:center; }
  .story-rider-frame img { width:150px; height:150px; }
  .story-dialogue-copy { padding:8px 18px 16px; }
}
@media (prefers-reduced-motion:reduce) {
  .story-dialogue[data-speaking="true"] img { animation:none; }
}

.pursuit-pressure { display:grid; gap:4px; margin-top:4px; }
.pursuit-pressure[hidden] { display:none; }
.capture-track { height:7px; overflow:hidden; border-radius:5px; background:#ffffff30; }
.capture-track span { display:block; height:100%; background:#67dfb3; }
.pursuit-pressure[data-state="rising"] .capture-track span { background:#ffa482; }
.pursuit-pressure .capture-reason { color:#e6e8e2; }

.garage-controls nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
.garage-progress { padding:8px 0; color:#eef3f7; }
.garage-progress h3,.garage-progress h4 { margin:6px 0; }
.garage-progress p { margin:6px 0; font-size:14px; }
.garage-progress small { display:block; color:#d4deea; font-size:12px; }
.progress-cars { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:8px; margin:10px 0; }
.progress-cars article { display:flex; flex-direction:column; gap:5px; padding:9px; background:#253342; border:1px solid #596a7b; border-radius:10px; }
.progress-cars article[data-locked="true"] { background:#1b2633; }
.progress-car-picture { width:100%; height:70px; }
.progress-cars span { color:#ffda8c; font-size:13px; }
.progress-cars button { margin-top:auto; }
.progress-chapter { border-top:1px solid #526273; padding-top:8px; margin-top:10px; }
.progress-chapter ol { padding-left:22px; }
.progress-chapter li { padding:7px 0; font-size:13px; }
.progress-chapter li strong { display:block; color:#ffda8c; font-size:12px; }
.progress-chapter li[data-mission-status="Complete"] strong { color:#b4e7c5; }

.visibility-status { display:block; margin-bottom:5px; color:#fff0b8; }
.pursuit-notice { position:fixed; z-index:40; top:30%; left:50%; transform:translateX(-50%); max-width:80vw; padding:14px 22px; border:2px solid #ffd58b; border-radius:14px; background:#412619f2; color:#fff5df; font-size:clamp(20px,5vw,30px); font-weight:850; text-align:center; box-shadow:0 6px 24px #0006; pointer-events:none; }
.pursuit-notice[hidden] { display:none; }

.pursuit-meter-labels { display:flex; justify-content:space-between; font-size:11px; font-weight:800; margin-top:6px; }
.pursuit-meter-labels span:first-child { color:#ffb0a5; }
.pursuit-meter-labels span:last-child { color:#a9edc5; }
.pursuit-meter-pair { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.pursuit-meter-pair .capture-track { background:#712e32; }
.pursuit-meter-pair .capture-track span { background:#ff5a51; }
.evade-track { height:7px; border-radius:5px; overflow:hidden; background:#234938; }
.evade-track span { display:block; height:100%; width:0; background:#67e69e; }
.pursuit-pressure[data-sight="seen"] .visibility-status { color:#ffb0a5; }
.pursuit-pressure[data-sight="unseen"] .visibility-status { color:#a9edc5; }
.police-radio-caption { position:absolute; z-index:12; bottom:calc(125px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:80%; padding:8px 13px; border-radius:10px; background:#101e2bf0; color:#edf8ff; font-size:13px; text-align:center; pointer-events:none; }
.police-radio-caption[hidden] { display:none; }

/* Solo Story and Normal entry. */
#app .campaign-mode-choice { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:12px 0; }
#app .campaign-mode-choice button { min-width:0; min-height:44px; padding:8px 3px; overflow-wrap:anywhere; border:1px solid #bbc8ce; border-radius:12px; background:#fff; color:#253b4a; font:inherit; font-weight:700; }
#app .campaign-mode-choice button[aria-expanded="true"] { background:#253f65; border-color:#253f65; color:#fff; }
#app [data-racing-entry="story"] :is(.learning-level,.race-ghost-option),
#app .colombo-setup[hidden], #app .campaign-summary[hidden],
#app .campaign-summary [hidden],
#app .colombo-setup [hidden],
#app [data-colombo-shared] .learning-level,
#app [data-colombo-shared] > .overlay-action,
#app [data-racing-entry="story"]:has(.campaign-entry) > .overlay-action,
#app [data-racing-entry="story"] #game-opening-rules[hidden] { display:none !important; }
#app [data-racing-entry="story"]:has(.campaign-entry) > :is(p:not(.art-load-error):not(#game-opening-rules),.overlay-icon) { display:none; }
#app [data-racing-entry="story"] .game-cover-art { display:none; }
#app .campaign-tryout { width:100%; margin:8px 0 14px; justify-content:center; text-decoration:none; }
.campaign-levels { text-align:left; border-block:1px solid #bac9d2; }
.campaign-level + .campaign-level { border-top:1px solid #bac9d2; }
.campaign-level summary { display:flex; gap:10px; align-items:center; min-height:44px; padding:7px 4px; cursor:pointer; }
.campaign-level summary::before { content:""; flex:none; width:7px; height:7px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
.campaign-level[open] summary::before { transform:translateY(-2px) rotate(45deg); }
.campaign-level small { margin-left:auto; text-align:right; color:#526473; white-space:nowrap; }
.campaign-level .campaign-target { display:block; white-space:normal; text-align:left; font-weight:400; }
.campaign-level ol { margin:0 2px 8px; padding:0; list-style:none; }
.campaign-stage { display:flex; gap:8px; align-items:baseline; min-height:44px; padding:6px 7px 6px 21px; font-size:.86rem; }
a.campaign-stage { color:inherit; border-radius:8px; text-decoration:none; }
a.campaign-stage:hover > span, a.campaign-stage:focus-visible > span { text-decoration:underline; }
.campaign-level li[data-campaign-status="next"] { border-radius:8px; background:#e7eff9; font-weight:700; }
#app .campaign-summary .text-button { min-height:44px; }
.race-prize { display:flex; align-items:center; gap:13px; max-width:fit-content; margin:12px auto; padding:11px 16px; border:1px solid #a9792b; border-radius:15px; background:linear-gradient(135deg,#fff7d9,#f0da9f); color:#442b11; text-align:left; }
.race-prize .race-prize-icon { display:grid; place-items:center; flex:none; width:38px; height:38px; border:2px solid #bd8d36; border-radius:50%; background:#fcdfa0; color:#795015; font-size:24px; }
.race-prize strong,.race-prize small { display:block; }
.race-prize-toast { position:absolute; z-index:13; left:50%; top:calc(env(safe-area-inset-top) + 80px); width:max-content; max-width:calc(100% - 30px); transform:translateX(-50%); pointer-events:none; }
.race-prize-toast .race-prize { margin:0; box-shadow:0 7px 24px #14120044; animation:race-prize-in .35s ease-out both; }
@keyframes race-prize-in { from { opacity:0; transform:translateY(6px) scale(.96); } }
@media(prefers-reduced-motion:reduce){ .race-prize-toast .race-prize { animation:none; } }
.garage-economy { margin:12px 0; padding:12px; border:1px solid #a8b8c2; border-radius:12px; }
.garage-economy dl { display:flex; flex-wrap:wrap; gap:12px 24px; margin:0; }
.garage-economy dt { font-size:13px; }
.garage-economy dd { margin:4px 0; font-size:20px; font-weight:800; }
.garage-economy details { margin-top:10px; }
.garage-economy summary { cursor:pointer; min-height:32px; }
.campaign-opening-hud { position:absolute; z-index:6; left:max(16px,env(safe-area-inset-left)); bottom:230px; width:min(230px,48vw); box-sizing:border-box; border:1px solid #ffd475; border-radius:12px; background:#142735ed; color:#fff5df; padding:12px; font-size:14px; }
.campaign-opening-hud[hidden],.campaign-opening-hud button[hidden] { display:none; }
#app .campaign-opening-hud.is-delivery-failure {
  z-index:30; top:50%; bottom:auto; left:50%; width:min(360px,calc(100vw - 32px)); max-width:none;
  transform:translate(-50%,-50%); padding:20px; text-align:center;
  background:#142735; box-shadow:0 14px 64px #102132a6; pointer-events:auto;
}
#app .is-delivery-failure strong { font-size:1.25rem; }
#app .is-delivery-failure button { width:100%; background:#f9d78e; border-color:#f9d78e; color:#233346; font-weight:800; }
.campaign-opening-hud p { line-height:1.4; margin:8px 0; }
.campaign-opening-hud small { display:block; line-height:1.35; color:#e0d8c7; }
.campaign-opening-hud button { margin-top:12px; min-height:44px; padding:10px; border:1px solid #c5d5dc; border-radius:10px; background:#28465b; color:#fff; font:inherit; }
.campaign-opening-intro .campaign-opening-hud { left:50%; transform:translateX(-50%); bottom:max(24px,env(safe-area-inset-bottom)); width:min(520px,calc(100% - 32px)); }
#app .campaign-opening-intro .control-panel { pointer-events:none; opacity:.4; }
@media(max-height:500px) { .campaign-opening-hud { top:65px; bottom:auto; left:150px; width:min(320px,calc(100vw - 310px)); } .campaign-opening-intro .campaign-opening-hud { top:auto; bottom:16px; } }

#app .race-meeting .control-panel { pointer-events:none; opacity:.3; }

/* Story stills keep the speaker in the scene, with readable dialogue below. */
#app .story-dialogue { left:16px; right:16px; top:64px; bottom:max(16px,env(safe-area-inset-bottom)); transform:none; width:auto; max-height:none; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; background:#142735; overflow:hidden; }
#app .story-rider-frame { height:auto; min-height:0; width:100%; display:block; }
#app .story-rider-frame img { width:100%; height:100%; object-fit:contain; object-position:center; animation:none; }
#app .story-dialogue-copy { padding:14px 18px; align-self:stretch; background:linear-gradient(#213539,#102631); }
#app .story-voice-status { min-height:1.4em; font-size:12px; }
@media(min-width:900px),(max-height:500px) {
 #app .story-dialogue { grid-template-columns:minmax(0,1fr) minmax(300px,45%); grid-template-rows:minmax(0,1fr); }
 #app .story-dialogue-copy { align-self:stretch; display:flex; flex-direction:column; justify-content:center; overflow:auto; }
 #app .story-subtitle { margin:8px 0; }
}

#app .story-rider-frame[hidden] { display:none; }
#app .story-dialogue.is-radio-dialogue { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
#app .story-dialogue.is-radio-dialogue .story-dialogue-copy { overflow:auto; }

/* Brief driving notices sit beside the map, then leave the car view clear. */
#app .campaign-opening-hud.is-route-notice,#app .campaign-opening-hud.is-compact { top:calc(110px + env(safe-area-inset-top)); bottom:auto; left:calc(clamp(108px,17vw,172px) + 32px); width:calc(100% - clamp(108px,17vw,172px) - 48px); max-width:320px; padding:10px; font-size:13px; pointer-events:none; }
#app .campaign-opening-hud.is-compact { width:auto; padding:0; border:0; background:transparent; pointer-events:auto; }
#app .campaign-opening-hud.is-compact strong,#app .campaign-opening-hud.is-compact p,#app .campaign-opening-hud.is-compact small { display:none; }
#app .campaign-opening-hud.is-compact button { margin:0; }
@media(max-height:500px) { #app .campaign-opening-hud.is-route-notice,#app .campaign-opening-hud.is-compact { top:65px; left:150px; width:min(320px,calc(100vw - 310px)); } }

#app .level-one-hud.is-compact strong { display:block; padding:6px 9px; border-radius:9px; background:#142735df; font-size:12px; }

.story-dialogue [data-story-outcome] { display:block; color:#8ef3d3; font-size:13px; font-weight:800; margin-bottom:8px; }
.story-dialogue [data-story-outcome][hidden] { display:none; }

#app .level-one-hud.is-compact { pointer-events:none; }

#app .level-one-hud.is-compact { width:min(320px,calc(100% - clamp(108px,17vw,172px) - 48px)); }

#app .story-page-title { font-size:17px; line-height:1.3; margin:8px 0 0; color:#ffdc82; }
#app .story-subtitle { white-space:pre-line; }
#app .story-dialogue.is-challenge-page .story-dialogue-copy { min-height:0; overflow:auto; justify-content:flex-start; }

/* Pursuit stays below the controls, leaving the road and car unobstructed. */
#app .police-pursuit-hud { position:fixed; z-index:8; left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); bottom:calc(env(safe-area-inset-bottom,0px) + 4px); width:auto; padding:5px 9px; border-radius:9px; background:#10202beb; font-size:11px; pointer-events:none; }
#app .police-pursuit-hud .pursuit-pressure { margin:0; gap:4px; }
#app .police-pursuit-hud :is(.visibility-status,.capture-value,.capture-reason,.pursuit-notice) { display:none; }
#app .police-pursuit-hud .pursuit-meter-labels { margin:0; align-items:center; line-height:12px; font-size:10px; }
#app .police-pursuit-hud .pursuit-state { color:#eff7f8; font-variant-numeric:tabular-nums; }
#app .police-pursuit-hud :is(.capture-track,.evade-track) { height:10px; border-radius:4px; }
#app .racing-shell:has(.police-pursuit-hud:not([hidden])) .control-panel[data-seat="1"] { bottom:calc(env(safe-area-inset-bottom,0px) + 48px); }
#app .racing-shell:has(.police-pursuit-hud:not([hidden])) .tap-feedback { display:none; }
#app .racing-shell:has(.police-pursuit-hud:not([hidden])) .driving-hud { bottom:180px; }
@media(max-height:500px) {
 #app .police-pursuit-hud { padding-block:3px; }
 #app .racing-shell:has(.police-pursuit-hud:not([hidden])) .control-panel[data-seat="1"] { bottom:calc(env(safe-area-inset-bottom,0px) + 39px); }
 #app .racing-shell:has(.police-pursuit-hud:not([hidden])) .driving-hud { bottom:118px; }
}
#app .racing-shell:has(.police-pursuit-hud:not([hidden])) .minimap-caption { display:none; }

/* Interface notes are visually separate from quoted character speech. */
.story-system-note:not([hidden]) { display:block; margin:8px 0; padding:8px 10px; border-left:2px solid #9bced3; background:#ffffff0a; color:#cbd9dc; font-size:12px; line-height:1.4; }

/* Camera toggle stays at the right edge, outside the central driving view. */
#app .racing-shell[data-race-mode="solo"][data-mode="playing"] { touch-action:none; }
.driving-hud .drive-camera { position:absolute;right:0;top:-50px;width:44px;height:44px;min-width:44px;min-height:44px;padding:8px;border:1px solid #c2e8f066;border-radius:13px;background:#112431e8;color:#d8edf6;pointer-events:auto;touch-action:none;display:grid;place-items:center; }
.drive-camera svg { width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round; }
.drive-camera span { position:absolute;right:4px;bottom:2px;font:700 10px system-ui; }
.drive-camera[aria-pressed="true"] { border-color:#a7eaff;background:#23586a; }
@media (orientation:landscape) and (max-height:500px) {
 .driving-hud .drive-camera { right:calc(100% + 8px);top:0; }
}

/* Retain room for all four controls on the narrowest phones. */
@media(max-width:360px){
 #app .racing-shell[data-race-mode="solo"] .control-panel{left:10px;right:10px;gap:4px;}
 #app .racing-shell[data-tap-steering="true"] .control-panel .tap-arrows button{width:72px;height:76px;}
 #app .racing-shell[data-manual-drive="true"][data-tap-steering="true"] .control-panel .tap-arrows button{width:52px;min-width:0;height:60px;}
 #app .racing-shell[data-race-mode="solo"][data-manual-drive="true"] button[data-action="brake"],
 #app .racing-shell[data-race-mode="solo"][data-manual-drive="true"] button[data-action="reverse"]{min-width:48px;width:48px;padding:0;}
 #app .racing-shell[data-race-mode="solo"][data-manual-drive="true"] button[data-action="throttle"]{width:60px;min-width:60px;}
}

/* Driving notices pass through input, while their Retry control remains tappable. */
#app .campaign-opening-hud.is-route-notice button { pointer-events:auto; }

.equipment-swatch {display:block;margin:8px auto;width:48px;height:55px;background:linear-gradient(90deg,var(--gear) 23%,var(--trim) 24% 28%,var(--gear) 29% 71%,var(--trim) 72% 76%,var(--gear) 77%);clip-path:polygon(24% 0,76% 0,100% 24%,87% 43%,75% 30%,75% 100%,25% 100%,25% 30%,13% 43%,0 24%);}
.equipment-swatch[data-gear=helmet] {height:44px;border-radius:48% 48% 35% 35%;clip-path:none;background:linear-gradient(var(--gear) 30%,#101923 31% 59%,var(--trim) 60% 64%,var(--gear) 65%);box-shadow:inset -6px -4px 10px #0005;}
.equipment-tyre {display:block;width:48px;height:48px;margin:10px auto;border:11px solid #222930;border-radius:50%;box-shadow:inset 0 0 0 2px #586572,0 2px 5px #0004;}
.equipment-tyre[data-tread=rain] {border-style:dashed;}
.equipment-tyre[data-tread=semi] {border-color:#131921;border-left-color:#52606b;}

.colombo-story-clock { position:absolute;z-index:5;left:max(14px,env(safe-area-inset-left));top:calc(64px + env(safe-area-inset-top));border:1px solid #92bdc0a0;border-radius:50px;background:#132d39e8;color:#f8efdb;padding:4px 9px;font:700 13px/1.2 system-ui;font-variant-numeric:tabular-nums;pointer-events:none; }
.colombo-story-clock[hidden] { display:none; }
@media (max-height:500px){ .colombo-story-clock { top:calc(36px + env(safe-area-inset-top)); } }

#app .colombo-minimap.story-map-available{border-color:#84e7ec;box-shadow:0 0 0 1px #7ae5f451,0 0 12px #39e3f047}
#app .colombo-explorer button.story-map-open{display:block;width:100%;padding:0;border:0;border-radius:0;background:none;touch-action:manipulation}
#app .colombo-explorer button.story-map-open[hidden]{display:none}
#app .colombo-explorer button.story-map-open:focus-visible{outline:2px solid #e9ffff;outline-offset:-3px}

#app .campaign-summary .colombo-cup-finish{margin:8px 0 12px;padding:10px;border:1px solid #c9a760;border-radius:10px;background:#faf0d0;color:#624613;font-size:1rem;font-weight:750}
#app .racing-shell .online-race-link{
  display:block;width:max-content;max-width:100%;margin:8px auto 0;padding:9px 13px;
  border:1px solid #7d9b8b;border-radius:10px;background:#eef7ef;color:#244d3d;font-weight:700
}
#app .racing-shell .local-team-choice{
  display:flex;align-items:center;justify-content:center;gap:10px;padding:8px;margin:0 auto 9px;
  border:1px solid #abc2b4;border-radius:10px;background:#edf5ed;color:#284539;text-align:left
}
#app .racing-shell .local-team-choice input{width:20px;height:20px;accent-color:#2e634d}
#app .racing-shell .local-team-choice small{font-size:12px}

/* Recovery stays reachable while the driving menus or race dialogs are closed. */
#app .racing-shell .race-recovery{position:absolute;z-index:15;top:calc(8px + env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));display:flex;flex-wrap:wrap;gap:4px;pointer-events:none}
#app .racing-shell .race-recovery button{pointer-events:auto;min-width:44px;min-height:44px;padding:7px 4px;border:1px solid #aacbc0;border-radius:10px;background:#173e36ed;color:#fff;font:650 11px system-ui;letter-spacing:normal}
#app .racing-shell .race-recovery button:disabled{opacity:.5}
#app .racing-shell[data-local-driving] .local-driving-menu{top:auto;bottom:max(12px,env(safe-area-inset-bottom))}
#app .racing-shell[data-local-driving] .local-driving-menu>div{top:auto;bottom:52px}
#app .racing-shell[data-thumb-steering] .driving-hud{top:calc(62px + env(safe-area-inset-top))}

#app .racing-shell .race-recovery .brand-button::before{display:none}

#app.has-game-home .racing-shell .race-recovery{left:calc(max(10px,env(safe-area-inset-left)) + 52px)}

/* Keep the solo mode picker and the public track Studio entry together. */
#app [data-racing-entry="tracks"]:has(.campaign-entry) > :is(.learning-level,.race-ghost-option,.overlay-action,.game-cover-art,.overlay-icon,.game-online-link,.online-race-link,p) { display:none !important; }
#app .my-tracks :is([data-track-studio],[data-track-online]) { display:grid; place-items:center; box-sizing:border-box; min-height:48px; width:min(100%,260px); margin:12px auto; text-decoration:none; }
#app .my-tracks [data-track-online] { border:1px solid #a5b5c2; border-radius:12px; background:#fff; color:#203e54; font-weight:700; }
#app .my-tracks { padding:0; border:0; background:transparent; }
#app .racing-shell:has([data-racing-entry="tracks"]) :is(.race-recovery,.legacy-driving-settings,.arcade-controls) { display:none!important; }

#app .racing-shell > .arcade-overlay:has(> [data-racing-entry="tracks"]) {
  inset:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
  align-items:safe center;
  padding-top:64px;
}

#app .landscape-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:18px 0; }
#app .landscape-choice { display:grid; gap:10px; color:inherit; text-decoration:none; min-width:0; padding:8px; border:1px solid #c0d0c2; border-radius:14px; background:#fffef7; }
#app .landscape-picture { display:block; aspect-ratio:1; border-radius:9px; background:linear-gradient(#89bde5 0%,#cfe4ec 43%,var(--land) 44%,var(--land) 100%); }
#app .landscape-choice:focus-visible { outline:3px solid #2c74b8; outline-offset:3px; }
#app [data-track-screen="choose"] .campaign-entry { margin:0; }
@media(max-height:480px) and (min-width:600px) { #app .landscape-picture { aspect-ratio:2.4; } }
