/* ================= The iPhone app's play screen (body.native) =================
   Only inside the app (ios/, window.skidNative; QA: ?native=1&touch=1). The web
   build keeps its thumb pad. User, 2026-10-23: "hold finger where you wanna go,
   and if you put another finger down that activates handbrake… boost and reverse
   remain as buttons… remove the tooltips and make the fuel and loadouts and
   passenger uis smaller and phone suited".
   Portrait first ("optimize for portrait"). Top: plate, pause, exit sign,
   score. Left edge: the loadout keys. Bottom row: map · fuel strip ·
   speedometer ("should stay bottom right"), with BOOST over REVERSE stacked
   above the speedometer under the right thumb. Landscape keeps the same
   corners. The road and the car get everything else. The whole
   road is the steering surface (engine/input.js POINT), so the HUD lets touches
   through except where a tap means something (slots, buttons). */

/* ---------- POINT steering surface ---------- */
.t-aim { display: none; }
body.native[data-steer='point'] #touch .t-steer { display: none; }
body.native[data-steer='point'] #touch .t-aim { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
body.native #hud { z-index: 5; } /* slots and the rail sit over the steering surface */

/* ---------- no tooltips, no coach ---------- */
body.native :is(#tip, #coach, .coach, .fw-coach, .fwc-marker) { display: none !important; }
body.native #hud [data-ob] { pointer-events: none; }
body.native #hud .rail-item { cursor: default; }

/* ---------- loadout: four icon keys down the left edge ---------- */
body.native #slots { width: auto; top: calc(58px + var(--safe-t)); transform: none; gap: 6px; left: var(--pad-x-l); }
body.native #slots .sl { grid-template-columns: 1fr; justify-items: center; width: 50px; min-height: 0; height: 50px; padding: 0; gap: 2px; place-content: center; border-radius: 12px; }
body.native #slots .sl :is(.cap, .sl-txt b, .sl-txt small, .sl-more) { display: none; }
body.native #slots .sl-ic { width: 26px; height: 26px; }
body.native #slots .sl-txt { width: 34px; gap: 0; justify-items: center; }
body.native #slots .sl-pips { gap: 3px; }
body.native #slots .sl-pips i { width: 8px; height: 4px; }
body.native #slots .sl-meter { height: 3px; }
body.native #slots .sl:active { transform: scale(0.94); }

/* ---------- passengers and parts: one slim strip ---------- */
body.native .rail, body.native.touch .rail { --rail-b: auto; left: 50%; right: auto; top: auto; bottom: calc(var(--row-b) + 48px); width: auto; transform: translateX(-50%); }
body.native .rail :is(.rail-toggle, .rm-glove, .rm-sep:last-of-type) { display: none; }
body.native .rail-mini { height: 30px; padding: 0 8px; gap: 6px; border-radius: 15px; }
body.native .rail-mini .rm-slot { width: 22px; height: 22px; }
body.native .rail-mini kbd { display: none; }
body.native .rail-mini .rm-kg { font-size: 10px; }

/* ---------- map, radio ---------- */
body.native #minimap { left: var(--pad-x-l); right: auto; top: auto; bottom: var(--row-b); width: 92px !important; height: 82px !important; }
body.native #minimap + .zone-name, body.native .minimap-label { display: none; }
body.native #radio { top: calc(108px + var(--safe-t)); bottom: auto; left: 50%; right: auto; width: min(260px, 52vw); transform: translateX(-50%); padding: 6px 10px; }
body.native #radio :is(.rd-dj, .rd-keys, .rd-tag) { display: none; }

/* ---------- bottom row: speedometer in the corner, BOOST / REVERSE above it ---------- */
body.native { --gauge: 96px; --row-b: calc(10px + var(--safe-b)); }
body.native #gauge, body.native.touch #gauge { top: auto !important; left: auto; right: var(--pad-x-r); bottom: var(--row-b); width: var(--gauge); height: var(--gauge); }
body.native #touch .t-pause, body.native.touch #touch .t-pause { left: calc(var(--pad-x-l) + 92px) !important; right: auto !important; margin-left: 0 !important; top: calc(10px + var(--safe-t)); width: 40px; height: 40px; }

/* ---------- fuel and body: a flat strip between the map and the speedometer, no panel ---------- */
body.native .hud-row { display: block; }
body.native #fuel { position: relative; display: grid; gap: 5px; width: 100%; padding: 0; background: none; box-shadow: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.native #fuel .fuel-head { display: flex; align-items: baseline; gap: 6px; height: auto; padding: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
body.native #fuel .fuel-head b { font: 800 9px/1 var(--sans); letter-spacing: 0.16em; color: var(--ink-2); }
body.native #fuel .fuel-pct { font: 800 12px/1 var(--mono); }
body.native #fuel .fuel-range { display: inline; margin-left: auto; font: 700 9px/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-2); }
body.native #fuel .fuel-bar { display: flex; gap: 1px; height: 6px; padding: 0; border-radius: 3px; overflow: hidden; background: rgba(0, 0, 0, 0.45); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
body.native #fuel .fuel-bar i { flex: 1; height: 100%; margin: 0; border-radius: 0; box-shadow: none; }
body.native #fuel .body { display: block; height: auto; padding: 0; }
body.native #fuel .body b { display: none; }
body.native #fuel .body-track { height: 2px; border-radius: 1px; background: rgba(0, 0, 0, 0.45); }
/* The fuel warning rides above the strip as one line. */
body.native #fuel #danger-line { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; padding: 0; background: none; box-shadow: none; font: 800 9px/1.2 var(--sans); letter-spacing: 0.1em; color: var(--amber); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.native #fuel #danger-line:not(.on) { display: none; }

/* ---------- landscape: same corners, the strip centred under the road ---------- */
@media (orientation: landscape) {
  body.native { --gauge: 88px; }
  body.native #touch .t-pause, body.native.touch #touch .t-pause { left: 50% !important; margin-left: -20px !important; }
}

/* ---------- no par (stretch.js parRules.late is off in the app) ---------- */
body.native #hud .par { display: none !important; }

/* ---------- fuel: one continuous line, no segments ---------- */
body.native #fuel .fuel-bar { display: block; position: relative; height: 4px; gap: 0; border-radius: 2px; background: rgba(244, 241, 232, 0.14); box-shadow: none; }
body.native #fuel .fuel-bar i { display: none; }
body.native #fuel .fuel-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--fuel-k, 1) * 100%); border-radius: inherit; background: var(--ink); transition: width 0.3s linear, background 0.3s; }
body.native #fuel[data-state='low'] .fuel-bar::before { background: var(--amber); }
body.native #fuel:is([data-state='critical'], [data-state='empty']) .fuel-bar::before { background: var(--red); box-shadow: 0 0 8px color-mix(in srgb, var(--red) 60%, transparent); }
body.native #fuel .fuel-pct { color: var(--ink); }
body.native #fuel .body-track { background: rgba(244, 241, 232, 0.1); }

/* ---------- top: score and heat on the right, money over the plate on the left ---------- */
/* User, 2026-10-23: "JUST score and heat goes in top right, money goes to the left above the plate,
   and odometer counts the overall miles and what act". */
body.native .hud-tr :is(.miles, .mult, .act-chip, .cond-chip) { display: none !important; }
body.native .hud-tr .cash { position: fixed; left: var(--pad-x-l); top: calc(8px + var(--safe-t)); font-size: 20px; transform-origin: left center; }
body.native .hud-tl { top: calc(36px + var(--safe-t)); }
body.native #touch .t-pause, body.native.touch #touch .t-pause { top: calc(38px + var(--safe-t)); }
body.native #slots { top: calc(92px + var(--safe-t)); }

/* ---------- odometer, between the speedo and REVERSE ---------- */
.odo { display: none; }
body.native #hud .odo { display: flex; position: absolute; right: var(--pad-x-r); bottom: calc(var(--row-b) + var(--gauge) + 6px); width: var(--gauge); justify-content: center; align-items: baseline; gap: 4px; padding: 3px 0; border-radius: 6px; background: rgba(8, 8, 12, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); pointer-events: none; }
body.native .odo-act { font: 800 8px/1 var(--sans); letter-spacing: 0.12em; color: var(--amber); }
body.native .odo-mi { font: 800 11px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink); }
body.native .odo small { font: 700 7px/1 var(--sans); color: var(--ink-2); }
@media (orientation: landscape) {
  body.native #touch .t-pause, body.native.touch #touch .t-pause { top: calc(8px + var(--safe-t)); }
  body.native #slots { gap: 5px; }
  body.native #slots .sl { width: 44px; height: 44px; }
  body.native #slots .sl-ic { width: 22px; height: 22px; }
}

