/* Thomas Nelson Stat Tracker — school colors: Navy #141539, Steel #788189, White */
:root {
  --navy: #141539; --navy-2: #1d1f4d; --navy-3: #2a2d66;
  --steel: #788189; --steel-2: #9aa2a9; --white: #ffffff;
  --good: #22c55e; --bad: #ef4444; --warn: #f59e0b; --info: #60a5fa;
  --radius: 14px; --radius-sm: 9px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0a0b1f; --bg-2: #0f1029; --surface: #15173a; --surface-2: #1c1f4a; --surface-3: #262a5c;
  --border: rgba(154,162,169,.16); --border-2: rgba(154,162,169,.28);
  --text: #eef0f4; --text-2: #b4bac1; --text-3: #7f8790;
  --accent: #c9d0d6; --accent-ink: #141539; --chip: #262a5c;
  --court-wood: #1a1c44; --court-line: rgba(220,226,232,.55); --court-paint: rgba(120,129,137,.22);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}
[data-theme="light"] {
  --bg: #eef0f4; --bg-2: #e4e7ec; --surface: #ffffff; --surface-2: #f5f6f9; --surface-3: #e8ebf0;
  --border: rgba(20,21,57,.10); --border-2: rgba(20,21,57,.2);
  --text: #141539; --text-2: #454a68; --text-3: #788189;
  --accent: #141539; --accent-ink: #ffffff; --chip: #e8ebf0;
  --court-wood: #e9e4d8; --court-line: #141539; --court-paint: rgba(120,129,137,.28);
  --shadow: 0 10px 30px rgba(20,21,57,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
a { color: inherit; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; border-right: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; }
.brand img { width: 40px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.brand .t1 { font-weight: 800; letter-spacing: .3px; font-size: 15px; line-height: 1.1; }
.brand .t2 { color: var(--steel-2); font-size: 10px; letter-spacing: .5px; white-space: nowrap; text-transform: uppercase; }
.level-switch { display: flex; background: rgba(255,255,255,.07); border-radius: 10px; padding: 3px; margin: -6px 0 10px; }
.level-switch button { flex: 1; border: 0; background: transparent; color: #c8cdd3; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.level-switch button.on { background: var(--steel); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.level-switch button:hover:not(.on) { color: #fff; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: #c8cdd3; cursor: pointer; text-align: left; font-weight: 600; transition: .15s; }
.nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-btn.active { background: linear-gradient(90deg, rgba(120,129,137,.35), rgba(120,129,137,.12)); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.nav-btn svg { width: 19px; height: 19px; flex: none; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 4px; }
.nav-live { margin-top: 4px; background: rgba(239,68,68,.15); color: #fecaca; }
.nav-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6);} 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0);} 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0);} }
.sidebar .spacer { flex: 1; }
.theme-toggle { display: flex; background: rgba(255,255,255,.07); border-radius: 10px; padding: 3px; }
.theme-toggle button { flex: 1; border: 0; background: transparent; color: #c8cdd3; padding: 7px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; }
.theme-toggle button.on { background: #fff; color: var(--navy); }
.side-foot { color: var(--steel-2); font-size: 11px; padding: 8px 6px 0; line-height: 1.5; }

.main { overflow: auto; position: relative; }
.page { padding: 26px 30px 60px; max-width: 1500px; margin: 0 auto; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.3px; }
.page-head .sub { color: var(--text-3); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1300px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h3 { padding: 16px 18px 0; }
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-3) 60%, #4b5560 130%); color: #fff; border-radius: 18px; padding: 26px 28px; display: flex; align-items: center; gap: 24px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(255,255,255,.04); }
.hero img { width: 74px; }
.hero h2 { margin: 0; font-size: 28px; letter-spacing: -.4px; }
.hero .meta { color: #c8cdd3; margin-top: 4px; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile .lbl { color: var(--text-3); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; }
.stat-tile .val { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat-tile .note { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ---------- Buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); padding: 9px 15px; border-radius: 10px; cursor: pointer; font-weight: 700; transition: .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(239,68,68,.12); color: var(--bad); border-color: rgba(239,68,68,.35); }
.btn.good { background: rgba(34,197,94,.14); color: var(--good); border-color: rgba(34,197,94,.35); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 13px 20px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.input, select.input, textarea.input { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 12px; outline: none; width: 100%; }
.input:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(120,129,137,.25); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--text-2); font-size: 12.5px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .4px; background: var(--chip); color: var(--text-2); text-transform: uppercase; }
.pill.live { background: rgba(239,68,68,.16); color: #f87171; }
.pill.final { background: rgba(120,129,137,.2); color: var(--text-2); }
.pill.win { background: rgba(34,197,94,.16); color: var(--good); }
.pill.loss { background: rgba(239,68,68,.14); color: var(--bad); }
.muted { color: var(--text-3); } .small { font-size: 12px; }
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty b { color: var(--text); display: block; font-size: 17px; margin-bottom: 6px; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--text); } .tbl th.sorted { color: var(--text); }
.tbl td { padding: 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child, .tbl .l { text-align: left; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr.tot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--border-2); }
.tbl tr.click { cursor: pointer; }
.tbl .num { color: var(--text-3); font-weight: 700; display: inline-block; min-width: 26px; }
.tbl td.hi { font-weight: 800; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5,6,20,.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; width: min(720px, 94vw); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal.wide { width: min(1100px, 96vw); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-h h2 { margin: 0; font-size: 18px; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: fade .2s; border: 1px solid rgba(255,255,255,.12); }

/* ---------- Game list ---------- */
.game-card { display: grid; grid-template-columns: 90px 1fr auto auto 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s; }
.game-card:hover { background: var(--surface-2); }
.game-card .date { color: var(--text-3); font-size: 12px; font-weight: 700; line-height: 1.3; }
.game-card .tm { font-weight: 800; font-size: 15px; }
.game-card .tm.r { text-align: right; }
.game-card .sc { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
.game-card .sc.w { color: var(--text); } .game-card .sc.l { color: var(--text-3); }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 6px; border: 1px solid var(--border-2); }

/* ---------- LIVE GAME ---------- */
.live-view { display: grid; grid-template-rows: auto auto 1fr; height: 100vh; }
.scorebar { background: linear-gradient(180deg, var(--navy) 0%, #0e0f2b 100%); color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 22px; gap: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-team { display: flex; align-items: center; gap: 14px; }
.sb-team.away { flex-direction: row-reverse; text-align: right; }
.sb-team .nm { font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.sb-team .meta { display: flex; gap: 10px; font-size: 11px; color: #aeb5bd; margin-top: 4px; font-weight: 700; letter-spacing: .4px; }
.sb-team.away .meta { justify-content: flex-end; }
.sb-team .score { font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -1.5px; min-width: 76px; text-align: center; }
.sb-team .tag { width: 8px; height: 46px; border-radius: 4px; }
.bonus { background: var(--warn); color: #241600; padding: 1px 6px; border-radius: 5px; font-weight: 900; }
.bonus.dbl { background: var(--bad); color: #fff; }
.to-dots { display: inline-flex; gap: 3px; align-items: center; } .to-dots i { width: 7px; height: 7px; border-radius: 50%; background: #fff; display: inline-block; } .to-dots i.u { background: rgba(255,255,255,.18); }
.sb-mid { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sb-period { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #aeb5bd; text-transform: uppercase; }
.sb-clock { font-family: var(--mono); font-size: 34px; font-weight: 700; padding: 2px 16px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); cursor: pointer; min-width: 138px; }
.sb-clock.run { color: #4ade80; }
.sb-ctl { display: flex; gap: 6px; }
.sb-ctl button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; }
.sb-ctl button:hover { background: rgba(255,255,255,.16); }
.poss { font-size: 11px; color: #aeb5bd; font-weight: 700; cursor: pointer; }
.poss b { color: #fff; }

.live-tabs { display: flex; gap: 4px; padding: 8px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border); align-items: center; }
.live-tabs .tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--text-2); }
.live-tabs .tab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--border-2); }
.live-body { overflow: auto; }
.tracker { display: grid; grid-template-columns: 280px 1fr 280px; gap: 14px; padding: 14px 18px; height: 100%; min-height: 0; }
.bench-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bench-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.bench-head .nm { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.bench-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.sec-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px; color: var(--text-3); text-transform: uppercase; padding: 6px 6px 2px; display: flex; justify-content: space-between; }
.pcard { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 11px; background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; transition: .1s; user-select: none; }
.pcard:hover { border-color: var(--border-2); }
.pcard.sel { border-color: var(--accent); background: var(--surface-3); box-shadow: 0 0 0 3px rgba(120,129,137,.25); }
.pcard.bench { opacity: .78; background: transparent; border: 1px dashed var(--border); }
.pcard .jn { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; color: #fff; }
.pcard .pn { font-weight: 700; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .ps { font-size: 11px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.pcard .pts { font-weight: 900; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.fouls { display: inline-flex; gap: 2px; } .fouls i { width: 6px; height: 6px; border-radius: 2px; background: var(--surface-3); display: inline-block; } .fouls i.f { background: var(--warn); } .fouls.out i.f { background: var(--bad); }
.foul-trouble { color: var(--warn); font-weight: 800; }

.center-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.court-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; position: relative; }
.court-hint { position: absolute; top: 18px; left: 22px; font-size: 12px; font-weight: 700; color: var(--text-3); pointer-events: none; }
.court-dir { position: absolute; top: 14px; right: 18px; }
svg.court { width: 100%; height: auto; display: block; cursor: crosshair; border-radius: 10px; max-height: 46vh; }
svg.court .wood { fill: var(--court-wood); }
svg.court .ln { fill: none; stroke: var(--court-line); stroke-width: .28; }
svg.court .paint { fill: var(--court-paint); }
svg.court .mk-made { fill: var(--good); stroke: #fff; stroke-width: .25; }
svg.court .mk-miss { stroke: var(--bad); stroke-width: .5; fill: none; }
svg.court .mk-pending { fill: var(--warn); stroke: #fff; stroke-width: .3; animation: pulse 1.2s infinite; }
svg.court .zone { stroke: var(--court-line); stroke-width: .12; stroke-opacity: .5; }
svg.court .zlbl { font-size: 1.9px; font-weight: 800; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: .35px; }
.actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.act { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 11px 6px; cursor: pointer; font-weight: 800; font-size: 13px; transition: .1s; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.act small { font-weight: 600; color: var(--text-3); font-size: 10.5px; }
.act:hover { background: var(--surface-2); border-color: var(--border-2); }
.act.g { color: var(--good); } .act.r { color: var(--bad); } .act.w { color: var(--warn); }
.act kbd { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
.feed { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); flex: 1; min-height: 140px; display: flex; flex-direction: column; overflow: hidden; }
.feed-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.feed-list { overflow: auto; flex: 1; }
.ev { display: grid; grid-template-columns: 54px 6px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ev .clk { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.ev .bar { width: 4px; height: 22px; border-radius: 3px; }
.ev .sc { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); }
.ev .x { opacity: 0; border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ev:hover .x { opacity: 1; } .ev .x:hover { color: var(--bad); background: rgba(239,68,68,.1); }
.ev.score .txt { font-weight: 700; }
.ev.sys { background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: 12px; }

/* shot popover (GameChanger-style flow) */
.flow { position: fixed; z-index: 60; width: 360px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow); animation: fade .12s; overflow: hidden; }
.flow-h { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.flow-h b { font-size: 14px; }
.flow-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chip { border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px 6px; cursor: pointer; font-weight: 700; font-size: 12.5px; text-align: center; transition: .1s; line-height: 1.15; }
.chip:hover { border-color: var(--border-2); }
.chip.on { border-color: var(--accent); background: var(--surface-3); }
.chip .n { font-weight: 900; font-size: 15px; display: block; }
.chip.wide { grid-column: span 3; }
.chip.half { grid-column: span 1; }
.bigchoice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bigchoice button { padding: 16px; border-radius: 12px; font-weight: 900; font-size: 16px; cursor: pointer; border: 0; }
.bigchoice .mk { background: var(--good); color: #052e14; }
.bigchoice .ms { background: var(--bad); color: #fff; }
.flow-lbl { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-3); }

/* reports */
.report-grid { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.qtable td, .qtable th { text-align: center; }
.qtable td:first-child, .qtable th:first-child { text-align: left; }
.qtable td.t { font-weight: 900; font-size: 16px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.cmp { display: grid; grid-template-columns: 70px 1fr 140px 1fr 70px; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.cmp .v { font-weight: 800; } .cmp .v.r { text-align: right; }
.cmp .lb { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .8px; color: var(--text-3); text-transform: uppercase; }
.cmp .track { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; display: flex; }
.cmp .track.l { justify-content: flex-end; }
.cmp .fill { height: 100%; border-radius: 6px; }
.summary p { line-height: 1.65; margin: 0 0 10px; color: var(--text-2); }
.summary p b { color: var(--text); }
.keys li { margin-bottom: 7px; line-height: 1.5; color: var(--text-2); }
.keys li b { color: var(--text); }
.leader { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.leader:last-child { border-bottom: 0; }
.leader .jn { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; }
.leader .v { margin-left: auto; font-size: 20px; font-weight: 900; }
.leader .nm { font-weight: 700; } .leader .s { font-size: 11px; color: var(--text-3); }
.zone-legend { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--text-3); font-weight: 700; }
.zone-legend i { width: 30px; height: 8px; border-radius: 4px; display: inline-block; }
.print-head { display: none; }

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .sidebar, .no-print, .live-tabs, .scorebar .sb-ctl, .btn { display: none !important; }
  .app { display: block; } .main { overflow: visible; } .live-view { height: auto; display: block; }
  .card, .bench-panel { border: 1px solid #ccc; break-inside: avoid; }
  .print-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
}

/* ---------- Sign-in screen ---------- */
.login-screen { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 30px;
  background: radial-gradient(1200px 600px at 20% 10%, #2a2d66 0%, transparent 60%), radial-gradient(900px 500px at 90% 100%, rgba(120,129,137,.35) 0%, transparent 60%), #0b0c24; animation: fade .25s; }
.login-screen.out { opacity: 0; transition: opacity .25s; }
.login-card { width: min(520px, 94vw); background: rgba(21,23,58,.92); border: 1px solid rgba(154,162,169,.25); border-radius: 22px; padding: 30px 34px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.55); color: #eef0f4; text-align: left; }
.login-card .muted { color: #aeb5bd; line-height: 1.55; }
.login-logo { height: 92px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.login-kicker { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 2.4px; color: #9aa2a9; text-transform: uppercase; }
.login-card h1 { text-align: center; margin: 6px 0 10px; font-size: 26px; letter-spacing: -.3px; }
.login-card .flow-lbl { color: #9aa2a9; }
.login-card label.f { color: #c8cdd3; }
.login-card .input { background: rgba(255,255,255,.06); border-color: rgba(154,162,169,.35); color: #fff; }
.login-card .input.lg { padding: 13px 14px; font-size: 16px; }
.login-card .seg { background: rgba(255,255,255,.05); border-color: rgba(154,162,169,.2); }
.login-card .seg button { color: #c8cdd3; }
.login-card .seg button.on { background: #fff; color: #141539; }
.login-card .btn.primary { background: #fff; color: #141539; }
.login-recent { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(154,162,169,.25); background: rgba(255,255,255,.05); color: #fff; cursor: pointer; text-align: left; transition: .12s; }
.login-user:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.login-user b { display: block; font-size: 13.5px; } .login-user small { color: #9aa2a9; font-size: 11px; }
.login-or { display: flex; align-items: center; gap: 10px; color: #7f8790; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: rgba(154,162,169,.25); }
.av, .av-lg { width: 32px; height: 32px; border-radius: 50%; background: #788189; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; flex: none; }
.av-lg { width: 44px; height: 44px; font-size: 15px; background: var(--navy-3); }
.signed-in { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.signed-in .nm { font-weight: 800; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signed-in .rl { font-size: 11px; color: var(--steel-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signed-in .sw { border: 1px solid rgba(255,255,255,.18); background: transparent; color: #c8cdd3; border-radius: 8px; font-size: 14px; font-weight: 700; padding: 2px 8px; flex: none; cursor: pointer; }
.signed-in .sw:hover { color: #fff; background: rgba(255,255,255,.08); }
.keeper-line { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.save-pick { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.save-pick.top { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(120,129,137,.18); }

/* ---------- Printable reports ---------- */
#print-root { display: none; }
.rpt-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid #141539; padding-bottom: 10px; margin-bottom: 14px; }
.rpt-head img { height: 64px; }
.rpt-kicker { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #788189; text-transform: uppercase; }
.rpt-title { font-size: 22px; font-weight: 900; color: #141539; }
.rpt-sub { font-size: 12px; color: #454a68; margin-top: 2px; }
.rpt-meta { font-size: 10px; color: #788189; text-align: right; }
.pr-h { font-size: 15px; margin: 0 0 10px; color: #141539; border-left: 4px solid #788189; padding-left: 8px; }
.card h3 a, .tbl a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--text-3); }
@media print {
  @page { margin: 0.4in; }
  body.printing #app, body.printing .modal-back, body.printing .toast-wrap, body.printing .flow, body.printing .login-screen { display: none !important; }
  body.printing #print-root { display: block; background: #fff; color: #141539; font-size: 11px; }
  #print-root .pr-section { break-before: page; }
  #print-root .card, #print-root .stat-tile { break-inside: avoid; padding: 10px; border-radius: 8px; border: 1px solid #d5d9e0; background: #fff; }
  #print-root .card.flush { padding: 0; }
  #print-root .pr-keep { break-inside: avoid; }
  #print-root .report-grid { padding: 0; gap: 10px; }
  #print-root .grid { gap: 10px; }
  #print-root .tbl-wrap { overflow: visible; max-height: none !important; }
  #print-root .tbl th { position: static; font-size: 8.5px; padding: 4px 5px; }
  #print-root .tbl td { padding: 3px 5px; font-size: 9.5px; }
  #print-root svg.court { max-height: 3.6in; }
  #print-root .feed-list { overflow: visible; }
  #print-root .ev { padding: 2px 8px; font-size: 9px; break-inside: avoid; }
  #print-root .ev .x { display: none; }
  #print-root .stat-tile .val { font-size: 18px; }
  #print-root .summary p { margin: 0 0 5px; font-size: 10.5px; }
  #print-root .cmp { grid-template-columns: 50px 1fr 110px 1fr 50px; }
  #print-root .bars { gap: 5px; }
  #print-root .tbl tr:hover td { background: none; }
  html, body.printing { background: #fff !important; }
  #print-root .rpt-head + section.pr-section, #print-root .rpt-head + section { break-before: auto; }
  #print-root .pr-h { break-after: avoid; }
  #print-root .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  #print-root svg.court { max-height: 2.5in; }
  #print-root .zt td, #print-root .zt th { padding: 1px 5px; font-size: 8px; }
  #print-root .keys li { margin-bottom: 3px; font-size: 10px; }
  .preview-badge { display: none !important; }
}
.lu5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.lu5-card { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px; position: relative; break-inside: avoid; }
.lu5-rank { position: absolute; top: 10px; right: 12px; font-size: 22px; font-weight: 900; color: var(--text-3); }
.lu5-players { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; font-size: 12.5px; }
.lu5-players b { color: var(--text-3); display: inline-block; min-width: 26px; }
.lu5-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.lu5-stats span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); }
.lu5-stats b { font-size: 15px; }
@media (max-width: 1300px) { .lu5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media print { #print-root .lu5 { grid-template-columns: repeat(5, minmax(0,1fr)); } }
.rpt-by { font-size: 12px; color: #141539; margin-bottom: 2px; }
.rpt-foot { display: none; }
@media print {
  #print-root .rpt-foot { display: block; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: 8.5px; color: #788189; border-top: 1px solid #d5d9e0; padding-top: 3px; background: #fff; }
  #print-root { padding-bottom: 16px; }
}
.login-err { min-height: 18px; color: #fca5a5; font-size: 12.5px; font-weight: 700; margin-top: 8px; }
.login-card .input.bad { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.25); }
.login-card.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.cloud-pill { margin: 8px 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.06); cursor: pointer; display: flex; flex-direction: column; gap: 1px; border: 1px solid rgba(255,255,255,.08); }
.cloud-pill b { font-size: 12px; color: #fff; } .cloud-pill span { font-size: 10.5px; color: var(--steel-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cloud-pill.ok b { color: #86efac; } .cloud-pill.warn b { color: #fcd34d; } .cloud-pill.bad b { color: #fca5a5; } .cloud-pill.busy b { color: #93c5fd; }
.cloud-pill:hover { background: rgba(255,255,255,.1); }
/* ---------- Schedule ---------- */
.sch-row { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.sch-row:last-child { border-bottom: 0; } .sch-row:hover { background: var(--surface-2); }
.sch-date { width: 56px; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 5px 0; display: flex; flex-direction: column; line-height: 1.1; }
.sch-date span { font-size: 10px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .8px; } .sch-date b { font-size: 22px; font-weight: 900; }
.sch-match { font-size: 15px; margin-bottom: 2px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.cal-h { font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; text-align: center; padding: 4px 0; }
.cal-cell { min-height: 92px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: .1s; }
.cal-cell:hover { border-color: var(--border-2); } .cal-cell.dim { opacity: .45; } .cal-cell.today { border-color: var(--steel); box-shadow: 0 0 0 2px rgba(120,129,137,.35); }
.cal-d { font-size: 12px; font-weight: 800; color: var(--text-3); }
.cal-ev { font-size: 11.5px; border-radius: 6px; padding: 3px 6px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { opacity: .7; font-weight: 800; font-size: 10px; }
.cal-ev.final { background: var(--surface-3); color: var(--text-2); } .cal-ev.live { background: var(--bad); color: #fff; }
.pass-bar { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.pass-btn { border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); padding: 10px 22px; cursor: pointer; display: flex; flex-direction: column; align-items: center; min-width: 150px; transition: transform .05s; }
.pass-btn:active { transform: scale(.96); }
.pass-btn .pp { font-size: 18px; font-weight: 900; letter-spacing: .5px; } .pass-btn small { font-size: 11px; font-weight: 700; opacity: .75; }
.pass-btn kbd { font-family: var(--mono); font-size: 10px; background: rgba(127,127,127,.25); border-radius: 4px; padding: 0 4px; }
.pass-info { display: flex; gap: 20px; flex: 1; }
.pass-info div { display: flex; flex-direction: column; } .pass-info b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; } .pass-info span { font-size: 10.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.lu-names { white-space: normal; display: inline-block; min-width: 300px; max-width: 520px; line-height: 1.45; }
.live-tabs { overflow-x: auto; } .live-tabs .tab, .live-tabs .btn { white-space: nowrap; flex: none; }
body:has(.login-screen) .modal-back, body:has(.login-screen) .toast-wrap { z-index: 120; }
