/* Atlantic Race menu polish (2026-10-25): one readable stylesheet over race.css and the home
   bundle's CSS, linked last on every menu page (index, modes, races/<mode>.html, options,
   profile, exit). It does not apply to the garages or race screens (game.css), which stay dark.

   - Tokens: every colour the menus use is a --mp-* custom property, set for the dark Storm
     theme on :root and for the light Coast Daylight theme on html[data-look-theme=sand]
     (app-theme.js sets that attribute; html[data-app-theme] stays "storm" underneath).
     --accent-ink is the mode colour made dark enough to read as text on the light theme.
   - Look: glass panels (blur over the backdrop or the home beach), a hairline of the accent
     along the top edge and a soft inner highlight, like the garage showroom; clear hover,
     pressed, picked and focus states (a white ring on dark, an ink ring on light; the home
     bundle's gamepad focus gets the same ring).
   - Motion: short lifts and slides, staggered entry of cards and stages; all of it is off
     under prefers-reduced-motion. */

@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(./assets/barlow-latin-500-normal-BPAOfeC8.woff2) format('woff2'); }

/* ---------- tokens ---------- */
:root {
  --mp-bg-top: #0d3354;
  --mp-bg-bot: #041424;
  --mp-glass: rgb(8 26 46 / .6);
  --mp-glass-strong: rgb(8 24 42 / .86);
  --mp-well: rgb(0 8 18 / .32);
  --mp-card: linear-gradient(160deg, rgb(255 255 255 / .07), rgb(255 255 255 / .02));
  --mp-card-hover: linear-gradient(160deg, rgb(255 255 255 / .12), rgb(255 255 255 / .04));
  --mp-stroke: rgb(255 255 255 / .11);
  --mp-stroke-2: rgb(255 255 255 / .28);
  --mp-hi: inset 0 1px rgb(255 255 255 / .07);
  --mp-shadow: 0 24px 60px rgb(0 0 0 / .38);
  --mp-shadow-sm: 0 8px 22px rgb(0 0 0 / .28);
  --mp-ink: #f4f8fc;
  --mp-ink-2: #a9c1d6;
  --mp-title: #ffffff;
  --mp-gold-ink: #ffd34d;
  --mp-on-accent: #06192c;
  --mp-track: rgb(255 255 255 / .13);
  --mp-kbd-bg: rgb(0 0 0 / .28);
  --mp-kbd-line: rgb(255 255 255 / .26);
  --mp-focus: #ffffff;
  --mp-scrim: rgb(2 8 16 / .66);
  --mp-lines: rgb(255 255 255 / .035);
  --mp-radius: 16px;
  --mp-ease: cubic-bezier(.2, .8, .2, 1);
  --accent-ink: var(--accent);
}
html[data-look-theme='sand'] {
  color-scheme: light;
  --navy: #f3ead8;
  --navy-2: #d9ecf4;
  --ink: #13263a;
  --muted: #4a5e72;
  --panel: rgb(255 252 245 / .74);
  --line: rgb(19 38 58 / .14);
  --mp-bg-top: #cfe7f2;
  --mp-bg-bot: #f5ecd9;
  --mp-glass: rgb(255 253 248 / .66);
  --mp-glass-strong: rgb(255 252 246 / .94);
  --mp-well: rgb(19 38 58 / .06);
  --mp-card: linear-gradient(160deg, rgb(255 255 255 / .92), rgb(255 250 240 / .78));
  --mp-card-hover: linear-gradient(160deg, #ffffff, rgb(255 252 246 / .95));
  --mp-stroke: rgb(19 38 58 / .13);
  --mp-stroke-2: rgb(19 38 58 / .32);
  --mp-hi: inset 0 1px rgb(255 255 255 / .9);
  --mp-shadow: 0 22px 50px rgb(60 48 20 / .16);
  --mp-shadow-sm: 0 6px 18px rgb(60 48 20 / .12);
  --mp-ink: #13263a;
  --mp-ink-2: #4a5e72;
  --mp-title: #0f2236;
  --mp-gold-ink: #8a5300;
  --mp-on-accent: #0b1a28;
  --mp-track: rgb(19 38 58 / .14);
  --mp-kbd-bg: #ffffff;
  --mp-kbd-line: rgb(19 38 58 / .25);
  --mp-focus: #0f2236;
  --mp-scrim: rgb(20 34 48 / .42);
  --mp-lines: rgb(19 38 58 / .045);
}
/* the mode colour as text: itself on dark, darkened on light (declared where --accent is set) */
body, :is(.game-panel, .panel, .racer-chip) { --accent-ink: var(--accent); }
.avatar { --accent-ink: var(--a); }
html[data-look-theme='sand'],
html[data-look-theme='sand'] :is(body, .game-panel, .panel, .racer-chip) {
  --accent-ink: color-mix(in oklab, var(--accent) 50%, #0d1b2a);
}
html[data-look-theme='sand'] .avatar { --accent-ink: color-mix(in oklab, var(--a) 50%, #0d1b2a); }

/* ---------- page base ---------- */
body { color: var(--mp-ink); background: var(--mp-bg-bot); font-feature-settings: 'tnum' 0; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.backdrop { background: radial-gradient(120% 80% at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), linear-gradient(180deg, var(--mp-bg-top), var(--mp-bg-bot) 72%); }
.backdrop .lines { background: repeating-linear-gradient(115deg, transparent 0 46px, var(--mp-lines) 46px 48px); }
html[data-look-theme='sand'] .backdrop .glow { opacity: .35; }
html[data-look-theme='sand'] .backdrop .sea { background: linear-gradient(180deg, rgb(47 155 224 / 0), rgb(47 155 224 / .14) 40%, rgb(24 190 200 / .12)); }
kbd { border-color: var(--mp-kbd-line); background: var(--mp-kbd-bg); color: var(--mp-ink-2); box-shadow: 0 1px 0 var(--mp-kbd-line); }

/* one focus ring everywhere (keyboard, and the home page's gamepad focus) */
:focus-visible, html[data-input='gamepad'] :focus { outline: 2px solid var(--mp-focus); outline-offset: 3px; }

/* ---------- top bar ---------- */
.back, .racer-chip, .ghost-btn {
  background: var(--mp-glass); border: 1px solid var(--mp-stroke); box-shadow: var(--mp-hi), var(--mp-shadow-sm);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  transition: transform .18s var(--mp-ease), border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.back { color: var(--mp-gold-ink); border-radius: 12px; font-size: .92rem; }
.back:hover { border-color: var(--mp-gold-ink); }
.back:active, .racer-chip:active, .ghost-btn:active { transform: translateY(1px) scale(.98); }
.counter { color: var(--mp-ink-2); }
.counter b { color: var(--accent-ink); }
.brand { filter: drop-shadow(0 6px 14px rgb(0 0 0 / .35)); }

/* ---------- headings ---------- */
.page-head h1 { color: var(--mp-title); text-shadow: 0 2px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
html[data-look-theme='sand'] .page-head h1 { text-shadow: none; }
.page-head h1::after { height: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent) 60%, transparent); }
.page-head p, .about { color: var(--mp-ink-2); font-weight: 500; }

/* ---------- glass panels ---------- */
.card, .stages, .stats {
  position: relative; background: var(--mp-glass); border: 1px solid var(--mp-stroke); border-radius: var(--mp-radius);
  box-shadow: var(--mp-hi), var(--mp-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.card::before, .stages::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 80%, transparent), transparent); opacity: .7;
}
.card h2, .stages h2 { color: var(--mp-gold-ink); font-size: .82rem; letter-spacing: .24em; }
.card h2::before, .stages h2::before { content: ''; flex: none; width: 4px; height: 1.1em; border-radius: 2px; background: var(--accent); }
.stages h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { border-top-color: var(--mp-stroke); }
.row small, .note, .status { color: var(--mp-ink-2); font-weight: 500; }
.status.saved { color: var(--accent-ink); }

/* ---------- controls (options) ---------- */
.segmented { background: var(--mp-well); border-color: var(--mp-stroke); border-radius: 12px; }
.segmented button { border-radius: 9px; color: var(--mp-ink-2); transition: background .18s ease, color .18s ease, transform .12s ease; }
.segmented button:hover { color: var(--mp-ink); background: var(--mp-well); }
.segmented button:active { transform: scale(.96); }
.segmented button[aria-checked='true'] { background: var(--accent); color: var(--mp-on-accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.switch { background: var(--mp-track); border-color: var(--mp-stroke-2); }
.switch::after { box-shadow: 0 2px 6px rgb(0 0 0 / .3); transition: transform .2s var(--mp-ease), background .2s ease; }
html[data-look-theme='sand'] .switch::after { background: #ffffff; }
.switch[aria-checked='true']::after { background: var(--mp-on-accent); }
input[type='range'] { accent-color: var(--accent); }
.slider output { color: var(--mp-ink); }
.logo-choice, .theme-choice, .avatar, .tile {
  background: var(--mp-card); border: 1px solid var(--mp-stroke); color: var(--mp-ink-2); box-shadow: var(--mp-hi);
  transition: transform .18s var(--mp-ease), border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.logo-choice:hover, .theme-choice:hover, .avatar:hover { transform: translateY(-2px); border-color: var(--mp-stroke-2); background: var(--mp-card-hover); }
.logo-choice:active, .theme-choice:active, .avatar:active { transform: translateY(0) scale(.98); }
.logo-choice[aria-checked='true'], .theme-choice[aria-checked='true'] { border-color: var(--accent); color: var(--mp-ink); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px color-mix(in srgb, var(--accent) 22%, transparent); }
.logo-choice img { border-radius: 6px; }
/* theme cards: a little preview of each palette */
.theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-choice { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; }
.theme-swatch { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.4fr 1fr; gap: 4px; width: 84px; height: 56px; padding: 6px; border-radius: 10px; border: 1px solid var(--mp-stroke); }
.theme-swatch i { border-radius: 4px; }
.theme-swatch i:first-child { grid-column: 1 / -1; }
.theme-swatch[data-swatch='storm'] { background: linear-gradient(180deg, #0d3354, #041424); }
.theme-swatch[data-swatch='storm'] i:nth-child(1) { background: rgb(255 255 255 / .12); }
.theme-swatch[data-swatch='storm'] i:nth-child(2) { background: #ffd34d; }
.theme-swatch[data-swatch='storm'] i:nth-child(3) { background: #2fb5ff; }
.theme-swatch[data-swatch='sand'] { background: linear-gradient(180deg, #cfe7f2, #f5ecd9); }
.theme-swatch[data-swatch='sand'] i:nth-child(1) { background: #ffffff; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.theme-swatch[data-swatch='sand'] i:nth-child(2) { background: #13263a; }
.theme-swatch[data-swatch='sand'] i:nth-child(3) { background: #ff8a3d; }
.theme-text { display: grid; gap: 2px; min-width: 0; }
.theme-text b { color: var(--mp-ink); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.theme-text small { color: var(--mp-ink-2); font-weight: 500; }
.keys div { color: var(--mp-ink-2); }
.keys dd { color: var(--mp-ink); font-weight: 500; }
.ghost-btn { color: var(--mp-gold-ink); border-radius: 12px; }
.ghost-btn:hover { border-color: var(--mp-gold-ink); transform: translateY(-1px); }
#erase-all { color: #e0485a; }
html:not([data-look-theme='sand']) #erase-all { color: #ff8f9a; }

/* ---------- profile ---------- */
.field label { color: var(--mp-ink-2); }
.field input, .field select { background: var(--mp-well); border-color: var(--mp-stroke-2); color: var(--mp-ink); transition: border-color .18s ease, box-shadow .18s ease; }
.field input:hover, .field select:hover { border-color: var(--accent); }
html[data-look-theme='sand'] .field select option { background: #ffffff; color: #13263a; }
.player-name { color: var(--mp-title); }
.player-sub { color: var(--mp-ink-2); }
.player-sub b { color: var(--accent-ink); }
.avatar { color: var(--accent-ink); }
.avatar[aria-checked='true'] { color: var(--mp-on-accent); background: var(--a); }
.avatar-big .race-num { border-color: var(--mp-bg-bot); box-shadow: 0 6px 14px rgb(0 0 0 / .25); }
.tile { position: relative; overflow: hidden; background: var(--mp-well); }
.tile::after { content: ''; position: absolute; left: 0; bottom: 0; width: 36%; height: 3px; background: var(--accent); opacity: .8; }
.tile b { color: var(--mp-ink); font-variant-numeric: tabular-nums; }
.tile span { color: var(--mp-ink-2); }

/* ---------- dialogs ---------- */
.soon { background: var(--mp-glass-strong); color: var(--mp-ink); border: 1px solid var(--mp-stroke-2); border-top: 3px solid var(--accent); box-shadow: var(--mp-shadow);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.soon::backdrop { background: var(--mp-scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.soon h2 { color: var(--mp-gold-ink); }
.soon p { color: var(--mp-ink-2); }
.soon button { border-color: var(--mp-gold-ink); color: var(--mp-gold-ink); transition: background .15s ease, color .15s ease; }
.soon button:hover { background: color-mix(in srgb, var(--mp-gold-ink) 14%, transparent); }
.soon .two button.danger { border-color: #e0485a; color: #e0485a; }
.soon[open] { animation: mp-pop .28s var(--mp-ease) both; }
@keyframes mp-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- mode page: hero, stats, start ---------- */
.tag { color: var(--accent-ink); }
.stats { padding: 14px 20px; }
.stat dt, .gp-stats b { color: var(--mp-ink-2); }
.stat dd i, .gp-bars i { background: var(--mp-track); }
/* (2026-10-28) Sand: a lit bar in a light mode colour (Foot Runner's yellow) was as light as an empty one
   (mode pages, race select, garage choice cards; the garage's dark showroom keeps its bright bars) */
html[data-look-theme='sand'] :is(.stat dd i.on, .gp-bars i.on, .car-choice i.on):not(.showroom *) { background: color-mix(in oklab, var(--accent) 72%, #0d1b2a); }
.stat.racers dd { color: var(--mp-ink); }
.race-btn { box-shadow: inset 0 -4px rgb(0 0 0 / .2), 0 10px 26px rgb(232 163 58 / .35); transition: transform .18s var(--mp-ease), filter .18s ease, box-shadow .18s ease; }
.race-btn:hover { box-shadow: inset 0 -4px rgb(0 0 0 / .2), 0 14px 34px rgb(232 163 58 / .5); }
.race-btn:active { transform: translateY(1px) scale(.98); filter: brightness(.96); }
/* clipped to a slant, so the ring is drawn inside it (as in the garage) */
.race-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #2a1a0c, inset 0 0 0 5px #fff, 0 10px 26px rgb(232 163 58 / .45); }
.picked { color: var(--mp-ink-2); }
.picked b { color: var(--mp-ink); }
html[data-look-theme='sand'] .mode-logo { filter: drop-shadow(0 10px 20px rgb(40 30 10 / .22)); }
html[data-look-theme='sand'] .mode-logo text[fill='#fff'] { fill: #0f2236; }
html[data-look-theme='sand'] .mode-logo text[fill='url(#lg-gold)'], html[data-look-theme='sand'] .mode-logo text[fill='#ffd34d'] { fill: #8a5300; }

/* ---------- stages: postcard cards ---------- */
.stages { padding: 20px; }
.open-count { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); margin-left: 0; }
/* the route's progress, from race.js (--open: 0..1) */
.stages h2::after {
  content: ''; flex: 1 1 80px; height: 6px; min-width: 80px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) calc(var(--open, 0) * 100%), var(--mp-track) 0);
}
.stage {
  padding: 12px 14px; border: 1px solid var(--mp-stroke); border-radius: 14px; isolation: isolate;
  background-color: #0b2a44; background-size: cover; background-position: center bottom;
  color: #fff; box-shadow: var(--mp-shadow-sm);
  transition: transform .2s var(--mp-ease), border-color .2s ease, box-shadow .2s ease, filter .2s ease;
}
/* a shade under the text so the city reads on any picture */
.stage::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(4 14 26 / 0) 25%, rgb(4 14 26 / .78)); transition: opacity .2s ease; }
.stage .num { color: rgb(255 255 255 / .82); text-shadow: 0 1px 4px rgb(0 0 0 / .6); }
.stage .city { color: #fff; text-shadow: 0 2px 8px rgb(0 0 0 / .55); }
.stage .country { color: rgb(255 255 255 / .78); font-weight: 500; }
.stage-icon { color: rgb(255 255 255 / .55); filter: drop-shadow(0 2px 4px rgb(0 0 0 / .5)); width: 36px; height: 36px; }
.stage:hover { transform: translateY(-3px); border-color: rgb(255 255 255 / .55); box-shadow: 0 14px 30px rgb(0 0 0 / .32); }
.stage:active { transform: translateY(0) scale(.98); }
.stage[aria-checked='true'] {
  background-color: #0b2a44; border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 12px 32px color-mix(in srgb, var(--accent) 40%, transparent);
}
.stage[aria-checked='true'] .num { color: #fff; }
.stage[aria-checked='true'] .num::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); vertical-align: 1px; }
.stage[aria-checked='true'] .stage-icon { color: #fff; }
.stage:focus-visible { outline: 2px solid var(--mp-focus); outline-offset: 3px; }
/* locked: the picture greys out under a dark veil, the padlock in gold */
.stage.locked { border-style: solid; border-color: var(--mp-stroke); background-color: #3a4450; background-blend-mode: luminosity; }
.stage.locked::before { background: linear-gradient(180deg, rgb(6 12 20 / .45), rgb(6 12 20 / .85)), repeating-linear-gradient(135deg, rgb(255 255 255 / .05) 0 8px, transparent 8px 16px); }
.stage.locked .num { color: rgb(255 255 255 / .7); }
.stage.locked :is(.city, .country) { opacity: .7; }
.stage.locked .lock { color: #ffd34d; opacity: 1; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .6)); }
.stage.locked:hover { border-color: #ffd34d; background-color: #56606c; }
.goals { border-top-color: var(--mp-stroke); }
.goals-title { color: var(--mp-ink); }
.goals-title span { color: var(--mp-ink-2); }
.ways li { background: var(--mp-well); border-color: var(--mp-stroke); }
.ways li.ok { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ways .way-icon { background: var(--mp-track); color: var(--mp-gold-ink); }
.ways li.ok .way-icon { background: var(--accent); color: var(--mp-on-accent); }
.ways small, .tasks { color: var(--mp-ink-2); }
.tasks li span { color: var(--mp-gold-ink); }
.tasks li.ok { color: var(--mp-ink); }
.tasks li.ok span { color: var(--accent-ink); }

/* ---------- the rail of modes ---------- */
.rail { background: var(--mp-glass); border-top: 1px solid var(--mp-stroke); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
.panel { background: var(--mp-card); border-color: var(--mp-stroke); color: var(--mp-ink-2); box-shadow: var(--mp-hi); transition: transform .18s var(--mp-ease), border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease; }
.panel .icon { color: var(--accent-ink); }
.panel:hover { color: var(--mp-ink); background: var(--mp-card-hover); }
.panel:active, .step:active { transform: scale(.97); }
.panel[aria-current='page'] { color: var(--mp-on-accent); }
.panel[aria-current='page'] .icon { color: var(--mp-on-accent); }
.step { background: var(--mp-glass); border-color: var(--mp-stroke); color: var(--mp-gold-ink); }
.step:hover { border-color: var(--mp-gold-ink); }

/* ---------- race select (modes.html) ---------- */
.racer-chip { border-radius: 14px; color: var(--mp-ink); }
.racer-chip:hover { border-color: var(--accent); }
.rc-badge { color: var(--mp-on-accent); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); }
.rc-text small { color: var(--mp-ink-2); }
.hints { color: var(--mp-ink-2); }
.game-panel {
  border: 1px solid var(--mp-stroke); border-radius: 18px; color: var(--mp-ink);
  box-shadow: var(--mp-hi), var(--mp-shadow-sm);
  transition: transform .22s var(--mp-ease), box-shadow .22s ease, border-color .22s ease;
}
/* a hairline of the mode colour along the top */
.game-panel > .gp-top::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .75;
}
html[data-look-theme='sand'] .game-panel {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 24%, #ffffff), #fffaf1 70%);
}
html[data-look-theme='sand'] .game-panel::after { background: repeating-linear-gradient(110deg, transparent 0 22px, rgb(19 38 58 / .03) 22px 23px); }
html[data-look-theme='sand'] .gp-art { opacity: .22; }
.gp-num { -webkit-text-stroke-color: color-mix(in srgb, var(--mp-ink) 45%, transparent); }
.gp-racers { color: var(--mp-ink-2); background: var(--mp-well); border-color: var(--mp-stroke); }
.gp-tag { color: var(--accent-ink); }
.gp-about { color: var(--mp-ink-2); font-weight: 500; }
.gp-play { color: var(--mp-ink); background: var(--mp-well); }
.gp-badge { color: var(--mp-on-accent); }
.game-panel:is(:hover, :focus-visible) { transform: translateY(-5px); }
.game-panel:active { transform: translateY(-1px) scale(.99); }
.game-panel:focus-visible { outline: 2px solid var(--mp-focus); outline-offset: 4px; }
.game-panel:is(:hover, :focus-visible) .gp-play { color: var(--mp-on-accent); }
.game-panel.last .gp-racers::before { color: var(--accent-ink); }

/* ---------- exit ---------- */
.exit-card { padding: 24px 26px; }

/* ---------- home page (index.html, the home bundle) ---------- */
/* the look picker stays hidden; keep its theme row out too, so the menu sits where it did */
.look-row[data-row='theme'] { display: none !important; }
body[data-home-page] .menu-panel {
  position: relative; padding: 12px; border-radius: 20px;
  background: rgb(6 22 38 / .48); border: 1px solid rgb(255 255 255 / .16);
  box-shadow: inset 0 1px rgb(255 255 255 / .1), 0 20px 50px rgb(0 10 30 / .35);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
body[data-home-page] .menu-panel::before {
  content: ''; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffd56a, transparent); opacity: .8;
}
body[data-home-page] .menu { gap: 10px; }
body[data-home-page] .menu .btn {
  position: relative; border-radius: 12px; font-family: Barlow, system-ui, sans-serif; font-weight: 800; letter-spacing: .16em;
  transition: transform .18s var(--mp-ease), background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body[data-home-page] .menu .btn-ghost-gold { background: rgb(4 16 30 / .5); border-color: rgb(255 213 106 / .42); color: #ffe08a; text-shadow: 0 1px 2px rgb(0 0 0 / .45); }
body[data-home-page] .menu .btn-ghost-gold:hover { background: rgb(255 213 106 / .16); color: #fff4c0; border-color: #ffd56a; }
body[data-home-page] .menu .btn-hero { box-shadow: inset 0 -3px rgb(0 0 0 / .16), 0 8px 24px rgb(240 160 48 / .45); text-shadow: none; }
body[data-home-page] .menu .btn:hover { transform: translateY(-2px); }
body[data-home-page] .menu .btn:active { transform: translateY(1px) scale(.97); }
body[data-home-page] .menu .btn:is(:focus-visible, :focus-visible:hover) { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px rgb(255 213 106 / .35); }
html[data-input='gamepad'] body[data-home-page] .menu .btn:focus { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px rgb(255 213 106 / .35); transform: translateY(-2px); }
.ar-clock { background: rgb(6 22 38 / .5); border-color: rgb(255 255 255 / .2); box-shadow: inset 0 1px rgb(255 255 255 / .1), 0 8px 20px rgb(0 10 30 / .25);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); }
/* light theme on the beach: frosted white glass, ink text */
html[data-look-theme='sand'] body[data-home-page] .menu-panel { background: rgb(255 252 245 / .62); border-color: rgb(255 255 255 / .75); box-shadow: inset 0 1px #fff, 0 20px 46px rgb(40 50 70 / .22); }
html[data-look-theme='sand'] body[data-home-page] .menu .btn-ghost-gold { background: rgb(255 255 255 / .7); border-color: rgb(19 38 58 / .2); color: #13263a; text-shadow: none; }
html[data-look-theme='sand'] body[data-home-page] .menu .btn-ghost-gold:hover { background: #ffffff; border-color: #c27a00; color: #0f2236; }
html[data-look-theme='sand'] body[data-home-page] .menu .btn:is(:focus-visible, :focus-visible:hover) { outline-color: #0f2236; box-shadow: 0 0 0 6px rgb(255 213 106 / .55); }
html[data-look-theme='sand'] .ar-clock { background: rgb(255 252 245 / .72); border-color: rgb(255 255 255 / .8); color: #13263a; }
html[data-look-theme='sand'] .ar-clock-icon { color: #c27a00; }
/* at night the light glass dims a little so it does not glare over the dark beach */
html[data-look-theme='sand'][data-time-of-day='night'] body[data-home-page] .menu-panel { background: rgb(232 238 248 / .5); border-color: rgb(255 255 255 / .35); }
html[data-look-theme='sand'][data-time-of-day='night'] body[data-home-page] .menu .btn-ghost-gold { background: rgb(240 244 252 / .82); }
html[data-look-theme='sand'][data-time-of-day='night'] .ar-clock { background: rgb(232 238 248 / .78); }
html[data-look-theme='sand'][data-time-of-day='night'] .ar-clock-icon { color: #3a4a7a; }
/* phones: the logo fits the width, no box behind the title, the menu centred under it */
@media (max-width: 899px), (max-height: 599px) {
  html[data-home-layout='center'] body[data-home-page] .title-panel { background: none; border: 0; padding: 0; justify-items: center; width: 100%; }
  html[data-home-layout='center'] body[data-home-page] .title.voyage-brand { width: min(560px, calc(100vw - 32px)); margin-inline: auto; }
  html[data-home-layout='center'] body[data-home-page] .title.voyage-brand img { width: 100%; height: auto; transform: none !important; }
  html[data-home-layout='center'] body[data-home-page] .menu-panel { width: min(340px, 100%); margin-inline: auto; }
}

/* seven entries (home-extra.js adds How to play, Controls and Credits, 2026-10-25): narrower buttons that
   wrap to a second row rather than run past the glass */
html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) { flex-wrap: wrap; justify-content: center; max-width: min(1180px, calc(100vw - 48px)); }
html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) .btn { min-width: 0; flex: 0 1 auto; padding-inline: clamp(14px, 1.3vw, 22px); letter-spacing: .1em; }
/* wide screens: the glass banner stretches so all seven sit on one row. Not on touch tablets held
   sideways: there the home bundle puts the logo on the left and the menu on the right, and a row
   of seven ran off the right edge (1180x820, 1366x1024); those get the two columns below.
   (2026-11-13: nine entries with Online Race and Leaderboards: one row needs about 1400 px, so
   narrower screens wrap to two centred rows. The row is wider than .container (1152 px at most),
   so it is centred by the flex container (align-self) with no auto margins: auto margins pin a
   too-wide item to the left instead) */
@media (min-width: 1600px) and (min-height: 600px) and (not ((pointer: coarse) and (orientation: landscape))) {
  html[data-home-layout='center'] body[data-home-page] .menu-panel:has(#tutorial-btn) { width: max-content; max-width: calc(100vw - 48px); margin-inline: 0; align-self: center; padding-inline: 20px; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) { flex-wrap: nowrap; max-width: none; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card:nth-child(2) { animation-delay: .1s; } .card:nth-child(3) { animation-delay: .14s; }
  .card:nth-child(4) { animation-delay: .18s; } .card:nth-child(5) { animation-delay: .22s; }
  .stage { animation: slide-in .45s var(--mp-ease) both; }
  .stage:nth-child(2) { animation-delay: .05s; } .stage:nth-child(3) { animation-delay: .1s; }
  .stage:nth-child(4) { animation-delay: .15s; } .stage:nth-child(5) { animation-delay: .2s; } .stage:nth-child(6) { animation-delay: .25s; }
}
@media (prefers-reduced-motion: reduce) {
  .soon[open] { animation: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 899px) {
  .theme-choices { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .stages { padding: 14px; }
  .stage-grid { gap: 10px; }
  .back { padding: 8px 14px 8px 10px; }
}

/* ---------- stage pictures: a postcard of each coast city (inline SVG, no files) ---------- */
.stage[data-stage='0'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%237cc4ec%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23f6d9a8%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232f8ac0%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231b5a86%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23fff2c0%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23fff2c0%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%27230%27%20cy%3D%2762%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%27230%27%20cy%3D%2762%27%20r%3D%2711%27%20fill%3D%27%23fffbe6%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M0%20101%20Q40%2074%2080%20101%20Q105%2084%20130%20101%20Z%20M300%20101%20H170%20L175%2097%20H300%20Z%27%20fill%3D%27%232a4058%27%2F%3E%3Crect%20x%3D%2750%27%20y%3D%2770%27%20width%3D%275%27%20height%3D%2712%27%20fill%3D%27%23f4f0e6%27%2F%3E%3Crect%20x%3D%2749%27%20y%3D%2767%27%20width%3D%277%27%20height%3D%274%27%20fill%3D%27%23c8372d%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage='1'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f0b860%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffe7b0%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%233a8aa8%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231f5a78%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23fff0b0%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23fff0b0%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%2770%27%20cy%3D%2752%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%2770%27%20cy%3D%2752%27%20r%3D%2711%27%20fill%3D%27%23fff8dc%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M150%20101V70h10v31h6V58h12v43h8V76h10v25h8V64h9v37h10V80h12v21h10V72h9v29h46V101Z%20M0%20101h120v-6H0Z%27%20fill%3D%27%233a3040%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage='2'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%239fd2ea%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23e8f2e8%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%233a9ab8%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%231e6a8a%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23ffffff%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffffff%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%27150%27%20cy%3D%2740%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%27150%27%20cy%3D%2740%27%20r%3D%2711%27%20fill%3D%27%23ffffff%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M0%20101V82h14v19h8V70h12v31h10V78h10v23h8V62h14v39h10V84h12v17Z%20M150%20101%20Q200%2092%20300%2096%20V101Z%27%20fill%3D%27%2334465a%27%2F%3E%3Cpath%20d%3D%27M120%2092%20L300%2088%27%20stroke%3D%27%2334465a%27%20stroke-width%3D%273%27%2F%3E%3Cpath%20d%3D%27M140%2092v9M180%2091v10M220%2090v11M260%2089v12%27%20stroke%3D%27%2334465a%27%20stroke-width%3D%272%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage='3'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23e86a4a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffc070%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23c86a5a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235a3050%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23ffd080%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffd080%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%27160%27%20cy%3D%2792%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%27160%27%20cy%3D%2792%27%20r%3D%2711%27%20fill%3D%27%23fff0b0%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M0%20150V112%20Q80%20104%20160%20118%20T300%20112V150Z%27%20fill%3D%27%232a1a28%27%2F%3E%3Cpath%20d%3D%27M40%20116%20Q44%2090%2052%2070%27%20stroke%3D%27%232a1a28%27%20stroke-width%3D%273%27%20fill%3D%27none%27%2F%3E%3Cpath%20d%3D%27M52%2070%20q-20%20-2%20-30%208%20M52%2070%20q-14%20-12%20-28%20-8%20M52%2070%20q18%20-10%2030%20-4%20M52%2070%20q16%202%2024%2014%20M52%2070%20q2%20-14%20-6%20-22%27%20stroke%3D%27%232a1a28%27%20stroke-width%3D%273%27%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M250%20114%20Q252%2096%20258%2084%27%20stroke%3D%27%232a1a28%27%20stroke-width%3D%272.4%27%20fill%3D%27none%27%2F%3E%3Cpath%20d%3D%27M258%2084%20q-14%200%20-20%206%20M258%2084%20q-10%20-8%20-20%20-6%20M258%2084%20q12%20-8%2022%20-2%20M258%2084%20q12%202%2016%2010%27%20stroke%3D%27%232a1a28%27%20stroke-width%3D%272.4%27%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage='4'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%235a4a9a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23f08a8a%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%234a5a9a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23232a5a%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23ffb090%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffb090%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%27220%27%20cy%3D%2788%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%27220%27%20cy%3D%2788%27%20r%3D%2711%27%20fill%3D%27%23ffe0c0%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M0%20101V84%20Q20%2078%2040%2080%20L46%2070h4v-4h6v4h20v-4h6v4h4l4%2010%20Q110%2082%20130%20101Z%20M200%20101%20Q250%2094%20300%2098V101Z%27%20fill%3D%27%23241c3a%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage='5'] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20300%20150%27%20preserveAspectRatio%3D%27xMidYMax%20slice%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27s%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%234aa0e0%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23c8e6f4%27%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%27w%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232a7ab0%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23164a72%27%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%27g%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23ffffff%27%20stop-opacity%3D%27.9%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23ffffff%27%20stop-opacity%3D%270%27%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%27300%27%20height%3D%27150%27%20fill%3D%27url(%23s)%27%2F%3E%3Ccircle%20cx%3D%2760%27%20cy%3D%2740%27%20r%3D%2746%27%20fill%3D%27url(%23g)%27%2F%3E%3Ccircle%20cx%3D%2760%27%20cy%3D%2740%27%20r%3D%2711%27%20fill%3D%27%23ffffff%27%2F%3E%3Crect%20y%3D%27100%27%20width%3D%27300%27%20height%3D%2750%27%20fill%3D%27url(%23w)%27%2F%3E%3Cpath%20d%3D%27M0%20104h300M20%20112h60M120%20110h80M230%20116h50M40%20124h90M170%20128h70%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.28%27%20stroke-width%3D%271.2%27%2F%3E%3Cpath%20d%3D%27M0%20101%20L40%2074%20L70%2060%20H190%20L214%2070%20L240%2066%20L262%2080%20L300%2088%20V101Z%27%20fill%3D%27%233a5068%27%2F%3E%3Cpath%20d%3D%27M70%2060H190%27%20stroke%3D%27%23fff%27%20stroke-opacity%3D%27.7%27%20stroke-width%3D%273%27%2F%3E%3C%2Fsvg%3E"); }
.stage[data-stage] { background-size: cover; background-position: center bottom; background-repeat: no-repeat; }

/* ---------- How to play links (modes page, mode pages; 2026-10-25) ---------- */
.learn-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 14px 7px 8px; border-radius: 999px; border: 1px solid var(--mp-stroke-2); background: var(--mp-glass); color: var(--mp-ink); font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .15s ease, transform .15s ease; }
.learn-link > span[aria-hidden] { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--mp-on-accent); font-size: .8rem; }
.learn-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.modes-head .learn-link { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .learn-link { transition: none; } .learn-link:hover { transform: none; } }

/* ---------- touch screens (phones and tablets; html.ar-touch from phone.js, 2026-10-25) ---------- */
/* every control at least 44 px high, as Apple and Google ask for fingers */
html.ar-touch :is(.back, .ghost-btn, .st-small, .learn-link, .race-btn, .cr-play, .cr-lic-link, .cr-btn, .tu-jump a, .lic-toc a) { min-height: 44px; }
html.ar-touch .lic-toc a { display: inline-flex; align-items: center; }
html.ar-touch .st-tabs [role='tab'], html.ar-touch .segmented button { min-height: 44px; }
html.ar-touch .st-mode-link { display: inline-flex; align-items: center; min-height: 44px; }
html.ar-touch .pf-mode summary { padding-block: 13px; }
html.ar-touch input[type='range'] { height: 44px; }
/* the switch keeps its look; an invisible margin round it takes the tap */
html.ar-touch .switch::before { content: ''; position: absolute; inset: -7px -4px; }
html.ar-touch body[data-home-page] .menu .btn { min-height: 44px; }
/* no keyboard on a phone: the Esc keycap on Back is left out */
html.ar-touch .back kbd { display: none; }
/* small print no smaller than 12 px */
html.ar-touch :is(.gp-stats b, .st-reco, .st-mode-tag, .pf-ring small, .pf-table thead th) { font-size: max(12px, .66rem); }
html.ar-touch :is(.gp-racers, .stage .num, .open-count, .st-table thead th, .pf-medal-text em) { font-size: max(12px, .7rem); }
html.ar-touch :is(.pad, .tap, .rc-text small, .tile span, .stat dt, .pf-title, .cr-kicker, .lc-label) { font-size: max(12px, .72rem); }
html.ar-touch :is(.tu-badge) { font-size: max(12px, .68rem); }
html.ar-touch :is(.logo-choice, .st-mode-link, .cr-item dt, .ways small, .lic-text, .lc-mode) { font-size: max(12px, .74rem); }
html.ar-touch :is(.tu-fig .t2, .tu-models small) { font-size: 12px; }
html.ar-touch .ar-clock-part { font-size: 12px; }
a.race-btn { text-decoration: none; }
/* notches and the home bar: the menu pages and garages keep their content inside the safe area
   (the race pages, the HUD and the home bundle have their own) */
html.ar-touch body:not([data-home-page]):not(.drive) { padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
html.ar-touch body:not([data-home-page]):not(.drive) .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
html.ar-touch .ar-clock { top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }

/* phones held sideways: the home page puts the logo on the left and the menu on the right
   (the home bundle's landscape layout); the seven entries go in two columns so they fit the
   short screen, and the logo takes the room that is left */
@media (pointer: coarse) and (orientation: landscape) and (max-width: 899px), (pointer: coarse) and (orientation: landscape) and (max-height: 599px), (orientation: landscape) and (max-height: 540px) {
  html[data-home-layout='center'] body[data-home-page] .main { grid-template-columns: minmax(0, 1fr); }
  html[data-home-layout='center'] body[data-home-page] .main .container { min-width: 0; padding-top: max(54px, env(safe-area-inset-top)); }
  html[data-home-layout='center'] body[data-home-page] .title-panel { flex: 1 1 0; min-width: 0; width: auto; }
  html[data-home-layout='center'] body[data-home-page] .title.voyage-brand { width: min(560px, 100%); }
  html[data-home-layout='center'] body[data-home-page] .title-panel .tagline { max-width: 100%; white-space: normal; text-align: center; }
  html[data-home-layout='center'] body[data-home-page] .menu-panel { flex: none; width: auto; margin: 0; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(320px, 46vw); min-width: 0; max-width: none; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) #start-btn { grid-column: 1 / -1; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) .btn { min-height: 44px; padding-inline: 8px; font-size: 15px; letter-spacing: .06em; }
}
/* tablets held sideways (iPad, 1024x768 to 1366x1024; 2026-10-26): the same logo-left, menu-right
   layout with the seven entries in two even columns, a little larger than on a phone */
@media (pointer: coarse) and (orientation: landscape) and (min-width: 900px) and (min-height: 600px) {
  html[data-home-layout='center'] body[data-home-page] .title-panel { flex: 1 1 0; min-width: 0; }
  html[data-home-layout='center'] body[data-home-page] .title.voyage-brand { width: min(640px, 100%); margin-inline: auto; }
  html[data-home-layout='center'] body[data-home-page] .title.voyage-brand img { width: 100%; height: auto; transform: none !important; }
  html[data-home-layout='center'] body[data-home-page] .menu-panel { flex: none; width: auto; margin: 0; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(420px, 38vw); min-width: 0; max-width: none; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) #start-btn { grid-column: 1 / -1; }
  html[data-home-layout='center'] body[data-home-page] .menu:has(#tutorial-btn) .btn { min-height: 52px; padding-inline: 10px; }
}

/* ---------- Exit Game dialog (home-extra.js, the Losyna Voyage rule, 2026-10-26) ---------- */
.exit-dialog { text-align: center; }
.exit-dialog .exit-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.exit-dialog .exit-actions .btn { min-width: 0; flex: 1 1 180px; min-height: 44px; }
/* the intro shown after Exit on short screens (phones held sideways): the logo, name, subtitle,
   Tap to start and the footer all fit, with no overlap */
@media (max-height: 600px) {
  .title-screen .title-stage { gap: 6px; }
  .title-screen .title-logo { width: min(980px, 88vw, 100vh); }
  .title-screen .title-name { font-size: clamp(1rem, 6vh, 1.6rem); }
  .title-screen .title-press { margin-top: 10px; padding: 12px 28px; min-height: 44px; }
  .title-screen .title-foot { bottom: 6px; font-size: 11px; }
}
