/* Infin8 Sleddin in-world HUD and Menu & settings sheet on the shared Infin8 UI kit
 * (games/assets/infin8-ui). Every surface, button, toggle, slider, select and the
 * sheet itself is a kit class; this file only places them for this game. The rider's
 * sky theme tints the kit through --i8-accent alone. Loaded inside the game bundle,
 * never by the menu.
 *
 * Layout contract (phone 375x812 target <= 20% coverage, nothing in the centre):
 *   top-left   one stat row, the missions chip and, only when wildlife matters, the health meter;
 *              lines wrap between their " · " segments instead of truncating
 *   left rail  the community dock below the top-left stack; chat / players open beside it
 *   top-right  camera, full screen and the menu gear (music joins on wide screens)
 *   top-centre the freestyle callout, text only, on a sled or board
 *   bottom     contextual prompts (interact, mount, fish) appear only when usable
 *   touch      one joystick (left thumb) and the GAS / BRAKE / BOOST / WHEELIE arc
 *              (right thumb); on foot only SPRINT. No trick buttons: tricks are flicks. */

.sled-stage.i8-root { --i8-accent: var(--theme-primary, #4de8ff); }
.sled-stage.i8-root [hidden] { display: none !important; }

/* ---- HUD frame: corners and edges only, the centre of the view stays clear ---- */
.sled-stage .sled-world-hud { z-index: 8; font-variant-numeric: tabular-nums; }
html:not([data-game-state="playing"]) .sled-world-hud,
html:not([data-game-state="playing"]) .sled-stage .touch-controls,
html:not([data-game-state="playing"]) #winter-survival-hud,
html:not([data-input-mode="touch"]) .sled-stage .touch-controls,
html[data-console-layout="true"] .sled-stage .touch-controls { display: none !important; }
/* Controller play hides the browser cursor over the world; any mouse move brings it back (input-mode.js). */
html[data-input-mode="gamepad"][data-game-state="playing"] .sled-stage, html[data-input-mode="gamepad"][data-game-state="playing"] .sled-stage * { cursor: none; }

/* Top-left: run stats, location, on-foot chip, missions and the wildlife meter.
   Wide enough on desktop for the wallet and mission lines; anything longer wraps. */
.sled-world-hud .sled-hud { pointer-events: none; }
/* 100% = its own grid column: the strip ellipsizes before it can reach the centred compass block. */
.sled-world-hud .i8-hud__tl { max-width: min(46vw, 440px, 100%); }
.sled-world-hud .sled-hud .sled-mission-chip { pointer-events: auto; }
.sled-stats { display: flex; flex-wrap: nowrap; gap: 4px; }
.sled-stats .i8-stat { padding: 4px 8px; white-space: nowrap; }
.sled-location { max-width: 100%; overflow: hidden; font-size: var(--i8-fs-xs); color: var(--i8-text-soft); text-overflow: ellipsis; white-space: nowrap; }
.sled-location span + span::before { content: " · "; color: var(--i8-muted); }
.sled-player-chip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; max-width: 100%; padding: 6px 14px; font-size: var(--i8-fs-xs); line-height: 1.35; }
#winter-player-mode { color: var(--i8-accent); letter-spacing: var(--i8-track); }
#winter-player-status, #winter-player-wallet, #winter-player-controls { min-width: 0; overflow-wrap: anywhere; }
/* game.js writes these as nowrap " · " segments, so a line breaks between facts. */
.sled-player-chip .hud-seg, .sled-mission-chip .hud-seg { white-space: nowrap; }
.sled-mission-chip .hud-seg:last-child { white-space: normal; }
#winter-player-wallet, #winter-player-controls, .sled-player-chip .winter-thief-status, #winter-sonar, #winter-tension-panel { grid-column: 1 / -1; }
#winter-player-wallet, .sled-player-chip .winter-thief-status { color: var(--i8-warning); }
#winter-player-controls { color: var(--i8-muted); font-family: var(--i8-font-mono); }
html[data-hud-hints="off"] #winter-player-controls,
html[data-last-input="touch"] #winter-player-controls { display: none; }
.sled-mission-chip { display: block; max-width: 100%; min-height: 36px; padding-block: 7px; line-height: 1.3; white-space: normal; text-align: left; }

/* Wildlife meter: a slim kit stat in the top-left stack, shown only outside the
   lodge safe zone or while hurt (game.js sets data-calm). */
.sled-stage .winter-survival-hud { display: flex; align-items: center; gap: 8px; width: min(220px, 100%); padding: 5px 10px; pointer-events: none; }
.sled-stage .winter-survival-hud[data-calm="true"] { display: none; }
.winter-survival-symbol { flex: none; width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(77, 232, 255, .6)); }
.winter-survival-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.winter-survival-copy strong { color: var(--i8-muted); font-size: 10px; letter-spacing: var(--i8-track); }
.winter-survival-copy small { color: var(--i8-text-soft); font-size: 10px; }
.winter-survival-copy progress { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: var(--i8-r-pill); background: #1e2436; }
.winter-survival-copy progress::-webkit-progress-bar { background: #1e2436; }
.winter-survival-copy progress::-webkit-progress-value { background: var(--i8-grad); }
.winter-survival-copy progress::-moz-progress-bar { background: var(--i8-grad); }

/* Top-right: one toolbar of music, camera, full screen and the menu gear. */
.sled-world-hud .i8-hud__tr { max-width: none; }
.sled-world-hud .i8-toolbar > * { flex: none; }
.sled-music-slot { display: grid; place-items: center; min-width: var(--i8-touch-hud); min-height: var(--i8-touch-hud); }

/* Top-centre: the freestyle callout, text only, small and transient. */
.freestyle-readout { max-width: min(480px, 92vw); text-align: center; pointer-events: none; text-shadow: 0 2px 6px #000, 0 0 12px rgba(139, 92, 246, .6); }
.freestyle-readout .sled-trick { margin-top: 4px; overflow: hidden; color: var(--i8-text-soft); font-size: var(--i8-fs-xs); text-overflow: ellipsis; white-space: nowrap; }
html[data-winter-mode="foot"] .freestyle-readout { display: none; }

/* Contextual prompts: a short row at the bottom edge; on touch above the right thumb. */
.sled-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: min(720px, 100%); }
.sled-actions .i8-stat { font-size: var(--i8-fs-xs); }
#winter-interact:disabled { display: none; }

/* Instruments: a HUD frame in the bottom-right corner on desktop; a speed chip on touch. */
.sled-world-hud .infin8-instruments { position: absolute; right: var(--i8-safe-r); bottom: var(--i8-safe-b); width: 250px; padding: 9px 14px 11px; pointer-events: none; }
html[data-hud-instruments="off"] .infin8-instruments,
html[data-winter-mode="foot"] .infin8-instruments,
html[data-winter-mode="snowboard"] .infin8-instruments,
html[data-winter-mode="snowskate"] .infin8-instruments { display: none; }
.sled-stage .tachometer-live { stroke: var(--i8-cyan); }
.sled-stage .instrument-brand span:first-child { color: var(--i8-cyan); }
.sled-stage .instrument-condition i::after { background: var(--i8-grad); }

/* Community: one icon toggle; the dock opens beside it (always open on wide desktops).
   Desktop: a left rail below the top-left stack; chat / players open to its right,
   never over the stack. While a panel is open the community layer draws above the
   HUD so no HUD text shows through it. */
.sleddin-community { --community-rail-top: max(38%, min(300px, 46%)); }
.sleddin-community .community-dock { position: absolute; left: var(--i8-safe-l); top: var(--community-rail-top); flex-direction: column; align-items: stretch; pointer-events: auto; }
.sleddin-community .community-dock-button { justify-content: center; }
.sleddin-community:has(.community-chat:not([hidden]), .community-board:not([hidden])) { z-index: 9; }
.community-dock[data-collapsed="true"] > :not(.community-dock-toggle) { display: none; }
.community-dock-toggle.has-unread, .community-dock-button.has-unread { --i8-edge: var(--i8-magenta); border-color: var(--i8-magenta); box-shadow: var(--i8-inset), var(--i8-glow-hot); }
.community-dock-button[aria-expanded="true"] { --i8-edge: var(--i8-cyan-bright); --i8-halo: rgba(77, 232, 255, .6); }
@media (min-width: 900px) and (pointer: fine) {
  .sleddin-community .community-dock-toggle { display: none; }
  .community-dock[data-collapsed="true"] > :not(.community-dock-toggle):not([hidden]) { display: inline-flex; }
  html:not([data-console-layout="true"]) .sleddin-community .community-chat,
  html:not([data-console-layout="true"]) .sleddin-community .community-board { left: calc(var(--i8-safe-l) + 124px); top: var(--community-rail-top); transform: none; max-height: max(180px, calc(100% - var(--community-rail-top) - var(--i8-safe-b) - 64px)); }
}

/* ---- Touch: one joystick and contextual action buttons on the edges ---- */
.sled-stage .touch-controls { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.touch-controls .i8-pad { pointer-events: none; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; opacity: var(--touch-opacity, .9); transform: scale(clamp(.88, var(--touch-scale, 1), 1.15)); transform-origin: left bottom; }
.touch-controls .i8-pad > * { pointer-events: auto; }
.touch-controls .i8-pad { display: none; grid-template-columns: auto; max-width: none; }
html[data-input-mode="touch"] .touch-controls .i8-pad { display: grid; }
.touch-controls .i8-pad--right { transform-origin: right bottom; }
html[data-touch-handedness="left"] .touch-controls .drive-pad { left: auto; right: var(--i8-safe-r); transform-origin: right bottom; }
html[data-touch-handedness="left"] .touch-controls .right-controls { right: auto; left: var(--i8-safe-l); transform-origin: left bottom; }
.drive-pad { --i8-pad-cols: 1; }
.touch-controls .i8-icon-btn { padding: 2px; overflow: hidden; color: var(--i8-text); font: 800 10px/1.05 var(--i8-font); letter-spacing: .03em; text-align: center; text-transform: uppercase; background: rgba(9, 12, 24, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.touch-controls .i8-icon-btn span { display: block; font-size: 10px; }
/* Right thumb: GAS is the big corner button, BRAKE beside it, BOOST above it and
   WHEELIE on the diagonal - the thumb-arc used by mobile racers and shooters.
   On foot only SPRINT (the boost action) remains, in the corner. No trick buttons:
   tricks are joystick flicks mapped in Settings > Tricks. */
.right-controls { --i8-pad-cols: 1; }
.action-pad { display: grid; grid-template-areas: "jump boost"; grid-template-columns: 56px 72px; grid-template-rows: 72px; gap: 10px; align-items: end; justify-items: center; }
.action-pad .i8-icon-btn { width: 56px; height: 56px; border-radius: 50%; }
.action-pad .jump-control { grid-area: jump; }
/* The stick drives gas, brake and the wheelie, so BOOST is the primary right-thumb action. */
.action-pad .boost-control { grid-area: boost; width: 72px; height: 72px; font-size: 12px; border-color: var(--i8-cyan); box-shadow: var(--i8-inset), var(--i8-glow-2); }
html[data-winter-mode="foot"] .action-pad { grid-template-areas: "boost"; grid-template-columns: 72px; grid-template-rows: 72px; }
html[data-winter-mode="foot"] .action-pad .boost-control { width: 72px; height: 72px; }
html[data-winter-mode="foot"] .action-pad .jump-control { display: none; }

/* Joystick: the brand's Neon knob rides inside a neon ring. */
.steer-zone { grid-column: 1 / -1; position: relative; display: grid; place-items: center; width: 136px; height: 136px; border-radius: 50%; touch-action: none; }
.steer-track { position: relative; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 123, 255, .16), rgba(9, 12, 24, .5) 68%); box-shadow: inset 0 0 18px rgba(139, 92, 246, .35), 0 0 16px rgba(77, 232, 255, .25); }
.steer-track::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2px; background: var(--i8-grad-diag); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: .8; }
.steer-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; will-change: transform; --i8-knob: 60px; }
.steer-caption { position: absolute; bottom: -2px; color: var(--i8-muted); font: 800 9px/1 var(--i8-font); letter-spacing: var(--i8-track); pointer-events: none; }
/* ---- Neon gear control art: the operator's real knob, button and meter hardware ----
   Source: Infin8-Audio SharedUI neon-gear (see games/assets/infin8-ui/README.md). Only physical-feeling
   controls wear it, one art style per control type: the stick; round buttons (BOOST / SPRINT, TRICK,
   the top-right HUD toolbar and the dock toggle); plates (nearby-action prompts, community dock);
   the instruments' throttle and boost-heat meters; and the settings sheet's toggles and sliders.
   Text buttons (menus, garage, dialogs) stay on the design-system styles.
   Strips are vertical: thumb rest|active; round rest|on|pressed; toggle off|on; slider thumb
   rest|pressed; meter track|fill. Pressed states follow what the code already sets: .active
   (input-manager touch), :active, :checked, aria-pressed / aria-expanded and the stick's aria-valuenow.
   Theme: game.js sets .sled-stage[data-sled-theme] to the current sled. Every tier uses it except
   constrained devices and the console layout (galaxy only); an Android unlockable theme on the page
   (html[data-ui-theme*="android"]) also keeps galaxy so it is never overridden. Galaxy is the single
   fallback, including the starter sleds.
   Sizes: art is served at 2x and never shown larger than half its pixel size: round art caps at
   64 px, the stick at 138 / 69 px (touch scale 1.15), plates at 56 px tall (40 desktop, 44 touch), toggles 60 x 30,
   slider thumbs 34 px and grooves 210 px, meters 105 x 18. tools/Validate-Sleddin-Controls.cjs
   checks fit and caps in a browser. */
.sled-stage {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-galaxy.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-galaxy.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-galaxy.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-galaxy.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-galaxy.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-galaxy.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-galaxy.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-galaxy.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-galaxy.webp");
}
html:not([data-device-tier="constrained"]):not([data-console-layout]):not([data-ui-theme*="android"]) .sled-stage[data-sled-theme="arctic"] {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-arctic.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-arctic.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-arctic.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-arctic.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-arctic.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-arctic.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-arctic.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-arctic.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-arctic.webp");
}
html:not([data-device-tier="constrained"]):not([data-console-layout]):not([data-ui-theme*="android"]) .sled-stage[data-sled-theme="aurora"] {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-aurora.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-aurora.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-aurora.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-aurora.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-aurora.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-aurora.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-aurora.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-aurora.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-aurora.webp");
}
html:not([data-device-tier="constrained"]):not([data-console-layout]):not([data-ui-theme*="android"]) .sled-stage[data-sled-theme="electric-rose"] {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-electric-rose.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-electric-rose.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-electric-rose.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-electric-rose.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-electric-rose.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-electric-rose.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-electric-rose.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-electric-rose.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-electric-rose.webp");
}
html:not([data-device-tier="constrained"]):not([data-console-layout]):not([data-ui-theme*="android"]) .sled-stage[data-sled-theme="solar-flare"] {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-solar-flare.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-solar-flare.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-solar-flare.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-solar-flare.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-solar-flare.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-solar-flare.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-solar-flare.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-solar-flare.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-solar-flare.webp");
}
html:not([data-device-tier="constrained"]):not([data-console-layout]):not([data-ui-theme*="android"]) .sled-stage[data-sled-theme="ultraviolet"] {
  --ctl-thumb: url("../assets/infin8-ui/brand/control-stick-thumb-ultraviolet.webp"); --ctl-base: url("../assets/infin8-ui/brand/control-stick-base-ultraviolet.webp");
  --ctl-round: url("../assets/infin8-ui/brand/control-button-round-ultraviolet.webp"); --ctl-meter: url("../assets/infin8-ui/brand/control-meter-ultraviolet.webp");
  --ctl-plate: url("../assets/infin8-ui/brand/control-button-plate-ultraviolet.webp"); --ctl-plate-lit: url("../assets/infin8-ui/brand/control-button-plate-lit-ultraviolet.webp");
  --ctl-toggle: url("../assets/infin8-ui/brand/control-toggle-ultraviolet.webp"); --ctl-slider-track: url("../assets/infin8-ui/brand/control-slider-track-ultraviolet.webp");
  --ctl-slider-thumb: url("../assets/infin8-ui/brand/control-slider-thumb-ultraviolet.webp");
}
/* One label treatment for every HUD control: Infin8 cyan in the Infin8 display face (Montserrat), a thin
   dark engraving so it reads on night and snow, and a cyan bloom; lit states brighten the cyan, disabled
   dims it. Captions are at least 11 px on screen on touch and 12 px on desktop, at every touch scale. */
.sled-stage .steer-caption, .sled-stage .action-pad .i8-icon-btn, .sled-world-hud .i8-toolbar .i8-icon-btn--hud,
.sleddin-community .community-dock-toggle, .sled-stage .sled-actions .i8-btn, .sleddin-community .community-dock-button {
  --ctl-ink: var(--i8-cyan); --ctl-bloom: 5px; --ctl-engrave: rgba(3, 6, 14, .92);
  color: var(--ctl-ink); font-family: var(--i8-font-display); font-weight: 800; text-transform: uppercase; letter-spacing: var(--ctl-track, var(--i8-track));
  text-shadow: 1px 0 0 var(--ctl-engrave), -1px 0 0 var(--ctl-engrave), 0 1px 0 var(--ctl-engrave), 0 -1px 0 var(--ctl-engrave), 0 0 var(--ctl-bloom) var(--ctl-ink);
}
.sled-world-hud .i8-toolbar .i8-icon-btn--hud svg, .sleddin-community .community-dock-toggle svg {
  width: calc(var(--ctl-art) * .34); height: calc(var(--ctl-art) * .34); filter: drop-shadow(0 0 1px var(--ctl-engrave)) drop-shadow(0 0 var(--ctl-bloom) var(--ctl-ink));
}
.sled-stage .action-pad .i8-icon-btn.active, .sled-stage .action-pad .i8-icon-btn:active:not(:disabled), .sled-stage .action-pad .boost-control,
.sled-world-hud .i8-toolbar .i8-icon-btn--hud[aria-pressed="true"], .sled-world-hud .i8-toolbar .i8-icon-btn--hud:active:not(:disabled),
.sleddin-community .community-dock-toggle[aria-expanded="true"], .sleddin-community .community-dock-toggle.has-unread,
.sled-stage .sled-actions .i8-btn--hot, .sled-stage .sled-actions .i8-btn.active, .sled-stage .sled-actions .i8-btn[aria-pressed="true"],
.sled-stage .sled-actions .i8-btn:active:not(:disabled), .sleddin-community .community-dock-button[aria-pressed="true"],
.sleddin-community .community-dock-button[aria-expanded="true"], .sleddin-community .community-dock-button.has-unread,
.sleddin-community .community-dock-button:active:not(:disabled), .sled-stage .steer-zone:not([aria-valuenow="0"]) .steer-caption { --ctl-ink: var(--i8-cyan-bright); --ctl-bloom: 9px; }
.sled-stage .action-pad .i8-icon-btn:disabled, .sled-world-hud .i8-toolbar .i8-icon-btn--hud:disabled,
.sled-stage .sled-actions .i8-btn:disabled, .sleddin-community .community-dock-button:disabled { --ctl-ink: var(--i8-muted); --ctl-bloom: 0px; }

/* The shared game shell also scales .touch-controls by --touch-scale; each pad already scales itself here,
   so the layer stays 1:1 (otherwise 1.15 compounds to 1.32 and pushes the stick off a landscape phone). */
.sled-stage .touch-controls { scale: none; }
/* Stick: the hollow ring is the base; the clean knob (no value line) is the thumb and lights while held.
   MOVE is engraved on the ring's lower band. The base and thumb keep their 2:1 ratio at every size. */
.sled-stage .steer-zone { --ctl-stick: 120px; }
.sled-stage .steer-track { background: var(--ctl-base) center / 100% 100% no-repeat; box-shadow: none; }
.sled-stage .steer-track::before { content: none; }
.sled-stage .steer-knob { width: calc(var(--ctl-stick) / 2); height: calc(var(--ctl-stick) / 2); margin: calc(var(--ctl-stick) / -4) 0 0 calc(var(--ctl-stick) / -4); border-radius: 50%; background: var(--ctl-thumb) 0 0 / 100% 200% no-repeat; filter: none; }
.sled-stage .steer-zone:active .steer-knob, .sled-stage .steer-zone:not([aria-valuenow="0"]) .steer-knob,
.sled-stage .steer-zone:focus-visible .steer-knob, .sled-stage .steer-zone.gp-focus .steer-knob { background-position: 0 100%; filter: drop-shadow(0 0 6px var(--i8-accent)); }
.sled-stage .steer-zone:active .steer-track, .sled-stage .steer-zone:not([aria-valuenow="0"]) .steer-track { filter: brightness(1.15); }
.sled-stage .steer-caption { top: calc(50% + var(--ctl-stick) * .37); bottom: auto; transform: translateY(-50%); font-size: calc(11px / clamp(.88, var(--touch-scale, 1), 1.15)); line-height: 1; --ctl-track: .08em; }

/* Round buttons: art drawn by ::before and capped at 64 px on screen (its 2x size), also under touch
   scale; the centre cap stays clean and the label is a caption on the lower rim, just below the button
   body (over the faint scale ticks), like the stick's MOVE (12 px on screen at every touch scale). BOOST / SPRINT rests lit as the primary thumb action;
   TRICK / BRAKE / JUMP / GRAB rests dark. The top-right toolbar (camera, full screen, menu) and the
   dock toggle use the same hardware with their icons in the cap. */
.sled-stage .action-pad .i8-icon-btn {
  --ctl-size: 56px; --ctl-art: min(var(--ctl-size), calc(64px / clamp(.88, var(--touch-scale, 1), 1.15)));
  --ctl-caption: calc(12px / clamp(.88, var(--touch-scale, 1), 1.15)); --ctl-track: .03em;
  display: flex; align-items: flex-end; justify-content: center; width: var(--ctl-size); height: calc(var(--ctl-size) / 2 + var(--ctl-art) * .37 + var(--ctl-caption) * 1.2 + 1px);
  font-size: var(--ctl-caption); white-space: nowrap; border-radius: 0;
}
.sled-stage .action-pad .boost-control { --ctl-size: 72px; }
html .sled-stage .action-pad { grid-template-rows: auto; align-items: end; }
.sled-world-hud .i8-toolbar .i8-icon-btn--hud, .sleddin-community .community-dock-toggle { --ctl-size: var(--i8-touch-hud); --ctl-art: min(var(--ctl-size), 64px); border-radius: 50%; }
.sled-stage .action-pad .i8-icon-btn, .sled-world-hud .i8-toolbar .i8-icon-btn--hud, .sleddin-community .community-dock-toggle {
  position: relative; isolation: isolate; overflow: visible; padding: 0; border: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; line-height: 1;
}
.sled-stage .action-pad .i8-icon-btn::before, .sled-world-hud .i8-toolbar .i8-icon-btn--hud::before, .sleddin-community .community-dock-toggle::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; width: var(--ctl-art); height: var(--ctl-art); transform: translate(-50%, -50%);
  background: var(--ctl-round) 0 0 / 100% 300% no-repeat; pointer-events: none;
}
.sled-stage .action-pad .i8-icon-btn::before { top: calc(var(--ctl-size) / 2); }
.sled-stage .action-pad .boost-control::before, .sled-world-hud .i8-toolbar .i8-icon-btn--hud[aria-pressed="true"]::before,
.sleddin-community .community-dock-toggle[aria-expanded="true"]::before, .sleddin-community .community-dock-toggle.has-unread::before { background-position: 0 50%; }
.sled-stage .action-pad .i8-icon-btn.active::before, .sled-stage .action-pad .i8-icon-btn:active:not(:disabled)::before,
.sled-world-hud .i8-toolbar .i8-icon-btn--hud:active:not(:disabled)::before, .sleddin-community .community-dock-toggle:active::before { background-position: 0 100%; }
.sled-stage .action-pad .i8-icon-btn.active, .sled-stage .action-pad .i8-icon-btn:active:not(:disabled),
.sled-world-hud .i8-toolbar .i8-icon-btn--hud:active:not(:disabled), .sleddin-community .community-dock-toggle:active { box-shadow: none; border-color: transparent; }
.sled-world-hud .i8-toolbar .i8-icon-btn--hud:hover:not(:disabled), .sleddin-community .community-dock-toggle:hover { box-shadow: none; filter: brightness(1.12); }
.sleddin-community .community-dock-toggle.has-unread { box-shadow: none; filter: drop-shadow(0 0 6px var(--i8-magenta)); }