/* A long-pressed BOOST stays lit until the tank's dry. */
body.native #touch .t-boost.latched { background: color-mix(in srgb, var(--cyan) 42%, rgba(13, 12, 20, 0.6)); color: #fff !important; box-shadow: inset 0 0 0 2px var(--cyan), 0 0 22px color-mix(in srgb, var(--cyan) 55%, transparent) !important; animation: boost-latch 0.9s ease-in-out infinite alternate; }
@keyframes boost-latch { to { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 34px color-mix(in srgb, var(--cyan) 75%, transparent); } }
@media (prefers-reduced-motion: reduce) { body.native #touch .t-boost.latched { animation: none; } }

/* ---------- loadout: a tapped key opens into a row with what it does ---------- */
body.native #slots .sl { position: relative; transition: width 0.16s var(--ease); }
body.native #slots .sl.open { width: min(232px, 62vw); height: auto; min-height: 50px; grid-template-columns: 26px minmax(0, 1fr); justify-items: start; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; place-content: stretch; z-index: 2; background: rgba(13, 12, 20, 0.9); }
body.native #slots .sl.open .sl-txt { width: auto; gap: 3px; justify-items: start; }
body.native #slots .sl.open .sl-txt b { display: block; font-size: 15px; }
body.native #slots .sl.open .sl-txt small { display: block; font-size: 9px; }
body.native #slots .sl-desc { font: 600 11px/1.3 var(--sans); color: var(--ink-2); white-space: normal; text-align: left; }
body.native #slots .sl-go { font: 800 8px/1 var(--sans); font-style: normal; letter-spacing: 0.14em; color: var(--acc); }
body.native #slots .sl-go:empty { display: none; }
@media (orientation: landscape) { body.native #slots .sl.open { width: 232px; height: auto; } }

/* ---------- passengers: press = what they do, long press = drop (ui/rider-pop.js) ---------- */
body.native #hud .rail .rm-ic.passenger { pointer-events: auto; touch-action: none; cursor: pointer; }
body.native .rider-pop { position: absolute; left: var(--pad-x-l); right: calc(var(--pad-x-r) + 78px); bottom: calc(var(--row-b) + 96px); max-width: 300px; display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(13, 12, 20, 0.92); box-shadow: inset 0 0 0 1px rgba(81, 207, 102, 0.45), 0 8px 20px rgba(0, 0, 0, 0.45); pointer-events: auto; z-index: 3; }
body.native .rider-pop.hidden { display: none; }
body.native .rider-pop b { font: 400 16px/1 var(--display); color: #51cf66; }
body.native .rider-pop p { margin: 0; font: 600 12px/1.3 var(--sans); color: var(--ink); }
body.native .rider-pop small { font: 800 9px/1 var(--sans); letter-spacing: 0.12em; color: var(--ink-2); }
body.native .rider-pop.drop { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 60%, transparent), 0 8px 20px rgba(0, 0, 0, 0.45); }
body.native .rider-pop.drop b { color: var(--red); }
body.native .rp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
body.native .rp-acts button { height: 40px; border: 0; border-radius: 10px; font: 800 13px/1 var(--sans); letter-spacing: 0.12em; color: var(--ink); background: rgba(255, 255, 255, 0.1); }
body.native .rp-acts .rp-drop { background: var(--red); color: #fff; }

/* ---------- radio: the cover and a skip button under the score (ui/radio-puck.js) ---------- */
body.native #radio { display: none !important; } /* no pop-up radio cards in the app */
.rpk, .rpk-card { display: none; }
body.native .rpk { display: flex; position: absolute; right: var(--pad-x-r); top: calc(64px + var(--safe-t)); align-items: center; gap: 6px; pointer-events: auto; }
body.native .rpk.hidden, body.native .rpk-card.hidden { display: none; }
body.native .rpk button { display: grid; place-items: center; margin: 0; padding: 0; border: 0; touch-action: manipulation; -webkit-touch-callout: none; }
body.native .rpk-art { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: rgba(13, 12, 20, 0.6); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.45); }
body.native .rpk-art img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
body.native .rpk-skip { order: -1; width: 30px; height: 30px; border-radius: 50%; color: var(--ink); background: rgba(13, 12, 20, 0.62); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22); }
body.native .rpk-skip svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
body.native .rpk-skip:active, body.native .rpk-art:active { transform: scale(0.93); }
body.native .rpk.hit .rpk-art { animation: rpk-hit 0.3s ease-out; }
@keyframes rpk-hit { from { transform: rotate(-8deg) scale(0.9); } }
body.native .rpk-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; position: absolute; right: var(--pad-x-r); top: calc(112px + var(--safe-t)); width: min(280px, 78vw); padding: 10px; border-radius: 12px; background: rgba(13, 12, 20, 0.92); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.45); pointer-events: auto; z-index: 3; }
body.native .rpk-card img { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
body.native .rpk-card div { display: grid; gap: 3px; min-width: 0; }
body.native .rpk-card b { font: italic 800 15px/1.15 var(--sans); color: #fff; }
body.native .rpk-card span { font: 700 11px/1.2 var(--sans); letter-spacing: 0.1em; color: var(--ink-2); text-transform: uppercase; }
body.native .rpk-card small { font: 600 11px/1.2 var(--sans); color: var(--ink-2); }
body.native .rpk-spot { justify-self: start; margin-top: 4px; padding: 7px 10px; border-radius: 999px; font: 800 10px/1 var(--sans); letter-spacing: 0.12em; color: #0b0a10; background: #1ed760; text-decoration: none; }

/* ---------- steering halves, and BOOST / REVERSE at the bottom (user, 2026-10-23: "the touch targets for
   boost and reverse aren't working. And maybe those should be at the bottom") ----------
   The buttons sit above the steering surface (.t-aim came later in the page and took their touches). */
body.native #touch .t-aim::before, body.native #touch .t-aim::after { content: ''; position: absolute; top: 0; bottom: 0; width: 50%; opacity: 0; transition: opacity 0.1s; pointer-events: none; }
body.native #touch .t-aim::before { left: 0; background: linear-gradient(90deg, rgba(244, 241, 232, 0.12), transparent 40%); }
body.native #touch .t-aim::after { right: 0; background: linear-gradient(270deg, rgba(244, 241, 232, 0.12), transparent 40%); }
body.native #touch .t-aim.l::before, body.native #touch .t-aim.r::after { opacity: 1; }
body.native #touch .t-aim.slide::before, body.native #touch .t-aim.slide::after { background-color: color-mix(in srgb, var(--amber) 6%, transparent); }
body.native[data-steer='point'] #touch :is(.t-gas, .t-brake) { display: none; }
body.native[data-steer='point'] #touch .t-pedals { z-index: 2; left: calc(var(--pad-x-l) + 104px); right: calc(var(--pad-x-r) + var(--gauge) + 12px); bottom: var(--row-b); width: auto; height: 56px; }
body.native[data-steer='point'] #touch :is(.t-boost, .t-rev) { bottom: 0; width: calc(50% - 4px); height: 56px; border-radius: 14px; font-size: 11px; letter-spacing: 0.12em; }
body.native[data-steer='point'] #touch .t-rev { left: 0; right: auto; color: var(--ink); }
body.native[data-steer='point'] #touch .t-boost { right: 0; left: auto; }
body.native[data-steer='point'] #touch .t-rev .t-lbl { font-size: 0; }
body.native[data-steer='point'] #touch .t-rev .t-lbl::after { content: 'REVERSE'; font-size: 11px; letter-spacing: 0.12em; }
body.native[data-steer='point'] #touch .t-rev.down { background: rgba(255, 255, 255, 0.3); }
body.native #touch .t-pause { z-index: 2; }
/* Fuel rides above the buttons, between the map and the speedo. */
body.native .hud-bottom, body.native.touch .hud-bottom { left: calc(var(--pad-x-l) + 104px); right: calc(var(--pad-x-r) + var(--gauge) + 12px); bottom: calc(var(--row-b) + 66px); width: auto; transform: none; }
body.native .rail, body.native.touch .rail { bottom: calc(var(--row-b) + 108px); }
body.native .rider-pop { right: var(--pad-x-l); bottom: calc(var(--row-b) + 146px); }
@media (orientation: landscape) {
  body.native[data-steer='point'] #touch .t-pedals, body.native .hud-bottom, body.native.touch .hud-bottom { left: 50%; right: auto; width: min(300px, 40vw); transform: translateX(-50%); }
}
