/* ===== Stat keeping ===== */
.stats { --made: #2fd27f; --miss: #ff5d6c; }

.st-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.st-game { display: flex; align-items: center; gap: 6px; }
.st-game select { height: 36px; max-width: 260px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-weight: 600; outline: none; }

.st-score { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.st-score .side { display: flex; align-items: center; gap: 10px; }
.st-score .nm { font: 700 15px/1.1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-score b { font: 700 40px/1 var(--font-display); min-width: 52px; text-align: center; padding: 2px 8px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.st-score .us b { color: var(--orange-2); }
.st-score .colon { font: 700 30px var(--font-display); color: var(--muted); }
.opp-btns { display: flex; gap: 4px; margin-left: 4px; }
.opp-btns button { width: 40px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 800; color: var(--text-2); }
.opp-btns button:hover { background: var(--panel-3); color: var(--text); }

.st-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-period .seg button { padding: 6px 9px; }
.tf { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tf b { font: 700 18px var(--font-display); color: var(--text); }
.tf span { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: #1b0d02; background: var(--warn); padding: 2px 7px; border-radius: 999px; }
.tf.pen b { color: var(--warn); }

.st-tabs { margin: 10px 14px 0; align-self: flex-start; }
.st-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 16px; }

.st-empty { max-width: 460px; margin: 40px auto; text-align: center; color: var(--text-2); }
.st-empty svg.big { width: 48px; height: 48px; color: var(--orange); }
.st-empty h3 { margin: 10px 0 4px; font: 700 26px var(--font-display); color: var(--text); }
.st-empty .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* live entry */
.st-live { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.st-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.st-player {
  position: relative; text-align: left; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px;
  padding: 10px 12px; min-height: 92px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  transition: border-color .12s, background .12s, transform .06s;
}
.st-player:hover { border-color: var(--line-2); }
.st-player:active { transform: scale(.98); }
.st-player .num { grid-row: 1 / 4; font: 700 36px/1 var(--font-display); color: var(--orange-2); min-width: 38px; align-self: center; }
.st-player .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-player .mini { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-player .mini b { color: var(--text); font-size: 13px; }
.st-player .fouls { display: flex; gap: 3px; margin-top: 4px; }
.st-player .fouls i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.st-player .fouls i.on { background: var(--warn); border-color: var(--warn); }
.st-player.sel { border-color: var(--orange); background: #24253a; box-shadow: 0 0 0 2px rgba(255, 122, 26, .35); }
.st-player.out { opacity: .55; }
.st-player.out .fouls i.on { background: var(--danger); border-color: var(--danger); }
.st-player .badge { position: absolute; top: 6px; right: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); }

.st-pad { position: sticky; top: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pad-head { display: flex; align-items: center; gap: 8px; }
.pad-head .who { display: flex; align-items: baseline; gap: 8px; font: 700 20px/1.1 var(--font-display); min-width: 0; }
.pad-head .who .num { color: var(--orange-2); font-size: 26px; }
.pad-head .who .hint { color: var(--muted); font: 600 14px var(--font); }
.pad-head .loc { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.pad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-act {
  height: 58px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px;
  transition: filter .12s, transform .06s;
}
.st-act b { font: 700 18px/1 var(--font-display); letter-spacing: .04em; }
.st-act i { font-style: normal; color: var(--text-2); }
.st-act:hover:not(:disabled) { filter: brightness(1.15); }
.st-act:active:not(:disabled) { transform: scale(.96); }
.st-act.made { background: rgba(47, 210, 127, .14); border-color: rgba(47, 210, 127, .45); }
.st-act.made i { color: var(--made); }
.st-act.miss { background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .4); }
.st-act.miss i { color: var(--miss); }
.st-act.foul { grid-column: span 2; background: rgba(255, 194, 61, .14); border-color: rgba(255, 194, 61, .5); }
.st-act.undo { grid-column: span 2; flex-direction: row; gap: 8px; }
.st-act.undo svg { width: 18px; height: 18px; }
.st-act:disabled { opacity: .4; cursor: not-allowed; }
.st-pad .last { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.st-pad .last b { color: var(--text); }
.log-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.st-log { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.st-log li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 4px 4px 8px; border-radius: 8px; background: var(--panel); }
.st-log li .per { font: 700 11px var(--font-display); letter-spacing: .08em; color: var(--muted); min-width: 26px; }
.st-log li .txt { flex: 1; min-width: 0; }
.st-log li.opp { background: transparent; border: 1px dashed var(--line); color: var(--text-2); }
.st-log li.empty { color: var(--muted); background: transparent; }
.st-log .mini-btn { width: 24px; height: 24px; }
.st-log .mini-btn svg { width: 13px; height: 13px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { padding: 7px 9px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.st-table th { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; }
.st-table .pl { text-align: left; font-weight: 600; }
.st-table .n { color: var(--orange-2); font-weight: 800; }
.st-table td.pct { color: var(--text-2); }
.st-table td.ts { color: var(--text); font-weight: 700; }
.st-table td.lead { color: var(--orange-2); font-weight: 800; }
.st-table td.warn { color: var(--danger); font-weight: 800; }
.st-table td.hl { font-weight: 800; }
.st-table td.tot { font-weight: 800; color: var(--text); }
.st-table tr.dnp td { opacity: .45; }
.st-table tr.team td, .st-table tfoot tr.team td { font-weight: 800; background: var(--panel-2); border-bottom: 0; }
.st-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.st-note { color: var(--muted); font-size: 12.5px; margin: 10px 2px 0; }
.st-sub { font: 700 18px var(--font-display); letter-spacing: .06em; text-transform: uppercase; margin: 20px 0 8px; }

.st-box .box-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.st-box .box-top .table-wrap { flex: 0 1 auto; }
.st-box .box-top .btn { margin-left: auto; }

/* shot chart */
.shot-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.shot-filters select { height: 36px; }
.shot-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(240px, 1fr); gap: 16px; align-items: start; }
.shot-court { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.shot-court svg { width: 100%; height: auto; display: block; }
.cv .shot.made { fill: var(--made); stroke: #0b3; stroke-width: 1.5; fill-opacity: .85; }
.cv .shot.miss { stroke: var(--miss); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding: 8px 4px 2px; flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--made); margin-right: 6px; }
.legend .x { color: var(--miss); font-style: normal; font-weight: 800; margin-right: 6px; }

/* season */
.record { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.record b { font: 700 34px var(--font-display); }
.record span { color: var(--muted); }
.res { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; background: var(--panel-3); }
.res.w { background: rgba(47, 210, 127, .2); color: var(--made); }
.res.l { background: rgba(255, 93, 108, .16); color: var(--miss); }
.st-table td.acts { display: flex; gap: 4px; justify-content: flex-end; }

/* roster */
.st-roster .st-note:first-child { margin: 0 0 12px; }
.st-table.roster { max-width: 680px; }
.st-table.roster input.field, .st-table.roster select.field { width: 100%; height: 34px; }
.st-table.roster input.num { width: 58px; text-align: center; font-weight: 800; }
.st-table.roster td { padding: 5px 6px; }
.st-table.roster td.c { width: 60px; }
.st-table.roster tr.inactive input:not([type="checkbox"]) { opacity: .5; }
.st-table.roster tr.add td { background: var(--bg-2); }
.st-roster > .btn { margin-top: 12px; }

/* shot picker modal */
.st-picker p { margin: 0 0 10px; color: var(--text-2); }
.st-picker svg { width: 100%; height: auto; display: block; border-radius: 10px; cursor: crosshair; touch-action: none; }

@media (max-width: 1100px) {
  .st-live { grid-template-columns: minmax(0, 1fr) 330px; }
  .shot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .st-live { grid-template-columns: 1fr; }
  .st-pad { position: static; }
  .st-score { margin: 0; }
  .st-score b { font-size: 32px; }
  .st-players { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
}
@media (max-width: 520px) {
  .st-tabs { margin: 8px 8px 0; overflow-x: auto; max-width: calc(100% - 16px); }
  .st-head { padding: 10px; }
  .st-score .nm { max-width: 90px; }
}
