/* BarcaFeed Insights — "Matchday broadcast" visual system. Mobile first; tokens mirrored in tokens.json for Remotion/social. */
/* Colours come from the shared Figma tokens in bf-tokens.css (dark and light). The aliases below re-resolve inside .story, whose 9:16
   artwork stays on the dark palette in both themes. */
:root, .story {
  --ink: var(--surface-page);
  --night: var(--surface-base);
  --deep: var(--surface-raised);
  --raise: var(--surface-raised);
  --line: var(--divider);
  --line-strong: var(--divider-strong);
  --muted: var(--text-muted);
  --faint: var(--text-faint);
  --slate: var(--text-soft);
  --blue: var(--bf-blue);
  --garnet: var(--bf-garnet);
  --gold: var(--bf-gold);
  --gold-ink: var(--bf-gold-ink);
  --win: var(--bf-win);
  --draw: var(--bf-draw);
  --loss: var(--garnet);
  --slate-dim: color-mix(in srgb, var(--text-soft) 55%, transparent);
  --ch: var(--blue);
  --ca: var(--slate-dim);
}
:root {
  --display: 'Sofia Sans Extra Condensed', 'Sofia Sans', 'Arial Narrow', sans-serif;
  --body: 'Sofia Sans', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --tabbar: calc(64px + env(safe-area-inset-bottom, 0px));
  --gutter: 16px; /* Figma container: 16px phone gutter, 20px desktop, 960px maximum */
}
.story {
  color-scheme: dark;
  --surface-page: #0a0a0a; --surface-base: #171717; --surface-raised: #262626;
  --divider: rgb(255 255 255 / .08); --divider-strong: rgb(255 255 255 / .18);
  --text: #ffffff; --text-muted: #a1a1a1; --text-soft: #d4d4d4; --text-faint: #8a8a8a;
  --bf-blue: #3d7bff; --bf-garnet: #e0245e; --bf-gold: #fdc700; --bf-gold-ink: #fdc700; --bf-win: #3d7bff; --bf-draw: #7a7a7a;
  color: var(--text);
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; background: var(--ink); scroll-padding-top: 72px; }
body {
  min-height: 100dvh; background: var(--ink); color: var(--text); font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip;
  padding-bottom: var(--tabbar);
}
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--bf-on-gold); padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px; background: var(--surface-base);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; letter-spacing: -.005em; }
.brand-name b { font-weight: 900; color: var(--gold-ink); }
html.light .brand img { filter: invert(1); } /* the symbol is white artwork: invert it on light surfaces */
/* ---------- layout ---------- */
#view { outline: none; }
.wrap { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: var(--gutter); }
/* Long-form blocks keep a comfortable measure inside the 960px container. */
.duels, .vgoals-head, .duel-names, .vgoals, .contrib, .comps, .events, .share, .facts-list, .note, .ribbon-readout, .xi, [data-lineup], [data-compare] { max-width: 720px; }
/* Chart blocks centre inside the container so both sides of a two-team comparison stay together. */
.duels, .vgoals, .vgoals-head, .duel-names, .duels.in { margin-inline: auto; }
.section { padding-block: 56px; }
.section + .section { border-top: 1px solid var(--line); }
.kicker { color: var(--gold-ink); font-weight: 700; font-size: .875rem; }
.h-display { font-family: var(--display); font-weight: 900; line-height: .9; letter-spacing: -.01em; text-wrap: balance; }
.h-section { font-family: var(--display); font-weight: 800; font-size: clamp(2.25rem, 9vw, 3.25rem); line-height: .95; letter-spacing: -.005em; text-wrap: balance; margin-top: 8px; }
.lede { color: var(--slate); font-size: 1.0625rem; line-height: 1.5; max-width: 34em; margin-top: 12px; text-wrap: pretty; }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--slate); font-size: .8125rem; font-weight: 600; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; transition: transform .16s var(--ease), background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gold); color: var(--bf-on-gold); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #ffd930; }
  .btn-ghost:hover { background: var(--deep); }
}


/* ---------- goal timeline (vertical: kick-off at the top) ---------- */
.vgoals-head { display: flex; justify-content: space-between; margin-top: 26px; font-weight: 800; font-size: 1rem; }
.vgoals-head span:first-child { color: var(--ch); } .vgoals-head span:last-child { color: var(--slate); }
.vgoals { position: relative; height: 700px; margin-top: 12px; }
.vgoals .axis { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: var(--line-strong); }
.vt { position: absolute; left: 50%; transform: translate(-50%, -50%); padding: 1px 6px; background: var(--ink); color: var(--faint); font-size: .75rem; font-variant-numeric: tabular-nums; z-index: 1; }
.vht { position: absolute; left: calc(50% - 14px); width: 28px; height: 2px; background: var(--faint); transform: translateY(-50%); }
.vg { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); transition-delay: calc(var(--k) * 110ms); --c: var(--ch); }
.in .vg { opacity: 1; }
.vg.away { --c: var(--ca); }
.vg .pip { position: absolute; left: 50%; top: var(--y); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 26%, transparent); z-index: 2; }
.vg .stub, .vg .jog, .vg .stub2 { position: absolute; background: var(--line-strong); }
.vg .stub { top: var(--y); height: 1px; width: 16px; }
.vg .jog { top: var(--top); height: var(--dy); width: 1px; }
.vg .stub2 { top: var(--ly); height: 1px; width: 10px; }
.vg.home .stub { right: 50%; } .vg.home .jog { right: calc(50% + 16px); } .vg.home .stub2 { right: calc(50% + 16px); }
.vg.away .stub { left: 50%; } .vg.away .jog { left: calc(50% + 16px); } .vg.away .stub2 { left: calc(50% + 16px); }
.vg .lab { position: absolute; top: var(--ly); transform: translateY(-50%); width: calc(50% - 34px); line-height: 1.15; }
.vg.home .lab { right: calc(50% + 28px); text-align: right; } .vg.away .lab { left: calc(50% + 28px); }
.vg .lab b { display: block; font-size: 1rem; font-weight: 800; overflow-wrap: anywhere; }
.vg .lab span { color: var(--muted); font-size: .8125rem; }

