/* AInda dá? — interface. Tokens da marca em docs/brand/BRAND_GUIDELINES.md (D-005, D-024). */

@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-latin.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafaf7;
  --surface: #ffffff;
  --ink: #17191c;
  --ink-soft: #4a4e55;
  --ink-faint: #6b6f76;
  --rule: #e2e1db;
  --rule-strong: #17191c;
  --signal: #d9381e;
  --title: #17191c;
  --on-title: #f7f5ef;
  --libertadores: #1f4f99;
  --on-libertadores: #ffffff;
  --libertadores-soft: #e3ebf7;
  --sudamericana: #8a5300;
  --sudamericana-soft: #f6ead6;
  --danger: #b3261e;
  --danger-soft: #f8e1df;
  --draw: #6b6f76;
  --on-draw: #ffffff;
  --positive: #1f4f99;
  --series-4: #a3307c;
  --series-5: #3f7f3a;
  --focus: #17191c;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17191c;
    --surface: #1d2024;
    --ink: #f7f5ef;
    --ink-soft: #b9bbbf;
    --ink-faint: #8d9198;
    --rule: #30343a;
    --rule-strong: #f7f5ef;
    --signal: #ff6a4d;
    --title: #f7f5ef;
    --on-title: #17191c;
    --libertadores: #8fb2ee;
    --on-libertadores: #17191c;
    --libertadores-soft: #1b2840;
    --sudamericana: #e6ac58;
    --sudamericana-soft: #3a2b14;
    --danger: #f08a82;
    --danger-soft: #3d1c1a;
    --draw: #8d9198;
    --on-draw: #17191c;
    --positive: #8fb2ee;
    --series-4: #e48cc4;
    --series-5: #8fd18a;
    --focus: #f7f5ef;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #17191c;
  --surface: #1d2024;
  --ink: #f7f5ef;
  --ink-soft: #b9bbbf;
  --ink-faint: #8d9198;
  --rule: #30343a;
  --rule-strong: #f7f5ef;
  --signal: #ff6a4d;
  --title: #f7f5ef;
  --on-title: #17191c;
  --libertadores: #8fb2ee;
  --on-libertadores: #17191c;
  --libertadores-soft: #1b2840;
  --sudamericana: #e6ac58;
  --sudamericana-soft: #3a2b14;
  --danger: #f08a82;
  --danger-soft: #3d1c1a;
  --draw: #8d9198;
  --on-draw: #17191c;
  --positive: #8fb2ee;
  --series-4: #e48cc4;
  --series-5: #8fd18a;
  --focus: #f7f5ef;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -999px; }

/* Seletor de competições (D-039): uma linha acima do cabeçalho, igual nos sites de cada competição. */
.leagues { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-top: 8px; padding-bottom: 6px; font-size: 14px; border-bottom: 1px solid var(--rule); }
.leagues a { text-decoration: none; color: var(--ink-soft); padding: 2px 0; border-bottom: 2px solid transparent; font-weight: 500; }
.leagues a:hover { color: var(--ink); }
.leagues a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 650; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

/* Cabeçalho */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 18px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.brand img { height: 36px; width: auto; display: block; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.masthead nav a { text-decoration: none; color: var(--ink-soft); padding: 4px 0; border-bottom: 2px solid transparent; font-size: 15px; font-weight: 500; }
.masthead nav a:hover { color: var(--ink); }
.masthead nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 600; }
.reference-bar { font-size: 13px; color: var(--ink-soft); padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 2px 18px; }
.reference-bar strong { color: var(--ink); font-weight: 650; }
.pill { font-size: 13px; color: var(--ink-faint); font-style: italic; font-family: var(--serif); }

/* Texto */
main p, main li, main h1, main h3 { overflow-wrap: anywhere; }
main > p, main section > p, .summary-list li, .changes li, main > ul li { font-family: var(--serif); font-size: 17px; line-height: 1.55; }
main p.note { font-family: var(--sans); font-size: 13px; }
main.wrap { padding-top: 32px; padding-bottom: 56px; min-height: 60vh; }
h1, h2, h3 { font-family: var(--sans); line-height: 1.12; }
h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; max-width: 24ch; }
h2 { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; margin: 40px 0 10px; padding-top: 10px; border-top: 3px solid var(--rule-strong); }
h3 { font-size: 16px; font-weight: 650; color: var(--ink); margin: 0 0 8px; }
.kicker { display: block; font-size: 15px; font-weight: 500; color: var(--ink-soft); margin-bottom: 4px; }
.lede { font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink-soft); max-width: 62ch; margin: 0 0 20px; }
.lede strong { color: var(--ink); }
.note { font-size: 13px; color: var(--ink-faint); max-width: 75ch; }
code { font-family: var(--mono); font-size: .9em; }
code.data-version { overflow-wrap: anywhere; word-break: break-word; }

