/* Pole to Flag - the menu design system.
   One place for the scales and the parts every menu page is built from:
   type, spacing, the top bar, the page frame (left panel + car on the right),
   buttons, chips, cards, tabs, form fields, switches, sliders, tables and the
   loading screen. Page-specific rules live in screens.css, home.css and
   meta.css and only arrange these parts. The in-race HUD is style.css. */

:root {
  /* condensed system faces first as fallbacks: the landing wordmark wrapped to three lines while Barlow was still loading */
  --f-display: 'Barlow Condensed', 'Bahnschrift SemiCondensed', 'Arial Narrow', 'Roboto Condensed', 'Inter', system-ui, sans-serif;
  /* spacing: 4 8 12 16 24 32 48 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* type */
  --t-xs: 11px; --t-sm: 12.5px; --t-md: 14px; --t-lg: 16px; --t-xl: 20px; --t-2xl: 28px; --t-3xl: 40px;
  /* surfaces on the dark panel */
  --bg-0: #05070b;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-hi: rgba(255, 255, 255, 0.11);
  --line-2: rgba(255, 255, 255, 0.15);
  --txt-2: #c3cad6;
  --acc-soft: rgba(255, 204, 0, 0.12);
  --acc-line: rgba(255, 204, 0, 0.5);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* frame */
  --bar-h: 56px;
  --side-w: 460px;
  --side-wide: 660px;
  --pad-x: 32px;
}
@media (max-width: 1366px) { :root { --side-wide: 620px; --pad-x: 28px; } }
@media (max-height: 760px) { :root { --bar-h: 50px; } }