/* ---------- stat duels ---------- */
.duels { display: grid; gap: 26px; margin-top: 28px; }
.duel .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.duel .row b { font-family: var(--display); font-weight: 900; font-size: 2.5rem; line-height: .9; font-variant-numeric: tabular-nums; min-width: 2.6ch; }
.duel .row b:last-child { text-align: right; color: var(--slate); }
.duel .row span { color: var(--muted); font-weight: 600; text-align: center; flex: 1; font-size: .9375rem; }
.duel .track { display: flex; gap: 3px; height: 10px; margin-top: 8px; }
.duel .track i { display: block; height: 100%; border-radius: 5px; transform: scaleX(0); transition: transform .9s var(--ease); }
.duel .track i.h { flex: var(--s) 1 0; background: var(--ch); transform-origin: left; }
.duel .track i.a { flex: calc(1 - var(--s)) 1 0; background: var(--ca); transform-origin: right; }
.swap { --ch: var(--slate-dim); --ca: var(--blue); }
.in .duel .track i { transform: scaleX(1); }
.duel.us-home .row b:first-child, .duel.us-away .row b:last-child { color: var(--gold-ink); }
.duel-names { display: flex; justify-content: space-between; margin-top: 22px; font-weight: 700; font-size: .9375rem; }
.duel-names span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.duel-names span:first-child::before { background: var(--ch); }
.duel-names span:last-child::before { background: var(--ca); }
.note { color: var(--faint); font-size: .8125rem; margin-top: 18px; text-wrap: pretty; }

