/* ScoreHub: dark, dense, built for scanning scores quickly. */
:root {
  --bg: #0d0f12;
  --panel: #14171c;
  --card: #1a1e24;
  --card-hover: #20252c;
  --line: #272c34;
  --text: #eef1f5;
  --muted: #8b94a3;
  --accent: #f2b134;
  --live: #ff4d5e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Barlow Semi Condensed", system-ui, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.4;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 32px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.brand::before { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .28); }
.main-nav { display: flex; gap: 24px; height: 100%; }
.main-nav a, .navbtn {
  display: flex; align-items: center; height: 100%; padding: 3px 0 0;
  background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); font: inherit; font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer;
}
.main-nav a:hover, .navbtn:hover { color: var(--text); }
.main-nav a.on, .navbtn.on { color: var(--text); border-bottom-color: var(--accent); }
.pills { display: flex; gap: 8px; padding-top: 16px; padding-bottom: 16px; }
.pills a { padding: 7px 18px; border-radius: 999px; background: var(--card); font-weight: 600; text-decoration: none; }
.pills a:hover { background: var(--card-hover); }
.pills a.on { background: #fff; color: #0d0f12; }

/* ---------- home: sidebar + matches ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 620px); gap: 20px; justify-content: center; align-items: start; padding-bottom: 64px; }
.sidebar { background: var(--panel); border-radius: 14px; overflow: hidden; position: sticky; top: 12px; }
.search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 1.02rem; }
.comps h2 { margin: 0; padding: 16px 16px 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.comp-list { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 10px; max-height: calc(100vh - 230px); overflow-y: auto; }
.comp { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; }
.comp:hover { background: var(--card); }
.comp.on { background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.comp-name b { display: block; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.comp-name small { color: var(--muted); font-size: .85rem; }
.badge { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; background: hsl(var(--h) 38% 34%); }

.datenav { position: relative; display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.live-btn { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 999px; background: var(--card); font-weight: 700; text-decoration: none; }
.live-btn:hover { background: var(--card-hover); }
.live-btn.has::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.2s infinite; }
.live-btn .n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--live); color: #fff; font-size: .8rem; text-align: center; }
.live-btn.on { background: #fff; color: #0d0f12; }
.arrow { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-size: 1.7rem; line-height: 1; text-decoration: none; }
a.arrow:hover { background: var(--card); }
.arrow.off { color: #3a414c; }
.dlabel { flex: 1; text-align: center; font-weight: 700; font-size: 1.15rem; }
.cal { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--card); color: var(--text); cursor: pointer; }
.cal:hover { background: var(--card-hover); }
.cal-input { position: absolute; right: 14px; bottom: 6px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tablelink { display: inline-block; margin: 0 0 12px 4px; color: var(--accent); font-weight: 600; text-decoration: none; }
.tablelink:hover { text-decoration: underline; }

.league { margin-bottom: 14px; }
.lg-head { display: flex; align-items: center; gap: 12px; padding: 10px 6px; text-decoration: none; }
.lg-name b { display: block; font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.lg-name small { color: var(--muted); font-size: .88rem; }
.chev { margin-left: auto; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.mrow { display: flex; align-items: stretch; background: var(--card); border-radius: 12px; margin-bottom: 6px; overflow: hidden; }
.mrow:hover { background: var(--card-hover); }
.mlink { flex: 1; min-width: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; padding: 12px 0; text-decoration: none; }
.st { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .95rem; }
.st small { font-size: .75rem; font-weight: 500; }
.mrow.live .st, .mrow.live .sc { color: var(--live); }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--live); animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .25; } }
.tms { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; padding: 0 14px; }
.t { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 1.05rem; line-height: 1.4; }
.t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t img { flex: 0 0 22px; width: 22px; height: 22px; object-fit: contain; }
.sc { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 0 6px 0 4px; text-align: right; font-size: 1.05rem; line-height: 1.4; }
.sc b { min-width: 1ch; min-height: 1.4em; font-weight: 700; }
.star { flex: 0 0 46px; display: grid; place-items: center; background: none; border: 0; color: #5b6470; cursor: pointer; }
.star:hover { color: var(--text); }
.star[aria-pressed="true"] { color: var(--accent); }
.star[aria-pressed="true"] svg { fill: currentColor; }

.empty { margin: 0; padding: 48px 16px; border-radius: 14px; background: var(--panel); color: var(--muted); text-align: center; }

/* ---------- match page and league table ---------- */
.narrow { max-width: 680px; padding-bottom: 64px; }
.page-back { display: inline-block; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.page-back:hover { color: var(--text); }
.scoreboard { background: var(--panel); border-radius: 14px; padding: 18px; margin-bottom: 12px; }
.league-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; font-weight: 700; }
.country { color: var(--muted); font-size: .88rem; font-weight: 500; }
.league-line .tbl { margin-left: auto; color: var(--accent); font-size: .92rem; font-weight: 600; text-decoration: none; }
.board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 1.1rem; font-weight: 600; }
.side img { width: 64px; height: 64px; object-fit: contain; }
.mid { text-align: center; }
.big { font-size: 2.7rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.state { margin-top: 4px; color: var(--muted); font-weight: 600; }
.scoreboard.live .big, .scoreboard.live .state { color: var(--live); }
.panel { background: var(--panel); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 10px; font-size: 1rem; }
.muted { margin: 0; color: var(--muted); }
.goals { margin: 0; padding: 0; list-style: none; }
.goals li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.goals li:last-child { border-bottom: 0; }
.goals li.away { flex-direction: row-reverse; text-align: right; }
.gmin { min-width: 52px; color: var(--muted); }
.goals li.away .gmin { text-align: right; }
.gplayer small { color: var(--muted); }
.info { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.table-title { margin: 0 0 12px; font-size: 1.4rem; line-height: 1.2; }
.table-title .country { display: block; margin-top: 2px; }
.standings { padding: 8px 12px; overflow-x: auto; }
.standings table { width: 100%; border-collapse: collapse; }
.standings th, .standings td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.standings tr:last-child td { border-bottom: 0; }
.standings th { color: var(--muted); font-size: .85rem; font-weight: 500; }
.standings .tm { width: 100%; text-align: left; white-space: nowrap; }
.standings .tm img { width: 20px; height: 20px; margin-right: 10px; object-fit: contain; vertical-align: middle; }
.standings .pts { font-weight: 700; }

.stat { margin-bottom: 14px; }
.stat:last-child { margin-bottom: 0; }
.stat-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-bottom: 5px; }
.stat-head b { font-weight: 700; }
.stat-head b:last-child { text-align: right; }
.stat-head span { color: var(--muted); font-size: .92rem; }
.stat-bars { display: flex; gap: 4px; height: 6px; }
.bar { border-radius: 3px; background: var(--line); }
.bar.lead { background: var(--accent); }
.pitch { position: relative; width: 100%; max-width: 560px; margin: 0 auto 18px; aspect-ratio: 5 / 7; overflow: hidden; border-radius: 14px;
  background: repeating-linear-gradient(180deg, #1f5a33 0, #1f5a33 9.09%, #236638 9.09%, #236638 18.18%); }
.pitch-lines span { position: absolute; border: 2px solid rgba(255, 255, 255, .28); }
.pitch-lines .halfway { left: 0; right: 0; top: 50%; border-width: 2px 0 0; }
.pitch-lines .centre { left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; }
.pitch-lines .box { left: 22%; right: 22%; height: 15%; }
.pitch-lines .box.box-t { top: -2px; border-top: 0; }
.pitch-lines .box.box-b { bottom: -2px; border-bottom: 0; }
.team-tag { position: absolute; display: flex; align-items: center; gap: 6px; font-size: .78rem; color: rgba(255, 255, 255, .85); }
.team-tag img { width: 24px; height: 24px; object-fit: contain; }
.team-tag.home { top: 10px; left: 12px; }
.team-tag.away { bottom: 10px; right: 12px; flex-direction: row-reverse; }
.pl { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 24%; transform: translate(-50%, -50%); }
.shirt { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: .95rem; }
.pl.home .shirt, .bp.home .shirt { background: #fff; color: #0d0f12; }
.pl.away .shirt, .bp.away .shirt { background: #14171c; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); }
.pname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: .72rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.shirt .ico { position: absolute; display: grid; place-items: center; min-width: 15px; height: 15px; border-radius: 50%; background: #fff; color: #0d0f12; font-size: 10px; font-style: normal; line-height: 1; }
.shirt .ico small { font-size: 9px; font-weight: 700; }
.shirt .goal { top: -6px; left: -6px; }
.shirt .og { top: -6px; left: -6px; background: var(--live); color: #fff; }
.shirt .off { right: -5px; bottom: -4px; background: var(--live); color: #fff; font-weight: 700; }
.shirt .card { position: absolute; top: -6px; right: -4px; width: 9px; height: 13px; border-radius: 2px; }
.shirt .card.y { background: #f2d334; }
.shirt .card.r { background: var(--live); }
.subs, .benches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.sub { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.sub-min { min-width: 40px; color: var(--muted); font-size: 1.02rem; }
.sub-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sub-line { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: .95rem; }
.sub-line small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.arr { display: grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; border-radius: 50%; color: #fff; font-style: normal; font-size: .72rem; font-weight: 700; }
.arr.in { background: #22c55e; }
.arr.out { background: var(--live); }
.bp { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.bp .who { display: flex; flex-direction: column; min-width: 0; }
.bp .who b { font-weight: 600; line-height: 1.15; }
.bp .who small { color: var(--muted); font-size: .8rem; }
.shirt .on-badge { right: -5px; bottom: -4px; background: #22c55e; color: #fff; font-weight: 700; }
.sub-on { margin-left: auto; color: #4ade80; font-size: .85rem; }
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lu h4 { margin: 0 0 8px; font-size: 1rem; }
.lu h4 small { margin-left: 6px; color: var(--muted); font-weight: 500; }
.lu h5 { margin: 14px 0 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.players { margin: 0; padding: 0; list-style: none; }
.players li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.players li:last-child { border-bottom: 0; }
.players .num { min-width: 24px; color: var(--muted); text-align: right; }
.players.bench li { color: var(--muted); }
.coach { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { position: static; margin-bottom: 12px; }
  .comps h2 { display: none; }
  .comp-list { flex-direction: row; max-height: none; overflow-x: auto; padding: 10px 8px; }
  .comp { flex: 0 0 auto; }
  .comp-name small { display: none; }
  .search { border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .lineups { grid-template-columns: 1fr; }
  .subs, .benches { gap: 4px 12px; }
  .sub-min { min-width: 32px; font-size: .9rem; }
  .sub-line, .bp .who b { font-size: .85rem; }
  .shirt { width: 28px; height: 28px; font-size: .82rem; }
  .pname { font-size: .62rem; }
  .pl { width: 26%; }
  .pitch { aspect-ratio: 5 / 9.4; }
  .top-row { gap: 20px; }
  .mlink { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .tms { padding: 0 10px; }
  .big { font-size: 2.2rem; }
  .side img { width: 52px; height: 52px; }
  .standings .opt { display: none; }
  .live-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
/* ---- match tabs ---- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line, #2a2a2a); margin: 0 0 12px; }
.tabbtn { background: none; border: 0; color: #9a9a9a; font: inherit; font-weight: 600; padding: 12px 14px; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabbtn.tab-active { color: #fff; border-bottom-color: #fff; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.empty { color: #9a9a9a; margin: 4px 0; }

/* ---- summary timeline ---- */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 44px 1fr 56px 1fr; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.tl-min { color: #9a9a9a; font-size: 13px; }
.tl-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-cell.home { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.tl-cell.away { justify-content: flex-start; text-align: left; }
.tl-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tl-txt b { font-size: 14px; }
.tl-txt em { font-style: normal; font-size: 10px; font-weight: 700; color: #9a9a9a; margin-left: 4px; }
.tl-txt small { color: #9a9a9a; font-size: 12px; }
.tl-score { text-align: center; font-weight: 700; font-size: 13px; }
.tl-ico { flex: none; width: 18px; text-align: center; font-size: 15px; }
.tl-ico.yellow, .tl-ico.red { width: 11px; height: 15px; border-radius: 2px; background: #f5d90a; }
.tl-ico.red { background: #e5484d; }
.tl-ico.sub { color: #3ecf8e; }
.tl-ico.var { font-size: 10px; font-weight: 700; color: #6cb4ff; }
.tl-ico.pen-miss { opacity: .45; }
.tl-div { display: flex; justify-content: space-between; padding: 9px 12px; margin: 4px 0; background: rgba(255,255,255,.05); border-radius: 6px; font-size: 13px; color: #9a9a9a; }
.tl-div b { color: #fff; }

/* ---- head to head ---- */
.h2h-tally { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; gap: 8px; margin-bottom: 14px; }
.h2h-tally b { display: block; font-size: 26px; margin-bottom: 4px; padding: 6px 0; border-radius: 8px; background: #3ecf8e; color: #08130e; }
.h2h-tally .hd b { background: #555; color: #fff; }
.h2h-tally .aw b { background: #6cb4ff; color: #07121c; }
.h2h-tally span { font-size: 12px; color: #9a9a9a; }
.h2h-sub { color: #9a9a9a; font-size: 13px; margin: 0 0 6px; }
.h2h-row { display: grid; grid-template-columns: 92px 1fr 54px 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.h2h-date { color: #9a9a9a; font-size: 12px; }
.h2h-date small { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h2h-team.r { text-align: right; }
.h2h-team.won { font-weight: 700; }
.h2h-score { text-align: center; }
@media (max-width: 520px) {
  .tl-row { grid-template-columns: 38px 1fr 48px 1fr; }
  .h2h-row { grid-template-columns: 1fr 44px 1fr; }
  .h2h-date { grid-column: 1 / -1; }
}

/* ---- goal alerts button ---- */
.bell { margin-left: auto; background: rgba(255,255,255,.08); color: #ddd; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.bell[hidden] { display: none; }
.bell.bell-on { background: #f5a623; color: #1a1200; }
@media (max-width: 520px) { .bell span { display: none; } .bell { padding: 8px 12px; } }

/* ---- player photos and ratings ---- */
.shirt .ph { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #e6e8ec; }
.pl.away .shirt .ph, .bp.away .shirt .ph { background: #2a2f38; }
.shirt .motm { top: -6px; right: -6px; background: #3b6cf5; color: #fff; }
.pl .rate { margin-top: -9px; position: relative; z-index: 1; }
.rate { min-width: 28px; padding: 1px 5px; border-radius: 4px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; line-height: 1.35; }
.rate.red { background: #d93a3a; }
.rate.orange { background: #e8852b; }
.rate.yellow { background: #d9b415; color: #1a1500; }
.rate.green { background: #1fb45a; }
.rate.blue { background: #3b6cf5; }
.bp .rate { margin-left: auto; }
.pname small { color: #b9bec7; font-weight: 700; margin-right: 2px; }
@media (max-width: 520px) { .shirt { width: 32px; height: 32px; } .rate { font-size: 10px; min-width: 24px; } }

/* ---- more sports ---- */
.pills { overflow-x: auto; scrollbar-width: none; }
.pills a { white-space: nowrap; }
.sc.txt { font-size: .85rem; max-width: 46vw; }
.sc.txt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cscore { font-style: normal; font-size: .9rem; font-weight: 600; color: var(--muted); }
.scoreboard.live .cscore { color: var(--live); }

/* Highlights tab */
.hl-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.hl-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hl-meta { margin: 8px 0 0; color: #9a9a9a; font-size: .85rem; }
.hl-note { margin: 0 0 10px; color: #9a9a9a; }
.hl-btn { display: inline-block; margin-top: 12px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line, #2a2a2a); color: inherit; text-decoration: none; font-weight: 600; font-size: .9rem; }
.hl-btn:hover { background: rgba(255,255,255,.06); }

/* Footer and text pages */
.site-footer { margin-top: 40px; padding: 20px 0 32px; border-top: 1px solid var(--line, #2a2a2a); color: #8a8a8a; font-size: .85rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.site-footer a { color: #b5b5b5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { margin: 0; }
.doc { padding-top: 16px; line-height: 1.6; }
.doc h1 { font-size: 1.6rem; margin: 8px 0 4px; }
.doc h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.doc p, .doc li { color: #cfcfcf; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--accent, #f5b335); }
.doc .updated { color: #8a8a8a; font-size: .85rem; margin: 0 0 14px; }