/* ---------------------------------------------------------------- type */
h1 { font: 800 var(--t-3xl)/1 var(--f-display); letter-spacing: 0.01em; text-transform: uppercase; margin: 0; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
h2 { font: 800 var(--t-2xl)/1.05 var(--f-display); letter-spacing: 0.01em; text-transform: uppercase; margin: 0; display: flex; align-items: center; gap: var(--s2); }
.kick { display: block; font: 700 12.5px/1.2 var(--f-display); letter-spacing: 0.18em; color: var(--acc); text-transform: uppercase; }
.sec { margin: var(--s2) 0 0; font: 700 13px var(--f-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.sec em { font: 600 12px Inter, sans-serif; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--dim); margin-left: 6px; }
.lede { color: var(--txt-2); margin: 0; font-size: 15px; line-height: 1.45; }
.hint { color: var(--dim); font-size: var(--t-sm); line-height: 1.4; margin: 0; }
.dim { color: var(--dim); }
.empty { color: var(--dim); margin: 0; font-size: 13.5px; line-height: 1.45; padding: var(--s3) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }
.mono { font-family: var(--mono); }

/* the wordmark (top bar, loading, boot) */
.wm { display: inline-flex; align-items: baseline; gap: 6px; font: 800 italic 22px/1 var(--f-display); letter-spacing: 0.04em; color: #fff; white-space: nowrap; }
.wm i { font-style: italic; color: var(--acc); font-size: 0.6em; letter-spacing: 0.16em; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--bar-h); z-index: 5; display: flex; align-items: center; gap: var(--s5); padding: 0 var(--s5) 0 var(--pad-x); background: linear-gradient(180deg, rgba(5, 7, 11, 0.95), rgba(5, 7, 11, 0.84)); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.tb-brand { background: none; border: 0; padding: 0; flex: none; }
.tb-tabs { display: flex; align-self: stretch; gap: 2px; }
.tb-tabs button { position: relative; background: none; border: 0; padding: 0 14px; font: 700 15px var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); transition: color .15s; }
.tb-tabs button:hover { color: #fff; }
.tb-tabs button.on { color: #fff; }
.tb-tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--acc); transform: skewX(-24deg); }
.tb-tabs .dot { position: absolute; top: calc(50% - 12px); right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.tb-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--txt-2); padding: 0; transition: border-color .15s, color .15s; }
.tb-icon svg { width: 20px; height: 20px; }
.tb-icon:hover, .tb-icon.on { color: #fff; border-color: var(--acc-line); }
.topbar.flow .tb-home { margin-left: auto; font: 700 13px var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt); background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.topbar.flow .tb-home:hover { border-color: var(--acc); color: var(--acc); }
.topbar.flow .tb-home + .tb-right { margin-left: 12px; }
.topbar.flow .tb-where { font: 700 14px var(--f-display); letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; padding-left: var(--s5); border-left: 1px solid var(--line); line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* credits + level */
.cred-chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; background: rgba(245, 197, 66, 0.07); border: 1px solid rgba(245, 197, 66, 0.35); border-radius: 999px; padding: 0 13px 0 7px; color: #fff; font-weight: 800; transition: border-color .15s; }
.cred-chip svg { width: 24px; height: 24px; }
.cred-chip b { font-family: var(--mono); font-size: 14px; }
.cred-chip small { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; font-weight: 800; border-left: 1px solid var(--line-2); padding-left: 8px; }
button.cred-chip:hover { border-color: #f5c542; }

/* ---------------------------------------------------------------- page frame */
.screen { position: absolute; inset: 0; animation: scr-in .3s var(--ease) both; }
.screen.page { --side: var(--side-w); background: linear-gradient(90deg, #07090d 0, #07090d var(--side), rgba(5, 7, 11, 0.5) calc(var(--side) + 60px), rgba(5, 7, 11, 0) calc(var(--side) + 240px)); }
.screen.page:has(> .side.wide) { --side: var(--side-wide); }
.page > .side { position: absolute; top: var(--bar-h); left: 0; bottom: 0; width: min(var(--side), 100%); display: flex; flex-direction: column; animation: side-in .38s var(--ease) both; }
.screen.still, .screen.still > .side { animation: none; }
.pg-head { flex: none; display: flex; flex-direction: column; gap: var(--s3); padding: 18px var(--pad-x) var(--s3); }
.pg-title { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.pg-title > div:first-child { display: grid; gap: 6px; min-width: 0; }
.pg-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--s1) var(--pad-x) var(--s5); display: flex; flex-direction: column; gap: var(--s3); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.pg-body > * { flex: none; }
.pg-foot { flex: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--pad-x) 22px; border-top: 1px solid var(--line); background: rgba(5, 7, 11, 0.55); }
.pg-foot > .primary.big, .pg-foot .btns .primary.big { flex: 1; }
.pg-foot .btns { display: flex; gap: var(--s3); flex: 1; }
.pg-foot .btns > .ghost { flex: none; }
.pg-body::-webkit-scrollbar { width: 6px; }
.pg-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }

/* the car slides right while a side panel is up, so it sits in the free space */
#gl { transition: transform .6s var(--ease); }
body:has(#ui > .screen.page > .side) #gl { transform: translateX(calc(var(--side-w) / 2)); }
body:has(#ui > .screen.page > .side.wide) #gl { transform: translateX(calc(var(--side-wide) / 2)); }

@keyframes scr-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes side-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- buttons */
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; filter: grayscale(0.5); box-shadow: none; }   /* v0.9.21: a button that cannot be used looks it */
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.primary, .btn, .ghost, .buy, .btn-go { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 700; font-size: var(--t-md); line-height: 1.2; transition: background .15s, border-color .15s, filter .15s, transform .15s; }
.primary { background: var(--acc); color: #111; border: 1px solid var(--acc); font-weight: 800; }
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary.big, .btn.big { padding: 14px 22px; font: 800 17px/1.1 var(--f-display); letter-spacing: 0.1em; text-transform: uppercase; }
.primary svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.primary:hover svg { transform: translateX(3px); }
.btn, .ghost { background: var(--surface-2); border: 1px solid var(--line); color: #dfe4ec; }
.btn:hover:not(:disabled), .ghost:hover:not(:disabled) { background: var(--surface-hi); border-color: var(--line-2); }
.ghost svg, .btn svg { width: 17px; height: 17px; flex: none; }
.ghost.wide { padding: 13px 16px; }
.ghost.icon { padding: 8px; }
.ghost.danger, .btn.danger { color: #ff9b9b; border-color: rgba(239, 68, 68, 0.3); }
.ghost.danger:hover, .btn.danger:hover { background: rgba(239, 68, 68, 0.12); }
/* a strong second choice: events "Race", shop "Buy" */
.btn-go, .buy { background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc); font-weight: 800; }
.btn-go:hover, .buy:hover { background: rgba(255, 204, 0, 0.2); }
.btn-go svg, .buy svg { width: 15px; height: 15px; }
.back { align-self: flex-start; background: none; border: 0; color: var(--dim); display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 0; font-weight: 700; font-size: 13px; transition: color .15s; }
.back:hover { color: #fff; }
.back svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 2px 0; display: inline-flex; align-items: center; gap: 1px; color: var(--txt-2); font-weight: 700; font-size: var(--t-sm); }
.link:hover { color: #fff; }
.link svg { width: 14px; height: 14px; }
.btns { display: flex; gap: var(--s3); flex-wrap: wrap; }
.btns .primary.big { flex: 1; }

/* ---------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-style: normal; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 11px; font-size: var(--t-sm); font-weight: 600; color: #d3d9e2; white-space: nowrap; }
.chip.soon { background: var(--acc); color: #111; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 9px; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }
.facts span { background: var(--surface-2); border-radius: 999px; padding: 4px 11px; font-size: var(--t-sm); font-weight: 600; color: #d3d9e2; }
.flagchip { display: inline-flex; width: 30px; height: 20px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); flex: none; }
.flagchip i { flex: 1; }
.flagchip svg { display: block; width: 100%; height: 100%; }
.liv { display: inline-block; width: 26px; height: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--a) 0 55%, var(--b) 55% 80%, var(--c) 80%); vertical-align: middle; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); flex: none; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.card-head span { color: var(--dim); font-size: 12px; font-weight: 700; }
.card-links { display: flex; gap: var(--s4); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.card > .kick { margin-bottom: var(--s2); }

/* a whole-card button: hub cards, contract offers */
.hubcard, .offer { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); color: var(--txt); transition: border-color .15s, background .15s, transform .2s var(--ease); }
.hubcard:hover:not(.soon), .offer:hover { border-color: var(--acc-line); background: rgba(255, 204, 0, 0.05); transform: translateX(3px); }
.hubcard > svg, .offer > svg { width: 20px; height: 20px; color: var(--dim); }
.hubcard:hover > svg, .offer:hover > svg { color: var(--acc); }

/* ---------------------------------------------------------------- tabs */
/* Race tab: Overview / Career / Quick race / Events */
.subtabs { display: flex; gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.subtabs button { flex: 1; background: none; border: 0; border-radius: 9px; padding: 8px 6px; font: 700 13.5px var(--f-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; transition: background .15s, color .15s; }
.subtabs button:hover { color: #fff; }
.subtabs button.on { background: var(--surface-hi); color: #fff; box-shadow: inset 0 -2px 0 var(--acc); }
/* in-page tabs: stats / trophies, shop slots, settings */
.tabrow { display: flex; gap: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.side > .tabrow { margin: 0 var(--pad-x) var(--s3); flex: none; }
.tabrow button { background: none; border: 0; padding: 0 0 9px; color: var(--dim); font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tabrow button:hover { color: #e6eaf0; }
.tabrow button.on { color: #fff; border-bottom-color: var(--acc); }
/* segmented choice (fuel mix) */
.seg { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.seg button { flex: 1; background: none; border: 0; border-radius: 8px; padding: 9px; font-weight: 700; color: var(--dim); }
.seg button.on { background: var(--acc); color: #111; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font: 700 12.5px var(--f-display); letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.field > span b { font: 700 12.5px Inter, sans-serif; letter-spacing: 0; text-transform: none; color: var(--acc); }
.cg-name { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.cg-name img { border-radius: 50%; }
.cg-name b { font: 700 16px Inter, sans-serif; color: var(--ink, #fff); }
.cg-name small { margin-left: auto; color: var(--dim); font-size: 12px; }
input, select { font: 600 14px Inter, system-ui, sans-serif; color: var(--txt); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px; outline: none; transition: border-color .15s; }
input:hover, select:hover { border-color: rgba(255, 255, 255, 0.24); }
input:focus, select:focus { border-color: var(--acc); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
select option { background: #151a22; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid rgba(255, 255, 255, 0.15); padding: 0; transition: transform .15s; }
.swatches button:hover { transform: scale(1.1); }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--acc); }
.swatches + .swatches { margin-top: 4px; }

/* switches (settings aids, pause aids) */
.check input[type=checkbox], .pause .aid input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 36px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); cursor: pointer; transition: background .15s; }
.check input[type=checkbox]::before, .pause .aid input[type=checkbox]::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease), background .15s; }
.check input[type=checkbox]:checked, .pause .aid input[type=checkbox]:checked { background: var(--acc); }
.check input[type=checkbox]:checked::before, .pause .aid input[type=checkbox]:checked::before { transform: translateX(16px); background: #111; }
.check input[type=checkbox]:disabled, .pause .aid input[type=checkbox]:disabled { cursor: not-allowed; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.check { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.check.off { opacity: 0.45; cursor: default; }

/* sliders: --pct is set by the App (a filled track) */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; padding: 0; margin: 0; background: transparent; border: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--acc) var(--pct, 50%), rgba(255, 255, 255, 0.14) var(--pct, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); transition: transform .15s; }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--acc); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); }
input[type=range]:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------- tables */
.board { padding: 6px; display: flex; flex-direction: column; }
.board > .kick { padding: 6px 8px 8px; margin: 0; }
.brow { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.brow:nth-child(even of .brow) { background: rgba(255, 255, 255, 0.025); }
.brow.me { position: relative; background: linear-gradient(90deg, rgba(255, 204, 0, 0.2), rgba(255, 204, 0, 0.06)); }
.brow.me::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: var(--acc); }
.brow.out { opacity: 0.5; }
.brow .p { width: 30px; flex: none; text-align: right; font-family: var(--mono); color: var(--dim); font-size: 12.5px; }
.brow.me .p { color: var(--acc); }
.brow > i { width: 4px; height: 16px; border-radius: 2px; flex: none; }
.brow .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .t { font-size: 12.5px; color: #d6dce6; white-space: nowrap; }
.brow .g { min-width: 64px; text-align: right; font-size: 12.5px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; color: var(--dim); }
.brow .g b { color: var(--acc); }
.brow em { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 800; }
.brow em.pen { background: var(--bad); color: #fff; }
.brow em.fl { background: var(--purple); color: #fff; }
.cutline { border-top: 1px dashed var(--bad); margin: 6px 4px; position: relative; height: 0; }
.cutline span { position: absolute; right: 8px; top: -9px; background: #14181f; color: var(--bad); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; padding: 0 6px; text-transform: uppercase; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r { text-align: right; font-family: var(--mono); }

/* stat numbers */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3) var(--s2); }
.statgrid b { display: block; font: 800 24px/1.1 var(--f-display); }
.statgrid small { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; font-weight: 800; text-transform: uppercase; }

/* ---------------------------------------------------------------- loading */
.loading-screen { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: clamp(20px, 4vw, 56px); padding: clamp(12px, 3.6vh, 26px) clamp(16px, 4vw, 48px) clamp(12px, 5vh, 40px); background: radial-gradient(ellipse at 72% 45%, rgba(24, 32, 48, 0.96), rgba(5, 7, 11, 0.99) 62%); overflow: hidden; }
/* the loader over the session's first drawn frames, fading out (session.js) */
.loading-screen.ld-leave { z-index: 60; pointer-events: none; animation: none; transition: opacity .45s ease; }
.loading-screen.ld-gone { opacity: 0; }
.loading-screen::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: repeating-linear-gradient(90deg, #fff 0 10px, #111 10px 20px); opacity: 0.18; }
.ld-brand .wm { font-size: 20px; }
/* the circuit's lap drive takes the right half (src/ui/lapDrive.js) */
.loading-screen.has-drive { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.loading-screen > .ld-brand, .loading-screen > .ld-main, .loading-screen > .ld-foot { grid-column: 1; min-width: 0; }
.loading-screen > .ld-drive { grid-column: 2; grid-row: 1 / 4; }
.ld-main { align-self: center; display: grid; gap: var(--s3); }
.ld-main h1 { font-size: clamp(30px, min(5.4vw, 10vh), 76px); gap: var(--s4); }
.ld-main h1 .flagchip { width: 1.1em; height: 0.74em; border-radius: 5px; }
.ld-foot { display: grid; gap: var(--s3); width: 100%; max-width: 640px; }
.ld-row { display: flex; justify-content: space-between; align-items: baseline; }
.ld-row b { font: 700 17px var(--f-display); letter-spacing: 0.14em; text-transform: uppercase; }
.ld-row span { font: 700 13px var(--mono); color: var(--dim); }
.prog { position: relative; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.prog i { display: block; height: 100%; width: 28%; border-radius: 2px; background: var(--acc); box-shadow: 0 0 10px rgba(255, 204, 0, 0.6); animation: sweep 1.4s ease-in-out infinite; }
.prog.det i { animation: none; transform: none; transition: width .3s ease; }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(370%); } }
.ld-tip { display: flex; align-items: center; gap: var(--s3); margin: var(--s1) 0 0; color: var(--txt-2); font-size: 14.5px; line-height: 1.4; transition: opacity .26s; }
.ld-tip.swap { opacity: 0; }
.ld-tip em { flex: none; font: 800 12px var(--f-display); font-style: normal; letter-spacing: 0.16em; color: #111; background: var(--acc); padding: 2px 8px; border-radius: 4px; }

/* ---------------------------------------------------------------- small and short screens */
@media (max-height: 760px) {
  h1 { font-size: 34px; }
  .pg-head { padding-top: 14px; gap: 10px; }
  .pg-foot { padding-top: 12px; padding-bottom: 16px; }
  .primary.big { padding: 12px 20px; }
}
@media (max-width: 900px) {
  :root { --pad-x: 16px; }
  .tb-tabs button { padding: 0 8px; font-size: 13px; }
  .topbar .wm { display: none; }
  .page > .side, .page > .side.wide { width: 100%; }
  .screen.page { background: rgba(5, 7, 11, 0.9); }
  body:has(#ui > .screen.page > .side) #gl { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .page > .side, .prog i { animation: none !important; }
}

/* ---------------------------------------------------------------- loader art
   (src/ui/loaderArt.js; a static copy sits in index.html's boot screen)
   The car runs on the spot: the kerb and speed lines move, the wheels spin. */
.la-scene { position: relative; height: clamp(64px, 15vh, 150px); overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ld-foot .la-scene, #boot .la-scene { margin-bottom: 4px; }
.la-car { position: absolute; left: 50%; bottom: 10px; height: calc(100% - 18px); transform: translateX(-50%); overflow: visible; animation: la-bob .24s ease-in-out infinite alternate; }
.la-car .la-p1 { fill: var(--car, #e9ecf1); }
.la-car .la-p2 { fill: var(--car2, #ffcc00); }
.la-car .la-p3 { fill: var(--car3, #15181d); opacity: .9; }
.la-car .la-dark { fill: #2a303b; }
.la-car .la-shadow { fill: rgba(0, 0, 0, .55); }
.la-car .la-helmet { fill: #ffcc00; }
.la-car .la-halo { fill: none; stroke: #0b0d12; stroke-width: 5; stroke-linecap: round; }
.la-car .la-tyre { fill: #0b0d10; }
.la-car .la-wall { fill: none; stroke: #ffcc00; stroke-width: 2; stroke-dasharray: 9 25; }
.la-car .la-rim { fill: #1b2029; stroke: #aab3c2; stroke-width: 2; stroke-dasharray: 4 3; }
.la-car .la-spin { animation: la-spin .32s linear infinite; }
.la-kerb { position: absolute; left: 0; right: 0; bottom: 2px; height: 8px; background: repeating-linear-gradient(90deg, #d8262c 0 28px, #eef1f6 28px 56px); opacity: .5; animation: la-kerb .28s linear infinite; border-top: 2px solid rgba(255, 255, 255, .12); }
.la-lines { position: absolute; inset: 0 0 12px; }
.la-lines i { position: absolute; right: -40%; height: 2px; width: 22%; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5)); animation: la-line 1.1s linear infinite; }
.la-lines i:nth-child(1) { top: 14%; animation-delay: -.1s; }
.la-lines i:nth-child(2) { top: 30%; width: 34%; animation-delay: -.55s; animation-duration: .9s; }
.la-lines i:nth-child(3) { top: 44%; animation-delay: -.3s; background: linear-gradient(90deg, transparent, rgba(255, 204, 0, .55)); }
.la-lines i:nth-child(4) { top: 58%; width: 16%; animation-delay: -.8s; animation-duration: 1.3s; }
.la-lines i:nth-child(5) { top: 70%; width: 28%; animation-delay: -.15s; animation-duration: .95s; }
.la-lines i:nth-child(6) { top: 22%; width: 12%; animation-delay: -.7s; animation-duration: 1.5s; }
.la-lines i:nth-child(7) { top: 82%; width: 40%; animation-delay: -.45s; animation-duration: .8s; background: linear-gradient(90deg, transparent, rgba(255, 204, 0, .4)); }
@keyframes la-spin { to { transform: rotate(360deg); } }
@keyframes la-bob { to { transform: translate(-50%, 1px); } }
@keyframes la-kerb { from { background-position: 0 0; } to { background-position: -56px 0; } }
@keyframes la-line { from { transform: translateX(0); } to { transform: translateX(-560%); } }

/* five start lights: they fill with the real progress, green when ready;
   .auto = no number yet, they count up on their own */
.la-lights { display: flex; gap: 6px; padding: 5px 7px; background: #0b0d12; border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; }
.la-lights b { display: grid; gap: 3px; }
.la-lights i { width: 11px; height: 11px; border-radius: 50%; background: #2a1012; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8); transition: background .15s, box-shadow .15s; }
.la-lights b.on i { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85), inset 0 -2px 3px rgba(0, 0, 0, .3); }
.la-lights.go i { background: #22e06b !important; box-shadow: 0 0 10px rgba(34, 224, 107, .9) !important; }
.la-lights.auto b i { animation: la-auto 3s steps(1) infinite; }
.la-lights.auto b:nth-child(2) i { animation-name: la-auto2; }
.la-lights.auto b:nth-child(3) i { animation-name: la-auto3; }
.la-lights.auto b:nth-child(4) i { animation-name: la-auto4; }
.la-lights.auto b:nth-child(5) i { animation-name: la-auto5; }
@keyframes la-auto { 0% { background: #2a1012; box-shadow: none; } 12%, 90% { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85); } }
@keyframes la-auto2 { 0% { background: #2a1012; box-shadow: none; } 27%, 90% { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85); } }
@keyframes la-auto3 { 0% { background: #2a1012; box-shadow: none; } 42%, 90% { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85); } }
@keyframes la-auto4 { 0% { background: #2a1012; box-shadow: none; } 57%, 90% { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85); } }
@keyframes la-auto5 { 0% { background: #2a1012; box-shadow: none; } 72%, 90% { background: #ff2a2a; box-shadow: 0 0 8px rgba(255, 42, 42, .85); } }

/* the tip's little picture: a key cap, or one of our icons */
.tip-art { flex: none; align-self: center; display: inline-grid; place-items: center; min-width: 26px; height: 26px; color: #c3cad6; }
.tip-art svg { width: 24px; height: 24px; }
.tip-key { padding: 0 7px; border-radius: 5px; background: linear-gradient(#2a303b, #1a1e26); border: 1px solid rgba(255, 255, 255, .22); border-bottom-width: 3px; font: 700 13px 'JetBrains Mono', monospace; color: #fff; }
.tip-80 { width: 26px; border-radius: 50%; background: #fff; border: 3px solid #d8262c; font: 800 11px Inter, sans-serif; color: #111; }

/* race loads: a line with the weather and the time of day */
.ld-cond { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s1); }
.ld-cond span { display: inline-flex; align-items: center; gap: var(--s2); padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font: 700 15px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--txt-2); }
.ld-cond svg { width: 20px; height: 20px; }
.ld-row { gap: var(--s4); align-items: center !important; }
.ld-row b { flex: 1; }
.ld-row span { min-width: 3.2em; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .la-car, .la-spin, .la-kerb, .la-lines i, .la-lights i { animation: none !important; }
}
@media (max-width: 600px) { .la-scene { height: 88px; } }

/* ---------------------------------------------------------------- lap drive
   the right half of the boot loader and of every race loader: a caption,
   then the canvas (a faint outline stands in until it draws) */
.ld-drive, #boot .bt-drive { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.dr-cap { display: grid; gap: 3px; padding: 2px 4px 0; }
.dr-cap small { font: 700 13px/1.2 'Barlow Condensed', Inter, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #ffcc00; }
.dr-cap b { font: 600 14px/1.35 Inter, system-ui, sans-serif; color: #c3cad6; }
body:has(#sound-chip) .dr-cap { padding-right: 170px; }
.dr-box { position: relative; flex: 1; min-height: 0; border-radius: 18px; background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 68%); }
.dr-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dr-ph { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .4s; }
.dr-ph path { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 12; stroke-linejoin: round; }
.dr-live .dr-ph { opacity: 0; }

/* narrow (portrait) windows: one column, the drive between the name and the bar */
@media (max-width: 700px) {
  .loading-screen.has-drive { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(120px, 1fr) auto; row-gap: 10px; }
  .loading-screen > .ld-drive { grid-column: 1; grid-row: 3; }
  .loading-screen > .ld-main { grid-row: 2; }
  .loading-screen > .ld-foot { grid-row: 4; }
}
/* short windows (a small iframe, a phone on its side) */
@media (max-height: 560px) {
  .ld-cond span { font-size: 13px; padding: 4px 10px 4px 6px; }
  .ld-cond svg { width: 16px; height: 16px; }
  .ld-tip, #boot .bt-tip { font-size: 13px; }
  .dr-cap b { font-size: 12.5px; }
  .la-scene { height: clamp(48px, 13vh, 84px); }
}
@media (max-height: 460px) {
  .la-scene { display: none; }
  .dr-cap b { display: none; }
  .ld-foot { gap: 8px; }
  .ld-main { gap: 8px; }
  .ld-row b { font-size: 15px; }
}

/* ---------------------------------------------------------------- sound chip + fullscreen hint */
#sound-chip { position: fixed; top: 12px; right: 14px; z-index: 80; display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px 8px 11px; border-radius: 999px; border: 0; background: #ffcc00; color: #111; font: 800 13px/1 Inter, system-ui, sans-serif; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); cursor: pointer; animation: chip-in .35s cubic-bezier(.2, .8, .2, 1) both, chip-pulse 2.2s ease-in-out 1s infinite; }
#sound-chip svg { width: 18px; height: 18px; flex: none; }
#sound-chip:hover { filter: brightness(1.08); }
body:has(.topbar) #sound-chip { top: calc(var(--bar-h) + 10px); }
@keyframes chip-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes chip-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 204, 0, .22), 0 6px 20px rgba(0, 0, 0, .45); } }
.fs-hint { position: fixed; right: 34px; bottom: 36px; z-index: 80; display: flex; align-items: center; gap: 10px; max-width: min(300px, calc(100vw - 60px)); padding: 9px 9px 9px 13px; border-radius: 14px; background: rgba(10, 13, 19, .95); border: 1px solid rgba(255, 204, 0, .65); color: #fff; font: 700 13.5px/1.3 Inter, system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: chip-in .4s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .35s, transform .35s; }
.fs-hint.out { opacity: 0; transform: translateY(8px); }
.fs-t { display: flex; align-items: center; gap: 10px; }
.fs-ic { width: 22px; height: 22px; flex: none; color: #ffcc00; }
.fs-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #c3cad6; cursor: pointer; }
.fs-x:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.fs-x svg { width: 14px; height: 14px; }
.fs-arrow { position: absolute; right: -30px; bottom: -32px; width: 46px; height: 46px; color: #ffcc00; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); animation: fs-nudge 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes fs-nudge { 50% { transform: translate(4px, 4px); } }
@media (max-height: 460px) { .fs-hint { font-size: 12.5px; padding: 6px 6px 6px 10px; bottom: 30px; } }
@media (prefers-reduced-motion: reduce) { #sound-chip, .fs-arrow { animation: none; } }

/* round 8: the update gift on the Updates page */
.upd-gift { display: grid; gap: var(--s2); margin-bottom: var(--s4); border-color: var(--accent, #f5c518); }
.upd-gift b { font-size: 20px; }
.upd-gift span { color: var(--dim); }
.upd-gift button { justify-self: start; }
.upd-gift.claimed { opacity: 0.75; }

/* round 8 (Uday): main controls on the left, details on the right; the car sits in the gap between them */
:root { --detail-w: 420px; }
@media (max-width: 1366px) { :root { --detail-w: 380px; } }
.page > .detail, .landing > .detail { position: absolute; top: var(--bar-h); right: 0; bottom: 0; width: var(--detail-w); overflow-y: auto; overflow-x: hidden;
  padding: 18px var(--pad-x) 22px; background: rgba(7, 9, 13, 0.9); border-left: 1px solid var(--line); animation: side-in .38s var(--ease) both;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.detail-in { display: flex; flex-direction: column; gap: var(--s3); }
.detail-in > * { flex: none; }
.detail .sec:first-child { margin-top: 0; }
.screen.page.has-right { --side: var(--side-w); background: linear-gradient(90deg, #07090d 0, #07090d var(--side), rgba(5, 7, 11, 0.45) calc(var(--side) + 60px), rgba(5, 7, 11, 0) calc(var(--side) + 200px), rgba(5, 7, 11, 0) calc(100% - var(--detail-w) - 200px), rgba(5, 7, 11, 0.45) calc(100% - var(--detail-w) - 60px), #07090d calc(100% - var(--detail-w))); }
.page.has-right > .side.wide { width: min(var(--side-w), 100%); }
body:has(#ui > .screen.page.has-right > .side) #gl { transform: translateX(calc((var(--side-w) - var(--detail-w)) / 2)); }
.mini-cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-cal li { display: grid; grid-template-columns: 22px 32px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.mini-cal li em { font-style: normal; color: var(--dim); font-weight: 700; }
.mini-cal li.nx { background: rgba(245, 197, 24, 0.12); }
.mini-cal li.done span { color: var(--dim); }
.upd-mini ul { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 8px; }
.upd-mini li { display: grid; gap: 2px; font-size: 13px; }
.upd-mini li span { color: var(--dim); }
/* narrow frames: one column, the details follow the main content (App.placeDetail moves them) */
@media (max-width: 1199px) {
  .page > .detail, .landing > .detail { display: none; }
  .page.has-right > .side.wide { width: min(var(--side-wide), 100%); }
  .screen.page.has-right { --side: var(--side-wide); background: linear-gradient(90deg, #07090d 0, #07090d var(--side), rgba(5, 7, 11, 0.5) calc(var(--side) + 60px), rgba(5, 7, 11, 0) calc(var(--side) + 240px)); }
  body:has(#ui > .screen.page.has-right > .side) #gl { transform: translateX(calc(var(--side-w) / 2)); }
  body:has(#ui > .screen.page.has-right > .side.wide) #gl { transform: translateX(calc(var(--side-wide) / 2)); }
}
@media (max-width: 900px) { body:has(#ui > .screen.page.has-right > .side) #gl, body:has(#ui > .screen.page.has-right > .side.wide) #gl { transform: none; } }

/* ---- round 9: clean panels (solid, crisp edge, the centre left clear), top bar, titles, Online events ---- */
.screen.page, .screen.page.has-right { background: none !important; }
.page > .side { background: rgba(8, 10, 15, 0.96); border-right: 1px solid var(--line); box-shadow: 10px 0 28px rgba(0, 0, 0, 0.32); }
.page > .detail, .landing > .detail { background: rgba(8, 10, 15, 0.96); box-shadow: -10px 0 28px rgba(0, 0, 0, 0.32); }
@media (max-width: 900px) { .page > .side { box-shadow: none; } }
.tb-soon { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0 12px; font: 700 15px var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.32); cursor: default; }
.tb-soon em { font: 700 11px var(--f-ui, inherit); letter-spacing: 0.06em; font-style: normal; padding: 2px 6px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.45); }
.tb-me { height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--txt-2); }
.tb-me svg { width: 22px; height: 22px; }
.tb-me.on, .tb-me:hover { border-color: var(--acc); }
.tb-icon { position: relative; }
.tb-icon .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
@media (max-width: 1000px) { .tb-soon { display: none; } .tb-me .ttl { display: none; } }
/* titles: a chip beside the name; the tier sets its colour */
.ttl { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; font: 800 11px/1.5 var(--f-ui, inherit); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; color: #0b0e14; background: #9aa3b2; }
.ttl.t-gold { background: linear-gradient(100deg, #ffd34d, #f5a90a 45%, #fff1b8 50%, #f5a90a 55%, #ffd34d); background-size: 300% 100%; animation: ttl-shine 3.2s linear infinite; }
.ttl.t-silver { background: linear-gradient(100deg, #e9edf2, #aab4c0); }
.ttl.t-bronze { background: linear-gradient(100deg, #f0a86a, #b8682c); }
.ttl.t-orange { background: #ff9a3c; } .ttl.t-teal { background: #39d0c0; } .ttl.t-blue { background: #6fb2ff; }
.ttl.t-violet { background: #c08bff; } .ttl.t-green { background: #63d98a; } .ttl.t-plain { background: #cfd6df; }
@keyframes ttl-shine { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ttl.t-gold { animation: none; } }
/* name cards: a board row of a title holder */
.lb li.nc-gold { background: linear-gradient(90deg, rgba(245, 197, 24, 0.22), rgba(245, 197, 24, 0.04)); box-shadow: inset 3px 0 0 #f5c518; }
.lb li.nc-silver { background: linear-gradient(90deg, rgba(200, 210, 222, 0.18), rgba(200, 210, 222, 0.03)); box-shadow: inset 3px 0 0 #c8d2de; }
.lb li.nc-bronze { background: linear-gradient(90deg, rgba(224, 140, 80, 0.18), rgba(224, 140, 80, 0.03)); box-shadow: inset 3px 0 0 #d98c4a; }
.lb li b { display: flex; align-items: center; min-width: 0; }
.lb li b .ttl { margin-left: 6px; font-size: 11px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; }
.pg-title h1 .ttl { font-size: 12px; margin-left: 12px; }
/* profile: titles held */
.ttl-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ttl-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.ttl-list li .ttl { margin: 0; }
.ttl-list li small { color: var(--dim); font-size: 12px; }
.ttl-list li em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--acc); }
.ttl-list li.on { border-color: rgba(245, 197, 24, 0.5); }
/* landing */
.land-online { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.land-online small { font-weight: 500; font-size: 12.5px; color: var(--dim); letter-spacing: 0; text-transform: none; }
.land-online svg { display: none; }
/* Online events */
.online .ev.daily { border-color: rgba(245, 197, 24, 0.35); }
.online .ev { display: grid; gap: 10px; }
.online .ev-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.online .ev-me { font-size: 13px; color: var(--txt-2); }
.online .ev-me.dim { color: var(--dim); }
.ev-tiers.compact { display: flex; gap: 4px; }
.ev-tiers.compact li { padding: 3px; border: 0; background: none; display: block; }
.ev-tiers.compact li span { display: none; }
.ev-tiers.compact li svg { width: 22px; height: 22px; opacity: 0.25; }
.ev-tiers.compact li.won svg { opacity: 1; }
.wk-claim { display: grid; gap: 6px; border-color: rgba(245, 197, 24, 0.6); background: linear-gradient(135deg, rgba(245, 197, 24, 0.14), rgba(245, 197, 24, 0.02)); }
.wk-claim b { font-size: 18px; }
.wk-claim button { justify-self: start; }
.wk-rank .bigstat { margin: 6px 0 10px; }
.wk-rewards { margin-top: 10px; font-size: 13px; }
.wk-rewards summary { cursor: pointer; color: var(--txt-2); font-weight: 700; }
.wk-rewards ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.wk-rewards li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wk-rewards li span { color: var(--dim); text-align: right; }
/* round 10: privacy notice (first loading screen, Settings, leaderboard log-in) */
.ld-privacy { margin: 6px 0 0; max-width: 62ch; color: #aab3c2; font-size: 12.5px; line-height: 1.4; }
.lb-privacy { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }
.hint.privacy { max-width: 62ch; }
/* round 10: a phone or tablet: one card (src/platform/device.js) */
#kbcard { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #06080c; color: #eef1f6; font-family: Inter, system-ui, sans-serif; text-align: center; padding: 16px; }
#kbcard .kb-in { max-width: 420px; display: grid; gap: 14px; justify-items: center; }
#kbcard h2 { margin: 0; font-size: 24px; }
#kbcard p { margin: 0; color: #c3cad6; font-size: 16px; }
#kbcard button { min-width: 180px; }

/* round 11: the midgame-ad break blocks the whole screen while the ad is asked for (CrazyGames ads rules) */
#adbreak { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(6, 8, 12, 0.88); pointer-events: all; cursor: wait; }
#adbreak > div { display: grid; gap: 6px; text-align: center; color: #eef1f6; font-family: Inter, system-ui, sans-serif; }
#adbreak b { font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; }
#adbreak span { font-size: 15px; opacity: 0.8; }

/* round 12: ghost laps on the online events and the event result (src/meta/ghosts.js) */
.gh-row { display: flex; gap: 8px; flex-wrap: wrap; }
.gh-btn { padding: 6px 10px; font-size: 13px; gap: 6px; }
.gh-btn.busy { opacity: 0.6; cursor: progress; }
.gh-card .gh-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.gh-card .gh-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 6px; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); font-size: 13px; }
.gh-card .gh-list li em { font: 800 13px var(--f-display); color: var(--dim); font-style: normal; text-align: right; }
.gh-card .gh-list li b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-card .gh-list li span { font: 600 12.5px var(--f-mono, monospace); color: var(--txt-2); font-variant-numeric: tabular-nums; }
.gh-act { display: flex; gap: 6px; flex-wrap: wrap; }
.gh-card .gh-act { grid-column: 2 / -1; }
.gh-own .gh-act { margin-top: 8px; }

/* ---------------------------------------------------------------- post-race screen (v0.9.15): two columns at every size */
.page.results > .detail { display: block; }
.page.results > .detail .detail-in { gap: var(--s2); }
.pr-card { padding: 12px 14px; }
.pr-card > .kick { margin-bottom: 4px; }
.pr-big { margin: 0; font: 800 26px/1.1 var(--f-display); letter-spacing: 0.02em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.pr-big small { font: 700 13px Inter, sans-serif; color: var(--dim); letter-spacing: 0; }
.pr-big em { font: 800 15px Inter, sans-serif; font-style: normal; color: var(--dim); }
.pr-big em.up, .pr-line .up { color: #6ee7a0; }
.pr-big em.down { color: #ff7a7a; }
.pr-big.ok { color: #6ee7a0; }
.pr-big.no { color: #ff9a7a; }
.pr-line { margin: 4px 0 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; line-height: 1.35; }
.pr-line b { font-weight: 800; }
.pr-line span { color: var(--txt-2); }
.pr-line.ok b { color: #6ee7a0; }
.pr-line.no b { color: #ff9a7a; }
.pr-sub { margin: 4px 0 0; color: var(--dim); font-size: 12.5px; line-height: 1.35; }
.pr-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 8px; }
.pr-bar i { display: block; height: 100%; border-radius: 4px; background: var(--acc); transition: width .6s var(--ease); }
.pr-league { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font: 800 17px var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; }
.pr-badge { width: 16px; height: 16px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 10px var(--lc); }
.pr-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pr-chips .chip { padding: 2px 9px; font-size: 12px; background: rgba(110, 231, 160, 0.14); color: #b8f2cf; }
.pr-chips .chip.neg { background: rgba(255, 122, 122, 0.14); color: #ffb0b0; }
.pr-gains ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pr-gains li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.3; }
.pr-gains li b { flex: none; font-weight: 800; }
.pr-gains li span { color: var(--txt-2); }
.pr-gains li.gift b { color: var(--acc); }
.pr-goal .pr-line b { font-weight: 700; color: #fff; }
@media (max-width: 1199px) {
  .page.results > .side, .page.results > .side.wide { width: 54%; }
  .page.results > .detail { width: 46%; }
  .screen.page.results { background: none; }
  body:has(#ui > .screen.page.results > .side) #gl { transform: none; }
}
@media (max-height: 560px) {
  .page.results .pg-head { padding-top: 8px; gap: 4px; }
  .page.results h1 { font-size: 26px; }
  .page.results .pg-head .lede { font-size: 12.5px; }
  .page.results .pg-foot { padding: 8px var(--pad-x) 10px; }
  .page.results .primary.big { padding: 9px 14px; font-size: 15px; }
  .page.results > .detail { padding: 8px 12px 10px; }
  .page.results > .detail .detail-in { gap: 5px; }
  .page.results .pr-card { padding: 7px 10px; }
  .pr-big { font-size: 20px; }
  .pr-line, .pr-gains li { font-size: 12px; }
  .pr-sub { font-size: 11.5px; margin-top: 2px; }
  .pr-bar { margin-top: 5px; height: 5px; }
  .pr-league { font-size: 14px; margin-bottom: 2px; }
  .pr-chips .chip { font-size: 11px; padding: 1px 7px; }
}
/* v0.9.15 short windows (800x450): the Rating card is one row (label left, number right) so the right column fits without scrolling */
@media (max-height: 520px) {
  .page.results .pr-rating { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .page.results .pr-rating > .kick { margin: 0; }
  .page.results .pr-rating .pr-big { font-size: 18px; }
  .page.results .pr-gains ul { gap: 1px; }
  .page.results .pr-goal .pr-sub { display: none; }
  .page.results > .detail { overflow-y: auto; }
}