/* Plates (prompts, community dock): 9-slice so the rounded caps never stretch; the cap is half the
   plate height, the plate is exactly that height and its width follows the label. */
.sled-stage { --ctl-plate-h: 40px; }
.sled-stage .sled-actions .i8-btn, .sleddin-community .community-dock-button {
  --ctl-cap: calc(var(--ctl-plate-h) / 2); height: var(--ctl-plate-h); min-height: var(--ctl-plate-h); min-width: calc(var(--ctl-plate-h) + 8px);
  padding: 0 calc(var(--ctl-cap) * .9); border-color: transparent; border-image: var(--ctl-plate) 0 56 fill / 0 var(--ctl-cap) / 0 stretch;
  background: none; box-shadow: none; font-size: clamp(11px, calc(var(--ctl-plate-h) * .3), 17px); font-weight: 700; line-height: 1; white-space: nowrap;
}
.sled-stage .sled-actions .i8-btn::before, .sled-stage .sled-actions .i8-btn::after,
.sleddin-community .community-dock-button::before, .sleddin-community .community-dock-button::after { content: none; }
.sled-stage .sled-actions .i8-btn--hot, .sled-stage .sled-actions .i8-btn.active, .sled-stage .sled-actions .i8-btn[aria-pressed="true"],
.sleddin-community .community-dock-button[aria-pressed="true"], .sleddin-community .community-dock-button[aria-expanded="true"],
.sleddin-community .community-dock-button.has-unread, .sled-stage .sled-actions .i8-btn:active:not(:disabled),
.sleddin-community .community-dock-button:active:not(:disabled) { border-image-source: var(--ctl-plate-lit); box-shadow: none; }
.sled-stage .sled-actions .i8-btn:hover:not(:disabled), .sleddin-community .community-dock-button:hover:not(:disabled) { filter: brightness(1.12); }
.sled-stage .sled-actions .i8-btn:active:not(:disabled), .sleddin-community .community-dock-button:active:not(:disabled) { filter: brightness(1.2); }
.sled-stage .sled-actions .i8-btn:disabled, .sleddin-community .community-dock-button:disabled { filter: grayscale(.7) brightness(.8); opacity: .65; }
html[data-input-mode="touch"] .sled-stage { --ctl-plate-h: 44px; }
html[data-console-layout="true"] .sled-stage { --ctl-plate-h: 56px; }
/* Portrait touch: the prompt column is wide enough for a full plate (MOUNT / DISMOUNT · F) at 360 px. */
@media (orientation: portrait) {
  html[data-input-mode="touch"] .sled-stage .sled-world-hud > #winter-dock { max-width: min(64vw, 260px); } }
/* Short landscape: the open community dock runs as one row under the toolbar, so neither thumb (stick or
   action pad, in either handedness) sits under a column of plates. */
@media (max-height: 500px) {
  html[data-input-mode="touch"]:not([data-console-layout="true"]) .sleddin-community .community-dock { flex-direction: row; align-items: center; } }
/* Short landscape: the prompt row stays between the thumbs (it scrolls sideways when long) at every touch scale. */
@media (orientation: landscape) and (max-height: 500px) {
  html[data-input-mode="touch"] .sled-stage .sled-world-hud > #winter-dock { max-width: calc(100% - var(--i8-safe-l) - var(--i8-safe-r) - 2 * 172px); } }
/* Short landscape keeps the 56 px action button so its caption fits; the stick steps down to 112 px. */
@media (max-height: 500px) {
  html[data-input-mode="touch"] .sled-stage .steer-zone { --ctl-stick: 112px; }
  html[data-input-mode="touch"]:not([data-winter-mode="foot"]) .sled-stage .action-pad { grid-template-columns: 56px 72px; } }

/* Instruments (desktop cluster): throttle and boost heat are the neon meter, 105 x 18 px in each column.
   Heat keeps its warning: the fill warms past the low mark and turns hot past the high mark. */
.sled-stage .instrument-meters meter { -webkit-appearance: none; appearance: none; width: 105px; height: 18px; margin-top: 3px; border: 0; background: var(--ctl-meter) 0 0 / 100% 200% no-repeat; }
.sled-stage .instrument-meters meter::-webkit-meter-bar { height: 18px; border: 0; border-radius: 0; background: none; }
.sled-stage .instrument-meters meter::-webkit-meter-optimum-value, .sled-stage .instrument-meters meter::-webkit-meter-suboptimum-value,
.sled-stage .instrument-meters meter::-webkit-meter-even-less-good-value { background: var(--ctl-meter) 0 100% / 105px 36px no-repeat; }
.sled-stage .instrument-meters meter::-webkit-meter-suboptimum-value { filter: hue-rotate(-45deg) saturate(1.5); }
.sled-stage .instrument-meters meter::-webkit-meter-even-less-good-value { filter: sepia(1) saturate(5) hue-rotate(-25deg); }
.sled-stage .instrument-meters meter::-moz-meter-bar { background: var(--ctl-meter) 0 100% / 105px 36px no-repeat; }
.sled-stage .instrument-meters meter:-moz-meter-sub-optimum::-moz-meter-bar { filter: hue-rotate(-45deg) saturate(1.5); }
.sled-stage .instrument-meters meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { filter: sepia(1) saturate(5) hue-rotate(-25deg); }

/* Settings sheet: the neon toggle (60 x 30 inside a full-row label) and the neon slider groove (at most
   210 px) and thumb; the fill is the design-system cyan-to-magenta inside the groove, kept in step
   with --i8-fill. Row text stays on the design-system styles. */
#ride-settings-dialog .i8-toggle { width: 60px; height: 30px; border: 0; border-radius: 15px; background: var(--ctl-toggle) 0 0 / 100% 200% no-repeat; box-shadow: none; }
#ride-settings-dialog .i8-toggle::before, #ride-settings-dialog .i8-toggle::after { content: none; }
#ride-settings-dialog .i8-toggle:checked { background-position: 0 100%; box-shadow: none; }
#ride-settings-dialog .i8-toggle:hover:not(:disabled) { filter: brightness(1.12); }
#ride-settings-dialog .i8-toggle:active:not(:disabled) { filter: brightness(1.25); }
#ride-settings-dialog .i8-slider { max-width: 210px; background: linear-gradient(90deg, transparent 9.5%, var(--i8-cyan) 9.5%, var(--i8-magenta) calc(9.5% + var(--i8-fill, 50%) * .81), transparent 0) 0 50% / 100% 6px no-repeat, var(--ctl-slider-track) center / 100% auto no-repeat; }
#ride-settings-dialog .i8-slider::-webkit-slider-runnable-track { height: 100%; border-radius: 0; background: none; }
#ride-settings-dialog .i8-slider::-webkit-slider-thumb { width: 34px; height: 34px; margin-top: calc((var(--i8-touch) - 34px) / 2); border: 0; border-radius: 50%; background: var(--ctl-slider-thumb) 0 0 / 100% 200% no-repeat; box-shadow: none; }
#ride-settings-dialog .i8-slider:active::-webkit-slider-thumb { background-position: 0 100%; }
#ride-settings-dialog .i8-slider::-moz-range-track { height: 100%; background: none; }
#ride-settings-dialog .i8-slider::-moz-range-progress { background: none; }
#ride-settings-dialog .i8-slider::-moz-range-thumb { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ctl-slider-thumb) 0 0 / 100% 200% no-repeat; box-shadow: none; }
#ride-settings-dialog .i8-slider:active::-moz-range-thumb { background-position: 0 100%; }
@media (prefers-reduced-motion: reduce) {
  .sled-stage .action-pad .i8-icon-btn, .sled-world-hud .i8-toolbar .i8-icon-btn--hud, .sleddin-community .community-dock-toggle,
  .sled-stage .sled-actions .i8-btn, .sleddin-community .community-dock-button, #ride-settings-dialog .i8-toggle { transition: none; transform: none !important; }
}

/* Touch screens: lift the bottom HUD row above the thumbs; prompts stack on the right. */
html[data-input-mode="touch"] .sled-stage .sled-world-hud { padding-bottom: calc(var(--i8-safe-b) + 150px); }
  html[data-input-mode="touch"] .sled-world-hud > #winter-dock { grid-area: br; justify-self: end; flex-direction: column; align-items: flex-end; max-width: min(46vw, 240px); }
  html[data-input-mode="touch"] .sled-world-hud > #winter-dock > .i8-stat { display: none; }
  /* Speed chip under the stat row (mission chip steps aside while riding). */
  html[data-input-mode="touch"] .sled-world-hud .infin8-instruments { top: calc(var(--i8-safe-t) + 34px); right: auto; left: var(--i8-safe-l); bottom: auto; width: auto; padding: 5px 12px; clip-path: none; }
  html[data-input-mode="touch"] .sled-world-hud .infin8-instruments::after { display: none; }
  html[data-input-mode="touch"][data-winter-mode="sled"] .sled-world-hud .sled-mission-chip { display: none; }
  html[data-input-mode="touch"] .sled-world-hud .infin8-instruments > :not(.tachometer), html[data-input-mode="touch"] .sled-world-hud .tachometer > :not(.instrument-speed):not(.instrument-drive) { display: none; }
  html[data-input-mode="touch"] .sled-world-hud .tachometer { display: flex; align-items: baseline; gap: 8px; height: auto; }
  html[data-input-mode="touch"] .sled-world-hud .instrument-speed, html[data-input-mode="touch"] .sled-world-hud .instrument-drive { position: static; transform: none; }
  html[data-input-mode="touch"] .sled-world-hud .instrument-speed strong { display: inline; font-size: 20px; }
  html[data-input-mode="touch"] .sled-world-hud .instrument-speed span { display: none; }
  html[data-input-mode="touch"] .sled-world-hud .instrument-drive { font-size: 14px; color: var(--i8-success); }
  html[data-input-mode="touch"] .sled-world-hud .i8-toolbar .i8-icon-btn--hud, html[data-input-mode="touch"] .sled-music-slot { --i8-touch-hud: 44px; }
  html[data-input-mode="touch"] .sled-world-hud .i8-hud__tr .i8-toolbar { padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  html[data-input-mode="touch"] .sleddin-community .community-dock { left: auto; right: var(--i8-safe-r); top: calc(var(--i8-safe-t) + 62px); padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; align-items: flex-end; }
  html[data-input-mode="touch"] .sleddin-community .community-dock-button { min-height: var(--i8-touch); }
/* Phones: one stat row, no location line or activity chip, no music button. */
@media (max-width: 560px) {
  .sled-world-hud .sled-location, .sled-world-hud .sled-player-chip, .sled-world-hud .sled-music-slot { display: none !important; }
  .sled-stats { flex-wrap: wrap; }
  .sled-stats .i8-stat { padding: 3px 7px; font-size: 13px; }
  .sled-stats .i8-stat b { font-size: 9px; }
  .sled-mission-chip { max-width: min(100%, 220px); }
  .freestyle-readout .sled-trick { max-width: 60vw; margin-inline: auto; }
  .freestyle-readout .sled-trick[data-idle="true"] { display: none; }
}
@media (max-height: 500px) {
  html[data-input-mode="touch"] .sled-world-hud .sled-location, html[data-input-mode="touch"] .sled-world-hud .sled-player-chip, html[data-input-mode="touch"] .sled-world-hud .sled-music-slot { display: none !important; }
  html[data-input-mode="touch"] .sled-stats { flex-wrap: wrap; }
  html[data-input-mode="touch"] .sled-stats .i8-stat { padding: 3px 7px; font-size: 13px; }
  html[data-input-mode="touch"] .sled-stats .i8-stat b { font-size: 9px; }
  html[data-input-mode="touch"] .sled-mission-chip { max-width: min(100%, 220px); }
  html[data-input-mode="touch"] .freestyle-readout .sled-trick { max-width: 60vw; margin-inline: auto; }
  html[data-input-mode="touch"] .freestyle-readout .sled-trick[data-idle="true"] { display: none; }
}
/* Short landscape phones: a smaller joystick and action arc, readout clear of the corners. */
@media (max-height: 500px) {
  html[data-input-mode="touch"] .sled-stage .sled-world-hud { padding-bottom: calc(var(--i8-safe-b) + 112px); }
  html[data-input-mode="touch"] .steer-zone { width: 124px; height: 124px; }
  html[data-input-mode="touch"] .steer-track { width: 112px; height: 112px; }
  html[data-input-mode="touch"] .action-pad { grid-template-areas: "jump boost"; grid-template-columns: 52px 72px; grid-template-rows: 72px; gap: 8px; align-items: end; }
  html[data-input-mode="touch"] .action-pad .i8-icon-btn { width: 52px; height: 52px; }
  html[data-input-mode="touch"] .action-pad .boost-control { width: 72px; height: 72px; }
  html[data-input-mode="touch"] .sleddin-community .community-dock { top: calc(var(--i8-safe-t) + 56px); }
}

/* ---- Mobile play: soft keyboard, short landscape prompts, safe areas ---- */
/* Typing (chat, /fin): ride-controls.js releases every held input and marks the
   page; the thumb pads and prompts step aside so the keyboard never presses them. */
html[data-soft-keyboard="open"] .sled-stage .touch-controls,
html[data-soft-keyboard="open"] .sled-world-hud > #winter-dock { visibility: hidden; }
/* Short landscape phones: prompts form one row between the two thumb pads, never
   stacked into the community dock; a long row scrolls sideways instead of wrapping. */
@media (max-height: 500px) and (orientation: landscape) {
  html[data-input-mode="touch"] .sled-world-hud > #winter-dock { grid-area: auto; position: absolute; left: calc(var(--i8-safe-l) + 164px); right: calc(var(--i8-safe-r) + 164px); bottom: var(--i8-safe-b); width: fit-content; max-width: none; margin-inline: auto; flex-direction: row; flex-wrap: nowrap; align-items: flex-end; justify-content: flex-start; overflow-x: auto; overscroll-behavior: contain; touch-action: pan-x; scrollbar-width: none; }
  html[data-input-mode="touch"] .sled-world-hud > #winter-dock::-webkit-scrollbar { display: none; }
  html[data-input-mode="touch"] .sled-world-hud > #winter-dock > .i8-btn { flex: none; white-space: nowrap; }
}
/* Touch targets: every in-world control is at least 44 px. */
html[data-input-mode="touch"] .sled-world-hud .sled-mission-chip, html[data-input-mode="touch"] .sled-actions .i8-btn { min-height: var(--i8-touch); }

/* ---- Menu & settings sheet ---- */
html:not([data-game-state="playing"]) #world-actions { display: none; }
.sled-stage .i8-sheet__body { touch-action: pan-y; }
.sled-stage .i8-sheet > .i8-panel { background: var(--i8-grad-glass), var(--i8-glass-bg-strong); }
.sled-stage .i8-sheet__head { background: linear-gradient(90deg, rgba(77, 232, 255, .08), rgba(230, 76, 255, .08)); border-bottom: 1px solid var(--i8-line-soft); }
.sled-stage .i8-sheet__title { background: var(--i8-grad-chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sled-sheet-section { display: grid; gap: var(--i8-s2); padding-top: var(--i8-s2); border-top: 1px solid var(--i8-line-soft); }
.sled-sheet-section:first-of-type { border-top: 0; }
.sled-sheet-section .i8-panel__title { margin: 0; font-size: var(--i8-fs-md); letter-spacing: var(--i8-track); text-transform: uppercase; }
.sled-sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--i8-s2); }
/* Long action labels wrap instead of clipping inside a 150 px column. */
.sled-sheet-grid > .i8-btn { min-width: 0; height: auto; min-height: var(--i8-touch, 44px); white-space: normal; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
#settings-lockers { grid-column: 1 / -1; justify-self: start; }
.sled-sheet-head, .sled-sheet-tabs, .sled-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--i8-s2); }
.sled-sheet-tabs { justify-content: flex-start; }
.sled-sheet-rows { display: grid; gap: var(--i8-s2); }
.sled-row-copy { display: grid; min-width: 0; gap: 2px; }
.sled-row-copy small { overflow-wrap: anywhere; }
/* Desktop keyboard/mouse settings (mouse look) are hidden on touch and console layouts. */
html:not([data-input-mode="keyboard"]) .sled-desktop-only { display: none; }
html[data-input-mode="touch"] .sled-gamepad-only { display: none; }
html[data-console-layout] .sled-desktop-only { display: none; }
.sled-row-actions { display: flex; flex: none; align-items: center; gap: var(--i8-s2); }
.sled-row-actions .i8-slider { width: min(42vw, 180px); }
.sled-sheet-section .i8-sheet__row > .i8-slider { width: min(42vw, 220px); }
.sled-setting-value { min-width: 3.2em; text-align: right; font-weight: 800; }
#ride-settings-dialog .sled-sidebar { margin-top: var(--i8-s2); }
#stage-end-run[aria-pressed="true"] { animation: i8-pulse .6s ease-in-out infinite alternate; }

/* ---- In-world popouts (career board, Race & Map selector, friends, lockers, parts counter, lodge dialogs)
   share popout-shell.css; below are their list and card contents. ---- */
.career-board-list { display: grid; gap: 12px; margin: 12px 0; }
.career-series { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--i8-line-soft); border-radius: var(--i8-r-control); background: rgba(13, 17, 28, .6); }
.career-series h3 { margin: 0 0 4px; color: var(--i8-cyan); font: 800 clamp(12px, 1.8vw, 15px)/1.2 var(--i8-font); letter-spacing: var(--i8-track); text-transform: uppercase; }
.career-series p { margin: 0 0 4px; color: var(--i8-muted); font-size: var(--i8-fs-xs); }
.career-event { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px 8px 16px; text-align: left; border: 1px solid rgba(127, 240, 255, .22); border-radius: var(--i8-r-control); color: var(--i8-text); background: rgba(9, 12, 24, .7); font: 700 var(--i8-fs-sm)/1.25 var(--i8-font); cursor: pointer; transition: border-color var(--i8-t-med), box-shadow var(--i8-t-med); }
.career-event::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--i8-cyan); opacity: .7; }
.career-event[data-kind="roam"]::before { background: var(--i8-success); }
.career-event[data-kind="hub"]::before { background: var(--i8-violet); }
.career-event[data-kind="activity"]::before { background: var(--i8-magenta); }
.career-event small { flex: none; color: var(--i8-muted); font-size: var(--i8-fs-xs); letter-spacing: .04em; }
.career-event:hover:not(:disabled) { border-color: var(--i8-cyan); box-shadow: 0 0 12px rgba(77, 232, 255, .3); }
.career-event[aria-pressed="true"] { border-color: var(--i8-cyan-bright); background: linear-gradient(100deg, rgba(42, 108, 240, .45), rgba(91, 43, 216, .4)); box-shadow: 0 0 16px rgba(77, 232, 255, .45), var(--i8-inset); }
.career-event:disabled { opacity: .5; cursor: not-allowed; }
.race-selector-panel .race-option[data-here="true"] small::after { content: " · YOU ARE HERE"; color: var(--i8-success); }
.career-bonus { margin: 0; padding: 12px; border: 1px solid rgba(255, 212, 121, .5); border-radius: var(--i8-r-control); color: var(--i8-warning); }
#career-board-objective, #race-selector-objective { margin: 8px 0; color: var(--i8-text-soft); font-size: var(--i8-fs-sm); }
/* The launch action lives in the shell footer below the scrolling list, so it never covers the last row. */
#career-board-launch, #race-selector-launch { flex: 1 1 auto; min-height: 56px; }
#career-board-launch:disabled, #race-selector-launch:disabled { opacity: 1; }
@media (max-width: 600px) { .career-event { flex-wrap: wrap; } }

