:root {
  --red: #c8102e; --red-2: #9e0b23; --gold: #e8b923; --ink: #16161a; --ink-2: #4a4a55; --ink-3: #777784;
  --bg: #f4f2ef; --card: #ffffff; --line: #e3dfd9; --soft: #f8f6f3;
  --win: #1f8a4c; --draw: #b08a12; --loss: #c8102e; --opp: #2f5d9e;
  --pitch: #2e7d4f; --pitch-2: #2a7448; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --radius: 12px; font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1efec; --ink-2: #c4c0bb; --ink-3: #9a958f; --bg: #121214; --card: #1c1c20; --line: #2e2e34;
    --soft: #232328; --win: #3fbf74; --draw: #e0b53a; --loss: #ff5a6e; --opp: #79a6ea; --red: #e0283f;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
a:hover { color: var(--red); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.3rem; margin-top: 1.6rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; } .tiny { font-size: .75rem; }
.loading { padding: 3rem; text-align: center; color: var(--ink-3); }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem 1.2rem; background: #111; color: #fff; border-bottom: 3px solid var(--red); }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; white-space: nowrap; }
.brand:hover { color: #fff; }
.crest { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red);
  color: var(--gold); font-weight: 800; font-size: .85rem; border: 2px solid var(--gold); }
nav { display: flex; gap: .2rem; flex-wrap: wrap; }
nav a { color: #ddd; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; font-size: .92rem; }
nav a:hover, nav a.on { background: #2a2a2a; color: #fff; }
nav a.on { box-shadow: inset 0 -2px 0 var(--gold); }
#search { margin-left: auto; min-width: 220px; padding: .45rem .7rem; border-radius: 8px; border: 1px solid #333;
  background: #1d1d1d; color: #fff; font: inherit; }
.results { position: absolute; right: 1.2rem; top: 100%; width: min(420px, calc(100vw - 2rem)); max-height: 70vh; overflow: auto;
  background: var(--card); color: var(--ink); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.results a { display: flex; gap: .6rem; align-items: center; padding: .5rem .8rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.results a:hover, .results a.sel { background: var(--soft); }
.results img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

main { max-width: 1240px; margin: 0 auto; padding: 1.2rem; }
.foot { max-width: 1240px; margin: 2rem auto; padding: 1rem 1.2rem; color: var(--ink-3); font-size: .8rem; border-top: 1px solid var(--line); }

/* building blocks */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-3); font-size: .82rem; }
.pill { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.red { background: var(--red); color: #fff; border-color: var(--red); }
.pill.gold { background: var(--gold); color: #111; border-color: var(--gold); }
.res { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 5px; color: #fff; font-weight: 700; font-size: .72rem; }
.res.W { background: var(--win); } .res.D { background: var(--draw); } .res.L { background: var(--loss); }
.btn { display: inline-flex; gap: .4rem; align-items: center; padding: .42rem .8rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; font: inherit; font-size: .88rem; cursor: pointer; }
.btn:hover { border-color: var(--red); color: var(--red); }
.btn.yt { background: #ff0000; color: #fff; border-color: #ff0000; }
.btn.yt:hover { background: #d40000; color: #fff; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .8rem 0; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { padding: .42rem .5rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; cursor: default; position: sticky; top: 0; background: var(--card); }
th[data-k] { cursor: pointer; } th[data-k]:hover { color: var(--red); }
td.n, th.n { text-align: right; }
tr.mu td { background: color-mix(in srgb, var(--red) 10%, transparent); font-weight: 600; }
tbody tr:hover td { background: var(--soft); }
tr.link { cursor: pointer; }
.score { font-weight: 700; }

/* filters */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 1rem; }
.filters select, .filters input { font: inherit; font-size: .88rem; padding: .38rem .55rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }

/* hero */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; background: #111 center/cover; color: #fff; min-height: 220px; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.82)); }
.hero > div { position: relative; z-index: 1; padding: 1.3rem 1.4rem; width: 100%; }
.hero h1 { font-size: 2.3rem; }
.hero .credit { position: absolute; right: .6rem; top: .4rem; z-index: 1; font-size: .68rem; opacity: .75; }
.hero .credit a { color: #fff; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.person .ph { aspect-ratio: 4/5; background: var(--soft) center 18%/cover; display: grid; place-items: center; color: var(--ink-3); font-size: 2rem; font-weight: 700; }
.person div.t { padding: .5rem .6rem .65rem; }
.person b { display: block; font-size: .92rem; line-height: 1.2; }
.person span { font-size: .78rem; color: var(--ink-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: center 20%; vertical-align: middle; background: var(--soft); }
.profile { display: grid; grid-template-columns: 240px 1fr; gap: 1.2rem; }
.profile .ph { border-radius: var(--radius); aspect-ratio: 4/5; background: var(--soft) center 18%/cover; }
@media (max-width: 640px) { .profile { grid-template-columns: 1fr; } .profile .ph { max-width: 260px; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .8rem 0; }
.facts div { background: var(--soft); border-radius: 8px; padding: .45rem .6rem; }
.facts b { display: block; } .facts span { font-size: .75rem; color: var(--ink-3); }

/* kits */
.kits { display: flex; gap: 1rem; flex-wrap: wrap; }
.kitwrap { text-align: center; font-size: .78rem; color: var(--ink-3); }
.kit { position: relative; width: 100px; height: 135px; margin: 0 auto .2rem; }
.kit > div { position: absolute; overflow: hidden; }
.kit img { display: block; position: absolute; left: 0; top: 0; max-width: none; }
.kit.sm { transform: scale(.55); transform-origin: top left; width: 55px; height: 75px; }
.kit.sm > .inner { position: absolute; left: 0; top: 0; width: 100px; height: 135px; }

/* match */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; text-align: center; }
.scoreboard .team { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-weight: 700; font-size: 1.1rem; }
.scoreboard .team img { width: 64px; height: 64px; object-fit: contain; }
.scoreboard .big { font-size: 3rem; font-weight: 800; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.timeline { position: relative; margin: .5rem 0; }
.tl-row { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: .6rem; padding: .28rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tl-row .min { text-align: center; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl-row .l { text-align: right; } .tl-row .r { text-align: left; }
.tl-row.phase { grid-template-columns: 1fr; text-align: center; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 0; }
.ico { display: inline-block; min-width: 1.2em; text-align: center; }
.card-y { display: inline-block; width: .65em; height: .9em; background: #f5c400; border-radius: 2px; vertical-align: -1px; }
.card-r { display: inline-block; width: .65em; height: .9em; background: #e0102e; border-radius: 2px; vertical-align: -1px; }
.statbar { display: grid; grid-template-columns: 4rem 1fr 4rem; gap: .5rem; align-items: center; font-size: .86rem; margin: .32rem 0; }
.statbar .lab { grid-column: 1 / -1; text-align: center; color: var(--ink-3); font-size: .75rem; margin-bottom: -.15rem; }
.statbar .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--soft); }
.statbar .bar i { display: block; height: 100%; }
.statbar .v { font-weight: 700; font-variant-numeric: tabular-nums; } .statbar .v.r { text-align: right; }
.pitch { width: 100%; height: auto; display: block; border-radius: 10px; }
.lu { columns: 2; column-gap: 1.2rem; font-size: .86rem; }
.lu li { break-inside: avoid; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .22rem 0; border-bottom: 1px solid var(--line); }
.comm { max-height: 420px; overflow: auto; font-size: .86rem; }
.comm div { padding: .3rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 3.4rem 1fr; gap: .4rem; }
.note { background: var(--soft); border-left: 3px solid var(--gold); padding: .5rem .8rem; border-radius: 6px; font-size: .86rem; color: var(--ink-2); }

/* charts */
svg text { fill: var(--ink-3); font: 11px system-ui, sans-serif; }
svg .axis { stroke: var(--line); }
svg .lbl { fill: var(--ink-2); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin: .3rem 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #111; color: #fff; padding: .35rem .55rem; border-radius: 6px; font-size: .8rem; max-width: 280px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }

.seasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.season { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .7rem .8rem; text-decoration: none; display: grid; grid-template-columns: 56px 1fr; gap: .6rem; align-items: center; }
.season .pos { font-size: 1.6rem; font-weight: 800; }
.season .pos.p1 { color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.form { display: inline-flex; gap: 2px; }
.form .res { width: 1.15rem; height: 1.15rem; font-size: .62rem; border-radius: 3px; }
@media (max-width: 760px) {
  .top { padding: .5rem 1rem; } #search { width: 100%; margin: 0; } main { padding: 1rem; }
  h1 { font-size: 1.6rem; } .hero h1 { font-size: 1.7rem; } .scoreboard .big { font-size: 2.2rem; }
  .lu { columns: 1; } .hide-sm { display: none; }
}
.trophies { display: inline-flex; gap: 3px; flex-wrap: wrap; vertical-align: middle; }
.season .trophies { margin-top: .25rem; }
.ytv { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; }
.ytv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytv button { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border: 0; border-radius: 12px; background: #ff0000; color: #fff; font-size: 1.4rem; cursor: pointer; }
.ytv iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-top: .6rem; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; }
.kitphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 170px)); gap: .6rem; }
.kitphotos a { text-decoration: none; text-align: center; font-size: .78rem; color: var(--ink-3); }
.kitphotos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; display: block; margin-bottom: .2rem; }
.dt { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .dt { grid-template-columns: 1fr; } }
.dtlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem; max-height: 520px; overflow: auto; }
.dtpick { display: flex; gap: .5rem; align-items: center; text-align: left; font: inherit; font-size: .86rem; padding: .35rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; }
.dtpick:hover { border-color: var(--red); }
.dtpick img, .dtpick .ph0 { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: var(--soft); }
.badge { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; flex: none; }
.badge.none { display: inline-grid; place-items: center; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); color: var(--ink-3); font-weight: 700; }
a.club { display: inline-flex; align-items: center; gap: .4rem; }
.scoreboard .badge { width: 64px; height: 64px; }
img.crest { background: transparent; border: 0; object-fit: contain; }
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }
dialog.cx { border: 0; border-radius: 14px; padding: 0; width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog.cx::backdrop { background: rgba(0,0,0,.55); }
.cx-in { padding: 1.1rem 1.2rem; }
.cx-in h3 { margin: 1.1rem 0 .5rem; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin-top: .8rem; }
.cx-card { background: var(--soft); border-radius: 10px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .1rem; }
.cx-card.cx-wide { grid-row: span 2; }
.cx-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.cx-card span:not(.cx-k) { font-size: .85rem; color: var(--ink-2); }
.cx-news li { display: block; }
.cx-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.cx-price { background: var(--soft); border-radius: 10px; padding: .6rem .75rem; display: flex; flex-direction: column; }
.cx-price b { font-size: 1.5rem; }
.cx-price span { font-size: .8rem; color: var(--ink-2); }
.cx-card .btn { align-self: flex-start; margin-top: .4rem; }
.cupgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.cupm { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .4rem; border-radius: 10px; text-decoration: none; background: var(--soft); border-top: 4px solid var(--line); text-align: center; }
.cupm.W { border-top-color: var(--win); } .cupm.D { border-top-color: var(--draw); } .cupm.L { border-top-color: var(--loss); }
.cupm b { font-size: 1.25rem; } .cupo { font-size: .82rem; line-height: 1.15; }
.bracket { display: flex; align-items: stretch; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; }
.round { min-width: 150px; flex: 1; display: flex; flex-direction: column; gap: .4rem; padding: .5rem; border-radius: 12px; background: color-mix(in srgb, var(--win) 7%, transparent); }
.round.out { background: color-mix(in srgb, var(--loss) 9%, transparent); }
.round.final.through { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.rname { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); text-align: center; font-weight: 700; }
.agg, .verdict { text-align: center; font-size: .82rem; }
.verdict { font-weight: 700; margin-top: auto; }
.arrow { align-self: center; color: var(--ink-3); font-size: 1.4rem; }
.cuppath { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.cuppath span { font-size: .66rem; padding: 1px 4px; border-radius: 4px; color: #fff; font-weight: 700; }
.cuppath .w { background: var(--win); } .cuppath .l { background: var(--loss); } .cuppath .g { background: var(--opp); }

/* retro sticker card: our own design, in the spirit of 1990s album stickers */
.sticker { position: relative; margin: 0; width: 100%; max-width: 260px; aspect-ratio: 5 / 7; background: #fdfcf8; border-radius: 10px; padding: 9px;
  box-shadow: 0 1px 0 #e6e1d6, 0 10px 24px rgba(0,0,0,.28), 0 2px 4px rgba(0,0,0,.2); transform: rotate(-1.6deg); transition: transform .3s ease; }
.sticker:hover { transform: rotate(0deg) scale(1.02); }
.st-in { position: relative; height: 100%; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
  background: #c8102e; border: 2px solid #111; }
.st-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; background: #111; color: #fbe122;
  font: 800 .78rem/1 "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif; font-stretch: condensed; letter-spacing: .08em; text-transform: uppercase; }
.st-top .badge { width: 22px; height: 22px; }
.st-photo { position: relative; flex: 1; margin: 6px 6px 0; border-radius: 4px; overflow: hidden; border: 2px solid #fbe122;
  background: radial-gradient(circle, rgba(255,255,255,.28) 1.4px, transparent 1.6px) 0 0 / 7px 7px, linear-gradient(160deg, #e4233f, #8e0a1f); }
.st-img { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; }
.st-none { display: grid; place-items: center; color: rgba(255,255,255,.85); font: 800 3.4rem/1 Arial, sans-serif; }
.st-num { position: absolute; top: 6px; left: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #fbe122; color: #111; font: 900 1.05rem/1 Arial, sans-serif; border: 2px solid #111; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.st-tag { position: absolute; top: 8px; right: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(17,17,17,.82); color: #fbe122; font: 700 .72rem/1.3 Arial, sans-serif; }
.st-name { position: absolute; left: -4px; right: -4px; bottom: 10px; transform: skewY(-4deg); background: #111; padding: 5px 10px 6px; border-top: 3px solid #fbe122; border-bottom: 3px solid #fbe122; }
.st-name span { display: block; transform: skewY(4deg); color: #fff; text-align: center; text-transform: uppercase;
  font: 900 1.05rem/1.05 "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif; font-stretch: condensed; letter-spacing: .03em; }
.st-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; }
.st-stats div { background: #fdfcf8; border-radius: 4px; text-align: center; padding: 3px 0 2px; border: 1.5px solid #111; }
.st-stats b { display: block; color: #c8102e; font: 900 1.15rem/1 Arial, sans-serif; }
.st-stats span { display: block; color: #111; font: 700 .58rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.st-foot { display: flex; justify-content: space-between; gap: 4px; padding: 3px 8px 5px; color: #fff; font: 700 .66rem/1.2 Arial, sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.st-gloss { position: absolute; inset: 9px; border-radius: 6px; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 68%, rgba(255,255,255,.12) 100%); mix-blend-mode: screen; }
@media (max-width: 640px) { .sticker { margin: 0 auto; } }
