/* Crucible competition workspace. Loaded after style, competition and layout. */
:root {
  --forest: #76d69d;
  --forest-surface: #17281f;
  --forest-line: #375f48;
  --daimyo: #f18b73;
  --daimyo-surface: #2b1d1b;
  --daimyo-line: #714438;
  --chart-blue: #80bcf5;
  --chart-violet: #bb9bf2;
  --chart-cyan: #77d4dc;
  --chart-amber: #ecc46f;
  --panel-space: 20px;
  --motion-ease: cubic-bezier(.16, 1, .3, 1);
}

[hidden] { display: none !important; }
.ui-icon { width: 19px; height: 19px; flex: 0 0 auto; display: inline-block; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button > .ui-icon, .button > .ui-icon, a > .ui-icon { margin-right: 6px; }
.site-header nav a { display: inline-flex; align-items: center; gap: 7px; }
.site-header nav a > .ui-icon { width: 17px; height: 17px; margin: 0; }
.site-header nav a[aria-current="page"] .ui-icon { color: var(--gold); }
.site-header { max-width: 1440px; padding-inline: 32px; gap: 24px; }
.site-header nav { gap: 22px; }
.motion-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 10px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.motion-toggle .ui-icon { width: 17px; height: 17px; margin: 0; }
.motion-toggle[aria-pressed="true"] { color: var(--chart-cyan); }
.staff-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding-left: 18px; }
.staff-link .ui-icon { width: 16px; height: 16px; margin: 0; }
button:hover, .button:hover { transform: none; }
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
main { max-width: 1440px; padding-inline: 32px; }
main > h1 { font-size: 44px; margin-bottom: 12px; }
.section-lead { font-size: 18px; margin-top: 0; margin-bottom: 22px; }

/* Challenge colour is identity, never a verification state. */
[data-challenge-theme="forest"], [data-theme="forest"], .theme-forest { --challenge-accent: var(--forest); --challenge-surface: var(--forest-surface); --challenge-line: var(--forest-line); }
[data-challenge-theme="daimyo"], [data-theme="daimyo"], .theme-daimyo { --challenge-accent: var(--daimyo); --challenge-surface: var(--daimyo-surface); --challenge-line: var(--daimyo-line); }
.competition-head { gap: 24px; margin-bottom: 16px; }
.competition-head h1 { font-size: 40px; margin-bottom: 8px; }
.competition-head .challenge-strip { flex-basis: 420px; gap: 10px; }
.challenge { transition: background-color 180ms, border-color 180ms; }
.challenge.selected { background: var(--challenge-surface, var(--raised)); border-color: var(--challenge-line, var(--line)); border-top-color: var(--challenge-accent, var(--gold)); }
.challenge.selected::after { background: var(--challenge-accent, var(--gold)); }
.challenge:focus-visible { outline-color: var(--challenge-accent, var(--gold)); }
.challenge-art { width: 80px; height: 80px; object-fit: contain; flex: 0 0 auto; color: var(--challenge-accent, var(--gold-soft)); }
.competition-head .challenge-art { float: left; margin-right: 18px; }
.challenge .challenge-art { width: 40px; height: 40px; margin-right: 10px; }
.challenge-heading, .challenge-identity, .competition-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.challenge-heading .challenge-art, .challenge-identity .challenge-art, .competition-identity .challenge-art { float: none; margin: 0; }
.competition-head .challenge { display: flex; align-items: center; gap: 8px; }
.competition-head .challenge > .ui-icon { color: var(--challenge-accent, var(--gold-soft)); margin: 0; }
.competition-head .challenge > span { flex: 1; }
.proof-notice { font-size: 13px; padding-block: 9px; }
.proof-notice .ui-icon { width: 16px; height: 16px; color: var(--gold-soft); margin-right: 5px; }
.compact-controls { gap: 12px; padding-block: 14px; }
.compact-controls label:nth-child(2) { width: 170px; }
.compact-controls > button { padding-inline: 15px; }

