/* NineCatHoops: one small stylesheet, light and dark, phone-first. */
:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d1f24; --muted: #5d636f; --line: #dcdad3;
  --accent: #c2410c; --accent-ink: #ffffff; --good: #15803d; --bad: #b91c1c; --chip: #ecebe6;
  --hi: #fff4e6;
  /* Chart palette (static/charts.js), run through the dataviz validator against --panel (see the commit):
     diverging blue <-> red with a gray midpoint; a one-hue blue sequential ramp (--seq-1 is a background
     wash, not a mark); --mark a neutral for the many-dots charts; --mine the ring around your team. */
  --div-neg: #e34948; --div-mid: #f0efec; --div-pos: #2a78d6;
  --seq-1: #cde2fb; --seq-2: #86b6ef; --seq-3: #2a78d6; --mark: #52514e; --mine: #1d1f24;
  --wash: 0.6;          /* opacity of --seq-1 washes (bands, the z curve); dark needs less */
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --panel: #1c1f25; --ink: #e8e6e1; --muted: #9aa0ab; --line: #2e333b;
          --accent: #f97316; --accent-ink: #1a1a1a; --good: #4ade80; --bad: #f87171; --chip: #262a31;
          --hi: #2a2118;
          --div-neg: #e66767; --div-mid: #383835; --div-pos: #3987e5;
          --seq-1: #0d366b; --seq-2: #256abf; --seq-3: #5598e7; --mark: #c3c2b7; --mine: #e8e6e1;
          --wash: 0.35; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 16px; }