/* Blocos: seções com fio no topo, sem caixas */
.grid { display: grid; gap: 12px 40px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { border-top: 1px solid var(--rule-strong); padding: 12px 0 4px; }

/* Barras de chance */
.race-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr auto; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.race-row:last-child { border-bottom: 0; }
.race-row a { text-decoration: none; font-weight: 600; }
.race-row a:hover { text-decoration: underline; }
.bar-track { height: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--title); }
.bar-fill.lib { background: var(--libertadores); }
.bar-fill.danger { background: var(--danger); }
.bar-range { position: absolute; top: 0; bottom: 0; background: var(--libertadores); opacity: .3; }
.value { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; font-size: 15px; min-width: 64px; white-space: nowrap; }

/* Tabelas */
.table-scroll { overflow-x: auto; border-top: 1px solid var(--rule-strong); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 7px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
th { font-size: 12px; color: var(--ink-soft); font-weight: 600; background: var(--paper); position: sticky; top: 0; }
th.left, td.left { text-align: left; }
td.club a { text-decoration: none; font-weight: 600; }
td.club a:hover { text-decoration: underline; }
td.pos { color: var(--ink-faint); width: 34px; font-weight: 600; }
tr.zone-lib td.pos { box-shadow: inset 3px 0 0 var(--libertadores); }
tr.zone-sula td.pos { box-shadow: inset 3px 0 0 var(--sudamericana); }
tr.zone-z4 td.pos { box-shadow: inset 3px 0 0 var(--danger); }
tbody tr:hover td { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.prob { padding: 2px 6px; display: inline-block; min-width: 54px; }
.prob-lib { background: color-mix(in srgb, var(--libertadores) calc(var(--p) * 45%), transparent); }
.prob-title { background: color-mix(in srgb, var(--title) calc(var(--p) * 30%), transparent); }
.prob-sula { background: color-mix(in srgb, var(--sudamericana) calc(var(--p) * 45%), transparent); }
.prob-danger { background: color-mix(in srgb, var(--danger) calc(var(--p) * 45%), transparent); }
.range { font-size: 12px; color: var(--ink-faint); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-soft); margin: 8px 0 12px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.legend .l-lib::before { background: var(--libertadores); }
.legend .l-sula::before { background: var(--sudamericana); }
.legend .l-z4::before { background: var(--danger); }
.legend .l-home::before { background: var(--title); }
.legend .l-draw::before { background: var(--draw); }
.legend .l-away::before { background: var(--libertadores); }

/* Cenários */
.scenario-panel { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; margin: 16px 0; }
.scenario-panel fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.scenario-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.scenario-title { margin: 0 0 10px; font-weight: 600; font-size: 16px; }
.scenario-panel .note { margin: 10px 0 0; }
select { font: inherit; font-size: 15px; font-weight: 400; padding: 6px 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 0; min-width: 0; max-width: 100%; }
.scenario-panel select { width: 100%; }
.link-button { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; margin-left: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Partidas */
.match-day { margin-top: 24px; }
.match { display: grid; grid-template-columns: 1fr minmax(150px, 240px) 1fr; gap: 6px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.match .home { text-align: right; font-weight: 600; }
.match .away { font-weight: 600; }
.match .home a, .match .away a { text-decoration: none; }
.match .home a:hover, .match .away a:hover { text-decoration: underline; }
.triple { display: flex; height: 24px; font-size: 12px; font-weight: 700; overflow: hidden; gap: 2px; }
.triple span { display: flex; align-items: center; justify-content: center; min-width: 0; }
.triple .t-home { background: var(--title); color: var(--on-title); }
.triple .t-draw { background: var(--draw); color: var(--on-draw); }
.triple .t-away { background: var(--libertadores); color: var(--on-libertadores); }
.match-meta { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--ink-faint); }
.score-outlook { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 8px; margin-top: 4px; }
.score-label { color: var(--ink-faint); }
.score-chip { font-variant-numeric: tabular-nums; color: var(--ink); }
.score-chip strong, .goals-chance strong { font-weight: 650; }
.score-chip + .score-chip::before { content: "·"; color: var(--ink-faint); margin-right: 6px; }
.goals-chance { color: var(--ink); padding-left: 10px; border-left: 1px solid var(--rule); }
.score { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }

/* Gráficos e números */
.chart { width: 100%; max-width: 820px; height: auto; display: block; }
.chart text { fill: var(--ink-faint); font-size: 11px; font-family: var(--sans); }
.chart .axis { stroke: var(--rule); }
.stat-row { display: flex; flex-wrap: wrap; gap: 16px 36px; margin: 16px 0 4px; }
.stat { display: flex; flex-direction: column; }
.stat .label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.stat .big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--ink-faint); }
.club-picker { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.club-picker a { text-decoration: none; font-size: 14px; color: var(--ink-soft); padding: 2px 0; border-bottom: 2px solid transparent; }
.club-picker a:hover { color: var(--ink); }
.club-picker a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 700; }
.warning { border-left: 3px solid var(--sudamericana); background: var(--sudamericana-soft); padding: 10px 14px; font-size: 14px; margin: 16px 0; }
details.warning summary { cursor: pointer; }
details.warning summary::marker { color: var(--sudamericana); }
details.warning p { margin: 8px 0 0; }
.change-up { color: var(--positive); font-weight: 600; font-family: var(--sans); }
.change-down { color: var(--danger); font-weight: 600; font-family: var(--sans); }
.changes { list-style: none; padding: 0; margin: 0; }
.changes li { padding: 7px 0; border-bottom: 1px solid var(--rule); }

/* Cabeçalho de edição */
.reference-bar { justify-content: space-between; align-items: baseline; gap: 2px 24px; }
.reference-bar p { margin: 0; }
.edition { font-size: 14px; color: var(--ink-soft); }
.edition-name { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); }
.edition-facts { font-size: 13px; }

