:root {
  --bg: #060a13;
  --bg-2: #0a1120;
  --panel: #0e1728;
  --panel-2: #121d33;
  --line: #1c2a44;
  --text: #e9eef7;
  --muted: #8794ad;
  --gold: #f6b928;
  --gold-2: #ffd261;
  --gold-ink: #1a1203;
  --win: #35d08a;
  --loss: #ff5d6d;
  --draw: #8794ad;
  --radius: 14px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(246, 185, 40, .08), transparent 60%),
                    radial-gradient(900px 400px at -10% 0%, rgba(40, 90, 200, .12), transparent 60%);
  background-repeat: no-repeat;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.gold { color: var(--gold); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(6, 10, 19, .92);
  border-bottom: 1px solid var(--line); }
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  backdrop-filter: blur(10px); }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.name-toggle { font: 600 12px/1 var(--font); color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.name-toggle:hover, .name-toggle[aria-pressed="true"] { color: var(--gold); border-color: rgba(246, 185, 40, .5); }
.name-toggle:focus-visible, .menu-btn:focus-within, .nav-drop summary:focus-visible, .nav-link:focus-visible, .nav-panel a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--gold); }
.brand-en { font: 700 22px/1 var(--display); letter-spacing: .06em; }
.brand-en.small { font-size: 18px; }
.brand-zh { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.site-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-drop { position: relative; }
.nav-drop summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  font-weight: 700; font-size: 15px; color: var(--text); padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--gold); border-bottom: 0; margin-top: 3px; }
.nav-drop[open] summary { color: var(--gold); background: rgba(246, 185, 40, .08); border-color: rgba(246, 185, 40, .35); }
.nav-label { font-weight: 700; }
.nav-current { color: var(--gold); font-size: 13px; font-weight: 600; }
.nav-current::before { content: "·"; color: var(--muted); margin-right: 6px; }
.nav-panel { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 180px; display: grid; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.nav-panel a { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.nav-panel a:hover { background: var(--panel-2); text-decoration: none; }
.nav-panel a[aria-current] { color: var(--gold); background: rgba(246, 185, 40, .1); }
.nav-link { font-weight: 700; font-size: 15px; color: var(--text); padding: 8px 10px; border-radius: 10px; }
.nav-link:hover { color: var(--gold); text-decoration: none; }
.nav-link[aria-current] { color: var(--gold); }
.nav-schedule { color: var(--gold-ink); background: var(--gold); border-radius: 99px; padding: 6px 14px; }
.nav-schedule:hover { color: var(--gold-ink); background: var(--gold-2); }
.menu-btn, .menu-close, .menu-backdrop { display: none; }
.site-menu-check { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.menu-bars { width: 16px; height: 12px; background:
  linear-gradient(currentColor, currentColor) 0 0 / 100% 2px,
  linear-gradient(currentColor, currentColor) 0 50% / 100% 2px,
  linear-gradient(currentColor, currentColor) 0 100% / 100% 2px;
  background-repeat: no-repeat; }

.crumbs { font-size: 13px; color: var(--muted); padding: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

main { padding: 12px 0 48px; }

/* hero */
.hero { padding: 36px 0 20px; }
.eyebrow { font: 700 13px/1 var(--display); letter-spacing: .2em; color: var(--gold); margin: 0 0 14px; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.25; margin: 0 0 14px; letter-spacing: .01em; }
.lead { color: #c4cde0; max-width: 46em; margin: 0 0 18px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; font-weight: 700; color: var(--gold-ink); background: var(--gold); padding: 10px 20px; border-radius: 10px; }
.btn:hover { background: var(--gold-2); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid rgba(246, 185, 40, .5); }

.page-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: clamp(24px, 4vw, 34px); line-height: 1.3; margin: 18px 0 12px; }
.page-title small { flex-basis: 100%; display: block; font: 600 15px/1.4 var(--display); letter-spacing: .08em; color: var(--muted); margin-top: 0; }
.league-mark { width: 20px; height: 20px; object-fit: contain; flex: none; }
.page-title .league-mark { width: 32px; height: 32px; }

/* blocks */
.block { margin-top: 28px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-bottom: 2px solid var(--line); margin-bottom: 10px; }
.block-head h2 { font-size: 19px; margin: 0; padding-bottom: 8px; position: relative; }
.block-head h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 36px; height: 2px; background: var(--gold); }
.block-head a, .block-head span { font-size: 13px; }

.summary { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 18px; }
.summary p { margin: 6px 0; color: #d3dae8; }

/* matches */
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.match { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.match.is-live { border-color: rgba(53, 208, 138, .6); }
.m-when { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.m-when time { color: #c4cde0; font-variant-numeric: tabular-nums; }
.m-league { display: inline-flex; align-items: center; color: var(--gold); font-weight: 700; }
.m-round { color: #1a1203; background: #ffe7a3; border: 1px solid #f6b928; padding: 1px 7px; border-radius: 6px; font-weight: 700; }
.m-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.m-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.m-team a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-team-names="en"] .m-team a { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.m-team.home { justify-content: flex-end; text-align: right; }
.match.is-done .m-team:not(.won) a { color: var(--muted); }
.m-score { font: 700 24px/1 var(--display); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.m-score small { display: block; margin-top: 3px; font: 700 11px/1.2 var(--font); letter-spacing: 0; color: var(--gold-2); }
.m-score i { font-style: normal; color: var(--muted); padding: 0 3px; }
.m-team.won { font-weight: 800; }
.m-score.vs { font-size: 15px; color: var(--muted); letter-spacing: .1em; }
.m-score.live { font: 700 13px/1 var(--font); color: var(--win); }
.match.is-done .m-score { color: var(--gold-2); }

.badge { --h: 210; flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 700 10px/1 var(--display); letter-spacing: .02em; color: #fff;
  background: var(--badge-color, linear-gradient(145deg, hsl(var(--h) 55% 42%), hsl(var(--h) 60% 24%)));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.badge.has-crest { background: #f4f7fb; padding: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.badge img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.standings caption { text-align: left; font-weight: 700; padding: 10px 14px 4px; color: var(--gold); }
.standings th { font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.standings td { padding: 8px; text-align: center; border-bottom: 1px solid rgba(28, 42, 68, .6); white-space: nowrap; }
.standings tr:last-child td { border-bottom: 0; }
.standings tbody tr:hover { background: var(--panel-2); }
.standings tr.hl { background: rgba(246, 185, 40, .1); }
.c-team { text-align: left !important; display: flex; align-items: center; gap: 8px; min-width: 150px; }
.c-team a { color: var(--text); font-weight: 600; }
.c-pos { width: 36px; color: var(--muted); }
.standings tbody tr.zone-ucl td:first-child,
.standings tbody tr.zone-division td:first-child,
.standings tbody tr.zone-playoffs td:first-child { box-shadow: inset 3px 0 0 var(--win); }
.standings tbody tr.zone-playoff td:first-child,
.standings tbody tr.zone-wildcard td:first-child,
.standings tbody tr.zone-playin td:first-child { box-shadow: inset 3px 0 0 #5b8def; }
.standings tbody tr.zone-down td:first-child { box-shadow: inset 3px 0 0 var(--loss); }
.standings tbody tr.zone-playdown td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.zone-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; margin: 8px 0 0; padding: 0; color: var(--muted); font-size: 13px; }
.zone-legend li { display: inline-flex; align-items: center; gap: 6px; }
.zone-legend i { width: 10px; height: 10px; border-radius: 2px; }
.z-ucl, .z-division, .z-playoffs { background: var(--win); }
.z-playoff, .z-wildcard, .z-playin { background: #5b8def; }
.z-down { background: var(--loss); }
.z-playdown { background: var(--gold); }
.z-out { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); }
.c-pts { font-weight: 700; color: var(--gold-2); }
.form { display: inline-flex; gap: 3px; }
.form i { font-style: normal; font-size: 11px; width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; color: #08111f; font-weight: 700; }
.f-W { background: var(--win); } .f-D { background: var(--draw); } .f-L { background: var(--loss); }
.grid-2 { display: grid; gap: 14px; }

/* cards */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { text-decoration: none; border-color: rgba(246, 185, 40, .55); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; font: 600 12px/1 var(--display); letter-spacing: .12em; color: var(--muted); }
.card-title { font-size: 22px; font-weight: 800; margin: 8px 0 10px; }
.card-line { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.card-line b { margin-left: auto; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.sport-group + .sport-group { margin-top: 18px; }
.sport-group h3 { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.card-line .tn { overflow-wrap: anywhere; }

/* team */
.team-head { display: flex; align-items: center; gap: 14px; }
.team-head .badge { width: 54px; height: 54px; font-size: 16px; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 6px 0 16px; }
.stat-strip div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.stat-strip b { font: 700 26px/1.1 var(--display); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 12px; color: var(--muted); }
.stat-strip .wide { grid-column: span 2; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.team-grid a { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); font-size: 14px; }
.team-grid a:hover { border-color: rgba(246, 185, 40, .5); text-decoration: none; }
.back { margin-top: 28px; }

.prose { max-width: 46em; }
.prose h2 { font-size: 18px; margin-top: 24px; }
.mail { font: 700 18px/1 var(--display); letter-spacing: .04em; color: var(--gold-2); }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 24px 0; font-size: 14px; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.foot-grid p { margin: 6px 0 0; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--muted); }

@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .matches { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .brand-zh { display: none; }
}
@media (max-width: 859px) {
  .brand-en { font-size: 18px; }
  .mark { width: 21px; height: 21px; }
  .top-row { min-height: 52px; gap: 8px; }
  .top-actions { gap: 6px; }
  .name-toggle { font-size: 11px; padding: 8px 8px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1 var(--font); color: var(--text);
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
  .site-nav { display: none; }
  .top:has(.site-menu-check:checked) .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(4, 8, 16, .55); }
  .top:has(.site-menu-check:checked) .site-nav { display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); margin: 0; padding: 16px 16px 28px;
    background: var(--bg-2); border-left: 1px solid var(--line); overflow: auto; }
  .menu-close { display: inline-flex; align-self: flex-end; margin: 0 0 8px; font: 700 14px/1 var(--font); color: var(--text);
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
  .nav-drop { width: 100%; }
  .nav-drop summary, .nav-drop[open] summary { width: 100%; padding: 12px 4px 4px; color: var(--gold);
    font-size: 13px; letter-spacing: .08em; background: transparent; border-color: transparent; }
  .nav-drop summary::after { display: none; }
  .site-nav .nav-drop:not([open]) > .nav-panel { display: grid; }
  .nav-panel { position: static; min-width: 0; padding: 0 0 8px; border: 0; box-shadow: none; background: transparent; }
  .nav-panel a { display: flex; padding: 10px 12px; }
  .nav-link { display: block; padding: 10px 12px; }
  .nav-schedule { text-align: center; margin-top: 8px; }
  body:has(.site-menu-check:checked) { overflow: hidden; }
}
@media (max-width: 560px) {
  .hide-s { display: none; }
  .m-score { font-size: 21px; min-width: 52px; }
  .m-team { font-size: 14px; gap: 6px; }
  .badge { width: 24px; height: 24px; font-size: 9px; }
  .stat-strip .wide { grid-column: span 2; }
}

.page-links { margin: 0 0 12px; font-weight: 700; }
.prose.guide h2, .glossary-table tr { scroll-margin-top: 88px; }
.glossary-anchor { display: block; height: 0; scroll-margin-top: 76px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.glossary-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.glossary-tabs a { font-weight: 700; color: var(--muted); padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); }
.glossary-tabs a:hover { color: var(--text); text-decoration: none; border-color: rgba(246, 185, 40, .45); }
.glossary-tabs a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.glossary-tabs a[aria-current="true"],
.glossary:not(:has(:target)) .glossary-tabs a[href="#football"],
.glossary:has(> #football:target) .glossary-tabs a[href="#football"],
.glossary:has(> [data-sport="football"] :target) .glossary-tabs a[href="#football"],
.glossary:has(> #baseball:target) .glossary-tabs a[href="#baseball"],
.glossary:has(> [data-sport="baseball"] :target) .glossary-tabs a[href="#baseball"],
.glossary:has(> #basketball:target) .glossary-tabs a[href="#basketball"],
.glossary:has(> [data-sport="basketball"] :target) .glossary-tabs a[href="#basketball"] {
  color: var(--gold-ink); background: var(--gold); border-color: var(--gold); text-decoration: none; }
.glossary-panel { display: none; }
.glossary:not(:has(:target)) > [data-sport="football"],
.glossary:has(> #football:target) > [data-sport="football"],
.glossary:has(> #baseball:target) > [data-sport="baseball"],
.glossary:has(> #basketball:target) > [data-sport="basketball"],
.glossary-panel:has(:target) { display: block; }
.glossary-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; }
.glossary-table th, .glossary-table td { text-align: left; vertical-align: top; padding: 12px 14px;
  border-bottom: 1px solid var(--line); white-space: normal; }
.glossary-table tr:last-child th, .glossary-table tr:last-child td { border-bottom: 0; }
.glossary-table thead th { color: var(--muted); font-size: 12px; font-weight: 700; }
.glossary-table tbody th { width: 9.5em; font-weight: 800; }
.glossary-table tbody th a { color: var(--text); }
.glossary-table td { color: #d3dae8; }
.glossary-table tr:target { background: rgba(246, 185, 40, .1); }
@media (max-width: 640px) {
  .glossary-table, .glossary-table thead, .glossary-table tbody, .glossary-table tr, .glossary-table th, .glossary-table td { display: block; width: auto; }
  .glossary-table { border: 0; background: transparent; overflow: visible; }
  .glossary-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .glossary-table tr { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 12px 14px; margin: 0 0 10px; }
  .glossary-table tbody th, .glossary-table td { display: block; width: auto; padding: 0; border: 0; }
  .glossary-table td { margin-top: 4px; }
}

/* focus line holds several inline team names; keep it as normal text flow */
.card-line.muted { display: block; }

.guide-card-title { font-size: 17px; line-height: 1.45; margin: 4px 0 8px; }

.prose ul { padding-left: 1.3em; margin: 8px 0 14px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--gold-2); }
.prose ol { padding-left: 1.4em; margin: 8px 0 14px; }

.player-en { font-weight: 700; }
.player-zh { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.c-team.player { min-width: 180px; }
.leader-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bracket { display: flex; flex-direction: column; gap: 16px; }
.br-round { order: var(--mobile); }
.br-round h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .06em; color: var(--gold); }
.series { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; margin: 0 0 8px; }
.series-row { display: flex; align-items: center; gap: 6px; min-height: 28px; font-weight: 600; }
.series-row b { margin-left: auto; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.series-row.won { font-weight: 800; }
.series-row.won .tn { color: var(--text); }
.series-tbd { color: var(--muted); }
@media (min-width: 900px) {
  .bracket.is-split, .bracket.is-rounds { flex-direction: row; align-items: center; }
  .bracket .br-round { order: var(--col); flex: 1 1 0; min-width: 0; }
}