/* ---------- contributors / events ---------- */
.contrib { display: grid; gap: 10px; margin-top: 22px; }
.contrib li { list-style: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--night); border: 1px solid var(--line); }
.contrib b { font-weight: 800; }
.contrib .pts { display: flex; gap: 14px; font-variant-numeric: tabular-nums; color: var(--slate); }
.contrib .pts em { font-style: normal; font-family: var(--display); font-weight: 900; font-size: 1.75rem; color: var(--text); margin-right: 4px; }
.events { margin-top: 20px; display: grid; }
.ev { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ev .m { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .who b { font-weight: 800; }
.ev .who span { display: block; color: var(--muted); font-size: .875rem; }
.ev.goal-ev .m { color: var(--gold-ink); }
.ev .dot { display: inline-block; width: 9px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.ev .dot.y { background: var(--gold); } .ev .dot.r { background: var(--garnet); }
.ev[hidden] { display: none; }

/* ---------- lineup pitch ---------- */


/* ---------- lists / states ---------- */
.page-head { padding-block: 32px 8px; }
.page-title { font-size: clamp(3rem, 13vw, 5rem); }
.h-sub { font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1; margin-top: 32px; }
.h-sub + .events, .h-sub + .stack { margin-top: 12px; }
.skeleton { display: grid; gap: 14px; padding-block: 40px; }
.skeleton i { display: block; height: 22px; border-radius: 8px; background: linear-gradient(90deg, var(--night), var(--deep), var(--night)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton i.xl { height: 120px; border-radius: 18px; } .skeleton i.s { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state { padding-block: 72px; text-align: left; }
.state h2 { font-family: var(--display); font-weight: 900; font-size: 2.75rem; line-height: .95; }
.state p { color: var(--slate); margin-top: 12px; max-width: 30em; }
.state .btn { margin-top: 22px; }
.footnote { padding-block: 40px 56px; color: var(--faint); font-size: .8125rem; border-top: 1px solid var(--line); }
.footnote p + p { margin-top: 8px; }
.footnote b { color: var(--muted); font-weight: 600; }

/* ---------- 9:16 social compositions (1080 x 1920 design grid, container-relative) ---------- */
.stories { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-top: 28px; }
.story-wrap { display: grid; gap: 12px; }
.rail .story-wrap { flex: 0 0 min(64vw, 270px); scroll-snap-align: start; }
.story-wrap figcaption { color: var(--slate); font-weight: 600; font-size: .9375rem; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.story-wrap figcaption em { font-style: normal; color: var(--faint); font-weight: 400; font-size: .8125rem; }
.story { --u: .0925926cqw; container-type: inline-size; position: relative; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: var(--ink); border: 1px solid var(--line); isolation: isolate; }
.story-inner { position: absolute; inset: 0; padding: calc(150 * var(--u)) calc(84 * var(--u)) calc(190 * var(--u)); display: flex; flex-direction: column; }
.story::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 45% at 50% 0%, rgb(61 123 255 / .34), transparent 72%), repeating-linear-gradient(90deg, rgb(255 255 255 / .02) 0 calc(54 * var(--u)), transparent calc(54 * var(--u)) calc(108 * var(--u))); }
.story .brandline { display: flex; align-items: center; gap: calc(16 * var(--u)); font-weight: 700; font-size: calc(38 * var(--u)); color: var(--slate); }
.story .brandline img { width: calc(46 * var(--u)); height: calc(46 * var(--u)); }
.story .brandline b { color: var(--gold); font-weight: 900; }
.story .s-ctx { font-size: calc(40 * var(--u)); font-weight: 600; color: var(--slate); margin-top: calc(70 * var(--u)); line-height: 1.2; }
.story .s-big { font-family: var(--display); font-weight: 900; line-height: .8; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.story .s-teams { font-family: var(--display); font-weight: 800; font-size: calc(86 * var(--u)); line-height: .95; }
.story .s-foot { margin-top: auto; padding-top: calc(24 * var(--u)); font-size: calc(34 * var(--u)); color: var(--muted); line-height: 1.3; }
.story .s-foot b { color: var(--slate); font-weight: 600; }
.story .s-row { display: flex; justify-content: space-between; align-items: baseline; gap: calc(24 * var(--u)); font-size: calc(46 * var(--u)); font-weight: 700; }
.story .s-row b { font-family: var(--display); font-weight: 900; font-size: calc(120 * var(--u)); line-height: .9; font-variant-numeric: tabular-nums; }
.story .s-bar { display: flex; gap: calc(6 * var(--u)); height: calc(22 * var(--u)); margin-top: calc(10 * var(--u)); }
.story .s-bar i { display: block; border-radius: calc(11 * var(--u)); background: var(--blue); }
.story .s-bar i:last-child { background: var(--slate-dim); }
.story .s-axis { position: relative; flex: 1; margin: calc(34 * var(--u)) 0 calc(20 * var(--u)); }
.story .s-axis .line { position: absolute; left: 50%; top: 0; bottom: 0; width: calc(4 * var(--u)); transform: translateX(-50%); background: var(--line-strong); }
.story .s-vg { position: absolute; inset: 0; --c: var(--blue); }
.story .s-vg.away { --c: var(--slate-dim); }
.story .s-vg .pip { position: absolute; left: 50%; top: var(--y); width: calc(34 * var(--u)); height: calc(34 * var(--u)); margin: calc(-17 * var(--u)) 0 0 calc(-17 * var(--u)); border-radius: 50%; background: var(--c); }
.story .s-vg .lab { position: absolute; top: var(--ly); transform: translateY(-50%); width: calc(50% - 60 * var(--u)); font-size: calc(34 * var(--u)); line-height: 1.12; color: var(--muted); }
.story .s-vg.home .lab { right: calc(50% + 40 * var(--u)); text-align: right; } .story .s-vg.away .lab { left: calc(50% + 40 * var(--u)); }
.story .s-vg .lab b { display: block; font-size: calc(44 * var(--u)); font-weight: 800; color: var(--text); }
.story-export { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- reveal / motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.view-enter { animation: enter .5s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .ribbon button, .duel .track i, .share i { transform: none; }
  .vg { opacity: 1; }
}
.no-js .reveal, .reveal.static { opacity: 1; transform: none; }


/* ======================================================================================================================================
   Insights V2: compact football intelligence. Same tokens (Figma neutrals), same type, one 960px container; components below.
   ====================================================================================================================================== */
.v2-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.v2-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1; letter-spacing: -.005em; }
.v2-head { padding-bottom: 6px; }
.v2-lede { max-width: 40em; margin: 8px 0 0; color: var(--muted); font-size: .9375rem; text-wrap: pretty; }
.v2-h { margin: 26px 0 8px; font-family: var(--display); font-weight: 800; font-size: 1.375rem; line-height: 1; }

/* sticky filter / sort bar */
.rp { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--raise); color: var(--text); font: 800 .6875rem/1 var(--body); font-style: normal; }
.rp.W { background: var(--win); color: #fff; } .rp.L { background: var(--loss); color: #fff; } .rp.D { background: var(--deep); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.rp:empty { background: none; }

/* avatars: circular portrait inside a restrained Blaugrana ring; same ring with initials when there is no verified photo */
.avatar { position: relative; display: inline-block; flex: none; width: var(--as, 56px); height: var(--as, 56px); padding: 2px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--garnet)); }
.avatar img, .av-init { display: block; width: 100%; height: 100%; border: 2px solid var(--ink); border-radius: 50%; background: var(--deep); object-fit: cover; }
.av-init { display: grid; place-items: center; color: var(--muted); font: 800 calc(var(--as, 56px) * .3) / 1 var(--body); letter-spacing: .02em; }

/* home */
.v2-grid { display: grid; gap: 12px; margin-top: 16px; }
.card { position: relative; display: grid; align-content: start; gap: 10px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--night); }
a.card { transition: transform .15s var(--ease); }
a.card:active { transform: scale(.992); }
.c-result::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue) 0 50%, var(--garnet) 50% 100%); }
.c-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.c-kick { color: var(--gold-ink); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.c-date { color: var(--muted); font-size: .8125rem; }
.c-link { display: inline-flex; align-items: center; gap: 2px; min-height: 28px; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.c-ctx { display: flex; align-items: center; color: var(--slate); font-size: .875rem; font-weight: 700; }
.card .c-ctx { color: var(--text); }
.c-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.c-team { display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; }
.c-team b { font-size: .9375rem; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.c-team .crest { margin: 0; }
.c-num { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 900; font-size: clamp(3rem, 15vw, 4rem); line-height: .9; }
.c-num i { color: var(--faint); font-size: .6em; font-style: normal; }
.c-num b.win, .md-num b.win { color: var(--gold-ink); }
.c-fact { color: var(--slate); font-size: .875rem; text-wrap: pretty; }
.c-cta { display: flex; align-items: center; gap: 2px; color: var(--text); font-size: .875rem; font-weight: 800; }
.c-fixture { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.c-fixture b { font-weight: 800; }
.c-fixture em { color: var(--faint); font-style: normal; }
.c-fixture .crest { margin: 0; }
.c-h { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1; }
.duels.tight { gap: 12px; margin-top: 10px; max-width: none; }
.card .duel-names, .card .duels { width: 100%; margin-inline: 0; }
.card .duel-names { margin-top: 2px; font-size: .8125rem; }
.card .duel .row b { font-size: 1.25rem; }
.fm-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fm { display: grid; justify-items: center; gap: 5px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 12px; }
.fm .crest { margin: 0; }
.fm small { color: var(--muted); font-size: .75rem; font-weight: 700; }
.rec { margin: 0; color: var(--muted); font-size: .875rem; }
.rec b { color: var(--text); font-weight: 800; }
.v2-block { margin-top: 22px; }
.blk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.blk-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.375rem; }
.prail { display: flex; gap: 14px; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.prail::-webkit-scrollbar { display: none; }
.pchip { display: grid; flex: none; justify-items: center; gap: 6px; width: 84px; text-align: center; scroll-snap-align: start; }
.pchip b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 800; }
.pchip small { color: var(--muted); font-size: .75rem; font-weight: 600; }

/* matches */
.mwrap { padding-top: 2px; }
.mlist { margin: 0; padding: 0; list-style: none; }
.mlist > li { list-style: none; }
.mrow { position: relative; display: grid; grid-template-columns: 20px 50px minmax(0, 1fr) auto 20px 16px; align-items: center; column-gap: 10px; min-height: 66px; padding: 8px 4px 8px 14px; border-bottom: 1px solid var(--line); }
.mrow::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--comp, var(--line-strong)); }
.mrow[data-comp="laliga"] { --comp: var(--comp-laliga); }
.mrow[data-comp="ucl"] { --comp: var(--comp-ucl); }
a.mrow:active { background-color: var(--night); }
.mr-badge { display: grid; place-items: center; }
.mr-badge .crest { margin: 0; }
.mr-when { display: grid; line-height: 1.15; }
.mr-when b { font-size: .875rem; white-space: nowrap; }
.mr-when small { color: var(--muted); font-size: .75rem; font-weight: 700; }
.mr-teams { display: grid; gap: 4px; min-width: 0; }
.mr-team { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--slate); }
.mr-team .crest { margin: 0; }
.mr-team .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; }
.mr-team.win { color: var(--text); font-weight: 800; }
/* hierarchy: identity (badge, crests, names) first, final scores strong, an upcoming kick-off visible but quiet */
.mr-score { display: grid; gap: 4px; color: var(--slate); font-family: var(--display); font-size: 1.375rem; font-weight: 800; line-height: 1; text-align: right; }
.mr-score b.win { color: var(--text); font-weight: 900; }
.mr-time { color: var(--muted); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.mrow.up .mr-team { color: var(--text); font-weight: 700; }
.mr-go { display: grid; place-items: center; color: var(--faint); }
.m-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 4px; font-family: var(--display); font-size: 1.125rem; font-weight: 800; letter-spacing: .02em; }
.m-divider::before, .m-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.m-divider em { color: var(--muted); font-size: .875rem; font-style: normal; }
.m-end { padding: 14px 0; color: var(--muted); font-size: .875rem; }