/* Mosaico do título */
.mosaic { margin: 8px 0 28px; }
.mosaic-swatch { display: inline-block; flex: none; width: 14px; height: 14px; margin-right: 6px; overflow: visible; }
.mosaic-chart { width: 100%; height: auto; display: block; max-width: 760px; }
.mosaic-chart.mosaic-blocks-1 { max-width: 240px; }
.mosaic-chart.mosaic-blocks-2 { max-width: 420px; }
.mosaic-legend { list-style: none; padding: 0; margin: 12px 0 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 22px; font-size: 15px; }
.mosaic-legend li { display: flex; align-items: center; gap: 2px; overflow-wrap: normal; min-width: 0; }
.mosaic-legend a { text-decoration: none; font-weight: 600; min-width: 0; }
.mosaic-legend a:hover { text-decoration: underline; }
.mosaic-legend .club-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mosaic-legend strong { margin-left: auto; padding: 0 12px 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mosaic figcaption .note { margin: 4px 0 0; }
main p.mosaic-key { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }
.mosaic-key strong { color: var(--ink); font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 16px; }

/* Anotações e rótulos diretos nos gráficos */
.annotation path { stroke: var(--ink-soft); stroke-width: 1; }
.annotation circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart .annotation text { font-family: var(--serif); font-style: italic; font-size: 12.5px; fill: var(--ink-soft); }
.chart .annotation text, .chart .series-end { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart .series-end { font-family: var(--sans); font-size: 12px; font-weight: 650; }

/* Destaques editoriais (insights publicados) */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 40px; margin: 8px 0 28px; }
.highlight { border-top: 1px solid var(--rule-strong); padding-top: 12px; }
.highlight h3 { font-size: 19px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 6px; }
main .highlight p { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 8px; }
main p.highlight-links { font-family: var(--sans); font-size: 14px; color: var(--ink); margin: 0 0 4px; }
main > p.highlight-links { margin: -8px 0 24px; }
.highlights-block { margin-bottom: 8px; }

/* Escolha de disputa (home) e de visão (tabela) */
.race-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 22px; }
.race-switch .note { margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--ink); }
.segmented a { font-size: 14px; font-weight: 600; padding: 7px 16px; text-decoration: none; color: var(--ink); }
.segmented a + a { border-left: 1px solid var(--ink); }
.segmented a:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.segmented a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.segmented a { display: inline-flex; align-items: center; justify-content: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Aba da rodada (D-037, versão enxuta do ADR-0009) */
.round-update { margin: 0 0 8px; }
.round-update .note { margin: 0 0 6px; }
.round-updated strong { color: var(--ink-soft); font-weight: 600; }
.round-day { margin: 18px 0 0; }
.round-day h3 { margin: 0 0 4px; }
main ol.round-matches { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.round-match { display: grid; grid-template-columns: 3.5rem 9.5rem minmax(0, 1fr) 4rem minmax(0, 1fr); grid-template-areas: "time status home center away" ". . meta meta meta"; align-items: center; column-gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: 15px; }
.rm-time { grid-area: time; font-variant-numeric: tabular-nums; font-weight: 600; }
.rm-status { grid-area: status; font-size: 13px; color: var(--ink-soft); }
.rm-status-alert { color: var(--sudamericana); font-weight: 650; }
.rm-home { grid-area: home; justify-self: end; text-align: right; }
.rm-away { grid-area: away; justify-self: start; }
.rm-home a, .rm-away a { font-weight: 600; }
.rm-center { grid-area: center; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-faint); }
.is-finished .rm-center { color: var(--ink); font-size: 17px; }
.is-postponed .rm-center { font-size: 13px; font-weight: 650; color: var(--sudamericana); }
main .round-match p.rm-meta { grid-area: meta; margin: 4px 0 0; font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--ink-faint); }
.round-changes caption { caption-side: top; text-align: left; font-size: 13px; color: var(--ink-soft); padding: 8px 0 4px; }
.round-changes th[scope="row"] { font-size: 14px; color: var(--ink); background: transparent; position: static; font-weight: 600; }
.round-changes td { vertical-align: top; }
.round-changes .range { display: block; }
.race-heading { border-top: 0; margin-top: 8px; padding-top: 0; font-size: 26px; }
.lede-method { color: var(--ink-faint); font-size: 16px; }

