:root {
  --bg: #fbf4e4; --surface: #fffaf0; --surface-2: #f1e4c8; --line: #e0d0b0; --line-strong: #8d7a8f;
  --ink: #302020; --ink-2: #5b4a58; --brand: #5f2d91; --on-brand: #ffffff;
  --accent: #f08a24; --on-accent: #302020; --forest: #4b2278; --on-forest: #fbf4e4;
  --pos: #1f64a8; --neg: #b8410c; --focus: #302020;
  --f-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --f-body: 'Instrument Sans', system-ui, sans-serif;
  --f-num: 'IBM Plex Sans', 'Instrument Sans', system-ui, sans-serif;
  --r-lg: 20px; --r-md: 12px; --r-sm: 6px;
  --shadow: 0 1px 0 rgba(48, 32, 32, .06), 0 6px 18px rgba(75, 34, 120, .08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1c1228; --surface: #2a1b3d; --surface-2: #38254f; --line: #46305f; --line-strong: #9a85b5;
  --ink: #f4ead4; --ink-2: #c4b4d6; --brand: #b794e0; --on-brand: #1c1228;
  --accent: #f5a455; --on-accent: #1c1228; --forest: #5b3590; --on-forest: #f4ead4;
  --pos: #7fc4e0; --neg: #f0987a; --focus: #ffd24a; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 64px max(16px, env(safe-area-inset-right, 0px)); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(28px, 5vw, 42px); } h2 { font-size: 22px; } h3 { font-size: 17px; }
a { color: var(--brand); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--ink-2); }

.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font: 800 22px var(--f-display); text-decoration: none; color: var(--ink); margin-right: auto; }
.brand .logo { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; }
.brand b { color: var(--brand); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 17px; }