/* A single standings table and a tabbed analytical rail. */
.board-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 292px; align-items: start; gap: 24px; }
.board-main, .profile-main, .record-main, .lab-chart { min-width: 0; }
.board-main .table-wrap th, .board-main .table-wrap td { padding-inline: 12px; }
.board-main .table-wrap th:nth-child(2) { width: 31%; }
.board-main .table-wrap th:nth-child(3) { min-width: 90px; }
.board-main .table-wrap td { padding-block: 8px; font-size: 16px; line-height: 1.3; }
.board-main .player { font-size: 18px; line-height: 1.2; }
.board-main .score { font-size: 23px; }
.board-main .imported, .board-main .proof { font-size: 12px; line-height: 1.3; }
.rank { white-space: nowrap; }
.rank .ui-icon { width: 15px; height: 15px; margin-right: 4px; color: inherit; }
.board-main .boons { gap: 2px; }
.board-main .boon-trigger { padding: 2px 1px; min-width: 34px; min-height: 36px; }
.board-main .boons img { width: 32px; height: 32px; }
.table-wrap tbody tr { animation: none; }
.table-wrap tbody tr.is-selected, .table-wrap tbody tr[aria-selected="true"] { background: #292019; }
.table-wrap tbody tr.is-selected .player, .table-wrap tbody tr[aria-selected="true"] .player { color: var(--gold-soft); }
.table-wrap tbody tr:hover .player { text-decoration-thickness: 1px; }
.table-wrap input[type="checkbox"] { width: 21px; height: 21px; }
.pagination { margin-block: 16px; }
.pagination button { min-height: 42px; }
.leaderboard-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
.leaderboard-page-numbers { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; flex: 1; }
.leaderboard-pages button { min-width: 40px; min-height: 42px; padding: 7px 11px; }
.leaderboard-pages button[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: #101214; font-weight: 800; }
.leaderboard-pages .page-gap { padding: 0 3px; color: var(--muted); }
@media (max-width: 600px) { .leaderboard-pages { justify-content: space-between; } .leaderboard-page-numbers { order: 3; flex-basis: 100%; } }
.board-pagination { margin-block: 12px; font-size: 13px; flex-wrap: nowrap; gap: 10px; }
.board-pagination button { min-height: 40px; padding: 7px 10px; font-size: 14px; }
.board-pagination .ui-icon { width: 16px; height: 16px; margin: 0 3px; }
.difficulty-badge { display: inline-block; padding: 4px 7px; border-radius: 3px; background: var(--raised); font-size: 13px; line-height: 1.2; color: var(--chart-blue); }
.difficulty-badge[data-difficulty="Easy"] { color: var(--chart-cyan); }
.difficulty-badge[data-difficulty="Intermediate"] { color: var(--forest); }
.difficulty-badge[data-difficulty="Hard"] { color: var(--chart-amber); }
.difficulty-badge[data-difficulty="Hardest"] { color: #f2bd77; }
.difficulty-badge[data-difficulty="Ridiculous"] { color: var(--gold-soft); }
.difficulty-badge[data-difficulty="Outrageous"] { color: var(--daimyo); }
.difficulty-badge[data-difficulty="Absurd"] { color: var(--chart-violet); }
.active-range { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin: 0 0 12px; background: #1b2531; border: 1px solid #405b75; color: var(--chart-blue); font-size: 14px; }
.active-range button { min-height: 34px; padding: 5px 8px; font-size: 13px; }
.scoreboard-meta { font-size: 13px; }
.scoreboard-meta.board-display-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board-display-options .feed-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; }
.board-display-options .sync { margin: 0; text-align: start; }
.board-filter-switches { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) { .scoreboard-meta.board-display-options { flex-wrap: wrap; } .board-filter-switches { width: 100%; justify-content: flex-start; } }
.country-filter { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; font-size: 15px; }
.country-switch { width: 25px; height: 15px; padding: 2px; display: inline-flex; align-items: center; border: 1px solid currentColor; border-radius: 100px; color: var(--muted); }
.country-switch::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.country-filter[aria-pressed="true"] { border-color: var(--gold); }
.country-filter[aria-pressed="true"] .country-switch { justify-content: flex-end; background: var(--gold); border-color: var(--gold); color: var(--ink); }
.country-filter-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.country-filter-status button { min-height: 44px; padding: 0 8px; font-size: inherit; border: 0; background: transparent; color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
#board-difficulties:not([hidden]) { display:flex; flex-wrap:wrap; gap:6px; padding:9px; margin:6px 0; border:1px solid var(--line); background:var(--surface); border-radius:4px; }
#board-difficulties button { min-height:38px; padding:6px 12px; }
#board-difficulties button[aria-pressed="true"] { border-color:var(--chart-amber); color:var(--chart-amber); }
.combined-standings .player:focus-visible { outline:2px solid var(--chart-amber); outline-offset:3px; }
.analytics-rail, .board-intel { position: sticky; top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: var(--panel-space); min-width: 0; }
.analytics-rail > h2, .board-intel > h2 { margin: 0 0 14px; font-size: 24px; }
.insight-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: var(--panel-space); min-width: 0; }
.analytics-rail > .insight-card, .board-intel > .insight-card, .profile-rail > .insight-card, .record-aside > .insight-card { border: 0; padding: 0; background: transparent; }
.insight-card h2 .ui-icon { color: var(--tone, var(--chart-blue)); }
.insight-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 22px; }
.insight-heading .ui-icon { color: var(--tone, var(--chart-blue)); }
.insight-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.insight-caption { font-size: 14px; color: var(--muted); line-height: 1.4; margin: 8px 0 0; }
.tone-green { --tone: var(--forest); }
.tone-red { --tone: var(--daimyo); }
.tone-blue { --tone: var(--chart-blue); }
.tone-violet { --tone: var(--chart-violet); }
.tone-gold { --tone: var(--chart-amber); }
.intel-tabs, .record-tabs, .view-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0; }
.intel-tabs button, .record-tabs button, .view-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 10px 11px; min-height: 42px; line-height: 1.2; }
.intel-tabs button { flex: 1; font-size: 14px; padding-inline: 4px; }
.intel-tabs button .ui-icon { width: 17px; height: 17px; margin-right: 4px; }
.intel-tabs button:hover, .record-tabs button:hover, .view-tabs button:hover { color: var(--text); background: var(--raised); }
.intel-tabs button[aria-selected="true"], .intel-tabs button[aria-pressed="true"], .record-tabs button[aria-selected="true"], .record-tabs button[aria-pressed="true"], .view-tabs button[aria-selected="true"], .view-tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--gold); background: #211c18; }
.intel-tabs button[aria-selected="true"] .ui-icon, .view-tabs button[aria-selected="true"] .ui-icon { color: var(--gold-soft); }
.intel-pane { min-width: 0; padding-top: 16px; animation: intel-reveal 180ms var(--motion-ease); }
.intel-pane h3 { font-size: 20px; margin: 0 0 10px; }
.intel-pane h2 { font-size: 24px; margin: 0 0 8px; }
.intel-pane p { font-size: 14px; line-height: 1.45; }
.intel-pane > .small { margin-top: 0; }
.rail-note { font-size: 12px; line-height: 1.4; margin-bottom: 0; }
.histogram { margin: 12px 0; }
.histogram svg, svg.score-chart, .score-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.histogram svg text, .score-chart text { fill: var(--muted); font-family: 'Alegreya Sans', sans-serif; }
.histogram text { font-size: 14px; }
.analytics-rail .histogram text, .board-intel .histogram text { font-size: 28px; }
.histogram-bar { fill: var(--chart-blue); cursor: default; transition: fill 140ms, opacity 140ms; }
.histogram-bar[data-bin] { cursor: pointer; }
.histogram-bar:nth-of-type(3n+2) { fill: var(--chart-cyan); }
.histogram-bar:nth-of-type(3n+3) { fill: var(--chart-violet); }
.histogram-bar:hover, .histogram-bar:focus { fill: var(--gold-soft); outline: none; }
.histogram-bar.is-selected, .histogram-bar[aria-pressed="true"] { fill: var(--gold); stroke: var(--text); stroke-width: 1.5; }
.histogram-bar.is-highlighted { fill: var(--gold); }
.intel-summary { margin: 12px 0 0; }
.intel-summary dl, dl.intel-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 8px 14px; }
.intel-summary dt { color: var(--muted); font-size: 14px; }
.intel-summary dd { margin: 0; font-size: 18px; font-weight: 700; text-align: right; }
dl.intel-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.intel-summary > div { display: grid; gap: 4px; }
.intel-summary > div dd { text-align: left; font-size: 22px; }
.difficulty-list { display: grid; gap: 5px; margin-top: 12px; }
.difficulty-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; text-align: left; padding: 10px; background: transparent; border-color: transparent; font-size: 15px; }
.difficulty-list button:hover { background: var(--raised); border-color: var(--line); }
.difficulty-list button[aria-pressed="true"] { background: #211c18; border-color: var(--gold); }
.difficulty-list button > span:first-child { display: flex; justify-content: space-between; gap: 12px; grid-column: 1 / -1; }
.difficulty-list button[data-color="0"] { --tone: var(--chart-blue); }
.difficulty-list button[data-color="1"] { --tone: var(--chart-cyan); }
.difficulty-list button[data-color="2"] { --tone: var(--forest); }
.difficulty-list button[data-color="3"] { --tone: var(--chart-amber); }
.difficulty-list button[data-color="4"] { --tone: var(--chart-violet); }
.mini-track { display: block; grid-column: 1 / -1; width: 100%; height: 6px; border-radius: 2px; background: #303944; overflow: hidden; }
.mini-fill { display: block; height: 100%; fill: var(--tone, var(--chart-blue)); background: var(--tone, var(--chart-blue)); border-radius: inherit; transform-origin: left; }
.difficulty-list button[aria-pressed="true"] .mini-fill { fill: var(--gold); background: var(--gold); }
.popular-boons { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.popular-boons li { min-width: 0; }
.popular-boons button { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; text-align: left; background: transparent; border-color: transparent; font-size: 16px; }
.popular-boons button:hover { background: var(--raised); border-color: var(--line); }
.popular-boons img { width: 40px; height: 40px; object-fit: contain; }
.popular-boons small { color: var(--muted); font-size: 13px; }
.tool-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tool-links > a, .tool-links > button { display: inline-flex; justify-content: center; align-items: center; flex: 1 1 auto; gap: 6px; min-height: 42px; padding: 8px 11px; color: var(--text); font-size: 14px; text-decoration: none; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; }
.tool-links .ui-icon { color: var(--tone, var(--chart-cyan)); margin: 0; transition: transform 160ms var(--motion-ease); }
.tool-links > a:hover, .tool-links > button:hover { border-color: #6a7687; background: #232c35; }
.tool-links > a:hover .ui-icon, .tool-links > button:hover .ui-icon { transform: translateX(2px); }

/* Player records: identity, a chosen challenge, then the useful evidence. */
.profile-shell { min-width: 0; }
.profile-hero, .profile-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 22px 0 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.profile-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.profile-identity h1, .profile-hero h1, .profile-banner h1 { font-size: 44px; margin: 0 0 8px; line-height: 1.08; overflow-wrap: anywhere; }
.profile-identity p, .profile-hero p, .profile-banner p { margin: 0; color: var(--muted); font-size: 14px; }
.profile-avatar { width: 76px; height: 76px; flex: 0 0 auto; display: grid; place-items: center; object-fit: contain; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); font-size: 28px; font-weight: 700; color: var(--gold-soft); }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; }
.profile-avatar > .ui-icon { width: 40px; height: 40px; color: var(--challenge-accent, var(--gold-soft)); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex: 0 1 400px; }
.profile-actions button, .profile-actions .button { min-height: 42px; font-size: 15px; padding: 9px 12px; white-space: nowrap; }
.record-tabs { margin-bottom: 18px; }
.record-tabs button { font-size: 18px; padding-inline: 16px; }
.record-tabs button .ui-icon { color: var(--challenge-accent, var(--gold-soft)); }
.view-tabs { margin: 18px 0; }
.view-tabs button { font-size: 16px; padding-inline: 16px; }
.profile-layout, .record-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.profile-rail, .record-aside { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: var(--panel-space); min-width: 0; }
.profile-rail h2, .profile-rail h3, .record-aside h2, .record-aside h3 { font-size: 22px; margin: 0 0 12px; }
.profile-rail p, .record-aside p { font-size: 14px; line-height: 1.45; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: baseline; padding: 8px 0 22px; border-bottom: 1px solid var(--line); }
.profile-stat { min-width: 110px; }
.stat-value { display: block; font-size: 32px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.profile-stats .stat-label { margin: 0 0 6px; }
.profile-stats .stat-value + .small { display: block; margin-top: 6px; }
.stat-value.difficulty-value { font-size: 27px; }
.profile-stat .ui-icon { color: var(--tone, var(--gold-soft)); }
.record-score { font-size: 48px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.record-facts dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
.record-facts dt { color: var(--muted); font-size: 14px; }
.record-facts dd { margin: 0; font-size: 17px; font-weight: 700; text-align: right; }
.record-facts > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.record-facts > div dd { overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 20px 0 12px; }
.section-heading h2, .player-detail > h2 { font-size: 27px; margin: 0; }
.player-detail > h2 { margin-top: 20px; }
.data-coverage { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.data-coverage ul { list-style: none; padding: 0; margin: 12px 0 16px; }
.data-coverage li { display: flex; gap: 8px; align-items: start; font-size: 14px; margin: 8px 0; }
.data-coverage li .ui-icon { width: 17px; height: 17px; color: var(--chart-blue); margin-top: 2px; }
.data-coverage h3 .ui-icon { color: var(--chart-cyan); }
.data-coverage > a { font-size: 14px; }
.loadout-grid, .boon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.loadout-item, .boon-grid > button { display: flex; gap: 12px; align-items: center; min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; text-align: left; }
.loadout-item:hover, .boon-grid > button:hover { background: var(--raised); border-color: var(--challenge-line, #6a7687); }
.loadout-icon, .boon-grid > button > img { width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain; transition: transform 180ms var(--motion-ease); }
.loadout-item:hover .loadout-icon, .boon-grid > button:hover > img { transform: translateY(-3px) rotate(-2deg); }
.loadout-copy { min-width: 0; }
.loadout-copy strong, .loadout-copy .name, .boon-grid > button strong { display: block; font-size: 18px; line-height: 1.2; }
.loadout-copy small, .loadout-copy p, .boon-grid > button small { display: block; margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.3; font-weight: 400; }
.loadout-item .ascended, .boon-grid .ascended { color: var(--chart-violet); }
.loadout-item.is-ascended { border-color: #62517b; }
.loadout-item.is-ascended small { color: var(--chart-violet); }
.loadout-copy small .ui-icon { width: 14px; height: 14px; }
.score-chart { margin: 16px 0; min-width: 0; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--tone, var(--chart-blue)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-fill { fill: var(--tone, var(--chart-blue)); fill-opacity: .13; }
.chart-dot { fill: var(--surface); stroke: var(--tone, var(--chart-blue)); stroke-width: 2; }
.chart-focus { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-cutoff { fill: none; stroke: var(--gold-soft); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart-axis { fill: var(--muted); stroke: none; }
line.chart-axis, path.chart-axis { fill: none; stroke: #728195; stroke-width: 1; }
.score-chart .chart-cutoff-label { fill: var(--gold-soft); stroke: none; }
.chart-ramp { fill: none; stroke: var(--chart-violet); stroke-width: 1.5; stroke-dasharray: 3 3; }
.score-chart .chart-label { fill: var(--text); font-weight: 700; }
.score-chart .chart-note { fill: var(--muted); font-size: 13px; }
.score-chart [tabindex="0"]:focus-visible { outline: none; stroke: var(--text); stroke-width: 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 14px; color: var(--muted); }
.chart-legend .legend-current { color: var(--gold-soft); }
.chart-legend .legend-current::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; background: var(--gold); }

/* A compact score lab and a six-item reference browser. */
.score-lab { max-width: 1200px; margin-inline: auto; }
.lab-heading, .library-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.lab-heading h1, .methods-heading h1 { font-size: 44px; margin-bottom: 12px; }
.lab-heading > p, .methods-heading > p { margin-top: 0; font-size: 18px; color: var(--muted); }
.lab-heading h1 .ui-icon, .library-heading h1 .ui-icon, .methods-heading h1 .ui-icon { width: 32px; height: 32px; color: var(--chart-cyan); margin-right: 8px; }
.lab-heading > .lab-warning { max-width: 300px; margin-top: 5px; font-size: 14px; line-height: 1.4; color: var(--chart-amber); }
.lab-heading > div > p { font-size: 18px; margin: 0; color: var(--muted); }
.lab-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 24px; }
.score-lab-controls, .lab-controls { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: var(--panel-space); align-self: start; }
.score-lab-controls label, .lab-controls label { font-size: 15px; }
.score-lab-controls input, .score-lab-controls select, .lab-controls input, .lab-controls select { width: 100%; }
.score-lab-controls .small, .lab-controls .small { margin: 0; font-size: 14px; }
.score-lab-controls fieldset, .lab-controls fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.score-lab-controls legend, .lab-controls legend { font-size: 15px; font-weight: 700; padding: 0; margin-bottom: 9px; }
.lab-difficulty-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lab-difficulty-buttons button { min-height: 40px; padding: 8px 7px; font-size: 14px; line-height: 1.2; }
.lab-difficulty-buttons button[aria-pressed="true"] { color: var(--chart-violet); border-color: var(--chart-violet); background: #271e35; }
.lab-stepper { display: flex; align-items: center; gap: 10px; }
.lab-stepper button, .lab-time-row > button { min-width: 40px; min-height: 40px; padding: 8px; }
.lab-stepper button .ui-icon, .lab-time-row > button .ui-icon { margin: 0; }
.lab-stepper output { flex: 1; text-align: center; font-size: 25px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--gold); padding: 0; cursor: pointer; min-height: 28px; }
.lab-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: var(--panel-space); }
.lab-chart h2 { margin: 0 0 12px; font-size: 26px; }
.lab-chart p { font-size: 14px; }
.lab-time-row { display: grid; gap: 8px; }
.lab-time-row output { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lab-time-presets, .lab-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-time-presets button, .lab-presets button { flex: 1; min-height: 40px; padding: 7px 9px; font-size: 14px; }
.lab-time-presets button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-soft); background: #211c18; }
.lab-result { padding-top: 16px; border-top: 1px solid var(--line); }
.lab-result output { display: block; font-size: 40px; line-height: 1.1; font-weight: 700; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.lab-cutoff-note, .lab-caption { font-size: 14px; color: var(--muted); line-height: 1.4; }
.lab-warning { font-size: 14px; color: var(--chart-amber); line-height: 1.4; }
.lab-formula { font-size: 16px; color: var(--chart-violet); }
.score-lab .chart-dot { fill: var(--gold); stroke: var(--ink); stroke-width: 2; transition: transform 160ms var(--motion-ease); }
.library-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 0; border-top: 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.library-heading { align-items: center; margin-bottom: 12px; }
.library-heading h1 { font-size: 38px; margin: 0 0 6px; }
.library-heading .section-lead { margin: 0; font-size: 16px; }
.library-heading > .button { white-space: nowrap; }
.library-pager > div { display: flex; align-items: center; gap: 8px; }
.library-pager button { min-height: 40px; padding: 6px 11px; font-size: 14px; }
.page-size-buttons, .board-pagination > .page-size-buttons, .library-pager > .page-size-buttons { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.page-size-buttons button { min-height: 40px; padding: 7px 9px; font-size: 13px; white-space: nowrap; }
.page-size-buttons button[aria-pressed="true"] { background: #1b2531; border-color: var(--chart-blue); color: var(--chart-blue); }
.board-pagination > span, .library-pager > span { white-space: nowrap; }
.board-pagination > div:last-child, .library-pager > div:last-child { display: flex; gap: 6px; flex: 0 0 auto; white-space: nowrap; }
.library-toolbar .library-pager { flex-wrap: nowrap; }
.category-icon { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; margin-right: 7px; }
.tabs { margin-block: 12px; gap: 8px; }
.tabs button { min-height: 40px; padding: 6px 11px; }
.tabs button .ui-icon { color: var(--tone, var(--chart-cyan)); }
.tabs button[aria-selected="true"] .ui-icon { color: var(--ink); }
.library-filter { margin: 8px 0; gap: 12px; }
.library-filter label { font-size: 14px; gap: 5px; }
.library-filter input { padding: 8px 12px; min-height: 40px; }
.library-toolbar { display: flex; align-items: end; gap: 20px; margin: 10px 0 14px; }
.library-toolbar .library-filter { flex: 1; min-width: 180px; margin: 0; }
.library-count { flex: 0 0 auto; align-self: end; padding-block: 9px; color: var(--muted); font-size: 14px; }
.library-toolbar .library-pager { flex: 0 1 auto; margin: 0; padding: 0; border: 0; }
.catalogue { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.catalogue article { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 18px; }
.catalogue article[data-color="0"], .difficulty-chips [data-color="0"] { --card-accent: var(--chart-blue); }
.catalogue article[data-color="1"], .difficulty-chips [data-color="1"] { --card-accent: var(--chart-cyan); }
.catalogue article[data-color="2"], .difficulty-chips [data-color="2"] { --card-accent: var(--forest); }
.catalogue article[data-color="3"], .difficulty-chips [data-color="3"] { --card-accent: var(--chart-amber); }
.catalogue article[data-color="4"], .difficulty-chips [data-color="4"] { --card-accent: var(--chart-violet); }
.catalogue article[data-color] { border-top: 2px solid var(--card-accent); }
.catalogue article:hover { background: #171d24; }
.catalogue h2 { font-size: 24px; line-height: 1.12; }
.catalogue-head { gap: 12px; align-items: center; }
.catalogue-head img { width: 56px; height: 56px; flex: 0 0 auto; }
.catalogue-head .category-icon { width: 48px; height: 48px; margin: 0; }
.category-label { display: inline-block; font-size: 13px; color: var(--card-accent, var(--muted)); margin-top: 4px; }
.catalogue-head .civ-flag { object-fit: contain; }
.catalogue article p { font-size: 16px; line-height: 1.4; margin-block: 12px; }
.catalogue details { font-size: 15px; }
.catalogue summary { color: var(--chart-cyan); min-height: 36px; }
.catalogue label { margin-top: 14px; font-size: 14px; }
.catalogue select { font-size: 15px; padding: 9px 10px; width: 100%; }
.level-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.level-step { display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; min-height: 42px; padding: 0; border: 2px solid #6c7b8e; border-radius: 50%; background: var(--ink); color: var(--muted); font-size: 15px; font-weight: 700; transition: background-color 140ms, border-color 140ms, color 140ms; }
.level-step .ui-icon { width: 20px; height: 20px; margin: 0; stroke-width: 2.2; }
.level-step:hover { background: #2c241d; border-color: var(--gold-soft); color: var(--gold-soft); }
.level-step[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.level-step[aria-pressed="true"]:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.level-step:active:not(:disabled) { transform: scale(.94); }
.level-clear { min-height: 42px; border: 0; background: transparent; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.level-clear:hover { background: var(--raised); color: var(--text); }
.level-choice-summary { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.level-choice-summary strong { color: var(--text); }
.level-choice-summary span { display: block; margin-top: 6px; }
.talent-effect { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.talent-effect > strong { color: var(--card-accent, var(--chart-amber)); font-size: 18px; }
.talent-effect p { margin: 6px 0; }
.tier-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.tier-buttons button { min-height: 40px; padding: 8px 11px; font-size: 14px; }
.tier-buttons button[aria-pressed="true"] { background: #271e35; color: var(--chart-violet); border-color: var(--chart-violet); }
.difficulty-toggle { min-height: 48px; min-width: 135px; align-self: end; }
.score-band-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.score-band-buttons button { min-height: 42px; padding: 9px 8px; font-size: 14px; line-height: 1.25; }
.score-band-buttons button[aria-pressed="true"] { color: var(--chart-blue); border-color: var(--chart-blue); background: #1b2531; }
.data-methods { max-width: 1120px; margin-inline: auto; }
.methods-tabs { margin: 20px 0; }
.methods-tabs button { flex: 0 1 auto; padding-inline: 16px; font-size: 16px; }
.methods-panel { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); padding: 22px; }
.methods-panel h2 { font-size: 28px; margin: 0 0 14px; }
.method-list { display: grid; }
.method-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.method-row:first-child { padding-top: 0; }
.method-row:last-child { border-bottom: 0; padding-bottom: 0; }
.method-row > .ui-icon { width: 24px; height: 24px; margin-top: 3px; color: var(--tone, var(--chart-cyan)); }
.method-row h3 { font-size: 21px; margin: 0 0 6px; }
.method-row p { font-size: 16px; line-height: 1.45; margin: 0; }
.source-list { padding-left: 22px; font-size: 16px; }
.source-list li { margin: 10px 0; }
.method-note { font-size: 14px; line-height: 1.45; color: var(--muted); margin-bottom: 0; }
.difficulty-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.difficulty-chips span { display: inline-block; padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); color: var(--card-accent, var(--text)); font-size: 14px; }
.guide-compact h2 { margin-top: 24px; font-size: 28px; }
.guide-compact h2:first-child { margin-top: 0; }
.guide-compact h2 .ui-icon { color: var(--chart-cyan); width: 24px; height: 24px; }
.budget { padding: 10px 16px; gap: 16px; }
.budget strong { font-size: 28px; }
.budget + p.small { margin: 6px 0; font-size: 12px; line-height: 1.4; }
.budget meter { accent-color: var(--chart-violet); }
.budget meter::-webkit-meter-optimum-value { background: var(--chart-violet); }
.budget meter::-moz-meter-bar { background: var(--chart-violet); }
/* The header scrolls normally. Keep the live budget within the perk list. */
#library-content { --perk-budget-clearance: 7rem; }
#library-content > .budget {
  position: sticky;
  top: max(var(--crucible-sticky-header-offset, 0px), env(safe-area-inset-top, 0px));
  z-index: 8;
  isolation: isolate;
  min-width: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
#library-content > .budget #budget-state { font-weight: 700; }
#library-content > .budget ~ :is(.library-toolbar, .catalogue) :is(a, button, input, select, textarea, summary, [tabindex]) {
  scroll-margin-block-start: calc(var(--perk-budget-clearance) + max(var(--crucible-sticky-header-offset, 0px), env(safe-area-inset-top, 0px)));
}
/* Reserve the bar in native focus scrolling; older engines retain the margin fallback. */
@supports selector(html:has(body)) {
  html:has(#library-content > .budget) {
    scroll-padding-block-start: calc(7rem + max(var(--crucible-sticky-header-offset, 0px), env(safe-area-inset-top, 0px)));
  }
  #library-content > .budget ~ :is(.library-toolbar, .catalogue) :is(a, button, input, select, textarea, summary, [tabindex]) {
    scroll-margin-block-start: 12px;
  }
}
.compare-tray { gap: 12px; }
.compare-tray .ui-icon { color: var(--gold-soft); }
.compare-grid { gap: 18px; }
.compare-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 4px; }
.compare-grid article:first-child { border-top: 2px solid var(--chart-blue); }
.compare-grid article:last-child { border-top: 2px solid var(--chart-violet); }
.boon-inspector { border-top: 2px solid var(--chart-violet); }
.boon-inspector h3 img { width: 48px; height: 48px; }

/* Decorative game artwork may move; scores and text never drift. */
.motion-object { transform-origin: center; }
.motion-on .motion-object { animation: game-art-float 4.6s ease-in-out infinite alternate; animation-play-state: paused; }
.motion-on .motion-object.is-motion-visible { animation-play-state: running; }
.motion-on .motion-object:nth-child(2n) { animation-delay: -2.2s; }
.motion-on .motion-object:nth-child(3n) { animation-delay: -1.1s; }
.motion-paused .motion-object, [data-motion="paused"] .motion-object, body[data-page-hidden="true"] .motion-object { animation-play-state: paused !important; }
.chart-animate .histogram-bar { transform-box: fill-box; transform-origin: center bottom; animation: chart-arrive 320ms var(--motion-ease); }
@keyframes intel-reveal { from { opacity: .75; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chart-arrive { from { opacity: .65; transform: scaleY(.9); } to { opacity: 1; transform: scaleY(1); } }
@keyframes game-art-float { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-5px) rotate(1deg); } }

@media (max-width: 1320px) {
  .board-workspace { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
  .analytics-rail, .board-intel { --panel-space: 16px; }
  .board-main .table-wrap th, .board-main .table-wrap td { padding-inline: 10px; }
  .board-main .boon-trigger { min-width: 30px; }
  .board-main .boons img { width: 28px; height: 28px; }
  .loadout-grid, .boon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Keep every perk and boon column readable before the side rail squeezes the
   full standings table below its intrinsic width. The rail remains below it. */
@media (max-width: 1200px) {
  .board-workspace { grid-template-columns: minmax(0, 1fr); }
  .board-workspace .analytics-rail { position: static; }
  .board-workspace .analytics-rail .intel-tabs { justify-content: start; }
  .board-workspace .intel-tabs button { flex: 0 1 auto; min-width: 100px; padding-inline: 14px; }
  .board-workspace .histogram { max-width: 600px; }
}
@media (max-width: 1120px) {
  main { padding-inline: 26px; }
  .board-workspace { grid-template-columns: minmax(0, 1fr); }
  .analytics-rail, .board-intel { position: static; }
  .analytics-rail .intel-tabs, .board-intel .intel-tabs { justify-content: start; }
  .intel-tabs button { flex: 0 1 auto; min-width: 100px; padding-inline: 14px; }
  .histogram { max-width: 600px; }
  .profile-layout, .record-workspace { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .profile-actions { flex-basis: 290px; }
  .catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-main .boons img { width: 32px; height: 32px; }
  .board-main .boon-trigger { min-width: 36px; }
}
@media (max-width: 800px) {
  .board-pagination { flex-wrap: wrap; }
  .library-toolbar { flex-wrap: wrap; }
  .library-toolbar .library-filter { flex-basis: 100%; }
  .library-toolbar .library-pager { width: 100%; flex-wrap: wrap; }
  .profile-hero, .profile-banner { align-items: start; flex-direction: column; gap: 16px; }
  .profile-actions { flex-basis: auto; justify-content: start; }
  .profile-layout, .record-workspace, .lab-layout { grid-template-columns: minmax(0, 1fr); }
  .profile-rail, .record-aside { padding: 18px; }
  .profile-identity h1, .profile-hero h1, .profile-banner h1 { font-size: 36px; }
  .lab-controls, .score-lab-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-controls > p, .score-lab-controls > p, .lab-controls > .full, .score-lab-controls > .full { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  main { padding-inline: 18px; padding-top: 20px; }
  main > h1 { font-size: 34px; }
  .site-header { padding-inline: 18px; gap: 12px; }
  .site-header nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .site-header nav a { flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 44px; font-size: 12px; text-align: center; }
  .site-header nav a > .ui-icon { width: 15px; height: 15px; }
  .site-header nav a[aria-current="page"]::after { bottom: -6px; }
  .site-header .motion-toggle { margin-left: auto; padding: 7px; gap: 4px; font-size: 12px; }
  .site-header .staff-link { margin-left: 0; padding-left: 12px; gap: 4px; font-size: 12px; }
  .section-lead { font-size: 17px; margin-bottom: 16px; }
  .competition-head h1 { font-size: 32px; }
  .challenge-art { width: 60px; height: 60px; }
  .competition-head .challenge-art { margin-right: 12px; }
  .challenge-heading, .challenge-identity, .competition-identity { gap: 12px; }
  .challenge-heading .challenge-art, .challenge-identity .challenge-art, .competition-identity .challenge-art { margin: 0; }
  .competition-head .challenge-strip { margin-top: 14px; }
  .competition-head .challenge { min-height: 56px; padding: 9px 11px; }
  .competition-head .challenge span { font-size: 17px; }
  .challenge .challenge-art { width: 30px; height: 30px; margin-right: 8px; }
  .proof-notice { font-size: 12px; line-height: 1.4; padding-block: 8px; }
  .compact-controls { gap: 10px; }
  .compact-controls label:nth-child(2) { width: auto; }
  .compact-controls > button { padding-inline: 11px; }
  .board-workspace { gap: 20px; }
  .board-main .table-wrap th, .board-main .table-wrap td { padding-inline: 7px; }
  .board-main .table-wrap th:nth-child(2) { width: auto; }
  .board-main .table-wrap th:nth-child(3) { min-width: 72px; }
  .board-main .score { font-size: 20px; }
  .rank .ui-icon { width: 12px; height: 12px; display: block; margin: 0 0 3px; }
  .analytics-rail, .board-intel { padding: 16px; }
  .intel-tabs button { flex: 1; min-width: 0; padding-inline: 5px; font-size: 14px; }
  .intel-tabs button .ui-icon { width: 16px; height: 16px; margin-right: 3px; }
  .profile-hero, .profile-banner { margin-block: 18px; padding-bottom: 18px; }
  .profile-identity { gap: 12px; }
  .profile-avatar { width: 60px; height: 60px; padding: 6px; font-size: 24px; }
  .profile-avatar > .ui-icon { width: 32px; height: 32px; }
  .profile-identity h1, .profile-hero h1, .profile-banner h1 { font-size: 30px; }
  .profile-identity p, .profile-hero p, .profile-banner p { font-size: 13px; }
  .profile-actions { width: 100%; gap: 8px; }
  .profile-actions button, .profile-actions .button { flex: 1 1 auto; font-size: 14px; padding-inline: 10px; }
  .record-tabs button { flex: 1; padding: 10px 8px; font-size: 16px; }
  .view-tabs { gap: 0; }
  .view-tabs button { flex: 1; padding: 10px 8px; font-size: 15px; }
  .profile-stats { gap: 16px 24px; padding-bottom: 18px; }
  .profile-stat { min-width: 90px; }
  .stat-value { font-size: 27px; }
  .stat-label { font-size: 13px; }
  .record-score { font-size: 40px; }
  .section-heading { display: block; }
  .section-heading .small { display: block; margin-top: 5px; }
  .section-heading h2, .player-detail > h2 { font-size: 24px; }
  .loadout-grid, .boon-grid { gap: 8px; }
  .loadout-item, .boon-grid > button { flex-direction: column; align-items: start; padding: 12px; gap: 8px; }
  .loadout-icon, .boon-grid > button > img { width: 48px; height: 48px; }
  .loadout-copy strong, .loadout-copy .name, .boon-grid > button strong { font-size: 17px; }
  .loadout-copy small, .boon-grid > button small { font-size: 13px; }
  .lab-controls, .score-lab-controls { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .lab-chart { padding: 16px; }
  .lab-chart h2 { font-size: 23px; }
  .lab-heading h1, .methods-heading h1 { font-size: 34px; }
  .lab-heading > p, .methods-heading > p { font-size: 17px; }
  .lab-heading, .library-heading { display: block; margin-bottom: 16px; }
  .lab-heading > .lab-warning { max-width: none; margin: 12px 0 0; font-size: 14px; }
  .lab-heading > div > p { font-size: 17px; }
  .library-heading h1 { font-size: 34px; }
  .library-heading > .button { display: inline-flex; align-items: center; margin-top: 12px; }
  .library-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .library-toolbar .library-filter { min-width: 0; }
  .histogram text { font-size: 22px; }
  .library-pager { margin-block: 12px; gap: 10px; }
  .library-pager button { padding-inline: 11px; font-size: 14px; }
  .page-size-buttons button { padding-inline: 8px; font-size: 12px; }
  .board-pagination > div:last-child, .library-pager > div:last-child { width: 100%; justify-content: space-between; }
  .tabs { gap: 6px; }
  .tabs button { padding: 8px 10px; font-size: 14px; }
  .tabs button .ui-icon { width: 17px; height: 17px; }
  .catalogue { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .catalogue article { padding: 16px; }
  .catalogue h2 { font-size: 23px; }
  .catalogue-head img { width: 52px; height: 52px; }
  .methods-tabs button { flex: 1; padding-inline: 9px; font-size: 14px; }
  .methods-panel { padding: 16px; }
  .methods-panel h2 { font-size: 24px; }
  .method-row { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
  .method-row > .ui-icon { width: 21px; height: 21px; }
  .level-buttons { gap: 7px; }
  .difficulty-toggle { min-width: 0; }
  .budget { padding: 14px; gap: 12px; }
  .budget strong { font-size: 26px; }
  .compare-grid { gap: 10px; }
  .compare-grid article { padding: 15px 12px; }
  .compare-grid .score { font-size: 28px; }
  .compare-tray { gap: 8px; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .library-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
  .library-heading > div { min-width: 0; }
  .library-heading h1 { margin: 0; font-size: 30px; line-height: 1.08; }
  .library-heading h1 .ui-icon { width: 24px; height: 24px; margin-right: 5px; }
  .library-heading .section-lead { display: none; }
  .library-heading > .button { flex: 0 0 auto; max-width: 126px; min-height: 40px; margin: 0; padding: 7px 8px; gap: 4px; font-size: 12px; line-height: 1.2; white-space: normal; }
  .library-heading > .button .ui-icon { width: 16px; height: 16px; margin: 0; }
  .library-heading + .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
  .library-heading + .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 40px; padding: 6px 4px; font-size: 13px; line-height: 1.15; }
  .library-heading + .tabs button .ui-icon { width: 15px; height: 15px; margin: 0; }
  .budget { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 12px; }
  .budget > div { grid-column: 1; grid-row: 1; width: auto; font-size: 14px; line-height: 1.2; white-space: normal; }
  .budget strong { font-size: 24px; }
  .budget span { margin-top: 2px; font-size: 12px; }
  .budget > meter { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; height: 8px; }
  .budget > button { grid-row: 1; min-height: 40px; padding: 6px 8px; font-size: 12px; line-height: 1.2; }
  .budget > button:nth-last-child(2) { grid-column: 2; }
  .budget > button:last-child { grid-column: 3; }
  .budget + p.small { margin: 4px 0; font-size: 12px; line-height: 1.3; }
  #library-content { --perk-budget-clearance: 8rem; }
  html:has(#library-content > .budget) {
    scroll-padding-block-start: calc(8rem + max(var(--crucible-sticky-header-offset, 0px), env(safe-area-inset-top, 0px)));
  }
  .library-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 7px; margin: 8px 0 10px; }
  .library-toolbar .library-filter { width: 100%; margin: 0; }
  .library-filter label { gap: 4px; font-size: 13px; }
  .library-filter input { min-height: 40px; padding: 7px 10px; }
  .library-pager, .library-toolbar .library-pager, .board-pagination { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin: 6px 0; padding: 5px 0; }
  .library-toolbar .library-pager { margin: 0; }
  .library-pager > .page-size-buttons, .board-pagination > .page-size-buttons { gap: 3px; }
  .library-pager .page-size-buttons button, .board-pagination .page-size-buttons button { min-height: 40px; padding: 5px 6px; font-size: 12px; line-height: 1.15; }
  .library-pager > span, .board-pagination > span { flex: 1 1 auto; min-width: 0; text-align: center; white-space: normal; font-size: 12px; line-height: 1.2; }
  .library-pager > div:last-child, .board-pagination > div:last-child { flex: 0 0 auto; width: auto; gap: 4px; justify-content: initial; }
  .library-pager > div:last-child button, .board-pagination > div:last-child button { display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; }
  .library-pager > div:last-child .ui-icon, .board-pagination > div:last-child .ui-icon { width: 18px; height: 18px; margin: 0; }
  .library-pager .pager-word, .board-pagination .pager-word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .motion-on .motion-object, .intel-pane, .chart-animate .histogram-bar { animation: none !important; }
  .loadout-icon, .boon-grid > button > img, .tool-links .ui-icon, .challenge, .histogram-bar, .score-lab .chart-dot, .level-step { transition: none !important; }
  .loadout-item:hover .loadout-icon, .boon-grid > button:hover > img, .tool-links > a:hover .ui-icon, .tool-links > button:hover .ui-icon, button:active:not(:disabled), .button:active, .level-step:active:not(:disabled) { transform: none !important; }
}

/* Automatic public-source review: observed facts, separate from human verdicts. */
.review-badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 4px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--blue); font-size: 14px; line-height: 1.2; text-decoration: none; transition: background-color 160ms ease-out, border-color 160ms ease-out; }
.review-badge .ui-icon { flex: 0 0 14px; width: 14px; height: 14px; margin: 0; }
.review-badge[data-state="suspicious"], .review-coverage-status[data-state="suspicious"] { color: var(--gold-soft); }
a.review-badge:hover { background: var(--raised); border-color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
a.review-badge:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.auto-review-panel { min-width: 0; }
.auto-review-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.auto-review-heading h2, .auto-review-heading h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 26px; line-height: 1.15; }
.auto-review-heading h3 { font-size: 26px; }
.auto-review-heading p { max-width: 70ch; margin: 7px 0 0; font-size: 16px; }
.auto-review-heading > .small { flex: 0 0 auto; max-width: 26ch; text-align: right; }
.review-scope { margin: 14px 0; padding: 10px 12px; background: var(--raised); color: var(--text); font-size: 16px; }
.review-coverage, .review-scanner-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.review-coverage > div, .review-scanner-counts > div { min-width: 0; }
.review-coverage dt, .review-scanner-counts dt { color: var(--muted); font-size: 14px; }
.review-coverage dd, .review-scanner-counts dd { margin: 3px 0 0; color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.review-coverage > div:last-child dd { font-size: 16px; }
.auto-review-panel .section-heading h3 { margin: 0; font-size: 26px; }
.review-source { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.review-source > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.review-source h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.review-source header p { margin: 3px 0 12px; color: var(--muted); font-size: 14px; }
.review-findings { margin: 0; padding: 0; list-style: none; }
.review-findings li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.review-resource { font-size: 14px; font-weight: 700; }
.review-findings [data-resource="food"] .review-resource { color: var(--forest); }
.review-findings [data-resource="wood"] .review-resource { color: var(--chart-amber); }
.review-findings [data-resource="gold"] .review-resource { color: var(--gold-soft); }
.review-findings [data-resource="stone"] .review-resource { color: var(--silver); }
.review-findings strong { font-size: 16px; }
.review-findings p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.review-time, .review-values { font-variant-numeric: tabular-nums; }
.review-values { text-align: right; font-size: 18px; white-space: nowrap; }
.review-values small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.review-empty { padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.review-limit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-coverage-status { margin-bottom: 6px; font-weight: 700; }
.automatic-scanner { margin: 20px 0; padding: 18px 20px; background: var(--surface); }
.review-scanner-counts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.review-scanner-counts .is-running dd { color: var(--gold-soft); }
.automatic-scanner > .small { margin: 10px 0 0; }
#scanner-update-status:empty { display: none; }
@media (max-width: 800px) {
  .auto-review-heading { display: block; }
  .auto-review-heading > .small { display: block; max-width: none; margin-top: 8px; text-align: left; }
  .review-scanner-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .auto-review-heading h2 { font-size: 26px; }
  .review-coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .review-coverage > div:last-child { grid-column: 1 / -1; }
  .review-source > header { display: block; }
  .review-source > header > .small { display: block; margin-bottom: 10px; }
  .review-findings li { grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 6px 10px; }
  .review-values { grid-column: 2; text-align: left; white-space: normal; }
  .review-values small { display: inline; margin-left: 6px; }
  .automatic-scanner { padding: 16px 12px; }
  .review-scanner-counts { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .review-badge { transition: none; }
}

.standings-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.standings-groups button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; background: var(--surface); color: var(--muted); }
.standings-groups button > .ui-icon { width: 16px; height: 16px; margin: 0; }
.standings-groups button b { min-width: 1.7em; text-align: center; border-radius: 3px; background: var(--raised); color: var(--text); font-size: .85em; font-variant-numeric: tabular-nums; }
.standings-groups button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-soft); }
.standings-groups button[data-group="confirmed"][aria-pressed="true"] { border-color: var(--red); color: var(--red); }
tr[data-set-aside] .rank { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
tr[data-set-aside] .organizer-label { display: block; width: fit-content; margin-top: 2px; line-height: 1.25; }
.board-main .combined-standings th:nth-child(-n+2),.board-main .combined-standings td:nth-child(-n+2) { width: 4.1em; min-width: 0; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.board-main .combined-standings th:nth-child(3) { width: 29%; }
.combined-standings .feed-position { color: var(--muted); }
.combined-standings tr[data-set-aside] :is(.player,.score) { color: var(--muted); }
.combined-standings tr[data-set-aside] .player { text-decoration: line-through; text-decoration-thickness: 1px; }
@media (max-width: 600px) {
  .board-main .combined-standings :is(th,td):nth-child(-n+2) { width: 2.8em; padding-inline: 3px; }
  .board-main .combined-standings th:nth-child(3) { width: auto; min-width: 60px; }
  .combined-standings .active-position .ui-icon { width: 11px; margin-right: 1px; }
}
@media (max-width: 580px) {
  .standings-groups button { min-height: 44px; padding: 5px 8px; font-size: 14px; }
  .standings-groups button > .ui-icon { display: none; }
}

/* Gold round perk art and a single Favor total alongside square boon icons. */
.mobile-run-perks { display: none; }
.board-main .combined-standings .run-perk-column { padding-inline: 6px; }
.run-perk-trigger { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 100%; padding: 3px 5px; border: 1px solid transparent; background: transparent; text-align: left; line-height: 1.15; }
.run-perk-trigger:hover,.run-perk-trigger:focus-visible { background: var(--raised); border-color: var(--line); }
.perk-amount { color: var(--chart-amber); font-weight: 700; font-size: 14px; white-space: normal; }
.perk-allowance { color: var(--muted); font-size: 12px; font-weight: 400; }
.perk-token-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; width: 156px; max-width: 100%; }
.perk-token-row small { font-size: 12px; color: var(--muted); }
.run-perk-token { position: relative; display: inline-grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; }
.run-perk-token img { display: block; width: 30px; height: 30px; border-radius: 50%; }
.run-perk-token b { position: absolute; right: -1px; bottom: -1px; min-width: 11px; padding: 0 2px; border-radius: 5px; background: var(--ink); color: var(--text); text-align: center; font-size: 11px; line-height: 12px; }
.loadout-sheet { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(28rem,100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--text); }
.loadout-sheet[open] { display: flex; flex-direction: column; }
.loadout-sheet::backdrop { background: #06090bb8; }
.loadout-sheet header { padding: 20px 22px 15px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.loadout-sheet header p,.loadout-sheet h2 { margin: 0; overflow-wrap: anywhere; }
.loadout-sheet h2 { font-size: 32px; line-height: 1.2; }
.loadout-sheet header button { min-height: 44px; }
.perk-sheet-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 16px 22px 30px; }
.perk-summary { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.loadout-sheet .perk-summary { position: sticky; top: -16px; z-index: 1; padding: 12px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.perk-summary strong { color: var(--chart-amber); font-size: 23px; line-height: 1; }
.perk-summary span,.perk-line span { color: var(--muted); font-size: 14px; }
.listed-talent { display: grid; gap: 3px; margin: 0 0 14px; padding-left: 10px; border-left: 2px solid var(--chart-blue); line-height: 1.25; }
.listed-talent strong { font-size: 15px; color: var(--chart-blue); }
.listed-talent small { font-size: 13px; color: var(--muted); }
.perk-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 12px; }
.perk-picker button { position: relative; padding: 2px 4px; min-height: 42px; min-width: 42px; display: grid; place-items: center; font-size: 13px; }
.perk-picker button[data-choice="all"] { padding: 5px 9px; }
.perk-picker button[aria-pressed="true"] { color: var(--chart-amber); border-color: var(--chart-amber); }
.perk-picker button>b { position: absolute; right: 2px; bottom: 2px; background: var(--ink); min-width: 13px; line-height: 14px; border-radius: 3px; }
.record-perks,.perk-effects { list-style: none; margin: 0; padding: 0; }
.record-perks>li { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.perk-line { display: flex; gap: 10px; align-items: center; }
.perk-line>div { display: grid; line-height: 1.2; }
.perk-line>b { margin-left: auto; white-space: nowrap; color: var(--chart-amber); font-size: 15px; }
.perk-line img { flex: 0 0 40px; }
.perk-effects { margin: 6px 0 0 50px; display: grid; gap: 2px; }
.perk-effects li { display: flex; gap: 8px; font-size: 14px; color: var(--muted); line-height: 1.3; }
.perk-effects b { flex: 0 0 auto; color: var(--text); }
.record-boons-heading { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.perk-provenance { line-height: 1.35; }
.perk-effect-intro { margin: 5px 0 3px 50px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.perk-missing { margin-bottom: 12px; }
.run-perk-trigger.is-recorded { border-color: color-mix(in srgb,var(--cyan) 45%,var(--line)); }
.run-perk-trigger.is-recorded .perk-amount { color: var(--cyan); }
.perk-breakdown.is-recorded .perk-summary { border-top: 2px solid var(--cyan); }
.recorded-run-heading { display: grid; gap: 3px; padding: 12px 0; }
.recorded-run-heading span { font-size: 13px; color: var(--muted); }
.recorded-run-nav { display: flex; gap: 6px; justify-content: space-between; margin: 0 0 12px; }
.recorded-run-nav button { padding: 9px 10px; font-size: 13px; }
.recorded-run-picker:not([hidden]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-bottom: 14px; }
.recorded-run-picker button { display: grid; gap: 4px; text-align: left; font-size: 12px; }
.recorded-run-picker button b { color: var(--cyan); }
.recorded-run-picker button[aria-pressed="true"] { border-color: var(--cyan); background: var(--raised); }
.recorded-run-pending { padding: 12px; background: var(--raised); border-left: 2px solid var(--chart-amber); }
.perk-missing p { margin-bottom: 5px; }
.weekly-listing-link { display: grid; gap: 3px; justify-items: start; }
.run-perk-trigger.perk-check-trigger { color: var(--blue); font-size: 13px; padding: 6px; border-color: var(--line); }
@media (min-width: 951px) { .board-main .combined-standings th:nth-child(3) { width: auto; } }
@media (max-width: 950px) {
  .run-perk-column { display: none; }
  .mobile-run-perks { display: block; }
  .run-perk-trigger.compact { align-items: flex-start; justify-content: center; min-height: 26px; padding: 2px 5px; margin: 3px 0 0; background: var(--raised); }
  .run-perk-trigger.compact .perk-amount { white-space: normal; font-size: 12px; }
  .run-perk-trigger.compact .perk-allowance { font-size: 11px; }
  .run-perk-trigger.compact .perk-token-row { width: 132px; }
  .run-perk-trigger.compact .run-perk-token { flex-basis: 24px; width: 24px; height: 24px; }
  .run-perk-trigger.compact .run-perk-token img { width: 24px; height: 24px; }
}
