/* Stats, quests, equipment, tax, summary and shared-control styles from the usability pass.
   Loaded after app.css, so rules here refine it. */

/* ---- summary: tips (advice.js) ------------------------------------------------------------- */
.tips-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; font-size: 14px; margin: 14px 0 8px; }
.tips-h .ico { align-self: center; color: var(--accent); }
.tips-h .muted { font-weight: 400; font-size: 12.5px; }
.issue.hint { background: var(--surface); border-color: var(--border); border-left: 3px solid var(--accent); }
.issue.hint.warn { border-left-color: var(--warn); }
.issue.hint > .ico { color: var(--accent); }
.issue.hint.warn > .ico { color: var(--warn); }
.issue.new:not(.leaving) { animation: slidein .26s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.cnt.tip { display: inline-flex; align-items: center; gap: 2px; background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .issue.new:not(.leaving) { animation: none; }
}

/* ---- stats & boons ---------------------------------------------------------------------------- */
/* two columns from ~900 px of panel (1440x900 with the summary: 1037 px), so the boons start at the top */
@media (min-width: 900px) { .cols-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); } }
/* boons (app.css .boon): two boons side by side when the card is wide */
@container boons (min-width: 900px) { .boons { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }
.boons-box { container: boons / inline-size; }
.tp-src { color: var(--muted); }
.addboon-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; }
.addboon-line .addboon { flex: 0 1 360px; margin-top: 8px; }
.addboon-line > .btn { margin-bottom: 3px; }
.eqrow-sets { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: -4px 0 10px; }

/* ---- quests ----------------------------------------------------------------------------------- */
.qbulk { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: -4px 0 10px; }
.qbulk:empty { display: none; }
.qbulk .btn .muted { font-weight: 400; }
#sec-quests > .hint { margin: -2px 0 6px; }
/* a progress ring per group (quests.js Ring: the ticked share; gold when every one is ticked) and the saved exp as a meter in the card head */
.qring { flex: none; vertical-align: -5px; }
.qring circle { fill: none; stroke-width: 3; }
.qring-bg { stroke: var(--surface-3); }
.qring-fg { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .35s ease; }
.qring.full .qring-fg { stroke: var(--gold); }
.qmeter { display: inline-block; width: 110px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; vertical-align: 1px; }
.qmeter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .35s ease; }
/* ticks: a box whose tick draws in gold (quests and abilities; the group boxes keep the native look for their mixed state) */
.qlist .check input, .ablist .check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 1px 0 0; border: 1.5px solid var(--field-border); border-radius: 4px;
  background: var(--surface); display: grid; place-content: center; transition: background .12s, border-color .12s; }
.qlist .check input::before, .ablist .check input::before { content: ""; width: 10px; height: 10px; transform: scale(0); background: var(--gold);
  clip-path: polygon(14% 50%, 0 66%, 40% 100%, 100% 20%, 86% 6%, 40% 70%); transition: transform .14s cubic-bezier(.2, .8, .3, 1.3); }