/* match detail */
.md { padding-top: 4px; }
.md-head { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.md-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.md-ctx { display: flex; align-items: center; color: var(--slate); font-size: .875rem; font-weight: 700; }
.md-ctx { color: var(--text); }
.md-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin-top: 12px; }
.md-side { display: grid; justify-items: center; gap: 8px; min-width: 0; text-align: center; }
.md-side b { font-size: 1rem; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.md-side .crest { margin: 0; }
.md-mid { display: grid; justify-items: center; gap: 4px; padding-top: 2px; }
.md-num { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 900; font-size: clamp(3.5rem, 18vw, 5.25rem); line-height: .85; }
.md-num i { color: var(--faint); font-size: .55em; font-style: normal; }
.md-mid small { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .1em; }
.md-score.sched .md-mid b { font-size: 1.0625rem; font-weight: 800; line-height: 1.1; }
.md-score.sched .md-mid .md-vs { color: var(--faint); font-family: var(--display); font-size: 2rem; font-style: normal; font-weight: 800; line-height: 1; }
.md-score.sched .md-mid small { letter-spacing: .02em; }
.md-scorers { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr); gap: 0 8px; margin-top: 12px; font-size: .875rem; }
.md-scorers ul.r { grid-column: 3; }
.md-mid { min-width: 120px; }
.md-scorers ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; color: var(--slate); text-align: center; }
.md-scorers ul.r { text-align: center; }
.md-scorers li span { margin-right: 6px; color: var(--muted); font-weight: 700; }
.md-scorers ul.r li span { margin-right: 6px; }
.md-scorers small { color: var(--muted); }
.md-meta { margin: 10px 0 0; color: var(--muted); font-size: .8125rem; text-align: center; }
.md-note { margin-top: 20px; color: var(--muted); }
.panel { padding-top: 4px; }
.panel[hidden] { display: none; }
.panel .facts-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.panel .facts-list li { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--r-inner, 12px); background: var(--night); color: var(--slate); font-size: .9375rem; line-height: 1.4; }
.panel .contrib { margin: 8px 0 0; padding: 0; gap: 8px; max-width: none; }
.panel .contrib li { padding: 10px 14px; border-radius: 12px; }
.panel .contrib .pts em { font-size: 1.375rem; }
.panel .vgoals { height: 460px; }
.panel .vgoals-head, .panel .duel-names { margin-top: 12px; }
.src { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r-inner, 12px); background: var(--night); color: var(--muted); font-size: .8125rem; }
.src summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: var(--r-inner, 12px); color: var(--slate); cursor: pointer; font-weight: 700; list-style: none; }
.src summary::-webkit-details-marker { display: none; }
.src summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease), margin .2s var(--ease); }
.src[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
.src summary:focus-visible { outline-offset: -2px; }
.src ul { margin: 0; padding: 4px 14px 14px 32px; display: grid; gap: 8px; }
.src a { text-decoration: underline; }

/* players */
.squad { padding-top: 6px; }
.grp { margin-top: 12px; }
.grp-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; font-family: var(--display); font-size: 1.25rem; font-weight: 800; }
.grp-h em { color: var(--muted); font-size: .875rem; font-style: normal; }
.plist { margin: 0; padding: 0; list-style: none; }
.plist > li { list-style: none; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; min-height: 72px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pr-name { display: grid; min-width: 0; line-height: 1.1; }
.pr-name small { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.pr-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.125rem; font-weight: 800; }
.pr-name em { margin-top: 2px; color: var(--muted); font-size: .8125rem; font-style: normal; }
.pr-stats { display: flex; gap: 10px; }
.st { display: grid; justify-items: center; min-width: 28px; }
.st b { font-family: var(--display); font-size: 1.375rem; font-weight: 900; line-height: 1; }
.st small { color: var(--muted); font-size: .625rem; font-weight: 700; letter-spacing: .08em; }
@media (max-width: 359px) { .prow { gap: 8px; } .pr-stats { gap: 6px; } .st { min-width: 24px; } .prow .avatar { --as: 48px !important; } }

/* player profile */
.pp { padding-top: 4px; }
.pp-top { display: flex; justify-content: space-between; align-items: center; }
.pp-season { color: var(--muted); font-size: .875rem; font-weight: 700; }
.pp-id { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.pp-av { position: relative; flex: none; }
.pp-club { position: absolute; right: -6px; bottom: -2px; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: var(--night); }
.pp-club .crest { margin: 0; }
.pp-name { min-width: 0; }
.pp-meta { margin: 0 0 4px; color: var(--muted); font-size: .875rem; font-weight: 600; }
.pp-name h1 { display: grid; margin: 0; font-family: var(--display); line-height: .9; }
.pp-name h1 small { color: var(--muted); font: 600 1rem / 1.2 var(--body); }
.pp-name h1 span { font-size: clamp(2.6rem, 12vw, 3.6rem); font-weight: 900; overflow-wrap: anywhere; }
.pp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.pp-stats div { display: flex; flex-direction: column; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--night); text-align: center; }
.pp-stats dt { order: 2; margin-top: 4px; color: var(--muted); font-size: .625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pp-stats dd { margin: 0; font-family: var(--display); font-size: 1.875rem; font-weight: 900; line-height: 1; }
.pp-stats .gold dd { color: var(--gold-ink); }
.pp-note { margin: 10px 0 0; color: var(--muted); font-size: .8125rem; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cr-name { display: flex; align-items: center; font-weight: 700; }
.cr-name .crest { margin-right: .5em; }
.cr-stats { display: flex; gap: 12px; }
.cr-stats span { display: grid; justify-items: center; min-width: 30px; }
.cr-stats b { font-family: var(--display); font-size: 1.25rem; font-weight: 900; line-height: 1; }
.cr-stats small { color: var(--muted); font-size: .625rem; font-weight: 700; letter-spacing: .06em; }
.rlist { margin: 0; padding: 0; list-style: none; }
.rrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rr-main { display: grid; min-width: 0; }
.rr-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.rr-main small { color: var(--muted); font-size: .8125rem; }
.rr-chips { display: flex; gap: 6px; }
.ct { padding: 2px 7px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.ct.g { background: color-mix(in srgb, var(--blue) 24%, transparent); }
.ct.a { background: color-mix(in srgb, var(--garnet) 24%, transparent); }
.ct.y, .ct.r { width: 9px; height: 12px; padding: 0; border-radius: 2px; }
.ct.y { background: var(--gold); } .ct.r { background: var(--garnet); }
.rr-score { min-width: 3ch; color: var(--slate); font-weight: 800; text-align: right; }
.cbars { display: flex; align-items: flex-end; gap: 4px; height: 84px; border-bottom: 1px solid var(--line-strong); }
.cb { display: flex; flex: 1; flex-direction: column-reverse; height: 100%; }
.cb i { display: block; min-height: 0; border-radius: 2px; height: calc(var(--h) * 100%); }
.cb i.g { background: var(--blue); } .cb i.a { background: var(--garnet); }
.legend { display: flex; align-items: center; gap: 14px; margin: 6px 0 0; color: var(--muted); font-size: .75rem; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; }
.legend i.g { background: var(--blue); } .legend i.a { background: var(--garnet); }
.legend small { margin-left: auto; color: var(--faint); }

/* ======================================================================================================================================
   Navigation controls: ONE system (rules and tokens: docs/UI_SYSTEM.md). Every control is opaque (no backdrop blur on sticky layers),
   has a 44px hit area, shows a visible keyboard focus ring, and never scrolls the page sideways.
   .utabs   underline tabs   move between SECTIONS of one view (match detail). Sticky, scrollable when they do not fit.
   .chips   outlined pills   filter or sort a list (competition, squad sort). Sticky bar, scrollable row.
   .seg     segmented track  pick ONE VALUE for what is shown below (team, event filter, season). Filled thumb.
   ====================================================================================================================================== */
:root {
  --stick: calc(61px + env(safe-area-inset-top, 0px)); /* height of the sticky .topbar: sticky controls sit directly below it */
  --ctl: 44px;   /* minimum hit area of any control */
  --pill: 36px;  /* painted height of pills and segment thumbs (the track around a segment brings the hit area to 44px) */
  --r-pill: 999px; --r-card: 16px; --r-inner: 12px;
  --tab-accent: var(--blue);
  --pitch-a: color-mix(in srgb, var(--text-green) 24%, var(--surface-base));
  --pitch-b: color-mix(in srgb, var(--text-green) 18%, var(--surface-base));
}

.utabs { position: sticky; top: var(--stick); z-index: 30; display: flex; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--ink); }
.utabs::-webkit-scrollbar { display: none; }
.utabs a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.utabs [role="tab"], .utabs a { position: relative; flex: 1 0 auto; min-height: var(--ctl); padding: 0 12px; color: var(--muted); font-size: .9375rem; font-weight: 800; white-space: nowrap; transition: color .15s; }
.utabs [role="tab"]::after, .utabs a::after { content: ''; position: absolute; inset: auto 12px -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--tab-accent); transform: scaleX(0); transition: transform .22s var(--ease); }
.utabs [aria-selected="true"], .utabs a[aria-current="page"] { color: var(--text); }
.utabs [aria-selected="true"]::after, .utabs a[aria-current="page"]::after { transform: scaleX(1); }
.utabs a .crest { margin: 0; }
.utabs a:focus-visible, .utabs [role="tab"]:focus-visible { outline-offset: -3px; border-radius: 8px; }
@media (max-width: 359px) { .utabs [role="tab"], .utabs a { padding: 0 8px; font-size: .875rem; } .utabs [role="tab"]::after, .utabs a::after { inset-inline: 8px; } }
.panel { scroll-margin-top: calc(var(--stick) + var(--ctl) + 8px); }

.bar { position: sticky; z-index: 30; top: var(--stick); margin-top: 10px; border-bottom: 1px solid var(--line); background: var(--ink); }
.bar .wrap { padding-block: 4px; }
.chips { display: flex; gap: 8px; padding-block: 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 7px; min-height: var(--pill); padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--muted); font-size: .875rem; font-weight: 700; transition: background .15s, color .15s, border-color .15s; }
.chip-btn::before { content: ''; position: absolute; inset: -4px -2px; }
.chip-btn[aria-pressed="true"] { background: var(--raise); border-color: var(--text); color: var(--text); }
.chip-btn .crest { margin: 0; }

.seg, .seasons { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--night); }
.seg { margin-top: 16px; max-width: 100%; }
.seg.full { display: flex; width: 100%; }
.seg button, .seasons a { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: var(--pill); padding: 0 16px; border-radius: var(--r-pill); color: var(--muted); font-size: .875rem; font-weight: 700; white-space: nowrap; transition: background .18s var(--ease), color .18s; }
.seg.full button { flex: 1 1 0; }
.seg button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-pressed="true"], .seasons a[aria-current="true"] { background: var(--text); color: var(--ink); }
.seg .crest { margin: 0; }
.seg button:focus-visible, .seasons a:focus-visible { outline-offset: 1px; border-radius: var(--r-pill); }