.table-tabs { display: flex; flex-wrap: wrap; gap: 4px 36px; margin: 8px 0 14px; border-bottom: 1px solid var(--rule); }
.tabs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; }
.tabs-label { font-size: 13px; color: var(--ink-faint); font-family: var(--serif); font-style: italic; }
.tabs a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 6px 0; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.standings th.view-start, .standings td.view-start { border-left: 1px solid var(--rule-strong); padding-left: 12px; }
.sort-button { font: inherit; font-size: 12px; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.sort-button:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 3px; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }
.sort-mark { display: inline-block; min-width: 10px; margin-left: 2px; font-size: 9px; color: var(--signal); }
.rank { font-size: 11px; color: var(--ink-faint); font-weight: 500; }
.difficulty { display: inline-block; min-width: 36px; padding: 2px 6px; font-weight: 700; background: color-mix(in srgb, var(--danger) calc(var(--d) * 40%), transparent); }
.upcoming { display: inline-flex; gap: 8px; }
.upcoming-match { display: inline-flex; align-items: center; gap: 2px; }
.upcoming-match.rated { padding: 2px 3px; background: color-mix(in srgb, var(--danger) calc(var(--d) * 32%), transparent); }
main p.upcoming-line { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.venue { font-size: 10px; font-weight: 700; color: var(--ink-faint); }
td.club .club-cell { gap: 8px; }

/* Clubes */
.club-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); border-top: 1px solid var(--rule-strong); }
main > ul.club-grid li { font-family: var(--sans); font-size: 15px; }
.club-tile { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 14px 8px 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.club-tile .crest, .club-tile .crest-spacer { grid-row: 1 / 3; }
.club-tile-name { font-weight: 650; line-height: 1.2; overflow-wrap: normal; hyphens: manual; }
.club-tile-meta { font-size: 12px; color: var(--ink-faint); }
.club-tile:hover .club-tile-name { text-decoration: underline; text-decoration-color: var(--signal); }
.club-strip { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 10px; margin: 0 0 22px; border-bottom: 1px solid var(--rule); scrollbar-width: thin; }
.club-strip a { flex: none; display: inline-flex; padding: 5px; border-bottom: 3px solid transparent; opacity: .55; }
.club-strip a:hover, .club-strip a:focus-visible { opacity: 1; }
.club-strip a[aria-current="page"] { opacity: 1; border-bottom-color: var(--signal); }
.club-heading { display: flex; align-items: center; gap: 14px; }
.postponed { color: var(--sudamericana); font-weight: 650; }
.match .home .club-cell { justify-content: flex-end; }

/* Rodapé */
.site-footer { border-top: 3px solid var(--rule-strong); padding-top: 16px; padding-bottom: 40px; font-size: 13px; line-height: 1.5; color: var(--ink-faint); display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.site-footer img { width: 28px; height: auto; display: block; }
.site-footer p { margin: 0 0 8px; max-width: 80ch; }
.site-footer .footer-name { color: var(--ink); font-weight: 700; font-size: 14px; }
.footer-tagline { font-weight: 400; color: var(--ink-soft); margin-left: 6px; }
.footer-facts { display: grid; gap: 6px; margin: 0 0 10px; max-width: 80ch; }
.footer-facts div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.footer-facts dt { font-weight: 650; color: var(--ink-soft); }
.footer-facts dd { margin: 0; }
.site-footer a { color: var(--ink-soft); }
.site-footer .footer-small { font-size: 12px; }

@media (max-width: 560px) {
  .brand img { height: 32px; }
  .race-row { grid-template-columns: 96px 1fr auto; gap: 10px; }
  .value { min-width: 48px; font-size: 14px; }
  .match { grid-template-columns: 1fr 1fr; }
  .match .triple-cell { grid-column: 1 / -1; order: 3; }
  .match .match-meta, .match .impact-row { order: 4; }
  .match .home { text-align: left; }
  .match .home .club-cell { justify-content: flex-start; }
  .goals-chance { border-left: 0; padding-left: 0; flex-basis: 100%; text-align: center; }
  .segmented a { padding: 7px 12px; }
  .segmented.has-round { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .segmented.has-round a { min-height: 44px; padding: 7px 8px; }
  .segmented.has-round a:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--ink); }
  .segmented.has-round a:nth-child(2) { border-left: 0; }
  .round-match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "time time status" "home center away" "meta meta meta"; row-gap: 6px; }
  .rm-status { justify-self: end; text-align: right; }
  .rm-home { justify-self: start; text-align: left; }
  .rm-away { justify-self: end; text-align: right; }
  .rm-home .club-cell, .rm-away .club-cell { align-items: flex-start; }
  .match .away { text-align: right; }
  .lede { font-size: 17px; }
  .stat .big { font-size: 28px; }
}

