/* Match result page. Builds on theme.css. */
.back { font-size: .85rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--brand); }

/* Hero */
.mh-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mh-teams { display: grid; gap: 8px; margin-top: 14px; }
.mh-t { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.mh-t .nm { font-weight: 600; }
.mh-t--won .nm { font-weight: 900; }
.mh-t .dot, .mh-t .flag { width: 14px; height: 16px; }
.mh-t .sc3 { margin-left: auto; font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.5rem; letter-spacing: -.01em; }
.mh-t .sc3 small { font-family: system-ui, sans-serif; font-weight: 500; font-size: .8rem; color: var(--muted); }
.mh-note { margin-top: 6px; font-weight: 700; color: var(--win); }
.mh-res { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-weight: 800; font-size: 1.05rem; color: var(--brand); }
.mh-facts { margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; }
.mh-facts dt { font-size: .76rem; color: var(--muted); font-weight: 700; }
.mh-facts dd { margin: 0; font-size: .88rem; }

/* Best performers */
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.perf-h, .sub-h { font-size: .8rem; font-weight: 800; color: var(--muted); margin: 0 0 8px; }
.sub-h { margin-top: 18px; }
.perfs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perf {
  display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 12px; background: var(--paper-2); border: 1px solid transparent;
}
.perf--top { background: var(--paper); border-color: color-mix(in srgb, var(--brand-2) 45%, var(--line)); }
.perf-team { grid-column: 1 / -1; font-size: .7rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.perf-name { font-weight: 800; }
.perf-fig { text-align: right; white-space: nowrap; }
.perf-fig b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.3rem; font-weight: 900; }
.perf-fig span { font-size: .78rem; color: var(--muted); margin-left: 3px; }
.perf-sub { grid-column: 1 / -1; font-size: .76rem; color: var(--ink-2); }
.hl { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.hl li { display: grid; }
.hl span { font-size: .76rem; color: var(--muted); font-weight: 700; }
.hl small { color: var(--ink-2); font-size: .78rem; }

/* Summary + chart side by side on wide screens */
.duo { display: grid; gap: 14px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.cmp td:not(:first-child), .cmp th:not(:first-child) { min-width: 96px; }
.cmp th { text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--ink-2); }
.cmp td:first-child { font-weight: 500; color: var(--ink-2); }
.sw { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw--1 { background: var(--s1); }
.sw--2 { background: var(--s2); }

/* Worm chart */
.legend { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; }
.wk-key { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink-2); margin-right: 6px; }
.worm { position: relative; }
.worm svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.worm .grid { stroke: var(--line); stroke-width: 1; }
.worm .ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.worm .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.worm .ln--1 { stroke: var(--s1); }
.worm .ln--2 { stroke: var(--s2); }
.worm .wk { stroke: var(--paper); stroke-width: 2; }
.worm .wk--1 { fill: var(--s1); }
.worm .wk--2 { fill: var(--s2); }
.worm .dl { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.worm .xh { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.worm .hit { fill: transparent; cursor: crosshair; }
.worm .tip {
  position: absolute; top: -6px; transform: translateY(-100%); pointer-events: none; opacity: 0; transition: opacity .12s;
  display: grid; gap: 2px; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .76rem; white-space: nowrap; z-index: 5;
}
.worm .tip.is-on { opacity: 1; }
.worm .tip .sw { width: 8px; }
.as-table { margin-top: 8px; font-size: .82rem; }
.as-table summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.as-table table { margin-top: 8px; }

/* Scorecards */
.inn-tabs { flex-wrap: wrap; border-radius: 14px; }
.inn-tabs button { display: inline-flex; align-items: center; gap: 6px; border-radius: 11px; }
.sc .no { color: var(--brand); font-weight: 800; }
.sc tr.top td { background: color-mix(in srgb, var(--brand-2) 8%, transparent); }
.sc tfoot td { border-bottom: 0; border-top: 1px solid var(--line); }
.sc tfoot .tot td { font-weight: 900; font-size: 1rem; }
.sc tfoot td:last-child { text-align: right; }
.dnb { font-size: .82rem; color: var(--ink-2); margin-top: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.fow-list, .stands { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.fow-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.fow-list small { color: var(--muted); }
.stands li { display: grid; grid-template-columns: 36px 1fr auto; gap: 2px 8px; align-items: baseline; }
.st-w { font-size: .72rem; color: var(--muted); font-weight: 700; }
.st-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-r small { color: var(--muted); }
.st-bar { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.st-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--brand-2); border-radius: 2px; }

@media (max-width: 760px) {
  .duo, .two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .perf-grid { grid-template-columns: 1fr; }
  .mh-t { font-size: 1rem; }
  .mh-t .sc3 { font-size: 1.25rem; }
}
