/* css/matchup.css
   MATCHUP ANALYSER - ported from the design export's FINAL - Matchup.html
   ("Draft D · Composite"). Behaviour in js/modules/matchup.js; the shell
   markup in index.html.

   Every rule is nested under `.mx`, the redesigned block. The Full Season
   strip is deliberately OUTSIDE that block (a sibling, in its own
   .matchup-shell) so none of these resets or short class names (.chip, .bar,
   .side, .pop …) can reach it - it keeps its components.css styling untouched.

   Colour, spacing, radius and font tokens are base.css's own (the export
   copied them verbatim); only values this page alone needs are declared on
   `.mx`. One scope-level re-point, the same one the landing makes
   (CONVENTIONS.md §5.2): Tough reads orange. */

@keyframes mx-sk { to { transform: translateX(100%); } }

.mx {
  --pad: clamp(16px, 3vw, 40px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 420ms;
  --shadow-pop: 0 16px 40px rgba(1, 4, 9, .6);
  --space-12: 48px;
  --mx-neutral-ink: #a2abb5;   /* neutral band text - grey is too dark on its tint */
  --mx-scrim: rgba(1, 4, 9, .55);
  --band-tough: var(--band-orange);
  --band-tough-bg: var(--band-orange-bg);

  font: 14px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  margin-bottom: var(--space-6);

  [data-band] { --b: var(--band-neutral); --bb: var(--band-neutral-bg); --bt: var(--color-muted); }
  [data-band=excellent] { --b: var(--band-excellent); --bb: var(--band-excellent-bg); --bt: var(--band-excellent); }
  [data-band=great]     { --b: var(--band-great);     --bb: var(--band-great-bg);     --bt: var(--band-great); }
  [data-band=good]      { --b: var(--band-good);      --bb: var(--band-good-bg);      --bt: var(--band-good); }
  [data-band=neutral]   { --b: var(--band-neutral);   --bb: var(--band-neutral-bg);   --bt: var(--mx-neutral-ink); }
  [data-band=tough]     { --b: var(--band-tough);     --bb: var(--band-tough-bg);     --bt: var(--band-tough); }
  [data-band=brutal]    { --b: var(--band-brutal);    --bb: var(--band-brutal-bg);    --bt: var(--band-brutal); }
  [data-band=extreme]   { --b: var(--band-extreme-ink); --bb: var(--band-extreme-bg); --bt: var(--band-extreme-ink); }
  [data-band=none]      { --b: var(--color-border);   --bb: transparent;              --bt: var(--color-muted); }

  *, *::before, *::after { box-sizing: border-box; margin: 0; }
  a { color: var(--color-accent); }
  a:hover { color: var(--color-text); }
  button { font: inherit; color: inherit; }
  ul, ol { list-style: none; padding: 0; }
  :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lbl { font: 700 11px/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); }
  .num { font-family: var(--font-score); font-weight: 700; font-variant-numeric: tabular-nums; line-height: .82; letter-spacing: 0; }
  .fd { display: inline-block; width: .5em; text-align: center; }
  .wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
  kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--color-border); border-radius: 3px; font: 600 11px/1 var(--font-mono); color: var(--color-muted); }

  /* score chip - one rule for every band: tint + hue ring. Only excellent is solid. */
  .chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 24px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); background: var(--bb); color: var(--bt); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b) 60%, transparent); font: 700 13px/1 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .chip[data-band=excellent] { background: var(--band-excellent); color: var(--color-bg); box-shadow: 0 0 0 1px var(--band-excellent), 0 0 14px color-mix(in srgb, var(--band-excellent) 40%, transparent); }
  .chip[data-band=extreme] { background: var(--band-extreme); }
  .chip[data-band=none] { color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-border); font-weight: 600; }
  .chip--lg { height: 32px; min-width: 46px; font-size: 16px; padding: 0 8px; }
  .chip--sm { height: 20px; min-width: 28px; font-size: 12px; padding: 0 4px; }
  /* Low-confidence score (CompositeScore.provisional): same chip, dashed ring. */
  .chip.is-est { outline: 1px dashed var(--color-estimated); outline-offset: 2px; }
  /* Still settling - the value is withheld, the footprint kept. */
  .chip.is-pending, .is-pending.sk-t { position: relative; overflow: hidden; background: var(--color-skeleton); color: transparent; box-shadow: none; outline: 0; }
  .chip.is-pending::after, .sk::after, .sk-t::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--color-skeleton-highlight), transparent); transform: translateX(-100%); animation: mx-sk 1.3s ease-in-out infinite; }
  .sk-t { position: relative; overflow: hidden; display: inline-block; background: var(--color-skeleton); color: transparent !important; border-radius: 2px; -webkit-text-stroke: 0 !important; }
  .bandname { font: 700 11px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--bt); }

  /* bars */
  .bar { position: relative; height: 8px; background: var(--color-surface-raised); overflow: hidden; }
  .bar > i { position: absolute; inset: 0; background: var(--b); transform-origin: left center; transform: scaleX(0); transition: transform 560ms var(--ease-out) var(--d, 0ms); }
  .bar--rtl > i { transform-origin: right center; }
  .bar.is-on > i { transform: scaleX(var(--v)); }
  .bar--zero::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--color-text); }
  .bar--rtl.bar--zero::after { left: auto; right: 0; }
  /* Estimated metric (fallback input): muted, dashed track. */
  .bar.is-est { outline: 1px dashed var(--color-estimated); outline-offset: -1px; }
  .bar.is-est > i { opacity: .45; }
  .nodata { display: inline-flex; align-items: center; gap: 6px; color: var(--color-muted); font-size: 12px; }
  .nodata::before { content: "-"; font-weight: 700; color: var(--color-muted); }

  /* info button */
  .ib { position: relative; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--color-border); background: transparent; color: var(--color-muted); font: italic 600 12px/1 Georgia, 'Times New Roman', serif; cursor: pointer; transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast); }
  .ib::before { content: ""; position: absolute; inset: -12px; }
  .ib:hover { color: var(--color-text); border-color: var(--color-muted); background: var(--color-surface-raised); }
  .ib[aria-expanded=true] { color: var(--color-accent); border-color: var(--color-accent); background: var(--color-accent-muted); }

  /* controls */
  .step { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-muted); font-size: 18px; line-height: 1; cursor: pointer; transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast); }
  .step:hover { color: var(--color-text); border-color: var(--color-muted); background: var(--color-surface-raised); }
  /* An end-of-list stepper keeps its slot so the title doesn't shift. */
  .step[data-off] { visibility: hidden; }
  .btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color var(--dur-fast), background-color var(--dur-fast); }
  .btn:hover { background: var(--color-surface-raised); border-color: var(--color-muted); }
  @media (pointer: coarse) { .step { width: 44px; height: 44px; } .btn { height: 44px; } }

  .crest { flex: none; display: inline-grid; place-items: center; width: var(--cs, 28px); height: var(--cs, 28px); border-radius: 50%; background: var(--color-surface-raised); box-shadow: inset 0 0 0 1px var(--color-border); color: var(--color-muted); font: 700 calc(var(--cs, 28px) * .3)/1 var(--font-sans); letter-spacing: .02em; }
  .crest > * { grid-area: 1 / 1; }
  .crest img { width: 72%; height: 72%; object-fit: contain; }
  .crest--img .crest__c { visibility: hidden; }
  .crest--18 { --cs: 18px; } .crest--20 { --cs: 20px; } .crest--24 { --cs: 24px; }
  .venue { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: 700 10px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }

  /* panel header */
  .ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding-bottom: var(--space-3); margin-bottom: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
  .ph__t { font: 600 22px/1 var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
  .ph__m { margin-left: auto; font-size: 12px; color: var(--color-muted); }

  /* popover / sheet - z-index above the app nav (100) and phone tab bar (200) */
  .pop { position: fixed; z-index: 230; left: 0; top: 0; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: var(--space-4); display: grid; gap: 10px; opacity: 0; transform: translateY(4px); pointer-events: none; visibility: hidden; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), visibility 0s 160ms; }
  .pop.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
  .pop__t { font: 600 22px/1.05 var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
  .pop__b { color: var(--color-muted); font-size: 13px; text-wrap: pretty; }
  .pop__ctx { display: grid; gap: 6px; font-size: 13px; padding-top: 10px; border-top: 1px solid var(--color-border-subtle); }
  .pop__ctx p { color: var(--color-muted); }
  .pop__ctx b { color: var(--color-text); }
  .pop__x { justify-self: end; }
  .pop__wl { margin-bottom: 6px; }
  .wts { display: flex; gap: 2px; height: 22px; }
  .wts span { display: grid; place-items: center; background: var(--color-surface); color: var(--color-muted); font: 700 10px/1 var(--font-sans); min-width: 0; overflow: hidden; }
  .wts span[aria-current=true] { background: var(--color-text); color: var(--color-bg); }
  .pop--sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 80vh; border-radius: var(--radius-md) var(--radius-md) 0 0; transform: translateY(100%); padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
  .pop--sheet.is-open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 205; background: var(--mx-scrim); opacity: 0; pointer-events: none; transition: opacity 160ms; }
  .scrim.is-on { opacity: 1; pointer-events: auto; }
  .tip { position: fixed; z-index: 240; left: 0; top: 0; padding: 6px 8px; background: var(--color-text); color: var(--color-bg); font-size: 12px; font-weight: 600; border-radius: var(--radius-sm); pointer-events: none; opacity: 0; transition: opacity 100ms; white-space: nowrap; }
  .tip.is-on { opacity: 1; }

  /* pairing explainer + named players, inside the popover (copy from matchup.js) */
  .counter-pairing-info__explain { display: grid; gap: 8px; }
  .counter-pairing-info__note { color: var(--color-muted); font-size: 13px; text-wrap: pretty; }
  .counter-pairing-info__note strong, .counter-pairing-info__terms strong { color: var(--color-text); }
  .counter-pairing-info__terms { display: grid; gap: 6px; font-size: 13px; color: var(--color-muted); }
  .counter-pairing-info__terms li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
  .counter-pairing-info__term { font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
  .individual-duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--color-border-subtle); font-size: 12px; }
  .individual-duel__attacker, .individual-duel__defender { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; font-weight: 600; }
  .individual-duel__defender { justify-content: flex-end; text-align: right; }
  .individual-duel__role, .individual-duel__vs { font-size: 11px; color: var(--color-muted); font-weight: 500; }
  .individual-duel__form { color: var(--color-muted); font-variant-numeric: tabular-nums; }

  /* skeleton + states */
  .sk { display: block; background: var(--color-skeleton); position: relative; overflow: hidden; border-radius: 2px; }
  .mx-sk-name { width: 180px; height: 32px; }
  .mx-sk-score { width: 150px; height: 130px; }
  .state { display: grid; gap: 10px; justify-items: start; padding: var(--space-6); border: 1px solid var(--color-border); background: var(--color-surface); max-width: 640px; }
  .state__t { font: 600 22px/1.05 var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
  .state p { color: var(--color-muted); text-wrap: pretty; }

  /* reveal */
  [data-rv] { opacity: 0; transform: translateY(8px); transition: opacity 380ms var(--ease-out), transform 380ms var(--ease-out); }
  [data-rv].in { opacity: 1; transform: none; }

  /* ─── command bar ───────────────────────────────────────────────────── */
  .cmd { position: sticky; top: var(--app-header-height); z-index: 30; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
  .cmd__in { display: flex; align-items: center; gap: 8px; height: 52px; }
  .cbtn { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; transition: border-color var(--dur-fast), background-color var(--dur-fast); }
  .cbtn:hover { border-color: var(--color-muted); background: var(--color-surface-raised); }
  .cbtn[aria-expanded=true] { border-color: var(--color-accent); }
  .cbtn .lbl { font-size: 10px; }
  .cbtn__fx { font: 400 19px/1 var(--font-team); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
  .cbtn__fx i { font-style: normal; color: var(--color-muted); font-size: 12px; }
  .cbtn__car { color: var(--color-muted); font-size: 11px; }
  .cmd__sp { flex: 1; }
  .cmd__hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-muted); }

  /* drawers */
  .drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 210; width: min(400px, 100vw); background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; transition: transform 260ms var(--ease-out), visibility 0s 260ms; }
  .drawer.is-open { transform: none; visibility: visible; transition: transform 260ms var(--ease-out); }
  .drawer__h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
  .drawer__h h2 { font: 600 22px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .drawer__b { flex: 1; overflow-y: auto; padding: 8px; }
  .drawer__f { padding: 12px 16px; border-top: 1px solid var(--color-border-subtle); font-size: 12px; color: var(--color-muted); }
  .dfx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; font: 400 20px/1 var(--font-team); letter-spacing: .04em; text-transform: uppercase; text-align: left; transition: background-color var(--dur-fast); }
  .dfx span:nth-child(4) { text-align: right; }
  .dfx i { font-style: normal; color: var(--color-muted); font-size: 12px; }
  .dfx:hover, .dtm:hover { background: var(--color-surface-raised); }
  .dfx[aria-current=true], .dtm[aria-current=true] { background: var(--color-surface-raised); box-shadow: inset 3px 0 0 var(--color-accent); }
  .dtm { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; text-align: left; font-size: 14px; font-weight: 600; transition: background-color var(--dur-fast); }
  .dtm__o { font-size: 12px; color: var(--color-muted); }
  .dtm__o i { font-style: normal; }
  .dtm__gw { font: 700 11px/1 var(--font-sans); color: var(--color-muted); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
  /* The FPL chip reset, between the two gameweeks that straddle it. */
  .dsep { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-1) var(--space-3); font: 700 10px/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--color-muted); }
  .dsep::before, .dsep::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

  /* Team-fixtures rows: one 32px line - crest · v opponent · H/A · GW · score. Fixed
     columns keep H/A, GW and the chip aligned down the list; only the name flexes. */
  .dtm--fx { grid-template-columns: 24px minmax(0, 1fr) 20px 32px 34px; gap: var(--space-2); padding: var(--space-1) var(--space-3); }
  .dtm--fx:focus-visible { outline-offset: -2px; }
  .dtm--fx[aria-current=true] { box-shadow: inset 2px 0 0 var(--color-accent); }
  .dtm__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dtm__n i { font-style: normal; font-weight: 400; color: var(--color-muted); }
  /* H/A: a small outlined pill, so the name and score carry the weight. */
  .dtm--fx .dtm__o { justify-self: center; }
  .dtm--fx .dtm__o i { display: inline-grid; place-items: center; min-width: 20px; height: 18px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--color-border); font: 700 10px/1 var(--font-sans); letter-spacing: .04em; }
  .dtm--fx .dtm__gw { min-width: 0; font-size: 12px; }
  .dtm--fx .chip { justify-self: end; }
  /* Team header: tighter, and a long team name truncates instead of wrapping. */
  .drawer__h--team { gap: var(--space-2); padding: var(--space-3); }
  .drawer__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (pointer: coarse) { .dtm--fx { padding-block: var(--space-2); } }
  /* Phone: arrows + name on row one, All teams / Close on row two, so the name keeps its room. */
  @media (max-width: 480px) {
    .drawer__h--team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
    .drawer__h--team [data-teams] { grid-column: 1 / 3; justify-self: start; }
  }

  /* ─── "read it as" ──────────────────────────────────────────────────── */
  .frame { display: grid; grid-template-columns: 190px repeat(3, minmax(0, 1fr)); padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border-subtle); }
  .frame__k { display: grid; align-content: center; gap: 6px; padding-right: var(--space-4); }
  .frame__t { font: 600 20px/1.05 var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
  .role { display: grid; gap: 8px; align-content: start; padding: 2px var(--space-5); border-left: 1px solid var(--color-border-subtle); min-width: 0; }
  .role__h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .role__h .lbl { color: var(--color-text); }
  .role__h em { font-style: normal; font-size: 12px; color: var(--color-muted); }
  .role__v { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rv { display: grid; gap: 6px; min-width: 0; }
  .rv__t { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-muted); font-weight: 600; }
  .rv__n { font: 700 16px/1 var(--font-sans); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; }
  .rv__n small { font-weight: 500; font-size: 12px; color: var(--color-muted); }
  .pips { display: flex; gap: 3px; }
  .pips i { width: 14px; height: 8px; background: var(--color-surface-raised); box-shadow: inset 0 0 0 1px var(--color-border); }
  .pips i.on { background: var(--color-text); box-shadow: none; }
  .meter { width: 64px; height: 4px; background: var(--color-surface-raised); position: relative; overflow: hidden; }
  .meter i { position: absolute; inset: 0; background: var(--color-muted); transform-origin: left; transform: scaleX(var(--v)); }
  .meter.is-low i { background: var(--color-estimated); }

  /* ─── tape ──────────────────────────────────────────────────────────── */
  .tape { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); row-gap: var(--space-5); padding: var(--space-6) var(--pad); overflow: hidden; border-bottom: 1px solid var(--color-border); max-width: 1440px; margin: 0 auto; }
  .tape__pitch { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .tape__pitch * { fill: none; stroke: var(--color-border-subtle); stroke-width: 2; }
  .tape__pitch .tape__spot { fill: var(--color-border-subtle); }
  .side { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-6); padding: var(--space-6) 64px var(--space-6) var(--space-6); background: var(--color-surface); clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%); }
  .side--a { grid-template-columns: auto minmax(0, 1fr); padding: var(--space-6) var(--space-6) var(--space-6) 64px; clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%); }
  .side--a .side__info { order: 2; justify-items: end; text-align: right; }
  .side[data-edge] { background: var(--color-surface-raised); }
  .side__info { display: grid; gap: var(--space-3); justify-items: start; min-width: 0; }
  /* crest backdrop: oversized, tilted 10° clockwise, faint, cropped by the card's own edge */
  .side__bg { position: absolute; top: 50%; left: -14%; height: 165%; aspect-ratio: 1; background: center / contain no-repeat; background-image: var(--bg); opacity: .1; transform: translateY(-50%) rotate(10deg); pointer-events: none; z-index: 0; }
  .side--a .side__bg { left: auto; right: -14%; }
  .side > :not(.side__bg) { position: relative; z-index: 1; }
  .side__team { display: grid; gap: 6px; justify-items: start; min-width: 0; }
  .side--a .side__team { justify-items: end; }
  .side__name { font: 400 clamp(31px, 3.6vw, 48px)/1.2 var(--font-team); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .score { display: grid; justify-items: end; gap: 10px; }
  .side--a .score { justify-items: start; }
  .numw { position: relative; isolation: isolate; display: block; font-size: clamp(110px, 13.75vw, 210px); }
  .numw .num { position: relative; display: block; font-size: 1em; }
  .side--h .numw .num { text-align: right; }
  .numw .num__o { position: absolute; width: 100%; white-space: nowrap; top: .05em; left: .05em; z-index: -1; color: var(--b); filter: url(#gq-outline); pointer-events: none; }
  .side--a .numw .num__o { left: -.05em; }
  .numw.is-est .num__o { color: var(--color-estimated); }
  .numw .sk-t { width: 1.08em; height: .82em; }
  .slab { display: flex; align-items: center; gap: 10px; }
  .slab::before { content: ""; width: 56px; height: 6px; background: var(--b); transform: skewX(-30deg); }
  .side--a .slab { flex-direction: row-reverse; }
  .axis { display: grid; align-content: center; justify-items: center; gap: 6px; position: relative; z-index: 1; }
  .axis .v { font: 600 28px/1 var(--font-head); color: var(--color-muted); text-transform: uppercase; letter-spacing: .05em; }
  .verdict { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; position: relative; }
  .verdict__t { font: 600 clamp(22px, 2.4vw, 30px)/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
  .verdict__s { color: var(--color-muted); }
  .edge { display: inline-flex; align-items: center; height: 26px; padding: 0 12px 0 18px; background: var(--color-text); color: var(--color-bg); font: 600 14px/1 var(--font-head); letter-spacing: .05em; text-transform: uppercase; clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%); }
  .edge--r { padding: 0 18px 0 12px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }

  /* ─── sections ──────────────────────────────────────────────────────── */
  .pn { padding: var(--space-8) 0; border-bottom: 1px solid var(--color-border-subtle); }
  .side-key { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--color-muted); }
  .side-key b { color: var(--color-text); font-weight: 700; }

  /* breakdown */
  .mir__r { display: grid; grid-template-columns: 64px minmax(0, 1fr) 232px minmax(0, 1fr) 64px; grid-template-areas: "hv hb c ab av"; align-items: center; column-gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--color-border-subtle); }
  .mir__r:last-child { border-bottom: 0; }
  .mir__v { grid-area: hv; text-align: right; font: 700 16px/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--bt); display: grid; gap: 3px; }
  .mir__v small { font: 500 11px/1 var(--font-mono); color: var(--color-muted); }
  .mir__v--a { grid-area: av; text-align: left; }
  .mir__v.is-est { color: var(--color-estimated); }
  .mir__v .sk-t { justify-self: end; width: 2ch; }
  .mir__v--a .sk-t { justify-self: start; }
  .mir__r .bar { height: 10px; }
  .mir__hb { grid-area: hb; }
  .mir__ab { grid-area: ab; }
  .mir__c { grid-area: c; display: flex; flex-wrap: wrap; row-gap: 4px; align-items: center; justify-content: center; gap: 8px; text-align: center; min-width: 0; }
  .mir__n { font-weight: 600; font-size: 13px; }
  .wt { font: 700 11px/1 var(--font-sans); color: var(--color-muted); font-variant-numeric: tabular-nums; }
  .dir { font-size: 11px; color: var(--color-muted); white-space: nowrap; }
  .legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: var(--space-4); font-size: 12px; color: var(--color-muted); }
  .legend span { display: inline-flex; align-items: center; gap: 8px; }
  .legend .bar { width: 48px; height: 8px; }
  .legend b { color: var(--color-text); }

  /* counters - donut per pairing */
  .ctr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .ctr__h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 18px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); }
  .ctr__h i { font-style: normal; color: var(--color-muted); font-size: 14px; }
  .dkey { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 10px 14px; margin-bottom: var(--space-6); border: 1px solid var(--color-border-subtle); background: var(--color-surface); font-size: 13px; color: var(--color-muted); }
  .dkey > span { display: inline-flex; align-items: center; gap: 8px; }
  .dkey b { color: var(--color-text); }
  .dkey__no { color: var(--color-text); font-weight: 700; }
  .dkey__ex { font-size: 12px; }
  .dkey__ex:first-of-type { margin-left: auto; }
  .dkey__sw { width: 22px; height: 22px; flex: none; }
  .dkey__sw path { fill: none; }
  .dkey__a { stroke: var(--band-green); stroke-width: 3.5; }
  .dkey__d { stroke: var(--band-red); stroke-width: 3.5; }
  .dmini { display: inline-block; width: 34px; flex: none; }
  .dmini .dn__tag { display: none; }
  .dn { display: grid; grid-template-columns: minmax(0, 1fr) clamp(88px, 8.5vw, 120px) minmax(0, 1fr); grid-template-areas: "h h h" "a r d"; gap: 8px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--color-border-subtle); }
  .dn:last-child { border-bottom: 0; }
  .dn__h { grid-area: h; display: flex; justify-content: center; align-items: center; gap: 8px; font: 600 16px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
  .dn__ring { grid-area: r; display: block; width: 100%; height: auto; overflow: visible; }
  .dmini .dn__ring { width: 100%; }
  .dn__arc { fill: none; stroke-dashoffset: var(--len); transition: stroke-dashoffset 340ms var(--ease-out) var(--d, 0ms); }
  .dn__arc--a { stroke: var(--band-green); stroke-width: 6; }
  .dn__arc--d { stroke: var(--band-red); stroke-width: 6; transition-delay: calc(var(--d, 0ms) + 280ms); }
  .is-on .dn__arc { stroke-dashoffset: 0; }
  .dn__arc.dn__arc--big { stroke-width: 13; }
  .dn__arc.dn__arc--even { stroke-width: 9; }
  .dn__zero { stroke: var(--color-text); stroke-width: 2.5; opacity: 0; transition: opacity 200ms var(--d, 0ms); }
  .is-on .dn__zero { opacity: 1; }
  .dn__miss { fill: none; stroke: var(--color-estimated); stroke-width: 6; stroke-dasharray: 6 5; }
  .dn__pend { fill: none; stroke: var(--color-skeleton-highlight); stroke-width: 6; }
  .dn__tag { fill: var(--color-text); font: 700 17px/1 var(--font-sans); letter-spacing: .12em; text-anchor: middle; }
  .dn__tag--m { fill: var(--color-muted); font-size: 12px; letter-spacing: .08em; }
  .dn__s { display: grid; gap: 4px; justify-items: start; min-width: 0; }
  .dn__s--a { grid-area: a; }
  .dn__s--d { grid-area: d; justify-items: end; text-align: right; }
  .dn__r { display: inline-flex; align-items: center; gap: 6px; font: 700 10px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); }
  .dn__r::before { content: ""; width: 14px; height: 2px; background: var(--band-green); }
  .dn__s.is-big .dn__r::before { height: 5px; }
  .dn__s--d .dn__r { flex-direction: row-reverse; }
  .dn__s--d .dn__r::before { background: var(--band-red); }
  .dn__v { font: 700 43px/.9 var(--font-score); font-variant-numeric: tabular-nums; color: var(--color-text); }
  .dn__v.sk-t { width: 1.2em; }
  .dn__m { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
  .dn__io { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }

  /* horizon */
  .ol { display: grid; grid-template-columns: 220px repeat(var(--cols, 10), minmax(0, 1fr)); gap: 8px 6px; align-items: center; }
  .ol__gw { text-align: center; font: 700 11px/1 var(--font-sans); color: var(--color-muted); font-variant-numeric: tabular-nums; }
  .ol__gw[aria-current] { color: var(--color-text); }
  .ol__team { display: flex; align-items: center; gap: 10px; font: 400 22px/1 var(--font-team); text-transform: uppercase; letter-spacing: .04em; }
  .ol__team .chip { margin-left: auto; }
  .ol__team .bandname { width: 64px; }
  .ol__tbd { font: 700 10px/1 var(--font-sans); letter-spacing: .08em; color: var(--color-muted); }
  .ol__chips { display: contents; }
  .ol__slot { display: flex; gap: 2px; min-width: 0; }
  .oc { flex: 1; width: 100%; min-width: 0; height: 32px; padding: 0 2px; cursor: pointer; }
  .oc[data-static] { cursor: default; }
  .oc.is-tbc { box-shadow: inset 0 0 0 1px var(--b), inset 0 -3px 0 var(--color-border); }
  .oc[aria-current=true] { outline: 2px solid var(--color-text); outline-offset: 2px; }
  .oc:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
  .foot { padding: var(--space-6) 0 var(--space-4); font-size: 12px; color: var(--color-muted); }

  /* ─── responsive ────────────────────────────────────────────────────── */
  @media (max-width: 1100px) {
    .cmd__hint { display: none; }
    .frame { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .frame__k { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 0 0 12px; }
    .frame > .role:nth-child(2) { border-left: 0; padding-left: 0; }
    .tape { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-top: var(--space-5); row-gap: var(--space-4); }
    .axis { display: none; }
    .side, .side--a { grid-template-columns: minmax(0, 1fr); padding: var(--space-4) 28px var(--space-4) var(--space-4); clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%); gap: var(--space-3); }
    .side--a { padding: var(--space-4) var(--space-4) var(--space-4) 28px; clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%); }
    .side--a .side__info { order: 0; }
    .score { justify-items: start; }
    .side--a .score { justify-items: end; }
    .numw { font-size: clamp(80px, 23.75vw, 150px); }
    .side__name { font-size: clamp(24px, 6.72vw, 36px); }
  }
  @media (max-width: 900px) {
    .mir__r { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 40px; grid-template-areas: "c c c c" "hv hb ab av"; row-gap: 8px; }
    .ctr { grid-template-columns: 1fr; }
    .ol { grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: 6px 4px; }
    .ol__corner { display: none; }
    .ol__team { grid-column: 1 / -1; margin-top: 8px; }
    .oc { height: 30px; min-width: 0; padding: 0; font-size: 12px; }
  }
  @media (max-width: 768px) {
    .cmd { position: static; }
    .cmd__in { height: auto; padding: 8px 0; flex-wrap: wrap; }
    .cbtn--fx { flex: 1; justify-content: space-between; }
    .cbtn .lbl { display: none; }
    .frame { grid-template-columns: 1fr; padding-bottom: 0; }
    .role, .frame > .role:nth-child(2) { border-left: 0; padding: 12px 0; border-top: 1px solid var(--color-border-subtle); }
    .dkey { gap: 8px 16px; }
    .dkey__ex:first-of-type { margin-left: 0; }
    .dn { gap: 8px 10px; }
    .dn__v { font-size: 30px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-iteration-count: 1 !important; }
    [data-rv] { transform: none; }
    .sk::after, .sk-t::after, .chip.is-pending::after { display: none; }
  }
}