.bar .seg { margin: 4px 0; }
.bar .seg button { padding-inline: 10px; font-size: .8125rem; }
.m-jump { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 14px); z-index: 35; min-height: 40px; padding: 0 16px; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-raised); color: var(--text); font-size: .875rem; font-weight: 700; box-shadow: 0 6px 20px var(--bf-shadow); }
.m-jump[hidden] { display: none; }
@media (min-width: 1024px) { .m-jump { bottom: 96px; } }
.back { display: inline-flex; align-items: center; min-height: var(--ctl); color: var(--muted); font-size: .875rem; font-weight: 700; }
/* The "← Matches / Players / Insights" link is a desktop and direct-link affordance; on a phone the bottom navigation and the system Back gesture do this job. */
@media (max-width: 1023.98px) { .back:not(.direct) { display: none; } }
.md-meta { display: flex; align-items: center; justify-content: center; gap: 6px; }
.md-meta .ico { flex: none; }
.md-top { min-height: var(--ctl); }

/* ---------- events ---------- */
.seg + .events { margin-top: 12px; }
.ev { grid-template-columns: 54px 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; }
.ev .m { font-size: 1.375rem; }
.ev-t { display: inline-flex; }
.ev-t .crest { margin: 0; }
.ev-ic { display: grid; place-items: center; height: 1.5rem; color: var(--muted); }
.ev-ic.goal { color: var(--gold-ink); }
.ev .dot { margin: 0; }
.ev .who .ev-l { display: block; color: var(--text); font-size: 1rem; }
.ev .who .ev-l .ev-d { display: inline; margin-left: 6px; color: var(--muted); font-size: .875rem; font-weight: 500; }

