:root {
  --bg: #101215;
  --surface: #171a1f;
  --surface-2: #1d2127;
  --text: #f1eef0;
  --muted: #9b969c;
  --line: #2b3037;
  --line-strong: #3a414b;
  --accent: #ec4f87;
  --accent-soft: #2b1721;
  --green: #54bd8d;
  --red: #e27669;
  --amber: #c4a36f;
  --logo-bg: rgba(255, 255, 255, .92);
  --font: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --wrap: 1120px;
  --pad: 22px;
  --radius: 8px;
}
[data-theme="light"] {
  --bg: #f8f7f8;
  --surface: #fff;
  --surface-2: #f1eef0;
  --text: #171317;
  --muted: #716a70;
  --line: #e3dde1;
  --line-strong: #d0c7cd;
  --accent: #c62961;
  --accent-soft: #faeaf0;
  --green: #2f8d68;
  --red: #be5e52;
  --amber: #927346;
  --logo-bg: transparent;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-width: 320px; color: var(--text); background: var(--bg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--pad))); margin-inline: auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.micro { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }

.topnav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: baseline; gap: 6px; flex: none; font-size: 18px; font-weight: 700; }
.brand b { color: var(--accent); font: 600 10px var(--mono); letter-spacing: .08em; }
.nav-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs a { position: relative; padding: 7px 10px; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.nav-tabs a:hover, .nav-tabs a[aria-current] { color: var(--accent); }
.nav-tabs a[aria-current]::after { content: ''; position: absolute; right: 10px; bottom: -11px; left: 10px; height: 2px; background: var(--accent); }
.status-chip { display: flex; align-items: center; gap: 7px; margin-left: auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.idle-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.live-dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent); }
.theme-toggle { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.view { min-height: 72vh; padding: 36px 0 64px; }
.page-head { margin-bottom: 24px; }
.page-head h1, .detail-hero h1, .player-hero h1 { font-size: 36px; line-height: 1.05; letter-spacing: 0; font-weight: 600; }
.page-head p { max-width: 62ch; margin-top: 8px; color: var(--muted); }
.page-section + .page-section { margin-top: 42px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.section-head > span { color: var(--muted); font-size: 10px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tag { display: inline-flex; padding: 2px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font: 500 10px var(--mono); text-transform: uppercase; }
.tag.live { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }

.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.game-card { padding: 15px; transition: border-color .15s, background .15s, transform .15s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.score-teams { display: flex; flex-direction: column; gap: 10px; }
.score-team { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 38px; }
.score-team img, .team-cell img, .schedule-row img, .player-team img { width: 100%; height: 100%; padding: 2px; object-fit: contain; border-radius: 3px; background: var(--logo-bg); }
.score-team div { min-width: 0; }
.score-team b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.score-team small { display: block; color: var(--muted); font-size: 10px; }
.score-team strong { font-size: 23px; font-weight: 500; }
.score-team strong.winner { color: var(--accent); }
.game-foot { min-height: 18px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.logo-fallback { display: block; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 3px; }

.standings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.standings-card { min-width: 0; padding: 15px; }
.standings-card > h2 { margin-bottom: 12px; font-size: 15px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 7px 6px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font: 500 9px var(--mono); text-align: right; text-transform: uppercase; }
td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
.rank { color: var(--muted); }
.team-cell { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.team-cell img { width: 24px; height: 24px; }
.entity-link { border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.entity-link:hover { color: var(--accent); border-color: var(--accent); }

.leader-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.leader-card { min-width: 0; padding: 14px; }
.leader-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.leader-title h2 { font-size: 13px; }
.leader-title span { color: var(--muted); }
.leader-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 7px; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s; }
.leader-row:last-child { border-bottom: 0; }
.leader-row:hover { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.leader-row > div { min-width: 0; }
.leader-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.leader-row small { display: block; color: var(--muted); font-size: 9px; }
.leader-row strong { font-size: 12px; }
.meter { display: block; width: 100%; height: 4px; margin-top: 5px; overflow: hidden; border-radius: 8px; background: var(--line); }
.meter i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--accent) 68%, var(--line)); }
.leader-row:hover .meter i { background: var(--accent); }

.teams-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.team-card { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 92px; padding: 14px; transition: color .15s, background .15s, border-color .15s; }
.team-card:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }
.team-card img { width: 62px; height: 62px; padding: 5px; object-fit: contain; border-radius: 5px; background: var(--logo-bg); }
.team-card h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.team-card .arrow { color: var(--muted); font-size: 22px; }

.back-link { display: inline-flex; margin-bottom: 24px; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.back-link:hover { color: var(--accent); }
.detail-hero, .player-hero { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 30px; min-height: 180px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.detail-logo { display: grid; place-items: center; width: 150px; height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-hero p, .player-hero p { margin-top: 12px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 38px; margin-top: 34px; }
.detail-section + .detail-section { margin-top: 38px; }
.schedule-list { border-top: 1px solid var(--line); }
.schedule-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px 90px; align-items: center; gap: 12px; min-height: 60px; padding: 9px 7px; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s; }
.schedule-row:hover, .roster-row:hover { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.schedule-row > span:first-child { display: flex; flex-direction: column; }
.schedule-row b { font-size: 13px; }
.schedule-row strong { text-align: right; }
.roster-group + .roster-group { margin-top: 18px; }
.roster-group h3 { padding-bottom: 7px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font: 500 9px var(--mono); text-transform: uppercase; }
.roster-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 7px; min-height: 34px; padding: 6px; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; font-size: 12px; transition: color .15s, background .15s, border-color .15s; }
.roster-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.player-photo-wrap { display: flex; align-items: flex-end; justify-content: center; width: 150px; height: 170px; }
.player-photo { width: auto; height: auto; max-width: 150px; max-height: 170px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.player-initials { display: grid; place-items: center; width: 150px; height: 150px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--accent); background: var(--surface); font-size: 34px; }
.player-team { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.player-team img { width: 28px; height: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stat-row b { flex: none; font-size: 12px; }
.bio { display: flex; flex-direction: column; }
.bio div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.bio dt { color: var(--muted); }
.bio dd { text-align: right; }

.match-hero { padding: 10px 0 28px; border-bottom: 1px solid var(--line); text-align: center; }
.match-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin: 22px 0; }
.match-score > div { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.match-score img { width: 70px; height: 70px; padding: 7px; object-fit: contain; border-radius: 6px; background: var(--logo-bg); }
.match-team { font-size: 24px; font-weight: 600; }
.match-score > strong { font-size: 42px; font-weight: 500; white-space: nowrap; }
.match-hero > p { color: var(--muted); font-size: 12px; }
.compare-head { display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 8px; color: var(--muted); font: 500 10px var(--mono); }
.compare-head span:last-child { text-align: right; }
.compare-row { display: grid; grid-template-columns: 1fr minmax(120px, 1.6fr) 1fr; align-items: baseline; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.compare-row span:last-child { text-align: right; }
.compare-row b { text-align: center; font-weight: 500; }
.game-leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.game-leader-group { min-width: 0; }
.game-leader-team { display: flex; align-items: center; gap: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.game-leader-team img { width: 28px; height: 28px; padding: 2px; object-fit: contain; border-radius: 3px; background: var(--logo-bg); }
.game-leader-team h3 { font-size: 13px; }
.game-leader-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 12px; }
.game-leader-row span { display: flex; min-width: 0; flex-direction: column; }
.game-leader-row .entity-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-leader-row strong { flex: none; }

.state { display: flex; min-height: 240px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.state-mark { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font: 600 15px var(--mono); }
.state h2 { font-size: 17px; }
.state p { max-width: 46ch; margin-top: 5px; color: var(--muted); font-size: 13px; }
.skeleton-list { display: flex; flex-direction: column; gap: 15px; }
.sk { display: block; height: 14px; border-radius: 2px; background: var(--surface-2); animation: pulse 1.3s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.site-foot { padding: 28px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.site-foot b { color: var(--text); }

@media (max-width: 960px) {
  .leader-grid, .teams-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; }
  .nav-inner { gap: 10px; }
  .brand b, .status-chip { display: none; }
  .nav-tabs a { padding-inline: 8px; }
  .game-grid, .standings-grid, .leader-grid, .teams-grid { grid-template-columns: 1fr; }
  .page-head h1, .detail-hero h1, .player-hero h1 { font-size: 29px; }
  .detail-hero, .player-hero { grid-template-columns: 110px minmax(0, 1fr); gap: 20px; }
  .detail-logo { width: 110px; height: 110px; padding: 13px; }
  .player-photo-wrap { width: 110px; height: 130px; }
  .player-photo { max-width: 110px; max-height: 130px; }
  .player-initials { width: 110px; height: 110px; }
  .stat-grid { grid-template-columns: 1fr; }
  .game-leaders { grid-template-columns: 1fr; }
  .match-team { font-size: 17px; }
  .match-score > strong { font-size: 30px; }
}
@media (max-width: 460px) {
  .theme-toggle { width: 31px; height: 31px; }
  .nav-tabs a { font-size: 9px; }
  .detail-hero, .player-hero { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; }
  .detail-logo { width: 82px; height: 82px; padding: 9px; }
  .player-photo-wrap { width: 82px; height: 100px; }
  .player-photo { max-width: 82px; max-height: 100px; }
  .player-initials { width: 82px; height: 82px; font-size: 25px; }
  .optional { display: none; }
  .match-score { gap: 12px; }
  .match-score img { width: 54px; height: 54px; }
  .compare-row { grid-template-columns: 1fr minmax(100px, 1.4fr) 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