/* ---- 10-foot console layout: larger HUD type and targets ---- */
html[data-console-layout="true"] .sled-world-hud { --i8-touch-hud: 56px; padding: var(--console-safe-y, 5vh) var(--console-safe-x, 5vw); font-size: 20px; }
html[data-console-layout="true"] .sled-world-hud .i8-stat { font-size: 24px; }
html[data-console-layout="true"] .sled-world-hud .i8-stat b { font-size: 16px; }
html[data-console-layout="true"] .sled-actions .i8-btn { min-height: var(--console-target, 56px); font-size: 18px; }
html[data-console-layout="true"] .sleddin-community .community-dock { left: auto; right: var(--console-safe-x, 5vw); top: clamp(150px, 24%, 230px); flex-direction: row; }
/* The console dock never folds to its icon, even when the browser reports a touch-type pointer and opening chat
   or the board marks it collapsed: every button stays reachable by pad. */
html[data-console-layout="true"] .sleddin-community .community-dock-toggle { display: none; }
html[data-console-layout="true"] .sleddin-community .community-dock[data-collapsed="true"] > :not(.community-dock-toggle):not([hidden]) { display: inline-flex; }
html[data-console-layout="true"] .sleddin-community .community-chat,
html[data-console-layout="true"] .sleddin-community .community-board { left: auto; right: var(--console-safe-x, 5vw); top: calc(clamp(150px, 24%, 230px) + 84px); transform: none; max-height: calc(100% - clamp(150px, 24%, 230px) - 84px - var(--console-safe-y, 5vh)); }
html[data-console-layout="true"] .sled-world-hud .i8-hud__tl { max-width: min(40vw, 640px); }
html[data-console-layout="true"] dialog.i8-sheet:not(.sled-popout) { border: 0; max-width: min(900px, 90vw); }

