/* =========================================================================
 * Rally Legends — UI styles (voxel / pixel-art look).
 * Hard pixel edges only: no border-radius, no skew, no blur, no soft shadows.
 * All text is drawn as pixel-font canvases by menu.js / hud.js (sized from the
 * CSS font-size of the element, coloured from its CSS colour).
 * Everything sizes in rem; the HUD sets the root font-size from the window size.
 * ========================================================================= */
:root {
  --yellow: #ffd23c; --yellow-d: #c99a00; --blue: #3d6fe0; --red: #ff5555; --green: #55ff55;
  --ink: #ffffff; --dim: #c4c4c4;
  --font: "Courier New", Menlo, Consolas, "Liberation Mono", monospace;
  --display: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;   /* real <input>s: a plain sans monospace, never the serif Courier */
  --px: 4px;                      /* bevel width */
  --tex-stone: none; --tex-dirt: none; --tex-planks: none; --tex-grass: none;   /* set by Menu from RALLY.PixelUI */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; background: #000; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--ink); font-family: var(--font); font-weight: 700; text-transform: uppercase; user-select: none; -webkit-user-select: none; }
body { background: #000; }
canvas.px, img.px { image-rendering: pixelated; }
.pxt { display: inline-block; vertical-align: top; }
#app { position: fixed; inset: 0; overflow: hidden; }
#viewport, #viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; font-weight: inherit; color: inherit; text-transform: inherit; }

/* ----------------------------------------------------- menu background */
.menu-bg { position: absolute; inset: 0; background: #4a86d0; overflow: hidden; }
.menu-bg .menu-bg-cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
body.has-scene .menu-bg { display: none; }

/* ------------------------------------------------------------- screens */
.ui { position: absolute; inset: 0; z-index: 20; }
.screen { --st: 4.5vh; --gut: 6vw; --sl: calc(var(--gut) + var(--tsafe-l)); --sr: calc(var(--gut) + var(--tsafe-r)); position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--st) var(--sr) 3.5vh var(--sl); overflow-y: auto; animation: fadein .3s steps(3, end); }
.screen::-webkit-scrollbar { width: 1rem; }
.screen::-webkit-scrollbar-track { background: #111; }
.screen::-webkit-scrollbar-thumb { background: #8b8b8b; border: 4px solid; border-color: #d0d0d0 #444 #444 #d0d0d0; }
/* Screen layout (ARCHITECTURE.md "UI guidelines"): Menu.LAYOUT gives every screen a width class and a background class.
 * Width, desktop only (body:not(.is-mobile)): the content stands in a centred column, the nav bar still spans the window.
 * Phones keep the whole width with the notch inset (widths from content, see the phone blocks at the end). */
:root { --page-wide: 84rem; --page-narrow: 60rem; }
body:not(.is-mobile) .screen.w-wide { --sl: max(calc(var(--gut) + var(--tsafe-l)), calc((100vw - var(--page-wide)) / 2)); --sr: max(calc(var(--gut) + var(--tsafe-r)), calc((100vw - var(--page-wide)) / 2)); }
body:not(.is-mobile) .screen.w-narrow { --sl: max(calc(var(--gut) + var(--tsafe-l)), calc((100vw - var(--page-narrow)) / 2)); --sr: max(calc(var(--gut) + var(--tsafe-r)), calc((100vw - var(--page-narrow)) / 2)); }
/* Backgrounds, one definition each: bg-dirt = darkened dirt over the scene (dense screens: grids, lists, forms; hard overlay, no blur),
 * bg-scrim = the scene under a black wash (after a run); no class = the live scene (hub, briefs, garage stage). */
.bg-dirt { background: var(--tex-dirt) #5a4026; background-size: 64px 64px; image-rendering: pixelated; box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .66); }
.screen-pause { background: rgba(0, 0, 0, .62); align-items: center; justify-content: center; justify-content: safe center; }   /* (safe: a pause taller than a phone scrolls from its top instead of losing it) */
.bg-scrim { background: rgba(0, 0, 0, .74); }
.screen-cars .settings { max-width: 56rem; }   /* the garage panes (full-width layout, no column) */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.head h2 { margin: 0; font: 900 2.6rem/1 var(--font); color: #fff; }
.head h2::after { content: ""; display: block; width: 8rem; height: .5rem; margin-top: .8rem; background: var(--yellow); box-shadow: 0 0 0 3px #000; }
.head p { margin: 1rem 0 0; color: var(--dim); font-size: 1.2rem; max-width: 52rem; }
.head.center { text-align: center; } .head.center h2::after { margin-left: auto; margin-right: auto; }
.row-foot { display: flex; gap: 1.2rem; margin-top: auto; padding-top: 1.8rem; flex-wrap: wrap; }
/* navigation bar: the screen's buttons (back, reset, retry…) sit at the top like on a web page and stay there while the content scrolls under them */
.row-foot.nav-top { position: sticky; top: calc(-1 * var(--st)); z-index: 3; margin: calc(-1 * var(--st)) calc(-1 * var(--sr)) 1.4rem calc(-1 * var(--sl)); padding: .8rem var(--sr) .8rem var(--sl); background: rgba(0, 0, 0, .86); border-bottom: 3px solid #000; }
.foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: .3rem 2rem; color: var(--dim); font-size: 1rem; }
.foot .ver { margin-left: auto; opacity: .75; }
.foot .about { color: var(--yellow); text-decoration: none; margin-right: 1.2rem; }   /* the link to about.html (menu.js main footer); yellow says "link": _pixelise bakes the colour, so no hover change */
.foot .copy { flex-basis: 100%; min-width: 0; text-align: right; opacity: .6; }   /* the copyright line (Platform.COPYRIGHT) under the hints; min-width 0 lets _pixelise wrap it on a phone */
.tip { color: var(--dim); max-width: 60rem; margin: 1.4rem 0 0; font-size: 1.1rem; }

/* ---------------------------------------------------------------- logo */
.logo { margin: 1vh 0 3vh; }
.logo-top { display: flex; align-items: center; gap: .5rem; color: var(--yellow); font-size: 1.1rem; }
.logo-top i { width: .8rem; height: .8rem; background: var(--yellow); display: inline-block; box-shadow: 0 0 0 2px #000; }
.logo-top i:nth-child(2) { background: #ff9a3c; } .logo-top i:nth-child(3) { background: #ff5555; }
.logo-main { display: flex; flex-direction: column; margin-top: .9rem; gap: .5rem; }
.logo-main .l2 { margin-left: .4rem; display: flex; align-items: flex-end; gap: .7rem; }
.logo-sub { margin: 1.2rem 0 0 .3rem; color: #fff; font-size: 1.05rem; }

/* ------------------------------------------------------------- buttons */
.menu-col { display: flex; flex-direction: column; gap: 1rem; width: 30rem; max-width: 90vw; }
.btn { position: relative; appearance: none; cursor: pointer; text-align: center; padding: .85rem 1.4rem; font: 800 1.3rem var(--font); color: #fff;
  background: #7c7c7c var(--tex-stone); background-size: 64px 64px; image-rendering: pixelated;
  border: var(--px) solid; border-color: #d8d8d8 #3a3a3a #3a3a3a #d8d8d8; box-shadow: 0 0 0 3px #000; }
.btn > span { display: block; }
.btn.big { font-size: 1.45rem; padding: 1rem 1.4rem; }
.btn.primary { background-color: #4caf3a; background-image: var(--tex-planks); background-blend-mode: multiply; border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; }
.btn.ghost { background-color: #6a6a6a; background-blend-mode: multiply; }
.btn.focus, .btn:hover { background-color: #3d6fe0; background-blend-mode: multiply; border-color: #fff #fff #fff #fff; }
.btn.primary.focus, .btn.primary:hover { background-color: #6bff4c; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn.danger, .btn.danger:hover, .btn.danger.focus { background-color: #ff5540; background-blend-mode: multiply; border-color: #ffb0a4 #6a1610 #6a1610 #ffb0a4; }
.set-row .btn.set-btn { width: 100%; min-height: 2.3rem; padding: .2rem .9rem; font-size: 1.05rem; }
/* main menu: the two settings surfaced on it sit under the navigation as their own small block */
.quick { margin-top: .6rem; padding-top: 1rem; border-top: 3px solid rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: .6rem; }
.quick-label { font-size: .95rem; color: var(--dim); text-shadow: 2px 2px 0 #000; }
.quick-row { display: flex; gap: .8rem; }
.quick-row .btn { flex: 1 1 0; min-width: 0; font-size: 1.05rem; padding: .6rem .6rem; background-color: #6a6a6a; background-blend-mode: multiply; }
.quick-row .btn > span { overflow: hidden; }
/* Discord invite (menu.js _discordBtn): a stone button, the brand colours its word only (UI guidelines: colour means one thing); in the quick row it is as wide as its word */
.btn.discord-btn { color: #aab1ff; }
.quick-row .btn.discord-btn { flex: 0 0 auto; padding-left: 1.2rem; padding-right: 1.2rem; }

/* stage variant toggles (stage select) */
.var-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.var-row .var-btn { font-size: 1rem; padding: .55rem 1rem; }

/* --------------------------------------------------------------- cards */
.cards, .spr-cards, .lock-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.6rem; margin-top: 1.8rem; padding: .6rem .6rem 1rem .4rem; }
.card { appearance: none; text-align: left; padding: 0; cursor: pointer; overflow: hidden; color: #fff; font: inherit;
  background: #866043 var(--tex-dirt); background-size: 48px 48px; image-rendering: pixelated;
  border: var(--px) solid; border-color: #b58a63 #3a281a #3a281a #b58a63; box-shadow: 0 0 0 3px #000; }
.card.focus, .card:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3d6fe0; }
.thumb { position: relative; aspect-ratio: 2 / 1; overflow: hidden; border-bottom: 3px solid #000; background: #000; }
.thumb img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.thumb .flag { position: absolute; left: .7rem; top: .7rem; width: 2rem; height: 1.3rem; border: 3px solid #000; }
.thumb .num { position: absolute; right: .7rem; top: .5rem; font: 900 1.3rem var(--font); color: #fff; }
.cbody { position: relative; padding: 1.1rem 1rem 1rem; }
.cbody::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--tex-grass) 0 0 / 48px 48px repeat-x; image-rendering: pixelated; border-bottom: 3px solid #000; }
.cname { font: 900 1.35rem var(--font); color: #fff; margin-top: .5rem; }
.ccountry { color: #ffe9b0; font-size: 1rem; margin-top: .3rem; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin: .8rem 0; }
.chip { font-size: 1rem; font-weight: 800; padding: .25rem .6rem; background: #444; border: 3px solid #000; color: #fff; display: inline-block; }
.chip.s0 { background: #4a4d55; } .chip.s1 { background: #8d7756; } .chip.s2 { background: #7d98b3; } .chip.s3 { background: #5b4632; } .chip.s4 { background: #5f9dc4; } .chip.s5 { background: #55702f; } .chip.s6 { background: #4a5a5e; } .chip.s7 { background: #8a867f; } .chip.s8 { background: #a9a9a4; }
.cstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border-top: 3px solid #000; padding-top: .7rem; }
.cstats small { display: block; color: #e0cdb0; font-size: .85rem; } .cstats b { display: block; font: 800 1.05rem var(--font); margin-top: .2rem; }
.gold { color: var(--yellow); }

/* ---- leaderboard UI (menu.js "leaderboard UI"): stage card extras, results table, ranking screen ---- */
.cwrap { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; } .cwrap > .card { flex: 1 1 auto; }
.cwrap > .rank-btn { padding: .35rem .8rem; font-size: 1rem; }
.cworld { margin-top: .6rem; border-top: 3px solid #000; padding-top: .5rem; font: 800 1rem var(--font); }
.cworld .cw-best { color: var(--yellow); } .cworld .cw-you { color: #fff; margin-top: .25rem; }
.lb-board .brow.lb-row { grid-template-columns: 2rem minmax(0, 1fr) 6rem 5rem; font-size: 1rem; padding: .16rem .5rem; }
.lb-board .lb-car { display: none; }   /* the narrow results panel has no room for it; the ranking screen shows it */
.lb-board .lb-nick, .lb-board .lb-car { overflow: hidden; white-space: nowrap; min-width: 0; } .lb-board .lb-car { color: var(--dim); }
/* one middle line per row: place, ghost, flag, name, 24H tag, car, time and gap centred on each other (pixel text is a canvas,
   which sits on the line box top otherwise) */
.lb-board .brow.lb-row { align-items: center; }
.lb-board .lb-nick { display: flex; align-items: center; padding: .2em 0; }   /* room for the 24H frame (the cell clips) */
.lb-board .lb-nick > .lb-new, .lb-board .lb-nick > .lb-old { margin-top: -.5em; margin-bottom: -.5em; }   /* the frame does not make its row taller than the others */ .lb-board .lb-nick > * { flex: none; } .lb-board .lb-nick > .pxt { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.lb-board .lb-row .pxt canvas, .lb-hint .pxt canvas { display: block; }
/* a text canvas keeps a row of pixels under the letters: lift the pictures and the tag onto the middle of the capitals */
.lb-board .lb-nick > .lb-gh, .lb-board .lb-nick > .lb-flag, .lb-board .lb-nick > .lb-new, .lb-board .lb-nick > .lb-old, .lb-hint > .lb-gh, .lb-hint > .lb-new, .lb-hint > .lb-old { position: relative; top: -.14em; }
.lb-board .lb-row b { text-align: right; } .lb-board .lb-row em { font-size: .9rem; }
.lb-board .brow.lb-gap, .lb-board .brow.lb-empty { display: block; text-align: center; color: var(--dim); padding: .16rem .5rem; }
.lb-board .lb-total, .online-slot .lb-note { color: var(--dim); font-size: .9rem; padding: .35rem .5rem 0; }
.online-slot { margin-top: .5rem; }
.lb-full { max-width: 54rem; margin-top: 1rem; }
.lb-full .brow.lb-row { grid-template-columns: 2.6rem minmax(0, 1fr) 6.5rem 6.5rem 5.5rem; font-size: 1.2rem; padding: .28rem .5rem; }
.lb-full .lb-car { display: block; font-size: 1rem; } .lb-full .lb-row em { font-size: 1.05rem; }
.lb-full .brow.lb-row.focus { background: #3d6fe0; outline: 3px solid #fff; outline-offset: -3px; }
.lb-full .brow.lb-row.me.focus { background: #2a52c0; }
.lb-gh { width: 1.1em; height: 1.1em; margin-right: .4em; vertical-align: -.12em; image-rendering: pixelated; } .lb-gh.none { visibility: hidden; }
/* the country of the run (14x11 pixel flag; the letters for a country without a picture) and the tag of a time from the last 24 hours */
.lb-flag { display: inline-block; width: 1.27em; height: 1em; margin-right: .45em; vertical-align: -.1em; image-rendering: pixelated; } .lb-flag.none { visibility: hidden; }
.lb-flag.cc { height: auto; font-size: .7em; width: 1.8em; color: var(--dim); text-align: center; vertical-align: .1em; }
.lb-new { display: inline-block; margin-left: 8px; padding: 3px 5px 2px; font-size: .75em; line-height: 1; color: #55ff55; background: rgba(0, 0, 0, .55); border: 2px solid #55ff55; vertical-align: .1em; }
/* a time from before the road changed (js/game/variants.js CHANGES): a grey tag, the row dimmed; the board keeps it */
.lb-old { display: inline-block; margin-left: 8px; padding: 3px 5px 2px; font-size: .75em; line-height: 1; color: #b8b8b8; background: rgba(0, 0, 0, .55); border: 2px solid #8a8a8a; vertical-align: .1em; }
.lb-board .brow.lb-row.old:not(.me) > i, .lb-board .brow.lb-row.old:not(.me) > b, .lb-board .brow.lb-row.old:not(.me) > em, .lb-board .brow.lb-row.old:not(.me) > .lb-car { opacity: .6; }
.lb-hint .lb-new, .lb-hint .lb-old { flex: none; margin: 0 .4em 0 0; }
/* the overall board (ALL tab): the era and the place in it after the name; the tab itself stands apart from the eras */
.lb-board .lb-nick > .lb-cls { flex: none; margin-left: .5em; font-size: .7em; } .lb-cls .era-plate { padding: .1rem .3rem; }
.lb-hint > .era-plate { flex: none; margin-right: .5em; font-size: .7em; }
.rk-tab.rk-all .era-plate { box-shadow: inset 0 0 0 2px #fff; }
.lb-full .brow.lb-row[data-pid] { cursor: pointer; }
.lb-full.busy { opacity: .55; }   /* another class picked: the old rows wait for the new board */
.lb-hint { display: flex; align-items: flex-start; max-width: 54rem; color: var(--dim); font-size: .95rem; padding: .45rem .5rem 0; }
.lb-hint .lb-gh { flex: none; margin-top: -.05em; } .lb-hint span { flex: 1; min-width: 0; }

/* -------------------------------------------------------------- panels */
.panel { background: #9a9a9a var(--tex-stone); background-size: 64px 64px; background-blend-mode: multiply; image-rendering: pixelated;
  border: var(--px) solid; border-color: #8e8e8e #1a1a1a #1a1a1a #8e8e8e; box-shadow: 0 0 0 3px #000; padding: 1.2rem 1.5rem; margin-top: 1.8rem; }
.panel h3 { margin: .5rem 0 .6rem; font: 800 1.15rem var(--font); color: var(--yellow); }
/* the dark panel (owner 2026-11-12, first on the event screen's showroom; "a pattern to use in other places"): the big step of the dark family (the black bar .rally-brief / .notice = short status, kept as it is), near-black, a little
   see-through (the live scene shows faintly), a grey frame and a black outline; .accent adds the yellow strip at the left. For content
   that should stand apart from the scene: a car in 3D, a picture, a hero block. A plain group of content stays .panel (stone). */
.panel-dark { background: rgba(18, 18, 20, .94); border: 4px solid #555; box-shadow: 0 0 0 4px #111, inset 0 0 0 2px #2b2b2f; }
.panel-dark.accent { border-left: .6rem solid var(--yellow); }
.champ-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 11rem 8rem 6rem; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 3px solid rgba(0, 0, 0, .55); font-size: 1.2rem; }
.champ-row b { font: 900 1.2rem var(--font); color: var(--yellow); } .champ-row em { color: var(--dim); font-style: normal; } .champ-row small { color: var(--dim); text-align: right; font-size: 1.1rem; }

/* ------------------------------------------------------------ settings */
.set-group { padding: 0 1.5rem .8rem; margin-top: 1.3rem; }
.set-group:first-child { margin-top: 1.8rem; }
/* group headers: one look for every group (UI guidelines: colour means one thing, so no colour per group): the black bar, the title in the yellow of section labels */
.set-group h3 { display: flex; align-items: center; gap: .8rem; margin: 0 -1.5rem .7rem; padding: .55rem 1.5rem; color: var(--yellow); background: rgba(0, 0, 0, .6); border-bottom: 3px solid #000; }
.set-group h3 i { font-style: normal; background: #2a2a2a; color: #fff; padding: .2rem .45rem; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; align-items: center; gap: 1rem; padding: .4rem .9rem; margin: .15rem -.9rem; border: 3px solid transparent; cursor: pointer; }
.set-row.focus { background: #1f3f9f; border-color: #fff; }
.set-label { font-size: 1.2rem; font-weight: 800; } .set-label small { display: block; color: var(--dim); font-weight: 700; font-size: 1rem; margin-top: .2rem; }
.slider { position: relative; height: 2.3rem; background: #141414; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; overflow: hidden; cursor: ew-resize; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #3ddc5c; box-shadow: inset 0 3px 0 #9dffb0, inset 0 -3px 0 #1f8f38; }
.slider .val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; }
.select { display: flex; align-items: center; justify-content: space-between; height: 2.3rem; background: #141414; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; }
.select .val { flex: 1; text-align: center; font-weight: 800; font-size: 1.05rem; color: var(--yellow); cursor: pointer; }
.select .arr { appearance: none; border: 3px solid; border-color: #d0d0d0 #3a3a3a #3a3a3a #d0d0d0; background: #7c7c7c var(--tex-stone); background-size: 48px 48px; color: #fff; font-size: 1.6rem; font-weight: 900; width: 2.6rem; height: 100%; cursor: pointer; padding: 0; }
.select .arr { flex: none; } .select .val { min-width: 0; }   /* a long value wraps inside the field instead of pushing the right arrow out (garage drivetrain: "4X4 (FACTORY)") */
.select .val { align-self: stretch; display: flex; align-items: center; justify-content: center; }   /* the full height of the field, the text centred in it: with overflow hidden (phones, stage options) a value box one line high cut the accents off capitals ("DOMYSLNE") */
.gar-setup .select { height: auto; min-height: 2.3rem; }
.select .arr:hover { background-color: #3d6fe0; background-blend-mode: multiply; border-color: #fff; }
/* text input styled like .select (online nick, account e-mail and code, challenge links; js/game/menu.js _textInput). Text nodes only are pixelised, so the input keeps a
   system monospace font, shown in capitals like every other text of the game (the typed value keeps its case). */
input.select.text { display: block; width: 100%; box-sizing: border-box; padding: 0 .7rem; font: 800 1.05rem var(--mono); color: var(--yellow); text-transform: uppercase; text-align: center; letter-spacing: .04em; outline: none; user-select: text; -webkit-user-select: text; caret-color: var(--yellow); }
.text-form { display: flex; gap: .6rem; align-items: stretch; min-width: 0; } .text-form input.select.text { flex: 1; width: auto; min-width: 0; }
.text-form .btn { flex: none; min-height: 0; padding: 0 .9rem; font-size: 1.05rem; }
input.select.text::placeholder { color: #6a6a6a; text-transform: uppercase; }
input.select.text:focus, input.select.text.focus { border-color: #fff; background: #1f3f9f; }
/* online ranking panel on the results screen (.online-slot is reserved for the full leaderboard) */
.online-panel .online-line { font-size: 1.15rem; min-height: 1.6rem; } .online-panel .online-line b { color: var(--yellow); }
.online-panel .nick-form { display: flex; gap: .6rem; align-items: stretch; margin-top: .6rem; } .online-panel .nick-form input { flex: 1; min-width: 0; height: auto; }
.online-panel .nick-form .btn { padding: .3rem 1rem; font-size: 1.05rem; }
.online-panel .nick-ask { color: var(--dim); font-size: 1.05rem; }

.ctl-wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; } .ctl { min-width: 24rem; flex: 1; }
.ctl-pad .btn { width: 100%; margin-top: 1rem; }   /* CONNECT A GAMEPAD / SET UP BUTTONS under the pad column (js/game/menu.js _controls) */
.ctl-set { cursor: pointer; padding-left: .4rem; padding-right: .4rem; }
.ctl-set.focus, .ctl-set.armed { background: rgba(255, 210, 60, .16); box-shadow: inset 0 0 0 3px var(--yellow); }
.padbar { flex: 0 0 55%; height: .9rem; position: relative; background: rgba(0, 0, 0, .35); box-shadow: 0 0 0 3px #000; }
.padbar i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--yellow); }
.padbar.mid::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: #000; }
.ctl-pad .set-row { grid-template-columns: 1fr; gap: .5rem; margin: .8rem 0 0; padding: .4rem; }   /* narrow column: the label above its control */
.ctl-pad kbd.lit { background: var(--yellow); border-color: #fff3b0 #8a6a00 #8a6a00 #fff3b0; transform: translateY(2px); }   /* the input pressed right now (menu._padLights) */
.ctl-btns { display: flex; gap: 1rem; } .ctl-btns .btn { flex: 1; }
.ctl-kb .btn { width: 100%; margin-top: 1rem; } .ctl-kb .ctl-btns .btn { margin-top: .6rem; }   /* SET UP KEYS / DEFAULTS / DONE under the keyboard column (js/game/menu.js _keyAssign) */
.ctl-keys { padding-left: .4rem; padding-right: .4rem; } .ctl-keys.armed { background: rgba(255, 210, 60, .16); box-shadow: inset 0 0 0 3px var(--yellow); }
.ctl-keys .kpair { display: flex; gap: .6rem; flex: none; } .ctl-keys .kslot { width: 6.2rem; box-sizing: border-box; padding-left: 0; padding-right: 0; text-align: center; cursor: pointer; }   /* fixed width: the two keys stand in columns */
.ctl-keys .kslot.empty { opacity: .55; }
.ctl-keys .kslot.focus { box-shadow: 0 0 0 2px #000, 0 0 0 5px var(--yellow); }   /* the text was drawn white: the key keeps its stone, a yellow ring */
.ctl-keys .kslot.armed { background: var(--yellow); border-color: #fff3b0 #8a6a00 #8a6a00 #fff3b0; color: #000; }   /* PRESS… is drawn after the class: black on yellow */
.ctl-fixed { opacity: .75; }
.btn.pg-btn { display: inline-flex; align-items: center; gap: .6rem; } .btn.pg-btn .pg-cone { width: 18px; height: 20px; image-rendering: pixelated; }   /* the mall car park on the stage select's bar (menu.js _stages) */
.pg-kit-btns .btn.set-btn { min-height: 2.3rem; padding: .2rem .6rem; }   /* the proving ground's pause: what G sets down, CLEAR (js/game/provingkit.js) */
.ctl-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 3px solid rgba(0, 0, 0, .5); font-size: 1.15rem; gap: 1rem; }
kbd { font: 800 1rem var(--font); background: #8b8b8b var(--tex-stone); background-size: 48px 48px; color: #fff; border: 3px solid; border-color: #e0e0e0 #2a2a2a #2a2a2a #e0e0e0; box-shadow: 0 0 0 2px #000; padding: .3rem .7rem; }

/* ------------------------------------------------------------- results */
.res-lines span, .ctl-row span, .set-label { min-width: 0; }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.8rem; align-items: start; }
.res-main { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.res-pos small, .res-time small { display: block; color: var(--dim); font-size: 1rem; }
.res-pos b { display: flex; align-items: flex-start; font: 900 4rem/1.1 var(--font); color: var(--ink); } .res-pos.podium b { color: var(--yellow); }
.res-pos sup { font-size: 1.6rem; vertical-align: top; } .res-pos em { color: var(--dim); font-style: normal; font-size: 1.1rem; }
.res-time b { display: block; font: 900 3.2rem/1.1 var(--font); }
.badge { display: inline-block; margin-top: .5rem; font: 800 1.1rem var(--font); background: var(--yellow); color: #3a2a00; border: 3px solid #000; padding: .25rem .7rem; animation: pulse 1s steps(2, end) infinite; }
@keyframes pulse { 50% { background: #fff; } }
.res-lines { grid-column: 1 / -1; }
.res-lines > div { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 3px solid rgba(0, 0, 0, .5); font-size: 1.15rem; gap: 1rem; }
.res-lines span { color: var(--dim); } .res-lines i { font-style: normal; font-weight: 800; margin-left: .5rem; }
.good { color: var(--green) !important; } .bad { color: var(--red) !important; }
.res-right .panel:first-child { margin-top: 1.4rem; } .res-right .panel { margin-top: 1rem; padding: 1rem 1.3rem; }
.screen-results .res-grid .res-main { margin-top: 1.4rem; }
.screen-pause .head { margin-bottom: 2rem; }
.board .brow { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 6.5rem 5.5rem; gap: .6rem; padding: .28rem .5rem; font-size: 1.1rem; border-bottom: 3px solid rgba(0, 0, 0, .45); }
.board.wide .brow { grid-template-columns: 2.4rem minmax(0, 1fr) 8rem 6.5rem 6rem; font-size: 1.2rem; }
.brow i { font: 900 1.1rem var(--font); color: var(--dim); font-style: normal; } .brow em { color: var(--dim); font-style: normal; text-align: right; } .brow u { text-decoration: none; color: var(--yellow); font-weight: 800; text-align: right; }
.brow.me { background: #1f3f9f; border: 3px solid #fff; font-weight: 800; }
.cond .word { color: var(--ink); margin-left: .8rem; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.cbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem .5rem; font-size: 1rem; margin: .5rem 0 .7rem; } .cbar span { color: var(--dim); }
.cbar b { display: block; grid-row: 2; grid-column: 1 / -1; height: .8rem; background: #141414; border: 3px solid #000; overflow: hidden; } .cbar b i { display: block; height: 100%; } .cbar em { grid-row: 1; grid-column: 2; font-style: normal; text-align: right; }

/* ------------------------------------------------------------- loading */
.loading { position: absolute; inset: 0; z-index: 40; background: #2a1d10 var(--tex-dirt); background-size: 64px 64px; image-rendering: pixelated; box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; }
.load-inner { width: min(40rem, 88vw); text-align: center; }
.load-thumb { aspect-ratio: 2 / 1; overflow: hidden; border: var(--px) solid; border-color: #d8d8d8 #3a3a3a #3a3a3a #d8d8d8; box-shadow: 0 0 0 3px #000; background: #000; } .load-thumb img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.load-title { font: 900 2.6rem var(--font); margin-top: 1.6rem; } .load-sub { color: var(--yellow); margin-top: .5rem; font-size: 1.1rem; }
.load-bar { height: 1.6rem; background: #141414; margin: 1.8rem 0 .8rem; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; box-shadow: 0 0 0 3px #000; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 5%; background: repeating-linear-gradient(90deg, #3ddc5c 0 16px, #1c1c1c 16px 20px); transition: width .4s steps(8, end); }
.load-text { color: #fff; font-size: 1.1rem; min-height: 1.6rem; } .load-tip { color: var(--dim); margin-top: 1.4rem; font-size: 1.1rem; }
/* play first (js/game/playfirst.js): the loader of a new player's shakedown says what the game is (logo, tagline, three steps),
   SKIP in its corner; the gate "press any key" over the start line until the first gesture (it lets the sound play) */
.pf-pitch { width: min(58rem, 92vw); display: flex; flex-direction: column; align-items: center; }
.pf-pitch .logo { margin: 0 0 1.2rem; }
.pf-tag { font-size: 1.7rem; } .pf-tag2 { font-size: 1.1rem; color: var(--dim); margin-top: .5rem; }
.pf-steps { display: flex; gap: .8rem; width: 100%; margin-top: 1.8rem; text-align: left; }
.pf-step { flex: 1 1 0; min-width: 0; padding: .6rem .8rem; background: rgba(0, 0, 0, .55); border-left: 4px solid; }
.pf-step b { display: block; font-size: 1.1rem; } .pf-step span { display: block; font-size: .9rem; color: #d8d8d8; margin-top: .35rem; }
.pf-y { border-color: #f7c531; } .pf-y b { color: #f7c531; } .pf-g { border-color: #9fe08f; } .pf-g b { color: #9fe08f; } .pf-o { border-color: #f58a22; } .pf-o b { color: #f58a22; }
.pf-pitch .load-bar { width: min(34rem, 100%); }
.pf-skip { position: absolute; right: 1.6rem; bottom: 1.2rem; } .pf-skip.pf-wait { opacity: .5; }
.pf-gate { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; text-align: center; background: rgba(8, 6, 4, .5); cursor: pointer; }
.pf-gate h2 { font-size: 2.6rem; margin: .8rem 0 0; } .pf-gate-kick { color: var(--dim); font-size: 1rem; } .pf-gate-sub { color: var(--dim); font-size: 1.3rem; margin-top: .6rem; }
.pf-gate-keys { display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: center; margin-top: 1.8rem; color: var(--dim); font-size: 1.1rem; }
body.pf-gating .coach { display: none; }   /* the guide's first lesson waits for the gate */
body.phone-land .pf-pitch .logo { margin-bottom: .6rem; } body.phone-land .pf-tag { font-size: 1.3rem; } body.phone-land .pf-steps { margin-top: .9rem; }
body.phone-land .pf-pitch .load-bar { margin: 1rem 0 .5rem; } body.phone-land .pf-skip { right: 1rem; bottom: .6rem; min-height: 40px; }
@media (orientation: portrait) { .pf-steps { flex-direction: column; } .pf-skip { bottom: 2.4rem; } }

/* ---------------------------------------------------------- boot splash */
/* #boot (index.html, RALLY.Boot): the stage loader's ground and bar with the logo, from the first frame of the page to the first
   frame of the menu scene. The plain ground is the loader's dirt under its shade (the texture is made by the game scripts, later);
   logo, bar and version show after 300 ms, so a fast start shows only the dark ground for a moment. Over the menu, HUD and stage
   loader (40), under the toasts (100: a message of the start, e.g. a bad road link, must be read) and the turn-your-phone blocker (300).
   The rules between the boot:critical markers are self-contained (no variable, nothing from another part of this sheet):
   tools/boot-splash.js copies them into the <style> in the <head> of index.html (gen:bootcss), since this sheet does not block
   the first paint (media="print" until it is in) and on a slow link it arrives seconds after the page. So the bar and the RELOAD
   button carry their own plain look here; .load-bar and .btn.primary refine them once the sheet is in (same specificity, later). */
/* boot:critical */
.boot { position: absolute; inset: 0; z-index: 90; background: #110c06; display: flex; align-items: center; justify-content: center; }
.boot canvas { display: block; image-rendering: pixelated; }
.boot-in { width: min(40rem, 88vw); display: flex; flex-direction: column; align-items: center; opacity: 0; animation: boot-show 1ms .3s forwards; }
.boot-logo { margin-bottom: 1.6rem; }
.boot-tag { margin: -.4rem 0 .3rem; } .boot-tag2 { margin-bottom: 1.6rem; }
.boot .boot-bar { width: 100%; height: 1.6rem; margin: 0 0 .8rem; background: #141414; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; box-shadow: 0 0 0 3px #000; overflow: hidden; }
.boot .boot-bar i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, #3ddc5c 0 16px, #1c1c1c 16px 20px); transition: none; transform: translateX(-100%); will-change: transform; }
.boot-text { min-height: 1.6rem; }
.boot-ver { position: absolute; right: 1.6rem; bottom: 1.2rem; opacity: 0; animation: boot-ver 1ms .3s forwards; }
.boot-reload { display: none; margin-top: 1.2rem; appearance: none; cursor: pointer; padding: .85rem 1.4rem; background: #4caf3a; border: 4px solid; border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; box-shadow: 0 0 0 3px #000; }
.boot-reload > span { display: block; }
.boot.failed .boot-bar { display: none; } .boot.failed .boot-reload { display: block; }
.boot.out { animation: boot-out .2s steps(3, end) forwards; pointer-events: none; }
@keyframes boot-show { to { opacity: 1; } } @keyframes boot-ver { to { opacity: .75; } } @keyframes boot-out { to { opacity: 0; } }
/* /boot:critical */

/* ---------------------------------------------------------------- toasts */
.toasts { position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: #202020; border: 3px solid #000; border-left: .6rem solid var(--blue); padding: .6rem 1rem; font-size: 1rem; max-width: 80vw; animation: fadein .25s steps(3, end); transition: opacity .4s steps(4, end); }
.toast.error { border-left-color: var(--red); color: #ffb4ae; } .toast.warn { border-left-color: #ff9a3c; color: #ffd9b0; } .toast.out { opacity: 0; }

/* ================================================================== HUD */
.hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; font-family: var(--font); }
.hud > div { position: absolute; }
.hud canvas.px { display: inline-block; }
.hud-tl { left: 1.6rem; top: 1.3rem; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.hud-stage { display: flex; align-items: center; gap: .7rem; background: rgba(0, 0, 0, .7); border: 3px solid #000; padding: .35rem .7rem; }
.hud-stage-flag { width: 1.8rem; height: 1.2rem; border: 3px solid #000; flex: none; }
.hud-time { background: rgba(0, 0, 0, .55); border: 3px solid #000; border-left: .5rem solid var(--yellow); padding: .35rem 1rem .35rem .8rem; display: inline-block; }
/* the proving ground (hud.js gs.proving): no clock, no gaps, no progress bar, no notes; the car, the surface, the speed and the map stay */
.hud-proving .hud-time, .hud-proving .hud-extra, .hud-proving .hud-tc, .hud-proving .hud-tr { display: none; }
.hud-time-val { display: block; }
.hud-pen { background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: .25rem .7rem; }
.hud-try { background: rgba(0, 0, 0, .55); border: 3px solid #000; border-left: .5rem solid #fff; padding: .25rem .7rem; }   /* hud.attempt: the attempt number for 6 s after GO */
.hud-delta { background: rgba(0, 0, 0, .78); border: 3px solid #000; border-left: .5rem solid #fff; padding: .3rem .9rem; animation: fadein .3s steps(3, end); }
.hud-ghost { background: rgba(0, 0, 0, .55); border: 3px solid #000; border-left: .5rem solid #7fc4ff; padding: .2rem .7rem; }
.hud-ghost.good { border-left-color: var(--green); } .hud-ghost.bad { border-left-color: var(--red); }
.hud-delta.good { border-left-color: var(--green); } .hud-delta.bad { border-left-color: var(--red); }
.hud-place { background: rgba(0, 0, 0, .78); border: 3px solid #000; border-left: .5rem solid #fff; padding: .2rem .9rem; animation: fadein .3s steps(3, end); }
.hud-place.good { border-left-color: var(--green); } .hud-place.bad { border-left-color: var(--red); }
.hud-stunt { background: rgba(0, 0, 0, .78); border: 3px solid #000; border-left: .5rem solid var(--green); padding: .2rem .9rem; animation: fadein .3s steps(3, end); }   /* a jump's / slide's length (hud.js showStunt) */
.hud-stunt.rec { border-left-color: var(--yellow); }

.hud-tc { left: 50%; top: 1.2rem; transform: translateX(-50%); width: min(26rem, 28vw); }
.hud-progress { position: relative; height: 1rem; background: #222; border: 3px solid #000; margin-top: .4rem; }
.hud-prog-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #3ddc5c; box-shadow: inset 0 3px 0 #9dffb0; }
.hud-prog-marks i { position: absolute; top: -.4rem; width: 3px; height: 1.4rem; background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 2px #000; }
.hud-prog-marks i.done { background: var(--green); }
.hud-prog-car { position: absolute; top: 50%; width: 1.2rem; height: 1.2rem; background: var(--yellow); border: 3px solid #000; transform: translate(-50%, -50%); }
.hud-prog-ghost { position: absolute; top: 50%; width: 1.5rem; height: 1.5rem; transform: translate(-50%, -50%); }
.hud-prog-l, .hud-prog-r { position: absolute; top: 1.35rem; } .hud-prog-l { left: 0; } .hud-prog-r { right: 0; }

/* next pace note: one big card, top centre under the progress bar */
.hud-tr { left: 50%; top: 4.2rem; width: auto; }
.hud-notes { display: flex; flex-direction: column; gap: .5rem; --ns: 4.4rem; }
.note { display: grid; grid-template-columns: var(--ns) auto auto; align-items: center; gap: 1rem; background: rgba(0, 0, 0, .62); border: 3px solid #000; padding: .5rem 1.2rem .5rem .5rem; position: relative; white-space: nowrap; }
.note canvas { grid-row: 1; grid-column: 1; }
.note-sev { position: absolute; left: .5rem; top: calc(var(--ns) - 1.2rem); }
.note-mods { margin-top: .3rem; }
.note.active { border-color: var(--yellow); background: rgba(40, 30, 0, .8); }
.note.note-1 { opacity: .9; } .note.note-2 { opacity: .75; }

.hud-bl { left: 1.6rem; bottom: 1.4rem; display: flex; flex-direction: column; gap: .7rem; }
.hud-cond { display: flex; gap: .9rem; align-items: center; background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: .5rem .9rem .5rem .6rem; }
.hud-car { display: block; flex: none; }
.hud-lbl { margin-bottom: .35rem; }
.hud-cond-bars { display: grid; grid-template-columns: auto 5.5rem; align-items: center; gap: .6rem .6rem; }
.cb { display: contents; }
.cb b { display: block; height: .7rem; background: #141414; border: 2px solid #000; overflow: hidden; } .cb b i { display: block; height: 100%; width: 100%; background: #3ddc5c; transition: width .3s steps(5, end); }
.hud-surface { background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: .5rem 1rem; display: grid; grid-template-columns: auto 1fr; column-gap: .8rem; align-items: center; }
.hud-surf-dots { grid-row: 1 / 3; display: grid; grid-template-columns: repeat(2, .8rem); gap: .25rem; }
.hud-surf-dots i { display: block; width: .8rem; height: 1rem; border: 2px solid #000; outline: 1px solid rgba(255, 255, 255, .35); }
.hud-surf-sub { margin-top: .2rem; }

.hud-br { right: 1.2rem; bottom: 1rem; width: 19rem; height: 19rem; }
/* minimap: top-right, frameless pixel canvas on the same logical grid as the gauge */
.hud-map { right: 1.2rem; top: 1.2rem; }
.hud-map canvas { display: block; }
.hud-map { transform: scale(calc(.72 * var(--mk, 1))); transform-origin: top right; }   /* --mk: Settings > Minimap size (small .75 / medium 1 / large 1.3), set by the body classes map-s / map-l */
body.map-s { --mk: .75; } body.map-l { --mk: 1.3; }
body.hud-small .hud-map { transform: scale(calc(.6 * var(--mk, 1))); right: calc(var(--tsafe-r) + .8rem); top: calc(var(--tsafe-t) + .5rem); }
/* in-race overlay scaled down so it covers less of the view (menus keep full size) */
.hud-tl { transform: scale(.72); transform-origin: top left; }
.hud-tr { transform: translateX(-50%) scale(.7); transform-origin: top center; }
.hud-bl { transform: scale(.72); transform-origin: bottom left; }
.hud-br { transform: scale(.72); transform-origin: bottom right; }
.hud-tc { transform: translateX(-50%) scale(.8); transform-origin: top center; }
.hud-gauge { width: 100%; height: 100%; display: block; }
.hud-shift { position: absolute; left: 50%; top: -1.9rem; transform: translateX(-50%); display: flex; gap: .3rem; }
.hud-shift i { display: block; width: 1.2rem; height: 1.2rem; background: #2a2a2a; border: 3px solid #000; }
.hud-shift i.g { background: #3ddc5c; } .hud-shift i.y { background: #ffd23c; } .hud-shift i.r { background: #ff3a30; }
.hud-shift i.f { background: #fff; }

.hud-center { left: 0; right: 0; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hud-countdown { opacity: 0; margin-top: -12vh; }
.hud-countdown.show { animation: cd 1s steps(10, end) forwards; } .hud-countdown.go { animation-duration: 1.2s; }
@keyframes cd { 0% { opacity: 0; transform: scale(1.5); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
.hud-wrong { position: absolute; top: 22vh; background: #c82020; border: 4px solid #000; padding: .5rem 2.4rem; animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hud-fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.hud-msgs { position: absolute; top: 12vh; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.hud-msg { padding: .35rem 1.6rem; background: rgba(0, 0, 0, .78); border: 3px solid #000; border-bottom: .4rem solid #fff; animation: msg 2.4s steps(12, end) forwards; }
.hud-msg.good { border-bottom-color: var(--green); } .hud-msg.bad { border-bottom-color: var(--red); } .hud-msg.warn { border-bottom-color: var(--yellow); }
@keyframes msg { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.hud-fps { right: 1.5rem; bottom: 21.5rem; background: rgba(0, 0, 0, .7); border: 3px solid #000; padding: .2rem .5rem; }
.hud-hint { left: 50%; bottom: 1.2rem; transform: translateX(-50%); opacity: 0; background: rgba(0, 0, 0, .55); padding: .3rem .8rem; border: 3px solid #000; transition: opacity .4s steps(4, end); }
.hud-hint.show { opacity: 1; }

@media (max-width: 900px) {
  .res-grid { grid-template-columns: 1fr; } .set-row { grid-template-columns: minmax(0, 1fr) 14rem; }
  .hud-tc { display: none; } .hud-tr { top: 1rem; }
}
.rank-note { display: grid; gap: .4rem; margin: .5rem 0 .6rem; } .rank-note .notice { font-size: 1rem; }
.set-label small.diff-blurb { color: var(--yellow); max-width: 30rem; margin-top: .2rem; }

/* =============================================================== TOUCH / MOBILE */
:root { --padk: 1; --pad: min(120px, calc(clamp(64px, 22vh, 110px) * var(--padk)));   /* --padk: Settings > Touch > pad size (input.js tick) */ --tsafe-l: env(safe-area-inset-left, 0px); --tsafe-r: env(safe-area-inset-right, 0px); --tsafe-t: env(safe-area-inset-top, 0px); --tsafe-b: env(safe-area-inset-bottom, 0px); }
html, body { overscroll-behavior: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
#viewport, #touch, .hud { touch-action: none; }
.screen { touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.slider { touch-action: none; }

/* on-screen pads: hard-edged, semi-transparent stone blocks */
.touch { position: absolute; inset: 0; z-index: 12; pointer-events: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.tpad { position: absolute; pointer-events: auto; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(20, 20, 20, .38); border: 4px solid; border-color: rgba(255, 255, 255, .55) rgba(0, 0, 0, .65) rgba(0, 0, 0, .65) rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .55); }
.tpad::before { content: ""; position: absolute; inset: -10px; }   /* generous hit area */
.tpad .ti, .tpad .tt { pointer-events: none; display: block; line-height: 0; }
.tpad canvas { display: block; image-rendering: pixelated; }
.tpad.on { background: rgba(255, 210, 60, .55); border-color: #fff8c0 #7a5a00 #7a5a00 #fff8c0; transform: translateY(3px); }
.tp-throttle { background: rgba(40, 150, 60, .34); } .tp-throttle.on { background: rgba(85, 255, 85, .5); border-color: #d8ffd0 #1f6a1f #1f6a1f #d8ffd0; }
.tp-brake { background: rgba(170, 40, 40, .34); } .tp-brake.on { background: rgba(255, 85, 85, .52); border-color: #ffd0d0 #7a1a1a #7a1a1a #ffd0d0; }
.tp-handbrake { background: rgba(200, 120, 20, .34); } .tp-handbrake.on { background: rgba(255, 176, 60, .55); }
.tp-throttle.auto { opacity: .6; }
/* left cluster: steering */
.tp-left, .tp-right { bottom: calc(var(--tsafe-b) + 12px); width: var(--pad); height: calc(var(--pad) * 1.2); }
.tp-left { left: calc(var(--tsafe-l) + 14px); }
.tp-right { left: calc(var(--tsafe-l) + 14px + var(--pad) + 12px); }
/* right cluster: pedals (+ handbrake above) */
.tp-throttle { right: calc(var(--tsafe-r) + 14px); bottom: calc(var(--tsafe-b) + 12px); width: var(--pad); height: calc(var(--pad) * 1.5); }
.tp-brake { right: calc(var(--tsafe-r) + 14px + var(--pad) + 12px); bottom: calc(var(--tsafe-b) + 12px); width: var(--pad); height: calc(var(--pad) * 1.2); }
.tp-handbrake { right: calc(var(--tsafe-r) + 14px); bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.5 + 14px); width: calc(var(--pad) * 2 + 12px); height: calc(var(--pad) * .5); flex-direction: row; }
.touch.tilt .tp-left, .touch.tilt .tp-right { display: none; }
/* the manual gearbox on touch (js/game/input.js, Transmission: Manual only): shift up / down stacked above the throttle */
.tgear { display: none; position: absolute; pointer-events: auto; touch-action: none; right: calc(var(--tsafe-r) + 14px); width: var(--pad); height: calc(var(--pad) * .42); align-items: center; justify-content: center;
  background: rgba(20, 20, 20, .45); border: 4px solid; border-color: rgba(255, 255, 255, .55) rgba(0, 0, 0, .65) rgba(0, 0, 0, .65) rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px rgba(0, 0, 0, .55); }
.tgear::before { content: ""; position: absolute; inset: -4px -10px; }
.tgear .ti { pointer-events: none; line-height: 0; } .tgear canvas { display: block; image-rendering: pixelated; }
.tgear.on { background: rgba(255, 210, 60, .55); }
body.touch-manual .tgear { display: flex; }
.tg-gearDown { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.5 + 14px + var(--pad) * .5 + 10px); }
.tg-gearUp { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.5 + 14px + var(--pad) * .5 + 10px + var(--pad) * .42 + 10px); }
/* top icon buttons */
.ttop { position: absolute; top: calc(var(--tsafe-t) + 8px); left: 50%; transform: translateX(-50%); display: flex; gap: 12px; pointer-events: none; }
.tbtn { pointer-events: auto; touch-action: none; position: relative; width: 52px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 20, .5); border: 4px solid; border-color: rgba(255, 255, 255, .55) rgba(0, 0, 0, .65) rgba(0, 0, 0, .65) rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px rgba(0, 0, 0, .55); }
.tbtn::before { content: ""; position: absolute; inset: -6px; }
.tbtn .ti { line-height: 0; pointer-events: none; } .tbtn canvas { display: block; image-rendering: pixelated; }
.tbtn.on { background: rgba(255, 210, 60, .6); }
body:not(.pg-kit) .tb-pgDrop { display: none !important; }   /* the proving ground's cone button (js/game/provingkit.js) */

/* "turn your phone" suggestion (phones held upright, every stage start; js/game/input.js landscapePrompt) */
.rotate { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; text-align: center; background: #14110d var(--tex-dirt); background-size: 64px 64px; image-rendering: pixelated; box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .78); touch-action: none; }
.rotate.on { display: flex; }
.rot-box { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px calc(24px + var(--tsafe-r, 0px)) calc(24px + var(--tsafe-b, 0px)) calc(24px + var(--tsafe-l, 0px)); }
.rot-b { margin-top: 4px; padding: .4rem .7rem; line-height: 0; opacity: .55; visibility: hidden; } .rot-b canvas { display: block; }
.rotate.late .rot-b { visibility: visible; }   /* PLAY UPRIGHT: smaller, and only after PROMPT_LATE (turning the phone is the way on) */
.rot-h { margin-top: -8px; }
.rot-ic { animation: rotphone 2s steps(6, end) infinite; line-height: 0; } .rot-ic canvas { display: block; }
@keyframes rotphone { 0%, 30% { transform: rotate(0); } 70%, 100% { transform: rotate(-90deg); } }
.rot-t, .rot-s { line-height: 0; } .rot-t canvas, .rot-s canvas { display: inline-block; }

/* ---- compact HUD (phones / short windows) ---- */
body.hud-small .hud-tl { transform: scale(.6); top: calc(var(--tsafe-t) + .5rem); left: calc(var(--tsafe-l) + .8rem); }
body.hud-small .hud-tr { transform: translateX(-50%) scale(.6); top: calc(var(--tsafe-t) + .5rem); }
body.hud-small.touch-on .hud-tr { top: calc(var(--tsafe-t) + 62px); }  /* below the camera/reset/pause buttons */
body.hud-small .hud-bl { transform: scale(.6); left: calc(var(--tsafe-l) + .8rem); bottom: calc(var(--tsafe-b) + .6rem); }
body.hud-small .hud-br { transform: scale(.6); right: calc(var(--tsafe-r) + .8rem); bottom: calc(var(--tsafe-b) + .6rem); }
/* stage progress on the compact HUD: a slim bar without the START / FINISH captions, pace notes move below it */
body.hud-small .hud-tc { display: block; top: calc(var(--tsafe-t) + 8px); width: min(260px, 30vw); transform: translateX(-50%); }
body.hud-small .hud-progress { height: 8px; margin-top: 0; }
body.hud-small .hud-prog-l, body.hud-small .hud-prog-r { display: none; }
body.hud-small .hud-prog-marks i { top: -3px; height: 8px; width: 2px; box-shadow: 0 0 0 1px #000; }
body.hud-small .hud-prog-car { width: 10px; height: 10px; border-width: 2px; }
body.hud-small .hud-prog-ghost { width: 18px; height: 18px; }
body.hud-small .hud-tr { top: calc(var(--tsafe-t) + 30px); }
body.hud-small.touch-on .hud-tc { top: calc(var(--tsafe-t) + 64px); }   /* below the camera/reset/pause buttons */
body.hud-small.touch-on .hud-tr { top: calc(var(--tsafe-t) + 86px); }
body.hud-small .hud-cond { display: none; }
body.hud-small .note-2 { display: none !important; }
body.hud-small .hud-notes { gap: .3rem; }
body.hud-small .hud-msgs { top: 16vh; } body.hud-small .hud-wrong { top: 28vh; }
/* touch overlay on: gauge moves to the bottom centre, surface info sits above the steering pads */
body.touch-on .hud-br { right: auto; left: 50%; transform: translateX(-50%) scale(.6); transform-origin: bottom center; bottom: calc(var(--tsafe-b) + .5rem); }
body.touch-on .hud-bl { bottom: calc(var(--tsafe-b) + var(--pad) * 1.2 + 26px); }
body.touch-on.touch-tilt .hud-bl { bottom: calc(var(--tsafe-b) + .6rem); }
body.touch-on .hud-fps { right: auto; left: calc(var(--tsafe-l) + 1rem); top: auto; bottom: calc(var(--tsafe-b) + var(--pad) * 1.2 + 70px); }
body.touch-on .hud-hint { display: none; }
body.touch-land.touch-on .hud-hint { display: block; }

/* ---- portrait phones: pads in both bottom corners, gauge above them, notes across the top ---- */
body.portrait { --pad: calc(clamp(68px, 12vw, 104px) * var(--padk)); }   /* 68 px on a phone, about 100 px on a tablet held upright (owner 2026-11-11) */
body.portrait .tp-left, body.portrait .tp-right { height: calc(var(--pad) * 1.35); }
body.portrait .tp-throttle { height: calc(var(--pad) * 1.6); }
body.portrait .tp-brake { height: calc(var(--pad) * 1.35); }
body.portrait .tp-handbrake { width: calc(var(--pad) * 2 + 12px); height: calc(var(--pad) * .55); bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.6 + 12px); }
body.portrait .ttop { top: calc(var(--tsafe-t) + 6px); gap: 10px; }
body.portrait .tbtn { width: 44px; height: 42px; }
body.portrait .tg-gearDown { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.6 + 12px + var(--pad) * .55 + 10px); }
body.portrait .tg-gearUp { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.6 + 12px + var(--pad) * .55 + 10px + var(--pad) * .42 + 10px); }
body.portrait.touch-on .hud-br { left: calc(var(--tsafe-l) + 14px); right: auto; bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.35 + 12px); transform: scale(.55); transform-origin: bottom left; }
body.portrait .hud-tl { top: calc(var(--tsafe-t) + 56px); left: calc(var(--tsafe-l) + .5rem); transform: scale(.55); }
body.portrait .hud-tc { top: calc(var(--tsafe-t) + 58px); width: calc(100vw - var(--tsafe-l) - var(--tsafe-r) - 28px); }
body.portrait .hud-tl { top: calc(var(--tsafe-t) + 80px); }
body.portrait .hud-map { top: calc(var(--tsafe-t) + 80px); }
body.portrait .hud-tr { top: calc(var(--tsafe-t) + 80px); transform: translateX(-50%) scale(.6); }
body.portrait.touch-on .hud-bl { left: auto; right: calc(var(--tsafe-r) + 14px); transform: scale(.55); transform-origin: bottom right; bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 2.15 + 24px); }
body.portrait.touch-on .hud-fps { left: calc(var(--tsafe-l) + 14px + 112px); bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.35 + 12px); }
body.portrait .hud-msgs { top: 30vh; } body.portrait .hud-wrong { top: 40vh; }
body.portrait .hud-countdown { top: 34vh; }

/* ---- menus on touch screens ---- */
body.is-touch .btn, body.is-mobile .btn { min-height: 52px; display: flex; align-items: center; justify-content: center; }
body.is-touch .menu-col { gap: 1.1rem; }
body.is-touch .set-row, body.is-mobile .set-row { min-height: 56px; }
body.is-touch .select, body.is-mobile .select { height: max(2.3rem, 46px); }
body.is-touch .select .arr, body.is-mobile .select .arr { min-width: 48px; width: 48px; }
body.is-touch .slider, body.is-mobile .slider { height: max(2.3rem, 46px); }
body.is-touch .card, body.is-mobile .card { min-height: 44px; }
body.is-touch .tilt-btn { margin: .6rem 0; width: 100%; }
@media (max-height: 520px) {
  .screen { --st: 3vh; --gut: 4vw; padding-bottom: 3vh; }
  .head h2 { font-size: 2rem; } .head p { margin-top: .5rem; }
  .logo { margin: 0 0 1.5vh; }
  .set-row { grid-template-columns: minmax(0, 1fr) 20rem; }
  .select .arr { flex: none; } .select .val { min-width: 0; overflow: hidden; }
  .panel { margin-top: 1rem; }
  .menu-col { gap: .8rem; width: 26rem; }
  .cards, .spr-cards, .lock-cards { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.2rem; margin-top: 1rem; }
  .ctl { min-width: 18rem; }
}

/* main menu has six big buttons (incl. the quick difficulty switch and the car screen): tighten on short screens.
   body.ui-tight (Hud.resize) = little height counted in rem: the UI unit grows with the window, so a pixel height query would miss big windows */
:where(body.ui-tight) .menu-col { gap: .55rem; } :where(body.ui-tight) .menu-col .btn.big { padding: .65rem 1.4rem; }

/* ---- phone landscape (body.touch-land, set by TouchControls.tick): minimal HUD, road stays clear ---- */
.hud-speed { display: none; }
body.touch-land.touch-on .hud-speed { display: block; position: absolute; left: calc(var(--tsafe-l) + 14px); bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.2 + 8px);   /* right above the steering arrows */ background: rgba(0, 0, 0, .6); border: 3px solid #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); padding: 6px 10px 5px; }
.hud-speed .hs-row { display: flex; align-items: flex-end; gap: 8px; } .hud-speed .hs-row span { display: block; line-height: 0; }
.hud-speed .hs-v { min-width: 54px; text-align: right; } .hud-speed .hs-g { margin-left: 6px; padding: 3px 6px; background: #141414; border: 2px solid #000; }
.hud-speed .hs-rpm { height: 6px; margin-top: 5px; background: #141414; border: 2px solid #000; } .hud-speed .hs-rpm i { display: block; height: 100%; width: 0; background: #3ddc5c; }
body.touch-land.touch-on .ttop { position: static; transform: none; display: contents; }
body.touch-land.touch-on .tbtn { position: absolute; width: 44px; height: 40px; }
body.touch-land.touch-on .tb-pause { top: calc(var(--tsafe-t) + 8px); right: calc(var(--tsafe-r) + 10px); }
body.touch-land.touch-on .tb-camera { top: calc(var(--tsafe-t) + 70px); left: calc(var(--tsafe-l) + 10px); }
body.touch-land.touch-on .tb-reset { top: calc(var(--tsafe-t) + 70px); left: calc(var(--tsafe-l) + 58px); }
body.touch-land.touch-on .tb-pgDrop { top: calc(var(--tsafe-t) + 70px); left: calc(var(--tsafe-l) + 106px); }
@keyframes tbblink { 50% { background: rgba(255, 210, 60, .75); } }
body.touch-land.touch-on .tb-reset.hint { animation: tbblink .6s steps(2) infinite; }
body.touch-land.touch-on .hud-map { top: calc(var(--tsafe-t) + 56px); right: calc(var(--tsafe-r) + .6rem); }
body.touch-land.touch-on .hud-tc { top: calc(var(--tsafe-t) + 16px); left: calc(50% + 120px); right: calc(var(--tsafe-r) + 76px); width: auto; transform: none; }   /* between the pace notes and the pause button: the notes keep the top edge */
body.touch-land.touch-on .hud-tr { top: calc(var(--tsafe-t) + 0px); transform: translateX(-50%) scale(.5); }
body.touch-land.touch-on .hud-br { display: none; }
.hud-extra { display: contents; }
body.touch-land.touch-on .hud-extra { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; position: absolute; left: calc(100% + .6rem); top: 0; }   /* penalty / delta / ghost sit right of the time, clear of the camera + reset buttons */
body.touch-land.touch-on .hud-bl { top: calc(var(--tsafe-t) + 116px); bottom: auto; left: calc(var(--tsafe-l) + .8rem); transform: scale(.5); transform-origin: top left; }
body.touch-land.touch-on .hud-fps { top: calc(var(--tsafe-t) + 116px); left: calc(var(--tsafe-l) + 8rem); bottom: auto; right: auto; }
body.touch-land.touch-on .hud-hint { bottom: calc(var(--tsafe-b) + 10px); transform: translateX(-50%) scale(.6); }
body.touch-land.touch-on .tpad { background: rgba(20, 20, 20, .28); }
body.touch-land.touch-on .tp-throttle { background: rgba(40, 150, 60, .26); height: calc(var(--pad) * 1.25); }
body.touch-land.touch-on .tp-brake { background: rgba(170, 40, 40, .26); height: calc(var(--pad) * 1.1); }
body.touch-land.touch-on .tp-handbrake { background: rgba(200, 120, 20, .26); right: calc(var(--tsafe-r) + 14px + 2 * (var(--pad) + 12px)); bottom: calc(var(--tsafe-b) + 12px); width: calc(var(--pad) * .62); height: calc(var(--pad) * 1.1); flex-direction: column; }
body.touch-land.touch-on.touch-v2 .tp-handbrake { right: calc(var(--tsafe-r) + 14px); bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.25 + 10px); width: calc(var(--pad) * 2 + 12px); height: calc(var(--pad) * .5); flex-direction: row; }   /* a bar above the brake and the throttle (owner 2026-11-11; RALLY.touchV2: was a narrow column left of the brake) */
body.touch-land.touch-on .tpad.on { background: rgba(255, 210, 60, .55); }
body.touch-land.touch-on .tp-throttle.on { background: rgba(85, 255, 85, .5); }
body.touch-land.touch-on .tp-brake.on { background: rgba(255, 85, 85, .52); }
body.touch-land.touch-on .tp-handbrake.on { background: rgba(255, 176, 60, .55); }
body.touch-land.touch-on .tg-gearDown { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.25 + 10px); }
body.touch-land.touch-on.touch-v2 .tg-gearDown { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.25 + 10px + var(--pad) * .5 + 10px); }
body.touch-land.touch-on .tg-gearUp { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.25 + 10px + var(--pad) * .42 + 10px); }
body.touch-land.touch-on.touch-v2 .tg-gearUp { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.25 + 10px + var(--pad) * .5 + 10px + var(--pad) * .42 + 10px); }

/* ---- share screen (js/game/menu.js _share): the result card and where to send it ---- */
/* results: the run in one narrow column (time, classification, records); the share card large beside it, car
 * condition under the card */
.screen-results .head h2 { font-size: 2.2rem; } .screen-results .head p { margin-top: .5rem; }
.screen-results .res-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); gap: 1.4rem; }
.screen-results .panel { margin-top: 1rem; }
.screen-results .res-grid .res-main { margin-top: 1rem; gap: .5rem 1.2rem; }
.screen-results .res-left .panel { padding: .8rem 1.1rem; }
.screen-results .res-pos b { font-size: 2.8rem; } .screen-results .res-time b { font-size: 2.3rem; }
.screen-results .badge { font-size: .95rem; padding: .15rem .5rem; margin-top: .3rem; }
.screen-results .res-lines > div { padding: .22rem 0; font-size: 1rem; }
.screen-results .board h3, .screen-results .cond h3, .share-panel h3 { margin: .1rem 0 .4rem; font-size: 1.05rem; }
.screen-results .board .brow { font-size: 1rem; padding: .16rem .5rem; grid-template-columns: 2rem minmax(0, 1fr) 6rem 5rem; }
.screen-results .res-right .panel:first-child { margin-top: 1rem; }
.share-panel { padding: .8rem 1.1rem 1rem; }
.share-card { display: block; width: 100%; height: auto; border: 3px solid #000; }
/* the Weekly Cup's brag panel (ceremony, LAST WEEK): a narrow panel, the card its width, the buttons wrapped under it (owner 2026-10-30: the full-width panel was far too big) */
.screen-ceremony .share-panel, .wk-brag .share-panel { width: 50%; max-width: 100%; margin-top: .8rem; box-sizing: border-box; }   /* half the column, as the results screen's; a phone gets the whole width */
.screen-ceremony .share-panel .share-row, .wk-brag .share-panel .share-row { flex-wrap: wrap; }
body.portrait .screen-ceremony .share-panel, body.portrait .wk-brag .share-panel, body.phone-land .screen-ceremony .share-panel, body.phone-land .wk-brag .share-panel { width: 100%; }
body.phone-land .screen-ceremony .share-panel, body.phone-land .wk-brag .share-panel { display: block; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .9rem; }
.share-row .btn { font-size: 1.05rem; padding: .55rem 1rem; }
.share-hint { display: block; margin-top: .6rem; color: var(--dim); font-size: .9rem; }
.res-rcol .panel { padding: .8rem 1.1rem; }
.res-rcol .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.res-rcol .cbar { margin: .2rem 0 .35rem; }
.res-rcol .setup-line { text-align: left; padding: .5rem 0 0; }
/* ---- medals (js/game/medals.js): pixel icons scaled by whole pixels (11 x 12 native), tally, results row ---- */
.medal-ic { width: 22px; height: 24px; vertical-align: middle; margin-right: .4rem; image-rendering: pixelated; }
.medal-ic.big { width: 44px; height: 48px; }
.cstats b .medal-ic { margin-top: -4px; }
.medal-tally { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .45rem; font-size: 1rem; color: #fff; }
.medal-tally b { color: var(--yellow); margin-right: .5rem; } .medal-tally span { margin-right: .7rem; }
.head .medal-tally { margin-top: .9rem; }
.screen-main .medal-tally { margin: -1vh 0 .3rem; }
.screen-results .res-left .res-medal { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; padding: .5rem 1.1rem; margin-top: .6rem; }
.res-medal b { font-size: 1.2rem; } .res-medal b.none { color: var(--dim); }
.res-medal b.bronze { color: #b87333; } .res-medal b.silver { color: #c0c8d0; } .res-medal b.gold { color: #ffd23c; } .res-medal b.platinum { color: #8fd0ff; }
.res-medal em { font-style: normal; color: var(--dim); font-size: .95rem; margin-left: auto; }
.res-medal .mth { display: inline-flex; align-items: center; font-size: .95rem; }
.select .val.locked { color: #8a8a8a; }
/* ---- car setup panel (js/game/menu.js _cars) ---- */
.setup-btn { margin-left: auto; }
/* ---- car screen (js/game/menu.js _cars): roster cards + setup of the selected car ---- */
.car-cards { max-width: 76rem; }
.car-cards .cstats { grid-template-columns: 1fr; gap: .35rem; margin-top: .7rem; }
.car-cards .cstats > div { display: flex; justify-content: space-between; align-items: center; gap: .6rem; } .car-cards .cstats b { margin-top: 0; }
.car-cards .cblurb { margin-top: .7rem; color: #f1e6d2; font-size: .9rem; min-height: 4.6rem; }
.card.sel { border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c; }
.card.sel.focus, .card.sel:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c, 0 0 0 11px #3d6fe0; }
.thumb .tag { position: absolute; left: .6rem; top: .6rem; padding: .25rem .5rem; font-size: .9rem; color: #fff; background: #2f8f3a; border: 3px solid #000; }
.setup-panel .set-label small, .setup-panel .set-hint { display: block; font-size: .8rem; opacity: .75; margin-top: .3rem; }
.setup-panel .ends { margin-top: .3rem; display: flex; justify-content: space-between; max-width: 18rem; gap: 1rem; font-size: .8rem; opacity: .7; font-style: normal; }
.setup-panel .ends em { font-style: normal; }
.notch .blocks { flex: 1; display: flex; gap: .35rem; justify-content: center; align-items: center; padding: 0 .5rem; }
.notch .blk { flex: 1; height: 1.2rem; background: #2a2a2a; border: 3px solid; border-color: #000 #555 #555 #000; cursor: pointer; }
.notch .blk.mid { background: #3a3a3a; }
.notch .blk.on { background: #3ddc5c; border-color: #9dffb0 #1f8f38 #1f8f38 #9dffb0; }
.notch .blk.cur { background: var(--yellow); border-color: #fff #a08000 #a08000 #fff; }
.setup-line { text-align: center; padding: .4rem .8rem; color: var(--yellow); }

/* ---- paint shop (js/game/paint.js, Car screen): preview of the painted side + roof, colour rows with a swatch ---- */
.paint-preview { display: flex; justify-content: center; padding: .3rem 0 .9rem; }
.paint-preview canvas { width: 424px; max-width: 100%; height: auto; image-rendering: pixelated; border: 3px solid #000; box-shadow: 0 0 0 3px #6a6a6a; background: #141414; }
.select .sw { flex: none; width: 1.25rem; height: 1.25rem; margin-left: .5rem; border: 2px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.paint-panel .btn.paint-reset { margin: .6rem 0 .2rem; }

/* ---- stage of the day (js/game/daily.js): main-menu button with two small lines under the title ---- */
.btn.daily { background-color: #b8860b; background-blend-mode: multiply; border-color: #ffe27a #6b4a00 #6b4a00 #ffe27a; }
.btn.daily.focus, .btn.daily:hover { background-color: #3d6fe0; border-color: #fff #fff #fff #fff; }
.btn.daily small { display: block; font-size: .8rem; font-weight: 600; margin-top: .35rem; color: #fff6d0; }
.btn.daily small.daily-left { margin-top: .15rem; color: #f1e6d2; opacity: .85; }
.btn.daily small.daily-left { margin-top: .4rem; }
:where(body.ui-tight) .menu-col .btn.big.daily { padding: .4rem 1.4rem; } :where(body.ui-tight) .btn.daily small { margin-top: .2rem; } :where(body.ui-tight) .btn.daily small.daily-left { margin-top: .3rem; }

/* ---- challenge link (js/game/challenge.js) */
/* ---- real roads (js/world/real.js): the cards share the stage select's look; the about screen is a column of credits */
.real-about { max-width: 46rem; margin-top: 1.2rem; }
.real-about h3 { margin: 1.1rem 0 .3rem; color: var(--yellow); } .real-about h3:first-child { margin-top: 0; }
.real-about p { font-size: 1.15rem; margin: .3rem 0; } .real-about p.dim { color: var(--dim); font-size: 1.05rem; }
.real-about p.real-url { color: var(--yellow); margin: 0; } .real-about p.real-url + p.real-url { margin: .25rem 0 .6rem; }
body.portrait :is(.screen-real, .screen-realmore, .screen-realabout) .head p { display: none; }
/* MORE ROADS (realmore): a country filter and a row per road; one line on wide screens, two on a phone in portrait (name and stars over km, climb, best, DRIVE) */
.real-more { margin: 1.2rem 0 .4rem; max-width: 22rem; }
.rm-body { max-width: 64rem; margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.rm-body .set-row { margin: .15rem 0; }
.rm-note { margin-top: .4rem; font-size: 1.15rem; } .rm-retry { align-self: flex-start; }
.rm-list { display: flex; flex-direction: column; gap: .6rem; padding: .3rem .3rem .8rem; }
.rm-row { appearance: none; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 9rem 7.5rem 15rem; align-items: center; gap: .9rem; min-height: 3.8rem; padding: .35rem .9rem; margin: 0; text-align: left; cursor: pointer; color: #fff; font: inherit; text-transform: uppercase;
  background: #866043 var(--tex-dirt); background-size: 48px 48px; image-rendering: pixelated; border: var(--px) solid; border-color: #b58a63 #3a281a #3a281a #b58a63; box-shadow: 0 0 0 3px #000; }
.rm-row.focus, .rm-row:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3d6fe0; }
.rm-row.busy { opacity: .75; }
.rm-flag { width: 2.4rem; height: 1.5rem; border: 3px solid #000; }
.rm-who { min-width: 0; overflow: hidden; }
:is(body.portrait, body.phone-land) .rm-body .select .val { padding: 0 2px; min-width: 0; overflow: hidden; } :is(body.portrait, body.phone-land) .rm-body .select .val .pxt { max-width: 100%; display: inline-block; } :is(body.portrait, body.phone-land) .rm-body .select .val .pxt canvas { max-width: 100%; height: auto; } .rm-name { font: 900 1.2rem var(--font); color: #fff; } .rm-country { color: #ffe9b0; font-size: .95rem; margin-top: .15rem; }
.rm-nums { display: flex; flex-direction: column; gap: .15rem; font-size: 1rem; color: #fff; }
.rm-stars { display: flex; gap: 3px; align-items: center; } .rm-stars em { font-style: normal; color: #e0cdb0; }
.rm-stars .st { display: block; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%233a281a' d='M3 0h1v2h3v1H5v1h1v3H5V6H4V5H3v1H2v1H1V4h1V3H0V2h3z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; image-rendering: pixelated; }
.rm-stars .st.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd23c' d='M3 0h1v2h3v1H5v1h1v3H5V6H4V5H3v1H2v1H1V4h1V3H0V2h3z'/%3E%3C/svg%3E"); }
.rm-end { display: flex; justify-content: space-between; align-items: center; gap: .8rem; font-size: 1rem; } .rm-best { color: #e0cdb0; } .rm-best.gold, .rm-go.gold { color: var(--yellow); }
body.portrait .screen-realmore .head { margin-bottom: 0; }
body.portrait .rm-body { margin-top: .6rem; } body.portrait .rm-list { gap: .5rem; padding: .3rem .3rem .6rem; }
body.portrait .rm-row { grid-template-columns: 2.2rem auto minmax(0, 1fr) auto; grid-template-areas: "flag name name stars" "flag country nums end"; row-gap: .45rem; column-gap: .6rem; min-height: 56px; padding: .45rem .6rem; }
body.portrait .rm-who { display: contents; } body.portrait .rm-flag { grid-area: flag; width: 2.2rem; height: 1.4rem; } body.portrait .rm-name { grid-area: name; font-size: 1.05rem; line-height: 1; } body.portrait .rm-country { grid-area: country; font-size: .85rem; margin: 0; line-height: 1; }
body.portrait .rm-stars { grid-area: stars; } body.portrait .rm-nums { grid-area: nums; flex-direction: row; gap: .9rem; margin-left: .3rem; font-size: .85rem; line-height: 1; } body.portrait .rm-end { grid-area: end; font-size: .85rem; gap: .5rem; line-height: 1; } body.portrait .rm-best.none { display: none; }
body.portrait .rm-stars .st { width: 11px; height: 11px; }
body.phone-land .screen-realmore .head { display: none; } body.phone-land .rm-body { margin-top: .6rem; } body.phone-land .rm-list { gap: .5rem; }
body.phone-land .rm-row { grid-template-columns: 2.2rem minmax(0, 1fr) auto auto auto; gap: 1rem; min-height: 44px; padding: .3rem .7rem; }
body.phone-land .rm-who { display: flex; overflow: hidden; flex-direction: column; gap: .3rem; line-height: 1; } body.phone-land .rm-nums { flex-direction: row; gap: .6rem; white-space: nowrap; line-height: 1; } body.phone-land .rm-end { gap: .8rem; line-height: 1; } body.phone-land .rm-best.none { display: none; }
body.phone-land .rm-body .set-row { grid-template-columns: minmax(0, 1fr) 18rem; }
body.phone-land .rm-name { font-size: 1rem; line-height: 1.1; } body.phone-land .rm-country { font-size: .8rem; margin-top: 0; } body.phone-land .rm-nums, body.phone-land .rm-end { font-size: .85rem; } body.phone-land .rm-stars .st { width: 11px; height: 11px; }
body.phone-land .real-more, body.portrait .real-more { max-width: none; } body.portrait .real-more .btn, body.phone-land .real-more .btn { min-height: 44px; width: 100%; }
/* ---- stage generator (js/game/stagegen.js): knobs on the left, the road from above and the buttons on the right */
.gen-grid { display: grid; grid-template-columns: minmax(0, 44rem) minmax(0, 26rem); gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.gen-knobs .set-row { grid-template-columns: minmax(16rem, 1fr) minmax(0, 22rem); }   /* the label keeps 16rem (DRUGA NAWIERZCHNIA on one line), the value takes up to 22rem, the label the rest */
.gen-adv.closed { display: none; }
.gen-knobs .gen-btns { margin: .5rem 0 .2rem; } .gen-knobs .gen-btns .btn { flex: 1 1 0; min-width: 0; font-size: 1rem; padding: .4rem .6rem; }
.gen-map { display: block; width: 100%; aspect-ratio: 3 / 2; image-rendering: pixelated; background: #2c2118; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; }
.gen-name { font-size: 1.3rem; color: var(--yellow); margin-top: .8rem; }
.gen-stat, .gen-best { font-size: 1.05rem; margin-top: .4rem; } .gen-best { color: var(--dim); }
.gen-from { font-size: 1.1rem; color: #5ec24a; margin-top: .8rem; } .gen-from:empty { display: none; }
.gen-acts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.gen-acts .btn { font-size: 1rem; padding: .5rem .9rem; flex: 1 1 auto; } .gen-acts .gen-go { flex-basis: 100%; font-size: 1.4rem; padding: .7rem 1rem; }
.gen-side input.chal-link { margin-top: .6rem; height: 2.3rem; width: 100%; }
/* what is on the road, what the last turn changed, what the knob in focus does (stagegen.js HELP); the side panel stays in view while the knobs scroll */
body:not(.portrait):not(.phone-land) .gen-side { position: sticky; top: 5.5rem; max-height: calc(100vh - 6.5rem); overflow-y: auto; }   /* under the bar with BACK */
.gen-sum { font-size: .95rem; margin-top: .5rem; color: var(--dim); } .gen-diff { font-size: .95rem; margin-top: .3rem; color: var(--yellow); } .gen-diff:empty { display: none; }
.gen-help { margin-top: .9rem; padding-top: .6rem; border-top: 2px solid #6a6a6a; }
.gen-help-t { font-size: 1.05rem; color: var(--yellow); } .gen-help-w { font-size: .95rem; margin-top: .35rem; } .gen-help-w:empty { display: none; }
.gen-help-v { margin-top: .4rem; } .gen-help-o { font-size: .9rem; color: var(--dim); margin-top: .2rem; } .gen-help-o.on { color: var(--yellow); }
body.phone-land .gen-help-w, body.phone-land .gen-help-v { display: none; }
.var-row .gen-btn { color: var(--yellow); }
body.portrait .gen-grid { grid-template-columns: minmax(0, 1fr); gap: .8rem; margin-top: .8rem; }
body.portrait .gen-knobs .set-row { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: .4rem; } body.portrait .gen-grid { margin-top: 0; } body.portrait .screen-stagegen .head { display: none; } body.portrait .gen-map { aspect-ratio: 2 / 1; } body.portrait .gen-knobs .select .val { font-size: .9rem; }
:is(body.portrait, body.phone-land) .gen-acts .btn { min-height: 44px; }
body.phone-land .screen-stagegen .head { display: none; }
body.phone-land .gen-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .6rem; margin-top: 0; }
body.phone-land .gen-knobs .set-row { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); padding-block: 0; margin-block: 0; }
/* a long value (MONTE CARLO, MIESZANA) between two 48 px arrows: the pixel canvas shrinks to the field instead of being clipped */
:is(body.portrait, body.phone-land) .gen-knobs .select .val { padding: 0 2px; } :is(body.portrait, body.phone-land) .gen-knobs .select .val .pxt { max-width: 100%; } :is(body.portrait, body.phone-land) .gen-knobs .select .val .pxt canvas { max-width: 100%; height: auto; }
body.phone-land .gen-knobs, body.phone-land .gen-side { padding-block: .5rem; }
body.phone-land .gen-knobs .gen-btns { margin: .3rem 0 0; } body.phone-land .gen-knobs .select { height: 40px; } body.phone-land .gen-knobs .gen-btns .btn { font-size: .85rem; min-height: 40px; }
:is(body.portrait, body.phone-land) .gen-knobs .set-row { min-height: 0; padding-block: 0; margin-block: .1rem; } body.portrait .gen-knobs .gen-btns { flex-direction: column; } body.portrait .gen-knobs .gen-btns .btn { flex: none; min-height: 40px; padding-block: .25rem; } body.phone-land .gen-knobs .gen-btns .btn { padding-block: .2rem; }
body.phone-land .gen-map { aspect-ratio: 5 / 2; } body.phone-land .gen-name, body.phone-land .gen-acts { margin-top: .4rem; }
.chal-panel { max-width: 46rem; margin-top: 1.4rem; }
.chal-panel .chips { margin-top: 0; }
.chal-from { font-size: 1.5rem; color: var(--yellow); margin-top: 1rem; min-height: 2rem; }
.chal-ghost, .chal-mine { font-size: 1.1rem; color: var(--dim); margin-top: .6rem; min-height: 1.4rem; }
.chal-mine { color: #fff; }
.chal-go { max-width: 46rem; margin-top: 1rem; } .chal-panel .set-row.chal-show { grid-template-columns: auto minmax(0, 1fr); margin: .7rem 0 -.3rem; padding-left: 0; padding-right: 0; } .chal-show .select { width: 100%; max-width: 22rem; justify-self: end; } .screen-challenge > .notice { max-width: 46rem; margin-top: 1rem; } .chal-go .btn { font-size: 1.4rem; padding: .7rem 2.2rem; }
:is(body.portrait, body.phone-land) .chal-go .btn { min-height: 48px; } body.portrait .chal-go .btn { width: 100%; }
.chal-share { margin-top: .9rem; } .chal-share:empty { display: none; }
.chal-share .btn { font-size: 1.05rem; padding: .55rem 1rem; }
.chal-share input.chal-link { margin-top: .6rem; height: 2.3rem; }
.screen-results .res-left .chal-result { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; padding: .6rem 1.1rem; margin-top: 1rem; border-left: 8px solid #3ddc5c; }
.screen-results .res-left .chal-result.lost { border-left-color: #e0503c; }
.chal-result .chal-line { font-size: 1.1rem; flex: 1 1 14rem; min-width: 0; }
.chal-result .btn { font-size: .95rem; padding: .35rem .8rem; }

/* ---- medals screen + livery strip (js/game/menu.js _medals, _liveryThumb, medalTally) ---- */
button.medal-tally { appearance: none; cursor: pointer; font: inherit; text-align: left; color: #fff; background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: .45rem .8rem; margin-top: .9rem; }
button.medal-tally em { font-style: normal; color: var(--dim); margin-left: .3rem; }
button.medal-tally.empty em { color: #ffe9b0; }
button.medal-tally.focus, button.medal-tally:hover { background: #1f3f9f; border-color: #fff; }
.menu-col button.medal-tally { margin: 0 0 .2rem; }
/* ---- medals screen (js/game/menu.js _medals): YOUR MEDALS (the showcase), ON THE STAGES, NEXT REWARDS, NEAREST NEXT MEDAL.
 *      Big medals worth wanting on a computer (owner 2026-10-23); phones stack the sections, each the full width ---- */
.screen-medals .head h2 { font-size: 2rem; } .screen-medals .head h2::after { display: none; } .screen-medals .head p { max-width: none; margin: .4rem 0 0; }
.medal-ic.lg { margin: 0; flex: none; width: 30px; height: 40px; }   /* 15 x 20 native: whole pixels only (x2 here, x5 in the showcase, x3 on a phone) */
.md-show, .md-grid { margin-top: 1.1rem; }
.md-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; } .md-top h3 { margin: 0; } .md-top em { font-style: normal; color: #fff; }
.md-top small { margin-left: auto; font-size: .8rem; color: #e0d6c2; }
.md-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: .8rem; }
.md-slot { display: flex; align-items: center; gap: 1.1rem; min-width: 0; padding: .9rem 1.1rem; background: rgba(0, 0, 0, .38); border: 3px solid #000; box-shadow: inset 0 -4px 0 var(--tier); }
.md-slot.bronze { --tier: #b87333; } .md-slot.silver { --tier: #c0c8d0; } .md-slot.gold { --tier: #ffd23c; } .md-slot.platinum { --tier: #8fd0ff; }
.md-slot .medal-ic.lg { width: 75px; height: 100px; }
.md-slot.zero .medal-ic { opacity: .35; } .md-slot.zero b { color: var(--dim); }
.md-sl { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.md-sl b { font-size: 2.2rem; line-height: 1; } .md-sl em { font-style: normal; font-size: 1rem; color: var(--tier); } .md-sl small { font-size: .78rem; color: #f0e6d2; }
.md-axis { display: flex; justify-content: space-between; margin-top: .5rem; font-size: .75rem; color: #c4b49c; }
/* the filter (Discord 2026-11-14: where is my one bronze?): a tier you hold is a button, the picked one framed in its colour */
button.md-slot { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.md-slot.focus, button.md-slot:hover { border-color: var(--yellow); }
.md-slot.sel { border-color: var(--tier); outline: 3px solid var(--tier); background: rgba(0, 0, 0, .6); }
.md-hint { color: var(--yellow); }
.md-tab { position: relative; }
.md-hits { position: absolute; top: -.9rem; right: -.6rem; min-width: 1.7rem; padding: .2rem .35rem; font-style: normal; font-size: 1rem; line-height: 1; text-align: center; color: #000; background: var(--tier); border: 2px solid #000; }
.md-hits.bronze { --tier: #b87333; } .md-hits.silver { --tier: #c0c8d0; } .md-hits.gold { --tier: #ffd23c; } .md-hits.platinum { --tier: #8fd0ff; }
.md-tile.miss { opacity: .35; }
.md-tile[data-nav] { cursor: pointer; } .md-tile.focus, .md-tile[data-nav]:hover { outline: 2px solid var(--yellow); } .md-tile.open { outline: 3px solid #fff; opacity: 1; }
/* the variants of the tile clicked: one row each, its medal and the road's tags as on the stage card */
.md-detail:empty { display: none; }
.md-detail { margin-top: .8rem; padding: .5rem .7rem; background: rgba(0, 0, 0, .45); border: 2px solid #000; }
.md-dname { display: block; margin-bottom: .35rem; font-size: .9rem; }
.md-drow { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; } .md-drow.dim { opacity: .4; }
.md-drow .chips { margin: 0; gap: .3rem; } .md-drow .chip { font-size: .8rem; padding: .1rem .4rem; }
.md-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.md-grid .panel { margin: 0; }
.md-have { grid-column: 1 / -1; }   /* ON THE STAGES the full width, NEXT REWARDS and NEAREST side by side under it (owner 2026-10-23) */
.md-have h3 { margin-top: 0; }
.md-right { display: contents; }
.md-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.md-tab { appearance: none; display: flex; align-items: center; justify-content: center; min-width: 0; padding: .45rem .3rem; font: inherit; color: #fff; background: var(--era); border: 3px solid #000; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35); cursor: pointer; }
.md-tab > span { min-width: 0; overflow: hidden; font-size: .8rem; line-height: 1.2; text-align: center; } .md-tab > b { display: none; font-size: 1.1rem; }
body.portrait .md-tab > b { display: block; } body.portrait .md-tab > span { display: none; }
.md-tab.sel { outline: 3px solid #fff; } .md-tab.focus, .md-tab:hover { border-color: var(--yellow); }
.md-tab.far:not(.sel), .md-col.far { opacity: .45; filter: grayscale(1); }
.md-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-top: .8rem; }
.md-col { min-width: 0; }
.md-lic { display: block; margin-bottom: .35rem; font-size: .8rem; text-align: center; color: var(--yellow); } .md-col.far .md-lic { color: #bbb; }
.md-lic > i { font-style: normal; } .md-lic > b { display: none; font-weight: normal; }
body.portrait .md-lic > i { display: none; } body.portrait .md-lic > b { display: inline; }
.md-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; }
.md-tile { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: 'm f n u'; align-items: center; gap: .55rem; min-width: 0; padding: .3rem .5rem; background: rgba(0, 0, 0, .25); border: 2px solid #000; }
.md-tile .em-flag { grid-area: f; } .md-tile u { grid-area: u; justify-self: end; font-size: .7rem; text-decoration: none; color: var(--yellow); }
.md-tile .medal-ic { grid-area: m; } .md-tile small { grid-area: n; overflow: hidden; font-size: .75rem; white-space: nowrap; }
.md-tile.bronze, .md-tile.silver, .md-tile.gold, .md-tile.platinum { background: rgba(0, 0, 0, .45); }
.md-tile.bronze { border-color: #b87333; } .md-tile.silver { border-color: #c0c8d0; } .md-tile.gold { border-color: #ffd23c; } .md-tile.platinum { border-color: #8fd0ff; }
.md-tile:not(.bronze):not(.silver):not(.gold):not(.platinum) .medal-ic { opacity: .7; }
.md-cap { margin: .8rem 0 0; font-size: .8rem; color: #f0e6d2; }
.md-track { margin-top: .7rem; }
.md-tt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 't c' 's s'; gap: .25rem .6rem; }
.md-tt b { grid-area: t; display: block; min-width: 0; font-size: 1rem; line-height: 1.3; }
.md-tt small { grid-area: s; display: block; font-size: .75rem; line-height: 1.3; color: #e0d6c2; } .md-tt em { grid-area: c; font-style: normal; color: var(--yellow); }
.md-track + .md-track { margin-top: 1rem; }
.md-line { position: relative; height: 2.1rem; margin: .5rem .8rem 0; }
.md-line::before, .md-fill { content: ''; position: absolute; left: 0; top: .5rem; height: 5px; background: #222; } .md-line::before { right: 0; }
.md-fill { background: var(--yellow); }
.md-node { position: absolute; top: calc(.5rem + 2px); width: .9rem; height: .9rem; box-sizing: border-box; background: #2a2a2a; border: 2px solid #000; transform: translate(-50%, -50%); }
.md-node.on { background: var(--yellow); } .md-node.nx { width: 1.2rem; height: 1.2rem; background: #fff; outline: 2px solid var(--yellow); }
.md-pts { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: .4rem; margin-top: .5rem; }
.md-pt { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 0; padding: .3rem .15rem; background: #3a3a3a; border: 3px solid #000; opacity: .55; }
.md-pt.on { background: #2f5a22; border-color: #8fe06a; opacity: 1; } .md-pt.nx { border-color: var(--yellow); opacity: 1; }
.md-pt:not(.on):not(.nx) .rw-ic { filter: grayscale(1); }
.md-pt u { text-decoration: none; font-size: .85rem; font-weight: 700; } .md-pt.nx u { color: var(--yellow); }
.md-pt small { display: none; }   /* the tiles are narrow: the name is in the title and the track's heading names the next one */
/* the era sets: one low row, the title and five small tiles side by side */
.md-etrack { display: flex; align-items: center; gap: .6rem; } .md-etrack .md-tt { flex: none; display: block; } .md-etrack .md-tt small, .md-etrack .md-tt em { display: none; }
.md-etrack .md-pts { flex: 1; margin-top: 0; }
.md-era-set { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: .25rem; min-width: 0; padding: .15rem .1rem; background: #3a3a3a; border: 3px solid #000; }
.md-era-set.on { background: #2f5a22; border-color: #8fe06a; }
.md-era-set u { text-decoration: none; font-size: .8rem; font-weight: 700; }
.md-era-set .rw-ic { width: 40px; height: 25px; }
.md-era-bar { display: none; }
body.portrait .md-etrack { flex-wrap: wrap; } body.portrait .md-etrack .md-pts { flex-basis: 100%; }
body:is(.phone-land, .portrait) .md-era-set .rw-ic { width: 32px; height: 20px; }
body.phone-land .md-next .md-tt small { display: none; }
body.phone-land .md-next .md-track { margin-top: .45rem; } body.phone-land .md-pt .rw-ic { max-width: 40px; }   /* phones held sideways: the second line of each track goes (the tiles' titles keep it), the screen stays within 2.5 heights */
.md-node u { position: absolute; top: 100%; left: 50%; margin-top: .3rem; font-size: .7rem; text-decoration: none; white-space: nowrap; color: #bbb; transform: translateX(-50%); }
.md-node.on u { color: #fff; } .md-node.nx u { color: var(--yellow); }
.md-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; padding: .3rem .6rem; background: rgba(0, 0, 0, .28); border: 2px solid #000; }
.md-row .em-flag { flex: none; }
.md-nm { flex: 1; min-width: 0; overflow: hidden; font-size: .9rem; white-space: nowrap; }
.md-to { font-style: normal; } .md-gap { flex: none; min-width: 6rem; text-align: right; white-space: nowrap; color: var(--yellow); font-size: 1.05rem; }
.md-row .btn.md-go { flex: none; min-width: 0; margin: 0; padding: .35rem 1rem; }
.md-near .next-card { margin-top: .6rem; }
/* phones: tighter, the sections one under the other, each the full width (owner 2026-10-23); the screen scrolls */
body:is(.phone-land, .portrait) .md-grid { grid-template-columns: minmax(0, 1fr); }
body:is(.phone-land, .portrait) :is(.md-show, .md-grid) { margin-top: .6rem; }
body:is(.phone-land, .portrait) .md-shelf { gap: .5rem; margin-top: .5rem; }
body:is(.phone-land, .portrait) .md-slot { gap: .6rem; padding: .5rem .6rem; }
body:is(.phone-land, .portrait) .md-slot .medal-ic.lg { width: 45px; height: 60px; }
body:is(.phone-land, .portrait) .md-sl b { font-size: 1.4rem; }
body:is(.phone-land, .portrait) .md-cols { gap: .5rem; }
body.phone-land .md-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.portrait .md-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.portrait .md-pts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body:is(.phone-land, .portrait) .md-pt { flex-direction: row; justify-content: center; gap: .3rem; padding: .2rem .1rem; }
body:is(.phone-land, .portrait) .md-pts { margin-top: .35rem; gap: .3rem; }
body:is(.phone-land, .portrait) .md-pt .rw-ic { max-width: 48px; }
body.portrait .md-tiles { grid-template-columns: minmax(0, 1fr); }
body.portrait .md-tt { grid-template-columns: minmax(0, 1fr); grid-template-areas: 't' 'c' 's'; }
body:is(.phone-land, .portrait) .md-tile { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'f' 'u' 'm'; justify-items: center; gap: .3rem; padding: .35rem .2rem; } body:is(.phone-land, .portrait) .md-tile small { display: none; }
body:is(.phone-land, .portrait) .md-tile u:empty { display: none; }
body.portrait .md-hint { display: none; }
.liv-strip { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .8rem; }
.liv-opt { appearance: none; cursor: pointer; font: inherit; color: #fff; padding: .4rem; background: #141414; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 6.6rem; }
.liv-opt img { width: 96px; height: 48px; image-rendering: pixelated; display: block; }
.liv-opt .ln { font-size: .95rem; } .liv-opt .lk { font-size: .8rem; color: var(--dim); }
.liv-opt.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.liv-opt.locked img { opacity: .35; filter: grayscale(1); } .liv-opt.locked .lk { color: #ffb0a0; }
.liv-opt.focus, .liv-opt:hover { background: #1f3f9f; border-color: #fff; }
/* team livery row of the paint shop (owner 2026-10-22: eight liveries in the narrow control column overlapped): the label and
   its hint take the full width, the liveries a grid of four below, each tile its thumbnail, name and state */
.set-row.liv-row { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
.set-row .liv-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: 0; }
.set-row .liv-opt { min-width: 0; padding: .35rem .25rem .3rem; overflow: hidden; }
.set-row .liv-opt img { width: 100%; max-width: 120px; height: auto; aspect-ratio: 2 / 1; }
.set-row .liv-opt .ln { font-size: .85rem; max-width: 100%; overflow: hidden; white-space: nowrap; }
.set-row .liv-opt .lk { font-size: .85rem; min-height: 1.15em; display: flex; align-items: center; justify-content: center; gap: .3em; color: #ffd23c; }
.set-row .liv-opt .lk.med::before { content: ''; display: block; flex: none; width: .7em; height: .7em; background: #ffd23c; border: 2px solid #7a5a00; box-shadow: inset -2px -2px 0 #c99a10; }   /* a pixel gold medal */
body.is-mobile .set-row .liv-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* phones: three bigger tiles a row, the names fit */
body.is-mobile .set-row .liv-opt .ln, body.is-mobile .set-row .liv-opt .lk { font-size: .75rem; }
body.is-mobile .set-row .liv-opt .lk { display: flex; overflow: visible; }   /* the phone rule below makes it a block: the medal needs the row */
.paint-intro { margin: .2rem 0 .6rem; color: #ffe9b0; font-size: 1rem; }
.paint-panel .btn.paint-how { margin: .2rem 0 .8rem; font-size: 1rem; padding: .5rem 1rem; }
:where(body.ui-tight) .quick { margin-top: .3rem; padding-top: .6rem; } :where(body.ui-tight) .quick-row .btn { padding: .45rem .6rem; }
/* desktop main menu with the night button: logo + tally + 7 buttons + quick settings in 45 rem of height (body.ui-tight, set by Hud.resize) */
body:not(.phone-land):where(.ui-tight) .screen-main { --st: 3vh; padding-bottom: 1vh; }
body:not(.phone-land):not(.portrait):where(.ui-tight) .screen-main .foot { position: absolute; left: calc(var(--sl) + max(30rem, 480px) + 1.5rem); right: var(--sr); bottom: 1vh; margin: 0; justify-content: flex-end; }   /* the hints sit in the corner instead of under the column, never across it (left: the column, max(30rem, 480px) on a desktop, + a gap) */
body:not(.phone-land):where(.ui-tight) .screen-main .logo { margin: 0 0 1vh; }
body:not(.phone-land):where(.ui-tight) .logo-main { margin-top: .5rem; gap: .3rem; }
body:not(.phone-land):where(.ui-tight) .menu-col { gap: .85rem; }
body:not(.phone-land):where(.ui-tight) .menu-col .btn.big { padding: .55rem 1.4rem; }
body:not(.phone-land):where(.ui-tight) .menu-col .btn.big.daily { padding: .3rem 1.4rem; }
body:not(.phone-land):where(.ui-tight) .btn.daily small { font-size: .75rem; margin-top: .15rem; }
body:not(.phone-land):where(.ui-tight) .btn.daily small.daily-left { margin-top: .15rem; }
body:not(.phone-land):where(.ui-tight) .menu-col button.medal-tally { padding: .3rem .8rem; }
body:not(.phone-land):where(.ui-tight) .quick { margin-top: .2rem; padding-top: .4rem; gap: .4rem; }
body:not(.phone-land):where(.ui-tight) .quick-row .btn { padding: .35rem .6rem; }
/* the medal button's explanation takes its own full-width line and wraps word by word instead of running out of the box */
button.medal-tally { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; width: 100%; box-sizing: border-box; }
button.medal-tally em { flex: 1 1 100%; margin: .1rem 0 0; white-space: normal; line-height: 1.5; }

/* ---- results screen, two equal columns: you + the world on the left, sharing + personal records on the right ---- */
.screen-results .res-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; }
.screen-results .res-left .res-main .res-medal.inline { margin: .7rem -1.1rem -.8rem; padding: .55rem 1.1rem; border: 0; border-top: 3px solid #000; box-shadow: none; background: rgba(0, 0, 0, .28); }
.screen-results .res-left .online-panel { margin-top: 1rem; }
.screen-results .lb-full-btn { margin-top: .7rem; font-size: 1rem; padding: .5rem 1rem; }
.screen-results .res-rcol .board { margin-top: 1rem; }
.screen-results .res-left .res-main .res-medal.inline { grid-column: 1 / -1; }
.screen-results .online-line { font-size: 1.1rem; }
/* a flex item never shrinks below its content by default, so the explanation canvas stretched the button; cap it so the pixel text wraps */
button.medal-tally em { min-width: 0; width: 100%; max-width: 100%; }

/* ---- phone landscape menus (body.phone-land, set by js/game/menu.js): compact bar + header, accordion settings, scrolling card row, two-column main menu ---- */
body.phone-land .row-foot.nav-top { padding: .4rem var(--sr) .4rem var(--sl); margin-bottom: .8rem; }
body.phone-land .row-foot.nav-top .btn { min-height: 40px; font-size: 1rem; padding: .4rem 1rem; }
body.phone-land .head h2 { font-size: 1.7rem; }
body.phone-land .head h2::after { margin-top: .4rem; height: .35rem; }
body.phone-land .head p, body.phone-land .head .medal-tally { display: none; }
body.phone-land :is(.cards, .spr-cards, .lock-cards) { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; padding: .4rem .4rem .6rem; margin-top: .8rem; }   /* three cards a row, the screen scrolls down (a sideways row swallowed the vertical drag and hid the ranking lines) */
body.phone-land .thumb { aspect-ratio: 6 / 1; }
body.phone-land .thumb .flag { top: .25rem; left: .4rem; width: 1.5rem; height: 1rem; } body.phone-land .thumb .num { top: .1rem; font-size: 1.1rem; }
body.phone-land .cbody { padding: 1.35rem .6rem .5rem; }
body.phone-land .cards .chips .chip:nth-child(n+2) { display: none; }
body.phone-land .cname { font-size: .95rem; margin-top: .3rem; } body.phone-land .ccountry { font-size: .85rem; margin-top: .15rem; }
body.phone-land .chips { margin: .4rem 0; gap: .25rem; } body.phone-land .chip { font-size: .8rem; padding: .1rem .35rem; }
body.phone-land .cstats { grid-template-columns: 1fr; padding-top: .4rem; gap: .3rem; }
body.phone-land .cstats > div { display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-width: 0; }
body.phone-land .cstats small { font-size: .7rem; } body.phone-land .cstats b { font-size: .85rem; margin-top: 0; white-space: nowrap; }
body.phone-land .cname { line-height: 1.1; }
body.phone-land .cwrap { gap: .5rem; } body.phone-land .cwrap > .rank-btn { min-height: 40px; }
body.phone-land .cworld { margin-top: .4rem; padding-top: .4rem; }
body.phone-land .set-group, body.is-mobile .set-group { scroll-margin-top: 4.5rem; }
body.phone-land .var-row { margin-top: 0; } body.phone-land :is(.screen-stages, .screen-real, .screen-realabout) .head { display: none; }   /* the bar and the cards say what this screen is */
body.phone-land .ccountry { margin-top: .4rem; }
body.phone-land .var-row .var-btn { padding: .4rem .7rem; font-size: .95rem; }
/* main menu: one narrow column at the left edge, the logo in the opposite corner, the live scene in between */
body.phone-land .screen-main { --st: 2vh; padding-bottom: 1vh; }
body.phone-land .screen-main .logo { position: absolute; right: var(--sr); top: 3vh; margin: 0; display: flex; flex-direction: column; align-items: flex-end; }
body.phone-land .screen-main .logo-main { align-items: flex-end; margin-top: .5rem; gap: .3rem; }
body.phone-land .menu-col { width: 25rem; max-width: 34vw; gap: .35rem; margin: auto 0; }
body.phone-land .menu-col .btn.big { min-height: 38px; font-size: 1.1rem; padding: .25rem .6rem; }
body.phone-land .menu-col .btn.daily small { font-size: .8rem; margin-top: .55rem; max-width: 100%; box-sizing: border-box; } body.phone-land .menu-col .btn.daily small canvas { max-width: 100%; height: auto; image-rendering: pixelated; }
body.phone-land .menu-col button.medal-tally { padding: .25rem .6rem; margin: 0; } body.phone-land .menu-col button.medal-tally em { display: none; }
body.phone-land .menu-col .quick { margin-top: .15rem; padding-top: .45rem; gap: .35rem; } body.phone-land .menu-col .quick-label { display: none; }
body.phone-land .menu-col .quick-row { flex-direction: column; gap: .35rem; } body.phone-land .menu-col .quick-row .btn { min-height: 36px; padding: .2rem .6rem; flex: none; }
/* phone landscape: the column is too narrow for a second quick button, so the invite sits in the free corner, the footer above it */
body.phone-land .menu-col .quick-row .btn.discord-btn { position: absolute; right: var(--sr); bottom: 1vh; min-height: 40px; padding: .2rem 1.2rem; }
body.phone-land .screen-main .foot > span:not(.ver):not(.copy) { display: none; }
body.phone-land .screen-main .foot { position: absolute; left: calc(var(--sl) + 58vw + 1rem); right: var(--sr); bottom: calc(1vh + 40px + .5rem); margin: 0; }   /* right of the column (58vw, below), above the invite; it wraps and grows upwards into the free scene */

/* ---- settings accordion (phones, any orientation) and controls screen ---- */
body.is-mobile .set-group h3[data-nav] { cursor: pointer; }
body.is-mobile .set-group h3[data-nav].focus { outline: 3px solid #fff; outline-offset: -3px; }
.set-group h3 .set-mark { margin-left: auto; font-weight: 900; }
.set-group.collapsed { padding-bottom: 0; }
.set-group.collapsed > h3 { margin-bottom: 0; }
.set-group.collapsed > :not(h3) { display: none; }
body.is-mobile .ctl-touch { order: -1; flex-basis: 100%; }
body.is-mobile .ctl-row kbd { flex: none; max-width: 55%; white-space: normal; text-align: center; }
.ctl-row kbd { flex: none; max-width: 55%; white-space: normal; text-align: center; }   /* desktop too: long hints wrap inside their panel instead of running out of it */

/* ---- phones (body.portrait / body.phone-land): one column, every section across the whole width ----
 * The pixel font never draws smaller than 2 px a dot (12 px a letter), while a phone's rem is 10 px: text is about
 * 1.6 times wider than the rem layout assumes. So on phones widths come from the content (auto / wrap), not from rem. */
body.portrait .screen { --sl: calc(4vw + var(--tsafe-l)); --sr: calc(4vw + var(--tsafe-r)); }
body.portrait .row-foot.nav-top { gap: .6rem; padding: .5rem var(--sr) .5rem var(--sl); margin-bottom: 1rem; }
body.portrait .row-foot.nav-top .btn { flex: 1 1 auto; min-height: 44px; font-size: 1rem; padding: .3rem .7rem; }
body.portrait .head h2 { font-size: 2rem; } body.portrait .head p { margin-top: .6rem; }
body.is-mobile .btn > span { min-width: 0; max-width: 100%; }

@media (max-width: 900px) { .screen-results .res-grid, .screen-champion .res-grid { grid-template-columns: minmax(0, 1fr); } }
:is(body.portrait, body.phone-land) .res-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
:is(body.portrait, body.phone-land) .res-rcol { display: flex; flex-direction: column; }
:is(body.portrait, body.phone-land) .res-rcol .share-panel { order: 9; }   /* the numbers first, sharing last */
:is(body.portrait, body.phone-land) .screen-results .panel, :is(body.portrait, body.phone-land) .screen-champion .panel { margin-top: 1.4rem; padding: 0 1.1rem .9rem; }
:is(body.portrait, body.phone-land) .screen-results .res-grid .res-main { margin-top: 1rem; padding-top: .9rem; }
body.portrait .screen-results .res-grid .res-main { grid-template-columns: minmax(0, 1fr); }   /* one column: the position and the time (with its NEW RECORD badge) are pixel canvases that cannot shrink, side by side they stick out of a 393 px phone */
/* every section opens with a dark title bar, so one ends where the next begins */
:is(body.portrait, body.phone-land) .res-grid .panel > h3 { margin: 0 -1.1rem .7rem; padding: .55rem 1.1rem; background: #141414; border-bottom: 3px solid #000; box-shadow: inset 0 -3px 0 rgba(255, 210, 60, .5); }
:is(body.portrait, body.phone-land) .res-pos, :is(body.portrait, body.phone-land) .res-time { min-width: 0; }
:is(body.portrait, body.phone-land) .res-lines > div { flex-wrap: wrap; gap: .2rem 1rem; padding: .45rem 0; }
:is(body.portrait, body.phone-land) .res-lines b { margin-left: auto; text-align: right; }
:is(body.portrait, body.phone-land) .res-grid .board .brow { grid-template-columns: 2.8rem minmax(0, 1fr) auto auto; gap: .8rem; padding: .4rem .5rem; align-items: center; }
:is(body.portrait, body.phone-land) .res-grid .board .brow > span:not(.pxt) { overflow: hidden; white-space: nowrap; min-width: 0; }   /* the cells, not a bare text line (its accents reach above the box) */
:is(body.portrait, body.phone-land) .lb-board .brow.lb-row { grid-template-columns: 2.8rem minmax(0, 1fr) 8.6rem 7.4rem; }
/* full ranking on phones: the table takes the whole width; five fields in five columns sized in em (monospace pixel font: .75em a character), roomier rows. Portrait drops the car */
:is(body.portrait, body.phone-land) :is(.lb-full, .lb-hint) { max-width: none; }
:is(body.portrait, body.phone-land) .lb-full .brow.lb-row { grid-template-columns: 2.4em minmax(0, 1fr) 8.6em 6.6em 6.4em; gap: 1rem; padding: .55rem .9rem; align-items: center; }
body.portrait .lb-full .lb-car { display: none; } body.portrait .lb-full .brow.lb-row { grid-template-columns: 1.6em minmax(0, 1fr) 6.2em 5.9em; gap: .3rem; padding: .55rem .3rem; }
:is(body.portrait, body.phone-land) .screen-results .res-left .chal-result { padding: .7rem 1.1rem; }
:is(body.portrait, body.phone-land) .screen-results .res-left .res-main .res-medal.inline { margin: .8rem -1.1rem -.9rem; }
:is(body.portrait, body.phone-land) .res-medal em { margin-left: 0; flex: 1 1 100%; }
:is(body.portrait, body.phone-land) .share-row .btn, :is(body.portrait, body.phone-land) .chal-share .btn { min-height: 44px; }
body.portrait .share-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
body.portrait .share-row .btn.primary, body.portrait .chal-share .btn { grid-column: 1 / -1; width: 100%; }
body.portrait .share-row .btn { padding: .4rem .5rem; }
/* landscape: place, time and the lines of the run side by side; the share card beside its buttons */
body.phone-land .screen-results .head p { display: block; margin-top: .4rem; font-size: 1rem; }
body.phone-land .screen-results .res-grid .res-main { grid-template-columns: 13rem 18rem minmax(0, 1fr); gap: .4rem 2rem; align-items: start; }   /* fixed tracks: the medal line under them must wrap, not widen them */
body.phone-land .screen-results .res-lines { grid-column: 3; grid-row: 1 / span 2; }
body.phone-land .share-panel { display: grid; grid-template-columns: 30rem minmax(0, 1fr); column-gap: 1.4rem; align-items: start; }
body.phone-land .share-panel > h3 { grid-column: 1 / -1; }
body.phone-land .share-panel > .share-card { grid-column: 1; grid-row: 2 / span 4; }
body.phone-land .share-panel > :not(h3):not(.share-card) { grid-column: 2; }
body.phone-land .share-panel .share-row { margin-top: 0; } body.phone-land .share-panel .chal-share { margin: 0 0 .8rem; }
body.is-mobile .card { display: flex; flex-direction: column; justify-content: flex-start; }   /* a button centres its content: short cards started lower than their neighbours */
body.is-mobile .card > * { width: 100%; }
body.is-mobile .foot > span:not(.ver):not(.copy) { display: none; }   /* keyboard hints */
/* phones: the footer on a black bar like the licence badge, light and opaque text (dim grey over the dirt or the scene could not be read) */
body.is-mobile .screen-main .foot { width: max-content; max-width: 100%; box-sizing: border-box; margin-left: auto; padding: .3rem .6rem; gap: .2rem .9rem; background: rgba(0, 0, 0, .55); color: #d4d4d4; }
body.is-mobile .screen-main .foot .ver, body.is-mobile .screen-main .foot .copy { opacity: 1; }
body.is-mobile .screen-main .foot, body.is-mobile .screen-main .foot .copy { justify-content: flex-start; text-align: left; } body.is-mobile .screen-main .foot .ver { margin-left: 0; flex-basis: 100%; }   /* every line from the left: the pixel font draws a wrapped text left-aligned in one canvas */
/* version and ABOUT share the first line, the copyright wraps under them (2026-11-20: four lines in the corner were three too many): a grid where
   .copy steps aside (display: contents), so its link and its pixel line are the grid's own items */
body.is-mobile .screen-main .foot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1.4rem; }
body.is-mobile .screen-main .foot .copy { display: contents; }
body.is-mobile .screen-main .foot .copy-t { grid-column: 1 / -1; min-width: 0; }   /* a box of its own: the pixel font wraps to its parent's width */
body.is-mobile .screen-main .foot .about { display: block; margin: 0; }
body.portrait .screen-main .foot { margin: .8rem 0 0; }   /* under the column on every phone held upright */
body.phone-land .screen-main .foot { width: auto; margin-left: 0; }   /* landscape: the box spans its corner (left/right above), the lines wrap inside it */
:is(body.portrait, body.phone-land) .res-pos b, :is(body.portrait, body.phone-land) .res-time b { margin-top: .5rem; }
.res-medal em { min-width: 0; max-width: 100%; }   /* so the line wraps inside the panel (it ran out of it on tablets too) */
body.phone-land .screen-results .res-left .res-main .res-medal.inline { grid-column: 1 / span 2; grid-row: 2; margin: .6rem 0 0; padding: .5rem .7rem; border: 3px solid #000; align-self: start; }

/* ---- phones: settings rows, car screen and paint shop ---- */
.sw-grid, .sw-name, .car-sel { display: none; }
body.is-mobile .select .arr { flex: none; } body.is-mobile .select .val { min-width: 0; overflow: hidden; }
body.portrait .set-row, body.is-mobile .set-row.row-stack { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding-top: .6rem; padding-bottom: .7rem; }
body.portrait .set-group { padding: 0 1.1rem .6rem; } body.portrait .set-group h3 { margin: 0 -1.1rem .5rem; padding: .7rem 1.1rem; }
body.portrait .setup-panel .ends { max-width: none; opacity: 1; color: var(--dim); margin-top: .5rem; }
body.portrait .setup-panel .set-hint { opacity: 1; color: #ffe9b0; }
body.is-mobile .notch .blk { height: 1.9rem; }
/* car roster: picture + name; what the chosen car is like stands under the row */
body.is-mobile .car-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; padding: .4rem; max-width: none; }
body.is-mobile .car-cards .cstats, body.is-mobile .car-cards .cblurb { display: none; }
body.is-mobile .car-cards .cbody { padding: 1.2rem .5rem .6rem; } body.is-mobile .car-cards .cname { font-size: 1rem; margin-top: .3rem; line-height: 1.1; }
body.is-mobile .car-cards .thumb .tag { left: .3rem; top: .3rem; padding: .1rem .3rem; }
body.phone-land .car-cards .thumb { aspect-ratio: 3 / 1; }
body.is-mobile .car-sel { display: block; margin-top: .8rem; padding: .7rem .9rem; background: rgba(0, 0, 0, .55); border: 3px solid #000; border-left: .6rem solid #3ddc5c; }
body.is-mobile .car-sel b { display: block; color: #fff; } body.is-mobile .car-sel span { display: block; color: var(--yellow); margin-top: .5rem; }
body.is-mobile .car-sel p { margin: .5rem 0 0; color: #f1e6d2; }
/* paint shop: the preview stays in sight, colours are a palette to tap */
body.is-mobile .paint-intro { display: none; }
body.is-mobile .paint-preview { position: sticky; top: calc(3.6rem + var(--tsafe-t)); z-index: 2; margin: 0 -1.1rem .4rem; padding: .5rem 1.1rem; background: #2b2b2b; border-bottom: 3px solid #000; }
body.portrait .paint-preview { top: calc(5.7rem + var(--tsafe-t)); }
body.is-mobile .paint-preview canvas { width: auto; max-height: 22vh; max-width: 100%; }
body.is-mobile .paint-color > .select { display: none; }
body.is-mobile .sw-name { display: block; color: var(--yellow); min-height: 1.4rem; }
body.is-mobile .sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin-top: .5rem; }
.sw-cell { appearance: none; height: 40px; padding: 0; border: 3px solid #000; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); color: #fff; font: 800 1rem var(--font); cursor: pointer; }
.sw-cell.sel { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--yellow); position: relative; z-index: 1; }
body.is-mobile .set-row .liv-strip { justify-content: stretch; gap: .5rem; }
body.is-mobile .set-row .liv-opt { min-width: 0; overflow: hidden; } body.is-mobile .set-row .liv-opt img { width: 100%; max-width: 144px; height: auto; aspect-ratio: 2 / 1; }
body.is-mobile .liv-opt .ln, body.is-mobile .liv-opt .lk { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; }
body.is-mobile .paint-panel .btn.paint-how, body.is-mobile .paint-panel .btn.paint-reset { width: 100%; }
body.is-mobile input.select.text { font-size: 16px; height: 46px; }   /* 16 px: iOS zooms the page into any smaller input */
body.is-mobile .set-group h3 > span:not(.set-mark) { flex: 1 1 0; min-width: 0; }
body.is-mobile .set-label small { margin-top: .5rem; } body.is-mobile .sw-name { margin-top: .2rem; }
body.is-mobile .car-sel p .pxt canvas, body.is-mobile .set-label small .pxt canvas { margin: 1px 0; }
body.touch-land.touch-tilt .hud-speed { bottom: calc(var(--tsafe-b) + 12px); }   /* steering by tilt: no arrows to sit above */

/* ---- touch switches (owner 2026-11-11, phone stage 2; js/game/input.js tick, Settings > Touch; docs/arch/phone.md "Touch switches") ---- */
/* D: see-through pads (the throttle's auto dimming on top of it) */
.touch .tpad, .touch .tgear { opacity: var(--tpad-op, 1); } .touch .tp-throttle.auto { opacity: calc(var(--tpad-op, 1) * .6); }
/* A: the finger zone instead of the arrows: the left half below the top-left buttons, 24 px clear of the edge (Safari's back swipe) */
.tzone { display: none; position: absolute; pointer-events: auto; touch-action: none; left: calc(var(--tsafe-l) + 24px); right: 50%; top: calc(var(--tsafe-t) + 120px); bottom: 0; }
.touch.finger .tzone { display: block; } .touch.finger .tp-left, .touch.finger .tp-right { display: none; }
.tzone i { display: none; position: absolute; left: 0; top: 0; pointer-events: none; }
.tzone.on i { display: block; }
.tpad-probe { position: absolute; width: var(--pad); height: 0; visibility: hidden; pointer-events: none; }   /* input.js padPx */
.tz-base { width: calc(var(--pad) * 1.4);   /* = 2 x FINGER_FULL_K (input.js) x the pad size: the track is the full lock range */ height: 10px; margin: -5px 0 0 calc(var(--pad) * -.7); background: rgba(20, 20, 20, .3); border: 2px solid rgba(255, 255, 255, .5); opacity: var(--tpad-op, 1); }
.tz-dot { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: rgba(255, 210, 60, .55); border: 3px solid; border-color: #fff3c0 #8a6a10 #8a6a10 #fff3c0; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
body.touch-land.touch-finger .hud-speed { bottom: calc(var(--tsafe-b) + 12px); }   /* no arrows to sit above */
/* tilt level (owner 2026-11-11 "jak mocno przechylam ... coś w rodzaju poziomicy"; input.js _drawLevel): bottom centre, below the car.
 * The marker is the phone's angle (--tlx, -1..1 of TILT_SPAN), the green fill the steering it gives (--tlf, up to full lock), the red
 * ends the angles past full lock (--tlfull) where turning further does nothing; there the marker turns red and blinks. Dimmed until
 * the first reading (.wait: iOS waits for the motion permission). */
.tlevel { --tlw: min(44vw, 340px); --tlx: 0; --tlf: 0; display: none; position: absolute; left: 50%; bottom: calc(var(--tsafe-b) + 14px); width: var(--tlw); height: 16px; margin-left: calc(var(--tlw) / -2); box-sizing: border-box; pointer-events: none; background: rgba(20, 20, 20, .55); border: 3px solid #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
body.touch-v2 .touch.tilt .tlevel { display: block; }
.tlevel::before, .tlevel::after { content: ''; position: absolute; top: 0; bottom: 0; width: calc((1 - var(--tlfull)) * 50%); background: rgba(214, 65, 58, .8); }
.tlevel::before { left: 0; } .tlevel::after { right: 0; }
.tlevel i { position: absolute; display: block; }
.tl-mid { top: 0; bottom: 0; left: calc(50% - var(--tldz) * 50%); width: calc(var(--tldz) * 100%); background: rgba(255, 255, 255, .3); }
.tl-fill { top: 3px; bottom: 3px; left: 50%; width: calc(var(--tlfull) * 50%); transform-origin: 0 50%; transform: scaleX(var(--tlf)); background: #3fb34f; }
.tl-dot { top: -9px; left: 50%; width: 14px; height: 28px; margin-left: -7px; box-sizing: border-box; transform: translateX(calc(var(--tlx) * (var(--tlw) - 6px) / 2)); background: #ffc61a; border: 3px solid #000; }
.tlevel.over .tl-dot { background: #ff4a3d; animation: tbblink .3s steps(2) infinite; }
.tlevel.wait { opacity: .4; }
body.portrait .tlevel { --tlw: min(52vw, 205px); left: calc(var(--tsafe-l) + 14px); margin-left: 0; bottom: calc(var(--tsafe-b) + 24px); }   /* upright: bottom left, under the dial, left of the pedals */
/* touch onboarding (js/game/touchpick.js): the style cards three in a row, their diagram whole; the results hint; NEW on the pause */
.tp-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1rem; }
body .tp-cards .tp-card .thumb { aspect-ratio: 2 / 1; height: auto; } body .tp-cards .tp-card .thumb img { object-fit: contain; }   /* the whole diagram, over phone-land 6:1 and is-mobile cover */
.tp-line { margin: .3rem 0 0; font-size: .95rem; opacity: .85; } .tp-note { display: none; margin: .8rem 0 0; opacity: .8; } body.phone-land .tp-note { display: block; }   /* the note only where the head's line is hidden (a phone sideways) */
/* upright: the tiles one under another, each a row (the diagram left, the name and line right), all three on one screen (owner 2026-11-11) */
body.portrait .tp-cards { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
body.portrait .tp-cards .tp-card { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); align-items: center; }
body.portrait .tp-cards .tp-card .cbody { padding: .6rem .8rem; } body.portrait .tp-cards .tp-card .cbody::before { display: none; }   /* no grass strip over half a row */
.tp-hint { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .6rem 0; } .tp-hint > .notice { flex: 1 1 30rem; margin: 0; }
.btn .tp-new { margin-left: .8rem; padding: .15rem .5rem; font: 400 1.1rem var(--font); font-style: normal; background: #d6413a; color: #fff; border: 3px solid #000; }
/* B: Auto throttle On: no throttle pad, the brake takes its place and size */
body.touch-autogas .tp-throttle { display: none; }
body.touch-on.touch-autogas .tp-brake { right: calc(var(--tsafe-r) + 14px); height: calc(var(--pad) * 1.5); }
body.touch-land.touch-on.touch-autogas .tp-brake { height: calc(var(--pad) * 1.25); width: calc(var(--pad) * 2 + 12px); }
body.portrait.touch-autogas .tp-brake { height: calc(var(--pad) * 1.6); }
/* D: mirror (left-handed): the pedals, the shift buttons and the speed box on the left, the steering on the right */
body.touch-on.touch-mirror .tp-left { left: auto; right: calc(var(--tsafe-r) + 14px + var(--pad) + 12px); }
body.touch-on.touch-mirror .tp-right { left: auto; right: calc(var(--tsafe-r) + 14px); }
body.touch-on.touch-mirror .tp-throttle, body.touch-on.touch-mirror .tgear { right: auto; left: calc(var(--tsafe-l) + 14px); }
body.touch-on.touch-mirror .tp-brake { right: auto; left: calc(var(--tsafe-l) + 14px + var(--pad) + 12px); }
body.touch-on.touch-mirror.touch-autogas .tp-brake { left: calc(var(--tsafe-l) + 14px); }
body.touch-on.touch-mirror .tp-handbrake, body.touch-land.touch-on.touch-mirror .tp-handbrake { right: auto; left: calc(var(--tsafe-l) + 14px); }
body.touch-on.touch-mirror .tzone { left: 50%; right: calc(var(--tsafe-r) + 24px); }
body.touch-land.touch-on.touch-mirror .hud-speed { left: auto; right: calc(var(--tsafe-r) + 14px); }
body.portrait.touch-on.touch-mirror .hud-br { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 2.15 + 24px); }
body.portrait.touch-on.touch-mirror .hud-bl { bottom: calc(var(--tsafe-b) + 12px + var(--pad) * 1.35 + 12px); }
:is(body.portrait, body.phone-land) .res-grid .board.wide .brow { grid-template-columns: 2.8rem minmax(0, 1fr) auto auto auto; }
body.portrait .res-grid .board.wide .brow { grid-template-columns: 2.6rem minmax(0, 1fr) 9.6rem 8.4rem; gap: .5rem; } body.portrait .res-grid .board.wide .brow b { text-align: right; } body.portrait .res-grid .board.wide .brow em { display: none; }   /* place, name, time, points: the gap gives way */
:is(body.portrait, body.phone-land) .screen-champion .panel { padding-top: 0; }
body.hud-small .hud-surf-sub { margin-top: .7rem; } body.hud-small .hud-surf-name, body.hud-small .hud-surf-sub { line-height: 0; }
/* portrait: main menu across the width, compact stage-list header, controls one under another */
body.portrait .menu-col { width: 100%; max-width: none; gap: .8rem; }
body.portrait :is(.screen-stages, .screen-real, .screen-realabout) .head p, body.portrait .head button.medal-tally em { display: none; }
body.portrait .var-row { gap: .6rem; margin-top: .8rem; } body.portrait .var-row .var-btn { flex: 1 1 auto; min-height: 44px; padding: .3rem .6rem; } body.portrait .var-row .setup-btn { margin-left: 0; }
body.portrait :is(.screen-stages, .screen-real, .screen-realabout) :is(.cards, .spr-cards, .lock-cards) { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; margin-top: 1rem; padding: .4rem; }
body.portrait :is(.screen-stages, .screen-real, .screen-realabout) .thumb { aspect-ratio: 3 / 1; }
body.portrait .cstats small { margin-bottom: .3rem; } body.portrait .ccountry { margin-top: .5rem; }
body.portrait .cwrap { gap: .5rem; } body.portrait .cwrap > .rank-btn { min-height: 44px; }
body.portrait .ctl { min-width: 0; flex-basis: 100%; }
body.portrait .ctl-row { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .7rem 0; }
body.portrait .ctl-row kbd { max-width: 100%; text-align: left; }
body.is-mobile .thumb img { object-fit: cover; object-position: 50% 62%; }   /* a lower thumbnail crops the picture instead of squeezing it */
body.portrait .ctl-row kbd { box-sizing: border-box; overflow: hidden; }
body.is-mobile .car-cards .thumb img { object-position: 50% 45%; }   /* keep the roof */
body.portrait .ctl-row > * { max-width: 100%; }

/* ---- status bar / notch / home indicator (home-screen app and Capacitor draw under them: viewport-fit=cover) ----
 * The navigation bar grows by the top inset, so its buttons start below the status bar and what scrolls under the bar
 * is covered up to the very top; screens without a bar get the inset as padding. */
.screen.has-nav > .row-foot.nav-top { border-top: var(--tsafe-t) solid transparent; }
.screen.has-nav { scroll-padding-top: 6rem; }   /* keys / pad scrolling up stop a focused row below the sticky nav bar, not under it */
.screen:not(.has-nav) { padding-top: calc(var(--st) + var(--tsafe-t)); }
.screen::after { content: ""; flex: none; height: var(--tsafe-b); }
body.phone-land .screen-main .logo { top: calc(3vh + var(--tsafe-t)); }
body.is-mobile .set-group { scroll-margin-top: calc(4.5rem + var(--tsafe-t)); }
body.is-mobile .row-foot.nav-top { background: #0c0c0c; }   /* opaque: nothing shows through the bar or under the status bar */

/* ---- first visit (js/game/intro.js): main-menu button, guide box in the HUD, hand-off screen */
.btn.intro { background-color: #1f7a2e; background-blend-mode: multiply; border-color: #9dff9d #0b3d14 #0b3d14 #9dff9d; }
.btn.intro small.intro-sub { display: block; font-size: .8rem; font-weight: 600; margin-top: .35rem; color: #e6ffe0; }
:where(body.ui-tight) .menu-col .btn.big.intro { padding: .4rem 1.4rem; } :where(body.ui-tight) .btn.intro small.intro-sub { margin-top: .2rem; }
.coach { position: absolute; left: 50%; bottom: 3.6rem; transform: translateX(-50%);   /* low, under the car: the road ahead stays clear (above .hud-hint) */
  display: none; text-align: center; padding: .5rem 1.1rem .55rem;
  background: rgba(0, 0, 0, .78); border: 3px solid #000; border-bottom: .4rem solid var(--yellow); pointer-events: none; max-width: 92vw; }
.coach.show { display: block; }
.coach-1 { margin-bottom: .35rem; }
.coach canvas { max-width: 100%; height: auto; }
body.phone-land .coach { bottom: calc(var(--tsafe-b, 0px) + 30px); padding: .3rem .7rem .35rem; transform: translateX(-50%) scale(.8); transform-origin: bottom center; }
.coach-on { animation: coach-blink .9s steps(2, jump-none) infinite; outline: 4px solid var(--yellow); outline-offset: 2px; }
@keyframes coach-blink { from { outline-color: var(--yellow); } to { outline-color: transparent; } }
.menu-col.first-visit .medal-tally.empty { display: none; }   /* nothing to show yet, and the intro button takes its room */
body.phone-land .menu-col .btn.intro small { font-size: .8rem; margin-top: .1rem; overflow: hidden; white-space: nowrap; max-width: 100%; box-sizing: border-box; }
body.phone-land .menu-col .btn.intro small canvas { max-width: 100%; }
.intro-done { max-width: 64rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; box-sizing: border-box; }
.intro-done > * { min-width: 0; }
.intro-done .intro-txt { margin: .8rem 0; line-height: 1.5; }
.intro-next { display: flex; flex-direction: column; gap: .6rem; }
body.phone-land .intro-done { gap: .8rem; padding: .6rem; } body.phone-land .intro-done .intro-txt { margin: .4rem 0; font-size: .85rem; }
body.phone-land .intro-next .btn.big { min-height: 38px; font-size: 1.1rem; padding: .25rem .6rem; }
.intro-aid { border-top: 3px solid #000; padding-top: .8rem; }
.intro-aid small { display: block; margin-bottom: .5rem; opacity: .85; }
.intro-aid .intro-blurb { font-size: .85rem; opacity: .85; margin: .5rem 0 0; }
/* settings > audio: the co-driver voice test and what the speech engine answered */
.set-group .btn.cd-test { margin: .5rem 0 .3rem; font-size: 1rem; padding: .5rem 1rem; } body.is-mobile .set-group .btn.cd-test { width: 100%; }
.cd-test-out { color: #ffe9b0; font-size: 1rem; min-height: 1.4rem; margin-bottom: .4rem; min-width: 0; } .cd-test-out:empty { display: none; }
/* ---- desktop: pixel text does not shrink with the rem (a glyph pixel is a whole number of screen pixels), so boxes that
   hold a fixed line of text take their minimum width in px as well ---- */
body:not(.is-mobile) .menu-col { width: max(30rem, 480px); gap: .9rem; }
body:not(.is-mobile) .menu-col .quick-row .btn { padding-left: .25rem; padding-right: .25rem; }
body:not(.is-mobile) :is(.screen-stages, .screen-real, .screen-realabout) :is(.cards, .spr-cards, .lock-cards) { grid-template-columns: repeat(auto-fill, minmax(max(19rem, 304px), 1fr)); }
body:not(.is-mobile) :is(.screen-stages, .screen-real, .screen-realabout) .cbody { padding-left: .6rem; padding-right: .6rem; }
body:not(.is-mobile) :is(.screen-stages, .screen-real, .screen-realabout) .cstats { gap: .35rem; }

/* ---- garage: the car in 3D beside the car screen (js/game/menu.js _garage, js/game/game.js setGarage) ---- */
.car-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; }
.car-cards .cbody { padding: 1rem .6rem .7rem; } .car-cards .cname { font-size: 1rem; line-height: 1.15; }
.car-cards .card.locked .thumb img { filter: grayscale(1) brightness(.55); }
.car-cards .card.locked .cname { color: #b9b0a0; }
.thumb .tag.lock { background: #5a5a5a; }
.thumb .tag.special { background: var(--yellow); color: #3a2a00; }   /* the special stage of REAL ROADS */
.thumb .tag.ev { top: auto; left: auto; right: .6rem; bottom: .5rem; } body.is-mobile .car-cards .thumb .tag.ev { top: auto; left: auto; right: .3rem; bottom: .3rem; }   /* the car of the running event: bottom right, so the SELECTED / LOCKED tag (top left) never meets it on a narrow card */
.clock { margin-top: .35rem; font-size: .8rem; color: var(--yellow); }
.car-sel { display: block; max-width: 76rem; margin-top: 1rem; padding: .8rem 1rem; background: rgba(0, 0, 0, .55); border: 3px solid #000; border-left: .6rem solid #3ddc5c; }
.car-sel b { display: block; color: #fff; } .car-sel p { margin: .5rem 0 0; color: #f1e6d2; }
/* the first session (js/game/eras.js): the first car, a new era, the end of the activation */
.head h2 .era-plate { font-size: .55em; vertical-align: middle; margin-left: .4rem; }
.car-cards .cclass .era-plate { font-size: .7rem; } .car-cards .cclass { margin-top: .45rem; }
.era-cards { max-width: 40rem; }
.car-era { max-width: 76rem; margin-top: .9rem; } .car-era:first-child { margin-top: 0; }
.car-era h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .45rem; font-size: .9rem; color: #e0cdb0; }
.car-era .car-cards { margin-top: 0; }
.screen-carpick .car-sel { margin-top: .8rem; } .screen-carpick .car-sel .statbars { margin-top: .5rem; }
.era-rank { margin-top: .7rem; color: var(--yellow); }
.act-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-top: 1rem; max-width: 64rem; } .act-row > .panel { width: auto; min-width: 0; margin: 0; }
.act-info { flex: 1.2 1 20rem; } .act-info p { margin: .2rem 0 .7rem; color: #f1e6d2; line-height: 1.6; } .act-info .era-rank { margin-top: 0; } .act-info p > span:first-child { display: block; }   /* the sentence wraps on its own line, the plate under it */
.era-chapter { flex: 1 1 18rem; } .era-chapter h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; }
.ch-row { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; color: #d0d0d0; }
.ch-row i { flex: none; width: .9rem; height: .9rem; border: 3px solid #9c9c9c; }
.ch-row.cur { color: #fff; } .ch-row.cur i { border-color: #fff; }
.ch-row.done i { background: #3ddc5c; border-color: #000; box-shadow: inset 0 0 0 2px #1f5a16; } .ch-row.done span { color: #9fe3a8; }
.ch-row em { margin-left: auto; font-style: normal; color: var(--yellow); font-size: .8rem; }
.ch-xp { margin-top: .7rem; } .ch-xp.ok small { color: #9fe3a8; } .ch-xp small { display: block; color: #d0d0d0; font-size: .8rem; margin-bottom: .3rem; }
.era-chapter .era-strip { margin-top: .8rem; max-width: 100%; }
body.phone-land .act-row { margin-top: .5rem; gap: .6rem; } body.phone-land .screen-carpick .row-foot { flex-wrap: nowrap; } body.phone-land .era-chapter .era-strip, body.phone-land .screen-carpick .era-strip { margin-top: .4rem; }
body.phone-land .screen-carpick .car-sel { margin-top: .5rem; padding: .5rem .7rem; } body.phone-land .screen-carpick .car-sel .statbars { margin-top: .3rem; }
/* the class plate and the era strip (js/game/eras.js plate, strip): the era colour is the one new graphic element, pixel-hard */
.era-plate { display: inline-block; padding: .15rem .45rem; background: var(--era); color: #fff; border: 2px solid #000; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); text-transform: uppercase; font-size: .8em; line-height: 1.2; white-space: nowrap; }
.era-strip { display: flex; align-items: center; gap: .35rem; margin-top: .8rem; padding: .4rem .6rem; background: rgba(0, 0, 0, .55); border: 3px solid #000; color: #fff; cursor: pointer; font: inherit; max-width: 34rem; }
.era-strip .es-lab { margin-right: .4rem; font-size: .85rem; white-space: nowrap; }
.era-strip { box-sizing: border-box; } .era-strip i { flex: 0 1 1.7rem; min-width: .6rem; height: .8rem; background: var(--era); border: 2px solid #000; }
.era-strip i.cur { border-color: #fff; } .era-strip i.far { opacity: .4; }
.era-strip .es-map { margin-left: auto; padding-left: .6rem; color: var(--yellow); font-size: .85rem; white-space: nowrap; }
.era-strip:hover, .era-strip.focus { outline: 3px solid #fff; }
/* ---- era map (js/game/eramap.js) ---- */
.screen-eramap > * { flex-shrink: 0; }
.em-top { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem 2rem; flex-wrap: wrap; }
.em-title h2 { margin: 0; font: 900 2.2rem/1 var(--font); color: #fff; } .em-title p { margin: .5rem 0 0; color: #e0cdb0; font-size: .9rem; }
.em-lic { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; } .em-lic > * { min-width: 0; max-width: 100%; } .em-lic b { color: var(--yellow); font-size: 1.6rem; } .em-lic small { color: #e0cdb0; font-size: .85rem; }
.em-box { margin-top: .6rem; overflow-x: auto; overflow-y: hidden; padding: 2.4rem .8rem 5.8rem; }   /* room for the NOW tab above and the gate signs under the road */
.em-inner { min-width: 55rem; }
.em-stops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.em-stop { --era: #888; position: relative; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.em-stop.cur { outline: 4px solid var(--yellow); outline-offset: 5px; } .em-stop.next { opacity: .72; } .em-stop.far { opacity: .42; filter: grayscale(1); }
.em-tab { position: absolute; left: 50%; top: -2.45rem; transform: translateX(-50%); padding: .15rem .6rem; background: #111; color: var(--yellow); border: 3px solid var(--yellow); font-size: .9rem; white-space: nowrap; z-index: 1; }
/* a finished era: a green box with a pixel check (3 px cells drawn by box-shadow) */
.em-done { position: absolute; right: -11px; top: -11px; width: 27px; height: 27px; background: #2fb84a; border: 3px solid #000; box-sizing: border-box; z-index: 1; }
.em-done i { position: absolute; left: 3px; top: 9px; width: 3px; height: 3px; background: #fff; box-shadow: 0 3px #fff, 3px 3px #fff, 3px 6px #fff, 6px 6px #fff, 6px 9px #fff, 9px 3px #fff, 9px 6px #fff, 12px 0 #fff, 12px 3px #fff, 15px -3px #fff, 15px 0 #fff; }
.em-plate { min-height: 3.6rem; box-sizing: border-box; display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; background: var(--era); border: 3px solid #000; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); color: #fff; }
.em-plate b { font-size: 2.2rem; line-height: 1; } .em-plate > span { display: flex; flex-direction: column; gap: .3rem; min-width: 0; } .em-plate em { font-style: normal; font-size: 1rem; line-height: 1.3; } .em-plate small { font-size: .8rem; line-height: 1.3; opacity: .92; }
.em-car { position: relative; background: rgba(0, 0, 0, .5); border: 3px solid #000; margin-top: -.6rem; border-top: 0; padding: 1rem 0 .8rem; display: flex; justify-content: center; }
.em-car img { width: 9.5rem; max-width: 80%; height: auto; image-rendering: pixelated; display: block; }
.em-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .2rem .6rem; background: #0b0b0b; border: 3px solid var(--yellow); color: var(--yellow); }
.em-pace { display: flex; gap: 3px; } .em-pace i { flex: 1; height: .7rem; border: 2px solid #000; background: #222; } .em-pace i.on { background: var(--era); }
.em-opens { display: flex; align-items: center; gap: .4rem; min-height: 1.4rem; }
.em-flag { display: block; width: 1.7rem; height: 1.15rem; border: 2px solid #000; box-sizing: border-box; background: var(--a); box-shadow: inset 0 -.38rem 0 var(--b); }   /* two stripes, hard edges */
.em-modes { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.em-cal { display: block; position: relative; width: 1.3rem; height: 1.3rem; border: 2px solid #fff; box-sizing: border-box; background: rgba(255, 255, 255, .85); box-shadow: inset 0 .32rem 0 #ff5555; }
.em-cup { display: block; position: relative; width: 1.4rem; height: 1.4rem; } .em-cup u { position: absolute; left: .15rem; top: 0; width: 1.1rem; height: .75rem; background: var(--yellow); } .em-cup s { position: absolute; left: .55rem; top: .75rem; width: .3rem; height: .35rem; background: var(--yellow); } .em-cup b { position: absolute; left: .3rem; top: 1.1rem; width: .8rem; height: .3rem; background: var(--yellow-d); }
.em-dots { display: grid; grid-template-columns: repeat(5, .9rem); gap: 3px; } .em-dots i { width: .9rem; height: .9rem; border: 2px solid #000; box-sizing: border-box; background: #2a2a2a; } .em-dots i.on { background: var(--yellow); }
/* the road: asphalt with grass verges, the dashed centre line; the driven stretch painted over it in the era colours */
.em-way { position: relative; height: 3.6rem; margin-top: 5.6rem; background: #4a4a4a; border-block: 4px solid #2a2a2a; box-shadow: 0 -8px 0 #3f7a2c, 0 8px 0 #3f7a2c; }
.em-way::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; margin-top: -2px; border-top: 4px dashed rgba(255, 210, 60, .55); }
.em-seg { position: absolute; top: 50%; height: .8rem; margin-top: -.4rem; background: var(--era); border-block: 3px solid #000; box-sizing: border-box; }
.em-knob { position: absolute; top: 50%; width: 1.5rem; height: 1.5rem; transform: translate(-50%, -50%); background: #2a2a2a; border: 3px solid #000; box-sizing: border-box; z-index: 1; } .em-knob.on { background: var(--era); }
/* a gate between two eras: a barrier across the road, the sign under the road says what the next licence needs */
.em-bar { position: absolute; top: -4px; bottom: -4px; width: 8px; margin-left: -4px; background: #d8d8d8; border: 2px solid #000; box-sizing: border-box; box-shadow: inset 0 .7rem 0 #c0392b, inset 0 -.7rem 0 #c0392b; z-index: 1; }
.em-bar.cur { background: var(--yellow); } .em-bar.done { background: #2fb84a; box-shadow: none; }
.em-gate { position: absolute; top: calc(100% + 16px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .2rem .45rem; background: #1b1b1b; border: 3px solid #6a6a6a; color: #cfcfcf; white-space: nowrap; }
.em-gate b { color: #fff; font-size: .85rem; } .em-gate small { font-size: .75rem; }
.em-gate.cur { border-color: var(--yellow); color: var(--yellow); } .em-gate.cur b { color: var(--yellow); }
.em-gate .ok { color: #9fe3a8; } .em-gate.done { border-color: #2fb84a; color: #9fe3a8; } .em-gate.done b { color: #9fe3a8; }
/* XP held back by the licence 2 gate: a dashed stretch past the barrier and a tag where the car will stand */
.em-bank { position: absolute; top: 50%; height: .8rem; margin-top: -.4rem; border: 3px dashed var(--yellow); box-sizing: border-box; background: rgba(255, 210, 60, .2); }
.em-banktag { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); padding: .1rem .4rem; background: #111; color: var(--yellow); border: 3px dashed var(--yellow); font-size: .8rem; white-space: nowrap; }
.em-banktag::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -2px; width: 4px; height: calc(8px + 1.8rem); background: var(--yellow); opacity: .6; }
/* the finish at the last stop: a checkered flag on a pole, LEGEND under it */
.em-finish { position: absolute; bottom: calc(100% + 12px); right: .4rem; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; z-index: 2; }
.em-chk { position: relative; display: block; width: 6px; height: 6px; margin: 0 21px 1.2rem 0; background: #111; box-shadow: 6px 0 #fff, 12px 0 #111, 18px 0 #fff, 0 6px #fff, 6px 6px #111, 12px 6px #fff, 18px 6px #111, 0 12px #111, 6px 12px #fff, 12px 12px #111, 18px 12px #fff; }
.em-chk::before { content: ""; position: absolute; left: -3px; top: 0; width: 3px; height: 2.4rem; background: #d8d8d8; }
.em-finish b { padding: .1rem .4rem; background: #111; color: var(--yellow); border: 3px solid var(--yellow); font-size: .75rem; }
/* you: your own car on the road, a yellow bubble with YOU and the nick above it (it bobs by one step) */
.em-me { --em-half: 4.6rem; position: absolute; bottom: 14%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 3; pointer-events: none; }
.em-me.top { transform: translateX(-85%); } .em-way.top .em-finish { display: none; }   /* the Legend licence held: the car stands at the finish */
.em-me img { width: 9rem; max-width: none; height: auto; margin-top: -.5rem; image-rendering: pixelated; display: block; }   /* the bare thumbnail's empty sky rows tucked under the pointer */
.em-bub { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .25rem .6rem; background: #111; color: var(--yellow); border: 3px solid var(--yellow); box-shadow: 4px 4px 0 rgba(0, 0, 0, .55); white-space: nowrap; animation: em-bob 1.2s steps(1) infinite; }
.em-bub b { font-size: 1.15rem; color: var(--yellow); } .em-bub small { font-size: .7rem; color: #fff; }
.em-ptr { display: block; width: 4px; height: 4px; margin: 9px 0 0; background: var(--yellow); box-shadow: -4px -4px var(--yellow), 0 -4px var(--yellow), 4px -4px var(--yellow), -8px -8px var(--yellow), -4px -8px var(--yellow), 0 -8px var(--yellow), 4px -8px var(--yellow), 8px -8px var(--yellow); animation: em-bob 1.2s steps(1) infinite; }
@keyframes em-bob { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .em-bub, .em-ptr { animation: none; } }
.em-key { display: flex; align-items: center; gap: .4rem; } .em-key i { width: .9rem; height: .9rem; border: 2px solid #000; box-sizing: border-box; background: var(--yellow); }
.em-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; margin: .2rem 0 0; color: var(--dim); font-size: .85rem; } .em-legend b { color: var(--yellow); }
/* a phone held sideways: the same road, tighter; the box scrolls sideways when the five stops do not fit */
/* a phone, held either way (and any narrow window): the era map and the account block tighter, laid out by the width */
@media (max-width: 960px), (max-height: 520px) {
  .em-title h2 { font-size: 1.4rem; } .em-title p { display: none; } .em-box { margin-top: .2rem; padding-top: 2rem; }
  .em-inner { min-width: 42rem; } .em-stops { gap: 14px; } .em-stop { gap: .35rem; }
  .em-plate { min-height: 3.2rem; padding: .25rem .4rem; gap: .5rem; } .em-plate b { font-size: 1.5rem; } .em-plate small { display: none; }
  .em-car { padding: .4rem 0; } .em-car img { width: 5.5rem; } .em-dots { grid-template-columns: repeat(8, .65rem); gap: 2px; } .em-dots i { width: .65rem; height: .65rem; }
  .em-tab { top: -1.9rem; font-size: .65rem; } .em-lock { padding: .1rem .4rem; }
  .em-way { height: 3rem; margin-top: 8.4rem; } .em-me { --em-half: 5.6rem; } .em-me img { width: 11rem; margin-top: -1.4rem; }   /* the player's car big enough to read as a car */ .em-bub { padding: .15rem .45rem; } .em-bub b { font-size: .85rem; } .em-bub small { font-size: .6rem; } .em-bar { box-shadow: inset 0 .5rem 0 #c0392b, inset 0 -.5rem 0 #c0392b; } .em-finish b { font-size: .6rem; }
  .em-gate { top: calc(100% + 10px); padding: 2px 5px; gap: 2px; } .em-gate.done small { display: none; }
  .em-lic b { font-size: 1.2rem; } .em-lic small { font-size: .7rem; } .em-legend { margin-top: 0; font-size: .7rem; } .em-box { padding-bottom: 7.2rem; } .em-dots, .em-key { display: none; } .em-bub { flex-direction: row; gap: .5rem; align-items: baseline; } .em-top { align-items: center; }
  .lic-acc.cta { padding: .5rem .7rem; gap: .6rem .7rem; }
}
/* a phone held upright: the five stops keep a readable width, the road scrolls sideways (to the player's car) */
@media (max-width: 600px) {
  .em-inner { min-width: 66rem; } .acc-disk { width: 2.2rem; height: 2.2rem; }
}
/* ---- surface setups (js/game/setup.js, garage) ---- */
/* the garage tabs (menu.js _cars): one pane shown at a time */
.gar-tabs { display: flex; gap: .45rem; max-width: 76rem; margin: .8rem 0 .2rem; } .gar-tabs .gar-tab { flex: 1 1 auto; }   /* five tabs: each as wide as its word, the rest shared */
.gar-tab { appearance: none; cursor: pointer; font: inherit; font-weight: 800; color: #e6dccb; min-width: 0; height: 2.6rem; padding: 0 .3rem; background: #7c7c7c var(--tex-stone); background-size: 64px 64px; image-rendering: pixelated; border: 3px solid; border-color: #d8d8d8 #3a3a3a #3a3a3a #d8d8d8; }   /* the stone of .btn */
.gar-tab.sel { background-color: #4caf3a; background-image: var(--tex-planks); background-blend-mode: multiply; border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; color: #fff; }   /* the planks of .btn.primary */
.gar-tab:hover, .gar-tab.focus { outline: 3px solid #fff; }
body.touch-land .gar-tab, body.is-mobile .gar-tab { height: max(2.6rem, 46px); }
.gar-pane { display: none; } .gar-pane.on { display: block; }
.gar-pane > .settings:first-child, .gar-pane > .car-sel + .settings { margin-top: .8rem; }
.gar-car .car-sel + .car-eras { margin-top: 1.2rem; }   /* the era heading kept clear of the car block above */
body:is(.phone-land, .portrait) .gar-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.set-tabs { display: flex; gap: .4rem; margin-bottom: .4rem; }
.set-tab { flex: 1; position: relative; appearance: none; height: 2.3rem; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; background: #141414; color: #bdbdbd; font-weight: 800; cursor: pointer; padding: 0 .3rem; }
.set-tab.sel { background: #3d6fe0; border-color: #fff #1a3a8a #1a3a8a #fff; color: #fff; }
.set-tab:hover, .set-tab.focus { outline: 3px solid #fff; }
.set-tab .dot { display: none; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; background: var(--yellow); border: 2px solid #000; }
.set-tab.changed .dot { display: block; }
.setup-panel .set-surf-note { margin: 0 0 .5rem; font-size: .8rem; opacity: .75; }
body.touch-land .set-tab, body.is-mobile .set-tab { height: max(2.3rem, 46px); }
/* ---- class rankings (menu.js _ranking, results) ---- */
.rk-tabs { max-width: 54rem; margin-top: .8rem; }
/* the ranking is of real players: a square green lamp + ONLINE + one line, above the class tabs */
.rk-live { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; max-width: 72rem; margin-top: .6rem; font-size: .9rem; color: #e0e0e0; }
.rk-live i { width: .6rem; height: .6rem; margin-right: .45rem; background: #55ff55; box-shadow: 0 0 0 3px #000; }
.rk-live b { color: #55ff55; margin-right: .6rem; }
.rk-lab { color: var(--dim); font-size: .85rem; margin-bottom: .3rem; }
.rk-row { display: flex; gap: .4rem; }
.rk-tab { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .35rem .2rem .3rem; background: rgba(0, 0, 0, .45); border: 3px solid #000; color: #fff; font: inherit; cursor: pointer; flex: 1 1 auto; justify-content: center; }
.rk-tab .era-plate, .wn-era .era-plate { font-size: .62em; padding: .15rem .3rem; }
.rk-tab .rk-pl { font-size: 1rem; color: var(--dim); min-height: 1.2em; } .rk-tab .rk-pl.on { color: var(--yellow); }
.rk-tab.sel { border-color: #fff; background: rgba(0, 0, 0, .7); } .rk-tab:not(.sel) .era-plate { opacity: .75; }
.rk-tab:hover, .rk-tab.focus { outline: 3px solid #fff; outline-offset: 0; }
.rank-rule { margin: .2rem 0 .5rem; font-size: .95rem; color: #f1e6d2; }
/* ---- what's new in the eras (js/game/whatsnew.js) ---- */
.wn-eras { display: grid; grid-template-columns: repeat(5, minmax(max-content, 1fr)); gap: .5rem; max-width: 54rem; margin-top: 1rem; }
.wn-era { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; padding: .5rem .35rem; background: rgba(0, 0, 0, .5); border: 3px solid #000; border-top: 6px solid var(--era, #000); text-align: center; }
.wn-era .era-plate { align-self: center; max-width: 100%; }
.wn-era ul { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.5; } .wn-era li.dim, .wn-era.none { opacity: .45; }
.wn-places { max-width: 54rem; margin-top: 1rem; }
.wn-row { display: grid; grid-template-columns: minmax(0, 1fr) 11rem 6rem; align-items: center; gap: .6rem; padding: .22rem .4rem; font-size: 1.1rem; }
.wn-row b { text-align: right; } .wn-row .era-plate { font-size: .75em; justify-self: start; }
@media (max-height: 520px) { .rk-tab { padding: .2rem .1rem; } .wn-eras { margin-top: .5rem; } .wn-era ul { font-size: .85rem; line-height: 2.1; } .wn-places { margin-top: .5rem; } .wn-row { font-size: .95rem; } }
.statbars { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: .35rem .8rem; margin-top: .8rem; }
.sb-row { display: contents; }
.sb-row small { color: #e0cdb0; font-size: .85rem; }
.sb-shine { grid-column: 1 / -1; margin-top: .3rem; color: #f1e6d2; font-size: .85rem; } .sb-shine small { color: #e0cdb0; margin-right: .4rem; }
.sb-cells { display: grid; grid-template-columns: repeat(10, minmax(0, 1.5rem)); gap: 3px; }
.sb-cells i { display: block; height: .85rem; background: #2a2a2a; border: 2px solid #000; }
.sb-cells i.on { background: var(--yellow); } .sb-cells i.on.up { background: #3ddc5c; } .sb-cells i.down { background: #7a2a22; }
.parts-panel .set-hint { display: block; font-size: .8rem; margin-top: .3rem; color: #ffe9b0; }
/* parts as tiles (menu.js _partsPanel, _looksRows; icons js/game/rewardicons.js, 24 x 16 native: whole pixels only) */
.rw-ic { display: block; width: 64px; height: 40px; image-rendering: pixelated; flex: none; }   /* 32 x 20 native (js/game/rewardicons.js): x2 */
.rw-ic.lg { width: 96px; height: 60px; } .rw-ic.xl { width: 128px; height: 80px; } .rw-ic.dim { opacity: .5; filter: grayscale(1); }
.pt-opt .rw-ic { width: 96px; height: 60px; max-width: 100%; }   /* x3 where the tile has the room (the garage tab) */
body:is(.phone-land, .portrait) .pt-opt .rw-ic { width: 64px; height: 40px; }
.md-pt .rw-ic { width: 100%; max-width: 64px; height: auto; }
.set-row.pt-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.pt-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.pt-opt { appearance: none; cursor: pointer; font: inherit; color: #fff; position: relative; min-width: 0; padding: .45rem .25rem .35rem; background: #3a3a3a; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.pt-opt .ln { width: 100%; font-size: .75rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.pt-opt.sel { background: #2f5a22; border-color: #8fe06a; }
.pt-opt.locked .rw-ic, .pt-opt.locked .ln { opacity: .4; filter: grayscale(1); }
.pt-opt .lk { position: absolute; top: .15rem; right: .2rem; display: flex; align-items: center; gap: .1rem; font-size: .8rem; font-weight: 700; color: #fff; }
.pt-opt .lk .medal-ic { width: 11px; height: 12px; margin: 0; }
.pt-opt.focus, .pt-opt:hover { border-color: #fff; }
.pt-tyres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.pt-tyre { appearance: none; cursor: pointer; font: inherit; color: #fff; min-width: 0; padding: .35rem .25rem; background: #3a3a3a; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.pt-tyre small { font-size: .75rem; color: var(--yellow); } .pt-tyre .ln { width: 100%; font-size: .75rem; text-align: center; }
.pt-tyre .pt-ty { display: flex; align-items: center; gap: .4rem; } .pt-tyre .pt-ty i { font-style: normal; font-size: 1.1rem; }
.pt-tyre.sel { border-color: var(--yellow); }
body:is(.phone-land, .portrait) .pt-opt .ln { display: none; }   /* phones: icons only, the name and what it does in the detail line under the rows */
.pt-tlock { display: block; margin-top: .35rem; font-size: .75rem; color: #ff9d8a; }
.pt-detail { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; padding: .5rem .7rem; background: rgba(0, 0, 0, .35); border: 3px solid #000; min-height: 3.6rem; }
.pt-dt { display: flex; flex-direction: column; gap: .25rem; min-width: 0; } .pt-dt b { font-size: .95rem; } .pt-dt small { font-size: .8rem; color: #e6dccb; }
.pt-fx { display: flex; flex-wrap: wrap; gap: .35rem; }
.pt-fx em { font-style: normal; font-size: .75rem; padding: .1rem .4rem; background: #222; border: 2px solid #000; }
.pt-fx em.up { color: #8fe06a; } .pt-fx em.dn { color: #f0a050; }
.pt-looks { margin-top: .6rem; font-size: .85rem; }
/* results: the part a run opened (menu.js _newPartCard) */
.res-part { border-left: 8px solid var(--yellow); display: flex; flex-direction: column; gap: .6rem; }
.res-part .rp-top { display: flex; align-items: baseline; gap: .7rem; } .res-part .rp-top b { color: var(--yellow); font-size: 1.1rem; } .res-part .rp-top small { color: #ddd; }
.res-part .rp-body { display: flex; align-items: center; gap: 1rem; }
.res-part .rp-body .rw-ic { background: #3a3a3a; border: 3px solid #000; padding: 4px; box-sizing: content-box; }
.res-part .rp-dt { display: flex; flex-direction: column; gap: .3rem; min-width: 0; } .res-part .rp-dt b { font-size: 1.2rem; } .res-part .rp-dt small { color: #ddd; }
.res-part .rp-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.res-part .rp-next { display: flex; align-items: center; gap: .6rem; padding-top: .5rem; border-top: 2px solid #000; }
.res-part .rp-next small { color: #ccc; } .res-part .rp-next span { flex: 1; min-width: 0; } .res-part .rp-next b { color: var(--yellow); }
body.portrait .res-part .rp-next { flex-wrap: wrap; } body.portrait .res-part .rp-next b { flex: 1 1 100%; }   /* a phone held upright: "in 2 medals" goes under the part instead of past the screen edge */
.parts-foot { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.garage-stage { display: none; }
body.garage-on .screen-cars { right: auto; width: var(--garage-w, 52vw); --sr: 2vw; --sl: 3vw; }
body.garage-on .garage-stage { display: flex; align-items: flex-end; justify-content: center; position: absolute; top: 0; bottom: 0; right: 0; left: var(--garage-w, 52vw); padding-bottom: 3vh; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
body.garage-on .garage-stage.drag { cursor: grabbing; }
.garage-stage span { padding: .3rem .7rem; color: #fff; background: rgba(0, 0, 0, .55); border: 3px solid #000; font-size: .9rem; pointer-events: none; }
body.garage-on .car-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.garage-on.garage-tall .screen-cars { width: auto; right: 0; top: var(--garage-top, 34vh); }
body.garage-on.garage-tall .garage-stage { left: 0; bottom: auto; height: var(--garage-top, 34vh); padding-bottom: 1vh; }
body.phone-land.garage-on .screen-cars { --sl: calc(2vw + var(--tsafe-l)); --sr: 1.5vw; }
body.phone-land.garage-on .garage-stage { padding-right: var(--tsafe-r); }
body.is-mobile .car-cards .clock { font-size: .7rem; }
body.is-mobile .parts-panel .paint-intro.garage-how { display: block; font-size: .9rem; }
.screen-results .res-left .res-garage { border-left: 8px solid var(--yellow); } .res-garage b { color: var(--yellow); } .res-garage .btn { margin-left: auto; }
.btn.big.car-btn { display: flex; align-items: center; justify-content: center; gap: .9rem; padding-top: .3rem; padding-bottom: .3rem; }
.btn.car-btn img { height: 3.4rem; width: auto; image-rendering: pixelated; border: 3px solid #000; flex: none; }
:where(body.ui-tight) .menu-col .btn.big.car-btn, body:not(.phone-land):where(.ui-tight) .menu-col .btn.big.car-btn { padding-top: .3rem; padding-bottom: .3rem; }
:where(body.ui-tight) .btn.car-btn img { height: 2.9rem; }   /* the picture fills the tile (owner: a picture says more than a description) */
:where(body.ui-tight) .menu-col .btn.big.car-btn, body:not(.phone-land):where(.ui-tight) .menu-col .btn.big.car-btn { padding-top: .15rem; padding-bottom: .15rem; }
.menu-pair { display: flex; gap: .6rem; } .menu-pair .btn { flex: 1 1 0; min-width: 0; padding-left: .4rem; padding-right: .4rem; font-size: 1.2rem; }
.screen-results .res-left .res-garage { display: block; } .res-garage b, .res-garage em { display: block; white-space: normal; } .res-garage em { margin: .3rem 0 .6rem; font-style: normal; }
.res-garage .btn { margin-left: 0; }
body.phone-land .menu-col .menu-pair { gap: .35rem; } body.phone-land .menu-col .menu-pair .btn.big { font-size: .78rem; padding: .25rem .15rem; }
body.portrait .menu-pair .btn { font-size: 1rem; }
.res-garage em + em { margin-top: -.4rem; }
/* ---- photo mode (js/game/photo.js, menu.js _photo): nothing over the scene but a hint line and a row of controls; the screen itself takes the drags */
.screen.screen-photo { padding: 0; background: none; overflow: hidden; touch-action: none; cursor: grab; align-items: center; justify-content: space-between; animation: none; user-select: none; -webkit-user-select: none; }
.photo-hint { margin-top: calc(var(--tsafe-t) + 1rem); padding: 0 1rem; font-size: .95rem; color: #fff; text-align: center; pointer-events: none; min-width: 0; max-width: 100%; }
.screen-photo::before, .screen-photo::after { display: none; }
.photo-bar { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: .5rem; padding: 0 calc(var(--tsafe-r) + .6rem) calc(var(--tsafe-b) + .8rem) calc(var(--tsafe-l) + .6rem); max-width: 100%; cursor: default; }
.photo-bar .btn { font-size: 1rem; padding: .5rem .9rem; }
.photo-bar .photo-adj { height: auto; min-height: 2.6rem; min-width: 13rem; }
.photo-bar .photo-adj.focus { border-color: #fff; }
body.is-mobile .photo-bar .photo-adj { min-width: 0; } body.is-mobile .photo-bar .photo-adj .val { padding: 0 .5rem; }
body[data-screen="photo"] .toasts { bottom: auto; top: calc(var(--tsafe-t) + 3.4rem); }   /* clear of the controls */
/* ---- service between the stages of an event run (js/game/eventrun.js serviceScreen): three repair rows, the time bar */
.screen-service .svc { max-width: 62rem; width: 100%; }
.svc-row .set-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .8rem; }
.svc-dmg { font-style: normal; font-size: 1rem; font-weight: 800; color: var(--green); }
.svc-dmg.d1 { color: var(--yellow); } .svc-dmg.d2 { color: #ff9a3c; } .svc-dmg.d3 { color: var(--red); }
.svc-row .svc-hint { flex-basis: 100%; margin-top: 0; min-width: 0; }
.svc-row.disabled { opacity: .55; cursor: default; } .svc-row .select.off .arr { visibility: hidden; }
.svc-sum { display: grid; gap: .5rem; margin-top: .8rem; padding-top: .8rem; border-top: 3px solid rgba(0, 0, 0, .5); }
.svc-time { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.2rem; font-weight: 800; } .svc-time span { color: var(--dim); }
.svc-bar { position: relative; height: 1rem; background: #141414; border: 3px solid; border-color: #000 #6a6a6a #6a6a6a #000; }
.svc-bar i { display: block; height: 100%; background: var(--green); } .svc-bar u { position: absolute; right: 0; top: 0; height: 100%; background: var(--red); }
/* the next stage beside the repairs (js/game/eventrun.js) */
.svc-grid { display: grid; grid-template-columns: minmax(0, 62rem) minmax(0, 28rem); gap: 1.2rem; align-items: start; }
.svc-grid .svc { max-width: none; }
.svc-next h3 { margin: 0 0 .6rem; } .svc-next .ccountry { color: var(--dim); }
body.phone-land .svc-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .6rem; }
body.portrait .svc-grid { grid-template-columns: minmax(0, 1fr); gap: .8rem; }

/* ---- stage map (js/game/stagemap.js): the course drawn over a stage's picture, its numbers under the facts */
.sp-pic, .load-thumb, .sm-pic { position: relative; }
.sm-route { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; pointer-events: none; }
.sm-route[hidden] { display: none; }
.sm-pic { aspect-ratio: 2 / 1; overflow: hidden; background: #000; border: 3px solid #000; margin-bottom: .6rem; }
.sm-pic img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.sm-stats { margin-top: .5rem; font-size: .85rem; color: var(--dim); line-height: 1.35; }
.sm-stats:empty { display: none; }
.svc-pen { font-size: 1.1rem; font-weight: 800; color: var(--dim); }
body.phone-land .screen-service .svc-sum { position: sticky; bottom: 0; margin: .4rem -.6rem 0; padding: .5rem .6rem; background: #262626; border-top: 3px solid #000; }   /* four rows are taller than a phone: the time bar stays in view */
/* ---- daily rally (js/game/rallyday.js): intro, the panel on the results, the final screen */
.rally-panel h3, .rally-final h3 { color: var(--yellow); }
.rally-brief { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1.2rem; align-items: center; max-width: 70.5rem; margin: 1rem 0 1.2rem; padding: .9rem 1rem; background: rgba(0, 0, 0, .8); border: 3px solid #000; border-left: .5rem solid var(--yellow); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08); }
.rally-brief h3 { grid-column: 1; margin: 0; min-width: 0; color: var(--yellow); font: 900 1.7rem/1.15 var(--font); }
.rally-next { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: .5rem 1rem; background: var(--yellow); border: 3px solid #000; color: #2a1e00; text-align: center; white-space: nowrap; }
.rally-next small { font-size: 1rem; font-weight: 800; } .rally-next b { font: 900 1.8rem var(--font); }
.rally-facts { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.rally-facts b { padding: .4rem .8rem; background: #2c2c2c; border: 3px solid; border-color: #6a6a6a #000 #000 #6a6a6a; color: #fff; font: 900 1.3rem var(--font); white-space: nowrap; }
.rally-brief p { grid-column: 1 / -1; margin: 0; color: #fff; font-size: 1.1rem; font-weight: 800; min-width: 0; }
body.phone-land .rally-brief { margin: .4rem 0 .5rem; padding: .4rem .5rem; gap: .3rem .6rem; } body.phone-land .rally-brief h3 { font-size: 1.3rem; } body.phone-land .rally-facts b { padding: .2rem .5rem; font-size: 1.1rem; } body.phone-land .rally-next { padding: .2rem .6rem; } body.phone-land .rally-next b { font-size: 1.3rem; }
body.portrait .rally-brief { grid-template-columns: minmax(0, 1fr); } body.portrait .rally-next { grid-column: 1; grid-row: auto; }
.rally-note { margin-top: .6rem; font-size: 1.05rem; font-weight: 800; color: var(--dim); min-width: 0; } .rally-note.gold { color: var(--yellow) !important; } .rally-note.bad { color: var(--red); }
.rally-status { margin: .8rem 0 0; color: #fff; }
.rally-legs .rally-chips { color: var(--yellow); font-weight: 800; min-width: 0; }
.rally-board .brow em { text-align: right; color: var(--dim); font-style: normal; }
.rally-foot { margin-top: .5rem; font-size: .95rem; color: var(--dim); }
.rally-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .6rem; }
.rally-total small { flex-basis: 100%; color: var(--dim); font-size: 1rem; font-weight: 800; } .rally-total b { font: 900 2.6rem var(--font); color: var(--yellow); }
.rally-tier { font-style: normal; font: 900 1.3rem var(--font); padding: .2rem .7rem; border: 3px solid #000; background: #6a6a6a; color: #fff; }
.rally-tier.top10 { background: var(--yellow); color: #3a2a00; } .rally-tier.top25 { background: #d0d0d0; color: #222; } .rally-tier.top50 { background: #b8791a; color: #fff; }
.rally-nick { margin-top: .8rem; }
/* ---- the notice (Menu.notice / menu._notice): one framed block for what the player must not miss; kinds warn, bad, good, info */
.notice { --nc: var(--dim); display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .6rem .9rem .6rem .7rem; background: rgba(0, 0, 0, .72); border: 3px solid #000; border-left: .5rem solid var(--nc); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08); color: #fff; font-size: 1.15rem; font-weight: 800; text-align: left; }
.notice.warn { --nc: var(--yellow); } .notice.bad { --nc: var(--red); } .notice.good { --nc: var(--green); }
.notice-ico { flex: none; display: flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; min-width: 26px; min-height: 26px; background: var(--nc); border: 3px solid #000; color: #000; line-height: 0; } .notice-ico canvas { display: block; }
.notice.bad, .notice.good { color: #fff !important; }   /* the global .good / .bad colour the text: here the stripe and the mark carry the kind */
.notice-text { flex: 1; min-width: 0; }
.rally-panel .notice { margin-top: .6rem; }
/* the stage of the day (js/game/daily.js, .day-screen): the brief, the banner and the two panels on one column width, the
   two panels level and of one height; the stage panel speaks the panel's language (dim labels, white values) */
.day-screen :is(.rally-brief, .daily-note, .day-grid) { max-width: none; width: 100%; }   /* the whole width, as the stage select and the other screens */
.day-screen .rally-brief { margin-bottom: .8rem; }
.daily-note .notice { margin: 0 0 1rem; }
.day-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 1.2rem; align-items: stretch; }
.day-stage { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: .9rem; align-content: start; }
.day-stage > h3 { grid-column: 1 / -1; }
.day-stage .sp-pic { align-self: start; aspect-ratio: 4 / 3; overflow: hidden; background: #000; border: 3px solid #000; }
.day-stage .sp-pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; image-rendering: pixelated; }
.day-stage .sp-facts { min-width: 0; } .day-stage .cname { margin-top: 0; } .day-stage .ccountry { color: var(--dim); }
.day-stage .chips { margin: .6rem 0; } .day-stage .chip { font-size: .9rem; padding: .2rem .45rem; } .day-stage .cstats small { color: var(--dim); }
.day-stage.day-legs { display: block; } .day-legs .rally-legs { margin: 0; } .day-legs .rally-nick { margin-top: .8rem; }
.day-screen .day-grid > .panel { margin: 0; }   /* the two panels level at the top */
/* the ranking screen in the same layout: the board is the wide one, the stage the narrow one */
.rk-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); align-items: start; }
.rk-grid .day-stage { grid-template-columns: minmax(0, 1fr); }   /* a narrow column: the picture over the facts */
.rk-grid .day-stage .sp-pic { aspect-ratio: 2 / 1; margin-bottom: .7rem; }
/* the ranking's picture starts the stage (menu.js _ranking): the stage card's focus ring and a green DRIVE badge, top right
   (CHANGED ROAD sits bottom left), above the course drawn later by stagemap.js (.sm-route) */
.sp-pic.sp-go { cursor: pointer; }
.sp-pic.sp-go.focus, .sp-pic.sp-go:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3d6fe0; }
.sp-go .sp-drive { position: absolute; z-index: 1; right: .5rem; top: .5rem; background: #3d9a2e; color: #fff; border: 3px solid #000; padding: .1rem .5rem; font-size: .9rem; }   /* the primary button's green, white text (black on green blurs into its own shadow) */
.sp-go.focus .sp-drive, .sp-go:hover .sp-drive { background: #4fc23c; }
/* phones: a small picture beside the facts, the board right under them */
:is(body.phone-land, body.portrait) .day-stage { grid-template-columns: minmax(0, 28%) minmax(0, 1fr); }
:is(body.phone-land, body.portrait) .day-stage .sp-pic { aspect-ratio: 4 / 3; margin-bottom: 0; }
.rk-panel .rk-live { margin: 0 0 .6rem; } .rk-panel .rk-tabs { margin: 0 0 .4rem; max-width: none; } .rk-panel .lb-full { max-width: none; margin-top: .4rem; }
.rk-panel .lb-hint { padding-left: 0; max-width: none; }
.rk-panel .rk-row { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(5, minmax(0, 1fr)); gap: .3rem; }
.rk-panel .rk-tab .era-plate { font-size: .55em; max-width: 100%; text-align: center; }
/* phones held upright: six tabs in a row left ~50 px each, the pixel font cannot shrink further and the era names broke letter by
   letter; three a row (ALL + two eras, then three eras), and the stage facts one per line like on a phone held sideways */
body.portrait :is(.rally-board, .rk-panel) .rk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* the ONLINE line in a narrow panel (phones, the ranking's side panel): lamp + ONLINE as a heading, the sentence under them across
   the whole width, instead of four short lines squeezed beside the word */
:is(body.portrait, body.phone-land) .rk-panel .rk-live { grid-template-columns: auto minmax(0, 1fr); row-gap: .35rem; }
:is(body.portrait, body.phone-land) .rk-panel .rk-live span { grid-column: 1 / -1; color: #e0e0e0; }
:is(body.portrait, body.phone-land) .rk-panel .rk-live { margin-bottom: .9rem; }
body.portrait .day-stage .cstats { grid-template-columns: 1fr; gap: .3rem; }
body.portrait .day-stage .cstats > div { display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-width: 0; }
body.portrait .day-stage .cstats small { margin-bottom: 0; } body.portrait .day-stage .cstats b { margin-top: 0; white-space: nowrap; }
body.phone-land .notice { gap: .5rem; padding: .35rem .6rem .35rem .45rem; font-size: 1rem; }
/* stage, name and length on one line, the variant under the name: side by side they ran into each other */
.rally-legs .champ-row { grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: .25rem .8rem; } .rally-legs .champ-row em { display: none; }
.rally-legs .champ-row b { grid-column: 1; grid-row: 1 / span 2; } .rally-legs .champ-row > span:not(.rally-chips) { grid-column: 2; grid-row: 1; min-width: 0; } .rally-legs .champ-row small { grid-column: 3; grid-row: 1; white-space: nowrap; }
.rally-legs .champ-row .rally-chips { grid-column: 2 / -1; grid-row: 2; font-size: 1.05rem; }
body.phone-land .rally-legs .champ-row { grid-template-columns: 3.4rem minmax(0, 1fr) auto; } body.phone-land .rally-legs .champ-row small { display: none; }   /* wide and short: one line */
body.phone-land .rally-legs .champ-row b { grid-row: 1; } body.phone-land .rally-legs .champ-row .rally-chips { grid-column: 3; grid-row: 1; }
body.portrait .rally-legs .champ-row small { display: none; }
.rally-board .brow.lb-empty { display: block; }
/* the class tabs over the boards of the daily screens (menu._classTabs) */
.rally-board > .rk-tabs { margin: 0 0 .5rem; max-width: none; }
.rally-board .rk-row { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(5, minmax(0, 1fr)); gap: .3rem; }   /* one row of six (ALL + five eras); a long era name goes on two lines in its plate */
:is(.rally-board, .rk-panel) .rk-tab { padding-left: .1rem; padding-right: .1rem; }
.rally-board .rk-tab .era-plate { font-size: .55em; max-width: 100%; text-align: center; } .rally-board .rk-tab .rk-pl { font-size: .9rem; }
/* main-menu tile of the daily rally: the stage-of-the-day tile (class .daily) and its tint; one tint for the Today group (UI guidelines) */

/* ---- stage cards: the picture always on top, the numbers always at the bottom, level across a row.
   A card is a <button>, and a button centres what is inside it: shorter cards used to start lower. */
.card { display: flex; flex-direction: column; justify-content: flex-start; } .card > * { width: 100%; }
:is(.screen-stages, .screen-real, .screen-realabout) .cbody { flex: 1 1 auto; display: flex; flex-direction: column; }
:is(.screen-stages, .screen-real, .screen-realabout) .cstats { margin-top: auto; align-items: start; }
:is(.screen-stages, .screen-real, .screen-realabout) .chips { margin-bottom: 1rem; }
.cbest-car { display: block; min-height: .95rem; margin-top: .15rem; font-style: normal; font-size: .8rem; color: #e0cdb0; white-space: nowrap; overflow: hidden; }
.cworld .cw-best, .cworld .cw-you { min-height: 1.05rem; }
.cworld.empty .cw-best, .cworld.empty .cw-you { color: #e0cdb0; }
body.is-mobile .cworld.empty, body.phone-land .cbest-car { display: none; }
/* small screens: the band and the panels of the day screens (daily rally, stage of the day) take the whole width */
:is(body.phone-land, body.portrait) .rally-brief, :is(body.phone-land, body.portrait) .rally-grid .champ-list { max-width: none; width: 100%; }

/* ---- career (js/game/menu.js, intro.js): licence badge, "what next" card, lock tags, lock screen, Licence screen ---- */
.lic-bar { display: block; height: .7rem; background: #151515; border: 3px solid #000; box-sizing: content-box; }
.lic-bar i { display: block; height: 100%; background: var(--yellow); }
button.lic-badge { appearance: none; cursor: pointer; font: inherit; color: #fff; text-align: left; background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: .45rem .8rem; box-sizing: border-box; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; }
.lic-badge b { grid-column: 1; color: var(--yellow); min-width: 0; }
.lic-badge .lic-bar { grid-column: 1 / -1; grid-row: 2; }
.lic-badge em { grid-column: 2; grid-row: 1; font-style: normal; color: var(--dim); }
.lic-badge.none b { color: #ffe9b0; } .lic-badge.none .lic-bar { display: none; }
button.lic-badge.focus, button.lic-badge:hover { background: #1f3f9f; border-color: #fff; }
.btn.next-card { text-align: left; background-color: #1f7a2e; background-blend-mode: multiply; border-color: #9dff9d #0b3d14 #0b3d14 #9dff9d; padding: .6rem 1rem; }
.btn.next-card > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t p" "s g"; gap: .25rem .8rem; align-items: center; }
.btn.next-card.big-card > span { grid-template-areas: "k k" "t p" "s g"; }
.btn.next-card.focus, .btn.next-card:hover { background-color: #3aa64a; border-color: #fff; }   /* the one main action stays green when focused, as .btn.primary does (it takes the first focus: blue hid the green on every menu open, 2026-11-20); the white frame marks the focus */
.nc-kick { grid-area: k; font-size: .8rem; color: #e6ffe0; opacity: .85; }
.nc-title { grid-area: t; font-size: 1.15rem; min-width: 0; }
.nc-sub { grid-area: s; font-size: .8rem; font-weight: 600; color: #e6ffe0; min-width: 0; }
.nc-pts { grid-area: p; font-style: normal; font-size: .9rem; color: var(--yellow); justify-self: end; }
.nc-go { grid-area: g; font-style: normal; font-size: 1.1rem; color: #000; background: var(--yellow); border: 3px solid #000; padding: .2rem .8rem; justify-self: end; align-self: end; }
.btn.next-card.big-card { padding: 1rem 1.2rem; } .big-card .nc-title { font-size: 1.45rem; } .big-card .nc-sub { font-size: .9rem; } .big-card .nc-go { font-size: 1.4rem; padding: .3rem 1.1rem; }
.menu-pair .btn.big small.pair-sub { display: block; font-size: .8rem; margin-top: .2rem; }
.btn.locked { background-color: #4a4a4a; background-blend-mode: multiply; border-color: #9a9a9a #222 #222 #9a9a9a; }
.btn.locked.focus, .btn.locked:hover { background-color: #3d6fe0; border-color: #fff; }
.lock-tag { text-decoration: none; display: inline-block; background: #5a5a5a; border: 2px solid #000; padding: .05rem .4rem; color: #fff; }
.lock-panel { max-width: 46rem; margin: 1rem auto 0; display: flex; flex-direction: column; gap: .8rem; box-sizing: border-box; }
.lock-panel h3 { margin: .2rem 0 0; } .lock-note { margin: 0; line-height: 1.5; opacity: .9; }
.lock-panel .btn.next-card { width: 100%; box-sizing: border-box; }
.lock-panel .lock-lic { align-self: flex-start; }
.lic-stamp { margin: .8rem 0; padding: .5rem .7rem; background: rgba(0, 0, 0, .35); border-left: .5rem solid var(--yellow); display: grid; gap: .4rem; } .lic-stamp b { color: var(--yellow); } .lic-stamp em { font-style: normal; font-size: .85rem; opacity: .85; }
/* account (js/game/account.js): one card, one column; every field and main button at the card's full width */
.acc-card { width: 100%; max-width: 36rem; box-sizing: border-box; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.4rem 1.6rem 1.5rem; }
.acc-card > .btn, .acc-card .acc-pair .btn, .acc-card .acc-methods .btn { width: 100%; box-sizing: border-box; }
.acc-note { display: grid; gap: .5rem; } .acc-note:empty { display: none; } .acc-note .notice { margin: 0; }
.acc-card h3.acc-title { margin: 0; font-size: 1.35rem; }
.acc-lead { margin: 0; font-size: 1.15rem; line-height: 1.45; }
.acc-field { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.acc-label { font: 800 1rem var(--font); color: var(--dim); }
input.select.text.acc-input { height: 3.6rem; padding: 0 1rem; font-size: 1.4rem; text-align: left; letter-spacing: .02em; border-width: 4px; }
input.select.text.acc-input::placeholder { color: #707070; }
input.select.text.acc-code { height: 4.6rem; font-size: 2.4rem; text-align: center; letter-spacing: .6em; padding: 0 0 0 .6em; }
input.select.text.acc-input:disabled { opacity: .45; }
.acc-or { display: flex; align-items: center; gap: .9rem; color: var(--dim); font-weight: 800; }
.acc-or::before, .acc-or::after { content: ''; flex: 1; height: 3px; background: rgba(0, 0, 0, .5); }
.btn.discord-btn.acc-discord, .acc-methods .btn.discord-btn { background: #5865f2; border-color: #aab1ff #2c3290 #2c3290 #aab1ff; color: #fff; }   /* Discord's own colour, flat */
.btn.discord-btn.acc-discord.focus, .btn.discord-btn.acc-discord:hover, .acc-methods .btn.discord-btn.focus, .acc-methods .btn.discord-btn:hover { background: #7480ff; }
.btn.acc-del { background-color: #7a2a22; background-blend-mode: multiply; }
.acc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.acc-pair .btn, .acc-row .btn { font-size: 1.05rem; padding: .7rem .8rem; }
.acc-fine { display: flex; flex-direction: column; gap: .4rem; } .acc-small { margin: 0; font-size: .9rem; line-height: 1.5; opacity: .85; }
.acc-link { align-self: flex-start; color: var(--yellow); font-size: .95rem; }
.acc-head { display: flex; flex-direction: column; gap: .2rem; } .acc-nick { font-size: 1.8rem; color: var(--yellow); overflow-wrap: anywhere; } .acc-sub { color: var(--dim); }
.acc-sec { display: flex; flex-direction: column; gap: .8rem; padding-top: 1rem; border-top: 3px solid rgba(0, 0, 0, .45); }
.acc-sec h3 { margin: 0; }
.acc-inline { display: flex; align-items: flex-end; gap: .8rem; } .acc-inline .acc-field { flex: 1; } .acc-inline .btn { flex: none; height: 3.6rem; box-sizing: border-box; }
.acc-methods { display: flex; flex-direction: column; gap: .6rem; }
.acc-method { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; padding: .55rem .8rem; background: rgba(0, 0, 0, .38); border-left: .5rem solid var(--green); }
.acc-method.discord { border-left-color: #5865f2; } .acc-method.wait, .acc-method.off { border-left-color: #6a6a6a; color: var(--dim); }
.acc-method span { color: var(--dim); overflow-wrap: anywhere; }
.acc-row { display: flex; flex-wrap: wrap; gap: .7rem; } .acc-row .btn { flex: 1 1 10rem; }
.acc-sec .btn.acc-boards { font-size: .95rem; padding: .55rem .8rem; }
/* phones: the card takes the width, the buttons stack where two do not fit */
body.portrait .acc-card, body.phone-land .acc-card { max-width: none; padding: 1rem 1.1rem 1.2rem; gap: .9rem; }
body.portrait .acc-pair { grid-template-columns: 1fr; }
body.portrait .acc-inline { flex-direction: column; align-items: stretch; } body.portrait .acc-inline .btn { width: 100%; }
body.phone-land input.select.text.acc-input, body.portrait input.select.text.acc-input { height: max(3rem, 52px); font-size: max(1.2rem, 18px); }   /* a finger-sized field; 16px+ text keeps iOS from zooming */
body.phone-land input.select.text.acc-code, body.portrait input.select.text.acc-code { height: max(3.6rem, 64px); font-size: max(2rem, 30px); }
body.phone-land .acc-inline .btn { height: max(3rem, 52px); }
.lic-acc { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .7rem; border-top: 2px solid rgba(0, 0, 0, .4); } .lic-acc > span { flex: 1 1 14rem; min-width: 0; }
/* signed in: a green check before the line */
.acc-ok { flex: none; position: relative; width: 24px; height: 24px; background: #2fb84a; border: 3px solid #000; box-sizing: border-box; }
.acc-ok::before { content: ""; position: absolute; left: 1px; top: 7px; width: 3px; height: 3px; background: #fff; box-shadow: 0 3px #fff, 3px 3px #fff, 3px 6px #fff, 6px 6px #fff, 6px 9px #fff, 9px 3px #fff, 9px 6px #fff, 12px 0 #fff, 12px 3px #fff, 15px -3px #fff, 15px 0 #fff; }
/* signed out: one call to action, a floppy, what would be lost, SAVE PROGRESS */
.lic-acc.cta { flex-wrap: wrap; gap: .8rem 1rem; padding: .8rem 1rem; border-top: 3px solid #000; border-left: 8px solid var(--yellow); }   /* as wide as the section it sits in */
.acc-txt { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: .3rem; } .acc-txt > * { display: block; } .acc-txt b { color: var(--yellow); font-size: 1.05rem; } .acc-txt > span { color: #e0cdb0; font-size: .8rem; }
.lic-acc.cta .lic-acc-btn { flex: none; order: 2; margin-left: auto; }   /* a narrow screen: under the text, on the right */
.acc-disk { flex: none; position: relative; width: 2.6rem; height: 2.6rem; background: #2f62c9; border: 3px solid #000; box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .3); }
.acc-disk::before { content: ""; position: absolute; left: 22%; right: 22%; top: 0; height: 32%; background: #c8ccd4; border: 2px solid #000; border-top: 0; }
.acc-disk::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 38%; background: #f4f6fa; border: 2px solid #000; border-bottom: 0; }
/* the menu groups (menu.js _main): progress (licence + tasks), the "what next" card, TODAY (label with the countdown + the daily pair), DRIVE (label + stages / championship), garage, tools */
.menu-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .95rem; color: var(--yellow); text-shadow: 2px 2px 0 #000; margin: .15rem .1rem -.45rem; line-height: 1; }
.menu-sec em { font-style: normal; color: #fff; }
.menu-prog > .lic-badge { flex: 1 1 0; min-width: 0; width: auto; margin: 0; }
.menu-prog > .btn.tasks-btn { flex: 0 0 42%; }
body.phone-land .menu-col .menu-sec { font-size: .8rem; margin: .15rem 0 0; }
body.portrait .menu-sec { margin: .3rem 0 -.2rem; }
:where(body.ui-tight) .menu-col .menu-sec { margin-top: 0; }
.menu-today .btn.big.daily { padding: .5rem .4rem; }
.menu-tools .btn.big { font-size: 1.05rem; padding-left: .3rem; padding-right: .3rem; }
/* phones: the menu column is wide on a landscape phone (58% of the screen, the scene is shifted right in game.js _menuView), the tools row wraps, locked tiles are title + tag */
body.phone-land .menu-col { width: 58vw; max-width: 58vw; }
body.phone-land .menu-tools .btn.discord-btn { position: absolute; right: var(--sr); bottom: 1vh; min-height: 40px; padding: .2rem 1.2rem; flex: none; }
body.phone-land .nc-kick, body.portrait .nc-kick { display: none; }
body.phone-land .btn.next-card > span, body.portrait .btn.next-card > span { grid-template-areas: "t g" "s p"; }
body.phone-land .menu-today .btn.big.daily, body.phone-land .menu-col .menu-pair .btn.big { font-size: .95rem; }
body.phone-land .menu-col .menu-pair .btn.big { padding-left: .1rem; padding-right: .1rem; }
body.phone-land .menu-col .btn.next-card { padding: .4rem .6rem; } body.phone-land .menu-col .btn.next-card > span { gap: .15rem .5rem; }
body.portrait .menu-tools { flex-wrap: wrap; } body.portrait .menu-tools .btn.discord-btn { flex: 1 1 100%; }
body.portrait .menu-tools .btn.big { font-size: 1rem; }
body.portrait .lock-panel, body.phone-land .lock-panel { max-width: none; width: 100%; }
.menu-pair .btn.locked small.lock-need { display: block; margin-top: .35rem; }
.menu-today .btn.locked small.lock-need { margin-top: 0; }   /* the locked daily rally (after 3 sprints) no taller than the daily stage next to it: the phone menu fits without scroll */
body.portrait .intro-done { grid-template-columns: minmax(0, 1fr); }
.lic-stamp { grid-template-columns: minmax(0, 1fr); } .lic-stamp > * { min-width: 0; }

/* ---- career, part 2 (js/game/menu.js _stages / _results): stage select header and sections, locked cards, the XP line, the progress panel ---- */
.st-status { display: flex; gap: .8rem; margin-top: 1rem; align-items: stretch; }
.st-status > .lic-badge.st-lic, .st-status > button.medal-tally { flex: 1 1 0; min-width: 0; width: auto; margin: 0; }
.st-setup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));   /* 3 x 2: how I drive (car, difficulty, rival) over the road's variant (direction, season, conditions) */ gap: .7rem 1rem; align-items: start; margin-top: .8rem; padding: .7rem 1rem .8rem; background: rgba(0, 0, 0, .55); border: 3px solid #000; }
.opt-cell { display: flex; flex-direction: column; gap: .3rem; min-width: 0; } .opt-cell > .btn, .opt-cell > .select { width: 100%; min-width: 0; margin: 0; }
.st-setup .opt-var-lock { grid-column: span 3; } .opt-step.changed .val { color: #ffb27a; }
.opt-step .val { min-width: 0; overflow: hidden; white-space: nowrap; } .opt-step.focus { border-color: #fff; }
.st-setup .opt-lab { color: var(--dim); font-size: .85rem; }
.row-foot.nav-top .st-other { display: flex; flex-wrap: wrap; gap: .8rem; margin-left: auto; }   /* YOUR STAGE + REAL ROADS (lab) on the stage select's bar, right side (menu.js _stages) */
body.phone-land .row-foot.nav-top .st-other { gap: .5rem; } body.portrait .row-foot.nav-top .st-other { flex: 1 1 100%; gap: .6rem; margin-left: 0; } body.portrait .row-foot.nav-top .st-other .btn { flex: 1 1 0; min-width: 0; }
.btn.opt { font-size: 1rem; padding: .45rem .8rem; }
.btn.opt.sel { background-color: #1f7a2e; border-color: #9dff9d #0b3d14 #0b3d14 #9dff9d; }
.btn.opt.sel.focus, .btn.opt.sel:hover { background-color: #3d6fe0; border-color: #fff; }
.st-sec { display: flex; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; margin-top: 1.6rem; padding: .35rem .6rem; background: rgba(0, 0, 0, .5); border-left: .5rem solid #555; text-align: left; color: #fff; font: inherit; }
.st-hidden { margin-top: .8rem; padding: .35rem .6rem; background: rgba(0, 0, 0, .5); color: var(--dim); font-size: .95rem; text-align: left; }   /* the open stages the season / conditions hide, under their cards */
.st-sec h3 { margin: 0; font-size: 1.1rem; } .st-sec em { font-style: normal; color: var(--dim); font-size: .95rem; }
button.st-sec { appearance: none; cursor: pointer; width: 100%; box-sizing: border-box; border-top: 0; border-right: 0; border-bottom: 0; }
button.st-sec.focus, button.st-sec:hover { background: #1f3f9f; border-left-color: #fff; }
.st-sec.has-rand { align-items: center; } .st-sec .btn.st-rand, .st-sec .btn.st-reset { padding: .35rem .9rem; } .st-sec .btn.st-reset { margin-left: auto; } .st-sec .st-reset + .st-rand { margin-left: .6rem; } .st-sec .btn.st-reset.hide { visibility: hidden; }   /* its place kept: the header does not move */
.st-block { margin: 0; }
.spr-cards { margin-top: .8rem; }
.card.sprint-card .thumb { aspect-ratio: 3 / 1; }
.cstats.cs2 { grid-template-columns: repeat(2, 1fr); }
.thumb .tag-new { position: absolute; left: .7rem; bottom: .5rem; background: var(--yellow); color: #3a2a00; border: 3px solid #000; padding: .05rem .5rem; font-size: .95rem; }
/* CHANGED ROAD (js/game/variants.js changedLately): 14 days on the stage card and the stage panel of the rankings */
.thumb .tag-chg, .sp-pic .tag-chg { background: #3d6fe0; color: #fff; }
.sp-pic .tag-chg { position: absolute; left: .5rem; bottom: .5rem; border: 3px solid #000; padding: .05rem .5rem; font-size: .9rem; }
.card.locked .thumb img { filter: grayscale(1) brightness(.5); } .card.locked .cname { color: #b9b0a0; } .card.locked { background-color: #5a5a5a; }
.card.locked.focus, .card.locked:hover { border-color: #fff; }
.lock-line { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem; margin-top: .8rem; } .lock-line span { min-width: 0; color: #e0d6c4; }
.cstats + .lock-line { border-top: 3px solid #000; padding-top: .7rem; margin-top: .7rem; }
/* results: the XP line under the time, the progress panel, the small what-next card */
.res-main > .xp-line { grid-column: 1 / -1; }
.xp-line { margin: .1rem 0; }
button.xp-main { appearance: none; cursor: pointer; font: inherit; color: #fff; text-align: left; width: 100%; box-sizing: border-box; background: rgba(0, 0, 0, .35); border: 3px solid #000; border-left: .5rem solid var(--yellow); padding: .4rem .7rem;
  display: grid; grid-template-columns: auto minmax(3rem, 1fr) auto; gap: .3rem .8rem; align-items: center; }
button.xp-main.focus, button.xp-main:hover { background: #1f3f9f; }
.xp-gain { color: var(--yellow); font-size: 1.3rem; } button.xp-main em { font-style: normal; color: var(--dim); font-size: .9rem; min-width: 0; }
.xp-items { margin: .3rem 0 0; padding: .3rem .7rem; background: rgba(0, 0, 0, .3); }
.xp-items > div { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; border-top: 2px solid rgba(0, 0, 0, .4); } .xp-items > div:first-child { border-top: 0; } .xp-items b { color: var(--yellow); }
.xp-taste { margin: .4rem 0 0; color: #ffe9b0; font-size: .95rem; }
.res-prog .rp-big { font-size: 1.5rem; } .res-prog b + em + b, .res-prog .btn + b { margin-top: .8rem; }
.res-next { margin-top: 1rem; } .res-next .btn.next-card { width: 100%; box-sizing: border-box; }
body.phone-land .screen-results .res-grid .res-main.has-xp .xp-line { grid-column: 1 / span 2; grid-row: 2; }
body.phone-land .screen-results .res-left .res-main.has-xp .res-medal.inline { grid-row: 3; }
body.phone-land .screen-results .res-lines { grid-row: 1 / span 3; }
/* phones: the next licence is a bar of names with a lock, not full cards, so the open stages fit the first screen */
body.phone-land .lock-cards { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .5rem; margin-top: .5rem; }
body.phone-land .lock-cards .thumb, body.phone-land .lock-cards .cstats { display: none; } body.phone-land .lock-cards .cbody { padding: .8rem .6rem .5rem; } body.phone-land .lock-cards .ccountry { display: none; }
body.phone-land .lock-cards .lock-line { margin-top: .3rem; }
body.phone-land .st-status { margin-top: .4rem; gap: .5rem; } body.phone-land .st-setup { gap: .4rem .6rem; padding: .5rem .6rem; margin-top: .5rem; } body.phone-land .btn.opt { padding: .35rem .6rem; font-size: .9rem; min-height: 40px; }
body.phone-land .st-setup .opt-lab { font-size: .75rem; } body.phone-land .st-sec { margin-top: .9rem; }
body.portrait .st-status { flex-direction: column; } body.portrait .st-setup { grid-template-columns: minmax(0, 1fr); gap: .3rem; } body.portrait .btn.opt { min-height: 44px; }
body.portrait .lock-cards .thumb, body.portrait .lock-cards .cstats, body.portrait .lock-cards .ccountry { display: none; }
.screen-stages .head p { display: none; }
body.is-mobile:not(.phone-land):not(.portrait) .menu-col .big-card .nc-sub { display: none; }   /* a tablet in landscape: the long sub-line pushed the menu 15 px below the fold */
body.phone-land .st-medals em, body.portrait .st-medals em { display: none; }
body.phone-land .st-setup { grid-template-columns: repeat(3, minmax(0, 1fr)); } body.portrait .st-setup { grid-template-columns: minmax(0, 1fr); gap: .4rem; } body.portrait .opt-cell { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: .5rem; }   /* a phone upright: one field a row, the label on the left, as in Settings */
:is(body.phone-land, body.portrait) .st-setup .opt-var-lock { grid-column: 1 / -1; } body.portrait .opt-var-lock { grid-template-columns: minmax(0, 1fr); } :is(body.phone-land, body.portrait) .opt-step .val { font-size: .9rem; }
/* phones: the drive options fold into one bar (menu.js _stages, .st-fold): the car, the difficulty and the changed fields; + opens the panel under it */
.st-fold { display: none; }
body.is-mobile .st-fold { display: flex; align-items: center; gap: .8rem; width: 100%; box-sizing: border-box; min-height: 44px; margin-top: .6rem; padding: .5rem .9rem; font: inherit; font-size: 1rem; text-align: left; color: #fff; background: rgba(0, 0, 0, .55); border: 3px solid #000; cursor: pointer; }
body.is-mobile .st-fold .st-fold-t { flex: 1 1 0; min-width: 0; } body.is-mobile .st-fold .set-mark { color: var(--yellow); }
body.is-mobile .st-fold.focus { outline: 3px solid #fff; outline-offset: -3px; }
body.is-mobile .st-setup.collapsed { display: none; } body.is-mobile .st-foldrow + .st-setup { margin-top: 0; border-top: 0; }
/* phones: the car before the fold bar (menu.js _stages, .st-car): the name and the class plate, a tap opens the garage; the cell inside the panel goes */
body.is-mobile .st-foldrow { display: flex; gap: .5rem; width: 100%; margin-top: .6rem; } body.is-mobile .st-foldrow .st-fold { flex: 1 1 0; min-width: 0; margin-top: 0; }
body.is-mobile .st-foldrow .st-car { flex: none; min-height: 44px; margin: 0; padding: .4rem .8rem; } body.is-mobile .st-setup .opt-car { display: none; }
.opt-car .era-plate, .st-car .era-plate, .gar-drive .era-plate { font-size: .7em; margin-left: .3em; vertical-align: middle; }
/* the stage of the day's intro: the car the player would drive and CHANGE (js/game/daily.js carRow) */
.day-car { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .5rem 0; padding: .4rem .8rem; background: rgba(0, 0, 0, .55); border: 3px solid #000; }
.day-car .day-car-lab { font-size: .8rem; color: #e0cdb0; text-transform: uppercase; } .day-car b { color: #fff; }
.day-car .era-plate { font-size: .75em; } .day-car .day-car-btn { margin: 0 0 0 auto; min-height: 36px; padding: .3rem .8rem; }
body.portrait .screen-results .row-foot.nav-top .btn.primary { flex: 1 1 100%; max-width: 100%; box-sizing: border-box; }   /* the long "Next: Sprint 2/3 • Warsaw" gets a row of its own, wrapped inside the screen */
.st-sec { min-width: 0; max-width: 100%; box-sizing: border-box; } .st-sec :is(h3, em) { min-width: 0; max-width: 100%; }   /* the locked tier's long line wraps on a phone held upright */ body.portrait .st-sec em { flex: 1 1 100%; }
.cstats.cs2 { grid-template-columns: 1.5fr 1fr; }
:where(body.ui-tight) .menu-col .btn.next-card.big-card { padding: .55rem 1rem; } :where(body.ui-tight) .menu-col .btn.big.daily { padding-top: .25rem; padding-bottom: .25rem; } :where(body.ui-tight) .menu-col .lic-badge { padding-top: .3rem; padding-bottom: .3rem; }   /* the menu has one row more (stage of the day alone): short windows give some padding back */
body.is-mobile:not(.phone-land):not(.portrait) .menu-col { gap: .65rem; } body.is-mobile:not(.phone-land):not(.portrait) .menu-col .btn.next-card.big-card { padding: .7rem 1.1rem; }   /* a tablet in landscape: one row more than before, so the rows sit closer */
:where(body.ui-tight) .menu-col .big-card .nc-sub { display: none; } :where(body.ui-tight) .menu-col .big-card .nc-title, body.is-mobile:not(.phone-land):not(.portrait) .menu-col .big-card .nc-title { font-size: 1.15rem; } body.is-mobile:not(.phone-land):not(.portrait) .menu-col .btn.next-card.big-card { padding: .5rem 1rem; }
body.is-mobile:not(.phone-land):not(.portrait) .menu-col .btn.big.daily, body.is-mobile:not(.phone-land):not(.portrait) .menu-col .btn.big { padding-top: .35rem; padding-bottom: .35rem; } :where(body.ui-tight) .menu-col .btn.big { padding-top: .5rem; padding-bottom: .5rem; }
body:not(.phone-land).ui-tight .menu-col .btn.big { padding-top: .45rem; padding-bottom: .45rem; }
body:not(.phone-land).ui-tight .menu-col { gap: .6rem; }
.card.sprint-card .cstats.cs2 { grid-template-columns: minmax(0, 1fr); gap: .3rem; } .card.sprint-card .cstats.cs2 > div { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-width: 0; } .card.sprint-card .cstats.cs2 b { margin-top: 0; white-space: nowrap; }
body.phone-land .card.sprint-card .cstats.cs2 small { display: none; } .card.sprint-card .cstats.cs2 b { white-space: normal; text-align: right; } .card.sprint-card .cstats.cs2 > div { flex-wrap: wrap; }   /* phones: the unit says what it is; no label, the value gets the whole line */
body.phone-land .lock-cards .cbody { padding-top: 1.6rem; }
.opt-cell > .setup-btn { height: 2.3rem; min-height: 0; padding-top: 0; padding-bottom: 0; }
.st-setup .opt-cell > .btn { min-width: 0; max-width: 100%; } .opt-var-lock > .btn { white-space: normal; height: auto; }
/* car classes (js/game/menu.js): the class under the car's name, the board of the chosen car, the suits hint, other wheels than the factory ones */
.cclass { margin-top: .2rem; font-size: .8rem; color: #e0cdb0; } body.is-mobile .car-cards .cclass { font-size: .7rem; }
.btn.car-btn small.car-class { display: block; font-size: .8rem; margin-top: .25rem; color: #e0cdb0; } .btn.car-btn small.car-class .era-plate { font-size: .7rem; }
.opt-rank { display: block; margin-top: .25rem; font-size: .8rem; color: #e0cdb0; }
.select.changed .val { color: #ffb27a; } .drive-warn:not(:empty) { margin: .2rem 0 .6rem; }

/* ---- tasks of the day (js/game/tasks.js): the main-menu tile beside the stage of the day, the tasks screen, the results row */
.btn.daily.tasks-btn { background: rgba(0, 0, 0, .55); border: 3px solid #000; box-shadow: none; }   /* progress, not an action: the black bar of the licence badge beside it (UI guidelines: green = the screen's one main action) */
.btn.daily.tasks-btn small { color: var(--dim); } .btn.daily.tasks-btn.all-done { background: rgba(0, 0, 0, .4); }
.btn.daily.tasks-btn.focus, .btn.daily.tasks-btn:hover { background: #1f3f9f; border-color: #fff; }
.tasks-panel { display: flex; flex-direction: column; gap: .6rem; }
.btn.tk-row { text-align: left; padding: .6rem 1rem; }
.btn.tk-row > span { width: 100%; box-sizing: border-box; justify-items: start; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; grid-template-areas: "c t p" "c s p"; gap: .2rem .8rem; align-items: center; }
.tk-state { grid-area: c; font-style: normal; width: 1.6rem; height: 1.6rem; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; color: #9dff9d; font-size: 1.1rem; }
.tk-title { grid-area: t; font-size: 1.1rem; min-width: 0; justify-self: stretch; }   /* the column's width, not the text's: the pixel title wraps to it (menu.js _renderPx) */
.tk-sub { grid-area: s; font-size: .8rem; font-weight: 600; opacity: .85; min-width: 0; justify-self: stretch; }
.tk-pts { grid-area: p; font-style: normal; color: var(--yellow); font-size: .95rem; }
.btn.tk-row.done { opacity: .7; } .btn.tk-row.done .tk-state { border-color: #9dff9d; } .btn.tk-row.done .tk-pts { color: #9dff9d; }
.tasks-streak { margin-top: 1rem; border-left: 8px solid #ff9a3c; } .tasks-streak .tk-streak { display: block; font-size: 1.3rem; color: #ff9a3c; margin-bottom: .4rem; }
.tasks-streak .tk-note { margin: .25rem 0; } .tasks-streak .tk-place:empty { display: none; }
.screen-results .res-left .res-tasks { border-left: 8px solid #9dff9d; display: block; }
.res-tasks .rt-head { display: block; color: #9dff9d; } .res-tasks .rt-head em { font-style: normal; color: #ff9a3c; margin-left: .6rem; }
.res-tasks .rt-done { display: flex; justify-content: space-between; gap: .8rem; margin-top: .35rem; } .res-tasks .rt-done b { color: var(--yellow); }
.res-tasks .btn.rt-next { margin-top: .6rem; width: 100%; box-sizing: border-box; text-align: left; } .res-tasks .btn.rt-next small.pair-sub { display: block; font-size: .8rem; margin-top: .2rem; opacity: .85; }
.tk-pts { justify-self: end; }
.intro-txt.intro-streak { color: #ff9a3c; }
body.phone-land .btn.tk-row { padding: .35rem .6rem; } body.phone-land .tk-title { font-size: .9rem; } body.phone-land .tasks-panel { gap: .35rem; }

/* garage tab CO-DRIVER (js/game/menu.js _pilotPanel): the voices as tiles, LISTEN under each, the next voice and its XP bar */
.pv-head { margin: .7rem 0 .4rem; color: #ddd; font-size: .9rem; font-weight: 700; }
.pv-strip { grid-template-columns: repeat(4, minmax(0, 11rem)); }
.pv-tile { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.pv-tile .pt-opt { width: 100%; }
.pv-tile .btn.pv-play { margin: 0; padding: .3rem .4rem; font-size: .8rem; width: 100%; }
.pv-pick .lk { font-size: .75rem; }
body:is(.phone-land, .portrait) .pv-pick .ln { display: block; font-size: .6rem; }   /* the voices keep their names on phones (parts show icons only) */
body:is(.phone-land, .portrait) .pv-tile .btn.pv-play { display: none; }   /* phones: a tap on the tile picks the voice and plays it (a locked one: plays it) */
.pv-out { color: #ffe9b0; font-size: .95rem; min-height: 1.3rem; margin-top: .5rem; }
.pv-next { margin-top: .7rem; display: flex; flex-direction: column; gap: .35rem; }
.pv-next > div { display: flex; justify-content: space-between; gap: .6rem; } .pv-next small { color: #ddd; }
.pv-all { margin-top: .7rem; color: #8fe06a; }
.set-group .btn.cd-garage { margin: .3rem 0 .5rem; font-size: 1rem; padding: .5rem 1rem; } body.is-mobile .set-group .btn.cd-garage { width: 100%; }
.res-voice { border-left-color: #6fc3ff; }
.xp-voice { margin: .35rem 0 0; color: #cfe8ff; font-size: .9rem; }

/* ---- copy notice (js/main.js copyNotice): the bundle served from a host that is not ours, instead of the game ---- */
/* the frame bar (menu.js _mountFrameBar): the game in an <iframe> of another site; one strip fixed at the top of the page over every
   screen and the race (above the UI, the HUD, the touch controls and the loading screen; under the boot splash and the toasts), the
   kind's colour as its bottom edge; the UI layers start under it (body.framed, --frame-h set from the bar's measured height) */
.frame-bar { position: absolute; left: 0; right: 0; top: 0; z-index: 50; justify-content: center; margin: 0; padding: .4rem 16px; border: 0 solid #000; border-bottom: 3px solid var(--nc); font-size: 1rem; }
.frame-bar .notice-text { text-align: center; }
.frame-bar .frame-out { flex: none; color: var(--yellow); text-decoration: none; white-space: nowrap; }
body.framed :is(.ui, .hud, .touch, .loading, .pf-gate) { top: var(--frame-h, 0px); }
.copy-notice { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; text-align: center; background: #14110d var(--tex-dirt); background-size: 64px 64px; image-rendering: pixelated; box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .78); }
.copy-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: 36rem; padding: 1.5rem 16px; color: #fff; }
.copy-box h1 { margin: 0; font-size: 1.5rem; color: #ff6a4a; }
.copy-box p { margin: 0; font-size: 1rem; color: #ddd; }
.copy-box .btn { text-decoration: none; }
.copy-box .copy-legal { margin-top: 1rem; font-size: .75rem; color: #9a9a9a; text-transform: none; }

/* ---- phantom stage (js/game/daily.js): the Friday tile keeps the one tint of the Today modes; the map hidden until the blind run, the BLIND / DAY boards */
.btn.daily.phantom small.ph-l3 { color: #ffe27a; }
.btn.daily.phantom small { margin-top: .25rem; }
.ph-hidden { box-sizing: border-box; width: 100%; padding: .6rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; min-height: 12rem; margin-top: .5rem; border: 2px dashed rgba(255, 255, 255, .35); }
.ph-hidden b { font-size: 4rem; line-height: 1; color: rgba(255, 255, 255, .45); }
.ph-tabs { margin-bottom: .4rem; }
.ph-tabs .rk-tab b { font-weight: 700; }
.ph-map p { margin: .5rem 0 0; }

/* ---- driver profile (js/game/profile.js). Desktop first: the phone rules (one column, an accordion) follow with the phone round. Children of grids keep min-width: 0. */
.screen-profile .head h2 { font-size: 2rem; } .screen-profile .head h2::after { display: none; } .screen-profile .head p { max-width: none; margin: .4rem 0 0; }
.screen-profile .panel { margin-top: 1.1rem; }
.screen-profile .panel h3 { margin: 0; }
.pf-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.4rem; align-items: center; }
.pf-car { width: 15rem; min-width: 0; } .pf-car img { display: block; width: 100%; height: auto; image-rendering: pixelated; border: 3px solid #000; }
.pf-id { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.pf-nick { font-size: 2rem; line-height: 1.1; color: #fff; }
.pf-status { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; min-width: 0; font-size: .85rem; color: #f0e6d2; }
.pf-acc.on { color: #fff; }
.pf-lic { font-size: 1.1rem; color: var(--yellow); }
.pf-xpline { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; min-width: 0; }
.pf-xp { font-size: 1.3rem; color: #fff; } .pf-need { font-size: .85rem; color: #e0d6c2; }
.pf-bar { max-width: 28rem; }
.pf-also, .pf-quiet { font-size: .8rem; color: #e0d6c2; }
.pf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .8rem; }
.pf-tile { min-width: 0; width: 100%; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.pf-grid > .panel { min-width: 0; margin-top: 1.1rem; }
.pf-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; margin-top: .4rem; } .pf-top:first-child { margin-top: 0; } .pf-top em { font-style: normal; color: #fff; font-size: .9rem; }
.pf-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .7rem; }
.pf-slot { display: flex; align-items: center; justify-content: center; gap: .6rem; min-width: 0; padding: .5rem .3rem; background: rgba(0, 0, 0, .38); border: 3px solid #000; box-shadow: inset 0 -4px 0 var(--tier); }
.pf-slot.bronze { --tier: #b87333; } .pf-slot.silver { --tier: #c0c8d0; } .pf-slot.gold { --tier: #ffd23c; } .pf-slot.platinum { --tier: #8fd0ff; }
.pf-slot .medal-ic.lg { width: 45px; height: 60px; } .pf-slot b { font-size: 1.5rem; line-height: 1; }
.pf-slot.zero .medal-ic { opacity: .35; } .pf-slot.zero b { color: var(--dim); }
.pf-eras { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; }
.pf-era { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) auto; align-items: center; gap: .6rem; min-width: 0; font-size: .85rem; }
.pf-en { min-width: 0; color: var(--era); }
.pf-eb { display: block; height: .7rem; background: #151515; border: 3px solid #000; box-sizing: content-box; } .pf-eb i { display: block; height: 100%; background: var(--era); }
.pf-era u { text-decoration: none; text-align: right; }
.pf-link { margin-top: .8rem; }
.pf-cup { display: grid; grid-template-columns: .5rem minmax(0, 8rem) auto minmax(0, 1fr); align-items: center; gap: .6rem; margin-top: .45rem; font-size: .85rem; } .pf-cup.locked { opacity: .5; }
.pf-cb { align-self: stretch; } .pf-cn { font-weight: 800; } .pf-cl3 { display: inline-flex; gap: .3rem; } .pf-cl3 .cup-trophy { width: 34px; height: 28px; } .pf-cm { text-align: right; min-width: 0; }
body:is(.phone-land, .portrait) .pf-cup { grid-template-columns: .4rem minmax(0, 1fr) auto; } body:is(.phone-land, .portrait) .pf-cm { grid-column: 2 / -1; text-align: left; }
.pf-garage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .7rem; }
.pf-gi { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding: .4rem .5rem; background: rgba(0, 0, 0, .28); border: 2px solid #000; }
.pf-gi b { font-size: 1.3rem; } .pf-gi small { font-size: .75rem; color: #e0d6c2; }
.pf-line { margin: .6rem 0 0; font-size: .85rem; line-height: 1.4; color: #f0e6d2; }
.pf-first { color: #fff; }
.pf-rows { display: flex; flex-direction: column; gap: .4rem; margin-top: .7rem; }
.pf-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: .6rem; min-width: 0; padding: .35rem .6rem; background: rgba(0, 0, 0, .28); border: 2px solid #000; font-size: .85rem; }
.pf-row > * { min-width: 0; }
.pf-rank { color: var(--yellow); font-size: 1.1rem; } .pf-tr { color: #e0d6c2; text-align: right; } .pf-tr, .pf-tm, .pf-cl, .pf-rank { white-space: nowrap; } .pf-tm { text-align: right; }
.pf-qrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.pf-qrow:empty { display: none; } .pf-qrow .pf-quiet { margin-top: .6rem; } .pf-qrow .btn { margin-top: .6rem; }
.screen-profile .pf-stats h3 { margin: 0; }

.pf-sub { font-size: 1rem; color: #fff; }
.pf-status .btn.pf-save { margin: 0; padding: .1rem .6rem; min-height: 0; font-size: .8rem; }
.pf-go { margin-top: .6rem; }
/* driver profile on phones: one column, widths from the content (the pixel font ignores rem sizes), the sections after WHAT NEXT fold into an accordion (menu.js _accordion, one open at a time) */
body:is(.phone-land, .portrait) .screen-profile .panel { margin-top: .6rem; padding: .6rem .8rem; }
body:is(.phone-land, .portrait) .screen-profile .head { margin-bottom: 0; }
body.phone-land .screen-profile .head { display: none; }   /* the bar and the card say what this screen is; the hero and the three rows must fit the first screen */
body:is(.phone-land, .portrait) .pf-hero { grid-template-columns: 56px minmax(0, 1fr); gap: .8rem; align-items: start; }
body:is(.phone-land, .portrait) .pf-car { width: 56px; } body:is(.phone-land, .portrait) .pf-car img { border-width: 2px; }
body:is(.phone-land, .portrait) .pf-id { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: center; gap: .5rem .7rem; }
body:is(.phone-land, .portrait) .pf-id > * { min-width: 0; }
body:is(.phone-land, .portrait) .pf-nick { font-size: 1.4rem; grid-column: 1; grid-row: 1; overflow-wrap: anywhere; }
body:is(.phone-land, .portrait) .pf-lic { grid-column: 2; grid-row: 1; font-size: 1.1rem; }
body:is(.phone-land, .portrait) .pf-xpline { display: contents; }
body:is(.phone-land, .portrait) .pf-xp { grid-column: 1; grid-row: 2; font-size: 1.1rem; }
body:is(.phone-land, .portrait) .pf-bar { grid-column: 2; grid-row: 2; max-width: none; }
body:is(.phone-land, .portrait) .pf-status { grid-column: 1 / -1; grid-row: 3; gap: .2rem .6rem; }
body:is(.phone-land, .portrait) .pf-status > * { min-width: 0; flex: 0 1 auto; }
body:is(.phone-land, .portrait) .pf-need { grid-column: 1 / -1; grid-row: 4; } body:is(.phone-land, .portrait) .pf-also { grid-column: 1 / -1; grid-row: 5; }
body:is(.phone-land, .portrait) .pf-id > .pf-quiet { grid-column: 1 / -1; grid-row: 6; }
body.phone-land :is(.pf-need, .pf-also, .pf-id > .pf-quiet) { display: none; }
/* driver card: the share button and its panel */
.pf-sharebtn { align-self: flex-start; margin-top: .3rem; } .pf-share { margin-top: 1rem; } .pf-share .share-card { max-width: 60rem; }
body:is(.phone-land, .portrait) .pf-sharebtn { grid-column: 1 / -1; grid-row: 7; justify-self: start; margin-top: 0; }
body.phone-land .pf-sharebtn { display: none; }   /* the sideways phone keeps its hero on the first screen; the card is shared from the upright phone and the desktop */
body.portrait .pf-hero .pf-sharebtn { grid-column: 1 / -1; grid-row: 8; margin-top: .4rem; }   /* its own row after need (5), also (6), quiet (7) */
/* results: the attempt a record fell on */
.res-try { margin-top: .4rem; font-size: .95rem; font-weight: 800; color: var(--yellow); }
body.portrait .pf-hero { grid-template-columns: 56px minmax(0, 11fr) minmax(0, 9fr); gap: .5rem .8rem; }   /* fixed shares: a pixel text wraps by the width its column has, which must not depend on the text drawn before it. The id block dissolves so the long lines can span the full card under the thumbnail */
body.portrait .pf-hero .pf-id, body.portrait .pf-hero .pf-xpline { display: contents; }
body.portrait .pf-hero .pf-car { grid-column: 1; grid-row: 1 / 5; }
body.portrait .pf-hero .pf-nick { grid-column: 2 / -1; grid-row: 1; } body.portrait .pf-hero .pf-lic { grid-column: 2 / -1; grid-row: 2; }
body.portrait .pf-hero .pf-xp { grid-column: 2; grid-row: 3; } body.portrait .pf-hero .pf-bar { grid-column: 3; grid-row: 3; }
body.portrait .pf-hero .pf-status { grid-column: 2 / -1; grid-row: 4; }
body.portrait .pf-hero .pf-need { grid-column: 1 / -1; grid-row: 5; } body.portrait .pf-hero .pf-also { grid-column: 1 / -1; grid-row: 6; } body.portrait .pf-hero .pf-quiet { grid-column: 1 / -1; grid-row: 7; }
body:is(.phone-land, .portrait) .pf-status .btn.pf-save { padding: .1rem .5rem; }
body:is(.phone-land, .portrait) .pf-next h3 { font-size: 1rem; }
body:is(.phone-land, .portrait) .pf-tiles { grid-template-columns: minmax(0, 1fr); gap: .5rem; margin-top: .5rem; }
body:is(.phone-land, .portrait) .pf-tile { padding: .4rem .6rem; }
body.portrait .pf-tiles .btn.next-card.pf-tile > span { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t p" "t g"; gap: .1rem .6rem; }   /* the XP chip over GO, so the title keeps the width for two lines */
body.portrait .pf-tile { padding: .1rem .5rem; min-height: 0; } body.portrait .pf-tile .nc-title { line-height: 1.05; }
body:is(.phone-land, .portrait) .btn.next-card.pf-tile > span { gap: .15rem .5rem; width: 100%; }
body:is(.phone-land, .portrait) .btn.next-card.pf-tile > span { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "t p g"; align-items: center; gap: .15rem 1rem; }
body:is(.phone-land, .portrait) .pf-tile .nc-sub { display: none; }
body:is(.phone-land, .portrait) .pf-tile .nc-go { align-self: center; padding: .1rem .6rem; }
body:is(.phone-land, .portrait) .pf-tile .nc-title { font-size: 1.05rem; text-align: left; }
body:is(.phone-land, .portrait) .pf-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
body:is(.phone-land, .portrait) .pf-grid > .panel { margin-top: .6rem; }
body:is(.phone-land, .portrait) .pf-fold > h3 { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
body:is(.phone-land, .portrait) .pf-fold > h3 .set-mark { margin-left: auto; color: var(--yellow); }
body:is(.phone-land, .portrait) .pf-fold.collapsed > :not(h3) { display: none; }
body:is(.phone-land, .portrait) .pf-fold:not(.collapsed) > h3 { margin-bottom: .2rem; }
body.portrait .pf-shelf, body.portrait .pf-garage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body:is(.phone-land, .portrait) .pf-slot { padding: .4rem .3rem; gap: .5rem; }
body:is(.phone-land, .portrait) .pf-era { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; }
body:is(.phone-land, .portrait) .pf-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "r s m" "r c t"; gap: .1rem .6rem; }
body:is(.phone-land, .portrait) .pf-rank { grid-area: r; } body:is(.phone-land, .portrait) .pf-st { grid-area: s; } body:is(.phone-land, .portrait) .pf-tm { grid-area: m; }
body:is(.phone-land, .portrait) .pf-cl { grid-area: c; color: #e0d6c2; } body:is(.phone-land, .portrait) .pf-tr { grid-area: t; }
body:is(.phone-land, .portrait) .pf-since { margin-top: .3rem; }
body:is(.phone-land, .portrait) .pf-qrow > * { min-width: 0; flex: 0 1 auto; }
body.portrait .screen-profile .row-foot.nav-top { gap: .4rem; } body.portrait .screen-profile .row-foot.nav-top .btn { padding: .3rem .4rem; }
/* a tablet (not a phone): two columns while they fit, else one */
@media (max-width: 699px) { body.is-mobile:not(.phone-land):not(.portrait) .pf-grid { grid-template-columns: minmax(0, 1fr); } }

/* a narrow desktop window (a half screen): one column for every body; phones have their own rules above */
@media (max-width: 999px) { .pf-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
body.portrait .screen-profile .head p { display: none; }
/* ---- weekly cup (js/game/weekly.js: the Today bar, the screen, the line after a run; ARCHITECTURE.md "Weekly Cup") */
/* the Today bar: WEEKLY CUP on the left, one sentence on the right (wraps, never shrinks);  */
.btn.weekly-tile { padding: .55rem 1rem; background-color: #b8860b; background-blend-mode: multiply; border-color: #ffe27a #6b4a00 #6b4a00 #ffe27a; }   /* the tint of the Today modes (as .btn.daily, which it does not carry: tests and tools pick the day's tiles by that class) */
.btn.weekly-tile.focus, .btn.weekly-tile:hover { background-color: #3d6fe0; }
.btn.weekly-tile small.wk-s { color: var(--yellow); font-weight: 600; }   /* the accent colour (places, points): it read as one sentence with the title on phones (2026-11-20) */
.btn.weekly-tile > span { display: flex; align-items: center; justify-content: space-between; gap: .9rem; text-align: left; }
.menu-col .btn.weekly-tile .wk-t { flex: none; font-size: 1.1rem; }
.menu-col .btn.weekly-tile small.wk-s { display: block; flex: 1 1 auto; min-width: 0; margin: 0; text-align: right; font-size: .8rem; }
.btn.weekly-tile.wk-pod { border-color: var(--yellow); box-shadow: 0 0 0 3px #000, inset 0 0 0 3px rgba(255, 210, 60, .55); }
.btn.weekly-tile.wk-mon { border-color: #55ff55; box-shadow: 0 0 0 3px #000, inset 0 0 0 3px rgba(85, 255, 85, .5); }
.btn.weekly-tile.focus, .btn.weekly-tile:hover { border-color: #fff; }
body.phone-land .menu-col .btn.weekly-tile { padding: .2rem .5rem; min-height: 34px; }
body.phone-land .menu-col .btn.weekly-tile .wk-t { font-size: .78rem; }
body.phone-land .menu-col .btn.weekly-tile small.wk-s { font-size: .72rem; margin: 0; }
body.portrait .menu-col .btn.weekly-tile .wk-t { font-size: 1rem; }
/* the cup of a weekly podium: 10x10 pixels, drawn as a data-URI SVG (gold / silver / bronze); .tro.big is the same drawing at twice the size */
.tro { display: inline-block; flex: none; width: 10px; height: 10px; vertical-align: -1px; margin-right: 4px; background-repeat: no-repeat; background-size: 100% 100%; image-rendering: pixelated; }
.tro.big { width: 20px; height: 20px; }
.tro.tro-1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd23c' d='M1 0h1v1h-1zM3 0h6v1h-6zM1 1h1v1h-1zM3 1h6v1h-6zM0 2h2v1h-2zM3 2h3v1h-3zM8 2h2v1h-2zM0 3h2v1h-2zM3 3h3v1h-3zM8 3h2v1h-2zM1 4h1v1h-1zM3 4h3v1h-3zM8 4h1v1h-1zM2 5h4v1h-4zM3 6h4v1h-4z'/%3E%3Cpath fill='%23b8860b' d='M6 2h1v1h-1zM6 3h1v1h-1zM6 4h1v1h-1zM6 5h2v1h-2zM4 7h2v1h-2zM4 8h2v1h-2zM2 9h6v1h-6z'/%3E%3Cpath fill='%23fff3b0' d='M2 0h1v1h-1zM2 1h1v1h-1z'/%3E%3C/svg%3E"); }
.tro.tro-2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Cpath fill='%23d8dde6' d='M1 0h1v1h-1zM3 0h6v1h-6zM1 1h1v1h-1zM3 1h6v1h-6zM0 2h2v1h-2zM3 2h3v1h-3zM8 2h2v1h-2zM0 3h2v1h-2zM3 3h3v1h-3zM8 3h2v1h-2zM1 4h1v1h-1zM3 4h3v1h-3zM8 4h1v1h-1zM2 5h4v1h-4zM3 6h4v1h-4z'/%3E%3Cpath fill='%237d8695' d='M6 2h1v1h-1zM6 3h1v1h-1zM6 4h1v1h-1zM6 5h2v1h-2zM4 7h2v1h-2zM4 8h2v1h-2zM2 9h6v1h-6z'/%3E%3Cpath fill='%23ffffff' d='M2 0h1v1h-1zM2 1h1v1h-1z'/%3E%3C/svg%3E"); }
.tro.tro-3 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Cpath fill='%23d98a45' d='M1 0h1v1h-1zM3 0h6v1h-6zM1 1h1v1h-1zM3 1h6v1h-6zM0 2h2v1h-2zM3 2h3v1h-3zM8 2h2v1h-2zM0 3h2v1h-2zM3 3h3v1h-3zM8 3h2v1h-2zM1 4h1v1h-1zM3 4h3v1h-3zM8 4h1v1h-1zM2 5h4v1h-4zM3 6h4v1h-4z'/%3E%3Cpath fill='%237a431a' d='M6 2h1v1h-1zM6 3h1v1h-1zM6 4h1v1h-1zM6 5h2v1h-2zM4 7h2v1h-2zM4 8h2v1h-2zM2 9h6v1h-6z'/%3E%3Cpath fill='%23f5c08a' d='M2 0h1v1h-1zM2 1h1v1h-1z'/%3E%3C/svg%3E"); }
/* the screen: tabs, the player's 7 days, the table, the legend */
.head p.wk-sub { margin-top: .6rem; max-width: none; }
.wk-tabs { display: flex; gap: .5rem; margin-top: 1rem; }
.btn.wk-tab { flex: 0 1 14rem; padding: .45rem .5rem; font-size: 1.05rem; }
.btn.wk-tab.sel { background-color: #3a3a3a; border-color: var(--yellow); box-shadow: 0 0 0 3px #000; }
.btn.wk-tab.sel.focus, .btn.wk-tab.sel:hover { background-color: #3d6fe0; border-color: #fff; }
.wk-body { margin-top: 1rem; min-width: 0; }
.wk-quiet { padding: 1.2rem .5rem; color: var(--dim); font-size: 1.1rem; }
.wk-start { display: flex; align-items: center; gap: .9rem; margin: .6rem 0 1rem; padding: .8rem 1rem; background: rgba(0,0,0,.45); border: 2px solid var(--yellow); color: #fff; font-size: 1.25rem; }
.wk-start .wk-cupimg { flex: none; }
.wk-rules { display: flex; flex-direction: column; gap: .7rem; margin: 0 0 .8rem; }
.wk-rule { display: flex; align-items: flex-start; gap: .6rem; color: #e8e8e8; font-size: 1rem; line-height: 1.35; text-align: left; }
.wk-rule i { flex: none; width: .55rem; height: .55rem; margin-top: .45rem; background: var(--yellow); border: 2px solid #000; }
.wk-rule span, .wk-start b { flex: 1 1 0; min-width: 0; }   /* a bounded width, so the pixel font wraps the sentence (menu.js _renderPx) */
body.phone-land .wk-start { margin: .3rem 0 .5rem; padding: .4rem .6rem; font-size: 1rem; } body.phone-land .wk-rule { font-size: .85rem; }
.wk-lab { margin: .2rem 0 .4rem; color: var(--yellow); font-size: .95rem; }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.wk-day { padding: .3rem .2rem; text-align: center; background: rgba(0, 0, 0, .45); border: 3px solid rgba(255, 255, 255, .25); }
.wk-day.best { border-color: var(--yellow); background: rgba(255, 210, 60, .16); }
.wk-day.today { border-style: dashed; }
.wk-day small { display: block; color: var(--dim); font-size: .8rem; margin-bottom: .35rem; }
.wk-day b { display: block; font-size: 1.35rem; margin-bottom: .1rem; }
.wk-day.zero b { color: var(--dim); }
.wk-day i { display: block; color: var(--dim); font-size: .75rem; font-style: normal; }   /* the day's split: stage of the day + daily rally */
.wk-sum { margin: .5rem 0 .2rem; color: var(--dim); font-size: .95rem; }
.wk-note { margin: .8rem 0; }
.wk-note .notice { margin: 0 0 .5rem; }
.wk-note .btn { display: inline-block; padding: .4rem 1.4rem; font-size: 1.05rem; }
.wk-brag { margin: -.2rem 0 1rem; text-align: center; } .wk-brag .btn.wk-brag-btn { display: inline-block; padding: .55rem 2.2rem; font-size: 1.15rem; }   /* BRAG under the podium; the panel takes its place */
.wk-brag .share-panel { margin: 0 auto .4rem; text-align: left; }
.wk-table { margin-top: .8rem; background: rgba(0, 0, 0, .45); border: 3px solid #000; }
.wk-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 6rem 4rem; align-items: center; gap: .6rem; padding: .28rem .6rem; font-size: 1.15rem; border-bottom: 3px solid rgba(0, 0, 0, .45); }
.wk-row.wk-th { color: var(--yellow); font-size: .9rem; padding-top: .35rem; }
.wk-row .wk-p { text-align: right; } .wk-row .wk-d { text-align: right; color: var(--dim); }
.wk-nick { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.wk-row.me { background: rgba(255, 210, 60, .2); outline: 3px solid var(--yellow); outline-offset: -3px; }
.wk-row.wk-tap { cursor: pointer; } .wk-row.wk-tap:hover, .wk-row.wk-tap.focus, .wk-row.wk-tap.open { background: rgba(255, 255, 255, .1); } .wk-row.me.wk-tap.open { background: rgba(255, 210, 60, .3); }
.wk-row.wk-tap.focus { outline: 3px solid #fff; outline-offset: -3px; }
.wk-xday { padding: .4rem .6rem .5rem; background: rgba(0, 0, 0, .35); border-bottom: 3px solid rgba(0, 0, 0, .45); }   /* the days of a tapped row */
.wk-xday .wk-sum { margin: .4rem 0 0; font-size: .85rem; }
.wk-wlab { margin-top: .9rem; } .wk-taphint { margin-top: .5rem; }
.wk-wins { margin-top: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: 1rem; }   /* the winners of the days: day | nick | pts, widths from the content */
.wk-row.wk-wrow { grid-column: 1 / -1; grid-template-columns: max-content minmax(0, 1fr) max-content; grid-template-columns: subgrid; }
.wk-wrow .wk-wd { color: var(--dim); font-size: .95rem; } .wk-row.wk-wrow.today { border: 3px dashed rgba(255, 255, 255, .35); }
.wk-gap { padding: .2rem .6rem; color: var(--dim); font-size: 1rem; }
.wk-gap.wk-total span { margin-left: .6rem; }
.wk-legend { display: flex; align-items: center; margin: .8rem 0 0; color: var(--dim); font-size: .9rem; }
/* HONOURS OF THE WEEK under the podium of a closed week (weekly.js honoursHtml): iron week drivers, the climb of the week, the records; the own name in yellow */
.wk-honours { margin: -.2rem 0 1rem; padding: .5rem .8rem .6rem; background: rgba(0, 0, 0, .45); border: 3px solid #000; }
.wk-honours .wk-lab { margin: 0 0 .3rem; }
.wk-hon { display: flex; align-items: center; gap: .5rem; font-size: .95rem; color: #ddd; margin: .3rem 0; } .wk-hon .me { color: var(--yellow); }
/* the honour icons (weekly.js honourImg): 12x12 pixels; after the nick in a closed week's table, in the honours block and the hall (x2), on the ceremony's reward lines */
.wk-hicon { flex: none; vertical-align: -2px; margin-left: 5px; image-rendering: pixelated; } .wk-hon .wk-hicon, .cer-hon .wk-hicon { margin: 0 .4rem 0 0; vertical-align: -6px; }
.wk-hs .wk-hicon { margin: 0 3px 0 0; }
body.phone-land .wk-honours { padding: .3rem .6rem .4rem; } body.phone-land .wk-hon { font-size: .85rem; }
/* the podium (weekly.js podium: LAST WEEK and the ceremony, owner 2026-10-30): blocks 2-1-3 with a bevelled stone face and the tier colour
   on top, the cup over the driver's car on the step, the number and the name on the block, points and days under the floor */
.wk-podium { margin: .4rem 0 1rem; --w: 13rem; --gap: .6rem; }
.wk-pd-row { display: flex; align-items: flex-end; justify-content: center; gap: var(--gap); }
.wk-pd-col { flex: 0 1 var(--w); min-width: 0; display: flex; flex-direction: column; align-items: center; }
.wk-pd-col.empty { visibility: hidden; }
.wk-pd-col.t1 { --c: #ffd23c; --cl: #fff3b0; --h: 8rem; } .wk-pd-col.t2 { --c: #d8dde6; --cl: #ffffff; --h: 6.2rem; } .wk-pd-col.t3 { --c: #d98a45; --cl: #f5c08a; --h: 5rem; }
.wk-pd-cup { position: relative; z-index: 2; line-height: 0; margin-bottom: .25rem; }
.wk-pd-cup img.px { filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .55)); }
.wk-pd-car { line-height: 0; display: flex; align-items: flex-end; justify-content: center; height: calc(24px * var(--cs, 3)); margin-bottom: -3px; position: relative; z-index: 1; }
.wk-pd-car img.px { width: calc(48px * var(--cs, 3)); height: calc(24px * var(--cs, 3)); }
.wk-pd-nocar { display: block; height: 100%; }
.wk-pd-top { width: calc(100% + 6px); height: 16px; box-sizing: border-box; background: var(--c); border: 3px solid #000; border-bottom: 0; box-shadow: inset 0 4px 0 var(--cl), inset 0 -3px 0 rgba(0, 0, 0, .3); position: relative; z-index: 1; }   /* the carpet on top, 3 px wider than the block (its outer black ring) */
.wk-pd-block { width: 100%; box-sizing: border-box; min-height: var(--h); background: #6a6a6a var(--tex-stone); background-size: 64px 64px; background-blend-mode: multiply; image-rendering: pixelated; border: 3px solid; border-color: #8e8e8e #1a1a1a #1a1a1a #8e8e8e; box-shadow: 0 0 0 3px #000, inset 0 0 0 3px rgba(0, 0, 0, .25); display: flex; flex-direction: column; align-items: center; padding: .6rem .45rem .45rem; text-align: center; }   /* the stone of the panels */
.wk-pd-n { font-size: 2.4rem; line-height: 1; color: var(--c); margin-bottom: .3rem; text-shadow: 3px 3px 0 #000; }
.wk-pd-nick { font-size: 1.05rem; color: #fff; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-pd-col.me .wk-pd-nick { color: var(--yellow); }
.wk-pd-floor { height: 14px; margin: 3px auto 0; width: calc(3 * var(--w) + 2 * var(--gap) + 2.4rem); max-width: 100%; box-sizing: border-box; background: #2c2c2c var(--tex-stone); background-size: 64px 64px; background-blend-mode: multiply; image-rendering: pixelated; border: 3px solid #000; box-shadow: inset 0 3px 0 #555; }
.wk-pd-caps { display: flex; justify-content: center; gap: var(--gap); margin-top: .5rem; }
.wk-pd-cap { flex: 0 1 var(--w); min-width: 0; text-align: center; color: var(--dim); font-size: .95rem; }
.wk-podium.big { --w: 17rem; --gap: .8rem; margin-top: .8rem; }
.wk-podium.big .wk-pd-col.t1 { --h: 10rem; } .wk-podium.big .wk-pd-col.t2 { --h: 7.8rem; } .wk-podium.big .wk-pd-col.t3 { --h: 6.2rem; }
.wk-podium.big .wk-pd-n { font-size: 3rem; } .wk-podium.big .wk-pd-nick { font-size: 1.2rem; } .wk-podium.big .wk-pd-cap { font-size: 1.05rem; }
body.portrait .wk-podium, body.portrait .wk-podium.big { --w: 1fr; --gap: .3rem; }
body.portrait .wk-pd-col, body.portrait .wk-pd-cap { flex: 1 1 0; }
body.portrait .wk-pd-car img.px { width: 96px; height: 48px; } body.portrait .wk-pd-car { height: 48px; }
body.portrait .wk-pd-cup img.px { width: 66px; height: 57px; }   /* 3 screen pixels per drawn one: the cups stay the eye-catcher on a phone */
body.portrait .wk-pd-n, body.portrait .wk-podium.big .wk-pd-n { font-size: 1.6rem; } body.portrait .wk-pd-nick { font-size: .78rem; }
body.portrait .wk-pd-col.t1 { --h: 5.2rem; } body.portrait .wk-pd-col.t2 { --h: 4.2rem; } body.portrait .wk-pd-col.t3 { --h: 3.4rem; }
body.portrait .wk-pd-floor { width: 100%; }
/* HALL OF FAME: trophies by driver, one row per finished week */
.wk-hall { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.wk-hrow { grid-template-columns: 2.5rem minmax(0, 1fr) 11rem minmax(0, 1.6fr); background: rgba(0, 0, 0, .45); }
.wk-cups { display: flex; align-items: center; } .wk-cups em { margin-right: .5rem; font-style: normal; }
.wk-hs { color: var(--dim); font-size: .9rem; }
.btn.wk-prow { padding: .35rem .6rem; font-size: 1rem; }
.btn.wk-prow > span { display: grid; grid-template-columns: 16rem minmax(0, 1fr) 9rem; gap: .6rem; align-items: center; text-align: left; }
.wk-pc { text-align: right; color: var(--dim); }
/* the line after a run (results of the stage of the day and the daily rally): the row style of "Place today", with the accent border */
.cup-line { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .1rem .8rem; padding: .35rem .6rem; background: rgba(255, 210, 60, .14); border: 3px solid var(--yellow); }
.cup-line b { color: var(--yellow); } .cup-line em { font-style: normal; text-align: right; }
.cup-line small { grid-column: 1 / -1; color: var(--dim); font-size: .85rem; }
/* narrow screens: the table keeps place, driver and points; the strip and the hall rows lose their side text */
body.portrait .wk-row { grid-template-columns: 2rem minmax(0, 1fr) 4.4rem 2.6rem; font-size: 1rem; gap: .4rem; padding: .3rem .4rem; }  body.portrait .wk-row.wk-wrow { grid-template-columns: max-content minmax(0, 1fr) max-content; grid-template-columns: subgrid; }
body.portrait .wk-hrow { grid-template-columns: 2rem minmax(0, 1fr) auto; } body.portrait .wk-hs { display: none; }
body.portrait .btn.wk-prow > span { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
body.portrait .btn.wk-tab { flex: 1 1 0; font-size: .85rem; padding: .4rem .2rem; }
body.portrait .wk-day b { font-size: 1.1rem; }
body.phone-land .wk-body { margin-top: .5rem; } body.phone-land .wk-sub { display: none; } body.phone-land .wk-row { padding: .12rem .5rem; font-size: .95rem; }
body.phone-land .wk-note { margin: .4rem 0; } body.phone-land .btn.wk-tab { padding: .25rem .4rem; font-size: .9rem; } body.phone-land .wk-day { padding: .15rem .1rem; }
/* the main menu has eight rows with the cup bar: in a window under 700 px high the bar and the gaps give back what the bar takes (shot-desktop --check holds it) */
@media (max-height: 700px) { body:not(.phone-land):not(.is-mobile).ui-tight .menu-col { gap: .3rem; } body:not(.phone-land).ui-tight .menu-col .btn.weekly-tile { padding-top: .15rem; padding-bottom: .15rem; }
  body:not(.phone-land):not(.is-mobile).ui-tight .menu-col .menu-sec { margin-bottom: -.1rem; } }   /* the TODAY / DRIVE labels keep clear of the tiles with the smaller gap */

/* ---- kit (js/game/kit.js): the kit button at the end of every board row (the icon on the colour of its state) and the KIT card ---- */
/* rows with a kit button (.kit): the same columns + one for the button, in every layout of the board rows above */
.lb-board .brow.lb-row.kit { grid-template-columns: 2rem minmax(0, 1fr) 6rem 5rem auto; }
.lb-full .brow.lb-row.kit { grid-template-columns: 2.6rem minmax(0, 1fr) 6.5rem 6.5rem 5.5rem auto; }
:is(body.portrait, body.phone-land) .lb-board .brow.lb-row.kit { grid-template-columns: 2.8rem minmax(0, 1fr) 8.6rem 7.4rem auto; }
:is(body.portrait, body.phone-land) .lb-full .brow.lb-row.kit { grid-template-columns: 2.4em minmax(0, 1fr) 8.6em 6.6em 6.4em auto; }
body.portrait .lb-full .brow.lb-row.kit { grid-template-columns: 1.6em minmax(0, 1fr) 6.2em 5.9em auto; }
.rally-board .brow.kit { grid-template-columns: 2.4rem minmax(0, 1fr) 6.5rem 5.5rem auto; align-items: center; }   /* the daily rally's board (js/game/rallyday.js) */
.lb-kit { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 1.7rem; padding: 0; margin-left: .4rem; box-sizing: border-box; background: #4a4a4a; border: 3px solid; border-color: #777 #222 #222 #777; cursor: pointer; }
.lb-kit.none { visibility: hidden; }
.lb-kit .kit-ic { width: 18px; height: 18px; image-rendering: pixelated; flex: none; }
.lb-kit.k-set { background: #2f5bb8; border-color: #8fb0ff #173a85 #173a85 #8fb0ff; }
.lb-kit.k-old { opacity: .45; }
.lb-kit.focus, .lb-kit:hover { outline: 3px solid #fff; outline-offset: -1px; }
.lb-hint > .lb-kit.kit-leg { margin: 0 .4rem 0 0; cursor: default; flex: none; width: 2rem; height: 1.4rem; }
.kit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.2rem; margin-top: 1.2rem; }
.kit-grid .kit-panel h3 { margin: 0 0 .6rem; } .kit-grid .kit-panel h3.kit-sub { margin-top: 1.2rem; }
.kit-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.2rem; align-items: baseline; }
.kit-row { display: contents; }
.kit-row .kit-lab, .kit-set .kit-lab { color: var(--dim); }
.kit-row .kit-lock { grid-column: 2; margin-top: -.3rem; font-style: normal; font-size: .85rem; color: var(--yellow); }
.kit-set { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: .8rem; align-items: center; padding: .35rem 0; }
.kit-set .notch .blk, .kit-legend .blk { cursor: default; position: relative; display: flex; align-items: center; justify-content: center; }
.kit-legend .blk.cur { background: var(--yellow); border-color: #fff #a08000 #a08000 #fff; }
.kit-me { display: block; width: .45rem; height: .45rem; background: #fff; box-shadow: 0 0 0 2px #000; }
.kit-legend { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; font-size: .85rem; color: var(--dim); }
.kit-legend .blk { width: 1.4rem; height: 1rem; flex: none; border: 3px solid; }
.kit-legend .kit-me { margin-left: .8rem; }
.kit-note { margin: 1rem 0 0; color: var(--dim); font-size: .9rem; }
.screen-kit > .notice { margin-top: 1rem; }
:is(body.portrait, body.phone-land) .kit-grid { grid-template-columns: 1fr; }
:is(body.portrait, body.phone-land) .kit-set { grid-template-columns: minmax(0, 1fr) 11rem; }
.chal-panel .chal-kit { margin-top: .8rem; }
:is(body.portrait, body.phone-land) .res-grid .rally-board .brow.kit { grid-template-columns: 2.8rem minmax(0, 1fr) auto auto auto; }

/* ------------------------------------------------------------ era cups (js/game/menu.js _cups, _cupIntro, results strip, _champion) */
/* ---- era cups: the hub's posters (menu.js _cups, eraScene) and the era title (menu.js trophy: a 34x28 px laurel, shown at whole multiples) ---- */
.cup-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; } .cup-top > .cup-head { flex: 1 1 26rem; width: auto; min-width: 0; margin: 0; } .cup-top > .cup-edition { flex: none; }
.cup-head p { color: #ffe9b0; font-size: 1.1rem; margin-top: .55rem; }
.cup-edition { position: relative; display: grid; grid-template-columns: auto auto; gap: .35rem 1.4rem; align-items: center; padding: .55rem 1rem .55rem 3rem; background: #0b0b0b; border: 3px solid #000; box-shadow: inset 0 -3px 0 #2a2a2a; }
.cup-edition::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2rem; border-right: 3px solid #000; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2' shape-rendering='crispEdges'%3E%3Cpath fill='%23f4f6fa' d='M0 0h1v1H0zM1 1h1v1H1z'/%3E%3Cpath fill='%23111' d='M1 0h1v1H1zM0 1h1v1H0z'/%3E%3C/svg%3E") 0 0 / 12px 12px repeat; }
.cup-edition > b { color: var(--yellow); font-size: 1.1rem; } .cup-edition > span { grid-column: 1; color: #fff; font-size: .95rem; } .cup-edition > em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; color: var(--yellow); font-size: 1.1rem; text-align: right; }
.ep-strip { flex: none; display: flex; gap: 1.4rem; margin: 1.1rem -.9rem 0; padding: .9rem .9rem 1.2rem; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 0 .9rem; scrollbar-color: var(--yellow) #111; }
.btn.era-poster { flex: 0 0 auto; width: calc(288px + 2 * var(--px)); padding: 0; display: flex; flex-direction: column; text-align: left; white-space: normal; scroll-snap-align: start;
  background: #866043 var(--tex-dirt); background-size: 48px 48px; border-color: #b58a63 #3a281a #3a281a #b58a63; }
.btn.era-poster > span { display: contents; }
.btn.era-poster.focus, .btn.era-poster:hover { background-color: #866043; background-blend-mode: normal; border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3d6fe0; }
.era-poster i, .era-poster b, .era-poster em, .era-poster small, .era-poster u, .era-poster s { font-style: normal; text-decoration: none; }
.btn.era-poster { overflow: hidden; } .era-poster > span > * { flex: none; box-sizing: border-box; max-width: 100%; min-width: 0; }
.era-poster .ep-pic, body.phone-land .era-poster .ep-pic { aspect-ratio: 2 / 1; }
.ep-plate { display: flex; align-items: center; gap: .65rem; padding: .3rem .5rem .3rem .75rem; background: var(--era); border-bottom: 3px solid #000; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); color: #fff; }
.ep-plate > b { font: 900 2.4rem/1 var(--font); } .ep-era { display: flex; flex-direction: column; gap: .3rem; min-width: 0; } .ep-era em { font-size: 1.05rem; white-space: nowrap; } .ep-era small { font-size: .8rem; opacity: .92; white-space: nowrap; }
.ep-tros { display: flex; align-items: center; gap: .3rem; margin-top: auto; padding-top: .7rem; border-top: 3px solid #000; } .ep-tros small { margin-left: auto; color: #e0cdb0; font-size: 1rem; }
.ep-pic { display: block; border-bottom: 0; }
.ep-pic img { width: 288px; height: 144px; }
.ep-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: .55rem; padding: .3rem .7rem; background: #0b0b0b; border: 3px solid var(--yellow); color: var(--yellow); font-size: 1rem; white-space: nowrap; }
.ep-padlock { display: block; flex: none; width: 15px; height: 18px; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffc61a' d='M1 0h3v1H1zM0 1h1v2H0zM4 1h1v2H4zM0 3h5v3H0z'/%3E%3Cpath fill='%23000' d='M2 4h1v1H2z'/%3E%3C/svg%3E") 0 0 / 100% 100%; }
.ep-live { position: absolute; right: .6rem; top: .55rem; padding: .15rem .5rem; background: #2fb84a; border: 3px solid #000; color: #fff; font-size: .85rem; }
.ep-body { display: flex; flex-direction: column; gap: .45rem; flex: 1 1 auto !important; padding: calc(15px + .55rem) .95rem .85rem; }   /* 15 px = the grass strip of .cbody::before */
.ep-name { font: 900 1.3rem/1.15 var(--font); color: #fff; }
.ep-line { color: #ffe9b0; font-size: .9rem; line-height: 1.4; min-height: 4.2em; }
.ep-r1 { position: absolute; left: .5rem; top: .5rem; display: flex; align-items: center; gap: .4rem; max-width: calc(100% - 1rem); box-sizing: border-box; padding: .1rem .4rem; background: rgba(0, 0, 0, .72); border: 3px solid #000; color: #fff; font-size: .75rem; white-space: nowrap; overflow: hidden; }
.ep-r1 .em-flag { flex: none; width: 1.3rem; height: .9rem; box-shadow: inset 0 -.3rem 0 var(--b); }
.ep-cta { display: block; padding: .75rem .95rem; background: #0b0b0b; border-top: 3px solid #000; box-shadow: inset 6px 0 0 var(--era); color: var(--yellow); font: 900 1.1rem var(--font); }
.era-poster.saved .ep-cta { background: #1f5a16; color: #fff; box-shadow: inset 6px 0 0 #b9f08c; }
.era-poster.locked .ep-plate { background: #4d4d4d; } .era-poster.locked .ep-body { filter: grayscale(1); opacity: .72; } .era-poster.locked .ep-cta { color: #c8c8c8; box-shadow: inset 6px 0 0 #4d4d4d; }
.cup-trophy { display: block; flex: none; width: 68px; height: 56px; image-rendering: pixelated; }
.cup-legend { margin: .9rem 0 0; color: #e0cdb0; font-size: 1rem; }
:is(body.portrait, body.phone-land) .ep-strip { gap: .9rem; margin-top: .6rem; padding-top: .7rem; padding-bottom: .9rem; }
body.phone-land .btn.era-poster { width: calc(192px + 2 * var(--px)); } body.phone-land .ep-pic img { width: 192px; height: 96px; }
body.phone-land .ep-plate { padding: .2rem .35rem .2rem .5rem; gap: .45rem; } body.phone-land .ep-plate > b { font-size: 1.6rem; } body.phone-land .ep-era small { display: none; } body.phone-land .ep-era em { font-size: .85rem; }
body.phone-land .ep-tros .cup-trophy { width: 34px; height: 28px; } body.phone-land .ep-tros { padding-top: .45rem; gap: .35rem; } body.phone-land .ep-tros small { font-size: .8rem; }
body.phone-land .ep-body { padding: calc(15px + .45rem) .6rem .5rem; gap: .3rem; } body.phone-land .ep-name { font-size: .9rem; } body.phone-land .ep-line { display: none; }
body.phone-land .ep-r1 { display: none; } body.phone-land .ep-r1 .em-flag { width: 1rem; height: .7rem; }
body.phone-land .ep-cta { padding: .5rem .55rem; font-size: .8rem; white-space: nowrap; overflow: hidden; }
body.phone-land .cup-edition { padding-top: .25rem; padding-bottom: .25rem; } body.phone-land .cup-edition > span { display: none; } body.phone-land .cup-head p { display: none; } body.phone-land .cup-legend { display: none; }
body.phone-land .btn.era-poster > span { display: contents; } body.phone-land .ep-plate { align-self: stretch; }
.cup-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 1.6rem; align-items: start; margin-top: 1.4rem; }
/* the intro (menu.js _cupIntro): the road book's stage cards, the trophy buttons, the rival cards */
.cup-ihead p { color: #ffe9b0; max-width: none; } .cup-ihead .cup-imeta { margin-top: .45rem; color: var(--dim); font-size: 1rem; }
.cup-legs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.card.cup-leg { cursor: default; } .card.cup-leg:hover { border-color: #b58a63 #3a281a #3a281a #b58a63; box-shadow: 0 0 0 3px #000; }
.cup-leg .flag { background: var(--a); box-shadow: inset -1rem 0 0 var(--b); }
.cup-leg .num { padding: 0 .35rem; background: rgba(0, 0, 0, .7); border: 3px solid #000; font-size: 1rem; }
.cup-leg .cbody { padding: calc(15px + .55rem) .75rem .7rem; } .cup-leg .cname { font-size: 1.1rem; line-height: 1.25; margin-top: 0; } .cup-leg .ccountry { font-size: .9rem; }
.cup-leg .chips { margin: .5rem 0 0; gap: .3rem; } .cup-leg .chip { font-size: .8rem; padding: .1rem .35rem; } .cup-leg .chip.var { background: #2c2c2c; }
.card.cup-leg.os, .card.cup-leg.os:hover { border-color: #fff1a0 #a87600 #a87600 #fff1a0; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--yellow); }
.cup-leg.os .num { background: var(--yellow); color: #000; } .cup-os { margin-top: .5rem; color: var(--yellow); font-size: .85rem; }
.cup-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.btn.cup-lv { padding: .8rem .45rem .7rem; white-space: normal; min-width: 0; } .btn.cup-lv > span { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 0; } .btn.cup-lv > span > * { max-width: 100%; box-sizing: border-box; }
.btn.cup-lv .cup-trophy { width: 102px; height: 84px; margin-bottom: .1rem; }
.cup-lv .cl-name { font-size: 1rem; } .cup-lvhint { margin: -.3rem 0 .9rem; color: #ffe9b0; font-size: .95rem; line-height: 1.4; }
.cup-lv .cl-state { font-style: normal; font-size: .72rem; color: var(--yellow); } .cup-lv .cl-state.held { color: #6bff4c; }
.cup-lv .cl-state.shut { color: #c8c8c8; display: inline-flex; align-items: center; gap: .3rem; } .cup-lv .cl-state .ep-padlock { width: 10px; height: 12px; }
.btn.cup-lv.sel { border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c; }
.btn.cup-lv.sel.focus, .btn.cup-lv.sel:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c, 0 0 0 11px #3d6fe0; }
.btn.cup-lv.disabled { opacity: .45; }
.cup-pick .cup-carh { margin-top: .4rem; }
.cup-cars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.btn.cup-car { padding: .55rem .4rem .5rem; min-width: 0; } .btn.cup-car > span { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.btn.cup-car img { width: 96px; height: 48px; image-rendering: pixelated; border: 3px solid #000; }
.btn.cup-car b { font-size: .95rem; max-width: 100%; }
.btn.cup-car.sel { border-color: #b9f08c #1f5a16 #1f5a16 #b9f08c; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c; }
.btn.cup-car.sel.focus, .btn.cup-car.sel:hover { border-color: #fff; box-shadow: 0 0 0 3px #000, 0 0 0 7px #3ddc5c, 0 0 0 11px #3d6fe0; }
.btn.cup-car.cup-locked { pointer-events: none; }
.xr-cars { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .6rem; }   /* the event rally's car pick (js/game/xrally.js): the event's cars only */
.btn.cup-car.locked img { filter: grayscale(1) brightness(.75); } .btn.cup-car .lock-need { font-size: .7rem; }
body.phone-land .btn.cup-car b { font-size: .75rem; } body.phone-land .cup-cars { gap: .5rem; }
.cup-rivals { margin-top: 0; } .cup-rivals h3 small { margin-left: .9rem; color: var(--dim); font-size: .95rem; } body.phone-land .cup-rivals h3 small { display: none; }
.res-prog .cup-trophy { display: inline-block; width: 34px; height: 28px; vertical-align: middle; }
.cup-rcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.cup-rcard { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: .3rem .8rem; align-items: start; padding: .7rem; background: rgba(0, 0, 0, .4); border: 3px solid #000; box-shadow: inset 4px 0 0 var(--tc, #555); }
.cup-rcard img { grid-row: 1 / span 3; width: 96px; height: 48px; image-rendering: pixelated; border: 3px solid #000; box-sizing: content-box; }
.cup-rcard b { font-size: 1.1rem; } .cup-rcard em { justify-self: start; font-style: normal; font-size: .8rem; padding: .05rem .4rem; background: var(--tc); border: 3px solid #000; color: #fff; }
.cup-rcard small { color: #e0e0e0; font-size: .85rem; line-height: 1.35; text-transform: none; }
.cup-rcard.t-risk { --tc: #e53935; } .cup-rcard.t-steady { --tc: #2f62c9; } .cup-rcard.t-nemesis { --tc: #8e44c7; }
.cup-entry { margin: .9rem 0 0; color: var(--dim); font-size: 1rem; }
@media (max-width: 1100px) { .cup-legs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.phone-land .cup-legs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; } body.phone-land .cup-leg .ccountry, body.phone-land .cup-leg .chip.var { display: none; }
body.phone-land .cup-leg .thumb { aspect-ratio: 2 / 1; } body.phone-land .cup-leg .cname { font-size: .8rem; }
body.phone-land .btn.cup-lv .cup-trophy { width: 68px; height: 56px; } body.phone-land .cup-lvhint { font-size: .75rem; }
body.phone-land .cup-rcard { grid-template-columns: 48px minmax(0, 1fr); padding: .45rem; } body.phone-land .cup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } body.phone-land .cup-rcard img { width: 48px; height: 24px; } body.phone-land .cup-rcard small { display: none; }
body.portrait .cup-legs { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.portrait .cup-rcards { grid-template-columns: minmax(0, 1fr); }
.cup-pick .cup-locked { opacity: .55; pointer-events: none; }
.cup-pick .cup-best { margin: .8rem 0 .2rem; color: var(--dim); font-size: 1.1rem; }
.cup-awards { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.2rem; }
.cup-award { display: inline-flex; gap: .7rem; align-items: center; padding: .4rem .9rem; background: rgba(0, 0, 0, .7); border: 3px solid var(--green); font-size: 1.1rem; } .cup-award em { font-style: normal; font-weight: 800; }
.cup-final { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, .95fr); }
.cup-title { text-align: center; } .cup-title .cup-trophy { width: 136px; height: 112px; margin: 0 auto .2rem; }
/* the results screen's cup panel: the era's colour on the left, the rounds of the road book (menu.js results, r.champ.index) */
.panel.cup-panel { box-shadow: inset 6px 0 0 var(--era), 0 0 0 3px #000; }
.cup-prog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: .2rem 0 .7rem; }
.cup-prog i { font-style: normal; text-align: center; padding: .15rem 0; font-size: .85rem; color: #9a9a9a; background: #1a1a1a; border: 3px solid #000; }
.cup-prog i.done { color: #fff; background: var(--era); } .cup-prog i.now { color: #000; background: var(--yellow); } .cup-prog i.os:not(.now):not(.done) { color: var(--yellow); }
/* the champion screen's ceremony (menu.js _champion): plate, the trophy on its podium step with static pixel confetti when won, a stamp */
.cup-title .ct-plate { display: flex; align-items: center; gap: .6rem; margin: -.2rem 0 .9rem; padding: .35rem .6rem; background: var(--era); border: 3px solid #000; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); text-align: left; }
.ct-plate b { font: 900 2rem/1 var(--font); } .ct-plate i { display: flex; flex-direction: column; gap: .25rem; min-width: 0; font-style: normal; } .ct-plate em { font-style: normal; font-size: 1.05rem; } .ct-plate small { font-size: .85rem; opacity: .92; }
.ct-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: .6rem 0 0; }
.ct-stage .cup-trophy { margin: 0; position: relative; z-index: 1; }
.ct-step { width: 7.5rem; min-height: 1.6rem; padding: .35rem 0 .45rem; margin-top: -3px; background: var(--era); border: 3px solid #000; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35), inset 0 3px 0 rgba(255, 255, 255, .25); font: 900 1.6rem/1 var(--font); color: #fff; }
.ct-stage:not(.lit) .ct-step { background: #4d4d4d; }
.ct-stage.lit::before { content: ""; position: absolute; left: 50%; top: .4rem; width: 6px; height: 6px; background: var(--yellow);
  box-shadow: -66px 6px 0 #fff, -48px 30px 0 var(--era), -78px 48px 0 var(--yellow), -36px -6px 0 #e53935, 42px 0 0 #fff, 60px 24px 0 var(--yellow), 78px 54px 0 var(--era), 30px 42px 0 #2fb84a, -96px 18px 0 #1e63d6, 96px 12px 0 #e53935, -24px 66px 0 #fff, 54px 72px 0 #1e63d6; }
.cup-title h3 { margin: .9rem 0 0; font-size: 1.35rem; } .cup-title.won h3 { color: var(--yellow); }
.ct-stamp { display: inline-block; margin-top: .7rem; padding: .2rem .6rem; font-style: normal; font-size: .95rem; color: #fff; background: #2fb84a; border: 3px solid #000; transform: none; } .cup-title h3 { font-size: 1.3rem; } .cup-title p { margin: .3rem 0 0; font-size: 1.1rem; } .cup-title .cup-rank { font: 900 4rem/1.1 var(--font); }
.cup-final-awards .off { opacity: .5; } .cup-final-awards .total { margin-top: .5rem; border-top: 3px solid #000; padding-top: .5rem; }
.brow span em.good, .brow span em.bad { font-size: .9em; }
@media (max-width: 900px) { .cup-grid, .cup-final { grid-template-columns: minmax(0, 1fr); } }
.screen-results .board.cup-board .brow, .cup-final .board .brow { grid-template-columns: 1.8rem minmax(0, 1fr) 6.8rem 5rem; } .cup-final .board .brow { gap: .4rem; font-size: 1rem; }
.cup-final .res-lines > div { flex-wrap: wrap; gap: .3rem 1rem; } .cup-final .res-lines .cup-stage { flex: 1 1 auto; }


/* ---- yesterday's results (Menu._dayTabs: TODAY | YESTERDAY above the era tabs of the stage of the day and the daily rally) */
.yd-tabs { margin: 0 0 .5rem; }
.yd-tab { flex: 0 0 auto; min-width: 7.5rem; padding: .3rem 1rem; background: rgba(0, 0, 0, .45); border: 3px solid #000; color: #fff; font: inherit; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.yd-tab b { font-weight: 700; }
.yd-tab.sel { border-color: #fff; background: rgba(0, 0, 0, .75); }
.yd-tab:not(.sel) { opacity: .75; }
.yd-tab:hover, .yd-tab.focus { outline: 3px solid #fff; outline-offset: 0; opacity: 1; }
.yd-tab.disabled { opacity: .4; cursor: default; } .yd-tab.disabled:hover { outline: none; opacity: .4; }   /* an etap that has not started (the event rally's tabs) */
.xr-board .yd-tab { flex: 1 1 0; min-width: 0; padding-left: .3rem; padding-right: .3rem; white-space: normal; }   /* three tabs (ETAP 1 | ETAP 2 | OVERALL) fit a portrait phone: the label may wrap */
.xr-board .rk-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }   /* the event's classes only: the tabs share the row (.rally-board is a six-column grid) */
.yd-sum { margin: 0 0 .4rem; font-size: .95rem; color: #e0e0e0; }

/* ---- the event rally's screen (js/game/xrally.js introScreen, owner 2026-11-12 variant A "showroom"; the template of every event rally):
   left the car in 3D standing on a dark stage of its own (js/game/turntable.js, turned by a drag), its name, blurb, bars and chips, the
   event's cars by class; right the etap's road cards (photo from the content server) and the player's attempts, place and rivals */
.xr-a .xr-head h2 { font-size: 2.4rem; }
.xr-a .xr-head h2::after { display: none; }
.xr-tagline { display: inline-block; margin: .35rem 0 0 !important; padding: .3rem .7rem; color: var(--yellow) !important; font-weight: 800; font-size: 1.1rem !important; max-width: none !important; background: rgba(0, 0, 0, .8); border: 2px solid #000; }   /* the black bar: readable over the menu scene (owner 2026-11-12) */
.xr-a .row-foot .xr-clock { margin-left: auto; grid-row: auto; padding: .25rem .9rem; gap: .1rem; }
.xr-a .xr-clock small { font-size: .8rem; } .xr-a .xr-clock b { font-size: 1.4rem; }
.xr-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; margin-top: 1rem; align-items: start; }
.xr-show { display: flex; flex-direction: column; }
.xr-room { display: contents; }   /* the picked car (stage + text), refilled in place when another car is picked */
.xr-stage { position: relative; height: clamp(12rem, 36vh, 24rem); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; background: #141416; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .55); }
.xr-stage.drag { cursor: grabbing; }
.xr-stage .turntable { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.xr-flat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.xr-flat canvas { height: 62%; width: auto; image-rendering: pixelated; }
.xr-stage.has-3d .xr-flat { display: none; }
.xr-stage-tags { position: absolute; z-index: 1; left: .6rem; top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; pointer-events: none; }
.xr-drag { position: absolute; z-index: 1; right: .6rem; bottom: .5rem; pointer-events: none; }
.xr-drag span { display: block; padding: .15rem .5rem; color: #ddd; background: rgba(0, 0, 0, .55); border: 3px solid #000; font-size: .7rem; }
.xr-chip { display: inline-block; padding: .2rem .55rem; background: #111; border: 3px solid #5a5a60; color: #f4f1e6; font-size: .85rem; font-weight: 800; white-space: nowrap; }
.xr-chip.xr-cls { background: var(--cc); border-color: #000; color: #fff; }
.xr-chip.xr-lock { background: #7a2a22; border-color: #000; }
.xr-show-body, .xr-pick { background: #9a9a9a var(--tex-stone); background-size: 64px 64px; background-blend-mode: multiply; image-rendering: pixelated; }
.xr-show-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; padding: 1rem 1.2rem .6rem; border-top: 3px solid #000; }
.xr-about h2 { margin: 0; font: 900 2rem/1.05 var(--font); color: #fff; }
.xr-about p { margin: .5rem 0 0; color: #fff; font-size: 1rem; font-weight: 700; line-height: 1.35; }
.xr-specs .statbars { margin-top: .2rem; }
.xr-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.xr-pick { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; padding: .4rem 1.2rem 1rem; }
.xr-pick-grp small { display: block; margin-bottom: .35rem; font-weight: 800; font-size: .85rem; }
.xr-pick .cup-cars { grid-template-columns: repeat(2, minmax(0, 11rem)); gap: .6rem; }
.xr-pick .btn.cup-car { padding: .35rem .35rem .4rem; }
.xr-pick .btn.cup-car img { width: 72px; height: 36px; }
.xr-pick .btn.cup-car img.xr-car-pic { width: 100%; height: auto; aspect-ratio: 5 / 2; border: 0; image-rendering: auto; background: #141416; box-shadow: inset 0 0 0 2px #000; }
.xr-pick .btn.cup-car.locked img.xr-car-pic { filter: grayscale(1) brightness(.6); }
.xr-rcol { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.xr-rcol > .panel { margin-top: 0; }
.xr-etap h3 { margin-top: 0; font-size: 1.35rem; }
.xr-blurb { margin: .1rem 0 .8rem; color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.35; }
.xr-roads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.rally-legs .champ-row.xr-road { position: relative; display: block; min-height: 5.6rem; padding: 0; background: #1b1b1f; border: 3px solid #000; box-shadow: 0 0 0 2px #5a5a60; overflow: hidden; font-size: 1rem; }
.xr-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.xr-ss { position: absolute; left: 0; top: 0; padding: .1rem .45rem; background: var(--yellow); color: #111; font-weight: 900; font-size: .95rem; }
.xr-road-lab { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: .15rem; padding: .35rem .5rem; background: rgba(0, 0, 0, .72); }
.rally-legs .xr-road-lab b { font-size: .85rem; color: #fff; } .rally-legs .xr-road-lab small { text-align: left; font-size: .72rem; color: #bdb6aa; }
.xr-road-none span { display: block; padding: .8rem; }
.xr-you .daily-note .notice { margin: .6rem 0 0; font-size: .95rem; }
.xr-you .rally-nick { margin-top: .6rem; }
.xr-you-btns { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .8rem; }
.xr-you-btns .btn { font-size: 1rem; padding: .4rem 1rem; }
.xr-rcol > .panel { padding: .9rem 1.1rem; }
.xr-you .daily-note .notice { padding: .4rem .7rem .4rem .5rem; font-size: .85rem; }
.xr-you-btns { margin-top: .6rem; }
/* the showroom is a .panel-dark.accent (the shared dark panel): the car on the same dark ground as the text */
.xr-show .xr-stage { background: transparent; box-shadow: none; }
.xr-show .xr-show-body, .xr-show .xr-pick { background: none; }
.xr-show .xr-show-body { border-top: 0; padding-top: .4rem; }
/* the car tiles on the dark panel: flat graphite, no stone (owner 2026-11-12); the green ring (picked) and the blue focus stay */
.xr-pick .btn.cup-car { background: #1e1e22; background-image: none; border-color: #4a4a50 #1a1a1a #1a1a1a #4a4a50; }
.xr-pick .btn.cup-car.focus, .xr-pick .btn.cup-car:hover { background: #26262b; }
.xr-pick .btn.cup-car img.xr-car-pic { background: transparent; box-shadow: none; }
/* the first-visit reading order (owner 2026-11-12 "jasne jak ABC"): numbered steps 1 pick a car, 2 your stages, 3 drive (the big START) */
.xr-step { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .6rem; margin: 0 0 .6rem; }
.xr-step i { align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; background: var(--yellow); color: #111; border: 3px solid #000; font: 900 1.05rem var(--font); font-style: normal; }
.xr-step b { color: var(--yellow); font: 900 1.25rem var(--font); }
.xr-step small { color: #e0cdb0; font-size: .85rem; font-weight: 700; }
.xr-show > .xr-step { margin: .8rem 1.2rem .2rem; }
.xr-show > .xr-pick { padding-top: .2rem; padding-bottom: .4rem; }
.xr-show .xr-stage { height: clamp(11rem, 30vh, 20rem); }
.xr-etap > h3 { font-size: 1.05rem; margin: 0 0 .2rem; }
.xr-hint { margin: 0 0 .7rem; color: #fff; font-size: 1.05rem; font-weight: 800; line-height: 1.35; }
.btn.xr-go { display: block; width: 100%; margin: 0 0 .7rem; padding: .7rem 1rem; }
.btn.xr-go > span { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.xr-go-sub { font-size: .8rem; font-weight: 800; opacity: .9; }
.xr-you .daily-note .notice { margin: 0 0 .6rem; }
/* "how it works": over the event screen on the first visit of an event (RULES opens it again) */
.xr-howto { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 2rem; background: rgba(0, 0, 0, .55); }
.xr-howto-box { width: min(46rem, 100%); padding: 1.4rem 1.8rem 1.6rem; }
.xr-howto-box h2 { margin: 0 0 1rem; font: 900 2rem var(--font); color: #fff; }
.xr-prize { display: flex; align-items: center; gap: 1rem; padding: .7rem .9rem; margin-bottom: 1rem; background: rgba(255, 210, 63, .1); border: 3px solid var(--yellow); }
.xr-prize p { margin: 0; color: #fff; font-weight: 800; font-size: 1.05rem; }
.xr-cups { display: flex; align-items: flex-end; gap: .3rem; } .xr-cups .tro { width: 24px; height: 24px; margin: 0; } .xr-cups .tro-1 { width: 32px; height: 32px; }
.xr-how-steps { list-style: none; margin: 0 0 1.3rem; padding: 0; display: grid; gap: .8rem; }
.xr-how-steps li { display: flex; align-items: center; gap: .9rem; }
.xr-how-steps i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; background: var(--yellow); color: #111; border: 3px solid #000; font: 900 1.3rem var(--font); font-style: normal; }
.xr-how-steps p { margin: 0; color: #fff; font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.xr-howto-box .btn { display: block; width: 100%; }
.xr-how-steps p, .xr-prize p { flex: 1; min-width: 0; }
.xr-how-steps { grid-template-columns: minmax(0, 1fr); } .xr-how-steps li { min-width: 0; }
.xr-etap .xr-blurb { font-size: .85rem; margin-bottom: .5rem; }
.xr-you .xr-step, .xr-etap .xr-step { margin-bottom: .35rem; }
.xr-hint { font-size: .95rem; margin-bottom: .5rem; }
.btn.xr-go { padding: .5rem 1rem; margin-bottom: .5rem; }
.xr-show .xr-stage { height: clamp(12rem, 33vh, 22rem); }
.xr-you-btns { margin-top: .5rem; } .xr-you-btns .btn { padding: .3rem .8rem; font-size: .9rem; }
.rally-legs .champ-row.xr-road.has-photo { min-height: 5.8rem; } .xr-roads { gap: .5rem; }
.xr-you .xr-hint { font-size: 1.05rem; }
.xr-you-btns { justify-content: flex-end; margin-top: .2rem; }
/* phones in landscape (body.phone-land): the four car tiles in one row, the car's text above its bars, the etap's blurb dropped (the
   photos say it), a step's sub-line on its own line, long road names smaller */
body.phone-land .xr-pick { flex-wrap: nowrap; gap: .4rem .6rem; padding: .2rem .6rem .5rem; }
body.phone-land .xr-pick-grp { flex: 1 1 0; min-width: 0; }
body.phone-land .xr-pick .cup-cars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
body.phone-land .xr-show-body { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: .4rem .6rem .5rem; }
body.phone-land .xr-show > .xr-step { margin: .4rem .6rem .1rem; }
body.phone-land .xr-step small { flex-basis: 100%; min-width: 0; }
body.phone-land .xr-etap .xr-blurb { display: none; }
body.phone-land .xr-grid { gap: .6rem; margin-top: .4rem; }
body.phone-land .xr-rcol { gap: .6rem; }
body.phone-land .xr-rcol > .panel { padding: .5rem .6rem; }
body.phone-land .rally-legs .xr-road-lab { padding: .25rem .35rem; }
body.phone-land .rally-legs .xr-road-lab b canvas.px { max-width: 100%; height: auto; }   /* one long word (CASTAGNICCIA) shrinks to the card */
body.phone-land .xr-about h2 { font-size: 1.4rem; }
/* the teaser (some days before the start): the cover of the event (its cars, rendered at publish time) beside the date, the prize, the cars and the licence line */
.xr-tease { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; margin-top: 1rem; padding: 1rem 1.2rem; }
.xr-cover { min-height: 14rem; display: flex; align-items: center; justify-content: center; }
.xr-cover img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.xr-cover.none { background: #141416; box-shadow: inset 0 0 0 3px #000; }
.xr-tease-side { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.xr-when b { display: block; color: var(--yellow); font: 900 2rem var(--font); } .xr-when small { color: #e0cdb0; font-weight: 800; font-size: .95rem; }
.xr-tease .xr-prize { margin: 0; }
.xr-tease-cls small { display: block; margin-bottom: .3rem; font-weight: 800; font-size: .85rem; }
.xr-tease-cls .xr-chip { margin: 0 .4rem .4rem 0; }
.xr-tease-etaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.xr-tease-etaps .panel { margin-top: 0; } .xr-dates { color: #e0cdb0; font-weight: 800; }
/* the teaser's line-up (owner 2026-11-12, "more interactive"): turn sprites of the event's cars (8 frames, ev.lineup), on plinths of their
   class colour; they drive in one by one, one turns now and then, a hover turns a car round and round, a drag turns it by hand */
.xr-tease.has-lineup { grid-template-columns: minmax(0, 1fr); }
.xr-lineup-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; min-width: 0; }
.xr-lineup { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: .6rem 2rem; }
.xr-lu-grp { display: flex; flex-direction: column; gap: .3rem; }
.xr-lu-grp > small { font-weight: 800; font-size: .85rem; }
.xr-lu-row { display: flex; gap: .4rem; }
.xr-lu-car { --cc: #888; position: relative; display: flex; flex-direction: column; align-items: center; width: 15rem; padding: .3rem .3rem .5rem; background: none; border: 3px solid transparent; color: #fff; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.xr-lu-car.scrub { cursor: grabbing; }
.xr-lu-car.focus { border-color: #3d6fe0; }
.xr-lu-pic { display: block; width: 100%; aspect-ratio: 16 / 9; background-repeat: no-repeat; background-size: 800% 100%; background-position: 0 0; image-rendering: pixelated; transition: transform .2s steps(3); }
.xr-lu-car:hover .xr-lu-pic, .xr-lu-car.focus .xr-lu-pic { transform: translateY(-.4rem) scale(1.08); animation: xr-spin 3.2s steps(8) infinite; }   /* one turn in 3.2 s: slow enough to see each side (owner) */
.xr-lu-car.scrub .xr-lu-pic { animation: none; }
.xr-lu-base { display: block; width: 78%; height: .55rem; margin-top: -.35rem; background: #1e1e22; border-top: 4px solid var(--cc); }
.xr-lu-car:hover .xr-lu-base, .xr-lu-car.focus .xr-lu-base, .xr-lu-car.sel .xr-lu-base { background: var(--cc); }
.xr-lu-name { margin-top: .45rem; font-weight: 800; font-size: .95rem; }
.xr-lu-car small { color: #e0cdb0; font-size: .75rem; font-weight: 800; }
.xr-lu-car.locked small { color: #ff8a7a; }
.xr-lineup:hover .xr-lu-car:not(:hover) { filter: brightness(.55); }
.xr-lu-info { margin: 0; color: var(--yellow); font-weight: 800; font-size: .95rem; text-align: center; }
@keyframes xr-spin { from { background-position: 0% 0; } to { background-position: 114.2857% 0; } }
@media (prefers-reduced-motion: reduce) { .xr-lu-car, .xr-lu-car .xr-lu-pic { animation: none !important; } }
.xr-tease.has-lineup .xr-tease-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem 1.6rem; border-top: 3px solid #2b2b2f; padding-top: .9rem; }
.xr-tease.has-lineup .xr-tease-side > * { flex: 0 1 auto; }
.xr-tease.has-lineup .xr-prize { max-width: 30rem; }
.xr-tease.has-lineup .xr-hint { max-width: 26rem; margin: 0; }
.xr-lu-car { width: 16.5rem; padding-top: 1.2rem; }
.xr-lu-pic { transform: scale(1.32); transform-origin: 50% 80%; }
.xr-lu-car:hover .xr-lu-pic, .xr-lu-car.focus .xr-lu-pic { transform: translateY(-.4rem) scale(1.45); }
.xr-lu-base { margin-top: .2rem; }
.xr-tease.has-lineup .xr-tease-side { justify-content: center; }
.xr-tease.has-lineup .xr-prize { max-width: none; padding: .5rem 1rem; }
.xr-tease.has-lineup .xr-prize p { white-space: nowrap; }
.xr-title-row { display: flex; align-items: center; gap: 1.2rem; }
.xr-head-when .xr-when-badge { grid-row: auto; flex: none; padding: .35rem .9rem; gap: .1rem; }
.xr-head-when .xr-when-badge small { font-size: .85rem; } .xr-head-when .xr-when-badge b { font-size: 1.6rem; }
/* between the stages of the event rally (menu.js results + .res-xr): the place, the move and the gap big; the next stage on the right */
.res-xr .res-main .res-lines, .res-xr .res-main .res-medal, .res-xr .tasks-panel, .res-xr .res-tasks { display: none; }
.xr-legp { padding: 1rem 1.2rem; margin-top: 0; }
.xr-legp h3 { margin: 0 0 .4rem; color: var(--yellow); font: 800 1.15rem var(--font); }
.xr-hero { display: flex; align-items: center; gap: 1.2rem; }
.xr-hero-place small { display: block; color: #e0cdb0; font-size: .85rem; font-weight: 800; }
.xr-hero-place b { font: 900 3.4rem/1 var(--font); color: #fff; } .xr-hero-place.gold b { color: var(--yellow); }
.xr-hero-place em { margin-left: .4rem; color: #e0cdb0; font-style: normal; font-weight: 800; }
.xr-move { padding: .25rem .7rem; background: #2f7a2a; border: 3px solid #000; color: #fff; font-weight: 900; font-size: 1.05rem; }
.xr-hero-gap { margin: .5rem 0 0; color: #fff; font-size: 1.15rem; font-weight: 800; } .xr-hero-gap.gold { color: var(--yellow); } .xr-hero-gap b { color: var(--yellow); }
.xr-hero-cum { margin: .4rem 0 0; color: #e0cdb0; font-size: .9rem; font-weight: 800; } .xr-hero-cum b { color: #fff; }
.xr-nextp { padding: 1rem 1.2rem; margin-top: 0; } .xr-nextp h3 { margin: 0 0 .5rem; color: var(--yellow); font: 800 1.15rem var(--font); }
.xr-nextp .champ-row.xr-road.has-photo { min-height: 11rem; }
.xr-chase { margin: .6rem 0 0; color: #fff; font-weight: 800; font-size: 1rem; } .xr-chase small { color: #e0cdb0; }
.xr-hero-place { display: grid; grid-template-columns: auto auto; align-items: end; column-gap: .5rem; }
.xr-hero-place small { grid-column: 1 / -1; margin-bottom: .3rem; }
.xr-hero-place em { margin: 0 0 .35rem; }
.xr-hero-place { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 .5rem; }
.xr-hero-place small { flex-basis: 100%; }
.xr-finp { padding: 1rem 1.2rem; margin-top: 0; } .xr-finp h3 { margin: 0 0 .5rem; color: var(--yellow); font: 800 1.15rem var(--font); }
.xr-finp .xr-hero { gap: 2.2rem; flex-wrap: wrap; }
.xr-fin-time small { display: block; color: #e0cdb0; font-size: .85rem; font-weight: 800; } .xr-fin-time b { font: 900 2.8rem/1 var(--font); color: #fff; }
.xr-legs-done { margin-top: 1rem; padding: .8rem 1rem 1rem; }
/* YOUR STAGES on the finish (xrally.js doneScreen, owner 2026-11-12 after the Weekly Cup's "your days"): a tile per stage, its photo, the
   time, the place on the stage and the gap to its winner, a cup for its podium, the best one framed yellow */
.xr-sst-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.xr-sst-head b { color: var(--yellow); font: 900 1.15rem var(--font); } .xr-sst-head small { color: #bdb6aa; font-size: .72rem; font-weight: 800; }
.xr-sst-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.xr-sst { position: relative; min-height: 8.6rem; background: #1b1b1f; border: 3px solid #000; box-shadow: 0 0 0 2px #5a5a60; overflow: hidden; }
.xr-sst.best { box-shadow: 0 0 0 3px var(--yellow); }
.xr-sst-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.xr-sst .xr-ss { position: absolute; left: 0; top: 0; z-index: 1; padding: .1rem .45rem; background: var(--yellow); color: #111; font-weight: 900; font-size: .95rem; }
.xr-sst-cup { position: absolute; right: .3rem; top: .25rem; z-index: 1; line-height: 0; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .6)); }
.xr-sst-lab { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: .2rem; padding: .35rem .5rem .4rem; background: rgba(0, 0, 0, .8); }
.xr-sst-lab b { color: #fff; font: 900 1.45rem/1 var(--font); }
.xr-sst-lab em { font-style: normal; color: #e0cdb0; font-size: .8rem; font-weight: 900; } .xr-sst.won .xr-sst-lab em { color: var(--yellow); }
.xr-sst-sum { margin: .6rem 0 0; color: #e0cdb0; font-size: .85rem; font-weight: 800; }
body.phone-land .xr-sst { min-height: 6.4rem; } body.phone-land .xr-sst-lab b { font-size: 1.05rem; } body.phone-land .xr-sst-head small { display: none; }
/* the event rally's podium (xrally.js podiumHtml): the Weekly Cup's steps and pixel cars, the rally time under the step */
.xr-podium .wk-podium { margin: .6rem 0 1rem; }
.xr-podium .wk-pd-cap { color: #fff; font-weight: 800; }
.res-grid.xr-rank { grid-template-columns: minmax(0, 1fr); }
.xr-rank-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.xr-rank-split .xr-podium .wk-podium { margin-top: 0; }
/* the event's final results (xrally.js finalScreen, mock-up X4): the player's banner, one podium per class */
.xr-final-me { margin-top: 1rem; padding: .9rem 1.2rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.4rem; }
.xr-final-me.gold { border-color: var(--yellow); }
.xr-final-big { font: 900 1.8rem var(--font); color: #fff; } .xr-final-me.gold .xr-final-big { color: var(--yellow); }
.xr-final-me p { margin: 0; color: #fff; font-weight: 800; font-size: 1.05rem; }
.xr-final { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.xr-final-cls { padding: 1rem 1.2rem; } .xr-final-cls h3 { margin: 0 0 .4rem; font: 900 1.2rem var(--font); }
.xr-pd-sprite { display: block; width: calc(48px * var(--cs, 3) * 1.3); aspect-ratio: 16 / 9; background-repeat: no-repeat; background-size: 800% 100%; background-position: 14.2857% 0; image-rendering: pixelated; }   /* frame 1 of 8: the side */
/* phones in landscape: the event's podiums at the portrait sizes of the Weekly Cup (two podiums side by side, ~120 px a step);
   the teaser's prize line wraps; "how it works" fits the low screen */
body.phone-land .xr-podium .wk-podium { --w: 1fr; --gap: .3rem; }
body.phone-land .xr-podium .wk-pd-col, body.phone-land .xr-podium .wk-pd-cap { flex: 1 1 0; }
body.phone-land .xr-podium .wk-pd-car { height: 48px; } body.phone-land .xr-podium .wk-pd-car img.px { width: 96px; height: 48px; }
body.phone-land .xr-podium .xr-pd-sprite { width: 112px; }
body.phone-land .xr-podium .wk-pd-cup img.px { width: 44px; height: 38px; }
body.phone-land .xr-podium .wk-pd-n { font-size: 1.6rem; } body.phone-land .xr-podium .wk-pd-nick { font-size: .78rem; }
body.phone-land .xr-podium .wk-pd-col.t1 { --h: 4.4rem; } body.phone-land .xr-podium .wk-pd-col.t2 { --h: 3.6rem; } body.phone-land .xr-podium .wk-pd-col.t3 { --h: 3rem; }
body.phone-land .xr-final { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
body.phone-land .xr-final-cls { padding: .5rem .6rem; }
body.phone-land .xr-final-me { margin-top: .5rem; padding: .5rem .8rem; } body.phone-land .xr-final-big { font-size: 1.3rem; }
/* the ranking: STAGE WINNERS under the podium (a lower podium then), the cups by the nicks; the final results: the honours of each class,
   YOURS and BRAG in the banner (js/game/xrally.js winnersHtml / honoursHtml, owner 2026-11-13) */
.xr-rank-left { min-width: 0; }
.xr-wins { margin-top: .9rem; }
.xr-wins .xr-sst-row { gap: .4rem; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.xr-wins .xr-sst { min-height: 5.6rem; }
.xr-wins .xr-sst .xr-ss { font-size: .8rem; }
.xr-wins .xr-sst-lab { gap: .15rem; padding: .25rem .4rem .3rem; }
.xr-wins .xr-sst-lab b { font: 900 .85rem/1.1 var(--font); white-space: nowrap; overflow: hidden; } .xr-wins .xr-sst.best .xr-sst-lab b { color: var(--yellow); }
.xr-wins .xr-sst-lab em { font-size: .78rem; }
.xr-rank-split.with-wins .wk-podium.big { margin-top: 0; }
.xr-rank-split.with-wins .wk-podium.big .wk-pd-col.t1 { --h: 6.4rem; } .xr-rank-split.with-wins .wk-podium.big .wk-pd-col.t2 { --h: 5rem; } .xr-rank-split.with-wins .wk-podium.big .wk-pd-col.t3 { --h: 4rem; }
.xr-rank-split.with-wins .wk-pd-cup img.px { width: auto; height: 60px; }
.xr-rank-split.with-wins .wk-podium.big .wk-pd-n { font-size: 2.4rem; }
.xr-cups { display: inline-flex; align-items: center; gap: 2px; margin-left: .35rem; vertical-align: -3px; line-height: 0; }
.xr-cups i { font-style: normal; color: var(--yellow); font-size: .75rem; font-weight: 900; line-height: 1; }
.xr-hon { margin-top: .9rem; padding-top: .7rem; border-top: 3px solid #000; display: flex; flex-direction: column; gap: .35rem; }
.xr-hon-row { display: grid; grid-template-columns: 28px 11.2rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; font-size: .9rem; }
.xr-hon-row .wk-hicon { margin: 0; }
.xr-hon-k { color: #bdb6aa; font-weight: 800; font-size: .78rem; }
.xr-hon-row b { min-width: 0; overflow: hidden; white-space: nowrap; color: #fff; font-weight: 900; } .xr-hon-row.me b { color: var(--yellow); }
.xr-hon-row em { font-style: normal; color: #e0cdb0; font-weight: 900; }
.xr-final-me.has-brag { position: relative; padding-right: 15rem; }
.xr-final-me.has-brag > .btn { position: absolute; right: 1.2rem; top: 0; bottom: 0; height: max-content; margin: auto 0; }
.xr-final-me .xr-final-yours { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: #e0cdb0; font-size: .9rem; }
.xr-final-yours span { display: inline-flex; align-items: center; gap: .3rem; } .xr-final-yours .xr-cups { margin-left: 0; }
body.phone-land .xr-wins .xr-sst-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.phone-land .xr-wins .xr-sst-head small { display: none; }
body.phone-land .xr-wins .xr-sst { min-height: 5.6rem; } body.phone-land .xr-wins .xr-sst-lab b { font-size: .7rem; } body.phone-land .xr-wins .xr-sst-lab em { font-size: .66rem; }
body.phone-land .xr-wins .xr-sst-cup img.px { width: 28px; height: auto; }
body.phone-land .xr-podium .wk-pd-nick { white-space: normal; }
body.phone-land .xr-hon-row { grid-template-columns: 22px minmax(0, 1fr) auto; gap: .35rem; font-size: .76rem; } body.phone-land .xr-hon-k { display: none; }
body.phone-land .xr-final-me.has-brag { padding-right: .8rem; } body.phone-land .xr-final-me.has-brag > .btn { position: static; margin: .2rem 0 0; }
body.phone-land .xr-tease.has-lineup .xr-prize p { white-space: normal; }
body.phone-land .xr-tease.has-lineup .xr-tease-side > * { min-width: 0; max-width: 100%; }
body.phone-land .xr-fin-time small { margin-bottom: .25rem; } body.phone-land .xr-fin-time b { font-size: 2.2rem; }
body.phone-land .xr-howto { padding: .3rem; }
body.phone-land .xr-howto-box { padding: .6rem 1rem .7rem; max-height: 100%; overflow-y: auto; }
body.phone-land .xr-howto-box h2 { font-size: 1.3rem; margin-bottom: .5rem; }
body.phone-land .xr-how-steps { gap: .4rem; margin-bottom: .6rem; } body.phone-land .xr-prize { margin-bottom: .5rem; padding: .4rem .6rem; }
/* a new etap: once per etap, above the steps */
.xr-newetap { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; margin-top: 1rem; padding: .8rem 1.2rem; }
.xr-newetap b { color: var(--yellow); font: 900 1.5rem var(--font); }
.xr-newetap p { margin: 0; color: #fff; font-weight: 800; }
.xr-newetap .btn { margin-left: auto; padding: .35rem 1rem; font-size: 1rem; }

/* ---- record a film (js/game/record.js): NAGRAJ FILM on the results. The screen is opaque: while it records, the scene
 * behind is rendered at the film's size and would show stretched; the film itself is the preview. */
.screen-record { background: #0b0b0c; }
/* NAGRAJ FILM on the results' bar: the camera before the words, set apart on the right (js/game/record.js button) */
.btn.rec-btn { display: inline-flex; align-items: center; gap: .7rem; margin-left: auto; }
.rec-btn .rec-ico { display: block; flex: none; image-rendering: pixelated; pointer-events: none; }
body.phone-land .btn.rec-btn { padding-left: .8rem; padding-right: .8rem; } body.phone-land .btn.rec-btn > span { display: none; }   /* a phone on its side: the camera alone keeps the bar on one row */
/* NAGRAJ FILM while new (owner 2026-11-21, js/game/record.js isNew): a yellow NOWOŚĆ tag on the button's corner that blinks a few times,
   and a line under the time in the results; the part of the run (FRAGMENT): the names only */
.rec-tag { background: var(--yellow); color: #000; border: 3px solid #000; padding: .15rem .4rem; font-size: .9rem; line-height: 1; white-space: nowrap; }
.rec-tag .pxt canvas { display: block; }
.btn.rec-btn.rec-new { position: relative; overflow: visible; border-color: var(--yellow); }
.btn.rec-new > .rec-tag { position: absolute; top: -.75rem; right: -.5rem; pointer-events: none; animation: rec-blink .6s linear 5; }
body.is-mobile .btn.rec-new > .rec-tag { top: -.55rem; right: -.55rem; width: 1.25rem; height: 1.25rem; padding: 0; }   /* a phone: a yellow square on the corner (the word stands in the line under the time) */
body.is-mobile .btn.rec-new > .rec-tag .pxt { display: none; }
body.portrait .rec-promo-go { display: none; }   /* a phone upright: the whole yellow box is the button, the words get the width */
@keyframes rec-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.rec-promo { display: flex; align-items: center; gap: .8rem; width: 100%; margin-top: 1rem; padding: .7rem 1rem; text-align: left; cursor: pointer; font: inherit; color: #fff; border-color: var(--yellow); }
.rec-promo .rec-ico { flex: none; image-rendering: pixelated; }
.rec-promo-t { order: 2; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; font-size: .95rem; }
.rec-promo-s { display: block; max-width: 100%; }
.rec-promo-go { order: 3; flex: none; font-style: normal; color: var(--yellow); font-size: 1rem; }
.rec-promo:hover, .rec-promo:focus-visible, .rec-promo.focus { border-color: #fff; outline: none; }
.rec-row.rec-parts .rec-opts { flex: 1 1 0; min-width: 0; }
body.portrait .rec-row.rec-parts .rec-opts { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: none; }
body.portrait .rec-row.rec-parts .rec-opts > .btn:not(.rec-part) { grid-column: span 3; }
body.portrait .rec-row.rec-parts .btn.rec-part { padding-left: .15rem; padding-right: .15rem; }
.rec-panel { display: flex; flex-direction: column; gap: .8rem; }
.rec-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.rec-lab { min-width: 7rem; color: #bbb; }
.rec-opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.rec-note { color: #aaa; margin: 0; }
body.portrait .rec-row { flex-direction: column; align-items: stretch; gap: .4rem; }   /* a phone upright: the label above, the choices in equal columns */
body.portrait .rec-opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; } body.portrait .rec-opts .btn { padding-left: .3rem; padding-right: .3rem; } body.portrait .rec-opts:has(> :nth-child(3)) { display: flex; } body.portrait .rec-opts:has(> :nth-child(3)) .btn { flex: 1 1 auto; }   /* three choices (the quality): widths from the words, NAJLEPSZA inside */
.rec-view { display: flex; align-items: center; justify-content: center; min-height: 12rem; background: #000; }
body.is-mobile .screen-record.rec-film .head { display: none; }   /* a phone: the film gets the height (the bar above names the screen's actions) */
.rec-cv, .rec-video { display: block; max-width: 100%; max-height: calc(100vh - 16rem); width: auto; height: auto; background: #000; image-rendering: auto; }
.rec-bar { height: .8rem; background: #222; border: 2px solid #555; }
.rec-bar > i { display: block; height: 100%; width: 0; background: var(--yellow); }
.rec-info { margin: 0; color: #fff; }
