/* TexMexHoops palette, taken from the app icon: ball orange for action and selection,
   hat-leather browns for the darks. Every text colour is at least 4.5:1 on --card2. */
:root {
  --bg: #110d0b;
  --side: #17120f;
  --card: #211b17;
  --hover: #1c1714;
  --card2: #2f2823;
  --card3: #4a3f37;
  --line: #2a231e;
  --text: #f7f2ec;
  --dim: #c9bdb2;
  --faint: #a3968c; /* third text level, not a hairline colour */
  --sep: #3a312b;
  --live: #ff4b3e;
  --accent: #f5862b;
  --gold: #ffd25e;
  --score: "Big Shoulders Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
}
/* scoreboard numerals and the wordmark: Big Shoulders Display (OFL), latin subset only */
@font-face {
  font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/big-shoulders-display-800-latin.woff2") format("woff2");
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
html { color-scheme: dark; scrollbar-color: var(--card3) transparent; }
body {
  font: 15px/1.3 "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  /* only chrome is unselectable; scores, box scores and plays can be copied */
}
.drag { position: fixed; inset: 0 0 auto 0; height: 36px; -webkit-app-region: drag; z-index: 10; background: var(--bg); }
.brand { position: fixed; top: 0; left: 18px; height: 36px; display: flex; align-items: center; z-index: 11; pointer-events: none;
  font: 800 19px/1 var(--score); letter-spacing: .03em; text-transform: uppercase; color: var(--text); }
.brand span { color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 40px 16px 32px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, .game:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* header + day strip */
.top { display: flex; align-items: baseline; gap: 10px; padding: 8px 4px 12px; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.league { color: var(--dim); font-weight: 600; }
.days {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none;
  position: sticky; top: 36px; background: var(--bg); z-index: 5;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card);
  color: var(--dim); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.day.on { background: var(--accent); color: var(--bg); }
.day.on small { color: inherit; }

/* game list */
.section { color: var(--dim); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; margin: 18px 6px 8px; }
.game {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: 100%; padding: 16px 18px; margin-bottom: 10px; border-radius: 22px; overflow: hidden;
  background: var(--card); text-align: left; transition: transform .12s ease;
}
.game:hover { transform: scale(1.01); }
.game:active { transform: scale(.99); }
/* team colours bleed in from each side, like Apple Sports */
.game::before {
  content: ""; position: absolute; inset: 0; opacity: .38; pointer-events: none;
  background: linear-gradient(90deg, var(--ca) 0%, transparent 38%, transparent 62%, var(--ch) 100%);
}
.game > * { position: relative; }
.side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side.home { flex-direction: row-reverse; text-align: right; }
.logo { width: 44px; height: 44px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.abbr { font-size: 17px; font-weight: 700; }
.rec { color: var(--dim); font-size: 12px; }
.score { font: 800 38px/1 var(--score); margin-left: auto; }
.side.home .score { margin-left: 0; margin-right: auto; }
.score.lost { color: var(--dim); }
.mid { min-width: 96px; padding: 0 10px; text-align: center; font-size: 13px; font-weight: 600; color: var(--dim); }
.mid .time { color: var(--text); font-size: 15px; }
/* phone-width window (down to minWidth 420): shrink logo, score and the middle so scores never touch the status */
@media (max-width: 559px) {
  .game { padding: 14px; }
  .game .side { gap: 8px; }
  .game .logo { width: 32px; height: 32px; }
  .game .score { font-size: 32px; }
  .game .mid { min-width: 72px; padding: 0 6px; }
}
.mid .tv { font-size: 11px; color: var(--faint); margin-top: 2px; }
.live { color: var(--live); }
.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--live); margin-right: 5px; vertical-align: 1px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.star { color: var(--gold); font-size: 11px; margin-left: 4px; }
.empty { color: var(--dim); text-align: center; padding: 60px 0; }

/* detail */
.back { color: var(--accent); font-size: 17px; padding: 6px 2px 14px; }
.hero {
  position: relative; border-radius: 26px; padding: 22px 18px; overflow: hidden; background: var(--card);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center;
}
.hero::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background: linear-gradient(90deg, var(--ca), transparent 45%, transparent 55%, var(--ch)); }
.hero > * { position: relative; }
.hero .logo { width: 72px; height: 72px; margin: 0 auto 6px; display: block; }
.hero .score { font-size: 58px; margin: 0; }
.hero .mid { font-size: 14px; }
.fav { margin-top: 6px; font-size: 12px; color: var(--dim); padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.fav.on { color: var(--gold); }
.venue { color: var(--faint); font-size: 12px; text-align: center; margin: 8px 0 0; }
.card { background: var(--card); border-radius: 20px; padding: 14px 16px; margin-top: 14px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { color: var(--dim); font-size: 12px; font-weight: 600; text-align: right; padding: 4px 6px; }
td { text-align: right; padding: 7px 6px; border-top: 1px solid var(--sep); font-size: 14px; }
th:first-child, td:first-child { text-align: left; }
td.b { font-weight: 700; }
.lead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--sep); }
.lead:first-of-type { border-top: 0; }
.lead .cat { color: var(--dim); font-size: 12px; text-align: center; }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player.r { flex-direction: row-reverse; text-align: right; }
.head { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); object-fit: cover; flex: none; }
.player .v { font: 800 26px/1 var(--score); }
.player .n { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { display: grid; grid-template-columns: 52px 1fr 52px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.bar .lbl { grid-column: 1 / -1; text-align: center; color: var(--dim); font-size: 12px; margin-bottom: -2px; }
.bar .r { text-align: right; }
.keys { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.key { display: flex; align-items: center; gap: 6px; }
.key i { width: 10px; height: 10px; border-radius: 3px; }
.track { display: flex; height: 6px; gap: 3px; }
.track i { border-radius: 3px; }
.seg { display: flex; background: var(--card2); border-radius: 9px; padding: 2px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 6px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--dim); }
.seg button.on { background: var(--card3); color: var(--text); }
.box { overflow-x: auto; scrollbar-width: thin; }
/* linescore: compact columns beside the team instead of stretching across the card */
.ls { width: auto; }
.ls th, .ls td { min-width: 44px; }
.ls td:first-child { min-width: 64px; }
.box td, .box th { white-space: nowrap; font-size: 13px; }
.box td:first-child { position: sticky; left: 0; background: var(--card); padding-right: 12px; }
.box tr.dnp td { color: var(--dim); }
.box tr.sub td { color: var(--dim); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 14px; text-align: left; }
.box tr.tot td { font-weight: 700; border-top: 1px solid var(--dim); }
.error { color: var(--text); text-align: center; padding: 40px 16px; text-wrap: pretty; }
.retry { margin-top: 12px; padding: 7px 16px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 700; font-size: 14px; }
.venue .retry { margin: 0 0 0 6px; padding: 2px 10px; font-size: 12px; }
.league.stale, .venue.stale { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* injury report */
.injteam { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
.injteam:first-of-type { margin-top: 0; }
.mini { width: 22px; height: 22px; object-fit: contain; }
.inj { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--sep); }
.inj .n1 { font-size: 14px; font-weight: 600; }
.inj .pos { color: var(--dim); font-weight: 400; font-size: 12px; }
.inj .n2 { color: var(--dim); font-size: 12px; }
.pill { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,210,94,.16); color: var(--gold); }
.pill.out { background: rgba(255,69,58,.18); color: #ff7a70; }
.none { color: var(--faint); font-size: 13px; padding: 6px 0; }

/* shot chart */
.court summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.court summary::-webkit-details-marker { display: none; }
.court summary h2 { margin: 0; }
.court[open] summary { margin-bottom: 10px; }
.chev { color: var(--dim); font-size: 20px; transition: transform .15s ease; }
.court[open] .chev { transform: rotate(90deg); }
.floor { display: block; width: 100%; height: auto; background: #2a2118; border-radius: 12px; }
.floor .ln { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; }
.floor .rim { stroke: var(--accent); }
.floor .made { stroke: #fff; stroke-width: 1.5; }
.floor .miss { stroke-width: 2.5; fill: none; opacity: .75; }
.floor .pulse { fill: none; stroke: #fff; stroke-width: 3; animation: ping 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.floor .zone { opacity: .8; stroke: rgba(0,0,0,.35); stroke-width: 1; }
.floor .zl { fill: #fff; font-size: 14px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: 3px; }
.floor .zp { font: 800 26px var(--score); }
.shotsum { display: flex; justify-content: center; gap: 22px; margin-top: 10px; font-size: 14px; color: var(--dim); }
.shotsum b { color: var(--text); }
.legend { display: flex; justify-content: center; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--dim); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.legend .ring { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
.legend .sw { width: 14px; height: 10px; border-radius: 3px; opacity: .8; }
.lastshot { margin-top: 10px; font-size: 13px; color: var(--dim); text-align: center; }
.lastshot b { color: var(--live); margin-right: 4px; }

/* listen live */
.listens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.listen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card2);
  color: var(--text); text-decoration: none; min-width: 0; }
.listen:hover { background: var(--card3); }
.listen:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.listen span:not(.play) { display: flex; flex-direction: column; min-width: 0; }
.listen b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen small { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen .play { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; background: var(--live); display: grid; place-items: center; font-size: 11px; flex: none; }
.note { color: var(--faint); font-size: 12px; margin-top: 10px; text-wrap: pretty; }

/* shot chart player picker */
.picker { flex: 1 1 160px; min-width: 0; padding: 8px 32px 8px 12px; border-radius: 9px; border: 0; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--card2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23aaa' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; cursor: pointer; }
.picker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker option, .picker optgroup { background: var(--card2); color: var(--text); }

/* ---------- shared bits for the split layout ---------- */
.day small { margin-left: 5px; font-weight: 500; color: var(--faint); }
.section { display: flex; align-items: center; gap: 8px; }
.section .count { background: var(--live); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; letter-spacing: 0; }
.prog { width: 64px; height: 3px; margin: 6px auto 0; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--live); border-radius: 2px; }
.hero .prog { width: 110px; }
.game:active, .item:active, .team:active { transform: scale(.98); transition: transform .1s ease-out; }
body:not(.wide) #side { display: none; }
/* narrow: My Teams becomes a chip strip under the days */
body:not(.wide) #myteams { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 6px; scrollbar-width: none; }
body:not(.wide) #myteams h3 { display: none; }
body:not(.wide) #myteams .team { flex: none; width: auto; padding: 5px 14px 5px 6px; border-radius: 999px; background: var(--card); white-space: nowrap; }
body:not(.wide) #myteams .hint { padding: 0 4px; color: var(--dim); }
@media (prefers-reduced-motion: reduce) {
  .game:hover, .game:active, .item:active, .team:active { transform: none; }
  .live::before, .floor .pulse { animation: none; }
  .chev { transition: none; }
}

/* ---------- wide window: sidebar | game list | game ---------- */
body.wide { overflow: hidden; }
.wide .app { display: grid; grid-template-columns: 210px 360px minmax(0, 1fr); height: 100vh; }
.wide #side, .wide #scores, .wide #detail { overflow-y: auto; height: 100vh; scrollbar-width: thin; scrollbar-color: var(--card3) transparent; }
.wide #side { background: var(--side); border-right: 1px solid var(--line); padding: 44px 12px 16px; }
.wide #scores { max-width: none; margin: 0; padding: 44px 0 16px; border-right: 1px solid var(--line); }
.wide #detail { max-width: none; margin: 0; padding: 44px 28px 32px; }
.wide #detail > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.wide #detail > .card, .wide #detail > .hero { margin-top: 14px; }
.wide #detail > .hero:first-of-type { margin-top: 0; }
.wide .back { display: none; }
.wide .top { padding: 0 18px 10px; flex-direction: column; gap: 2px; }
.wide h1 { font-size: 26px; letter-spacing: -.02em; }
.wide .league { font-size: 13px; }
.wide .section { margin: 14px 18px 6px; }

/* sidebar days: vertical list */
.wide .days { position: static; flex-direction: column; gap: 2px; overflow: visible; padding: 0; background: none; }
.wide .day { display: flex; flex-direction: column; align-items: flex-start; position: relative; padding: 7px 10px; border-radius: 9px;
  background: none; color: var(--dim); font-weight: 500; text-align: left; }
.wide .day small { margin: 1px 0 0; font-size: 11px; color: var(--faint); opacity: 1; }
.wide .day:hover { background: var(--hover); }
.wide .day.on { background: var(--card2); color: var(--text); font-weight: 600; }
.wide .day.haslive::after { content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: var(--live); }

/* sidebar My Teams */
#myteams h3 { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin: 18px 10px 6px; }
.team { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 9px; text-align: left; font-size: 14px; font-weight: 600; }
.team:hover:not(:disabled) { background: var(--hover); }
.team:disabled { cursor: default; opacity: .55; }
.team .logo { width: 24px; height: 24px; }
.team span { display: flex; flex-direction: column; min-width: 0; }
.team small { font-size: 11px; font-weight: 500; color: var(--faint); }
.team small.live::before { display: none; }
.hint { font-size: 12px; color: var(--faint); padding: 0 10px; line-height: 1.4; }

/* game list rows */
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; width: calc(100% - 20px); margin: 0 10px 2px;
  padding: 10px; border-radius: 12px; text-align: left; }
.item:hover { background: var(--hover); }
.item.on { background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
.item .tr { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; min-width: 0; }
.item .logo { width: 22px; height: 22px; }
.item .r { color: var(--faint); font-weight: 400; font-size: 12px; }
.item .score { margin-left: auto; font-size: 21px; }
.item .st { grid-row: 1 / 3; grid-column: 2; min-width: 78px; text-align: right; font-size: 12px; font-weight: 600; color: var(--dim); }
.item .st .prog { margin: 5px 0 0 auto; width: 56px; }
.item .st .time { font-size: 13px; }

/* fixes: one-line sidebar days so My Teams stays in view; long TV lists can't squash a row */
.wide .day { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 6px 10px; }
.wide .day small { margin: 0; }
.wide .day.haslive::after { right: auto; left: 2px; width: 5px; height: 5px; margin-top: -2px; }
.item .r { white-space: nowrap; }
.item .st { max-width: 120px; }
.item .st .tv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .score:not(.lost) { color: var(--text); }
.wide .day { padding-left: 16px; }
.wide .day.haslive::after { left: 5px; }

/* onboarding: empty day, keyboard hint */
.empty .retry { margin-top: 14px; }
.kbd { margin: 18px 18px 0; font-size: 12px; color: var(--faint); }
.kbd kbd { font: 600 11px/1 "Segoe UI Variable Display", "Segoe UI", sans-serif; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--sep); color: var(--dim); }

/* shot chart: whose shots + view in one row */
.court-ctl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.court-ctl .seg { margin: 0; flex: none; }
.court-ctl .seg button { padding: 6px 12px; white-space: nowrap; }
/* wide sidebar: My Teams above the dates */
.wide #myteams { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.wide #myteams h3 { margin-top: 0; }
.wide #myteams:empty { display: none; }
.drag, .brand, button, summary, .days, .seg, .kbd { user-select: none; }

/* go-to-date picker: last chip in the day strip, last row in the sidebar */
.pick { flex: none; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--card); color: var(--dim);
  font: 600 14px/1.2 "Segoe UI Variable Display", "Segoe UI", sans-serif; color-scheme: dark; cursor: pointer; }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.wide .pick { margin-top: 6px; padding: 6px 10px 6px 16px; border-radius: 9px; background: none; font-weight: 500; }
.wide .pick:hover { background: var(--hover); }

/* wide sidebar: collapsible date list (folded keeps the selected day and the date picker) */
.daystoggle { display: none; }
.wide .daystoggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 0 4px; padding: 4px 10px;
  border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.wide .daystoggle:hover { background: var(--hover); }
.wide .daystoggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.wide .days.folded .day:not(.on) { display: none; }
.wide .daystoggle .chev { font-size: 16px; }
