:root {
  --bg: #08080a; --panel: #141417; --panel2: #1b1b20; --line: #2a2a31; --line2: #3a3a44;
  --ink: #f3f3f5; --ink2: #b4b7c0; --muted: #7d808a;
  --gold: #e0b040; --gold-ink: #17130a; --silver: #cfd2d9;
  --home: #3b82f6; --away: #e2603a;
  --good: #3fae74; --bad: #e05252;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink2); margin: 0 0 12px; }
.num { font-variant-numeric: tabular-nums; }

.topbar { background: #000; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: 0 16px; height: 58px; display: flex; align-items: center; gap: 20px; }
.topbar img { height: 40px; display: block; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink2); font-size: 14px; font-weight: 600; }
.topbar nav a:hover, .topbar nav a.on { color: var(--ink); background: var(--panel2); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section { margin-top: 24px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.crumb a { color: var(--ink2); }

.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--ink2); }
.chip.live { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.final { background: var(--panel2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; }

/* game cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card:hover { border-color: var(--gold); color: inherit; }
.card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.card .row { display: flex; align-items: center; padding: 3px 0; font-weight: 600; }
.card .row .sc { margin-left: auto; font-size: 20px; font-weight: 700; }
.card .row.lose { color: var(--ink2); font-weight: 500; }
.card .row.lose .sc { font-weight: 500; }

/* scoreboard */
.board { background: linear-gradient(180deg, #17171b, #101013); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 14px; }
.board .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.board .t { display: flex; align-items: center; gap: 14px; min-width: 0; }
.board .t.away { flex-direction: row-reverse; text-align: right; }
.board .t .nm { font-size: 20px; font-weight: 700; line-height: 1.15; overflow-wrap: break-word; }
.board .t .cd { color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.board .t .pts { font-size: 54px; font-weight: 800; line-height: 1; margin-left: auto; }
.board .t.away .pts { margin-left: 0; margin-right: auto; }
.board .bar { width: 6px; align-self: stretch; border-radius: 3px; min-height: 48px; }
.board .mid { text-align: center; min-width: 110px; }
.board .mid .clk { font-size: 26px; font-weight: 700; }
.board .sub { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 12px; }
table.qs { margin: 12px auto 0; border-collapse: collapse; font-size: 13px; }
table.qs th, table.qs td { padding: 3px 10px; text-align: center; }
table.qs th { color: var(--muted); font-weight: 600; }
table.qs td:first-child, table.qs th:first-child { text-align: left; color: var(--ink2); }
table.qs td:last-child { font-weight: 700; }

.tabs { display: flex; gap: 4px; margin: 16px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--ink2); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--gold); }

/* tables */
.tw { overflow-x: auto; }
table.st { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
table.st th { color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--line2); }
table.st td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.st th.l, table.st td.l { text-align: left; }
table.st tr:hover td { background: var(--panel2); }
table.st tr.tot td { font-weight: 700; border-top: 1px solid var(--line2); border-bottom: 0; }
table.st tr.sep td { border-bottom-color: var(--line2); }
table.st td.hi { font-weight: 700; color: var(--ink); }
table.st .dnp { color: var(--muted); }
.oncourt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-left: 6px; vertical-align: middle; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { background: none; border: 0; padding: 5px 11px; border-radius: 6px; color: var(--ink2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--line2); color: var(--ink); }
select, input[type=text], input[type=number], input[type=password], input[type=datetime-local], input[type=color] {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; color: var(--ink); }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--gold); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.danger { color: #ff8f8f; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .4; cursor: default; }

/* play by play */
.pbp .ev { display: grid; grid-template-columns: 62px 1fr 74px 1fr; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pbp .ev .ck { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pbp .ev .sc { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.pbp .ev.score .sc { color: var(--ink); font-weight: 700; }
.pbp .ev .h { text-align: right; } .pbp .ev .a { text-align: left; }
.pbp .ev.score .h, .pbp .ev.score .a { font-weight: 600; }
.pbp .ev.mark { grid-template-columns: 1fr; text-align: center; color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; background: var(--panel2); }

/* charts */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); margin-bottom: 8px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.axis { fill: var(--muted); font-size: 11px; }
.tip { position: fixed; pointer-events: none; z-index: 50; background: #000; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--ink); box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 260px; display: none; }
.tip b { font-weight: 700; } .tip .m { color: var(--ink2); }

.cmp .r { display: grid; grid-template-columns: 64px 1fr 150px 1fr 64px; align-items: center; gap: 10px; padding: 6px 0; }
.cmp .r .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp .r .v.rt { text-align: right; }
.cmp .r .lb { text-align: center; color: var(--ink2); font-size: 13px; }
.cmp .r .lb small { display: block; color: var(--muted); font-size: 11px; }
.cmp .tr { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; display: flex; }
.cmp .tr.l { justify-content: flex-end; }
.cmp .tr i { display: block; height: 100%; border-radius: 4px; }

.court { background: #0e0e11; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.court svg { display: block; width: 100%; height: auto; }
.court .ln { fill: none; stroke: #4a4a55; stroke-width: .07; }
.court .fl { fill: #17171c; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tile .k { color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.tile .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .s { color: var(--ink2); font-size: 12.5px; }

.ldr { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 12px; align-items: center; }
.ldr .k { color: var(--muted); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.ldr .p { display: flex; gap: 10px; align-items: baseline; }
.ldr .p.rt { flex-direction: row-reverse; }
.ldr .p b { font-size: 22px; font-variant-numeric: tabular-nums; }

.sponsors { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 36px; }
.sponsors .tier { margin-bottom: 16px; text-align: center; }
.sponsors h2 { margin-bottom: 10px; }
.sps { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sp { display: flex; align-items: center; justify-content: center; width: 132px; height: 62px; padding: 8px 12px; background: #fff; border-radius: 8px; color: #16161a; font-weight: 700; font-size: 13px; text-align: center; line-height: 1.2; }
.sp:hover { color: #16161a; outline: 2px solid var(--gold); }
.sp img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sps.big .sp { width: 200px; height: 88px; font-size: 16px; }
.hero { text-align: center; padding: 26px 0 8px; }
.hero img { max-width: min(560px, 92%); height: auto; }
.hero p { color: var(--ink2); margin: 4px 0 0; }

@media (max-width: 760px) {
  .g2, .g3 { grid-template-columns: 1fr; }
  .board .t .nm { font-size: 15px; } .board .t .pts { font-size: 38px; } .board .mid { min-width: 78px; }
  .board .mid .clk { font-size: 20px; }
  .cmp .r { grid-template-columns: 48px 1fr 104px 1fr 48px; gap: 6px; }
  .pbp .ev { grid-template-columns: 50px 1fr 60px 1fr; font-size: 13px; }
  .topbar .in { gap: 8px; padding: 0 10px; }
  .topbar img { height: 26px; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding: 6px 7px; font-size: 13px; }
  .board .t, .board .t.away { flex-direction: column; text-align: center; gap: 6px; }
  .board .t .pts, .board .t.away .pts { margin: 0; }
  .board .bar { width: 40px; height: 4px; min-height: 0; align-self: center; }
  .axis { font-size: 15px; }
}


/* ================= identity and motion ================= */
:root {
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
/* arena lights: slow drifting glows behind everything */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(820px 460px at 12% 0%, rgba(224, 176, 64, .11), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(59, 130, 246, .08), transparent 62%),
    radial-gradient(760px 520px at 50% 104%, rgba(226, 96, 58, .07), transparent 62%);
  animation: lights 22s ease-in-out infinite alternate;
}
@keyframes lights { to { transform: translate3d(3%, 2%, 0) scale(1.08); } }

h1, .board .t .nm, .board .t .pts, .board .mid .clk, .card .row .sc, .tile .v, .ldr .p b, .sb .tm .s, .sb .ck .time, .sb .tm .n {
  font-family: var(--display); font-stretch: condensed; letter-spacing: .01em;
}
h1, .board .t .nm, .sb .tm .n { font-style: italic; text-transform: uppercase; }
.board .t .pts, .sb .tm .s { font-style: italic; }
h2 { display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 14px; height: 2px; background: var(--gold); border-radius: 2px; transform: skewX(-24deg); flex: none; }
.sponsors h2 { justify-content: center; }

.topbar { border-bottom: 0; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2) 18%, var(--gold) 50%, var(--line2) 82%, transparent); }
.topbar nav a { position: relative; transition: color .2s, background .2s; }
.topbar nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; background: var(--gold); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.topbar nav a:hover::after, .topbar nav a.on::after { transform: scaleX(1); }

/* entrance: blocks rise in sequence, only on real navigation */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; } }
.enter .board, .enter .panel, .enter .card, .enter .tile, .enter .tier, .enter .tabs, .enter > h2, .enter .section > h2, .enter .hero p {
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 42ms);
}

/* hero: the court draws itself, the logo lands, light sweeps across the metal */
.hero { position: relative; padding: 44px 0 26px; overflow: hidden; }
.herocourt { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; opacity: .5;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); }
.herocourt svg { width: min(880px, 118%); height: auto; flex: none; }
.herocourt .ln { fill: none; stroke: var(--gold); stroke-width: .05; opacity: .5; stroke-dasharray: 1; animation: draw 2.6s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.shine { position: relative; display: inline-block; max-width: min(620px, 92%); }
.shine img { display: block; width: 100%; height: auto; animation: land .9s var(--ease) both; }
@keyframes land { from { opacity: 0; transform: scale(1.08) translateY(6px); filter: blur(6px); } }
.shine::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%) no-repeat; background-size: 260% 100%;
  -webkit-mask: url(img/logo.png) center / 100% 100% no-repeat; mask: url(img/logo.png) center / 100% 100% no-repeat;
  mix-blend-mode: plus-lighter; animation: sweep 5.5s ease-in-out 1s infinite; }
@keyframes sweep { 0% { background-position: 130% 0; } 45%, 100% { background-position: -60% 0; } }
.hero p { position: relative; letter-spacing: .22em; text-transform: uppercase; font-size: 12.5px; margin-top: 12px; }

/* cards */
.card { position: relative; overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .07) 50%, transparent 65%); transform: translateX(-120%); }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.card:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.card.live { border-color: rgba(224, 82, 82, .55); animation: rise .6s var(--ease) both, liveglow 2.4s ease-in-out infinite; }
@keyframes liveglow { 50% { box-shadow: 0 0 0 1px rgba(224, 82, 82, .35), 0 0 22px rgba(224, 82, 82, .18); } }
.chip.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: 1px; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* scoreboard */
.board { position: relative; overflow: hidden; }
.board::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--home), transparent 38%, transparent 62%, var(--away)); }
.board .t { position: relative; }
.board .t .pts { display: inline-block; transition: color .3s; }
.board .t .pts.bump { animation: bump .9s var(--ease); }
@keyframes bump { 0% { transform: translateY(-40%) scale(1.25); color: var(--gold); opacity: 0; } 35% { opacity: 1; } 60% { transform: none; color: var(--gold); } }
.board .t.scored::after { content: ""; position: absolute; inset: -18px -16px; border-radius: 14px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(224, 176, 64, .28), transparent); animation: flash 1.1s ease-out both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.board .mid .chip { animation: fade .6s .3s both; }

/* tabs with a sliding marker */
.tabs { position: relative; }
.tabs a { transition: color .2s; }
.tabs a.on { border-bottom-color: transparent; }
.tabs .ink { position: absolute; bottom: 0; height: 2px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 10px rgba(224, 176, 64, .6);
  transition: left .38s var(--ease), width .38s var(--ease); }

/* charts */
.enter .draw { stroke-dasharray: 1; animation: draw 1.5s var(--ease) .25s both; }
.enter .fadein { animation: fade .9s ease 1s both; }
@keyframes growx { from { transform: scaleX(0); } }
.enter .cmp .tr i { transform-origin: left; animation: growx .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 42ms + 150ms); }
.enter .cmp .tr.l i { transform-origin: right; }
@keyframes pop { from { opacity: 0; transform: scale(0); } 70% { transform: scale(1.25); } }
.pops .shot, .enter .court .shot { transform-box: fill-box; transform-origin: center; animation: pop .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 7ms + 120ms); }
.shot { transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.shot:hover { transform: scale(1.5); }

/* play by play: a new play slides in and glows in its team colour */
@keyframes playin { from { opacity: 0; transform: translateY(-10px); } }
@keyframes glowh { from { background: rgba(59, 130, 246, .28); } }
@keyframes glowa { from { background: rgba(226, 96, 58, .28); } }
.pbp .ev.fresh { animation: playin .45s var(--ease) both, glowh 2.4s ease-out both; }
.pbp .ev.fresh.t2 { animation: playin .45s var(--ease) both, glowa 2.4s ease-out both; }
.pbp .ev.fresh.t0 { animation: playin .45s var(--ease) both; }

/* small touches */
.btn, .seg button, .act, .pb, .cp { transition: transform .12s, border-color .2s, background .2s, color .2s; }
.btn:active, .act:active:not(:disabled), .pb:active, .cp:active { transform: scale(.97); }
table.st tr td { transition: background .15s; }
.sp { transition: transform .25s var(--ease), outline-color .2s; }
.sp:hover { transform: translateY(-2px); }
.tile { transition: border-color .2s, transform .25s var(--ease); }
.tile:hover { border-color: var(--line2); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
