:root { --bg:#fff; --fg:#1b1f24; --muted:#6a737d; --line:#e1e4e8; --accent:#0b5cad; --up:#1a7f37; --down:#cf222e; --bg2:#f6f8fa;
        --fill:#9cc3ea; --whisk:#9aa4ae; --sel:#eaf2fb; color-scheme: light; }
:root[data-theme=dark] { --bg:#0d1117; --fg:#e6edf3; --muted:#8b949e; --line:#30363d; --accent:#4493f8; --up:#3fb950; --down:#f85149;
        --bg2:#161b22; --fill:#1f4f82; --whisk:#6e7681; --sel:#1b2a3d; color-scheme: dark; }
* { box-sizing: border-box; }
html { background: var(--bg); }
body { font: 14px/1.4 system-ui, sans-serif; color: var(--fg); background: var(--bg); margin: 0 auto; max-width: 1100px; padding: 16px; }
header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 8px; } h1 img { height: 22px; width: auto; }
.sub { margin: 4px 0 10px; color: var(--muted); }
.meta { color: var(--muted); font-size: 12px; margin-left: auto; }
/* Buttons: one style everywhere (theme, share, close, tabs). */
.btn, .seg button, .seg a.tab, .close { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px;
  padding: 0 12px; font: inherit; font-weight: 500; color: var(--fg); background: var(--bg2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background .12s; }
.btn:hover, .seg button:hover, .seg a.tab:hover, .close:hover { background: var(--line); }
.btn.icon { width: 30px; padding: 0; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn svg.moon { fill: currentColor; stroke: none; }
:root[data-theme=dark] #theme .moon { display: none; }
:root:not([data-theme=dark]) #theme .sun { display: none; }
#share, .push { margin-left: auto; align-self: center; }
h1 a.home { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
#theme { align-self: center; }
nav { margin: 12px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; }
.seg button, .seg a.tab { border-color: transparent; background: transparent; height: 26px; border-radius: 7px; color: var(--muted); }
.seg button:hover, .seg a.tab:hover { color: var(--fg); }
.seg button.on, .seg a.tab.on { background: var(--bg); color: var(--fg); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 32px; height: 18px; border-radius: 9px; background: var(--line); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.btn:focus-visible, .seg button:focus-visible, .close:focus-visible, .switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
select, input { background: var(--bg); color: var(--fg); }
select, input[type=search] { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--bg); cursor: pointer; user-select: none; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.team { cursor: pointer; }
tr.team:hover { background: var(--bg2); }
tr.team.open td { background: var(--sel); font-weight: 600; border-bottom-color: transparent; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
tr.detail > td { background: var(--sel); white-space: normal; position: relative; padding: 4px 12px 12px; }
.dgrid { display: grid; grid-template-columns: max-content minmax(240px, 1fr); gap: 12px 32px; align-items: start; }
.dgrid > div:first-child { overflow-x: auto; }
.games { width: 100%; margin-top: 4px; }
.games th { position: static; background: none; cursor: default; color: var(--muted); font-weight: 600; font-size: 12px;
            border-bottom: 1px solid var(--line); }
.games td, .games th { padding: 3px 10px 3px 0; }
.games td { border: 0; }
.games .sep { border-left: 1px solid var(--line); padding-left: 10px; }
.games td.actual { font-weight: 700; }
.games tr.sum td { border-top: 1px solid var(--line); }
.games tr.prevtoggle { cursor: pointer; }
.cdhead { display: flex; gap: 8px; margin: 4px 0 6px; padding-right: 36px; }
.games tr.cgroup { cursor: pointer; }
.games td.cpair, .games th.cpair { border-left: 1px solid var(--line); padding-left: 10px; }
.games th[colspan].cpair { text-align: center; }
.games th[data-csort] { cursor: pointer; }
.cscroll { overflow-x: auto; }
.games td.copp, .games th.copp { opacity: .75; font-size: .92em; }
a.tlink { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.tlink:hover { color: var(--accent); border-bottom-color: var(--accent); }
.games tr.prevgame td { font-size: 13px; }
.games tr.seasonend td { border-bottom: 1px solid var(--line); }
.games td.cf span { opacity: .55; }
.dsim { padding-top: 4px; }
.simhead { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin: 0 40px 6px 0; }
.simhead .ttl, .simhead b { color: var(--muted); font-weight: 600; font-size: 12px; }
.simhead .ttl { flex-basis: 100%; padding: 3px 0; border-bottom: 1px solid var(--line); }
.plot { width: 100%; height: auto; display: block; }
.plot text { fill: var(--muted); font-size: 11px; }
.plot .grid { stroke: var(--line); stroke-width: 1; }
.plot .area { fill: var(--fill); stroke: var(--accent); stroke-width: 1; }
.plot .area.in { fill: var(--accent); fill-opacity: .75; }
.plot .hit { fill: transparent; }
.plot .cross line { stroke: var(--fg); stroke-opacity: .5; stroke-width: 1; }
.plot .cross circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.plot .cross .tipbg { fill: var(--fg); }
.plot text.tip { fill: var(--bg); font-size: 11px; font-weight: 600; }
.bar { position: relative; height: 14px; width: 260px; background: var(--bg2); border-radius: 3px; }
.bar .whisk { position: absolute; top: 6px; height: 2px; background: var(--whisk); }
.bar .box { position: absolute; top: 1px; height: 12px; background: var(--fill); border: 1px solid var(--accent); border-radius: 2px; }
.bar .med { position: absolute; top: 0; height: 14px; width: 2px; background: var(--fg); }
.close { position: absolute; top: 6px; right: 8px; width: 30px; padding: 0; font-size: 18px; line-height: 1; }
th select { font: inherit; font-weight: 600; padding: 1px 2px; border: 1px solid var(--line); border-radius: 4px; field-sizing: content; }
th input#topN { width: 3.5em; font: inherit; padding: 1px 2px; border: 1px solid var(--line); border-radius: 4px; }
th input#qHead { width: 9em; font: inherit; font-weight: normal; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; margin-left: 4px; }
#conf, #q, #div { display: none; }  /* state holders; on wide screens the Teams tab's pickers live in the table header */
@media (max-width: 1100px) { .dgrid { grid-template-columns: minmax(0, 1fr); padding-top: 28px; } }
.dwrap { position: relative; }
/* Phones: every column stays; the table scrolls sideways in its own box with the name column
   pinned, and an open detail stays screen-wide (its own tables scroll inside it). */
@media (max-width: 700px) {
  body[data-tab=teams] #div, body[data-tab=teams] #conf { display: inline-block; }
  .tscroll { overflow-x: auto; }
  .tscroll th.tname, .tscroll td.tname { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: inset -1px 0 0 var(--line); }
  .tscroll tr.team:hover td.tname { background: var(--bg2); }
  .tscroll tr.team.open td.tname { background: var(--sel); }
  .dwrap { position: sticky; left: 0; width: calc(100vw - 56px); }
  .dwrap .cscroll, .dgrid > div:first-child { overflow-x: auto; }
  th input#qHead { width: 84px; }
  .cdhead { flex-wrap: wrap; }
}
body[data-tab=about] #season, body[data-tab=about] .switch { display: none; }
.about { max-width: 720px; line-height: 1.55; font-size: 15px; }
.about h2 { margin: 8px 0 4px; } .about h3 { margin: 22px 0 6px; }
.about li { margin: 6px 0; } .about a { color: var(--accent); }
footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; } footer a { color: inherit; }
/* Row names are links (crawlable team and conference pages) that look like plain text. */
a.rlink, .list td.tname a { color: inherit; text-decoration: none; }
/* Loading skeleton: table-height rows until the data arrives. */
.skel i { display: block; height: 31px; border-bottom: 1px solid var(--line); position: relative; }
.skel i::before { content: ""; position: absolute; left: 8px; top: 10px; height: 11px; width: 55%; border-radius: 4px; background: var(--bg2);
  animation: skel 1.2s ease-in-out infinite alternate; }
.skel i:nth-child(3n+2)::before { width: 45%; } .skel i:nth-child(3n)::before { width: 62%; }
@keyframes skel { to { opacity: .45; } }
.notfound { margin: 24px 0; }