/* Rodada a rodada */
.move-bar { fill: var(--title); opacity: .35; }
.move-bar.strength { fill: var(--sudamericana); }
.move-bar.current { opacity: 1; }
a:hover > .move-bar, a:focus-visible > .move-bar { opacity: .8; }
.swatch { display: inline-block; width: 10px; height: 10px; vertical-align: middle; }
.swatch-results { background: var(--title); }
.swatch-strength { background: var(--sudamericana); }
.round-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0; }
.round-nav label { font-size: 14px; font-weight: 600; }
.round-nav select { margin-left: 6px; max-width: 100%; padding: 5px 6px; }
.button { display: inline-block; padding: 7px 12px; border: 1px solid var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.button:hover { background: var(--ink); color: var(--paper); }
.metric-picker { display: inline-flex; border: 1px solid var(--ink); margin: 4px 0 8px; }
.metric-picker button { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 16px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.metric-picker button + button { border-left: 1px solid var(--ink); }
.metric-picker button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.summary-list { margin: 0; padding-left: 20px; }
.summary-list li { margin: 7px 0; }
.impact-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: center; font-size: 13px; }
.impact-label { color: var(--ink-soft); }
.chip { display: inline-block; padding: 1px 7px; border: 1px solid var(--rule); background: var(--surface); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .round-nav { justify-content: center; }
  .round-nav label { order: -1; width: 100%; text-align: center; }
  .metric-picker { display: flex; }
  .metric-picker button { flex: 1; padding: 7px 8px; }
}

/* Como o Elo é calculado e abas por competição (D-040). */
.formula { font-family: var(--sans); font-size: 15px; background: var(--surface); border-left: 3px solid var(--rule); padding: 8px 12px; overflow-x: auto; }
.elo-title { font-size: 18px; margin: 28px 0 8px; }
.method-tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--rule); margin: 8px 0 14px; }
.method-tabs button { font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; color: var(--ink-soft); cursor: pointer; }
.method-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 650; }
.method-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0 0 12px; }
.method-facts div { border-top: 3px solid var(--ink); padding-top: 6px; }
.method-facts dt { font-size: 13px; color: var(--ink-soft); }
.method-facts dd { margin: 2px 0 0; font-weight: 650; }
.method-list { font-family: var(--serif); font-size: 16px; padding-left: 20px; }
.method-list li { margin: 4px 0; }
.elo-examples-title { font-size: 16px; margin: 22px 0 8px; }
.elo-examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px 32px; }
.elo-example { border-top: 1px solid var(--rule-strong, var(--ink)); padding-top: 10px; min-width: 0; }
.elo-example h5 { font-size: 17px; margin: 0 0 6px; line-height: 1.3; }
.elo-match-title { font-size: 16px; margin: 18px 0 6px; }
.elo-details { margin: 6px 0 10px; font-family: var(--sans); font-size: 14px; }
.elo-details summary { cursor: pointer; font-weight: 600; }
main .elo-details p { font-family: var(--sans); font-size: 14px; }
.elo-table { font-size: 13px; margin: 6px 0; }
.elo-table td, .elo-table th { padding: 4px 6px; }
.elo-venue { color: var(--ink-faint); font-size: 12px; }
.elo-up { color: var(--positive, var(--up, #1f4f99)); font-weight: 600; }
.elo-down { color: var(--danger, var(--down, #b3261e)); font-weight: 600; }
.elo-country { font-size: 13px; font-weight: 500; color: var(--ink-faint); }
main .elo-example p { font-family: var(--serif); font-size: 16px; line-height: 1.5; margin: 0 0 8px; }
main .elo-example p.formula { font-family: var(--sans); font-size: 14px; }
.elo-steps { font-family: var(--sans); font-size: 14px; line-height: 1.5; padding-left: 20px; margin: 0 0 8px; }
.elo-steps li { margin: 3px 0; overflow-wrap: anywhere; }

/* Celular (D-045): cabeçalho em faixas de uma linha que rolam de lado, conteúdo com a hierarquia preservada
   e tabelas com a coluna do clube fixa. Vale para todos os sites, que usam este arquivo. */
@media (max-width: 560px) {
  .leagues, .masthead nav { position: relative; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .leagues::-webkit-scrollbar, .masthead nav::-webkit-scrollbar { display: none; }
  .leagues { gap: 18px; padding-top: 6px; padding-bottom: 0; font-size: 13px; }
  .leagues a { white-space: nowrap; padding: 6px 0 7px; }
  .masthead-inner { flex-direction: column; align-items: stretch; gap: 4px; padding-top: 12px; padding-bottom: 0; }
  .brand img { height: 28px; }
  .masthead nav { gap: 20px; margin: 0 -16px; padding: 0 16px; min-width: 0; max-width: 100vw; }
  .brand { align-self: flex-start; }
  .masthead nav a { white-space: nowrap; padding: 10px 0 9px; font-size: 15px; }
  .reference-bar { padding-top: 7px; padding-bottom: 8px; gap: 0; }
  .edition { font-size: 12px; }
  .edition-name { font-size: 14px; }
  .edition-facts { font-size: 12px; color: var(--ink-faint); }

  main.wrap { padding-top: 22px; padding-bottom: 40px; }
  h1 { font-size: 27px; line-height: 1.12; }
  h2 { font-size: 19px; margin-top: 32px; }
  .race-heading { font-size: 22px; }
  .lede { font-size: 16px; line-height: 1.5; }
  .lede-method { font-size: 14px; }
  main > p, main section > p, .summary-list li, main > ul li { font-size: 16px; }
  .race-switch { gap: 6px; margin-bottom: 18px; }
  .race-switch .segmented { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .race-switch .segmented a { text-align: center; padding: 9px 4px; }
  .tabs { gap: 2px 16px; }
  .table-tabs { gap: 2px 24px; }

  /* Barras: nome e número na mesma linha, barra inteira embaixo */
  .race-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "bar bar"; gap: 5px 10px; padding: 9px 0; }
  .race-row > :first-child { grid-area: name; min-width: 0; }
  .race-row .bar-track { grid-area: bar; height: 8px; }
  .race-row .value { grid-area: value; min-width: 0; }

  /* Mudanças: texto mais curto por linha */
  .changes li { font-size: 15px; line-height: 1.45; padding: 9px 0; }

  /* Números do clube em duas colunas iguais */
  .stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .stat .big { font-size: 24px; }
  .stat .sub { font-size: 12px; }

  /* Tabelas: posição e clube ficam parados enquanto o resto rola de lado */
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
  table:has(td.pos) td.pos, table:has(td.pos) th:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 30px; width: 30px; }
  table:has(td.pos) td.pos + td, table:has(td.pos) th:first-child + th { position: sticky; left: 30px; z-index: 1; background: var(--paper); max-width: 132px; box-shadow: 6px 0 6px -6px color-mix(in srgb, var(--ink) 35%, transparent); }
  table td.club .club-cell { max-width: 120px; }
  table td.club .club-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  th { z-index: 2; }
  table:has(td.pos) th:first-child, table:has(td.pos) th:first-child + th { z-index: 3; }
  .table-scroll { margin-right: -16px; }

  /* Jogos e escolha de clube */
  .club-strip { margin-left: -16px; margin-right: -16px; padding-left: 12px; padding-right: 12px; }
  .club-grid { grid-template-columns: 1fr 1fr; }
  .club-tile { grid-template-columns: 32px 1fr; padding: 10px 6px 10px 0; }
  .club-tile .crest { width: 32px; height: 32px; }
  .club-heading { font-size: 26px; gap: 10px; }
  .club-heading .crest { width: 40px; height: 40px; }

  .site-footer { gap: 10px; }
  .footer-tagline { display: block; margin: 2px 0 0; }
  .footer-facts div { grid-template-columns: 1fr; gap: 0; }
}

/* Barra de navegação no pé da tela, no celular (D-048; assets/mobile-nav.js). Itens com ícone e rótulo, área de toque
   de 48 px; o resto do menu e as outras competições ficam em "Mais". */
.tabbar, .tabbar-sheet { display: none; }
@media (max-width: 560px) {
  .masthead nav { display: none; }
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--paper); border-top: 1px solid var(--rule); padding: 2px 4px calc(2px + env(safe-area-inset-bottom)); }
  .tabbar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px;
    font: inherit; font-size: 11px; font-weight: 600; line-height: 1.1; color: var(--ink-faint); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tabbar-item[aria-current="page"], .tabbar-item.is-active, .tabbar-item[aria-expanded="true"] { color: var(--ink); }
  .tabbar-item[aria-current="page"] svg, .tabbar-item.is-active svg { color: var(--signal); }
  .tabbar-sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 39; background: color-mix(in srgb, var(--ink) 35%, transparent); }
  .tabbar-sheet-panel { position: absolute; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto;
    background: var(--paper); border-top: 3px solid var(--rule-strong); padding: 14px 16px 18px; }
  .tabbar-sheet-title { margin: 6px 0 8px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
  .tabbar-sheet-links { display: grid; gap: 2px; margin-bottom: 10px; }
  .tabbar-sheet-links a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px; font-size: 16px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--rule); }
  .tabbar-sheet-links a[aria-current="page"] { color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); padding-left: 10px; }
  .tabbar-sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .tabbar-sheet-chips a { padding: 8px 12px; border: 1px solid var(--rule); font-size: 14px; font-weight: 600; text-decoration: none; }
  .tabbar-sheet-chips a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
  .sim-savebar { bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* Seu time, convites para explorar e atalhos da página do clube (D-048). Cantos retos e fios, como o resto do site. */
.your-team { border: 1px solid var(--rule); border-left: 3px solid var(--signal); background: var(--surface); padding: 10px 12px; margin: 0 0 22px; }
.your-team-head { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; text-decoration: none; }
.your-team-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; color: var(--ink-soft); }
.your-team-name strong { font-size: 18px; color: var(--ink); }
.your-team-kicker { font-size: 12px; font-weight: 650; color: var(--signal); text-transform: none; }
.your-team-go { font-size: 26px; color: var(--ink-faint); line-height: 1; }
.your-team.is-empty { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; color: var(--ink-soft); }
.your-team.is-empty svg { color: var(--signal); }
.your-team.is-empty strong { color: var(--ink); }
.chance-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chance-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: 1px solid var(--rule); background: var(--paper); font-size: 13px; color: var(--ink-soft); }
.chance-chip strong { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
main p.your-team-next { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 6px 0 0; }
.your-team-next strong { color: var(--ink); font-weight: 600; }

.explore { margin-top: 40px; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.explore-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 12px 34px 12px 12px; border: 1px solid var(--rule); background: var(--surface); text-decoration: none; }
.explore-card strong { font-size: 16px; line-height: 1.25; }
.explore-card span { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.explore-card .explore-go { position: absolute; right: 12px; top: 12px; font-size: 18px; color: var(--ink-faint); }
.explore-card:hover { border-color: var(--ink); }
.explore-card.is-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.explore-card.is-primary span { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.explore-card.is-primary .explore-go { color: var(--signal); }

.club-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.club-title .club-heading { margin-bottom: 0; }
.follow-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.follow-button.is-following { background: var(--ink); color: var(--paper); }
.follow-button.is-following svg { color: var(--signal); }
.club-title + .lede { margin-top: 12px; }
.jump-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 18px 0 0; padding-bottom: 2px; }
.jump-chips::-webkit-scrollbar { display: none; }
.jump-chips a { flex: none; padding: 7px 12px; border: 1px solid var(--rule); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.jump-chips a:hover { border-color: var(--ink); }
.club-tile-star { color: var(--signal); vertical-align: -3px; }
.club-tile.is-favorite { box-shadow: inset 3px 0 0 var(--signal); padding-left: 8px; }
main h2[id] { scroll-margin-top: 12px; }
@media (max-width: 560px) {
  .explore-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .explore-card { min-height: 112px; padding: 10px 26px 10px 10px; }
  .explore-card.is-primary { grid-column: 1 / -1; min-height: 0; }
  .explore-card strong { font-size: 15px; }
  .jump-chips { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}
.round-howto { margin: 0 0 12px; }
.round-howto summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.round-howto p { margin: 6px 0 0; }
.follow-box { display: grid; gap: 4px; justify-items: start; }
.follow-hint { margin: 0; font-size: 13px; color: var(--ink-soft); }
.chance-chip.is-strong { border-color: var(--ink); }
.chance-chip.is-strong strong { font-size: 18px; }
.chance-chip[data-dispute="queda"].is-strong strong { color: var(--danger); }
.chance-chip[data-dispute="titulo"].is-strong strong { color: var(--ink); }

/* Popup de jogo (D-049; assets/match-popup.js): <dialog> que fecha com Esc, com o botão ou tocando fora. */
.match-popup { border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 0; width: min(92vw, 520px); max-height: 86vh; }
.match-popup::backdrop { background: color-mix(in srgb, var(--ink) 40%, transparent); }
.match-popup-panel { padding: 16px 18px 20px; overflow-y: auto; max-height: 86vh; }
.match-popup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.match-popup-head h2 { font-size: 18px; margin: 0; border: 0; padding: 0; }
.match-popup-close { width: 40px; height: 40px; font-size: 26px; line-height: 1; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; flex: none; }
.match-popup-score { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.match-popup-score span { display: block; font-size: 14px; font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
main .match-popup p.match-popup-line, .match-popup p.match-popup-line { font-family: var(--sans); font-size: 15px; margin: 6px 0; }
.match-popup-sub { font-size: 15px; margin: 16px 0 6px; border-top: 1px solid var(--rule); padding-top: 10px; }
.match-popup-club h3 { font-size: 15px; margin: 8px 0 4px; }
.match-popup-effects { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.match-popup-effects li { display: flex; justify-content: space-between; font-size: 15px; border-bottom: 1px solid var(--rule); padding: 4px 0; }
.match-popup-effects .up { color: var(--positive); }
.match-popup-effects .down { color: var(--danger); }
.match-popup-triple { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.match-popup-triple span { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-soft); border-top: 2px solid var(--ink); padding-top: 6px; }
.match-popup-triple strong { font-size: 20px; color: var(--ink); }
.match-popup-links { font-size: 14px; margin-top: 14px; }
.match-actions { grid-column: 1 / -1; }
.match-open { font: inherit; font-size: 13px; font-weight: 650; padding: 6px 10px; min-height: 36px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.match-open:hover { background: var(--ink); color: var(--paper); }

/* Dica de gráfico (D-049; match-popup.js): um balão, com o conteúdo do elemento sob o ponteiro ou o dedo. */
.chart-float { position: absolute; z-index: 60; max-width: min(260px, 88vw); padding: 8px 10px; background: var(--surface); border: 1px solid var(--ink); font-size: 13px; line-height: 1.4; color: var(--ink); pointer-events: none; }
.chart-float strong { font-weight: 650; }
.table-auto-note { margin: 4px 0 12px; }
.chance-chip { text-decoration: none; color: inherit; }
.chance-chip:hover { border-color: var(--ink); }


/* Continue explorando no celular: lista de linhas, sem blocos (D-049). */
@media (max-width: 560px) {
  .explore-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--rule-strong); }
  .explore-card, .explore-card.is-primary { min-height: 0; padding: 14px 32px 14px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); }
  .explore-card.is-primary span { color: var(--ink-soft); }
  .explore-card strong { font-size: 16px; }
  .explore-card span { font-size: 14px; }
  .explore-card .explore-go { right: 0; top: 16px; }
  .explore-card:hover { border-color: var(--rule); }
}