.qlist .check input:checked, .ablist .check input:checked { background: var(--accent); border-color: var(--accent); }
.qlist .check input:checked::before, .ablist .check input:checked::before { transform: scale(1); }
.qlist .check input:focus-visible, .ablist .check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* the per-quest info buttons stay, but quiet: 164 identical icons were the loudest thing on the tab; the row under the hand or with focus shows its own in full */
.qlist li .infobtn, .ablist li .infobtn { opacity: .4; transition: opacity .15s ease-out; }
.qlist li:is(:hover, :focus-within) .infobtn, .ablist li:is(:hover, :focus-within) .infobtn { opacity: 1; }
@media (pointer: coarse) { .qlist li .infobtn, .ablist li .infobtn { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .qring-fg, .qmeter i, .qlist .check input, .qlist .check input::before, .ablist .check input, .ablist .check input::before { transition: none; } }

/* ---- equipment -------------------------------------------------------------------------------- */
.burden { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; max-width: 420px; margin: -2px 0 12px; }
.burden-bar { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.burden-bar.over { background: var(--err); }
.slot.picked { align-items: start; }
.slot.picked > label { padding-top: 6px; }
.slot-info { grid-column: 2; margin-top: -4px; font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.combo-list li { overflow-wrap: anywhere; }
/* slot silhouettes (common.js ICONS slot-*) before the slot names, and the burden bar with its pack */
.slot > label { display: inline-flex; align-items: center; gap: 5px; }
.slot > label .ico, .eftable th[scope="row"] .ico { color: var(--accent); opacity: .85; vertical-align: -2px; margin-right: 3px; }
.burden-row { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; }
.burden-row .ico { color: var(--muted); }
.burden-row .burden { flex: 1 1 auto; margin: 0; }
.ef-burden { grid-template-columns: auto minmax(0, 1fr) auto; }
.ef-burden .ico { color: var(--muted); }
.burden-bar { transition: width .35s ease; }
@media (prefers-reduced-motion: reduce) { .burden-bar { transition: none; } }

/* ---- reinc tax -------------------------------------------------------------------------------- */
.ok-text { color: var(--ok); }
.tx-planasc { display: block; margin-top: 2px; }
.cols-tax .card > .hint:first-of-type { margin-bottom: 10px; }
/* the result card gets the room: the inputs need less (from 900 px; one column below) */
@media (min-width: 900px) { .cols-tax { grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); } }
/* the time between the reincs as a line (tax.js Timeline): the last reinc, today when it lies between, the next reinc, and the year after
   which the tax is nothing; the dots' words sit under the line (start, next) or over it (today, the year), so they do not collide */
.tx-line { position: relative; height: 74px; margin: 22px 48px 6px 12px; }
.tx-track { position: absolute; left: 0; right: 0; top: 34px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.tx-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .35s ease; }
.tx-dot { position: absolute; top: 28px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.tx-dot.end, .tx-dot.today { border-color: var(--gold); }
.tx-dot.today { box-shadow: 0 0 0 2px var(--surface), 0 0 10px rgba(233, 177, 59, .55); }
.tx-dot.year { border-color: var(--border-strong); border-style: dashed; background: var(--surface-2); }
.tx-dot.low { width: 12px; height: 12px; margin-left: -6px; top: 30px; border-width: 2px; border-color: var(--ok); }
.tx-dot.low small { top: auto; bottom: 16px; }
/* the days the tax drops (tax.js MILESTONES): ticks across the track, their rates on hover */
.tx-tick { position: absolute; top: 29px; width: 2px; height: 14px; margin-left: -1px; border-radius: 1px; background: var(--border-strong); }
.tx-tick.past { background: var(--accent); }
.tx-dot small { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; line-height: 1.3; color: var(--muted); text-align: center; }
.tx-dot small b { display: block; color: var(--text); font-weight: 600; }
.tx-dot.today small, .tx-dot.year small, .tx-dot.up small { top: auto; bottom: 18px; }
.tx-dot.start small { left: -8px; transform: none; text-align: left; }
.tx-dot.right small { left: auto; right: -40px; transform: none; text-align: right; }
.tx-speeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.tx-speed { display: grid; gap: 1px; align-content: start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--hilite); font-size: 12.5px; color: var(--muted); }
.tx-speed.fits { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.tx-speed.short { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.tx-sp-name { font-size: 13.5px; color: var(--text); }
.tx-rate { font-family: var(--font-display, inherit); font-size: 24px; font-weight: 750; line-height: 1.15; color: var(--text); font-variant-numeric: lining-nums tabular-nums; margin-bottom: 3px; }
.tx-tax { color: var(--text); }
.tx-tax .num { font-weight: 600; }
.tx-fit { font-weight: 600; }
.tx-range { font-size: 11.5px; margin-top: 3px; }
.tx-drop { font-size: 12px; color: var(--ok); }
@media (max-width: 599px) { .tx-line { margin: 20px 40px 6px 10px; } .tx-speeds { grid-template-columns: 1fr 1fr; } }

/* ---- tables and headers that must not wrap numbers -------------------------------------------- */
.cols-stats .nt .numc { white-space: nowrap; }
.qgroup h3 { flex-wrap: wrap; gap: 2px 12px; }
.card-foot { margin: 12px 0 0; }
.cols-stats .grid5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); }

/* ---- summary panel: hero, total exp with its breakdown bar, tiles, stat bars, HP/SP/EP meters --
   Colours are tokens (light, dark) in the brand's indigo and gold; every bar is decoration beside
   its number (aria-hidden), and delta chips sit inline after their number so they never cover text. */
:root {
  --sx-levels: #3d3497; --sx-ascension: #8e44ad; --sx-skills: #1f8a7a; --sx-spells: #2f7fd1; --sx-other: #c9900f; --sx-quests: #8994a3;
  --sx-hp: #d14343; --sx-sp: #2f74c9; --sx-ep: #18804a; --sx-race: #3d3497; --sx-more: #d9a21b;
  --sx-grad: linear-gradient(90deg, #272059 0%, #4a3fb3 50%, #a8740a 100%);
  --sx-hero: linear-gradient(135deg, color-mix(in srgb, #272059 9%, var(--surface)) 0%, color-mix(in srgb, #e9b13b 13%, var(--surface)) 100%);
  --sx-gold-tile: color-mix(in srgb, #e9b13b 16%, var(--surface-2)); --sx-gold-ink: #94650a;
  --sx-track: color-mix(in srgb, var(--text) 9%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sx-levels: #8b83f0; --sx-ascension: #c08ae0; --sx-skills: #45c4ae; --sx-spells: #6aa9f0; --sx-other: #e9b13b; --sx-quests: #6c7888;
    --sx-hp: #ff7b7b; --sx-sp: #6aa9f0; --sx-ep: #4fc887; --sx-race: #8b83f0; --sx-more: #e9b13b;
    --sx-grad: linear-gradient(90deg, #c9c4ff 0%, #a59cff 45%, #f1c35a 100%);
    --sx-hero: linear-gradient(135deg, color-mix(in srgb, #6d5fff 16%, var(--surface)) 0%, color-mix(in srgb, #e9b13b 11%, var(--surface)) 100%);
    --sx-gold-tile: color-mix(in srgb, #e9b13b 13%, var(--surface-2)); --sx-gold-ink: #f1c35a;
  }
}
:root[data-theme="dark"] {
  --sx-levels: #8b83f0; --sx-ascension: #c08ae0; --sx-skills: #45c4ae; --sx-spells: #6aa9f0; --sx-other: #e9b13b; --sx-quests: #6c7888;
  --sx-hp: #ff7b7b; --sx-sp: #6aa9f0; --sx-ep: #4fc887; --sx-race: #8b83f0; --sx-more: #e9b13b;
  --sx-grad: linear-gradient(90deg, #c9c4ff 0%, #a59cff 45%, #f1c35a 100%);
  --sx-hero: linear-gradient(135deg, color-mix(in srgb, #6d5fff 16%, var(--surface)) 0%, color-mix(in srgb, #e9b13b 11%, var(--surface)) 100%);
  --sx-gold-tile: color-mix(in srgb, #e9b13b 13%, var(--surface-2)); --sx-gold-ink: #f1c35a;
}

/* ---- loading states (lazy.js Loading; .quip-loader itself is in brand.css) -------------------- */
.quip-wait { min-height: 1.4em; }
.quip-loader p { margin: 0; }
.quip-loader.sm { gap: 8px; padding: 4px 0; font-size: 13px; }
.quip-loader.sm img { width: 28px; height: 28px; }
.quip-spin { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: quipspin .9s linear infinite; }
@keyframes quipspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .quip-spin { animation: none; } }

/* delta chips in the stats, quests, eq and tax views: inline after their number too (never over a
   label, a header or the row above) */
.cols-stats .num .chip, .cols-tax .num .chip, #sec-quests .num .chip, #sec-abilities .num .chip, .eqset .num .chip,
.card-head .num .chip { position: static; display: inline-block; margin-left: 4px; vertical-align: 1px; animation-name: chipfade; }

.summary .sum-body { gap: 12px; }
.summary .num .chip { position: static; display: inline-block; margin-left: 0; vertical-align: 1px; animation-name: chipfade; }
/* the number never breaks inside; its chip goes under it when the line is too narrow */
.summary .num { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; row-gap: 1px; max-width: 100%; }

/* hero */
.sx-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px 12px; margin: -2px -4px 0;
  border-radius: var(--radius); background: var(--sx-hero); border: 1px solid color-mix(in srgb, #e9b13b 25%, var(--border)); }
.sx-portrait { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, #e9b13b 70%, transparent); }
.sx-name { font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.sx-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #272059; color: #e9b13b; vertical-align: 3px; }
.sx-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.sx-tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sx-emblem { width: 18px; height: 18px; flex: none; }
.sx-guilds { grid-column: 1 / -1; list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sx-chip { font-size: 12px; line-height: 1.3; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.sx-chip b { font-variant-numeric: tabular-nums; }
.sx-chip.race { color: var(--muted); }
.sx-chip.none { color: var(--muted); font-style: italic; }

/* status */
.sx-status { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  border-left-width: 4px; font: inherit; text-align: left; cursor: pointer; color: var(--text); background: var(--surface-2); transition: filter .15s ease; }
.sx-status:hover { filter: brightness(.97); }
.sx-status:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sx-status.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); border-left-color: var(--ok); }
.sx-status.ok > .ico { color: var(--ok); }
.sx-status.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); border-left-color: var(--warn); }
.sx-status.warn > .ico { color: var(--warn); }
.sx-status.error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); border-left-color: var(--err); }
.sx-status.error > .ico { color: var(--err); }
.sx-status-text { flex: 1; display: grid; font-size: 13px; line-height: 1.3; }
.sx-status-text b { font-size: 14px; }
.sx-status-text span { color: var(--muted); }
.sx-status-go { font-size: 20px; color: var(--muted); line-height: 1; }

/* total exp */
.sx-total .lbl { display: block; }
.sx-big { font-size: 32px; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; margin: 1px 0 4px; font-variant-numeric: tabular-nums; }
.sx-pace { display: flex; gap: 6px; align-items: baseline; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.sx-pace svg { align-self: start; }
.sx-pace b { color: var(--text); }
.sx-big .num .chip { font-size: 12px; vertical-align: 8px; }
.sx-grad { background: var(--sx-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
@media (forced-colors: active) { .sx-grad { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; } }
.sx-bar { display: flex; height: 6px; border-radius: 999px; background: var(--sx-track); overflow: hidden; }
.sx-bar > i { display: block; height: 100%; min-width: 2px; transition: width .35s ease; }
.sx-bar > i + i { box-shadow: -1px 0 0 var(--surface); }
.sx-expbar { height: 10px; margin: 8px 0; }
.sx-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.sw-levels { background: var(--sx-levels); }
.sw-ascension { background: var(--sx-ascension); }
.sw-skills { background: var(--sx-skills); }
.sw-spells { background: var(--sx-spells); }
.sw-other { background: var(--sx-other); }
.sw-quests { background: repeating-linear-gradient(135deg, var(--sx-quests) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--sx-quests); }
.sx-legend { margin: 0; display: grid; gap: 1px; }
.sx-legend > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.sx-legend dt { color: var(--muted); }
.sx-legend dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.sx-legend .saved { border-top: 1px dashed var(--border); padding-top: 2px; margin-top: 2px; }

/* tiles */
.sx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sx-tile { display: grid; gap: 3px; align-content: start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  text-decoration: none; border: 1px solid transparent; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
a.sx-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
a.sx-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.sx-tl { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sx-tl .ico { color: var(--accent); flex: none; }
a.sx-tile .sx-tl::after { content: "›"; margin-left: auto; font-size: 14px; color: var(--faint); }
.sx-tv { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.sx-tv small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sx-ts { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sx-tile .sx-bar { height: 4px; }
.sx-bar .fill { background: var(--accent); }
.sx-bar .fill.bad { background: var(--err); }
.sx-tile.gold { background: var(--sx-gold-tile); }
.sx-tile.gold .sx-tl .ico { color: var(--sx-gold-ink); }
.sx-tile.bad { background: var(--err-soft); }

/* stats: one bar per stat (the race part darker), skill and spell max as meters */
.sx-statgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sx-stat, .sx-maxrow, .sx-pool { display: grid; grid-template-columns: 38px minmax(40px, 1fr) auto; gap: 2px 10px; align-items: center; font-size: 13.5px; }
.sx-sl, .sx-ml, .sx-pl { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.sx-stat .sx-bar { grid-column: 2; grid-row: 1; height: 8px; }
.sx-sv { grid-column: 3; grid-row: 1; font-weight: 800; font-size: 15px; text-align: right; min-width: 3ch; }
.sx-bar .race { background: var(--sx-race); }
.sx-bar .more { background: var(--sx-more); }
.sx-statkey { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); display: flex; gap: 4px 12px; flex-wrap: wrap; }
.sx-statkey .sx-sw { width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.sx-statkey .race { background: var(--sx-race); }
.sx-statkey .more { background: var(--sx-more); }
.sx-maxes { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sx-maxrow { grid-template-columns: 70px minmax(40px, 1fr) auto; }
.sx-maxrow .sx-bar { grid-column: 2; grid-row: 1; height: 6px; }
.sx-mv { grid-column: 3; grid-row: 1; font-weight: 700; text-align: right; }

/* HP / SP / EP */
.sx-pools { display: grid; gap: 6px; }
.sx-pool { grid-template-columns: 46px minmax(40px, 1fr) auto; row-gap: 0; }
.sx-pl { display: inline-flex; align-items: center; gap: 4px; }
.sx-pool .sx-bar { grid-column: 2; grid-row: 1; height: 8px; }
.sx-pv { grid-column: 3; grid-row: 1; font-weight: 800; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.sx-pr { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.sx-pool.hp .sx-pl { color: var(--sx-hp); }
.sx-pool.hp .fill { background: var(--sx-hp); }
.sx-pool.sp .sx-pl { color: var(--sx-sp); }
.sx-pool.sp .fill { background: var(--sx-sp); }
.sx-pool.ep .sx-pl { color: var(--sx-ep); }
.sx-pool.ep .fill { background: var(--sx-ep); }
.sx-note { margin: 0; font-size: 11.5px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .sx-bar > i, .sx-tile, .sx-status { transition: none; }
  a.sx-tile:hover { transform: none; }
}

/* ---- folding: common.js FoldHead / FoldToggle / FoldBody on top of ui/fold.js -----------------
   The button, chevron and summary look are fold.js's (brand.css .fold-*); these rules fit them
   into card heads, groups and the summary. */
/* the body glides shut and open: a grid whose one row goes 1fr to 0fr. common.js FoldBody adds .gliding for the ride, so the inner
   part clips only then and while shut (open, popovers and pickers inside may reach past it); shut and still, it is also invisible. */
.fold-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease-out; }
.fold-body.is-shut { grid-template-rows: 0fr; }
.fold-in { min-height: 0; }
.fold-body.is-shut .fold-in, .fold-body.gliding .fold-in { overflow: hidden; }
.fold-body.is-shut:not(.gliding) .fold-in { visibility: hidden; }
.fold-body[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .fold-body { transition: none; } }
/* the chevron follows the button's own state (these headings have no .fold wrapper) */
.fold-btn[aria-expanded="false"] .fold-chev { transform: rotate(0deg); }
.fold-btn[aria-expanded="true"] .fold-chev { transform: rotate(90deg); }
.card-head > h2.fold-h { font-size: 17px; }
.fold-sum.inline { margin: 0; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fold-only { display: inline-flex; flex: none; }
.fold-only .fold-btn { width: 26px; height: 26px; justify-content: center; border-radius: var(--radius-sm); }
.card.is-folded .card-head { margin-bottom: 0; }
.card.is-folded { padding-bottom: 12px; }
/* headings that hold other content keep it on one line with the button */
.boon-group-h, .eq-items-h, .sx-fold-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.boon-group-h h3.fold-h { font-size: 13.5px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.eq-items-h { margin: 6px 0 8px; }
.eq-items-h h3.fold-h { font-size: 14px; }
.specials legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.specials legend h3.leg-h { font-size: inherit; }
.qgroup h3 .fold-only { margin-right: -2px; }
.qgroup.is-folded h3 { border-bottom-style: dashed; }
/* the summary: small upper-case section labels as fold buttons */
.summary h2.fold-h.lbl { font-size: 11.5px; margin: 0 0 2px; }
.summary .fold-h.lbl .fold-chev { width: 14px; height: 14px; }
.summary .sx-fold-line { margin-bottom: 4px; }
.summary .sx-fold-line .fold-sum.inline { font-size: 12.5px; }
.summary .sum-issues h2.fold-h.sec-h { margin: 0; font-size: 14px; }
.sx-pools-body { display: grid; gap: 6px; }

/* ---- Routes tab (ui/routes.js): the route and the advisor beside the map ------------------------- */
.routes { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rt-side { min-width: 0; }
.rt-mapcard { position: sticky; top: calc(var(--top-h) + 12px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; min-width: 0; }
.rt-maphead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.rt-maphead h2 { margin: 0; font-size: 1.15em; }
.rt-tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; }
.rt-zoom { display: inline-flex; align-items: center; gap: 4px; }
.rt-zoomval { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.rt-viewport { position: relative; overflow: auto; height: calc(100vh - var(--top-h) - 150px); min-height: 360px; border-radius: 10px;
  background: #05070a; border: 1px solid var(--border); cursor: crosshair; overscroll-behavior: contain; }
.rt-viewport.dragging { cursor: grabbing; }
.rt-spacer { width: 1px; height: 1px; }
.rt-canvas { position: absolute; left: 0; top: 0; display: block; pointer-events: none; }
.rt-readout { min-height: 1.4em; font-variant-numeric: tabular-nums; }
.rt-credit { margin: 0; }
.rt-ends { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; }
.rt-ends .field { margin: 0; }
.rt-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 800; font-size: 12px; color: #000;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); align-self: end; margin-bottom: 6px; }
.rt-dot.a { background: #38d67a; }
.rt-dot.b { background: #ff5a5a; }
.rt-stats { margin: 0 0 8px; }
.rt-cmdhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.rt-batch { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); }
.rt-batch select { width: auto; min-height: 28px; padding-top: 2px; padding-bottom: 2px; }
.rt-walk { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical; margin-bottom: 6px; background: var(--surface-2); }
.rt-legs { margin-top: 8px; font-size: 13px; }
.rt-legs summary { cursor: pointer; font-weight: 600; }
.rt-legs ol { margin: 6px 0 0; padding-left: 2.6em; max-height: 320px; overflow: auto; font-variant-numeric: tabular-nums; }
.rt-legs li { padding: 1px 0; }
.rt-legs li.brk { border-bottom: 1px dashed var(--border-strong); padding-bottom: 4px; margin-bottom: 3px; }
.rt-legs .btn.link { font-family: ui-monospace, Consolas, monospace; padding: 0 2px; }
.rt-none p { margin: 0; }
.rt-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; }
.rt-opts fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 2px; font-size: 13.5px; }
.rt-opts legend { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0; margin-bottom: 2px; }
.rt-advq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.rt-advq .field { margin: 0; }
.rt-advbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rt-advbar .seg-opt span { padding: 4px 10px; font-size: 13px; }
.rt-advlist { list-style: none; margin: 0; padding: 0; display: grid; }
.rt-advlist li { padding: 9px 8px; border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; border-radius: 8px; min-width: 0; }
.rt-advlist li > * { min-width: 0; overflow-wrap: anywhere; }
.rt-advlist li.on { background: var(--accent-soft); border-top-color: transparent; }
.rt-advtop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.rt-advexp { margin-left: auto; font-variant-numeric: tabular-nums; }
.rt-advexp b { font-size: 15px; color: var(--accent); }
.rt-diff { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rt-races { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-advlist .row-btns { margin-top: 2px; }
@media (max-width: 1099px) {
  .routes { grid-template-columns: minmax(0, 1fr); }
  .rt-mapcard { position: static; order: -1; }
  .rt-viewport { height: min(62vh, 560px); }
}
@media (max-width: 599px) { .rt-tools { margin-left: 0; } }

/* ---- the exping advisor (ui/routes.js ExpingView) --------------------------------------------------- */
.routes.exping { grid-template-columns: minmax(380px, 540px) minmax(0, 1fr); }
.rt-startrow { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); gap: 6px 12px; align-items: end; }
.rt-startrow .field { margin: 0; }
.rt-advlist .rt-walkbox { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.rt-advlist li.on .row-btns .btn[disabled] { opacity: .5; }
@media (max-width: 1099px) { .routes.exping { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) { .rt-startrow { grid-template-columns: minmax(0, 1fr); } }

.rt-mines { margin: 0 0 10px; align-items: flex-start; flex-wrap: nowrap; font-size: 13.5px; }
.rt-mines .ico { flex: none; margin-top: 2px; }
.rt-mines > span:first-of-type { flex: 1 1 auto; }

/* "Show me the WAY" (routes.js ExpingView): the mines, in red */
.rt-mines { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; }
.btn.rt-way { grid-column: 2; justify-self: end; background: #d81e1e; border-color: #d81e1e; color: #fff; font-weight: 800; letter-spacing: .02em; }
.btn.rt-way:hover { background: #b51313; border-color: #b51313; color: #fff; }
.btn.rt-way[aria-pressed="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, #d81e1e 35%, transparent); }

/* Reinc stats and Exping stats tabs (ui/reincstats.js, ui/expstats.js; charts ui/charts.js, lists and cards ui/drill.js).
   --rs-you marks the plan's character ("you"), always with the word beside it; the shades of the day grid are the
   accent mixed into the card, so more is darker on light and brighter on dark. */
.rs, .rs-card {
  --rs-you: #a2700a; --rs-dim: .3;
  --rs-c0: var(--surface-3); --rs-c1: color-mix(in srgb, var(--accent) 24%, var(--surface)); --rs-c2: color-mix(in srgb, var(--accent) 42%, var(--surface));
  --rs-c3: color-mix(in srgb, var(--accent) 62%, var(--surface)); --rs-c4: color-mix(in srgb, var(--accent) 82%, var(--surface)); --rs-c5: var(--accent);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.rs, .rs-card) { --rs-you: #f0b94a; } }
:root[data-theme="dark"] :is(.rs, .rs-card) { --rs-you: #f0b94a; }
.rs { display: grid; gap: 16px; }
.rs h3 { margin: 0 0 10px; }
.rs-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.rs-filters select { max-width: 12em; }
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rs-tile { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0;
  border: 1px solid transparent; font: inherit; color: inherit; text-align: left; }
button.rs-tile { cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
button.rs-tile:hover { border-color: var(--border-strong); }
button.rs-tile:active { transform: scale(.98); }
button.rs-tile.on { border-color: var(--accent); background: var(--accent-soft); }
button.rs-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
button.rs-tile .rs-tl::after { content: " ›"; color: var(--accent); font-weight: 700; }
.rs-tl { font-size: 12.5px; color: var(--muted); }
.rs-tv { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; font-size: 22px; font-weight: 750; line-height: 1.2; }
.rs-ts { font-size: 12px; color: var(--muted); }
.rs-spark { flex: none; margin-bottom: 3px; }
.rs-spark rect { fill: color-mix(in srgb, var(--muted) 40%, transparent); }
.rs-spark rect.now { fill: var(--accent); }
.rs-you, .rs-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 13.5px; }
.rs-you svg, .rs-note svg { flex: none; margin-top: 2px; color: var(--muted); }
.rs-note { margin: 4px 0 14px; }
.rs-how { display: flex; gap: 5px; align-items: center; margin-top: 10px; }
.rs-how svg { flex: none; }
.rs-you-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.45; padding: 0 6px;
  border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--rs-you) 16%, transparent); border: 1px solid color-mix(in srgb, var(--rs-you) 55%, transparent); vertical-align: 1px; }

/* charts */
.rs-chart { margin: 0 0 16px; min-width: 0; }
.rs :is(.hint, .tablewrap, .rs-drill) + .rs-chart { margin-top: 14px; }
.rs-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.rs-chart-head figcaption { font-size: 13.5px; }
.rs-plot { position: relative; }
.rs-svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.rs-svg:focus { outline: none; }
.rs-svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.rs-grid line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.rs-grid.v line { stroke: color-mix(in srgb, var(--border) 55%, transparent); }
.rs-grid text, .rs-x, .rs-axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.rs-x.on { fill: var(--text); font-weight: 700; }
.rs-axis { font-size: 11px; }
.rs-peak { fill: var(--text); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rs-cols { animation: rs-rise .5s cubic-bezier(.2, .75, .25, 1) both; }
.rs-bar { fill: var(--accent); transition: y .35s cubic-bezier(.2, .75, .25, 1), height .35s cubic-bezier(.2, .75, .25, 1), opacity .2s, fill .12s; }
.rs-bar.on { fill: var(--accent-hover); }
.rs-bar.partial { opacity: .45; }
.rs-dim .rs-bar:not(.picked):not(.on) { opacity: var(--rs-dim); }
.rs-hit { fill: transparent; }
.rs-pick .rs-hit, .rs-pick .rs-cal { cursor: pointer; }
.rs-mark path { fill: var(--rs-you); }
.rs-mark text, .rs-mark-l, .rs-median-l { fill: var(--text); font-size: 11px; font-weight: 700; }
/* labels that sit on marks keep a halo of the card colour */
.rs-mark text, .rs-mark-l, .rs-median-l, .rs-peak { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.rs-dot { fill: var(--accent); fill-opacity: .5; stroke: var(--surface); stroke-width: 1; }
.rs-dot.on { fill-opacity: 1; stroke-width: 2; }
.rs-dot.me { fill: var(--rs-you); fill-opacity: 1; stroke-width: 2; }
.rs-step { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; opacity: .75; }
.rs-curve { fill: none; stroke: var(--muted); stroke-opacity: .3; stroke-width: 1.25; stroke-linejoin: round; }
.rs-curve.on { stroke: var(--text); stroke-opacity: 1; stroke-width: 2.25; }
.rs-curve.me { stroke: var(--rs-you); stroke-opacity: 1; stroke-width: 2.25; }
.rs-dim .rs-curve:not(.on):not(.me) { stroke-opacity: .14; }
.rs-median { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rs-cross { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.rs-cal { fill: var(--rs-c0); }
.rs-cal.c1 { fill: var(--rs-c1); } .rs-cal.c2 { fill: var(--rs-c2); } .rs-cal.c3 { fill: var(--rs-c3); } .rs-cal.c4 { fill: var(--rs-c4); } .rs-cal.c5 { fill: var(--rs-c5); }
.rs-cal.today { stroke: var(--accent); stroke-width: 1.5; }
.rs-cal.on, .rs-cal.picked { stroke: var(--text); stroke-width: 2; }
.rs-cal-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.rs-cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.rs-cal-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--rs-c0); }
.rs-cal-legend i.c1 { background: var(--rs-c1); } .rs-cal-legend i.c2 { background: var(--rs-c2); } .rs-cal-legend i.c3 { background: var(--rs-c3); }
.rs-cal-legend i.c4 { background: var(--rs-c4); } .rs-cal-legend i.c5 { background: var(--rs-c5); }
.rs-tip { position: absolute; z-index: 3; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; width: max-content; min-width: 96px; max-width: 220px;
  padding: 5px 10px 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: 12.5px; line-height: 1.35; animation: rs-fade .12s ease-out; }
.rs-tip b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rs-tip-hint { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--accent); }
.rs-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 24px; }
.rs-two > div { min-width: 0; }
.rs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.rs-key { display: inline-flex; align-items: center; gap: 6px; }
.rs-sw { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.rs-sw.all { background: var(--border-strong); }
.rs-sw.dot { width: 9px; height: 9px; border-radius: 50%; opacity: .7; }
.rs-sw.dot.me { background: var(--rs-you); opacity: 1; }
.rs-sw.line { width: 18px; height: 3px; border-radius: 2px; }
.rs-sw.line.curve { height: 1.5px; background: var(--muted); opacity: .6; }
.rs-sw.line.me { background: var(--rs-you); }
.rs-sw.line.step { background: var(--text); opacity: .75; }

/* tables */
.rs-table { width: 100%; }
.rs-table th[scope=row] { font-weight: 600; }
.rs-table th[scope=row] .btn.link { white-space: nowrap; }
.ap-table tbody tr:nth-child(even) > * { background: var(--surface-2, var(--surface)); }
.rs-table tr.xs-me > * { background: var(--accent-soft); }
.rs-table tr.rs-row-on > * { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.rs-tall { max-height: 420px; overflow-y: auto; }
/* a visually hidden header label is absolutely placed: without this it escapes the scrolling box and widens the page */
:is(.rs, .rs-card) .tablewrap { position: relative; }
.rs-bars { width: 32%; min-width: 80px; }
.rs-bars i { display: block; height: 7px; border-radius: 0 4px 4px 0; min-width: 1px; transition: width .35s cubic-bezier(.2, .75, .25, 1); }
.rs-bars i + i { margin-top: 2px; }
.rs-bars .recent { background: var(--accent); }
.rs-bars .all { background: var(--border-strong); }
.rs-race { display: inline-flex; align-items: center; gap: 7px; }
.rs-races .btn.link, .rs-race .btn.link, .btn.link.rs-who { padding: 0; }
.btn.link.rs-who { font-weight: inherit; text-align: left; }
.rs-sort { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit;
  letter-spacing: inherit; cursor: pointer; }
.rs-sort:hover { color: var(--text); }
.rs-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.rs-more { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 8px; }
.xs-gap td { padding: 0 7px; text-align: center; color: var(--muted); }
.rs-table th.xs-mon { white-space: normal; min-width: 12em; }

/* drill-down lists, the day of the feed */
.rs-drill { margin: 0 0 16px; padding: 10px 12px 6px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent);
  animation: rs-open .22s ease-out; scroll-margin: 80px 0 24px; }
.rs-drill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rs-drill-head h4 { margin: 0; font-size: 14px; }
.rs-drill .tablewrap { margin-bottom: 8px; }
.xs-day { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 4px 20px; padding-bottom: 8px; }
.xs-day h5 { display: flex; align-items: center; gap: 5px; margin: 6px 0 4px; font-size: 13px; }
.xs-day h5 svg { color: var(--muted); }
.xs-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }

/* the live record on the Player profile (ui/drill.js) and the feed's timeline */
.rs-facts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.rs-card-wait { animation: rs-pulse 1.2s ease-in-out infinite; }
.rs-timeline { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 9px; }
.rs-tl-day { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rs-timeline ul { list-style: none; margin: 3px 0 0 5px; padding: 0 0 0 10px; display: grid; gap: 3px; border-left: 2px solid var(--border); font-size: 13px; }
.rs-timeline li li { display: flex; gap: 6px; align-items: baseline; }
.rs-timeline li li .ico { flex: none; position: relative; top: 2px; color: var(--muted); }
.rs-timeline .k-reinc .ico { color: var(--accent); }
.rs-timeline .k-level .ico { color: var(--ok); }
.rs-timeline .k-death .ico { color: var(--err); }
.rs-timeline .k-kill .ico { color: var(--warn); }

/* Exping stats only */
.xs-h4 { margin: 16px 0 6px; font-size: 14px; }
.xs-latest { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.xs-latest .muted { font-variant-numeric: tabular-nums; }

@keyframes rs-rise { from { transform: scaleY(0); } }
@keyframes rs-fade { from { opacity: 0; } }
@keyframes rs-open { from { opacity: 0; transform: translateY(-4px); } }
@keyframes rs-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .rs-bar, .rs-bars i, button.rs-tile { transition: none; }
  .rs-cols, .rs-tip, .rs-drill, .rs-card-wait { animation: none; }
}
@media (forced-colors: active) { .rs-bar, .rs-bars i, .rs-sw, .rs-cal, .rs-cal-legend i, .rs-dot, .rs-spark rect, .rs-curve, .rs-median { forced-color-adjust: none; } }

/* ---- Build advisor as a gallery (ui/advisor.js): idea tiles, build cards with a portrait, the exp against the budget, guild chips ---- */
.adv-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.adv-idea { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--hilite), var(--shadow); cursor: pointer; font: inherit; color: var(--text); text-align: left; transition: transform .16s ease-out, box-shadow .16s ease-out; }
.adv-idea:hover, .adv-idea:focus-visible { transform: translateY(-2px); box-shadow: var(--glow-gold); }
.adv-idea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.adv-idea .race-pic { flex: none; }
.adv-idea-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.adv-idea-txt { min-width: 0; }
.adv-idea b { display: block; font-size: 14.5px; }
.adv-idea small { color: var(--muted); font-size: 12.5px; }
.adv-build-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; margin-bottom: 8px; }
.adv-portrait { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--gold) 70%, transparent); }
.adv-build-top h3 { margin: 0; font-family: var(--font-display, inherit); font-size: 19px; font-weight: 650; }
.adv-build-top .adv-build-meta { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.adv-emblem { width: 18px; height: 18px; flex: none; }
.adv-build-top .badge { font-size: 13px; align-self: start; }
.adv-expbar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 2px 0 8px; }
.adv-expbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .35s ease; }
.adv-expbar i.over { background: var(--err); }
.adv-rows { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: row; }
.adv-rows li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.adv-rows li::before { counter-increment: row; content: counter(row); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.adv-rows li .adv-link { text-decoration: none; font-weight: 600; }
.adv-rows li .adv-link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .adv-idea, .adv-expbar i { transition: none; } .adv-idea:hover, .adv-idea:focus-visible { transform: none; } }

/* Exping stats: the time lapse (ui/lapse.js), a bar race of bat.org's weekly exp plaque */
.lp-ctl label, .lp-follow { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.lp-follow input { width: 13em; }
.lp-play { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.lp-pp { min-width: 8.5em; }
.lp-slider { flex: 1 1 220px; min-width: 160px; accent-color: var(--accent); }
.lp-when { margin: 4px 0 10px; font-size: 14px; }
.lp-when b { font-size: 22px; font-variant-numeric: tabular-nums; margin-right: 4px; }
.lp-board { position: relative; margin-bottom: 8px; transition: height .3s ease; }
.lp-row { position: absolute; left: 0; right: 0; top: 0; height: 26px; display: grid; grid-template-columns: 2.2em minmax(7em, 11em) minmax(0, 1fr); align-items: center; gap: 8px;
  font-size: 13.5px; transition: transform .45s cubic-bezier(.2, .75, .25, 1); }
.lp-rank { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lp-track { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lp-track i { display: block; height: 18px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; transition: width .2s linear; }
.lp-track b { flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lp-row.fol .lp-track i { background: var(--rs-you); }
.lp-row.me .lp-name::after { content: "you"; margin-left: 2px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.lp-board.still .lp-row, .lp-board.still .lp-track i { transition: none; }
@media (prefers-reduced-motion: reduce) { .lp-row, .lp-track i, .lp-board { transition: none; } }
@media (max-width: 600px) { .lp-row { grid-template-columns: 1.8em minmax(5.5em, 7em) minmax(0, 1fr); font-size: 12.5px; } }
.lp-tot { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Retired (ui/retired.js): players exping and retired over time */
.rt-race { display: grid; gap: 6px; margin: 4px 0 12px; }
.rt-race-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); align-items: center; gap: 8px; }
.rt-race-label { font-weight: 600; font-size: 13.5px; }
.rt-race-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rt-race-track i { display: block; height: 22px; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .25s linear; }
.rt-race-track b { flex: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.rt-race-track i.rt-live, .rt-col .rt-live, .rs-sw.rt-live { background: var(--accent); fill: var(--accent); }
.rt-race-track i.rt-gone, .rt-col .rt-gone, .rs-sw.rt-gone { background: var(--gold); fill: var(--gold); }
.rt-col.later rect.rt-live, .rt-col.later rect.rt-gone { opacity: .18; }
.rt-col.on rect.rt-live, .rt-col.on rect.rt-gone { opacity: 1; filter: brightness(1.12); }
.rt-col .rs-hit { fill: transparent; cursor: pointer; }
.rt-now { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
@media (prefers-reduced-motion: reduce) { .rt-race-track i { transition: none; } }
/* the panels share the row's width (a lone one keeps a column's) */
.rt-tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 6px 0 16px; }
.rt-top { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 10px 8px; background: var(--surface); min-width: 0; }
.rt-top-h { font-size: 13.5px; margin: 0 0 6px 4px; }
/* one grid for the whole list (subgrid rows), so ranks, names, bars and values line up */
.rt-top-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.5em minmax(0, max-content) minmax(40px, 1fr) max-content; column-gap: 10px; }
.rt-top-list li, .rt-top-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; }
.rt-top-row { width: 100%; padding: 4px 4px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rt-top-row:hover { background: var(--surface-2); }
.rt-top-row[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.rt-top-list li + li .rt-top-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); border-radius: 0; }
.rt-top-rank { color: var(--muted); text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rt-top-name { display: grid; min-width: 0; line-height: 1.25; }
.rt-top-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-top-name small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-top-bar i { display: block; height: 8px; border-radius: 0 3px 3px 0; background: var(--gold); }
.rt-top-val { text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-range .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
@media (max-width: 600px) {
  .rt-top-list { grid-template-columns: 1.5em minmax(0, 1fr) max-content; }
  .rt-top-rank { grid-column: 1; grid-row: 1; }
  .rt-top-name { grid-column: 2; grid-row: 1; }
  .rt-top-val { grid-column: 3; grid-row: 1; }
  .rt-top-bar { grid-column: 2 / -1; grid-row: 2; margin-top: 4px; }
  .rt-top-name small { white-space: normal; }
}

/* Dashboard (ui/dashboard.js): the Player stats' landing page */
.db-heroes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.db-big { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.db-big:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.db-big-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.db-big b { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.db-big small { color: var(--muted); font-size: 12px; }
.db-trend svg { display: block; width: 100%; height: 90px; }
.db-a-live { fill: color-mix(in srgb, var(--accent) 22%, transparent); } .db-l-live { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.db-a-gone { fill: color-mix(in srgb, var(--gold) 28%, transparent); } .db-l-gone { fill: none; stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.db-trend-words { margin: 6px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.db-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.db-key.live { background: var(--accent); } .db-key.gone { background: var(--gold); }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.db-card { margin: 0; display: flex; flex-direction: column; }
.db-card-head { display: flex; align-items: center; gap: 10px; margin: -4px 0 6px; }
.db-card-head h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.db-card-head .mascot { flex: none; transition: transform .25s ease; transform-origin: 50% 90%; }
.db-card:hover .mascot { transform: rotate(-6deg) scale(1.06); }
.db-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 2px; }
.db-list li { display: grid; grid-template-columns: 1.6em 28px minmax(0, 1fr) max-content; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px 4px; border-radius: var(--radius-sm); }
.db-list li.me { background: var(--accent-soft); }
.db-rank { grid-row: 1 / span 2; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.db-list li.medal .db-rank { color: #1d1640; border: 2px solid #1d1640; }
.db-list li.m1 .db-rank { background: #f2c14e; } .db-list li.m2 .db-rank { background: #d5dbe5; } .db-list li.m3 .db-rank { background: #d99a5b; }
.db-list .race-pic, .db-noface { grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; }
.db-noface { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 13px; }
.db-who { display: grid; min-width: 0; line-height: 1.2; }
.db-name { font-weight: 700; font-size: 14px; justify-self: start; padding: 0; }
.db-who small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-val { font-weight: 700; font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-bar { grid-column: 3 / -1; height: 5px; margin-top: 3px; }
.db-bar i { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
.db-list li.m1 .db-bar i { background: linear-gradient(90deg, var(--gold), #f6cf6a); }
.db-more { margin-top: auto; align-self: flex-end; }
@media (prefers-reduced-motion: reduce) { .db-big, .db-card-head .mascot { transition: none; } }
.db-card-head .mascot { background: radial-gradient(circle at 50% 40%, #fffaf0, #f5e6bf); border: 3px solid #1d1640; border-radius: 50%; padding: 4px;
  box-shadow: 0 0 0 3px var(--gold), var(--shadow); width: 120px; height: 120px; object-fit: contain; }
@media (max-width: 600px) {
  .db-heroes { grid-template-columns: 1fr 1fr; gap: 8px; }
  .db-big { padding: 10px; } .db-big b { font-size: 24px; } .db-big-label { font-size: 11px; }
}
.lp-top { display: inline-flex; align-items: center; gap: 6px; }
.lp-top-n { min-width: 4.2em; text-align: center; font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rt-tops > .rt-top:only-child { max-width: 640px; }
.rt-gone { margin-bottom: 6px; } .rt-gone-l { font-size: 13.5px; }

/* Player profile (ui/profile.js) */
.pf-search input[type=search], .pf-search input[type=text] { width: 15em; }
.pf-who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.pf-who > div { flex: 1 1 260px; min-width: 0; }
.pf-name { margin: 0; font-size: 22px; }
.pf-who p { margin: 2px 0 0; }
.pf-face { width: 56px; height: 56px; font-size: 22px; }
.pf-now { font-size: 15px; }
.pf-facts { margin: 0 0 6px; font-size: 13.5px; }
.rs-tiles + .pf-facts { margin-top: 12px; }
.pf-feed { margin: 4px 0 10px; font-size: 13.5px; }
.pf-feed a { display: inline-flex; align-items: center; gap: 4px; }
.pf-two { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.pf-h { font-size: 14px; margin: 14px 0 6px; }
.pf-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .15s; }
.pf-line.dim { opacity: .25; }
.pf-dot { stroke: var(--surface); stroke-width: 2; }
/* the comparison's lines: the dataviz reference categorical slots 1-5 (validated: lightness, chroma, colour-blind separation;
   light-mode contrast under 3:1 is relieved by the legend and the table view), stepped for the dark surface */
:root { --pf1: #2a78d6; --pf2: #eb6834; --pf3: #1baf7a; --pf4: #eda100; --pf5: #e87ba4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pf1: #3987e5; --pf2: #d95926; --pf3: #199e70; --pf4: #c98500; --pf5: #d55181; } }
:root[data-theme="dark"] { --pf1: #3987e5; --pf2: #d95926; --pf3: #199e70; --pf4: #c98500; --pf5: #d55181; }
.pf-s0 { stroke: var(--pf1); } .pf-dot.pf-s0, .rs-sw.pf-s0 { fill: var(--pf1); background: var(--pf1); }
.pf-s1 { stroke: var(--pf2); } .pf-dot.pf-s1, .rs-sw.pf-s1 { fill: var(--pf2); background: var(--pf2); }
.pf-s2 { stroke: var(--pf3); } .pf-dot.pf-s2, .rs-sw.pf-s2 { fill: var(--pf3); background: var(--pf3); }
.pf-s3 { stroke: var(--pf4); } .pf-dot.pf-s3, .rs-sw.pf-s3 { fill: var(--pf4); background: var(--pf4); }
.pf-s4 { stroke: var(--pf5); } .pf-dot.pf-s4, .rs-sw.pf-s4 { fill: var(--pf5); background: var(--pf5); }
.pf-key { text-decoration: none; color: var(--text); padding: 0 4px; }
.pf-key[aria-pressed="true"] { font-weight: 700; }
/* Who stays (ui/retired.js Cohorts): each share shaded by its size */
.rt-cohorts td.rt-co { background: color-mix(in srgb, var(--accent) calc(var(--p) * 45%), transparent); font-variant-numeric: tabular-nums; }

/* Player stats: the tab bar's tools (find a player, copy the view's link) and, on a phone, a dropdown for the tabs */
.tabs-stats-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs-stats-box .tabs-stats { flex: 1 1 auto; min-width: 0; }
.stats-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.stats-find { display: inline-flex; align-items: center; gap: 4px; }
.stats-find input { width: 11em; }
.stats-pick { display: none; flex: 1 1 auto; }
.stats-pick select { width: 100%; font-weight: 600; }
.rt-who { padding: 0; font-weight: 600; text-decoration: none; color: var(--text); }
.rt-who:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .tabs-stats-box .tabs-stats { display: none; }
  .stats-pick { display: block; }
  .stats-tools { width: 100%; margin-left: 0; }
  .stats-find { flex: 1 1 auto; } .stats-find input { width: 100%; }
  .stats-link span { display: none; }
}
/* Exping stats: each leaderboard row's last 12 weeks on the plaque */
.xs-trend { width: 92px; } .xs-trend .rs-spark { display: block; }

/* Time lapse highlights (ui/lapse.js): big moves stand out for a moment */
.lp-move { flex: none; margin-left: 2px; font-size: 11px; font-weight: 800; white-space: nowrap; padding: 1px 6px; border-radius: 999px;
  animation: lp-move 1.8s ease-out forwards; }
.lp-move.up { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.lp-move.down { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
@keyframes lp-move { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.15); } 25% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.lp-row.mv-up .lp-track i, .lp-row.mv-new .lp-track i { animation: lp-flash 1.4s ease-out; }
.lp-row.mv-podium .lp-track i { animation: lp-gold 1.8s ease-out; }
.lp-row.mv-new .lp-name { animation: lp-newname 1.6s ease-out; }
@keyframes lp-flash { 0%, 30% { filter: brightness(1.45) saturate(1.2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { filter: none; box-shadow: none; } }
@keyframes lp-gold { 0%, 35% { background: var(--gold); box-shadow: var(--glow-gold); } 100% { box-shadow: none; } }
@keyframes lp-newname { 0% { color: var(--gold-ink); transform: translateX(-8px); } 30% { transform: none; } 100% { color: inherit; } }
.lp-board { overflow: visible; }
.lp-banner { position: absolute; z-index: 2; right: 0; top: -50px; transition: top .3s ease; display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--gold); color: var(--on-gold); font-size: 13.5px; box-shadow: var(--glow-gold); animation: lp-banner 3.2s ease-out forwards; }
.lp-banner { max-width: min(600px, 94%); line-height: 1.3; padding: 4px 16px 4px 4px; }
.lp-banner .mascot { flex: none; width: 52px; height: 52px; margin: -10px 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.lp-banner.podium, .lp-banner.milestone { background: var(--surface); color: var(--text); border: 2px solid var(--gold); }
.lp-banner.rocket { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); font-size: 13px; }
.lp-banner.crown { font-size: 14px; }
@keyframes lp-banner { 0% { opacity: 0; transform: translateY(-8px) scale(.9); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lp-move, .lp-banner, .lp-row .lp-track i, .lp-row .lp-name { animation: none !important; }
}
/* from the end of the player's bar: the bar column starts after the rank (2.2em) and the name (up to 11em) and two 8px gaps,
   in the row's own font size (--lp-s); the bar is --f of the column */
.lp-board { --lp-s: calc(13.2 * 13.5px + 16px); }
.lp-banner.at-row.end-right { right: auto; left: calc(var(--lp-s) + (100% - var(--lp-s)) * var(--f) - 30px); }
.lp-banner.at-row.end-left { left: auto; right: calc((100% - var(--lp-s)) * (1 - var(--f)) - 30px); }
/* the pointer up at the player's name */
.lp-banner.at-row::before { content: ""; position: absolute; left: 22px; top: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--gold); }
.lp-banner.at-row.end-left::before { left: auto; right: 22px; }
.lp-banner.at-row.rocket::before { border-bottom-color: var(--accent); }
@media (max-width: 600px) { .lp-board { --lp-s: calc(8.8 * 12.5px + 16px); } .lp-banner.at-row { max-width: calc(100% - 8px); } }
/* Shared milestone chips in the profile and Feats views. */
.pf-mi { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.35; }
.pf-mic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); align-self: start; }
.pf-mi.k-exp .pf-mic, .pf-mi.k-year .pf-mic, .pf-mi.k-best .pf-mic { background: var(--accent-soft); color: var(--gold); }
.pf-mi.k-level .pf-mic, .pf-mi.k-first .pf-mic { background: var(--accent-soft); color: var(--accent); }
.pf-mi.k-reinc .pf-mic, .pf-mi.k-rebirth .pf-mic, .pf-mi.k-back .pf-mic, .pf-mi.k-streak .pf-mic { color: var(--ok); }
.pf-md { font-size: 12px; }
/* Badges (ui/badges.js): a medal pops in, a shine sweeps across it; the big ones float */
.bdg-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.bdg { --bdg-a: #8a6d1d; --bdg-b: #f2c94c; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; line-height: 1.2;
  animation: bdg-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: var(--bdg-d, 0ms); }
.bdg-disc { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none;
  color: #fff; background: radial-gradient(circle at 35% 30%, var(--bdg-b), var(--bdg-a)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 1px 3px rgba(0, 0, 0, .25); }
.bdg-disc::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .75) 50%, transparent 60%);
  transform: translateX(-120%); animation: bdg-shine 3.6s ease-in-out infinite; animation-delay: calc(var(--bdg-d, 0ms) + .5s); }
.bdg-text { display: grid; }
.bdg-text small { color: var(--muted); font-size: 11.5px; }
.bdg.big { padding: 6px 16px 6px 6px; font-size: 15px; }
.bdg.big .bdg-disc { width: 48px; height: 48px; animation: bdg-float 3s ease-in-out infinite; }
.bdg.k-loser, .bdg.k-losers { --bdg-a: #4b2a7a; --bdg-b: #a77ce8; }
.bdg.k-loser .bdg-disc { animation: bdg-float 3s ease-in-out infinite, bdg-wobble 6s ease-in-out infinite; }
.bdg.k-weekloser { --bdg-a: #7a2a5f; --bdg-b: #e87ba4; }
.bdg.k-monthloser { --bdg-a: #2a3f7a; --bdg-b: #8aa6f0; }
.bdg.k-phoenix { --bdg-a: #b23c0e; --bdg-b: #ffb04a; }
.bdg.k-reinc { --bdg-a: #136b4f; --bdg-b: #4fd1a1; }
.bdg.k-old { --bdg-a: #5b4a35; --bdg-b: #c9a77a; }
.bdg.k-streak, .bdg.k-back { --bdg-a: #1d4f91; --bdg-b: #6aa8f0; }
.bdg.k-week { --bdg-a: #a3261f; --bdg-b: #ff7a6b; }
@keyframes bdg-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes bdg-shine { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes bdg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bdg-wobble { 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: -10deg; } 94% { rotate: 8deg; } 97% { rotate: -4deg; } }
@media (prefers-reduced-motion: reduce) { .bdg, .bdg-disc, .bdg-disc::after { animation: none !important; } }
/* the Exp lost tab's biggest loser */
.ls-loser { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 38px 14px 12px; margin: 4px 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: linear-gradient(150deg, rgba(167, 124, 232, .18), var(--surface) 70%); }
.ls-loser .mascot { animation: bdg-float 3.4s ease-in-out infinite; }
.ls-loser-who { display: grid; gap: 4px; justify-items: start; flex: 1 1 200px; }
.ls-loser-name { all: unset; cursor: pointer; font-size: 26px; font-weight: 800; letter-spacing: .01em; color: var(--text); }
.ls-loser-name:hover, .ls-r-name:hover { text-decoration: underline; }
.ls-loser-name:focus-visible, .ls-r-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ls-loser-n { color: var(--muted); font-size: 13.5px; }
.ls-loser-n b { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.ls-r-name { all: unset; cursor: pointer; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ls-loser .mascot { animation: none; } }
/* a Dashboard hero with a badge */
.db-big .bdg { justify-self: start; margin: 2px 0; }
/* the biggest loser's ribbon: slides in, a shine runs along it now and then */
.ls-ribbon { position: absolute; top: 0; left: 0; right: 0; padding: 5px 12px; text-align: center; font-size: 12.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #fff; overflow: hidden;
  background: linear-gradient(90deg, #4b2a7a, #8a55d6 50%, #4b2a7a); animation: ls-ribbon .7s cubic-bezier(.2, 1.2, .4, 1) both; }
.ls-ribbon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-100%); animation: bdg-shine 5s ease-in-out 1s infinite; }
@keyframes ls-ribbon { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ls-ribbon, .ls-ribbon::after { animation: none; } }
/* the Exp lost tab's losers of the week and the month */
.ls-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: -4px 0 12px; }
.ls-period { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.ls-period .ls-r-name { font-size: 18px; font-weight: 700; }
.ls-period small { color: var(--muted); }
/* each badge's icon has its own little act, now and then (after the pop-in), so a row of them never moves all at once */
.bdg-disc svg { animation: var(--bdg-act, none) var(--bdg-len, 4s) ease-in-out infinite; animation-delay: calc(var(--bdg-d, 0ms) + .7s); transform-origin: 50% 50%; }
.bdg.k-loser, .bdg.k-losers { --bdg-act: bdg-drip; --bdg-len: 3.2s; }
.bdg.k-weekloser { --bdg-act: bdg-zap; --bdg-len: 3.6s; }
.bdg.k-monthloser { --bdg-act: bdg-glow; --bdg-len: 4.4s; }
.bdg.k-phoenix { --bdg-act: bdg-flame; --bdg-len: 1.6s; }
.bdg.k-reinc { --bdg-act: bdg-spin; --bdg-len: 4.8s; }
.bdg.k-club, .bdg.k-king { --bdg-act: bdg-flip; --bdg-len: 4.2s; }
.bdg.k-streak { --bdg-act: bdg-climb; --bdg-len: 3s; }
.bdg.k-week { --bdg-act: bdg-shake; --bdg-len: 3.4s; }
.bdg.k-back { --bdg-act: bdg-hop; --bdg-len: 3.8s; }
.bdg.k-old { --bdg-act: bdg-wave; --bdg-len: 2.8s; transform-origin: 20% 90%; }
.bdg.k-old .bdg-disc svg { transform-origin: 25% 90%; }
@keyframes bdg-drip { 0%, 60%, 100% { transform: none; } 70% { transform: translateY(-2px) scaleY(1.08); } 80% { transform: translateY(3px) scale(.92, 1.12); opacity: .7; } 90% { transform: translateY(0); opacity: 1; } }
@keyframes bdg-zap { 0%, 78%, 100% { transform: none; filter: none; } 82% { transform: skewX(-12deg) scale(1.15); filter: drop-shadow(0 0 4px #fff); } 86% { transform: skewX(10deg); } 90% { transform: scale(1.1); filter: drop-shadow(0 0 3px #fff); } }
@keyframes bdg-glow { 0%, 100% { transform: rotate(0); filter: none; } 50% { transform: rotate(-14deg) scale(1.08); filter: drop-shadow(0 0 5px rgba(255, 255, 255, .9)); } }
@keyframes bdg-flame { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.08, .94) rotate(-4deg); } 50% { transform: scale(.95, 1.1) rotate(3deg); } 75% { transform: scale(1.05) rotate(-2deg); } }
@keyframes bdg-spin { 0%, 55% { transform: rotate(0); } 85%, 100% { transform: rotate(360deg); } }
@keyframes bdg-flip { 0%, 65% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes bdg-climb { 0%, 55%, 100% { transform: none; } 70% { transform: translate(2px, -3px); } 80% { transform: translate(-1px, 1px); } }
@keyframes bdg-shake { 0%, 70%, 100% { transform: none; } 74% { transform: translateX(-2px) rotate(-8deg); } 78% { transform: translateX(2px) rotate(8deg); } 82% { transform: translateX(-2px) rotate(-6deg); } 86% { transform: translateX(1px) rotate(4deg); } }
@keyframes bdg-hop { 0%, 60%, 100% { transform: none; } 70% { transform: translateY(-4px) scale(1.05, .95); } 78% { transform: translateY(0) scale(1.08, .9); } 85% { transform: translateY(-1px); } }
@keyframes bdg-wave { 0%, 100% { transform: skewY(0) rotate(0); } 25% { transform: skewY(-8deg) rotate(-3deg); } 75% { transform: skewY(6deg) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .bdg-disc svg { animation: none !important; } }
/* a badge as a button (click to see it big) */
.bdg-btn { font: inherit; color: inherit; cursor: zoom-in; text-align: left; transition: box-shadow .15s ease, border-color .15s ease; }
.bdg-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.bdg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the badge big */
.bdg-big-dlg { border: none; border-radius: 18px; padding: 0; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.bdg-big-dlg::backdrop { background: rgba(10, 8, 20, .55); backdrop-filter: blur(2px); animation: bdg-fade .25s ease both; }
.bdg-big-body { display: grid; justify-items: center; gap: 8px; padding: 28px 22px 20px; text-align: center; animation: bdg-rise .35s cubic-bezier(.2, 1.3, .4, 1) both; }
.bdg-big-body h2 { margin: 6px 0 0; font-size: 24px; }
.bdg-big-body p { margin: 0; }
.bdg-big-sub { font-weight: 600; }
.bdg-big-body .btn { margin-top: 8px; }
.bdg.bdg-huge { position: relative; padding: 0; border: none; background: none; animation: bdg-spin-in .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.bdg.bdg-huge .bdg-disc { width: 140px; height: 140px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .3); animation: bdg-float 3s ease-in-out .9s infinite; }
.bdg-spark { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--bdg-b);
  box-shadow: 0 0 6px var(--bdg-b); opacity: 0; animation: bdg-spark 1.1s ease-out .35s both; --a: calc(var(--k) * 45deg); }
@keyframes bdg-spin-in { from { opacity: 0; transform: scale(.2) rotate(-200deg); } to { opacity: 1; transform: none; } }
@keyframes bdg-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(30px) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(110px) scale(.3); } }
@keyframes bdg-rise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bdg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bdg-big-body, .bdg.bdg-huge, .bdg.bdg-huge .bdg-disc, .bdg-spark, .bdg-big-dlg::backdrop { animation: none !important; } .bdg-spark { display: none; } }
/* the badges added with the Badges tab: colours and acts */
.bdg.k-champion { --bdg-a: #9a6b00; --bdg-b: #ffd84a; --bdg-act: bdg-glow; --bdg-len: 3.8s; }
.bdg.k-podium { --bdg-a: #5d6b78; --bdg-b: #d6dde4; --bdg-act: bdg-hop; --bdg-len: 3.4s; }
.bdg.k-level { --bdg-a: #0f5e6e; --bdg-b: #4cc9d9; --bdg-act: bdg-climb; --bdg-len: 3.2s; }
.bdg.k-veteran { --bdg-a: #3d4a5c; --bdg-b: #9fb0c6; --bdg-act: bdg-shake; --bdg-len: 4.6s; }
.bdg.k-rocket { --bdg-a: #b0381c; --bdg-b: #ffa25a; --bdg-act: bdg-launch; --bdg-len: 3s; }
.bdg.k-star { --bdg-a: #8a1f6a; --bdg-b: #f07ad0; --bdg-act: bdg-spin; --bdg-len: 4s; }
.bdg.k-elite { --bdg-a: #8a6a00; --bdg-b: #ffe27a; --bdg-act: bdg-glow; --bdg-len: 3.8s; }
.bdg.k-explorer { --bdg-a: #1f6b3a; --bdg-b: #7fe09a; }
.bdg.k-slayer { --bdg-a: #8f1d1d; --bdg-b: #ff7b6b; --bdg-act: bdg-shake; --bdg-len: 4.2s; }
.bdg.k-survivor { --bdg-a: #2a4a6e; --bdg-b: #8fc1f0; }
.bdg.k-elder { --bdg-a: #5b4a35; --bdg-b: #d9bd8f; }
.bdg.k-prodigy { --bdg-a: #7a2a8f; --bdg-b: #e39cf5; --bdg-act: bdg-spin; --bdg-len: 4.4s; }
.bdg.k-racelead { --bdg-a: #0f5e6e; --bdg-b: #6fe0ee; }
.bdg.k-hot { --bdg-a: #b0381c; --bdg-b: #ff9a4a; --bdg-act: bdg-glow; --bdg-len: 2.6s; }
.bdg.k-fresh { --bdg-a: #1f6b8a; --bdg-b: #7fd6f0; --bdg-act: bdg-spin; --bdg-len: 5s; }
.bdg.k-secondary { --bdg-a: #5b3d8f; --bdg-b: #b99cf0; --bdg-act: bdg-hop; --bdg-len: 3.6s; }
.bdg.k-lazarus { --bdg-a: #24624a; --bdg-b: #8fe0b8; --bdg-act: bdg-spin; --bdg-len: 5.2s; }
@keyframes bdg-launch { 0%, 55%, 100% { transform: none; opacity: 1; } 70% { transform: translateY(-9px) scale(.9); opacity: 0; } 71% { transform: translateY(9px); opacity: 0; } 85% { transform: none; opacity: 1; } }
/* the Badges tab */
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bg-card { display: grid; align-content: start; gap: 8px; }
.bg-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bg-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.bg-what { margin: 0; font-size: 13.5px; color: var(--muted); }
.bg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bg-list li { display: grid; grid-template-columns: 2.6em 1fr auto; gap: 6px; align-items: baseline; font-size: 13.5px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.bg-list li:last-child { border-bottom: none; }
.bg-list .bg-rank { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bg-list .bg-v { color: var(--muted); font-size: 12.5px; text-align: right; }
.bg-list li.me { background: var(--accent-soft); }
.bg-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.bg-top li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bg-mini { display: inline-flex; gap: 2px; }
.bg-mini .bdg-disc { width: 20px; height: 20px; }
.bg-mini .bdg { padding: 0; border: none; background: none; }
/* a badge's level: a ring of its metal round the medal (diamond's shimmers), and the level's name beside its title */
.bdg { --tier: transparent; }
.bdg.t-bronze { --tier: #b06a32; --tier-2: #e3a26b; }
.bdg.t-silver { --tier: #8d99a6; --tier-2: #eef2f6; }
.bdg.t-gold { --tier: #c99a12; --tier-2: #ffe27a; }
.bdg.t-diamond { --tier: #49b6e6; --tier-2: #e9fbff; }
.bdg[class*=' t-'] .bdg-disc { box-shadow: 0 0 0 2px var(--tier-2), 0 0 0 4px var(--tier), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 2px 5px rgba(0, 0, 0, .3); }
.bdg.big[class*=' t-'] .bdg-disc { box-shadow: 0 0 0 3px var(--tier-2), 0 0 0 6px var(--tier), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .3); }
.bdg.bdg-huge[class*=' t-'] .bdg-disc { box-shadow: 0 0 0 5px var(--tier-2), 0 0 0 11px var(--tier), inset 0 -6px 0 rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .3); }
.bdg.t-diamond .bdg-disc { animation: bdg-diamond 2.4s ease-in-out infinite; }
.bdg.big.t-diamond .bdg-disc, .bdg.k-loser.t-diamond .bdg-disc { animation: bdg-float 3s ease-in-out infinite, bdg-diamond 2.4s ease-in-out infinite; }
@keyframes bdg-diamond {
  0%, 100% { box-shadow: 0 0 0 2px #e9fbff, 0 0 0 4px #49b6e6, 0 0 6px 2px rgba(73, 182, 230, .45), inset 0 -2px 0 rgba(0, 0, 0, .25); }
  33% { box-shadow: 0 0 0 2px #fff4fe, 0 0 0 4px #c48be8, 0 0 10px 3px rgba(196, 139, 232, .55), inset 0 -2px 0 rgba(0, 0, 0, .25); }
  66% { box-shadow: 0 0 0 2px #f0fff6, 0 0 0 4px #5fe0b0, 0 0 8px 2px rgba(95, 224, 176, .5), inset 0 -2px 0 rgba(0, 0, 0, .25); }
}
.bdg-tier { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px;
  vertical-align: 1px; color: #fff; background: linear-gradient(135deg, var(--tier), var(--tier-2)); text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.bdg-tier-big { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35); background: linear-gradient(135deg, var(--tier), var(--tier-2), var(--tier)); background-size: 200% 100%; animation: bdg-sheen 3s linear infinite; }
.bdg-tier-big.t-bronze { --tier: #b06a32; --tier-2: #e3a26b; }
.bdg-tier-big.t-silver { --tier: #8d99a6; --tier-2: #d9e0e7; }
.bdg-tier-big.t-gold { --tier: #c99a12; --tier-2: #ffe27a; }
.bdg-tier-big.t-diamond { --tier: #49b6e6; --tier-2: #c48be8; }
@keyframes bdg-sheen { from { background-position: 0 0; } to { background-position: 200% 0; } }
.bg-tiers { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.bg-tiers span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.bg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: linear-gradient(135deg, var(--tier), var(--tier-2)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); flex: none; }
.bg-dot.t-bronze { --tier: #b06a32; --tier-2: #e3a26b; }
.bg-dot.t-silver { --tier: #8d99a6; --tier-2: #eef2f6; }
.bg-dot.t-gold { --tier: #c99a12; --tier-2: #ffe27a; }
.bg-dot.t-diamond { --tier: #49b6e6; --tier-2: #c48be8; }
.bg-list .bg-rank { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .bdg.t-diamond .bdg-disc, .bdg-tier-big { animation: none !important; } }
/* the Badges tab's most decorated: a podium for the top three, then a table */
.bg-dec { display: grid; gap: 14px; }
.bg-podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.bg-pod { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 10px 0; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-bottom: none;
  animation: bdg-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--bdg-d, 0ms); }
.bg-pod-place { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 18px; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .25); }
.bg-pod.p1 .bg-pod-place { width: 46px; height: 46px; font-size: 22px; background: radial-gradient(circle at 35% 30%, #ffe27a, #c99a12); }
.bg-pod.p2 .bg-pod-place { background: radial-gradient(circle at 35% 30%, #f4f7fa, #8d99a6); }
.bg-pod.p3 .bg-pod-place { background: radial-gradient(circle at 35% 30%, #f0b98a, #b06a32); }
.bg-pod-name .rt-who { font-size: 17px; font-weight: 700; }
.bg-pod.p1 .bg-pod-name .rt-who { font-size: 20px; }
.bg-pod-pts { font-size: 13px; color: var(--muted); }
.bg-pod-pts b { color: var(--text); font-size: 15px; }
.bg-pod .bg-mini { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.bg-pod-step { display: block; align-self: stretch; justify-self: stretch; margin: 6px -10px 0; border-radius: 6px 6px 0 0; height: 18px; background: var(--border); }
.bg-pod.p1 .bg-pod-step { height: 46px; background: linear-gradient(180deg, #ffe27a, #c99a12); }
.bg-pod.p2 .bg-pod-step { height: 30px; background: linear-gradient(180deg, #eef2f6, #8d99a6); }
.bg-pod.p3 .bg-pod-step { height: 18px; background: linear-gradient(180deg, #e3a26b, #b06a32); }
.bg-pod.me { outline: 2px solid var(--focus); outline-offset: 2px; }
.bg-counts { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.bg-chip { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35); background: linear-gradient(135deg, var(--tier), var(--tier-2)); }
.bg-chip.t-bronze { --tier: #b06a32; --tier-2: #e3a26b; }
.bg-chip.t-silver { --tier: #7d8996; --tier-2: #c9d2db; }
.bg-chip.t-gold { --tier: #c99a12; --tier-2: #f2c94c; }
.bg-chip.t-diamond { --tier: #3aa3d6; --tier-2: #b07ee0; }
.bg-dec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bg-dec-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--border-strong); }
.bg-dec-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bg-dec-table tr.me td { background: var(--accent-soft); }
.bg-dec-rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 2em; }
.bg-nobody { font-style: italic; }
@media (max-width: 640px) {
  .bg-podium { grid-template-columns: 1fr; }
  .bg-pod { border-radius: var(--radius); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
  .bg-pod-step { display: none; }
  .bg-podium .bg-pod.p1 { order: -1; }
  .bg-dec-table th:nth-child(5), .bg-dec-table td:nth-child(5) { display: none; }
}
/* the day / week / month awards */
.bdg.k-day { --bdg-a: #b8730a; --bdg-b: #ffd166; --bdg-act: bdg-spin; --bdg-len: 6s; }
.bdg.k-month { --bdg-a: #3b2a7a; --bdg-b: #9d8af0; --bdg-act: bdg-glow; --bdg-len: 4.6s; }
.bg-bars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.bg-bars span { display: inline-flex; align-items: center; gap: 4px; }
/* the News tab (ui/news.js) */
.nw-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; }
.nw-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.nw-list > li:last-child { border-bottom: none; }
.nw-post { display: grid; gap: 1px; flex: 1 1 320px; min-width: 0; }
.nw-post a { font-weight: 600; }
.nw-kind { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); vertical-align: 1px; }
.nw-kind.k-holiday { background: rgba(201, 154, 18, .15); color: var(--text); }
.nw-kind.k-reinc { background: rgba(79, 209, 161, .15); color: var(--text); }
.nw-chg { font-size: 13px; color: var(--muted); }
.nw-chg b { color: var(--text); font-size: 14px; }
.nw-spark { display: block; flex: none; }
.nw-spark rect { fill: var(--accent); }
.nw-spark rect.before { opacity: .3; }
.nw-spark rect.at { fill: var(--gold); }
.nw-swings > li { display: grid; grid-template-columns: minmax(220px, auto) 1fr; align-items: start; }
.nw-near { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.nw-none { margin: 0; font-size: 13px; }
@media (max-width: 640px) { .nw-swings > li { grid-template-columns: 1fr; } }
.nw-guilds { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.3fr); gap: 18px; align-items: start; }
.nw-guilds .bg-dec-table td, .nw-guilds .bg-dec-table th { padding: 4px 8px; }
@media (max-width: 860px) { .nw-guilds { grid-template-columns: 1fr; } }
.bg-dec-table th.numc { text-align: right; }
/* the News tab's layout: verdict cards, section links, columns */
.nw-findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.nw-finding { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); border-left-width: 4px; }
.nw-finding.t-clear { border-left-color: var(--ok); }
.nw-finding.t-likely { border-left-color: var(--gold); }
.nw-finding.t-weak { border-left-color: var(--warn); }
.nw-finding.t-none { border-left-color: var(--border-strong); }
.nw-verdict { justify-self: start; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.nw-finding.t-clear .nw-verdict { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--text); }
.nw-finding.t-likely .nw-verdict { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--text); }
.nw-f-title { font-size: 15px; }
.nw-f-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.nw-f-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.nw-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.nw-jump a { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.nw-jump a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.nwt .card { scroll-margin-top: 12px; }
.nw-post small { font-size: 12px; }
.nw-post .nw-kind { justify-self: start; margin-top: 2px; }
.nw-rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.nw-up { color: var(--ok); font-weight: 700; }
.nw-down { color: var(--err); font-weight: 700; }
.nw-chg.nw-down b, .nw-chg.nw-up b { color: inherit; }
.nw-table td, .nw-table th { white-space: nowrap; }
.nw-table td:last-child { white-space: normal; }
.nw-guilds .btn { margin-top: 8px; }
@media (max-width: 640px) { .nw-f-value { font-size: 22px; } }
/* the News tab's linked posts as tiles */
.nw-group + .nw-group { margin-top: 18px; }
.nw-group-h { font-size: 14px; margin: 6px 0 10px; font-weight: 600; }
.nw-group-h .nw-kind { font-size: 13px; padding: 2px 10px; font-weight: 700; }
.nw-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nw-tile { display: grid; gap: 6px; align-content: start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color .15s ease, transform .15s ease; }
.nw-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.nw-tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nw-tile-when { font-weight: 700; font-size: 13px; color: var(--muted); }
.nw-tile-chg { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ok); }
.nw-tile-title { font-weight: 600; line-height: 1.3; }
.nw-tile small { font-size: 11.5px; }
.nw-spark.fill { width: 100%; }
.nw-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 12px 0 0; }
.nw-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.nw-key.before { opacity: .3; }
.nw-key.at { background: var(--gold); }
/* the biggest swings as tiles */
.nw-swing-tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 12px; }
.nw-swing-tiles .nw-tile-when { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.nw-swing-tiles .nw-near { gap: 6px; }
.nw-swing-tiles .nw-near li { display: grid; gap: 1px; }
.nw-swing-tiles .nw-near .nw-kind { justify-self: start; }
.nw-tile-chg.s-retire { color: var(--warn); }
.nw-tile-chg.s-back { color: var(--accent); }
.nw-table tfoot th, .nw-table tfoot td { border-top: 2px solid var(--border-strong); border-bottom: none; font-weight: 600; background: var(--surface-2); }
.nw-table tfoot th { text-align: left; }
.nw-finding.t-down { border-left-color: var(--err); }
.nw-finding.t-down .nw-verdict { background: color-mix(in srgb, var(--err) 18%, transparent); color: var(--text); }
/* the News tab's grids may shrink below their columns' minimum on narrow screens (a table scrolls in its own box) */
@media (max-width: 860px) { .nw-guilds { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .nw-findings { grid-template-columns: minmax(0, 1fr); } .nw-tiles, .nw-swing-tiles { grid-template-columns: minmax(0, 1fr); } }
/* the time lapse's other headlines: a reinc, a new highest level, a newcomer, a tumble */
.lp-banner.reinc { background: var(--surface); color: var(--text); border: 2px solid #4fd1a1; }
.lp-banner.levelup { background: var(--surface); color: var(--text); border: 2px solid #6aa8f0; }
.lp-banner.newcomer { background: var(--accent-soft); color: var(--text); border: 2px solid var(--accent); }
.lp-banner.tumble { background: var(--surface); color: var(--text); border: 2px solid var(--err); font-size: 13px; }
/* the Dashboard cards' art: bigger, and on hover it zooms out over the card to twice its size (the `scale` property,
   apart from the card's tilt) */
.db-card-head .mascot { position: relative; z-index: 1; transform-origin: 18% 18%; transition: transform .25s ease, scale .3s cubic-bezier(.2, 1.3, .4, 1), box-shadow .3s ease; }
.db-card-head .mascot:hover { scale: 2; z-index: 5; box-shadow: 0 14px 32px rgba(0, 0, 0, .35); }
.db-card { overflow: visible; }
@media (prefers-reduced-motion: reduce) { .db-card-head .mascot:hover { scale: 1.6; } }
@media (hover: none) { .db-card-head .mascot:hover { scale: 1; box-shadow: none; } }
@media (max-width: 600px) { .db-card-head .mascot { width: 88px; height: 88px; } }
/* the profile's milestones as a timeline: a year a row of chips, the long breaks as dashed bands between */
.pf-tl { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 0; }
.pf-tl > li { display: grid; grid-template-columns: 4.2em 1fr; gap: 0 12px; align-items: start; position: relative; padding: 6px 0; }
.pf-tl > li::before { content: ''; position: absolute; left: calc(4.2em + 5px); top: 0; bottom: 0; width: 2px; background: var(--border); }
.pf-tl-y { font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 4px; text-align: right; }
.pf-chips { list-style: none; margin: 0; padding: 0 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.pf-tl-year .pf-chips::before { content: ''; position: absolute; left: -2px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.pf-chip { display: inline-flex !important; grid-template-columns: none !important; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; line-height: 1.25; }
.pf-chip .pf-md { font-size: 11.5px; white-space: nowrap; }
.pf-tl-gap .pf-gap-band { margin-left: 14px; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 12px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--border) 45%, transparent) 8px 9px); font-size: 13px; }
.pf-tl-gap::before { background: repeating-linear-gradient(180deg, var(--border-strong) 0 4px, transparent 4px 8px) !important; }
@media (max-width: 600px) { .pf-tl > li { grid-template-columns: 3em 1fr; } .pf-tl > li::before { left: calc(3em + 5px); } }
/* the Feats tab */
.ft-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 6px; }
.ft-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-kind { display: inline-flex !important; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.ft-kind small { color: var(--muted); }
.ft-kind[aria-pressed='false'] { opacity: .45; }
.ft-kind[aria-pressed='true'] { background: var(--surface-2); border-color: var(--border-strong); }
.ft-search input { width: 14em; }
.ft-count { margin: 4px 0 8px; font-size: 13px; }
.ft-who { font-weight: 700; padding: 0; }
/* the latest week's standouts: a card a kind, its mascot in the awards' medallion */
.ft-spot { margin: 6px 0 16px; padding: 12px 14px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 72%); }
.ft-spot-h { font-family: var(--font-brand); font-size: 18px; font-weight: 600; margin: 0 0 10px; }
.ft-spot-h .muted { font-family: var(--font); font-size: 13px; font-weight: 400; }
.ft-fast { margin: 18px 0 4px; }
.ft-fast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 10px; }
.ft-fast-col { padding: 10px 12px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: ft-rise .45s ease-out both; }
.ft-fast-col > small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ft-fast-mark { font-family: var(--font-brand); font-size: 19px; font-weight: 600; line-height: 1.2; display: block; margin: 2px 0 6px; }
.ft-fast-col ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: ftf; }
.ft-fast-col li { counter-increment: ftf; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 8px; }
.ft-fast-col li:first-child .ft-fast-wk { color: var(--gold-ink); }
.ft-fast-col .ft-fast-who { all: unset; cursor: pointer; font-size: 14.5px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-fast-col .ft-fast-who::before { content: counter(ftf) "."; display: inline-block; min-width: 1.4em; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ft-fast-col .ft-fast-who:hover { text-decoration: underline; }
.ft-fast-col .ft-fast-who:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ft-fast-col li small { grid-column: 1 / -1; margin: -1px 0 0 1.4em; font-size: 11.5px; }
.ft-fast-wk { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-spot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ft-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); animation: ft-rise .45s ease-out both; animation-delay: var(--ft-d, 0ms); }
@keyframes ft-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ft-card .mascot { flex: none; width: 64px; height: 64px; border-radius: 50%; padding: 3px; border: 3px solid #1d1640;
  background: radial-gradient(circle at 50% 40%, #fffaf0, #f5e6bf); transition: rotate .25s ease; }
.ft-card:hover .mascot { rotate: -6deg; }
.ft-card-body { display: grid; gap: 1px; min-width: 0; }
.ft-card-kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ft-card-name { all: unset; cursor: pointer; font-size: 17px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-card-name:hover { text-decoration: underline; }
.ft-card-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ft-card-big { font-size: 15px; font-variant-numeric: tabular-nums; }
.ft-card.k-year .ft-card-big, .ft-card.k-exp .ft-card-big, .ft-card.k-rebirth .ft-card-big { color: var(--gold-ink); }
.ft-card small { font-size: 12px; }
/* month by month: the profile's milestone timeline, the month's name staying in view while its chips scroll */
.ft-tl > li { padding: 8px 0; }
.ft-m { display: grid; justify-items: end; line-height: 1.15; position: sticky; top: calc(var(--top-h, 0px) + 8px); }
.ft-m b { font-family: var(--font-brand); font-size: 16px; font-weight: 600; }
.ft-m small { font-size: 11.5px; color: var(--muted); }
.ft-m .ft-m-n { margin-top: 2px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.ft-tl .pf-chips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.ft-tl .ft-chip { display: flex !important; width: 100%; border-radius: 12px; padding: 4px 12px 4px 4px; }
.ft-chip .ft-date { flex: none; width: 3.6em; text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.ft-chip { padding-right: 12px; max-width: 100%; }
.ft-chip > span:not(.pf-mic):not(.pf-md) { min-width: 0; overflow-wrap: anywhere; }      /* a long line wraps inside its chip on a phone */
.ft-chip .ft-pic { width: 20px; height: 20px; border-radius: 50%; flex: none; margin-left: -2px; }
.ft-chip .ft-who { font-weight: 700; }
.ft-chip.ft-big { border-color: var(--gold); background: linear-gradient(90deg, rgba(233, 177, 59, .16), var(--surface-2) 70%); box-shadow: 0 0 0 1px rgba(233, 177, 59, .35); }
@media (prefers-reduced-motion: reduce) { .ft-card { animation: none; } .ft-card .mascot { transition: none; } }
.pf-mi.k-year .pf-mic { background: var(--accent-soft); color: var(--gold); }
/* the awards (ui/dashboard.js Awards): a card each, its art zooming on hover */
.aw-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.aw-card { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 65%); position: relative; }
.aw-card .mascot { flex: none; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fffaf0, #f5e6bf); border: 3px solid #1d1640;
  box-shadow: 0 0 0 3px var(--gold), var(--shadow); padding: 4px; object-fit: contain; position: relative; z-index: 1; transform-origin: 18% 18%;
  transition: scale .3s cubic-bezier(.2, 1.3, .4, 1), box-shadow .3s ease, rotate .25s ease; }
.aw-card:hover .mascot { rotate: -5deg; }
.aw-card .mascot:hover { scale: 2; z-index: 5; box-shadow: 0 0 0 3px var(--gold), 0 14px 32px rgba(0, 0, 0, .35); }
.aw-body { display: grid; gap: 2px; min-width: 0; }
.aw-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.aw-name { all: unset; cursor: pointer; font-size: 22px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.aw-name:hover { text-decoration: underline; }
button.aw-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.aw-value b { font-size: 16px; }
.aw-value small { font-size: 12px; }
.aw-line { font-size: 13px; font-style: italic; color: var(--muted); }
.aw-more { justify-self: start; padding: 0; margin-top: 2px; }
@media (max-width: 600px) { .aw-grid { grid-template-columns: minmax(0, 1fr); } .aw-card .mascot { width: 88px; height: 88px; } }
@media (hover: none) { .aw-card .mascot:hover { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .aw-card .mascot { transition: none; } }
/* Shared home-page icon and brand-home control; Chronicle layout is in upgrade.css. */
.hm-ico { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); transition: rotate .2s ease, scale .2s ease; }
.brand-home { all: unset; cursor: pointer; display: inline-grid; border-radius: 50%; }
.brand-home:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .hm-ico { transition: none; } }
/* Recorded weekly activity (ui/liveweek.js). */
.lw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 420px); gap: 10px 20px; align-items: center; margin: 6px 0 12px; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 60%); }
.lw-num { display: grid; gap: 2px; min-width: 0; }
.lw-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lw-value { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; }
.lw-num small { font-size: 12.5px; }
.lw-chart { width: 100%; height: auto; display: block; overflow: visible; }
.lw-grid { stroke: var(--border); stroke-width: 1; }
.lw-day { font-size: 9px; fill: var(--muted); text-anchor: middle; }
.lw-day.now { fill: var(--text); font-weight: 700; }
.lw-daymade { font-size: 8px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.lw-today { fill: color-mix(in srgb, var(--gold) 9%, transparent); }
.lw-last { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.lw-lastl { font-size: 8.5px; fill: var(--muted); text-anchor: end; }
.lw-vs { font-size: 12.5px; }
.lw-delta { font-variant-numeric: tabular-nums; }
.lw-delta.up { color: var(--ok, #2a8a4a); }
.lw-delta.down { color: var(--err); }
.lw-area { fill: color-mix(in srgb, var(--gold) 25%, transparent); }
.lw-line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.lw-ahead { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 4 4; opacity: .7; }
.lw-dot { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
@media (max-width: 700px) { .lw { grid-template-columns: minmax(0, 1fr); } }
/* exp inflation (ui/dashboard.js Inflation) */
.inf { margin: 0 0 12px; padding: 10px 16px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.inf-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.inf-head small { font-size: 12.5px; }
.inf-row { display: grid; grid-template-columns: repeat(3, minmax(110px, 160px)) minmax(200px, 1fr); gap: 10px 16px; align-items: stretch; }
.inf-tile { display: grid; gap: 1px; align-content: space-between; }
.inf-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.inf-tile b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--err); line-height: 1.1; }
.inf-tile small { font-size: 12px; }
.inf-chart { display: flex; align-items: stretch; gap: 3px; min-height: 58px; }
.inf-col { flex: 1 1 0; display: grid; grid-template-rows: 1fr auto; height: 100%; min-width: 0; text-align: center; }
.inf-col i { align-self: end; display: block; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--err) 45%, var(--surface-3)); }
.inf-col.now i { background: var(--gold); }
.inf-col small { font-size: 9.5px; line-height: 12px; height: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) { .inf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .inf-chart { grid-column: 1 / -1; height: 70px; } }
/* the home page's player search */
.hm-find { display: flex; gap: 6px; align-items: center; flex: 0 1 380px; }
.hm-find input { flex: 1 1 auto; min-width: 0; font-size: 15px; padding: 8px 12px; }
/* comebacks in the Retired tab's time lapse (ui/retired.js PlayersLapse, MonthsChart) */
.rt-race-track i.rt-back, .rs-sw.rt-back { background: var(--ok); }
.rt-backs { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.rt-backs.later { opacity: .25; }
/* the comebacks so far in Home's trend (ui/dashboard.js Trend) */
.db-l-back { fill: none; stroke: var(--ok); stroke-width: 2; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.db-key.back { background: var(--ok); }

/* ---- the battle scroll of the Battle replay (ui/battlescroll.js): a real fight played back with a MUD client's highlights ---- */
/* the terminal stays dark in both themes, like a client's window; the colours are the old ANSI ones, a little softened */
.bs-card { padding: 18px 20px 16px; --bs-bg: #0b0f14; --bs-fg: #c9d1d9; --bs-dim: #6e7b8b; --bs-red: #ff5c5c; --bs-green: #6fd08c; --bs-yellow: #f2d06b;
  --bs-blue: #79a8ff; --bs-cyan: #5fd7e6; --bs-magenta: #ff79c6; --bs-gold: #f1c35a; --bs-orange: #ff9e57; }
.bs-wait { min-height: 520px; }
.bs-tall .bs-scroll { height: max(360px, calc(100vh - 360px)); }
.bs-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.bs-h { margin: 0; font-family: var(--font-brand); font-size: 24px; }
.bs-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.bs-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-pick { font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.bs-pick:hover { border-color: var(--accent); }
.bs-pick.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bs-board { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: end; margin-bottom: 10px; }
.bs-board.bs-duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }      /* the foe, you, the tally */
.bs-none { color: var(--muted); font-weight: 600; }
.bs-foe-name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; font-size: 14px; margin-bottom: 5px; }
.bs-stage { font-size: 13px; font-weight: 600; }
.bs-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bs-bar i { display: block; height: 100%; border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1), background-color .6s; }
.bs-bar .bs-t-hi { background: #3fb465; } .bs-bar .bs-t-mid { background: #e9a23b; } .bs-bar .bs-t-lo { background: #e5484d; } .bs-bar .bs-t-dead { background: var(--border-strong); }
.bs-stage.bs-t-hi { color: var(--ok, #2f8f4e); } .bs-stage.bs-t-mid { color: var(--gold-ink); } .bs-stage.bs-t-lo, .bs-stage.bs-t-dead { color: var(--err); }
.bs-tally { display: flex; gap: 14px; margin: 0; }
.bs-tally div { text-align: center; }
.bs-tally dt { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bs-tally dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-c-crit { color: #c2318a; } .bs-c-spell { color: #1f7f9a; } .bs-c-death { color: var(--err); } .bs-c-exp { color: var(--gold-ink); }
.bs-tally dd { animation: bs-pop .5s ease-out; }
:root[data-theme="dark"] .bs-c-crit { color: var(--bs-magenta); } :root[data-theme="dark"] .bs-c-spell { color: var(--bs-cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bs-c-crit { color: #ff79c6; } :root:not([data-theme="light"]) .bs-c-spell { color: #5fd7e6; } }

.bs-term { position: relative; border-radius: var(--radius); background: var(--bs-bg); border: 1px solid #1d2632; box-shadow: inset 0 0 40px rgba(0, 0, 0, .6); overflow: hidden; }
.bs-term::after { content: ''; position: absolute; inset: 0; pointer-events: none;      /* faint scanlines and a glow at the edges */
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .35)); }
.bs-term.jolt-a { animation: bs-jolt-a .32s ease-out; } .bs-term.jolt-b { animation: bs-jolt-b .32s ease-out; }
@keyframes bs-jolt-a { 20% { transform: translate(-3px, 1px); } 45% { transform: translate(3px, -1px); } 70% { transform: translate(-1px, 0); } }
@keyframes bs-jolt-b { 20% { transform: translate(3px, -1px); } 45% { transform: translate(-3px, 1px); } 70% { transform: translate(1px, 0); } }
.bs-scroll { height: 360px; overflow-y: auto; padding: 12px 14px 16px; font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 13px; line-height: 1.5;
  color: var(--bs-fg); scrollbar-color: #2b3644 transparent; overscroll-behavior: contain; }
.bs-scroll:focus-visible { outline: 2px solid var(--bs-gold); outline-offset: -2px; }
.bs-l { white-space: pre-wrap; overflow-wrap: anywhere; animation: bs-in .25s ease-out; padding: 0 4px; margin: 0 -4px; border-radius: 3px; }
@keyframes bs-in { from { opacity: 0; transform: translateY(4px); } }
.bs-round { color: #3a4656; white-space: nowrap; overflow: hidden; font-size: 11px; line-height: 1.3; }
.bs-miss { color: var(--bs-dim); }
.bs-hit { color: var(--bs-fg); }
.bs-hurt { color: #ffb0b0; }
.bs-shield { color: #7f93b5; }
.bs-cast { color: var(--bs-blue); } .bs-cast .bs-q { color: #b9a4ff; font-style: italic; }
.bs-spell { color: var(--bs-cyan); font-weight: 600; }
.bs-crit { color: #fff; font-weight: 700; background: linear-gradient(90deg, rgba(255, 121, 198, .28), transparent 85%); animation: bs-in .25s ease-out, bs-flash 1.2s ease-out; }
.bs-crit::before { content: '» '; color: var(--bs-magenta); }
@keyframes bs-flash { 0%, 15% { background-color: rgba(255, 121, 198, .55); } }
.bs-danger { color: var(--bs-orange); font-weight: 600; }
.bs-say { color: var(--bs-yellow); } .bs-say .bs-q { color: #fff3b8; }
.bs-hp { color: var(--bs-green); font-weight: 600; }
.bs-hp.bs-boss { padding-left: 8px; border-left: 3px solid var(--bs-green); background: rgba(111, 208, 140, .08); }
.bs-info, .bs-exits { color: #8fa0b3; }
.bs-mob { color: #ff8f8f; font-weight: 700; }
.bs-room { color: var(--bs-green); opacity: .85; margin-top: 6px; }
.bs-place { color: #9df0b5; font-weight: 700; margin-top: 6px; }
.bs-gore { color: var(--bs-red); }
.bs-death { color: var(--bs-red); font-weight: 800; letter-spacing: .02em; }
.bs-death.bs-boss { font-size: 1.25em; padding: 4px 8px; margin: 6px -4px; color: #fff; background: linear-gradient(90deg, rgba(229, 72, 77, .55), rgba(229, 72, 77, .08));
  text-shadow: 0 0 12px rgba(255, 92, 92, .8); animation: bs-in .25s ease-out, bs-kill 1.6s ease-out; }
@keyframes bs-kill { 0% { box-shadow: 0 0 0 0 rgba(255, 92, 92, .9); } 100% { box-shadow: 0 0 0 14px rgba(255, 92, 92, 0); } }
.bs-kill { color: var(--bs-gold); font-weight: 700; }
.bs-kill::before { content: '☠ '; }
.bs-exp { color: var(--bs-gold); }
.bs-loot { color: var(--bs-gold); font-weight: 600; }
.bs-loot::before { content: '◆ '; color: var(--bs-gold); }
.bs-eq { color: #1b1300; background: linear-gradient(90deg, #f1c35a, #ffe7a3, #f1c35a); background-size: 200% 100%; padding: 0 3px; border-radius: 3px; animation: bs-shine 2.4s linear infinite; }
@keyframes bs-shine { to { background-position: -200% 0; } }
.bs-glow { color: var(--bs-red); text-shadow: 0 0 8px rgba(255, 92, 92, .9); }
.bs-note { margin: 8px 0; color: #8fa0b3; font-family: var(--font); font-style: italic; font-size: 12.5px; }
.bs-note-t::before { content: '— '; } .bs-note-t::after { content: ' —'; }
.bs-cursor span { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--bs-fg); animation: bs-blink 1s steps(1) infinite; }
@keyframes bs-blink { 50% { opacity: 0; } }
.bs-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.bs-src { flex: 1 1 280px; margin: 0; font-size: 12.5px; color: var(--muted); text-align: right; }
.bs-gear { color: #b9c4d2; } .bs-gear .bs-eq { animation: none; }
.bs-storm { color: #fff; font-weight: 700; background: linear-gradient(90deg, rgba(95, 215, 230, .25), transparent 85%); animation: bs-in .25s ease-out, bs-flash-c 1.2s ease-out; }
.bs-storm::before { content: '» '; color: var(--bs-cyan); }
@keyframes bs-flash-c { 0%, 15% { background-color: rgba(95, 215, 230, .5); } }
.bs-crit.bs-foe-hit { background: linear-gradient(90deg, rgba(255, 92, 92, .3), transparent 85%); }
.bs-crit.bs-foe-hit::before { color: var(--bs-red); }
/* you: your hp bar, the hits on it as numbers that float off, sp and ep under it, and whether you are still on your mount */
.bs-me .bs-bar { position: relative; overflow: visible; }
.bs-num { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.bs-ride { font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); animation: bs-pop .5s ease-out; }
.bs-ride.off { background: #e5484d; color: #fff; font-weight: 700; }
.bs-dmg { position: absolute; right: 4px; top: -6px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none;
  animation: bs-float 1.4s ease-out forwards; text-shadow: 0 1px 0 var(--surface); }
.bs-dmg.neg { color: var(--err); } .bs-dmg.pos { color: var(--ok, #2f8f4e); }
@keyframes bs-float { 0% { opacity: 0; transform: translateY(6px) scale(.8); } 15% { opacity: 1; transform: translateY(-4px) scale(1.15); } 100% { opacity: 0; transform: translateY(-22px); } }
.bs-gauges { display: flex; gap: 10px; margin-top: 5px; }
.bs-g { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bs-g i { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bs-g b { display: block; height: 100%; border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bs-g-sp b { background: #5b8def; } .bs-g-ep b { background: #e9a23b; }
/* low on hp: the screen's edges go red, and beat */
.bs-term.bs-low { border-color: #7a1f24; }
.bs-term.bs-low::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 60px rgba(229, 72, 77, .55); animation: bs-beat 1.1s ease-in-out infinite; }
@keyframes bs-beat { 50% { box-shadow: inset 0 0 90px rgba(229, 72, 77, .8); } }

/* the lines the client picks out of a modern log */
.bs-round.bs-rn { display: flex; align-items: center; gap: 8px; color: #4b5a6c; letter-spacing: .08em; text-transform: uppercase; margin: 4px 0 2px; }
.bs-round.bs-rn::before, .bs-round.bs-rn::after { content: ''; flex: 1; border-top: 1px dashed #263142; }
.bs-blow { color: #fff; font-weight: 800; letter-spacing: .03em; background: linear-gradient(90deg, rgba(241, 195, 90, .45), transparent 85%); animation: bs-in .25s ease-out, bs-flash-g 1.2s ease-out; }
.bs-blow::before { content: '\2726  '; color: var(--bs-gold); }
@keyframes bs-flash-g { 0%, 15% { background-color: rgba(241, 195, 90, .55); } }
.bs-heal { color: #9df0b5; }
.bs-mount { color: #7fd3c4; }
.bs-wield { color: #b9c4d2; } .bs-wield .bs-eq { animation: none; }
.bs-chant { color: #b9a4ff; }
.bs-chant-bar { color: #d7c9ff; letter-spacing: .12em; text-shadow: 0 0 8px rgba(185, 164, 255, .9); }
.bs-say.bs-boss { font-size: 1.08em; padding: 2px 8px; margin: 4px -4px; border-left: 3px solid var(--bs-yellow); background: rgba(242, 208, 107, .08); }
.bs-danger.bs-dire { color: #fff; font-weight: 800; background: linear-gradient(90deg, rgba(229, 72, 77, .6), transparent 90%); animation: bs-in .25s ease-out, bs-kill 1.6s ease-out; }
.bs-fast { animation-duration: .12s; }
.bs-place.bs-fast { margin-top: 2px; }
.bs-l.bs-still { animation: none; }
.bs-jumped { margin-top: 10px; }
.bs-jumped::before { content: '\22EF'; display: block; margin-bottom: 6px; text-align: center; color: #4b5a6c; letter-spacing: .4em; }
.bs-chap-t { display: block; margin-top: 6px; font-family: var(--font-brand); font-style: normal; font-size: 16px; color: var(--bs-gold); letter-spacing: .02em; }
.bs-chap-t + .bs-note-t::before, .bs-chap-t + .bs-note-t::after { content: none; }
/* the map the game draws outside */
.bs-mapbox { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: rgba(255, 255, 255, .03); border: 1px solid #1d2632; overflow-x: auto; white-space: normal; }
.bs-mapbox pre { margin: 0; font: inherit; line-height: 1.25; white-space: pre; }
.bs-map-r { display: block; }
.bs-mapbox .m-fr { color: #3a4656; } .bs-mapbox .m-f { color: #3fb465; } .bs-mapbox .m-s { color: #dfe9f5; }
.bs-mapbox .m-me { color: var(--bs-gold); font-weight: 800; text-shadow: 0 0 8px rgba(241, 195, 90, .9); }
.bs-mapbox .m-t { color: #8fa0b3; }
.bs-item { margin-top: 4px; color: #b9c4d2; white-space: pre-wrap; }

/* under the scroll: the timeline (drag it; the dots are the highlights, the ticks the chapters) and the chapters */
.bs-tl { margin-top: 10px; }
.bs-tl-bar { position: relative; height: 22px; border-radius: 6px; }
.bs-tl-bar:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bs-tl-track { position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 999px; background: var(--surface-3); }
.bs-tl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #8b83f0); transition: width .25s linear; }
.bs-tl-ch { position: absolute; top: -5px; width: 2px; height: 16px; margin-left: -1px; background: var(--border-strong); border-radius: 1px; }
.bs-tl-dot { position: absolute; top: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--surface); opacity: .55; }
.bs-tl-dot.big { top: -3px; width: 12px; height: 12px; margin-left: -6px; opacity: .8; }
.bs-tl-dot.past { opacity: 1; }
.bs-tl-dot.t-red { background: #e5484d; } .bs-tl-dot.t-gold { background: var(--gold); } .bs-tl-dot.t-violet { background: #8b83f0; }
.bs-tl-dot.t-green { background: #3fb465; } .bs-tl-dot.t-blue { background: #5b8def; }
.bs-tl-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bs-chaps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bs-chap { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.bs-chap:hover { border-color: var(--accent); color: var(--text); }
.bs-chap.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }

/* the headline of a big moment floats over the scroll for a while, as in the time lapses (.lp-banner) */
.bs-banner { position: absolute; z-index: 2; right: 14px; top: 14px; display: flex; align-items: center; gap: 6px; max-width: min(560px, calc(100% - 28px));
  padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-family: var(--font); font-size: 15.5px; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .15); animation: bs-banner 5s ease-out forwards; pointer-events: none; }
.bs-banner .mascot { flex: none; width: 64px; height: 64px; margin: -16px 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.bs-banner.ouch, .bs-banner.storm { background: #2a0f12; color: #ffe3e3; border: 2px solid var(--bs-red); }
.bs-banner.fallen { background: #1d2430; color: #e5eaf1; border: 2px solid #8fa0b3; }
.bs-banner.down { background: #1f1b45; color: #f0eeff; border: 2px solid #8b83f0; }
.bs-banner.heal { background: #10291f; color: #dff7ea; border: 2px solid var(--bs-green); }
.bs-banner.win, .bs-banner.loot { font-size: 15px; box-shadow: 0 0 0 3px rgba(241, 195, 90, .35), 0 0 30px rgba(241, 195, 90, .6); animation-duration: 8s; }
.bs-banner.meet { background: var(--surface); color: var(--text); border: 2px solid var(--gold); animation-duration: 7s; }
.bs-banner.taunt, .bs-banner.appear { background: #1a1230; color: #f3eaff; border: 2px solid #b9a4ff; animation-duration: 7s; box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 24px rgba(185, 164, 255, .45); }
.bs-banner.taunt q { font-style: italic; }
.bs-banner.die, .bs-banner.thrown { background: #3a0b10; color: #fff; border: 2px solid var(--bs-red); box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 30px rgba(229, 72, 77, .7); }
.bs-banner.run, .bs-banner.out { background: #2b1a06; color: #ffe9cf; border: 2px solid var(--bs-orange); }
.bs-banner.outside { background: #eaf2fb; color: #14233a; border: 2px solid #9cc3ec; }
.bs-banner.mend { background: #10291f; color: #dff7ea; border: 2px solid var(--bs-green); }
.bs-banner.stun { background: #1f1b45; color: #f0eeff; border: 2px solid #8b83f0; }
@keyframes bs-banner { 0% { opacity: 0; transform: translateY(-14px) scale(.85); } 6% { opacity: 1; transform: scale(1.04); } 10% { transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }
.bs-stage { animation: bs-pop .5s ease-out; display: inline-block; }
@keyframes bs-pop { 0% { transform: scale(1.35); } }
@media (max-width: 900px) {
  .bs-board.bs-duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bs-board.bs-duo .bs-tally { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .bs-card { padding: 14px 12px 12px; }
  .bs-board { grid-template-columns: 1fr; }
  .bs-tally { justify-content: space-between; }
  .bs-scroll { height: 58vh; max-height: 420px; font-size: 12px; padding: 10px; }
  .bs-banner { right: 8px; left: 8px; top: 10px; max-width: none; font-size: 13px; }
  .bs-board.bs-duo { grid-template-columns: 1fr; }
  .bs-board.bs-duo .bs-tally { justify-content: space-between; }
  .bs-mapbox { font-size: 11px; }
  .bs-src { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .bs-l, .bs-crit, .bs-storm, .bs-stage, .bs-banner, .bs-death.bs-boss, .bs-term.jolt-a, .bs-term.jolt-b, .bs-eq, .bs-cursor span,
  .bs-blow, .bs-danger.bs-dire, .bs-tally dd, .bs-ride, .bs-dmg, .bs-term.bs-low::before { animation: none; }
  .bs-bar i, .bs-g b, .bs-tl-fill { transition: none; }
}

/* Player profile: Forecast and Month in review (ui/forecast.js) */
.fc-fc { stroke: var(--pf2); stroke-dasharray: 6 4; }
.fc-band { fill: var(--pf2); opacity: .16; stroke: none; }
.fc-now { stroke: var(--border-strong); stroke-dasharray: 2 3; }
.rs-sw.fc-k-fc { background: var(--pf2); }
.rs-sw.fc-k-band { background: var(--pf2); opacity: .3; }
.fc .rs-tiles { margin-bottom: 8px; }
.fc-eta { max-width: 520px; }
.fc-eta td { font-variant-numeric: tabular-nums; }
.fc-goal { margin-top: 8px; }
.fc-goal input { width: 9em; }
.fc-custom th, .fc-custom td { border-top: 1px dashed var(--border-strong); }
.mr-pick { align-items: center; gap: 8px; }
.mr-pick select { min-width: 10em; }
.mr-cards { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 12px; }
.mr-cards > .mr-card { grid-column: span 4; }
.mr-cards > .mr-hero { grid-column: span 5; }
.mr-cards > .mr-chart { grid-column: span 7; }
.mr-cards > .mr-stood { grid-column: span 5; }
.mr-cards > .mr-wide { grid-column: span 7; }
@media (max-width: 860px) { .mr-cards > .mr-card, .mr-cards > .mr-hero, .mr-cards > .mr-chart, .mr-cards > .mr-stood, .mr-cards > .mr-wide { grid-column: 1 / -1; } }
.mr-card { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  animation: mr-in .45s ease-out both; animation-delay: var(--d, 0ms); min-width: 0; }
.mr-hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); border-color: var(--accent); }
.mr-k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.mr-big { font-size: clamp(48px, 7vw, 76px); line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--accent); }
.mr-sub { font-size: 13.5px; color: var(--muted); }
.mr-verdict { font-size: 16px; font-weight: 600; }
.mr-line { font-size: 18px; }
.mr-bars { display: flex; align-items: flex-end; gap: 8px; height: 230px; flex: 1 1 auto; padding-top: 16px; }
.mr-bar { flex: 1 1 0; max-width: 84px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; font-size: 11px; min-width: 0; }
.mr-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--pf1); opacity: .75; transform-origin: bottom; animation: rs-rise .5s ease-out both; }
.mr-bar.best i { background: var(--gold, #e9b13b); opacity: 1; }
.mr-bar.neg i { background: var(--err); }
.mr-bar em { font-style: normal; font-variant-numeric: tabular-nums; order: -1; color: var(--text); }
.mr-bar small { color: var(--muted); }
.mr-ev { margin: 0; padding-left: 1.2em; display: grid; gap: 5px; font-size: 14.5px; }
.mr-ev.cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); column-gap: 24px; }
.mr-bar.none i { display: none; }
@media (max-width: 600px) { .mr-bars.many { gap: 4px; } .mr-bars.many .mr-bar em { display: none; } }
@keyframes mr-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .mr-card, .mr-bar i { animation: none; } }
.onl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 4px 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 14px; }
.onl-now { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.onl-now b { font-size: 22px; font-variant-numeric: tabular-nums; }
.onl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok, #2f9e5b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok, #2f9e5b) 25%, transparent); animation: rs-pulse 2.4s ease-in-out infinite; }
.onl-bit { color: var(--muted); }
.onl-bit b { color: var(--text); }
.onl-last .btn.link { padding: 0 1px; font-weight: 700; }
.onl-day { display: inline-flex; align-items: center; gap: 8px; }
.onl-day .rs-spark { display: block; }
@media (prefers-reduced-motion: reduce) { .onl-dot { animation: none; } }
.ls-table th[scope=row] { white-space: nowrap; }
.ls .ls-stack { min-width: 160px; width: 28%; }
.ls-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.ls-bar i { display: block; flex-basis: 0; min-width: 0; }
.ls-e { background: var(--gold, #e9b13b); } .ls-l { background: var(--accent, #3b3490); } .ls-g { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.ls-ret { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin: 4px 0 12px; border: 1px solid var(--border, rgba(128,128,128,.3)); border-left: 4px solid var(--accent, #6b8afd); border-radius: 10px; background: color-mix(in srgb, var(--accent, #6b8afd) 8%, transparent); }
.ls-ret-main { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.ls-ret-main b { font-size: 32px; line-height: 1.1; }
.ls-ret-main span { font-size: 12px; opacity: .75; }
.ls-ret p { margin: 0; font-size: 14px; }
@media (max-width: 560px) { .ls-ret { flex-direction: column; align-items: flex-start; } }
.ls-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; margin: 8px 0 0; }
.ls-key i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; }
.hof-list { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 4px; counter-reset: none; }
.hof-row { display: grid; grid-template-columns: 1.8em 34px minmax(0, 1fr) minmax(90px, 220px); align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); }
.hof-row.m1 { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%); }
.hof-row.m2, .hof-row.m3 { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%); }
.hof-rank { width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hof-row.m1 .hof-rank { background: #f2c14e; color: #1d1640; } .hof-row.m2 .hof-rank { background: #d5dbe5; color: #1d1640; } .hof-row.m3 .hof-rank { background: #d99a5b; color: #1d1640; }
.hof-who { display: grid; min-width: 0; line-height: 1.25; }
.hof-names { display: flex; flex-wrap: wrap; align-items: baseline; }
.hof-who > small { color: var(--muted); font-size: 11.5px; }
.hof-name { font-weight: 700; padding: 0 1px; }
.hof-plus { color: var(--muted); font-weight: 700; margin: 0 .2em; }
.hof-val { display: grid; gap: 3px; justify-items: end; font-variant-numeric: tabular-nums; }
.hof-val b { font-size: 15px; }
.hof-bar { display: block; height: 5px; border-radius: 3px; background: var(--gold, #e9b13b); }
@media (max-width: 560px) { .hof-row { grid-template-columns: 1.8em 34px minmax(0, 1fr); } .hof-val { grid-column: 3; justify-items: start; } }
.xs-plus { margin: 0 .25em; color: var(--muted); font-weight: 700; }
.pf-finger { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 8px 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.pf-finger > div { display: grid; gap: 1px; }
.pf-finger dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pf-finger dd { margin: 0; font-size: 14.5px; }
.pf-finger .btn.link { padding: 0 1px; font-weight: 600; }
.pf-st { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-3); }
.pf-st.st-eternal { background: color-mix(in srgb, var(--gold) 28%, transparent); } .pf-st.st-ancient { background: var(--accent-soft); color: var(--accent); }
.pf-angel { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.mm-lead { max-width: 60ch; color: var(--muted); }
.mm-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.mm-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 12px 14px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--gold) 16%, transparent), var(--surface-2) 70%); }
.mm-halo { color: var(--gold); margin-bottom: -6px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 55%, transparent)); }
.mm-pic .race-pic { border-radius: 50%; filter: grayscale(.55) brightness(1.04); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent), 0 0 14px color-mix(in srgb, var(--gold) 35%, transparent); }
.mm-name { font-weight: 700; font-size: 16px; padding: 4px 2px 0; }
.mm-sub { font-size: 13px; }
.mm-yrs { font-size: 12.5px; color: var(--gold-ink, var(--muted)); font-weight: 600; letter-spacing: .02em; }
.mm-meta { font-size: 11.5px; color: var(--muted); }

.ro-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.ro-table .ro-exp { font-weight: 600; }
.ro-table td .rs-race { white-space: nowrap; }
.ro-table td, .ro-table th[scope=row] { white-space: nowrap; }
.ro-table td .rs-race { display: inline-flex; align-items: center; gap: 6px; }

.xs-filters + .xs-filters { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.xs-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.xs-jump .chip { all: unset; cursor: pointer; padding: 5px 12px; border-radius: 999px; font-size: 13px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.xs-jump .chip:hover, .xs-jump .chip:focus-visible { border-color: var(--accent, #4b3fa0); color: var(--accent, #4b3fa0); }
.xs-board th, .xs-board td { white-space: nowrap; }
.xs-board th[scope=row] .rs-race { gap: 8px; }
.rs h3[id^="h-xs"] { scroll-margin-top: calc(var(--top-h, 60px) + 12px); }

.xs-stack { display: flex; height: 7px; gap: 1px; min-width: 1px; }
.rs-bars .xs-stack i { height: 7px; border-radius: 0; margin: 0; min-width: 2px; transition: none; }
.rs-bars .xs-stack i:last-child { border-radius: 0 4px 4px 0; }
.xs-m0 { background: var(--accent); } .xs-m1 { background: #e0802f; } .xs-m2 { background: #2a9d8f; } .xs-m3 { background: #c44d8b; } .xs-m4 { background: #8a8f98; }
.xs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* the badge ranking tab and the Dashboard's card */
.rk-table th, .rk-table td { white-space: nowrap; }
.rk-table .rk-fam { color: var(--muted); font-size: 12.5px; width: 3.2em; }
.rk-pts { display: grid; gap: 3px; min-width: 110px; font-variant-numeric: tabular-nums; }
.rk-pts b { font-size: 15px; }
.rk-bar { display: block; height: 5px; border-radius: 3px; background: var(--gold, #e9b13b); }
.rk-table tr.me, .rk-now-list li.me { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rk-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.rk-now-col h4 { margin: 0 0 6px; font-size: 14px; }
.rk-now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rk-now-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.rk-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rk-mini-row { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) minmax(70px, 140px); align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); }
.rk-mini-row.m1 { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%); }
.rk-mini-row.m2, .rk-mini-row.m3 { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%); }
.rk-mini-row.m1 .hof-rank { background: #f2c14e; color: #1d1640; } .rk-mini-row.m2 .hof-rank { background: #d5dbe5; color: #1d1640; } .rk-mini-row.m3 .hof-rank { background: #d99a5b; color: #1d1640; }
.rk-mini-who { display: grid; gap: 3px; min-width: 0; }
@media (max-width: 560px) { .rk-mini-row { grid-template-columns: 1.8em minmax(0, 1fr) 60px; } }

/* the Badges tab, themed: each card takes its badge's colours; the cards sit in family sections */
.bg-card.k-loser { --bdg-a: #4b2a7a; --bdg-b: #a77ce8; }
.bg-card.k-losers { --bdg-a: #4b2a7a; --bdg-b: #a77ce8; }
.bg-card.k-weekloser { --bdg-a: #7a2a5f; --bdg-b: #e87ba4; }
.bg-card.k-monthloser { --bdg-a: #2a3f7a; --bdg-b: #8aa6f0; }
.bg-card.k-phoenix { --bdg-a: #b23c0e; --bdg-b: #ffb04a; }
.bg-card.k-reinc { --bdg-a: #136b4f; --bdg-b: #4fd1a1; }
.bg-card.k-old { --bdg-a: #5b4a35; --bdg-b: #c9a77a; }
.bg-card.k-streak { --bdg-a: #1d4f91; --bdg-b: #6aa8f0; }
.bg-card.k-back { --bdg-a: #1d4f91; --bdg-b: #6aa8f0; }
.bg-card.k-week { --bdg-a: #a3261f; --bdg-b: #ff7a6b; }
.bg-card.k-champion { --bdg-a: #9a6b00; --bdg-b: #ffd84a; }
.bg-card.k-podium { --bdg-a: #5d6b78; --bdg-b: #d6dde4; }
.bg-card.k-level { --bdg-a: #0f5e6e; --bdg-b: #4cc9d9; }
.bg-card.k-veteran { --bdg-a: #3d4a5c; --bdg-b: #9fb0c6; }
.bg-card.k-rocket { --bdg-a: #b0381c; --bdg-b: #ffa25a; }
.bg-card.k-star { --bdg-a: #8a1f6a; --bdg-b: #f07ad0; }
.bg-card.k-elite { --bdg-a: #8a6a00; --bdg-b: #ffe27a; }
.bg-card.k-explorer { --bdg-a: #1f6b3a; --bdg-b: #7fe09a; }
.bg-card.k-slayer { --bdg-a: #8f1d1d; --bdg-b: #ff7b6b; }
.bg-card.k-survivor { --bdg-a: #2a4a6e; --bdg-b: #8fc1f0; }
.bg-card.k-elder { --bdg-a: #5b4a35; --bdg-b: #d9bd8f; }
.bg-card.k-prodigy { --bdg-a: #7a2a8f; --bdg-b: #e39cf5; }
.bg-card.k-racelead { --bdg-a: #0f5e6e; --bdg-b: #6fe0ee; }
.bg-card.k-hot { --bdg-a: #b0381c; --bdg-b: #ff9a4a; }
.bg-card.k-fresh { --bdg-a: #1f6b8a; --bdg-b: #7fd6f0; }
.bg-card.k-secondary { --bdg-a: #5b3d8f; --bdg-b: #b99cf0; }
.bg-card.k-lazarus { --bdg-a: #24624a; --bdg-b: #8fe0b8; }
.bg-card.k-day { --bdg-a: #b8730a; --bdg-b: #ffd166; }
.bg-card.k-month { --bdg-a: #3b2a7a; --bdg-b: #9d8af0; }
.bg-tiles { margin: 14px 0 6px; }
.bg-fam { margin-top: 26px; scroll-margin-top: 90px; }
.bg-fam-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 2px 10px; padding-bottom: 8px; border-bottom: 2px solid var(--border); position: relative; }
.bg-fam-head::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 64px; height: 2px; background: var(--accent, #4b3fa0); }
.bg-fam-head h3 { margin: 0; font-size: 20px; letter-spacing: .01em; }
.bg-card { --bdg-a: #8a6d1d; --bdg-b: #f2c94c; position: relative; overflow: hidden; border-top: 3px solid var(--bdg-b);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bdg-b) 13%, var(--surface)) 0, var(--surface) 120px); transition: transform .18s ease, box-shadow .18s ease; }
.bg-card::before { content: ''; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--bdg-b) 28%, transparent), transparent 70%); pointer-events: none; }
.bg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bg-card > * { position: relative; }
.bg-card .bg-count { background: color-mix(in srgb, var(--bdg-b) 22%, var(--surface)); color: var(--text); padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.bg-card .bg-list li { position: relative; border-bottom: none; border-radius: 6px; padding: 4px 6px; isolation: isolate; }
.bg-card .bg-list li::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0); border-radius: 6px; z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bdg-b) 30%, transparent), color-mix(in srgb, var(--bdg-b) 6%, transparent)); }
.bg-card .bg-list li:nth-child(1) { font-weight: 700; font-size: 14.5px; }
.bg-card .bg-list li:hover { background: color-mix(in srgb, var(--bdg-b) 10%, transparent); }
.bg-card .bg-list li.me { outline: 2px solid var(--focus); }
.bg-card .bg-tiers span, .bg-card .bg-bars span { background: color-mix(in srgb, var(--bdg-b) 10%, var(--surface)); padding: 1px 8px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .bg-card { transition: none; } .bg-card:hover { transform: none; } }
@media (max-width: 560px) { .bg-grid { grid-template-columns: 1fr; } }
.ap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
.ap-cols .ap-table { font-size: 13px; }
.ap-cols .ap-table th, .ap-cols .ap-table td { padding: 3px 8px; }
.ap-cols .ap-table th[scope=row] { white-space: nowrap; }
.ap-race { display: inline-flex; vertical-align: middle; margin-right: 6px; }
@media (max-width: 1000px) { .ap-cols { grid-template-columns: 1fr; } }

/* the player profile's early records: a card a copy of the old plaque */
.pf-early { margin-top: 6px; }
.pf-early .pf-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-ec-row { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.pf-ec { position: relative; display: grid; gap: 3px; padding: 10px 12px 11px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface-2); }
.pf-ec::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold); }
.pf-ec-when { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pf-ec-place { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--gold); }
.pf-ec-place i { font-style: normal; font-size: 16px; font-weight: 600; opacity: .7; margin-right: 1px; }
.pf-ec-exp { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-ec-bar { display: block; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin: 3px 0 2px; }
.pf-ec-bar > span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.pf-ec-meta { font-size: 12.5px; color: var(--muted); }
.pf-ec-meta .pos { color: var(--ok); }
.pf-ec-meta .neg { color: var(--err); }
.pf-ec.late { border-style: dashed; background: var(--surface-2); }
.pf-ec.late::before { background: var(--border-strong); }
.pf-ec.late .pf-ec-place { color: var(--muted); }
.pf-ec-late { justify-self: start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px dashed var(--border-strong); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .pf-ec { animation: pf-ec-in .35s ease both; } .pf-ec:nth-child(2) { animation-delay: .05s; } .pf-ec:nth-child(3) { animation-delay: .1s; } .pf-ec:nth-child(4) { animation-delay: .15s; } .pf-ec:nth-child(5) { animation-delay: .2s; } }
@keyframes pf-ec-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* a stretch with no data, squeezed on a graphs time axis */
.pf-gap rect { fill: color-mix(in srgb, var(--border) 35%, transparent); stroke: var(--border-strong); stroke-dasharray: 3 4; }
.pf-gap text { fill: var(--muted); font-size: 11px; }
