:root{--bg:#111827;--panel:#1f2937;--panel2:#374151;--line:#4b5563;--txt:#fff;--muted:#cbd5e1;--orange:#ff6b00;--green:#22c55e;--green-dark:#166534;--yellow:#ca8a04;--red:#dc2626;--blue:#2563eb}
*{box-sizing:border-box;margin:0;padding:0;font-family:Arial,Helvetica,sans-serif}
html,body{background:var(--bg);color:var(--txt);min-height:100%;overscroll-behavior:none}
body{overflow-x:hidden}button,input,select{font:inherit}.hidden{display:none!important}.screen{min-height:100vh}
.center-screen{display:flex;align-items:center;justify-content:center;padding:24px}.login-card,.picker-card{width:min(590px,94vw);background:#101823;border:1px solid #324053;border-radius:20px;padding:28px;box-shadow:0 20px 70px #0008}.brand-row,.simple-brand,.scorer-brand-row{display:flex;gap:18px;align-items:center}.brand-logo-wrap{width:135px;display:flex;align-items:center;justify-content:center}.brand-logo{width:132px;max-height:82px;object-fit:contain;display:block}.brand-logo.small{width:110px;max-height:68px}.scorer-logo{width:160px;max-height:92px}.brand-title{color:var(--orange)!important;font-weight:900;letter-spacing:.03em}.brand-tagline{color:#f4f6fa!important;font-weight:700}.app-label{margin-top:7px;color:var(--orange);font-size:11px;font-weight:900;letter-spacing:.18em}.scorer-label{margin-top:3px;font-size:9px}.brand-row h1,.simple-head h1{margin:0;font-size:24px}.brand-row p,.simple-head p{margin:4px 0 0;color:var(--muted)}.divider{height:1px;background:#2b3748;margin:24px 0}.login-card label,.picker-card label{display:block;color:#d7deea;font-size:12px;font-weight:800;letter-spacing:.08em;margin:16px 0}.picker-card label{font-size:16px;letter-spacing:.07em}.login-card input,.picker-card select{width:100%;margin-top:8px;border:1px solid #41516a;background:#09111d;color:white;border-radius:10px;padding:14px;min-height:48px}.picker-card select{font-size:19px;font-weight:800;min-height:56px;padding:14px 16px}.primary,.secondary{border:0;border-radius:10px;padding:14px 18px;font-weight:900;cursor:pointer}.primary{width:100%;background:linear-gradient(90deg,#ff7200,#e95000);color:#fff}.secondary{background:#20304a;color:white}.message{min-height:20px;color:#ffb27a;margin-top:12px}.simple-head{display:flex;align-items:center;justify-content:space-between;padding:20px 28px;border-bottom:1px solid #26354a;background:#09111d}.picker-main{display:flex;justify-content:center;padding:56px 20px}.picker-card .eyebrow{color:var(--orange);font-size:12px;font-weight:900;letter-spacing:.14em}.picker-card h2{font-size:30px;margin:8px 0 20px}

/* Scorer: original District-T proportions, JBM branding */
.scorer-shell{max-width:1400px;margin:auto;padding:20px;background:var(--bg)}
.scorer-top{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:12px}.scorer-top.compact{align-items:center;min-height:32px;margin-bottom:12px;font-size:14px}.scorer-brand h1{margin:0;font-size:28px}.scorer-brand small{display:block;margin-top:4px;font-size:15px;color:var(--muted)}.scorer-controls{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}.scorer-controls label{display:flex;flex-direction:column;gap:5px;font-size:14px;font-weight:700;color:#e5e7eb}.scorer-select{min-height:44px;padding:8px 12px;border:none;border-radius:8px;background:#f8fafc;color:#111827;font-size:17px;min-width:220px}.scorer-close{min-height:44px;border:0;border-radius:9px;background:#2b405f;color:white;padding:10px 16px;font-weight:800;cursor:pointer}.scorer-box-btn{background:#315174}.scorer-sync{display:inline-flex;align-items:center;min-height:32px;padding:6px 11px;border-radius:999px;font-size:14px;font-weight:700;background:var(--green-dark);color:#dcfce7}.scorer-sync.busy{background:#1e3a8a;color:#dbeafe}.scorer-sync.error{background:#991b1b;color:#fee2e2}#scorerGameLabel{margin-left:auto;color:#e5e7eb;font-weight:700}
.scorer-scoreboard{display:grid;grid-template-columns:1fr 220px 1fr;gap:16px;margin-bottom:16px}.scorer-score-card,.scorer-period-card{background:var(--panel);border-radius:14px;min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:18px}.scorer-score-card b{font-size:32px;line-height:1.1}.scorer-score-card strong{font-size:68px;line-height:1;margin-top:8px}.scorer-period-card span{font-size:20px;margin-bottom:8px}.scorer-period-card strong{font-size:42px;line-height:1}.scorer-actions-top{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.scorer-action{min-height:58px;padding:14px;border:none;border-radius:10px;font-size:19px;cursor:pointer;background:#f8fafc;color:var(--blue);font-weight:700;touch-action:manipulation}.scorer-action.danger{background:var(--red);color:#fff}
.scorer-team-wrap{display:grid;grid-template-columns:1fr;gap:16px}.scorer-team-wrap.both{grid-template-columns:1fr 1fr}.scorer-team{background:var(--panel);border-radius:14px;padding:16px}.scorer-team-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.scorer-team-head h2{margin:0;font-size:24px}.scorer-fouls{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:8px;background:var(--green-dark);font-size:18px;font-weight:700}.scorer-fouls.warning{background:var(--yellow);color:#111827}.scorer-fouls.penalty{background:var(--red);color:#fff}.scorer-roster{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.scorer-team-wrap.both .scorer-roster{grid-template-columns:repeat(2,minmax(0,1fr))}.scorer-player{width:100%;min-height:62px;padding:12px 14px;border:none;border-radius:10px;background:var(--panel2);color:#fff;cursor:pointer;font-size:18px;text-align:left;line-height:1.2;font-weight:700;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.scorer-player.selected{background:var(--blue);box-shadow:0 0 0 3px rgba(96,165,250,.45)}
.scorer-stat-panel{margin-top:16px;width:100%;background:var(--panel);border-radius:14px;padding:16px}.scorer-selected-label{margin-bottom:14px}.scorer-selected-label small{display:block;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;margin-bottom:4px}.scorer-selected-label strong{font-size:26px}.scorer-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.scorer-stat{position:relative;min-height:72px;padding:16px;border:none;border-radius:10px;cursor:pointer;font-size:21px;font-weight:700;background:#f8fafc;color:var(--blue);touch-action:manipulation;-webkit-tap-highlight-color:transparent}.scorer-stat.score{background:var(--green);color:#fff}
.scorer-events{background:var(--panel);border-radius:14px;padding:16px;margin-top:16px}.scorer-events h3{margin:0 0 14px;font-size:24px}.scorer-event{background:var(--panel2);padding:9px 10px;border-radius:7px;font-size:16px;margin-top:6px}

/* Tap confirmation modeled on original scorer */
.scorer-stat,.scorer-player,.scorer-score-card strong{will-change:transform,box-shadow,filter}.scorer-stat.recorded{animation:statTapButton .26s ease-out}.scorer-player.pulse{animation:statTapPlayer .36s ease-out}.scorer-score-card strong.score-pop{animation:statTapScore .38s ease-out}.tap-feedback-badge{position:fixed;z-index:9999;pointer-events:none;transform:translate(-50%,-50%) scale(.75);opacity:0;padding:9px 14px;border-radius:999px;background:#f8fafc;color:#111827;font-size:20px;font-weight:900;line-height:1;box-shadow:0 8px 24px rgba(0,0,0,.38);white-space:nowrap}.tap-feedback-badge.show{animation:tapBadgeFloat .62s ease-out forwards}@keyframes statTapButton{0%{transform:scale(1);filter:brightness(1)}30%{transform:scale(.91);filter:brightness(1.35);box-shadow:0 0 0 4px rgba(255,255,255,.55),0 0 28px rgba(255,255,255,.35)}70%{transform:scale(1.04);filter:brightness(1.15)}100%{transform:scale(1);filter:brightness(1)}}@keyframes statTapPlayer{0%{transform:scale(1)}35%{transform:scale(1.025);box-shadow:0 0 0 4px rgba(250,204,21,.8),0 0 24px rgba(250,204,21,.5)}100%{transform:scale(1)}}@keyframes statTapScore{0%{transform:scale(1)}35%{transform:scale(1.22);text-shadow:0 0 18px rgba(255,255,255,.65)}100%{transform:scale(1);text-shadow:none}}@keyframes tapBadgeFloat{0%{opacity:0;transform:translate(-50%,-45%) scale(.72)}18%{opacity:1;transform:translate(-50%,-68%) scale(1.06)}75%{opacity:1;transform:translate(-50%,-120%) scale(1)}100%{opacity:0;transform:translate(-50%,-155%) scale(.96)}}

/* Box score */
.scorer-box-overlay{position:fixed;inset:0;background:#050913ef;z-index:9000;padding:22px;overflow:auto}.scorer-box-panel{background:#101a29;border:1px solid #344760;border-radius:14px;padding:16px;max-width:1400px;margin:auto}.scorer-box-head{display:flex;justify-content:space-between;align-items:center}.scorer-box-head h2{margin:3px 0 12px}.scorer-box-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.scorer-box-team{background:#17212d;border:1px solid #34404e;border-radius:10px;padding:10px}.scorer-box-team-title{display:flex;justify-content:space-between;align-items:center}.scorer-box-team-title h3{margin:0}.scorer-box-team-title strong{font-size:24px}.scorer-box-scroll{overflow:auto}.scorer-box-table{width:100%;border-collapse:collapse;font-size:13px;background:#151d27;color:#f7f9fc}.scorer-box-table th,.scorer-box-table td{padding:7px;border:1px solid #34404e;text-align:center}.scorer-box-table th{background:#202a36;color:#aeb9c8}.scorer-box-table th:first-child,.scorer-box-table td:first-child{text-align:left}.pf-max{color:#ff3b3b!important;font-weight:900!important}.quarter-summary{margin-top:14px;background:#17212d;border:1px solid #34404e;border-radius:10px;padding:12px}.quarter-summary h3{margin:0 0 10px;color:var(--orange);letter-spacing:.06em}.quarter-scroll{overflow:auto}.quarter-summary table{width:100%;border-collapse:collapse;font-size:13px;min-width:520px;background:#151d27;color:#f7f9fc}.quarter-summary th,.quarter-summary td{padding:8px 10px;border:1px solid #34404e;text-align:center}.quarter-summary th{background:#202a36;color:#aeb9c8}.quarter-summary th:first-child{text-align:left}.leader-card{margin-top:14px;border:1px solid var(--orange);background:#1b2535;border-radius:10px;padding:12px}.leader-card small{display:block;color:var(--orange);font-weight:900;letter-spacing:.1em}.leader-card strong{display:block;font-size:20px;margin:5px 0}.leader-card span{color:#c8d1df;font-size:13px}.scorer-toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);opacity:0;pointer-events:none;background:#101722;color:#fff;border:1px solid #43536a;border-radius:8px;padding:9px 13px;font-weight:900;z-index:10000;transition:.15s}.scorer-toast.show{opacity:1}.scorer-toast.undo{background:#c32929}
button:disabled,select:disabled{opacity:.5;cursor:not-allowed}

/* Tablet */
@media(max-width:1100px){.scorer-shell{padding:14px}.scorer-scoreboard{grid-template-columns:1fr 180px 1fr;gap:12px}.scorer-score-card b{font-size:27px}.scorer-score-card strong{font-size:58px}.scorer-roster{grid-template-columns:repeat(3,minmax(0,1fr))}.scorer-team-wrap.both .scorer-roster{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* iPad portrait: intentionally keeps original large controls */
@media(max-width:900px){.scorer-top{flex-direction:column;gap:12px}.scorer-controls{width:100%;display:grid;grid-template-columns:180px auto auto;align-items:end}.scorer-select{width:100%;min-width:0}.scorer-scoreboard{grid-template-columns:1fr 170px 1fr}.scorer-actions-top{grid-template-columns:repeat(4,1fr)}.scorer-team-wrap.both{grid-template-columns:1fr 1fr}.scorer-team-wrap:not(.both) .scorer-roster{grid-template-columns:repeat(3,minmax(0,1fr))}.scorer-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.scorer-events{max-height:220px;overflow:auto}.scorer-logo{width:150px;max-height:88px}}
@media(max-width:650px){.scorer-controls{grid-template-columns:1fr}.scorer-scoreboard{grid-template-columns:1fr}.scorer-actions-top{grid-template-columns:1fr 1fr}.scorer-team-wrap,.scorer-team-wrap.both{grid-template-columns:1fr}.scorer-roster,.scorer-team-wrap.both .scorer-roster{grid-template-columns:1fr 1fr}.scorer-stat-grid{grid-template-columns:1fr 1fr}.scorer-score-card b{font-size:25px}.scorer-score-card strong{font-size:54px}.scorer-box-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.scorer-stat.recorded,.scorer-player.pulse,.scorer-score-card strong.score-pop,.tap-feedback-badge.show{animation-duration:.01ms}}


/* v2.1 safer startup / resume prompt */
.resume-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;margin:0 0 16px;border:1px solid rgba(249,115,22,.55);border-radius:12px;background:rgba(249,115,22,.08)}
.resume-card.hidden{display:none}
.resume-card small{display:block;color:#cbd5e1;font-size:11px;font-weight:800;letter-spacing:.08em;margin-bottom:4px}
.resume-card strong{display:block;font-size:18px;line-height:1.25}
.resume-actions{display:flex;gap:8px;flex-wrap:wrap}
.resume-actions button{min-height:44px;padding:10px 14px;white-space:nowrap}
@media(max-width:700px){.resume-card{align-items:stretch;flex-direction:column}.resume-actions{display:grid;grid-template-columns:1fr 1fr}.resume-actions button{width:100%}}


/* Permanent scorer v1.1 - league branding */
.scorer-league-brand-slot{margin-top:12px}
.scorer-league-brand{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid #344760;border-radius:12px;background:#101a29;max-width:620px}
.scorer-league-brand img{width:58px;height:58px;object-fit:contain;flex:0 0 58px;border-radius:10px;background:#0b1320}
.scorer-league-brand small{display:block;color:var(--orange);font-size:10px;font-weight:900;letter-spacing:.14em}
.scorer-league-brand strong{display:block;margin-top:2px;color:#fff;font-size:18px;line-height:1.1}
.scorer-league-brand span{display:block;margin-top:4px;color:#9eabbc;font-size:12px}
.scorer-league-brand.compact{margin-bottom:10px;padding:8px 10px;max-width:720px}
.scorer-league-brand.compact img{width:46px;height:46px;flex-basis:46px}
.scorer-league-brand.compact strong{font-size:16px}
@media(max-width:900px){.scorer-league-brand{max-width:100%}.scorer-league-brand img{width:50px;height:50px;flex-basis:50px}.scorer-league-brand strong{font-size:16px}}

/* Permanent scorer v1.3 - iPad sign-in logo only */
@media (min-width:700px) and (max-width:1366px){
  #authView .brand-logo-wrap{width:175px}
  #authView #loginJbmLogo{width:170px;max-height:106px}
}

/* Permanent scorer v1.4 - authorized league first */
.access-note{margin:-8px 0 8px;color:#9eabbc;font-size:12px;font-weight:700}.picker-card select:disabled{opacity:.55;cursor:not-allowed}
/* v1.6 game-day roster */
.roster-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.roster-add,.roster-manage{border:1px solid #ff6a00;background:transparent;color:#ff8a33;border-radius:8px;padding:8px 11px;font-weight:800;cursor:pointer}.roster-manage{border-color:#64748b;color:#d1d5db}.roster-absent-btn{background:#7f1d1d!important}.roster-absent-btn:disabled{background:#374151!important;color:#9ca3af!important;cursor:not-allowed}.roster-subhead{margin:10px 0 2px;font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:#9ca3af}.roster-empty{grid-column:1/-1;padding:16px;border:1px dashed #334155;border-radius:10px;color:#9ca3af;text-align:center}.roster-modal{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.76);display:flex;align-items:center;justify-content:center;padding:18px}.roster-modal.hidden{display:none}.roster-panel{width:min(760px,96vw);max-height:88vh;overflow:auto;background:#111821;border:1px solid #334155;border-radius:16px;padding:18px}.roster-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.roster-head h2{margin:0}.roster-list{display:grid;gap:8px}.roster-option{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#18212c;border:1px solid #334155;border-radius:10px;padding:12px}.roster-option button{border:0;border-radius:8px;background:#ff6a00;color:#fff;font-weight:800;padding:9px 12px;cursor:pointer}.roster-note{color:#9ca3af;font-size:13px;margin:0 0 12px}

/* v1.10 pre-game readiness */
.pregame-panel{margin:12px 16px 4px;padding:14px 16px;border:1px solid #41516a;border-radius:14px;background:#101823;display:flex;gap:16px;align-items:center;justify-content:space-between}.pregame-panel.hidden{display:none}.pregame-panel div{display:flex;flex-direction:column;gap:4px}.pregame-panel small{color:var(--orange);font-weight:900;letter-spacing:.12em}.pregame-panel strong{font-size:15px}.pregame-panel span{color:var(--muted);font-size:12px}.pregame-start{border:0;border-radius:10px;padding:14px 22px;background:linear-gradient(90deg,#ff7200,#e95000);color:#fff;font-weight:900;cursor:pointer;min-width:150px}.pregame-start:disabled{opacity:.5;cursor:not-allowed}.scorer-actions-top button:disabled,#scorerStatGrid button:disabled{opacity:.35;cursor:not-allowed;filter:grayscale(.2)}@media(max-width:700px){.pregame-panel{flex-direction:column;align-items:stretch}.pregame-start{width:100%}}

/* v1.11 box-score row focus and foul-out emphasis */
.scorer-box-table .box-player-row{cursor:pointer;transition:background .12s ease,box-shadow .12s ease}.scorer-box-table .box-player-row:hover td{background:#202b38}.scorer-box-table .box-player-row.box-row-selected td{background:#2a3d55!important;box-shadow:inset 0 1px 0 rgba(255,122,24,.55),inset 0 -1px 0 rgba(255,122,24,.55)}.scorer-box-table .box-player-row.box-row-selected td:first-child{box-shadow:inset 3px 0 0 #ff7a18,inset 0 1px 0 rgba(255,122,24,.55),inset 0 -1px 0 rgba(255,122,24,.55)}.scorer-box-table .pf-max{color:#ff3b30!important;font-weight:1000!important;font-size:15px}

/* v1.12.2.6 - DID NOT PLAY uses the scorer table's native td sizing. */
.scorer-box-table .box-dnp-row td {
  background: inherit !important;
  color: inherit !important;
  vertical-align: middle !important;
}
.scorer-box-table .box-dnp {
  color: inherit !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  text-align: center !important;
  white-space: nowrap !important;
}
.scorer-box-table .box-dnp-row:hover td { background:#202b38 !important; }

/* Manual roster refresh is intentionally inside Manage Roster only. */
.roster-refresh-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:4px 0 14px}
.roster-refresh-row .roster-note{flex:1 1 190px;margin:0}
.roster-refresh-row button{flex:0 0 auto;white-space:nowrap;padding:10px 12px}
.roster-refresh-row button:disabled{opacity:.6;cursor:wait}

/* v1.12.2.9 - branded foul milestone alerts (4 and 5 PF) */
.foul-warning-overlay{position:fixed;inset:0;z-index:10000;background:rgba(0,0,0,.84);display:flex;align-items:center;justify-content:center;padding:18px}
.foul-warning-card{width:min(480px,100%);background:#111821;color:#f8fafc;border:2px solid #ff7900;border-radius:18px;box-shadow:0 0 0 4px rgba(255,121,0,.12),0 20px 80px rgba(0,0,0,.6);padding:28px;text-align:center}
.foul-warning-kicker{font-size:11px;font-weight:900;letter-spacing:.13em;color:#ff9b42;margin-bottom:15px}
.foul-warning-card h2{font-size:clamp(21px,4vw,28px);line-height:1.2;color:#ff7900;margin:0 0 15px;font-weight:1000}
.foul-warning-player{font-size:clamp(22px,4vw,30px);font-weight:900;margin-bottom:12px;overflow-wrap:anywhere}
.foul-warning-card p{font-size:15px;line-height:1.5;color:#d1d5db;margin:0 0 23px}
.foul-warning-ack{background:#ff7900;color:#101010;border:0;border-radius:10px;padding:14px 22px;font-size:15px;font-weight:1000;min-height:48px;cursor:pointer;width:100%}
.foul-warning-ack:focus-visible{outline:3px solid #fff;outline-offset:3px}
.scorer-box-table .pf-warning{color:#ff9b42!important;font-weight:900!important}

/* v1.12.2.11 — Best Players, matching JBM orange foul-alert treatment */
.best-players-card{border-color:#ff7900!important}.best-players-list{display:grid;gap:10px;margin-top:12px}.best-player-entry{display:flex;flex-direction:column;gap:5px;padding:11px 13px;background:#19212b;border:1px solid #35404c;border-radius:10px}.best-player-entry strong{color:#fff;font-size:15px}.best-player-entry span{color:#ff9b42;font-size:13px}.best-players-alert-card{max-width:560px;width:min(92vw,560px);max-height:90vh;overflow:auto}.best-players-winning-team{font-weight:700;color:#ff9b42;text-align:center}.best-players-alert-list{display:grid;gap:12px;margin:16px 0}.best-players-alert-entry{display:flex;flex-direction:column;gap:7px;padding:14px;background:#171e28;border:1px solid #ff7900;border-radius:10px;text-align:left}.best-players-alert-entry small{font-weight:800;color:#ff7900;letter-spacing:.06em}.best-players-alert-entry strong{font-size:17px;color:#fff;overflow-wrap:anywhere}.best-players-alert-entry span{font-size:13px;color:#f3f4f6;line-height:1.5}