.brand { font-weight: 800; letter-spacing: .02em; color: var(--ink); text-decoration: none; margin-right: 8px; }
.brand span { color: var(--accent); }
nav.main a { color: var(--ink); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
nav.main a.on, nav.main a:hover { background: var(--chip); }
.who { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.demo { background: var(--hi); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.demo .wrap { padding: 6px 16px; }
h1 { font-size: 24px; margin: 8px 0 4px; } h2 { font-size: 18px; margin: 20px 0 8px; }
.sub { color: var(--muted); margin: 0 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.btn, button { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
               padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small, button.small { padding: 3px 8px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; }
input[type=text], input[type=password], input[type=number], input[type=search], select {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
form.inline { display: inline; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; gap: 4px; align-items: center; background: var(--chip); border-radius: 999px;
        padding: 3px 10px; font-size: 13px; }
.chip input { margin: 0; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel); position: sticky; top: 0; }
td.l, th.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
.z-hi { background: color-mix(in srgb, var(--good) 22%, transparent); }
.z-lo { background: color-mix(in srgb, var(--bad) 20%, transparent); }
.muted { color: var(--muted); } .good { color: var(--good); } .bad { color: var(--bad); }
.msg { background: var(--hi); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; }
.err { color: var(--bad); }
.form-card { max-width: 420px; }
.form-card label { display: block; margin: 10px 0 4px; font-weight: 600; }
.form-card input { width: 100%; }
.star { font-size: 16px; line-height: 1; }
.pill { font-size: 12px; background: var(--chip); padding: 1px 7px; border-radius: 999px; color: var(--muted); }
.draft-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 820px) { .draft-layout { grid-template-columns: 1fr; } .who { margin-left: 0; } }
.status { font-weight: 600; }
.draft-layout.wide { grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); }
@media (max-width: 820px) { .draft-layout.wide { grid-template-columns: 1fr; } }
th.sortable { cursor: pointer; user-select: none; }
th.sortable[aria-sort="descending"]::after { content: " ▾"; }
th.sortable[aria-sort="ascending"]::after { content: " ▴"; }
.pmeta { display: block; font-size: 12px; color: var(--muted); }
.flag-hurt { color: var(--bad); font-weight: 700; margin-left: 6px; }
.sched td.g2 { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.sched td.g4, .sched td.g5 { background: color-mix(in srgb, var(--good) 22%, transparent); }
footer { color: var(--muted); font-size: 13px; }
.sched td a, .sched th a { color: inherit; text-decoration: none; display: block; }
.sched td a:hover, .sched th a:hover { text-decoration: underline; }
.sched.week td { text-align: center; }
.sched.week td.off { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.sched.week th { text-align: center; line-height: 1.25; }
.sched th[aria-sort="descending"] a::after { content: " ▾"; }
.sched th[aria-sort="ascending"] a::after { content: " ▴"; }


table.sortable thead th { cursor: pointer; user-select: none; }
table.sortable th[aria-sort="descending"]::after { content: " ▾"; }
table.sortable th[aria-sort="ascending"]::after { content: " ▴"; }
td.won { font-weight: 700; background: color-mix(in srgb, var(--good) 22%, transparent); }
/* Trade builder: chips move between a roster and its side's drop zone (static/trade.js). */
.trade-builder .zone { min-height: 44px; border: 2px dashed var(--line); border-radius: 10px; padding: 6px; margin-bottom: 6px; }
.trade-builder .zone.over, .trade-builder .roster.over { border-color: var(--accent); background: var(--hi); }
.trade-builder .roster { border: 2px solid transparent; border-radius: 10px; padding: 6px; }
.trade-builder .chip { margin: 3px; cursor: grab; }
td.wrap { white-space: normal; min-width: 16em; }
th[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
table.sortable thead th[title] { cursor: pointer; }
.verdict { padding: 10px 14px; border-radius: 8px; border-left: 6px solid var(--muted); background: var(--panel); }
.verdict.good { border-left-color: var(--good); } .verdict.small-up { border-left-color: color-mix(in srgb, var(--good) 50%, var(--muted)); }
.verdict.bad { border-left-color: var(--bad); } .verdict.small-down { border-left-color: color-mix(in srgb, var(--bad) 50%, var(--muted)); }
/* Charts: above their tables (the table view), drawn by static/charts.js. */
.chart-wrap { padding: 10px 14px 8px; }
.chart { position: relative; color: var(--ink); }
.chart svg { display: block; overflow: visible; max-width: 100%; height: auto; }
.chart .mark.hover, .chart .xbar:hover { stroke: var(--ink); stroke-width: 1.5; }
.chart .hit { cursor: default; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); color: var(--ink);
             border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; line-height: 1.35;
             box-shadow: 0 2px 10px rgba(0, 0, 0, .18); max-width: 280px; white-space: normal; }
.chart-tip .v { font-weight: 700; font-size: 14px; }
.chart-tip div:not(.v) { color: var(--muted); }
.chart-note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.smalls { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.sm-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 24px; font-weight: 650; line-height: 1.2; }
.tile .note { font-size: 12px; color: var(--muted); }
.chart-scroll { overflow-x: auto; }
.chart-scroll svg { max-width: none; }     /* the heatmap keeps readable columns and scrolls instead */
/* Week page: every other matchup is a tile (<details>, so it opens without JS); an open one spans the row. */
.match-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; margin: 10px 0; }
.match-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.match-tile[open] { grid-column: 1 / -1; }
.match-tile summary { list-style: none; cursor: pointer; padding: 8px 10px; border-radius: 10px; }
.match-tile summary::-webkit-details-marker { display: none; }
.match-tile summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.match-tile .teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: baseline; font-size: 14px; }
.match-tile .teams a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-tile .side-a { border-left: 4px solid var(--div-pos); padding-left: 5px; }
.match-tile .side-b { text-align: right; border-right: 4px solid var(--div-neg); padding-right: 5px; }
.match-tile .score { font-size: 13px; white-space: nowrap; }
.cat-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; margin-top: 7px; }
.cat-strip .cat { font-size: 11px; line-height: 1.15; text-align: center; padding: 3px 0; border-radius: 4px;
                  background: var(--div-mid); color: var(--ink); white-space: nowrap; }
.cat-strip .cat small { display: block; font-size: 12px; font-weight: 700; }
.cat-strip .cat.a { background: color-mix(in srgb, var(--div-pos) 30%, var(--panel)); }
.cat-strip .cat.b { background: color-mix(in srgb, var(--div-neg) 30%, var(--panel)); }
.match-tile .more { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.match-tile .more::before { content: "▸ Full table"; }
.match-tile[open] .more::before { content: "▾ Hide table"; }
.match-tile > .table-wrap { margin: 0 8px 8px; }
/* Trade list: generated trades as cards in their own scroll area; Evaluate opens the builder's evaluation in
   a modal dialog (static/trade_list.js), so closing it leaves the list where it was. */
.trade-list { max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 8px;
              padding: 8px; margin: 10px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.trade-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trade-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
/* Partner and deltas on the left, Evaluate on the right; on a phone the deltas drop under the partner and the
   button stays beside them instead of taking a line of its own. */
.tc-head { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "who delta go";
           align-items: baseline; gap: 2px 12px; }
.tc-partner { grid-area: who; font-weight: 650; }
.tc-delta { grid-area: delta; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tc-delta b { font-size: 15px; color: var(--ink); }
.tc-delta b.good { color: var(--good); } .tc-delta b.bad { color: var(--bad); }
.tc-head .evaluate { grid-area: go; align-self: center; }
.tc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 6px; }
.tc-sides .muted { display: block; font-size: 12px; }
.tc-drops { font-size: 13px; margin-top: 4px; }
.tc-why { font-size: 13px; margin-top: 4px; }
.eval-dialog { width: min(980px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
               padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
               box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.eval-dialog[open] { display: flex; flex-direction: column; }
.eval-dialog::backdrop { background: rgba(10, 12, 16, .55); }
.eval-dialog .dialog-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
                           background: var(--panel); border-bottom: 1px solid var(--line); }
.eval-dialog .dialog-bar h2 { margin: 0 auto 0 0; font-size: 17px; }
.eval-dialog .dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 14px; min-height: 120px; }
.eval-dialog .dialog-body > .panel { margin-top: 12px; }
.eval-dialog .dialog-trade { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; padding: 10px 2px 0; }
.eval-dialog .dialog-trade .tc-sides { display: contents; }
.eval-dialog .dialog-trade .tc-sides .muted { display: block; font-size: 12px; }
.eval-dialog .dialog-trade .tc-drops { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .tc-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who go" "delta go"; }
  .tc-delta { white-space: normal; }
  .tc-sides { grid-template-columns: 1fr; }
  .eval-dialog .dialog-bar { padding: 8px 10px; }
  /* A long team name shortens rather than pushing Close onto a second line; the players are listed below. */
  .eval-dialog .dialog-bar h2 { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis;
                                white-space: nowrap; }
  .eval-dialog .dialog-bar .btn, .eval-dialog .dialog-bar button { flex: none; }
  .eval-dialog .dialog-body > .panel { padding: 10px; }
  .eval-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .eval-dialog .dialog-body { padding: 0 8px 12px; }
}

/* Batch D data views. The rankings' caption says which lens and basis the table shows. */
.caption { margin: 10px 0 6px; font-weight: 600; font-size: 14px; }
/* Stats behind the numbers: the projection and this season stand apart from the past seasons. */
table.seasons tr.proj td, table.seasons tr.now td { font-weight: 600; background: var(--hi); }
table.seasons td .muted { font-size: 12px; }
.sources { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
/* Best swaps: xCats changes on the charts' diverging scale (blue gain, red loss, gray about zero),
   three steps by size (league_views.SWAP_STEPS); the best move is outlined. */
/* Sized to its numbers, not stretched across the page: the cells are the point, not the whitespace. */
table.swaps { width: auto; }
.table-wrap:has(> table.swaps) { display: inline-block; max-width: 100%; vertical-align: top; }
td.swap { padding: 0; text-align: center; min-width: 9em; }
td.swap a { display: block; padding: 6px 10px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
td.swap a:hover, td.swap a:focus-visible { text-decoration: underline; }
td.swap.z { background: var(--div-mid); }
td.swap.p1 { background: color-mix(in srgb, var(--div-pos) 18%, var(--panel)); }
td.swap.p2 { background: color-mix(in srgb, var(--div-pos) 40%, var(--panel)); }
td.swap.p3 { background: color-mix(in srgb, var(--div-pos) 65%, var(--panel)); }
td.swap.n1 { background: color-mix(in srgb, var(--div-neg) 18%, var(--panel)); }
td.swap.n2 { background: color-mix(in srgb, var(--div-neg) 40%, var(--panel)); }
td.swap.n3 { background: color-mix(in srgb, var(--div-neg) 65%, var(--panel)); }
td.swap.best { outline: 3px solid var(--ink); outline-offset: -3px; font-weight: 700; }
/* Sign-up honeypot: off-screen for people (and screen readers skip it); form-filling scripts still fill it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Long-form pages (privacy, terms, about): a readable line length. */
.prose { max-width: 760px; line-height: 1.55; }
.prose h2 { margin-top: 20px; }