.hero { background: var(--forest); color: var(--on-forest); border-radius: var(--r-lg); padding: 26px clamp(18px, 4vw, 34px); margin: 8px 0 18px; }
.hero p { margin: 10px 0 0; max-width: 62ch; opacity: .92; }
.banner { background: var(--accent); color: var(--on-accent); border-radius: var(--r-md); padding: 8px 14px; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.controls { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; margin-bottom: 16px; }
.field label, .field .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.field input[type=range] { width: 100%; accent-color: var(--brand); }
input[type=search], input[type=number], select { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); color: var(--ink); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 600 13px var(--f-num); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.off { text-decoration: line-through; opacity: .6; background: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: 8px 14px; font: 600 14px var(--f-body); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; background: var(--surface-2); font: 700 12px var(--f-body); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; user-select: none; }
thead th[aria-sort] { color: var(--ink); }
th.l, td.l { text-align: left; }
td.nm { position: sticky; left: 0; background: var(--surface); font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
thead th.nm { left: 0; z-index: 3; }
td.nm small { font-weight: 500; color: var(--ink-2); margin-left: 6px; font-size: 11.5px; }
td.nm .short { display: none; }
tbody tr:hover td { background: var(--surface-2); }
td.tot { font-weight: 700; }
.more { margin: 14px 0 0; text-align: center; }
.note { font-size: 13px; color: var(--ink-2); margin-top: 10px; }

.panes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.pane h2 { margin-bottom: 12px; }
.pane.give { border-top: 4px solid var(--accent); } .pane.get { border-top: 4px solid var(--brand); }
.results { margin: 8px 0 0; border: 1px solid var(--line); border-radius: var(--r-md); max-height: 220px; overflow: auto; }
.results button { all: unset; box-sizing: border-box; display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.results button:hover, .results button:focus-visible { background: var(--surface-2); }
.results .r { margin-left: auto; color: var(--ink-2); font: 500 12.5px var(--f-num); }
.picked { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; min-height: 56px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); }
.pick b { font-weight: 600; } .pick .r { margin-left: auto; font: 600 13px var(--f-num); }
.pick button { all: unset; cursor: pointer; padding: 0 4px; font-size: 18px; color: var(--ink-2); }
.verdict { background: var(--forest); color: var(--on-forest); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 16px; }
.verdict .big { font: 800 34px var(--f-num); }
.verdict p { margin: 6px 0 0; opacity: .92; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
td.catcell { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.prose { max-width: 70ch; } .prose h2 { margin: 28px 0 8px; } .prose p, .prose li { color: var(--ink); }
.prose code, .formula { font-family: var(--f-num); background: var(--surface-2); padding: 2px 6px; border-radius: var(--r-sm); font-size: .92em; }
.formula { display: block; padding: 10px 14px; margin: 10px 0; overflow-x: auto; }
footer { color: var(--ink-2); font-size: 13px; padding-top: 28px; }

@media (max-width: 700px) {
  /* Header: logo and theme button on the first row, the three pages evenly across the second. */
  .top { gap: 12px; padding: 14px 0; }
  .top .iconbtn { order: 2; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; }
  .nav a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13.5px; white-space: nowrap; }
  th, td { padding: 7px 7px; font-size: 13px; }
  /* Player cell: "F. Lastname" with the team underneath, so the sticky column stays narrow. */
  td.nm { max-width: 124px; padding-top: 5px; padding-bottom: 5px; line-height: 1.25; }
  td.nm .full { display: none; }
  td.nm .short { display: inline; }
  td.nm .pn { display: block; overflow: hidden; text-overflow: ellipsis; }
  td.nm small { display: block; margin-left: 0; font-size: 10.5px; letter-spacing: .03em; }
  .hero { padding: 20px 16px; }
}
@media (prefers-reduced-motion: no-preference) { .card, .chip, .btn { transition: background .15s, color .15s; } }

/* ---------- Daily report (Home) ---------- */
:root { --highlight: #ffc93c; --on-highlight: #302020; --heat-hi: color-mix(in srgb, var(--pos) 26%, transparent); --heat-good: color-mix(in srgb, var(--pos) 11%, transparent); --heat-bad: color-mix(in srgb, var(--neg) 20%, transparent); --band: color-mix(in srgb, var(--brand) 26%, var(--surface-2)); }
:root[data-theme="dark"] { --highlight: #ffd24a; --on-highlight: #1c1228; }
.eyebrow { font: 600 12px/16px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pill { display: inline-block; font: 600 12px/16px var(--f-body); letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.report { display: flex; flex-direction: column; gap: 32px; margin-top: 8px; }
:where(.report section) { display: flex; flex-direction: column; gap: 12px; }
.rhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.rhead h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.1; }
.sechead h2 { font-size: 24px; line-height: 30px; }
.sechead p { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--ink-2); max-width: 75ch; }
.lotn .eyebrow { color: inherit; opacity: .85; }
.lotn h2 { font-size: clamp(36px, 7vw, 56px); line-height: 1.04; letter-spacing: -.02em; }
.lotn .statline { font: 500 15px/24px var(--f-num); font-variant-numeric: tabular-nums; }
.lotn .big { font: 600 44px/48px var(--f-num); font-variant-numeric: tabular-nums; background: var(--highlight); color: var(--on-highlight); padding: 4px 12px; border-radius: var(--r-sm); align-self: flex-start; }
.shortv ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.shortv h2 { font-size: 24px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.game { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-num); font-variant-numeric: tabular-nums; padding: 16px; }
.game .tm { display: flex; justify-content: space-between; }
.game .tm.w { font-weight: 700; }
.game .ft { display: flex; justify-content: space-between; font: 12px/16px var(--f-body); color: var(--ink-2); margin-top: 4px; }
.game .ft b { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; gap: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink); font: 600 13px var(--f-body); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lines th button { all: unset; cursor: pointer; display: block; width: 100%; text-align: inherit; min-height: 28px; line-height: 28px; }
.lines th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.lines td.c { text-align: center; } .lines td.c span { display: inline-block; min-width: 46px; padding: 4px 6px; border-radius: var(--r-sm); font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.lines td.nm small { display: block; margin-left: 0; }
.h-hi { background: var(--heat-hi); font-weight: 600; } .h-good { background: var(--heat-good); } .h-bad { background: var(--heat-bad); }
.h-top { background: var(--highlight); color: var(--on-highlight); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.two > .card { padding: 24px; display: flex; flex-direction: column; }
.two h3 { font-size: 20px; margin-bottom: 8px; } .two h2 { font-size: 24px; }
.two .sub { font-size: 13px; line-height: 18px; color: var(--ink-2); margin: 2px 0 8px; }
.item { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.item .top2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item .nm2 { font-weight: 600; } .item .tm2 { font-size: 13px; color: var(--ink-2); font-weight: 400; }
.item .d { font: 600 15px var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.range { position: relative; height: 14px; }
.range .track { position: absolute; left: 0; right: 0; top: 4px; height: 6px; background: var(--surface-2); border-radius: 999px; }
.range .band { position: absolute; top: 2px; height: 10px; background: var(--band); border-radius: 999px; }
.range .dot { position: absolute; top: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: border-box; }
.item .why { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.tag { font: 600 12px/16px var(--f-body); letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tag.signal { background: var(--brand); color: var(--on-brand); } .tag.noise { background: var(--surface-2); color: var(--ink); }
.row2 { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.row2 .l2 { display: flex; flex-direction: column; min-width: 0; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 44px; flex: none; }
.spark i { width: 12px; border-radius: 3px 3px 0 0; background: var(--band); }
.spark i.now { background: var(--brand); }
.own { font: 600 12px/16px var(--f-body); letter-spacing: .08em; text-transform: uppercase; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.nextup { background: var(--surface-2); border-radius: var(--r-lg); padding: 24px; }
.nextup h2 { font-size: 24px; }
.nextup .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.nextup .cols > div { display: flex; flex-direction: column; gap: 2px; }
.method { border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; line-height: 18px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.method strong { color: var(--ink); }
.empty { color: var(--ink-2); font-size: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
/* Tools hub */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.tool { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.tool:hover { border-color: var(--brand); }
.tool .go { color: var(--brand); font-weight: 600; margin-top: auto; }
.tool.soon { opacity: .75; }
.crumb { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; } .crumb a { color: var(--ink-2); }
@media (max-width: 700px) {
  .report { gap: 26px; }
  .lotn .big { font-size: 36px; line-height: 40px; }
  .lines td.c span { min-width: 38px; padding: 3px 4px; }
}
.lines thead th:not(.l) { text-align: center; }
/* Short names everywhere on phones (rankings, report lists) */
.short { display: none; }
@media (max-width: 700px) {
  .full { display: none; } .short { display: inline; }
  .own .w { display: none; }
}
/* Scoreboard cards open a game breakdown */
button.game { font: inherit; color: inherit; text-align: left; cursor: pointer; border: 1px solid var(--line); width: 100%; }
button.game:hover { border-color: var(--brand); }
button.game.open { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.game .peek { font: 600 12px/16px var(--f-body); color: var(--brand); margin-top: 2px; }
.gamepanel { display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r-lg); padding: clamp(16px, 3vw, 24px); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); margin-top: 4px; }
.gamepanel h3 { font-size: 20px; }
.gamepanel .sechead { margin-top: 8px; }
.gp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.gp-head h2 { font-size: clamp(24px, 4vw, 32px); }
.gp-best { background: var(--forest); color: var(--on-forest); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.gp-best .eyebrow, .gp-best .muted { color: inherit; opacity: .85; }
.gp-bestrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; font-size: 20px; }
.gp-bestrow .big { margin-left: auto; font: 600 26px/30px var(--f-num); font-variant-numeric: tabular-nums; background: var(--highlight); color: var(--on-highlight); padding: 2px 10px; border-radius: var(--r-sm); }
.gp-best .statline { font: 500 14px/20px var(--f-num); font-variant-numeric: tabular-nums; }
.teamhead { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 8px; }
.teamhead .pill { font-size: 11px; padding: 3px 9px; background: var(--brand); color: var(--on-brand); }
.gp-box { display: flex; flex-direction: column; }
/* Player photo in the line of the night (placeholder mascot until a licensed photo source exists) */
.lotn .photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) {
}
.gp-bestrow .muted { font-size: 14px; }
.pctcol { color: var(--ink-2); } .lines td.pct span { color: var(--ink-2); }

/* Line of the night: the photo always sits to the right of the name, never below it.
   Wide: name and stats | score | photo. Narrow: name | photo, then stats, then score. */
.lotn { background: var(--forest); color: var(--on-forest); border-radius: var(--r-lg); padding: clamp(18px, 4vw, 32px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who photo" "stat stat" "score score"; gap: 14px 20px; align-items: center; }
.lotn .who { grid-area: who; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lotn .statline { grid-area: stat; }
.lotn .scorebox { grid-area: score; display: flex; flex-flow: row wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.lotn .photo { grid-area: photo; align-self: start; margin: 0; width: clamp(84px, 22vw, 168px); aspect-ratio: 1; border-radius: clamp(12px, 2vw, 20px); overflow: hidden; background: #fbf6ea; border: 3px solid var(--highlight); }
.lotn h2 { overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .lotn { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "who score photo" "stat score photo"; column-gap: 28px; }
  .lotn .who { align-self: end; }
  .lotn .statline { align-self: start; }
  .lotn .scorebox { flex-direction: column; align-items: flex-start; }
  .lotn .photo { width: 168px; align-self: center; }
}