/* ---------- lineups: team selector, pitch, substitutes ---------- */
.lu { display: grid; gap: 14px; margin-top: 14px; }
.lu-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; color: var(--slate); font-size: .875rem; font-weight: 600; }
.lu-meta b { color: var(--text); font-weight: 800; }
.pitch { position: relative; width: 100%; max-width: 480px; margin-inline: auto; overflow: hidden; container-type: inline-size; border: 1px solid var(--line); border-radius: 20px; background: repeating-linear-gradient(180deg, var(--pitch-a) 0 12.5%, var(--pitch-b) 12.5% 25%); }
.pitch-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: color-mix(in srgb, var(--text) 22%, transparent); stroke-width: .35; }
.pt { position: absolute; left: var(--x); top: var(--y); display: grid; justify-items: center; gap: 3px; width: 19cqw; color: var(--text); transform: translate(-50%, -50%); }
a.pt:focus-visible { outline-offset: 0; border-radius: 12px; }
.pt-av { position: relative; display: block; }
.pt .avatar { width: clamp(34px, 11.5cqw, 54px); height: clamp(34px, 11.5cqw, 54px); }
.pitch.opp .avatar { background: var(--slate-dim); }
.pt-no { position: absolute; left: -5px; bottom: -2px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid var(--pitch-b); border-radius: 9px; background: var(--blue); color: #fff; font: 800 .6875rem/1 var(--body); }
.pitch.opp .pt-no { background: var(--text); color: var(--ink); }
.pt-nm { max-width: 20.5cqw; padding: 1px 6px; overflow: hidden; border-radius: 6px; background: color-mix(in srgb, var(--ink) 82%, transparent); font-size: clamp(.625rem, 3cqw, .75rem); font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pt-mk { position: absolute; top: -3px; right: -9px; display: grid; gap: 2px; }
.mk { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 16px; height: 16px; padding: 0 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); font: 800 .625rem/1 var(--body); font-style: normal; }
.mk b { font-weight: 800; }
.mk.og { color: var(--garnet); }
.mk.card { width: 11px; min-width: 11px; height: 15px; padding: 0; border: 0; border-radius: 2px; }
.mk.card.y { background: var(--gold); }
.mk.card.r { background: var(--garnet); }
.mk.off { position: absolute; right: -9px; bottom: -2px; color: var(--garnet); }
.lu-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.lu-key li { display: inline-flex; align-items: center; gap: 6px; }
.lu-key .mk { position: static; }
.xi { display: grid; margin: 0; padding: 0; list-style: none; }
.xi-row, .bn-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.xi-no { min-width: 2ch; color: var(--muted); text-align: right; }
.xi-nm, .bn-nm { display: grid; min-width: 0; font-weight: 800; line-height: 1.15; }
.xi-nm small, .bn-nm small { overflow: hidden; color: var(--muted); font-size: .8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bn-nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-nm b .num { color: var(--muted); }
.bench ul { display: grid; margin: 0; padding: 0; list-style: none; }
.bench .v2-h { margin-top: 8px; }
@media (min-width: 720px) { .bench ul { grid-template-columns: 1fr 1fr; column-gap: 28px; } }

.duel-note { margin: 6px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.3; text-align: center; }
.c-fact .ico { display: inline-block; margin-right: 6px; vertical-align: -2px; }

/* ---------- player hero ---------- */
.pp-head { position: relative; margin-top: 4px; padding: 4px 16px 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--blue) 30%, transparent), transparent 62%), radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--garnet) 22%, transparent), transparent 66%), var(--night); }
.pp-top { min-height: var(--ctl); }
.pp-id { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 2px; }
.pp-name { display: grid; gap: 2px; align-content: center; }
.pp-meta { margin: 0; color: var(--slate); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pp-stats { gap: 8px; margin-top: 16px; }
.pp-stats div { padding: 10px 4px 8px; border-color: var(--line); background: color-mix(in srgb, var(--ink) 55%, transparent); }
.pp-stats dt { margin-top: 4px; font-size: .625rem; letter-spacing: .08em; white-space: nowrap; }
.pp-note { margin: 12px 0 0; }
.crow { grid-template-columns: minmax(0, 1fr) auto; }
.cr-stats { gap: 4px; }
.cr-stats span { min-width: 44px; }
.chead { padding-block: 4px 6px; border-bottom-color: var(--line-strong); }
.chead .cr-stats span { color: var(--muted); font-size: .625rem; font-weight: 700; letter-spacing: .08em; }
.crow:not(.chead) .cr-stats small { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cr-name { min-width: 0; line-height: 1.2; }
.cr-link { display: inline-flex; align-items: center; gap: 0; min-height: 44px; }
.cr-link svg { margin-left: 4px; color: var(--muted); }
.cbl { display: flex; gap: 4px; margin-top: 4px; }
.cbl span { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: .5rem; font-weight: 700; letter-spacing: 0; text-align: center; }
@media (max-width: 359px) { .pp-head { padding-inline: 12px; } .pp-id { gap: 12px; } .pp-id .avatar { --as: 92px !important; } .cr-stats span { min-width: 36px; } }

/* ---------- interactive stories viewer (frames are the approved .story compositions; this only adds the viewer and the extra slide parts) ---------- */
.sv-page { display: grid; justify-items: center; gap: 12px; margin-top: 10px; }
.sv-head .v2-top { padding-top: 10px; justify-content: flex-end; }
.sv-head .v2-top:not(:has(.seasons)) { display: none; }
.sv { position: relative; width: min(100%, 420px, calc((100svh - var(--stick) - var(--tabbar) - 190px) * 9 / 16)); min-width: 250px; border-radius: 22px; outline-offset: 4px; touch-action: pan-y; -webkit-user-select: none; user-select: none; --sv-dur: 6500ms; --sv-state: running; }
.sv-stage > .story { animation: sv-in .28s var(--ease) both; }
@keyframes sv-in { from { opacity: 0; } }
.sv-bars { position: absolute; inset: 10px 12px auto; z-index: 3; display: flex; gap: 4px; pointer-events: none; }
.sv-bars i { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: rgb(255 255 255 / .28); }
.sv-bars b { display: block; width: 0; height: 100%; background: #fff; }
.sv-bars .done b { width: 100%; }
.sv-bars .on b { animation: sv-fill var(--sv-dur) linear forwards; animation-play-state: var(--sv-state); }
.sv[data-motion="off"] .sv-bars .on b { width: 100%; animation: none; }
@keyframes sv-fill { to { width: 100%; } }
.sv-zone { position: absolute; top: 0; bottom: 0; z-index: 2; width: 34%; border-radius: 0; background: none; }
.sv-zone.prev { left: 0; }
.sv-zone.next { right: 0; width: 66%; }
.sv-zone:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: -4px; border-radius: 22px; }
.sv-pause { position: absolute; top: 22px; right: 8px; z-index: 4; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(0 0 0 / .45); color: #fff; }
.sv-pause .sv-i-play, .sv-pause[data-state="paused"] .sv-i-pause { display: none; }
.sv-pause[data-state="paused"] .sv-i-play { display: inline; }
.sv[data-motion="off"] .sv-pause { display: none; }
.sv-picker { max-width: 100%; justify-content: flex-start; padding-inline: 2px; }
.sv-hint { margin: 0; color: var(--muted); font-size: .75rem; text-align: center; }
.sv-stage .s-tick { position: absolute; left: 50%; z-index: 1; padding: 0 calc(12 * var(--u)); transform: translate(-50%, -50%); background: var(--surface-page); color: var(--muted); font-size: calc(30 * var(--u)); font-weight: 600; }
.sv-stage .s-list { flex: 1 1 auto; align-content: space-evenly; margin-top: calc(30 * var(--u)); }
.sv-stage .s-pills { display: flex; gap: calc(18 * var(--u)); margin-top: calc(30 * var(--u)); }
.sv-stage .s-pill { display: grid; place-items: center; width: calc(110 * var(--u)); height: calc(110 * var(--u)); border-radius: calc(28 * var(--u)); background: var(--raise); color: var(--text); font: 900 calc(60 * var(--u)) / 1 var(--display); }
.sv-stage .s-pill.W { background: var(--blue); color: #fff; }
.sv-stage .s-pill.L { background: var(--garnet); color: #fff; }
.sv-stage .s-list { display: grid; gap: calc(26 * var(--u)); margin-top: calc(50 * var(--u)); }
.sv-stage .s-item { display: grid; grid-template-columns: calc(56 * var(--u)) auto minmax(0, 1fr) auto; align-items: center; gap: calc(26 * var(--u)); padding: calc(18 * var(--u)) calc(24 * var(--u)); border-radius: calc(36 * var(--u)); background: color-mix(in srgb, var(--text) 6%, transparent); }
.sv-stage .s-item.me { background: linear-gradient(90deg, rgb(61 123 255 / .34), rgb(224 36 94 / .26)); }
.sv-stage .s-rank { color: var(--muted); font: 900 calc(54 * var(--u)) / 1 var(--display); text-align: center; }
.sv-stage .s-who { display: grid; min-width: 0; line-height: 1.05; }
.sv-stage .s-who small { color: var(--muted); font-size: calc(34 * var(--u)); font-weight: 600; }
.sv-stage .s-who b { overflow: hidden; font: 800 calc(60 * var(--u)) / 1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.sv-stage .s-num { display: grid; justify-items: end; line-height: 1; }
.sv-stage .s-num b { font: 900 calc(96 * var(--u)) / .9 var(--display); font-variant-numeric: tabular-nums; color: var(--bf-gold); }
.sv-stage .s-num small { margin-top: calc(6 * var(--u)); color: var(--muted); font-size: calc(30 * var(--u)); font-weight: 600; white-space: nowrap; }
.sv-stage .s-crest .crest { margin: 0; }
.sv-stage .s-item .avatar { --as: calc(150 * var(--u)); }

/* ---------- full tables: sticky column header, key, onward link ---------- */
.tbl .utabs { margin-top: 14px; }
.tb-full thead th, .tb-full thead th.r { position: sticky; top: calc(var(--stick) + var(--ctl)); z-index: 5; background: var(--ink); box-shadow: 0 1px 0 var(--line); }
.tb-more { margin: 14px 0 0; }
.tb-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.tb-key span { display: inline-flex; align-items: center; gap: 5px; }
.tb-key i { width: 8px; height: 8px; border-radius: 2px; background: var(--faint); }
.tb-key [data-zone="top"] i { background: var(--blue); }
.tb-key [data-zone="next"] i { background: var(--gold); }
.tb-key [data-zone="mid"] i { background: var(--faint); }
.tb-key [data-zone="out"] i { background: var(--garnet); }
.tb-key [data-zone]::before { content: none; }

/* football media: crests, competition badges (cached local files; see media.js) */
.crest { position: relative; display: inline-block; flex: none; width: var(--cs, 24px); height: var(--cs, 24px); margin-right: .38em; vertical-align: -.2em; }
.crest img { display: block; width: 100%; height: 100%; object-fit: contain; }
.crest-badge { margin-right: .4em; vertical-align: -.3em; }
.crest-fallback { display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--deep); color: var(--muted); font: 800 calc(var(--cs, 24px) * .34) / 1 var(--body); letter-spacing: .02em; }
html.light .crest-dark { display: none; }
html:not(.light) .crest-light { display: none; }
html .story .crest-light { display: none; }
html .story .crest-dark { display: block; }
.story .s-teams .crest { margin-right: calc(24 * var(--u)); vertical-align: calc(-12 * var(--u)); }
.story .s-ctx .crest-badge { margin-right: calc(16 * var(--u)); vertical-align: calc(-8 * var(--u)); }
.story .s-photo { position: absolute; z-index: -1; right: 0; bottom: 0; width: 82%; height: 40%; object-fit: cover; object-position: 50% 0%; opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 38%), radial-gradient(ellipse at 60% 50%, #000 40%, transparent 78%); mask-image: linear-gradient(180deg, transparent 0, #000 38%), radial-gradient(ellipse at 60% 50%, #000 40%, transparent 78%); -webkit-mask-composite: source-in; mask-composite: intersect; }

@media (hover: hover) and (pointer: fine) {
  a.mrow:hover, .prow:hover .pr-name b, .rrow:hover .rr-main b { color: var(--text); }
  a.mrow:hover { background-color: var(--night); }
  .seasons a:not([aria-current="true"]):hover, .seg button[aria-pressed="false"]:hover, .chip-btn[aria-pressed="false"]:hover { background: var(--deep); color: var(--text); }
  a.card:hover { border-color: var(--line-strong); }
}
/* ---------- competition tables: overview preview + full table ---------- */
.c-comp { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.c-table { gap: 4px; }
.c-table::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--comp); }
.c-table[data-comp="laliga"] { --comp: var(--comp-laliga); }
.c-table[data-comp="ucl"] { --comp: var(--comp-ucl); }
.tb-cols, .tb-row { display: grid; grid-template-columns: 22px 22px minmax(0, 1fr) 30px 34px; align-items: center; column-gap: 8px; }
.tb-cols { padding: 4px 8px 2px; color: var(--muted); font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tb-cols span:nth-child(2) { grid-column: 2 / 4; }
.tb-cols span:nth-child(n+3) { text-align: right; }
.tb-cols span:nth-child(3) { grid-column: auto; }
.tb-list { display: grid; }
.tb-row { position: relative; min-height: 36px; padding: 0 8px; border-top: 1px solid var(--line); border-radius: 0; font-size: .9375rem; }
.tb-row:first-child { border-top-color: transparent; }
.tb-row::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: transparent; }
[data-zone="top"]::before { background: var(--blue); }
[data-zone="next"]::before { background: var(--gold); }
[data-zone="mid"]::before { background: var(--faint); }
[data-zone="out"]::before { background: var(--garnet); }
.tb-rank { color: var(--muted); font-style: normal; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.tb-row .crest { margin: 0; }
.tb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tb-p { color: var(--slate); text-align: right; font-variant-numeric: tabular-nums; }
.tb-pts { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.tb-row.me { margin-inline: -4px; padding-inline: 12px; border-radius: 10px; border-top-color: transparent; background: linear-gradient(90deg, var(--bf-stripe-blue), var(--bf-stripe-garnet)); }
.tb-row.me + .tb-row { border-top-color: transparent; }
.tb-row.me .tb-name, .tb-row.me .tb-rank, .tb-row.me .tb-pts { color: var(--text); font-weight: 900; }
.tb-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 6px; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.tb-warn { color: var(--gold-ink); font-weight: 800; }

.tbl .v2-top { display: flex; justify-content: space-between; align-items: center; }
.tb-title { margin-top: 8px; }
.tb-title .v2-title { display: flex; align-items: center; gap: 10px; }
.tbl[data-comp="laliga"] .tb-title .v2-title { color: var(--text); }
.tb-lede { margin: 6px 0 0; color: var(--slate); font-size: .9375rem; font-weight: 600; }
.tb-note { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--gold-ink); border-radius: 12px; color: var(--text); font-size: .875rem; }
.tb-scroll { margin: 16px calc(var(--gutter) * -1) 0; padding-inline: var(--gutter); }
.tb-full { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .9375rem; }
.tb-full th, .tb-full td { padding: 0; height: 44px; text-align: right; border-top: 1px solid var(--line); font-weight: 600; }
.tb-full thead th { height: 32px; border-top: 0; color: var(--muted); font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tb-full abbr { text-decoration: none; }
.tb-full .r { position: relative; width: 36px; padding-left: 8px; text-align: left; color: var(--muted); font-weight: 800; }
.tb-full tbody .r::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: transparent; }
.tb-full tr[data-zone="top"] .r::before { background: var(--blue); }
.tb-full tr[data-zone="next"] .r::before { background: var(--gold); }
.tb-full tr[data-zone="mid"] .r::before { background: var(--faint); }
.tb-full tr[data-zone="out"] .r::before { background: var(--garnet); }
.tb-full .zdot { display: none; }
.tb-full .club { text-align: left; font-weight: 700; }
.tb-full .club .crest { display: inline-flex; margin: 0 10px 0 0; vertical-align: middle; }

.tb-full .nm-full { display: none; }
.tb-full .x, .tb-full .xx { display: none; }
.tb-full td, .tb-full th:not(.r):not(.club) { width: 34px; font-variant-numeric: tabular-nums; }
.tb-full td.club { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-full .gd { width: 40px; color: var(--slate); }
.tb-full .pts { width: 40px; padding-right: 6px; color: var(--text); }
.tb-full .pts b { font-weight: 900; }
.tb-full tr.me { background: linear-gradient(90deg, var(--bf-stripe-blue), var(--bf-stripe-garnet)); }
.tb-full tr.me .club, .tb-full tr.me .r, .tb-full tr.me .pts { color: var(--text); font-weight: 900; }
.tb-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--slate); font-size: .8125rem; font-weight: 600; }
.tb-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tb-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--faint); }
.tb-legend [data-zone="top"] i, .tb-legend[data-zone="top"] i { background: var(--blue); }
.tb-legend li[data-zone="next"] i { background: var(--gold); }
.tb-legend li[data-zone="mid"] i { background: var(--faint); }
.tb-legend li[data-zone="out"] i { background: var(--garnet); }
.tb-legend li::before { content: none !important; }
.tb-meta { min-height: 1em; margin: 12px 0 0; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.tb-ko { margin-top: 24px; }
@media (min-width: 400px) { .tb-full .x { display: table-cell; } }
@media (min-width: 720px) {
  .tb-full th, .tb-full td { height: 48px; }
  .tb-full .nm-short { display: none; } .tb-full .nm-full { display: inline; }
  .tb-full th.xx, .tb-full td.xx { display: table-cell; width: 84px; padding-right: 10px; color: var(--slate); }
  .tb-full th.gd, .tb-full td.gd { width: 52px; }
  .tb-scroll { margin-inline: 0; padding-inline: 0; }
  .c-table .tb-row { min-height: 38px; }
}

@media (min-width: 720px) {
  .v2-grid { grid-template-columns: 1fr 1fr; }
  .c-result, .c-form { grid-column: 1 / -1; }
  .c-result .c-score { max-width: 560px; margin-inline: auto; width: 100%; }
  .md-scorers { max-width: 560px; margin-inline: auto; }
  .c-form .fm-row { gap: 10px; }
  .c-form .fm { padding: 12px 4px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 20px; }
  body { padding-bottom: 0; }
  .panel .vgoals { height: 520px; }
  .stories { grid-template-columns: repeat(4, 1fr); }
  .prail { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .plist { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
}

/* the phone shell's static footer is not part of this layout (the pages draw their own footer line) */
.site-footer { display: none; }