/* ---- Menu & settings sheet layout (settings-core.js categories) ----
   Desktop / TV: a wide two-pane sheet, the category rail on the left and the
   section's settings in a responsive grid on the right. Phones: one column
   with the category tabs as a sticky horizontal strip. Console: full screen
   inside the 5% title-safe area at 10-foot sizes. Header and footer bars hold
   the actions (BACK, GO RIDE, saved state); nothing is clipped by scrolling. */
.sled-settings-sheet.i8-sheet { max-height: min(92vh, 92dvh); margin-block: max(12px, 3vh) auto; }
/* Phones: the sheet rests at the top like every other overlaid screen, not as
   the kit's bottom sheet. */
@media (max-width: 719.98px) {
  .sled-settings-sheet.i8-sheet { inset: 0 0 auto 0; margin: max(8px, env(safe-area-inset-top)) 0 0; max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + 8px)); border-radius: 0 0 var(--i8-r-panel) var(--i8-r-panel); }
}
@media (min-width: 720px) {
  .sled-settings-sheet.i8-sheet { width: min(1180px, calc(100% - 48px)); max-height: min(90vh, 900px); }
}
.sled-settings-head { align-items: flex-start; flex-wrap: wrap; }
.sled-settings-head #settings-selection { margin: 4px 0 0; }
.sled-settings-head-actions { display: flex; flex: none; flex-wrap: wrap; gap: var(--i8-s2); }
.sled-settings-body { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: var(--i8-s3); align-items: start; padding-top: var(--i8-s3); }
.sled-settings-tabs { position: sticky; top: 0; z-index: 2; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px; }
.sled-settings-tabs > button { flex: none; justify-content: flex-start; min-height: 44px; text-align: left; }
.sled-settings-tabs > button[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--i8-accent), var(--i8-inset); }
.sled-settings-panels { display: grid; min-width: 0; gap: var(--i8-s3); }
.sled-settings-panels > [data-settings-panel] { border-top: 0; padding-top: 0; }
.sled-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--i8-s2) var(--i8-s3); }
.sled-section-head > p { flex: 1 1 320px; margin: 0; }
.sled-section-head .sled-section-reset { margin-left: auto; }
.sled-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--i8-s2); }
.sled-settings-grid .i8-sheet__row { min-height: 60px; }
.sled-settings-note { padding: var(--i8-s2) var(--i8-s3); border-radius: var(--i8-r-control); background: rgba(255, 255, 255, .03); color: var(--i8-text-soft); font-size: var(--i8-fs-sm); }
.sled-settings-foot { align-items: center; justify-content: space-between; }
.sled-save-state { margin: 0; font-size: var(--i8-fs-xs); letter-spacing: var(--i8-track); text-transform: uppercase; }
.sled-save-state[data-state="saving"] { color: var(--i8-warning); }
.sled-save-state[data-state="saved"] { color: var(--i8-success); }
/* Toggles say ON / OFF beside the switch: state is never colour or glow alone. */
#ride-settings-dialog .i8-sheet__row:has(> .i8-toggle)::after { content: "OFF"; flex: none; min-width: 2.4em; color: var(--i8-muted); font: 800 var(--i8-fs-xs)/1 var(--i8-font); letter-spacing: var(--i8-track); text-align: left; }
#ride-settings-dialog .i8-sheet__row:has(> .i8-toggle:checked)::after { content: "ON"; color: var(--i8-success); }
@media (max-width: 719px) {
  .sled-settings-body { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .sled-settings-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: calc(var(--i8-s4) * -1); padding-inline: var(--i8-s4); border-radius: 0; border-left: 0; border-right: 0; background: var(--i8-panel-solid); }
  .sled-settings-tabs::-webkit-scrollbar { display: none; }
  .sled-settings-tabs > button { min-width: max-content; }
  .sled-settings-head-actions { width: 100%; }
  .sled-settings-head-actions > .i8-btn { flex: 1 1 auto; }
}
/* Console / TV: the sheet fills the title-safe area at 10-foot sizes. */
html[data-console-layout="true"] .sled-settings-sheet.i8-sheet { inset: 0; width: calc(100vw - 2 * var(--console-safe-x)); max-width: none; max-height: calc(100vh - 2 * var(--console-safe-y)); margin: var(--console-safe-y) auto auto; border-radius: var(--i8-r-panel); }
html[data-console-layout="true"] .sled-settings-body { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
html[data-console-layout="true"] .sled-settings-tabs > button, html[data-console-layout="true"] .sled-settings-grid .i8-sheet__row { min-height: var(--console-target, 56px); }
html[data-console-layout="true"] .sled-settings-sheet .i8-sheet__row > :first-child { font-size: 20px; }
html[data-console-layout="true"] .sled-settings-sheet small { font-size: 16px; }
/* Larger text (HUD & accessibility): HUD readouts, prompts and the sheet scale up together. */
html[data-large-text="on"] .sled-stage { --i8-fs-xs: 15px; --i8-fs-sm: 17px; --i8-fs-md: 20px; --i8-fs-lg: 26px; }
html[data-large-text="on"] .sled-world-hud .sled-stats .i8-stat strong { font-size: 1.25em; }
html[data-large-text="on"] #ride-settings-dialog { font-size: 1.15em; }
/* HUD density from hud-layout.js (--hud-scale, --hud-safe-*): TV readouts scale up with the 10-foot contract. */
html[data-hud-density="tv"] .sled-world-hud { font-size: calc(1em * var(--hud-scale, 1.25)); }
html[data-hud-density="tv"] .sled-world-hud .sled-stats .i8-stat strong { font-size: 1.4em; }
html[data-hud-density="compact"] .sled-world-hud { font-size: calc(1em * var(--hud-scale, .9)); }
