
:root{
 --bg:#061827;--panel:#09243b;--panel2:#0b2c48;--line:#43566a;--text:#f5f2ea;--muted:#aeb9c3;
 --accent:#e0bf72;--selected:#1f4770;--radius:13px;
 --custom-bg:#061827;--custom-bg2:#041421;--custom-header:#071b2d;--custom-panel:#09243b;
 --custom-panel2:#0b2c48;--custom-line:#43566a;--custom-drawer:#17344d;--custom-drawer2:#23435e;
 --custom-accent:#e0bf72;--custom-selected:#1f4770;--custom-text:#f5f2ea;
}
*{box-sizing:border-box}
html,body{margin:0;width:100%;max-width:100%;min-height:100%;overflow-x:hidden;background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif}
body{min-height:100vh;overscroll-behavior-x:none}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.app-shell{width:100%;max-width:100%;min-height:100vh;overflow-x:hidden;background:var(--bg)}
main{width:100%;max-width:1120px;margin:0 auto;padding:10px 10px 32px}
.card{border:1px solid var(--line);background:var(--panel);border-radius:var(--radius);overflow:hidden}

/* Header */
.topbar{
 position:relative;z-index:30;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:8px;
 min-height:88px;padding:calc(10px + env(safe-area-inset-top)) 12px 10px;background:#07131e;border-bottom:1px solid rgba(255,255,255,.08)
}
.topbar h1{margin:0;text-align:center;font-family:Georgia,'Times New Roman',serif;font-size:28px;font-weight:800}
.top-actions{display:flex;gap:6px}
.top-icon,.top-action{min-height:44px;border:1px solid rgba(255,255,255,.34);background:rgba(0,0,0,.12);color:inherit;border-radius:11px;font-weight:850}
.top-icon{width:44px;font-size:20px}
.menu-icon{border:0;background:transparent;font-size:28px}
.top-action{padding:0 13px;white-space:nowrap}
.postseason-banner{display:none;grid-column:1/-1;justify-self:center;align-items:center;gap:12px;color:#e2ac50;font-family:Georgia,'Times New Roman',serif;font-size:22px;font-weight:900;letter-spacing:.05em;padding:5px 0}
.post-year{font-size:12px;letter-spacing:.14em}

/* Drawer - clear, compact, theme-aware */
.drawer-shade{position:fixed;inset:0;z-index:80;background:rgba(0,0,0,.58)}
.drawer{
 position:fixed;left:0;top:0;bottom:0;z-index:90;width:min(310px,82vw);transform:translateX(-105%);transition:transform .18s ease;
 overflow-y:auto;padding:calc(14px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
 background:#17344d;color:#f5f2ea;border-right:1px solid #43566a;box-shadow:18px 0 46px rgba(0,0,0,.35)
}
.drawer.open{transform:none}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 14px;border-bottom:1px solid rgba(255,255,255,.18);font-size:23px}
.drawer-head button{border:0;background:transparent;color:inherit;font-size:26px}
.drawer-section{padding:14px 0;border-bottom:1px solid rgba(255,255,255,.16)}
.drawer-label{font-size:9px;font-weight:900;letter-spacing:.17em;color:#b6c0c8;margin:0 8px 7px}
.drawer-nav,.theme-choice,.drawer-tools>button,.import-button{
 width:100%;min-height:47px;display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;
 padding:7px 9px;border:0;border-radius:9px;background:transparent;color:inherit;text-align:left;font-weight:850
}
.menu-glyph{display:grid;place-items:center;width:24px;font-size:18px}
.drawer-nav.active,.theme-choice.active{background:rgba(255,255,255,.12)}
.drawer-nav b{min-width:21px;text-align:center;border-radius:12px;padding:3px 6px;background:rgba(0,0,0,.18)}
.theme-choice{grid-template-columns:40px minmax(0,1fr) 20px}
.theme-choice span:nth-child(2){display:flex;flex-direction:column;gap:2px;min-width:0}
.theme-choice small{font-size:8px;color:#b9c4cd;font-weight:700}
.theme-check{visibility:hidden;color:var(--accent)}
.theme-choice.active .theme-check{visibility:visible}
.theme-swatch{width:34px;height:34px;border-radius:9px;display:block}
.custom-swatch{background:linear-gradient(135deg,#0a2a46,#e0bf72)}
.wrigley-swatch{background:linear-gradient(135deg,#0e3d28 0 65%,#88543e 66%)}
.playoff-swatch{background:linear-gradient(135deg,#04182a 0 65%,#d99e3a)}
.theme-sub{margin:4px 6px 8px 42px;padding:8px;border-left:3px solid var(--accent);border-radius:0 8px 8px 0;background:rgba(0,0,0,.16)}
.theme-sub label{display:flex;flex-direction:column;gap:4px;font-size:8px;font-weight:900;color:#d5dae0;letter-spacing:.08em}
.theme-sub select,.theme-sub input[type=color]{width:100%;min-height:34px;border:1px solid rgba(255,255,255,.22);border-radius:7px;background:#071827;color:#fff}
.color-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:7px}
.drawer-tools{border-bottom:0}
.import-button input{display:none}

/* Game info */
.game-info{display:grid;gap:0;margin-bottom:9px}
.game-info.with-extras{grid-template-columns:repeat(3,minmax(0,1fr))}
.game-info.four-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
.game-field{
 min-width:0;display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;gap:7px;padding:9px 11px;
 border-right:1px solid var(--line);border-bottom:1px solid var(--line)
}
.game-info.with-extras .game-field:nth-child(3n){border-right:0}
.game-info.with-extras .game-field:nth-last-child(-n+3){border-bottom:0}
.game-info.four-fields .game-field:last-child{border-right:0}
.game-info.four-fields .game-field{border-bottom:0}
.game-info-icon{display:grid;place-items:center;width:28px;height:28px;color:var(--accent);font-size:21px}
.game-field-copy{min-width:0}
.game-field label{display:block;margin-bottom:2px;font-size:7px;letter-spacing:.10em;font-weight:900;color:var(--muted)}
.game-field input{
 width:100%;min-width:0;max-width:100%;height:28px;padding:0;border:0;background:transparent;color:var(--text);
 font-weight:850;font-size:12px;outline:none;overflow:hidden;text-overflow:ellipsis
}

/* Matchup */
.matchup-selector{
 display:grid;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr);align-items:center;gap:6px;padding:7px;margin-bottom:9px
}
.matchup-team{display:grid;grid-template-columns:38px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;gap:1px 6px;min-width:0}
.matchup-label{grid-column:2;color:var(--accent);font-size:7px;font-weight:900;letter-spacing:.12em}
.matchup-team img{grid-row:1/span 2;width:37px;height:37px;object-fit:contain;object-position:center;background:transparent}
.matchup-team select,.team-header-select{
 width:100%;min-width:0;border:0;background:transparent;color:var(--text);font-weight:900;outline:none;text-overflow:ellipsis
}
.matchup-team select{height:31px;font-size:10px;padding:0 22px 0 2px}
.versus-mark{text-align:center;color:var(--accent);font-weight:950;font-size:12px}
select option{color:#111;background:#fff}

/* Shared collapse icon */
.section-collapse{
 margin-left:auto;flex:0 0 30px;width:30px;height:30px;display:grid;place-items:center;padding:0;
 border:1px solid color-mix(in srgb,var(--accent) 70%,transparent);border-radius:999px;background:rgba(0,0,0,.09);color:var(--accent)
}
.chevron-icon{width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(225deg);transition:transform .16s ease}
.section-collapse.is-collapsed .chevron-icon{transform:rotate(45deg)}

/* Standings */
.standings-overview{margin-bottom:10px}
.overview-title,.card-title{
 min-height:38px;display:flex;align-items:center;gap:7px;padding:0 7px 0 11px;background:var(--panel2);border-bottom:1px solid var(--line);
 color:var(--accent);font-size:10px;font-weight:900
}
.overview-title strong{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.title-glyph{font-size:15px}
.standings-overview.collapsed .standings-overview-body{display:none}
.standings-overview-body{display:grid;gap:0;min-width:0}
.standings-overview-body.two{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.standings-overview-body.one{grid-template-columns:1fr}
.standings-card{min-width:0;border:0!important;border-radius:0!important}
.standings-overview-body.two .standings-card+.standings-card{border-left:1px solid var(--line)!important}
.standings-head{height:29px;display:flex;align-items:center;justify-content:space-between;padding:0 7px;background:color-mix(in srgb,var(--panel2) 88%,#000);color:var(--accent);font-size:7px;font-weight:900;border-bottom:1px solid var(--line)}
.refresh-mini{width:22px;height:22px;border:1px solid var(--accent);border-radius:7px;background:transparent;color:var(--accent);font-size:10px}
.standings-grid{display:grid;grid-template-columns:minmax(0,1.8fr) .42fr .42fr .60fr .50fr;font-size:6.5px}
.standings-grid>div{min-width:0;padding:5px 2px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--panel)}
.standings-grid>div:nth-child(5n){border-right:0}
.standings-grid .head{background:var(--panel2);color:var(--accent);font-size:5.5px;font-weight:900}
.standings-grid .team{display:flex;align-items:center;gap:3px;overflow:hidden;white-space:nowrap}
.standings-grid .team img{width:12px;height:12px;flex:0 0 12px;object-fit:contain}
.standings-selected{background:var(--selected)!important;color:var(--accent)!important;font-weight:900}
.standings-foot{text-align:center;padding:4px;color:var(--muted);font-size:5.5px;background:var(--panel)}
.playoff-overview{display:grid;grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr);gap:8px;margin-bottom:10px}
.playoff-overview .standings-overview{margin:0}
.notes-card{margin:0}
.notes-card textarea{display:block;width:100%;height:180px;resize:vertical;border:0;background:transparent;color:var(--text);padding:10px;outline:none}
.notes-card.collapsed textarea{display:none}
.notes-card.collapsed .card-title{border-bottom:0}

/* Team scorebook */
.team-scorebook{margin-bottom:11px}
.team-scorebook-head{
 min-height:44px;display:flex;align-items:center;gap:8px;padding:5px 7px 5px 10px;background:var(--panel2);border-bottom:1px solid var(--line)
}
.team-scorebook-name{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
.team-logo{width:32px;height:32px;flex:0 0 32px;object-fit:contain;object-position:center;background:transparent;overflow:visible}
.team-header-select{height:32px;padding:0 22px 0 0;font-size:11px;text-transform:uppercase;color:var(--accent)}
.team-scorebook.collapsed .team-scorebook-body{display:none}
.team-scorebook-body{min-width:0}
.team-scorebook-scroll{
 width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;
 overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom
}
.team-scorebook-canvas{
 display:grid;
 grid-template-columns:190px 760px;
 grid-template-rows:auto auto;
 grid-template-areas:
   "left scoring"
   "pitch pitch";
 align-items:start;
 min-width:950px;
 width:950px;
 background:var(--panel)
}
.team-left-stack{
 grid-area:left;
 position:sticky;
 left:0;
 z-index:4;
 align-self:start;
 background:var(--panel);
 border-right:1px solid var(--line)
}
.team-left-stack .pitch-pane{display:none!important}
.lineup-pane,.pitch-pane,.scoring-pane{min-width:0;background:var(--panel)}
.lineup-pane{grid-area:left}
.scoring-pane{grid-area:scoring}
.team-scorebook-canvas>.pitch-pane{
 grid-area:pitch;
 display:block!important;
 width:100%;
 border-top:1px solid var(--line)
}
.pane-title{height:26px;display:flex;align-items:center;gap:5px;padding:0 6px;background:var(--panel2);color:var(--accent);font-size:7px;font-weight:900;border-bottom:1px solid var(--line)}
.pitch-scroll{
 width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;
 overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom
}
.lineup-only-table,.scoring-only-table,.pitch-table{border-collapse:collapse;table-layout:fixed}
.lineup-only-table{width:190px}
.lineup-only-table th,.lineup-only-table td,.scoring-only-table th,.scoring-only-table td,.pitch-table th,.pitch-table td{
 border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--panel);color:var(--text)
}
.lineup-only-table th,.scoring-only-table th,.pitch-table th{background:var(--panel2);color:var(--accent);font-size:6px;font-weight:900}
.lineup-only-table th{height:23px}
.lineup-only-table td{height:39px;font-size:6.5px}
.lineup-only-table .ord{width:23px;text-align:center;font-weight:900}
.lineup-only-table .player{width:132px;padding:2px 4px;text-align:left;overflow:hidden}
.lineup-only-table .pos{width:35px;text-align:center;font-weight:900}
.player-main{font-size:6.2px;line-height:1.04;font-weight:900}
.player-subs{font-size:4.8px;line-height:1;color:var(--muted);margin-top:2px}
.scoring-pane{width:760px}
.score-scroll{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y pinch-zoom}
.scoring-only-table{min-width:760px;width:760px}
.scoring-only-table th{height:23px}
.scoring-only-table td{height:39px;text-align:center;font-size:7px}
.scoring-only-table .inn{width:40px}
.scoring-only-table .stat{width:46px}
.scoring-only-table .play-cell{width:40px;padding:0;position:relative;overflow:hidden}
.totals-row td{height:29px!important;background:var(--panel2)!important;color:var(--accent)!important;font-weight:900!important}
.play-entry{position:absolute;inset:0;display:grid;place-items:center}
.play-entry svg{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px)}
.play-code{position:absolute;right:2px;bottom:2px;font-size:7px;font-weight:950}
.standalone-out{font-size:14px;font-weight:950;color:#e0524d}
.play-entry.out .play-code{color:#e0524d}
.rbi-code{position:absolute;right:2px;top:2px;font-size:4.8px;font-weight:900}
.pa-count{position:absolute;left:2px;top:2px;font-size:4.5px;color:var(--muted);font-weight:900}
.event-marker{position:absolute;left:0;right:0;bottom:0;height:8px;background:#111;color:#fff;font-size:5px;display:grid;place-items:center;font-weight:900}
.play-cell.third-out{box-shadow:inset 0 -3px 0 #df4b46}

/* Pitching deliberately wider than left pane: horizontal scroll inside the pane */
.pitch-table{width:520px;min-width:520px}
.pitch-table .pitcher-name{width:165px}
.pitch-table th{height:22px}
.pitch-table td{height:29px}
.pitch-table th:not(.pitcher-name),.pitch-table td:not(.pitcher-name){width:44px}
.pitch-table input{width:100%;height:27px;padding:2px 3px;border:0;background:transparent;color:var(--text);text-align:center;font-size:5.8px}
.pitch-table .pitcher-name input{text-align:left}

/* Default theme */
body.theme-custom{
 --bg:var(--custom-bg);--panel:var(--custom-panel);--panel2:var(--custom-panel2);--line:var(--custom-line);
 --accent:var(--custom-accent-safe,var(--custom-accent));--selected:var(--custom-selected);--text:var(--custom-text);--muted:var(--custom-muted,#aeb9c3);
 background:var(--custom-bg)
}
body.theme-custom .app-shell{background:linear-gradient(180deg,var(--custom-bg),var(--custom-bg2))}
body.theme-custom .topbar{background:var(--custom-header)}
body.theme-custom .drawer{background:linear-gradient(180deg,var(--custom-drawer),var(--custom-drawer2));border-color:var(--custom-line)}
body.theme-custom .drawer-head,body.theme-custom .drawer-section{border-color:var(--custom-line)}
body.theme-custom .theme-choice.active,body.theme-custom .drawer-nav.active{background:color-mix(in srgb,var(--custom-panel2) 80%,#fff 7%)}

/* Wrigley inspired */
body.theme-wrigley{
 --bg:#08180f;--panel:#0d2517;--panel2:#13331f;--line:#506a55;--text:#f2f3eb;--muted:#aeb8af;--accent:#e4dfc8;--selected:#1f6134;
 background:#07140d
}
body.theme-wrigley .app-shell{background:linear-gradient(180deg,#07140d,#0a1d12)}
body.theme-wrigley .topbar{
 background:linear-gradient(90deg,rgba(4,21,12,.88),rgba(8,42,23,.64),rgba(4,21,12,.90)),url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat;
}
body.theme-wrigley .drawer{background:linear-gradient(180deg,#0d2a19,#102f1e);border-color:#506a55}
body.theme-wrigley .theme-choice.active,body.theme-wrigley .drawer-nav.active{background:#1d4b2c}
body.theme-wrigley .wrigley-footer{height:54px;margin:3px -10px -32px;background:url("assets/theme/wrigley-footer.jpg") center/cover no-repeat;border-top:2px solid #315638}
body.theme-wrigley.dark-mode{--bg:#040b07;--panel:#09150e;--panel2:#102218;--line:#39483c;--selected:#174526}

/* Playoff */
body.theme-postseason{
 --bg:#020c16;--panel:#04182a;--panel2:#061f35;--line:#8d672f;--text:#f3f1ec;--muted:#aab6c2;--accent:#dda947;--selected:#503a1f;
 background:#010912
}
body.theme-postseason .app-shell{background:radial-gradient(circle at 50% 0,rgba(36,72,105,.24),transparent 30%),linear-gradient(180deg,#031221,#020b15)}
body.theme-postseason .topbar{background:linear-gradient(180deg,#031426,#020d18);border-color:#49371e}
body.theme-postseason .postseason-banner{display:flex}
body.theme-postseason .drawer{background:linear-gradient(180deg,#061b2f,#041526);border-color:#8d672f}
body.theme-postseason .theme-choice.active,body.theme-postseason .drawer-nav.active{background:#3c2d19}
body.theme-postseason .postseason-footer{margin:4px -10px -32px;padding:10px;text-align:center;border-top:1px solid #9b7436;color:#dda947;font-weight:900;letter-spacing:.06em}
body.theme-postseason.dark-mode{--bg:#01060b;--panel:#020d18;--panel2:#041525;--line:#6f5128;--selected:#392b18}

/* Dark mode preserves selected theme identity */
body.dark-mode .topbar{filter:brightness(.88)}
body.dark-mode .card,body.dark-mode .team-left-stack,body.dark-mode .lineup-pane,body.dark-mode .pitch-pane,body.dark-mode .scoring-pane{filter:brightness(.94)}
body.theme-custom.dark-mode .drawer{filter:brightness(.92)}
body.dark-mode .modal-card{background:#0c1712;color:#f4f4ef;border-color:#4a554d}

/* Focus */
body.focus-mode .game-info,body.focus-mode .matchup-selector,body.focus-mode .standings-overview,body.focus-mode .playoff-overview{display:none!important}

/* Modals / settings / history / summary */
.modal{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:12px;background:rgba(0,0,0,.62)}
.modal-card{width:min(720px,96vw);max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:14px;background:#f8f5e9;color:#202621;padding:11px}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #cbc6b9;padding-bottom:8px}
.modal-head small{display:block;color:#6d716b;margin-top:2px}
.modal-head button{border:0;background:transparent;font-size:23px}
.form-grid{display:grid;gap:8px;margin-top:9px}.form-grid.two{grid-template-columns:1fr 1fr}.form-grid.three{grid-template-columns:2fr .7fr 1fr}
.modal label{display:flex;flex-direction:column;gap:4px;font-size:8px;font-weight:900;color:#626760;letter-spacing:.06em}
.modal input,.modal select{min-height:34px;border:1px solid #c7c2b5;border-radius:7px;background:#fff;padding:7px}
.section-row{display:flex;align-items:center;justify-content:space-between;margin:11px 0 7px}
.small-btn,.modal-actions button,.settings-buttons button,.history-actions button{border:1px solid #bcb7ab;border-radius:7px;background:#fff;padding:8px 10px;font-weight:850}
.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}.modal-actions .primary{background:#173f2d;color:#fff;border-color:#173f2d}.danger{color:#a63c36!important}
.sub-row{display:grid;grid-template-columns:70px 1fr 55px 70px 55px 30px;gap:5px;margin-bottom:5px}.sub-row button{border:1px solid #d4aaa6;background:#fff;color:#a33a34;border-radius:6px}
.situation{margin-top:9px;background:#173f2d;color:#fff;border-radius:7px;padding:8px;font-weight:900}.quick-label{font-size:8px;font-weight:900;color:#6b6e68;margin:9px 0 5px}.quick-plays{display:flex;gap:5px;flex-wrap:wrap}.quick-plays button{border:1px solid #c8c3b7;background:#fff;border-radius:6px;padding:7px 10px;font-weight:900}
.settings-section{border-top:1px solid #d6d1c6;padding-top:10px;margin-top:10px}.settings-section h3{margin:0 0 7px}.settings-buttons{display:flex;flex-wrap:wrap;gap:6px}
.page-title{font-size:20px}.history-list,.summary-grid{display:grid;gap:8px}.history-item{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px}.history-score{font-size:22px;font-weight:900;color:var(--accent)}.history-actions{display:flex;gap:5px}.summary-hero{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:12px}.summary-team{display:flex;align-items:center;gap:7px;font-weight:900}.summary-team.right{justify-content:flex-end}.summary-team img{width:40px;height:40px;object-fit:contain}.summary-score{font-size:27px;font-weight:950}.summary-score span{color:var(--accent);margin:0 7px}.summary-table{border-collapse:collapse;min-width:720px}.summary-table th,.summary-table td{border:1px solid var(--line);padding:5px;text-align:center;font-size:8px}
.check-label{flex-direction:row!important;align-items:center!important}
.check-label input{width:17px;min-height:17px}

/* Mobile */
@media(max-width:600px){
 .topbar{grid-template-columns:40px minmax(0,1fr) auto;min-height:78px;padding:calc(8px + env(safe-area-inset-top)) 8px 8px}
 .topbar h1{font-size:22px}.top-icon{width:38px;min-height:39px}.menu-icon{font-size:25px}.top-action{min-height:39px;padding:0 10px;font-size:12px}
 main{padding:6px 6px 26px}
 .drawer{width:min(286px,80vw);padding-left:10px;padding-right:10px}
 .drawer-head{font-size:20px}.drawer-section{padding:11px 0}.drawer-nav,.theme-choice,.drawer-tools>button,.import-button{min-height:43px;padding:6px 8px}
 .game-info.with-extras{grid-template-columns:repeat(3,minmax(0,1fr))}
 .game-info.four-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .game-info.four-fields .game-field{border-bottom:1px solid var(--line)}
 .game-info.four-fields .game-field:nth-child(2n){border-right:0}.game-info.four-fields .game-field:nth-last-child(-n+2){border-bottom:0}
 .game-field{grid-template-columns:25px minmax(0,1fr);gap:5px;padding:7px 6px}.game-info-icon{width:24px;height:24px;font-size:18px}
 .game-field label{font-size:5.6px}.game-field input{height:24px;font-size:8px}
 .matchup-selector{grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr);padding:5px;gap:2px}
 .matchup-team{grid-template-columns:29px minmax(0,1fr);gap:1px 3px}.matchup-team img{width:28px;height:28px}.matchup-label{font-size:5px}.matchup-team select{height:26px;font-size:6.8px}.versus-mark{font-size:8px}
 .overview-title{min-height:31px;font-size:7px;padding-left:7px}.section-collapse{width:25px;height:25px;flex-basis:25px}.chevron-icon{width:7px;height:7px}
 .standings-head{height:23px;font-size:5.4px;padding:0 3px}.refresh-mini{width:19px;height:19px}
 .standings-grid{grid-template-columns:minmax(0,1.62fr) .42fr .42fr .61fr .50fr;font-size:4.7px}.standings-grid>div{padding:3px 1px}.standings-grid .head{font-size:4px}.standings-grid .team img{width:9px;height:9px;flex-basis:9px}.standings-foot{font-size:4px;padding:3px}
 .playoff-overview{grid-template-columns:minmax(0,.74fr) minmax(0,1.26fr);gap:5px}.notes-card textarea{height:138px;font-size:8px;padding:7px}.card-title{font-size:7px;min-height:31px}
 .team-scorebook-head{min-height:39px;padding:4px 5px 4px 7px}.team-logo{width:27px;height:27px;flex-basis:27px}.team-header-select{height:28px;font-size:8.5px}
 .team-scorebook-canvas{
  grid-template-columns:176px 720px;
  grid-template-rows:auto auto;
  grid-template-areas:
    "left scoring"
    "pitch pitch";
  min-width:896px;
  width:896px
 }
 .lineup-only-table{width:176px}.lineup-only-table th{height:22px;font-size:5.2px}.lineup-only-table td{height:38px;font-size:6px}.lineup-only-table .ord{width:21px}.lineup-only-table .player{width:124px}.lineup-only-table .pos{width:31px}.player-main{font-size:5.8px}.player-subs{font-size:4.4px}
 .pane-title{height:23px;font-size:6px}
 .scoring-pane{width:720px}.scoring-only-table{width:720px;min-width:720px}.scoring-only-table th{height:22px;font-size:5.3px}.scoring-only-table td{height:38px;font-size:6px}.scoring-only-table .inn{width:38px}.scoring-only-table .stat{width:44px}
 .pitch-table{width:500px;min-width:500px}.pitch-table .pitcher-name{width:155px}.pitch-table th{font-size:5px}.pitch-table input{font-size:5.3px}
 .postseason-banner{font-size:17px}
 .form-grid.two,.form-grid.three{grid-template-columns:1fr 1fr}.sub-row{grid-template-columns:55px 1fr 46px 60px 45px 28px}
}

/* v5 final team-header cleanup: team selection remains in the VS row / Settings,
   leaving one unambiguous far-right collapse control. */
.team-header-name{
 min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 color:var(--accent);font-size:11px;font-weight:950;letter-spacing:.01em
}
@media(max-width:600px){.team-header-name{font-size:8.5px}}

/* v6: full-width pitching section under lineup + scoring */
.team-scorebook-canvas>.pitch-pane .pitch-scroll{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
}
.team-scorebook-canvas>.pitch-pane .pitch-table{
  width:950px!important;
  min-width:950px!important;
  table-layout:fixed!important;
}
.team-scorebook-canvas>.pitch-pane .pitch-table .pitcher-name{
  width:320px!important;
}
.team-scorebook-canvas>.pitch-pane .pitch-table th:not(.pitcher-name),
.team-scorebook-canvas>.pitch-pane .pitch-table td:not(.pitcher-name){
  width:auto!important;
}
@media(max-width:600px){
  .team-scorebook-canvas>.pitch-pane .pitch-table{
    width:896px!important;
    min-width:896px!important;
  }
  .team-scorebook-canvas>.pitch-pane .pitch-table .pitcher-name{
    width:285px!important;
  }
}

/* v7 logo-safety pass: larger frames + inner breathing room */
.team-logo{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:3px!important;
  margin:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  overflow:visible!important;
  clip-path:none!important;
  mask:none!important;
}
.matchup-team img{
  width:42px!important;
  height:42px!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:3px!important;
  background:transparent!important;
  overflow:visible!important;
  clip-path:none!important;
  mask:none!important;
}
.standings-grid .team img{
  object-fit:contain!important;
  object-position:center!important;
  padding:1px!important;
  background:transparent!important;
  overflow:visible!important;
}
.summary-team img{
  object-fit:contain!important;
  object-position:center!important;
  padding:3px!important;
  background:transparent!important;
  overflow:visible!important;
}
@media(max-width:600px){
  .team-logo{
    width:34px!important;
    height:34px!important;
    flex-basis:34px!important;
    padding:3px!important;
  }
  .matchup-team img{
    width:34px!important;
    height:34px!important;
    padding:3px!important;
  }
}

/* v8 definitive pitching-render fix */
.team-scorebook-canvas{
  grid-template-areas:
    "left scoring"
    "pitch pitch" !important;
}
.team-scorebook-canvas > .pitch-pane{
  grid-area:pitch !important;
  display:block !important;
  visibility:visible !important;
  width:100% !important;
  min-width:100% !important;
  position:relative !important;
  z-index:2 !important;
  border-top:1px solid var(--line) !important;
}
.team-scorebook-canvas > .pitch-pane .pitch-scroll{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
}
.team-scorebook-canvas > .pitch-pane .pitch-table{
  display:table !important;
  width:950px !important;
  min-width:950px !important;
}
@media(max-width:600px){
  .team-scorebook-canvas > .pitch-pane .pitch-table{
    width:896px !important;
    min-width:896px !important;
  }
}


/* ===========================================================
   v9 UNIFIED THEMES + SCROLL STABILITY
   Same structural layout for Default / Wrigley / Playoff.
   One horizontal scroller per team card; no nested pan conflict.
   =========================================================== */

/* One intentional horizontal scroller per team card. */
html,body,.app-shell{overflow-x:clip!important;max-width:100%!important}
.team-scorebook{max-width:100%!important;overflow:hidden!important}
.team-scorebook-body{max-width:100%!important;overflow:hidden!important}
.team-scorebook-scroll{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:scroll!important;
  overflow-y:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-x:contain!important;
  touch-action:pan-x pan-y pinch-zoom!important;
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--accent) 60%,transparent) transparent;
}
.team-scorebook-scroll::-webkit-scrollbar{height:5px}
.team-scorebook-scroll::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--accent) 62%,transparent);border-radius:4px}
.team-scorebook-canvas{overflow:visible!important}
.score-scroll,.team-scorebook-canvas>.pitch-pane .pitch-scroll{
  overflow:visible!important;
  width:auto!important;
  max-width:none!important;
  touch-action:auto!important;
  -webkit-overflow-scrolling:auto!important;
}
.scoring-pane{overflow:visible!important}
.team-scorebook-canvas>.pitch-pane{overflow:visible!important}

/* Standings is part of the shared structure in every theme. */
body.theme-custom .standings-overview,
body.theme-wrigley .standings-overview,
body.theme-postseason .standings-overview{display:block}
body.theme-postseason .playoff-overview,.postseason-notes{display:none!important}

/* ---------- PLAYOFF ROUNDS: same layout, clearly distinct presentation ---------- */
body.theme-postseason.playoff-wild-card{
 --bg:#06111d;--panel:#0b1f31;--panel2:#112b40;--line:#8295a8;--accent:#dbe3e8;--selected:#263f56;
}
body.theme-postseason.playoff-wild-card .topbar,
body.theme-postseason.playoff-wild-card .app-shell{
 background-image:linear-gradient(135deg,rgba(215,225,232,.05) 25%,transparent 25%,transparent 50%,rgba(215,225,232,.05) 50%,rgba(215,225,232,.05) 75%,transparent 75%),linear-gradient(180deg,#071726,#020b14)!important;
 background-size:18px 18px,auto!important;
}
body.theme-postseason.playoff-wild-card .postseason-banner{color:#e2e8ec;text-shadow:0 0 12px rgba(212,228,238,.22)}
body.theme-postseason.playoff-wild-card .card{border-color:#8295a8!important}

body.theme-postseason.playoff-division-series{
 --bg:#020c16;--panel:#04182a;--panel2:#061f35;--line:#9c7435;--accent:#dda947;--selected:#503a1f;
}
body.theme-postseason.playoff-division-series .app-shell{
 background-image:linear-gradient(90deg,transparent 48%,rgba(218,168,73,.045) 49%,rgba(218,168,73,.045) 51%,transparent 52%),linear-gradient(0deg,transparent 48%,rgba(218,168,73,.035) 49%,rgba(218,168,73,.035) 51%,transparent 52%),linear-gradient(180deg,#031221,#020b15)!important;
 background-size:110px 58px,110px 58px,auto!important;
}

body.theme-postseason.playoff-championship-series{
 --bg:#070d18;--panel:#101b2d;--panel2:#17263b;--line:#a86f45;--accent:#efbd65;--selected:#5b3428;
}
body.theme-postseason.playoff-championship-series .topbar{background:linear-gradient(90deg,#111d32,#4b1f27 50%,#111d32)!important}
body.theme-postseason.playoff-championship-series .team-scorebook-head,
body.theme-postseason.playoff-championship-series .overview-title{background:linear-gradient(90deg,#17263b,#3b2028,#17263b)!important}
body.theme-postseason.playoff-championship-series .card{box-shadow:inset 0 0 0 1px rgba(239,189,101,.08),0 8px 22px rgba(0,0,0,.18)}

body.theme-postseason.playoff-world-series{
 --bg:#01070e;--panel:#031322;--panel2:#071d30;--line:#c49a4e;--accent:#f0c875;--selected:#62451d;
}
body.theme-postseason.playoff-world-series .app-shell{background:radial-gradient(circle at 50% 0,rgba(240,200,117,.16),transparent 27%),linear-gradient(180deg,#031323,#01070e)!important}
body.theme-postseason.playoff-world-series .postseason-banner{font-size:25px;letter-spacing:.09em;text-shadow:0 0 16px rgba(240,200,117,.26)}
body.theme-postseason.playoff-world-series .card{border:1px solid #c49a4e!important;box-shadow:inset 0 0 0 1px rgba(240,200,117,.14),0 0 20px rgba(196,154,78,.08)}
body.theme-postseason.playoff-world-series .team-scorebook-head{border-bottom:2px solid #c49a4e!important}
body.theme-postseason.playoff-world-series .postseason-footer{font-size:13px;letter-spacing:.12em;border-top:2px solid #c49a4e}

/* ---------- WRIGLEY: ivy-framed brick cards, green play grid ---------- */
body.theme-wrigley,
body.theme-wrigley button,
body.theme-wrigley input,
body.theme-wrigley select,
body.theme-wrigley textarea{font-family:Georgia,'Times New Roman',serif!important}

body.theme-wrigley{
 --wrigley-brick:#60392c;
 --wrigley-brick-dark:#40251e;
 --wrigley-green:#0d2c1a;
 --wrigley-green2:#153b25;
 --wrigley-cream:#e7e2cd;
}
body.theme-wrigley .game-info,
body.theme-wrigley .matchup-selector,
body.theme-wrigley .standings-overview,
body.theme-wrigley .team-scorebook{
 position:relative!important;
 overflow:visible!important;
 border:2px solid #58705b!important;
 background:
   linear-gradient(rgba(72,42,32,.88),rgba(72,42,32,.88)),
   repeating-linear-gradient(0deg,transparent 0 17px,rgba(222,179,150,.35) 18px 19px),
   repeating-linear-gradient(90deg,#6e4232 0 38px,#a17157 39px 40px)!important;
 box-shadow:0 7px 18px rgba(0,0,0,.22)!important;
}
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before,
body.theme-wrigley .game-info::after,
body.theme-wrigley .matchup-selector::after,
body.theme-wrigley .standings-overview::after,
body.theme-wrigley .team-scorebook::after{
 content:'';position:absolute;left:5px;right:5px;height:12px;z-index:8;pointer-events:none;opacity:.95;
 background:
  radial-gradient(ellipse at 8px 6px,#2d7b3e 0 5px,transparent 5.6px) 0 0/24px 12px repeat-x,
  radial-gradient(ellipse at 17px 5px,#1f6332 0 5px,transparent 5.6px) 0 0/28px 12px repeat-x;
 filter:drop-shadow(0 2px 1px rgba(0,0,0,.3));
}
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before{top:-8px}
body.theme-wrigley .game-info::after,
body.theme-wrigley .matchup-selector::after,
body.theme-wrigley .standings-overview::after,
body.theme-wrigley .team-scorebook::after{bottom:-8px;transform:rotate(180deg)}

/* Green content tiles sit over the brick frames. */
body.theme-wrigley .game-field,
body.theme-wrigley .matchup-team,
body.theme-wrigley .overview-title,
body.theme-wrigley .standings-card,
body.theme-wrigley .team-scorebook-head,
body.theme-wrigley .team-scorebook-body{
 background:linear-gradient(180deg,var(--wrigley-green2),var(--wrigley-green))!important;
}
body.theme-wrigley .game-info{padding:5px!important;gap:3px!important}
body.theme-wrigley .game-field{border:1px solid #4d6954!important;border-radius:7px!important}
body.theme-wrigley .matchup-selector{padding:7px!important}
body.theme-wrigley .matchup-team{padding:4px 6px!important;border:1px solid #4d6954!important;border-radius:8px!important}
body.theme-wrigley .standings-overview{padding:5px!important}
body.theme-wrigley .standings-overview .overview-title{border-radius:7px 7px 0 0!important}
body.theme-wrigley .team-scorebook{padding:5px!important}
body.theme-wrigley .team-scorebook-head{border-radius:7px 7px 0 0!important}
body.theme-wrigley .team-scorebook-body{border-radius:0 0 7px 7px!important}

/* The actual scoring/play grid stays green — never brick. */
body.theme-wrigley .team-scorebook-canvas,
body.theme-wrigley .team-left-stack,
body.theme-wrigley .lineup-pane,
body.theme-wrigley .pitch-pane,
body.theme-wrigley .scoring-pane,
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .lineup-only-table td,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .scoring-only-table td,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pitch-table td,
body.theme-wrigley .standings-grid>div{
 background:#0b2818!important;
 color:var(--wrigley-cream)!important;
}
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pane-title,
body.theme-wrigley .standings-grid .head{
 background:#143821!important;color:#e7e2cd!important;
}
body.theme-wrigley .standings-selected{background:#26633a!important;color:#fff!important}
body.theme-wrigley .section-collapse{background:#143821!important;border-color:#9eb39c!important;color:#e7e2cd!important}

/* Wrigley style suboptions remain visibly different without changing layout. */
body.theme-wrigley.wrigley-scoreboard .topbar{filter:none!important}
body.theme-wrigley.wrigley-ivybrick .app-shell{background:linear-gradient(180deg,#0a1d12,#152319)!important}
body.theme-wrigley.wrigley-ivybrick .team-scorebook{box-shadow:0 8px 22px rgba(0,0,0,.28),inset 0 0 0 1px rgba(214,185,153,.08)!important}
body.theme-wrigley.wrigley-night{--wrigley-brick:#3d2722;--wrigley-brick-dark:#241713;--wrigley-green:#071a11;--wrigley-green2:#0d291b}
body.theme-wrigley.wrigley-night .app-shell{background:radial-gradient(circle at 50% 0,rgba(169,204,178,.08),transparent 25%),linear-gradient(180deg,#030a06,#08120c)!important}
body.theme-wrigley.wrigley-night .topbar{filter:brightness(.72)!important}

/* Keep theme identity when Dark Mode is on; only deepen tones. */
body.theme-wrigley.dark-mode .game-info,
body.theme-wrigley.dark-mode .matchup-selector,
body.theme-wrigley.dark-mode .standings-overview,
body.theme-wrigley.dark-mode .team-scorebook{filter:brightness(.82)!important}
body.theme-postseason.dark-mode .card{filter:brightness(.90)!important}

@media(max-width:600px){
 .team-scorebook-scroll{scroll-snap-type:none!important}
 .team-scorebook-canvas{will-change:transform}
 body.theme-wrigley .game-info::before,body.theme-wrigley .matchup-selector::before,body.theme-wrigley .standings-overview::before,body.theme-wrigley .team-scorebook::before,
 body.theme-wrigley .game-info::after,body.theme-wrigley .matchup-selector::after,body.theme-wrigley .standings-overview::after,body.theme-wrigley .team-scorebook::after{height:9px;background-size:20px 9px,24px 9px}
 body.theme-wrigley .game-info::before,body.theme-wrigley .matchup-selector::before,body.theme-wrigley .standings-overview::before,body.theme-wrigley .team-scorebook::before{top:-6px}
 body.theme-wrigley .game-info::after,body.theme-wrigley .matchup-selector::after,body.theme-wrigley .standings-overview::after,body.theme-wrigley .team-scorebook::after{bottom:-6px}
}


/* =========================================================
   v10 — EXACT LINEUP / SCORE GRID ALIGNMENT
   One physical table, sticky lineup columns.
   ========================================================= */

.team-scorebook-body{
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
}
.team-scorebook-scroll{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-x:contain!important;
  touch-action:pan-x pan-y pinch-zoom!important;
  position:relative!important;
}
.unified-score-table{
  --ord-w:23px;
  --player-w:132px;
  --pos-w:35px;
  --inning-w:40px;
  --stat-w:46px;
  --head1-h:26px;
  --head2-h:23px;
  --row-h:39px;
  --total-h:29px;
  border-collapse:separate!important;
  border-spacing:0!important;
  table-layout:fixed!important;
  width:950px!important;
  min-width:950px!important;
  background:var(--panel)!important;
}
.unified-score-table .c-ord{width:var(--ord-w)}
.unified-score-table .c-player{width:var(--player-w)}
.unified-score-table .c-pos{width:var(--pos-w)}
.unified-score-table .c-inning{width:var(--inning-w)}
.unified-score-table .c-stat{width:var(--stat-w)}

.unified-score-table th,
.unified-score-table td{
  box-sizing:border-box!important;
  margin:0!important;
  padding:0!important;
  border-right:1px solid var(--line)!important;
  border-bottom:1px solid var(--line)!important;
  background:var(--panel)!important;
  color:var(--text)!important;
  text-align:center!important;
  vertical-align:middle!important;
}
.unified-score-table thead th{
  background:var(--panel2)!important;
  color:var(--accent)!important;
  font-weight:900!important;
}
.unified-score-table .score-head-primary th{
  height:var(--head1-h)!important;
  min-height:var(--head1-h)!important;
  max-height:var(--head1-h)!important;
  font-size:6px!important;
}
.unified-score-table .score-head-secondary th{
  height:var(--head2-h)!important;
  min-height:var(--head2-h)!important;
  max-height:var(--head2-h)!important;
  font-size:6px!important;
}
.unified-score-table .batter-row > td{
  height:var(--row-h)!important;
  min-height:var(--row-h)!important;
  max-height:var(--row-h)!important;
}
.unified-score-table .unified-totals-row > td{
  height:var(--total-h)!important;
  min-height:var(--total-h)!important;
  max-height:var(--total-h)!important;
  background:var(--panel2)!important;
  color:var(--accent)!important;
  font-weight:900!important;
}

/* Frozen lineup columns are cells in the SAME rows as the scoring cells. */
.unified-score-table .sticky-lineup-banner,
.unified-score-table .sticky-ord,
.unified-score-table .sticky-player,
.unified-score-table .sticky-pos,
.unified-score-table .sticky-totals-label{
  position:sticky!important;
  z-index:6!important;
  background:var(--panel2)!important;
}
.unified-score-table .sticky-lineup-banner,
.unified-score-table .sticky-ord,
.unified-score-table .sticky-totals-label{left:0!important}
.unified-score-table .sticky-player{left:var(--ord-w)!important}
.unified-score-table .sticky-pos{left:calc(var(--ord-w) + var(--player-w))!important}
.unified-score-table tbody .sticky-ord,
.unified-score-table tbody .sticky-player,
.unified-score-table tbody .sticky-pos{
  background:var(--panel)!important;
  z-index:5!important;
}
.unified-score-table .sticky-lineup-banner{
  text-align:left!important;
  padding-left:7px!important;
  font-size:7px!important;
}
.unified-score-table .sticky-totals-label{
  text-align:left!important;
  padding-left:8px!important;
}
.unified-score-table .sticky-player{
  text-align:left!important;
  padding:2px 4px!important;
  overflow:hidden!important;
}
.unified-score-table .sticky-ord,
.unified-score-table .sticky-pos{
  font-weight:900!important;
}
.unified-score-table .player-main{font-size:6.2px!important;line-height:1.04!important}
.unified-score-table .player-subs{font-size:4.8px!important;line-height:1!important}
.unified-score-table .play-cell{
  position:relative!important;
  overflow:hidden!important;
}
.unified-score-table .stat-cell{font-size:7px!important}

/* Pitching is an explicit full-width block under the aligned table. */
.full-width-pitch{
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  border-top:1px solid var(--line)!important;
  background:var(--panel)!important;
}
.full-width-pitch .pitch-scroll{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-x:contain!important;
  touch-action:pan-x pan-y pinch-zoom!important;
}
.full-width-pitch .pitch-table{
  width:max(100%,760px)!important;
  min-width:760px!important;
}

/* Wrigley compatibility with the unified table. */
body.theme-wrigley .unified-score-table,
body.theme-wrigley .unified-score-table th,
body.theme-wrigley .unified-score-table td{
  background:#0b2818!important;
  color:var(--wrigley-cream)!important;
  border-color:#536750!important;
}
body.theme-wrigley .unified-score-table thead th,
body.theme-wrigley .unified-score-table .sticky-lineup-banner,
body.theme-wrigley .unified-score-table .sticky-totals-label,
body.theme-wrigley .unified-score-table .unified-totals-row td{
  background:#143821!important;
  color:#e7e2cd!important;
}
body.theme-wrigley .unified-score-table tbody .sticky-ord,
body.theme-wrigley .unified-score-table tbody .sticky-player,
body.theme-wrigley .unified-score-table tbody .sticky-pos{
  background:#0b2818!important;
}
body.theme-wrigley .full-width-pitch,
body.theme-wrigley .full-width-pitch .pitch-table th,
body.theme-wrigley .full-width-pitch .pitch-table td{
  background:#0b2818!important;
  color:var(--wrigley-cream)!important;
  border-color:#536750!important;
}
body.theme-wrigley .full-width-pitch .pane-title,
body.theme-wrigley .full-width-pitch .pitch-table th{
  background:#143821!important;color:#e7e2cd!important;
}

/* Playoff compatibility. */
body.theme-postseason .unified-score-table th,
body.theme-postseason .unified-score-table td,
body.theme-postseason .full-width-pitch .pitch-table th,
body.theme-postseason .full-width-pitch .pitch-table td{
  border-color:var(--line)!important;
}
body.theme-postseason .unified-score-table thead th,
body.theme-postseason .unified-score-table .sticky-lineup-banner,
body.theme-postseason .unified-score-table .sticky-totals-label,
body.theme-postseason .unified-score-table .unified-totals-row td{
  background:var(--panel2)!important;color:var(--accent)!important;
}

/* The old split-table layout is no longer rendered. */
.lineup-only-table,.scoring-only-table,.team-scorebook-canvas,.team-left-stack,.scoring-pane{}

/* Mobile exact dimensions; every row still shares one <tr>. */
@media(max-width:600px){
  .unified-score-table{
    --ord-w:21px;
    --player-w:124px;
    --pos-w:31px;
    --inning-w:38px;
    --stat-w:44px;
    --head1-h:23px;
    --head2-h:22px;
    --row-h:38px;
    --total-h:29px;
    width:896px!important;
    min-width:896px!important;
  }
  .unified-score-table .score-head-primary th{font-size:5.3px!important}
  .unified-score-table .score-head-secondary th{font-size:5.2px!important}
  .unified-score-table .sticky-lineup-banner{font-size:6px!important;padding-left:5px!important}
  .unified-score-table .player-main{font-size:5.8px!important}
  .unified-score-table .player-subs{font-size:4.4px!important}
  .unified-score-table .stat-cell{font-size:6px!important}
  .full-width-pitch .pitch-table{
    width:896px!important;
    min-width:896px!important;
  }
}


/* ==========================================================
   v11 RESTORED REALISTIC WRIGLEY — approved photo-real ivy + brick
   Core layout is unchanged. Play/scoring grid remains green.
   ========================================================== */
body.theme-wrigley{
  --wrigley-brick-image:url("assets/theme/wrigley-real-brick.jpg");
  --wrigley-ivy-v:url("assets/theme/wrigley-real-ivy-vertical.png");
  --wrigley-ivy-h:url("assets/theme/wrigley-real-ivy-horizontal.png");
  --wrigley-green:#071d12;
  --wrigley-green2:#0d2b1b;
  --wrigley-cream:#eee4c8;
  --wrigley-gold:#a98b56;
  --wrigley-line:#887247;
  --bg:#06120b;
  --panel:#0a2416;
  --panel2:#0d2c1b;
  --line:#7d6943;
  --text:#f0ead8;
  --muted:#b8b09c;
  --accent:#eee4c8;
  --selected:#205b32;
}
body.theme-wrigley .app-shell{
  background:
    linear-gradient(rgba(5,18,10,.88),rgba(5,18,10,.88)),
    var(--wrigley-brick-image) center/420px auto repeat!important;
}
body.theme-wrigley .topbar{
  min-height:96px!important;
  background:
    linear-gradient(90deg,rgba(4,15,9,.68),rgba(5,33,18,.38),rgba(4,15,9,.72)),
    url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important;
  border-bottom:1px solid #927b4b!important;
  box-shadow:0 8px 18px rgba(0,0,0,.34)!important;
}
body.theme-wrigley .topbar h1{
  color:var(--wrigley-cream)!important;
  text-shadow:0 2px 3px #000,0 0 14px rgba(210,199,158,.15)!important;
}
body.theme-wrigley .top-icon,
body.theme-wrigley .top-action{
  background:rgba(3,22,12,.72)!important;
  border-color:#b2aa82!important;
  color:var(--wrigley-cream)!important;
  box-shadow:0 2px 7px rgba(0,0,0,.28)!important;
}

/* Realistic photo-backed brick wrappers around every major section. */
body.theme-wrigley .game-info,
body.theme-wrigley .matchup-selector,
body.theme-wrigley .standings-overview,
body.theme-wrigley .team-scorebook{
  position:relative!important;
  isolation:isolate!important;
  padding:11px!important;
  margin-top:14px!important;
  border:1px solid #6f5135!important;
  border-radius:13px!important;
  overflow:visible!important;
  background:
    var(--wrigley-ivy-v) left center/34px 92% no-repeat,
    var(--wrigley-ivy-v) right center/34px 92% no-repeat,
    var(--wrigley-brick-image) center/330px auto repeat!important;
  box-shadow:
    0 8px 19px rgba(0,0,0,.38),
    inset 0 0 0 1px rgba(233,204,154,.13)!important;
}

/* Real extracted ivy across the top/bottom edges of each section. */
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before,
body.theme-wrigley .game-info::after,
body.theme-wrigley .matchup-selector::after,
body.theme-wrigley .standings-overview::after,
body.theme-wrigley .team-scorebook::after{
  content:""!important;
  position:absolute!important;
  left:-7px!important;
  right:-7px!important;
  height:31px!important;
  z-index:5!important;
  pointer-events:none!important;
  background:var(--wrigley-ivy-h) center/auto 31px repeat-x!important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.52))!important;
}
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before{top:-18px!important}
body.theme-wrigley .game-info::after,
body.theme-wrigley .matchup-selector::after,
body.theme-wrigley .standings-overview::after,
body.theme-wrigley .team-scorebook::after{
  bottom:-18px!important;
  transform:rotate(180deg)!important;
}

/* Green inner cards remain readable on top of brick. */
body.theme-wrigley .game-field,
body.theme-wrigley .matchup-team,
body.theme-wrigley .overview-title,
body.theme-wrigley .standings-card,
body.theme-wrigley .team-scorebook-head,
body.theme-wrigley .team-scorebook-body{
  position:relative!important;
  z-index:2!important;
  background:
    radial-gradient(circle at 28% 8%,rgba(255,255,255,.025),transparent 38%),
    linear-gradient(180deg,#0a2818,#071f13)!important;
  border:1px solid #82704b!important;
  box-shadow:
    inset 0 0 18px rgba(0,0,0,.18),
    0 1px 0 rgba(244,231,192,.05)!important;
}
body.theme-wrigley .game-info{gap:5px!important}
body.theme-wrigley .game-field{border-radius:6px!important}
body.theme-wrigley .matchup-selector{gap:8px!important}
body.theme-wrigley .matchup-team{padding:6px 8px!important;border-radius:7px!important}
body.theme-wrigley .overview-title{border-radius:6px 6px 0 0!important}
body.theme-wrigley .standings-card{border-radius:0!important}
body.theme-wrigley .team-scorebook-head{border-radius:6px 6px 0 0!important}
body.theme-wrigley .team-scorebook-body{border-radius:0 0 6px 6px!important;overflow:hidden!important}

/* IMPORTANT: the active scorebook/play grid itself remains Wrigley green, not brick. */
body.theme-wrigley .team-scorebook-canvas,
body.theme-wrigley .team-left-stack,
body.theme-wrigley .lineup-pane,
body.theme-wrigley .pitch-pane,
body.theme-wrigley .scoring-pane,
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .lineup-only-table td,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .scoring-only-table td,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pitch-table td{
  background:#082519!important;
}
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pane-title{
  background:#0d3020!important;
  color:#eadfbe!important;
}
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .lineup-only-table td,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .scoring-only-table td,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pitch-table td{
  border-color:#756644!important;
}
body.theme-wrigley .standings-grid>div{
  background:#092619!important;
  border-color:#756644!important;
}
body.theme-wrigley .standings-grid .head{background:#0d3020!important;color:#eadfbe!important}
body.theme-wrigley .standings-selected{background:#28683d!important;color:#fff!important}

/* Wrigley typography across the full theme. */
body.theme-wrigley,
body.theme-wrigley button,
body.theme-wrigley input,
body.theme-wrigley select,
body.theme-wrigley textarea{
  font-family:Georgia,"Times New Roman",serif!important;
}
body.theme-wrigley .game-field label,
body.theme-wrigley .matchup-label,
body.theme-wrigley .pane-title,
body.theme-wrigley .standings-head,
body.theme-wrigley .standings-grid .head{
  letter-spacing:.055em!important;
}
body.theme-wrigley .team-header-name,
body.theme-wrigley .overview-title strong{
  text-shadow:0 1px 1px rgba(0,0,0,.7)!important;
}

/* Draw realistic brick floor under the scorebook with ivy crest. */
body.theme-wrigley .wrigley-footer{
  position:relative!important;
  height:84px!important;
  margin:20px -10px -32px!important;
  background:var(--wrigley-brick-image) center/430px auto repeat!important;
  border-top:2px solid #60472f!important;
  box-shadow:inset 0 10px 18px rgba(0,0,0,.25)!important;
}
body.theme-wrigley .wrigley-footer::before{
  content:""!important;
  position:absolute!important;
  left:0;right:0;top:-20px;height:38px!important;
  background:var(--wrigley-ivy-h) center/auto 38px repeat-x!important;
  filter:drop-shadow(0 3px 3px rgba(0,0,0,.5))!important;
}

/* Wrigley style suboptions remain distinct while using the same real textures. */
body.theme-wrigley.wrigley-scoreboard .topbar{
  background:
    linear-gradient(90deg,rgba(3,15,8,.64),rgba(3,30,16,.28),rgba(3,15,8,.68)),
    url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info,
body.theme-wrigley.wrigley-ivybrick .matchup-selector,
body.theme-wrigley.wrigley-ivybrick .standings-overview,
body.theme-wrigley.wrigley-ivybrick .team-scorebook{
  padding:14px!important;
  background:
    var(--wrigley-ivy-v) left center/42px 96% no-repeat,
    var(--wrigley-ivy-v) right center/42px 96% no-repeat,
    var(--wrigley-brick-image) center/310px auto repeat!important;
}
body.theme-wrigley.wrigley-night{
  --wrigley-brick-image:url("assets/theme/wrigley-real-brick-night.jpg");
}
body.theme-wrigley.wrigley-night .app-shell{
  background:
    radial-gradient(circle at 50% 0,rgba(94,135,104,.08),transparent 30%),
    linear-gradient(rgba(1,8,4,.88),rgba(1,8,4,.9)),
    var(--wrigley-brick-image) center/420px auto repeat!important;
}
body.theme-wrigley.wrigley-night .topbar{filter:brightness(.74)!important}
body.theme-wrigley.wrigley-night .game-info,
body.theme-wrigley.wrigley-night .matchup-selector,
body.theme-wrigley.wrigley-night .standings-overview,
body.theme-wrigley.wrigley-night .team-scorebook{filter:brightness(.78)!important}

/* Dark mode deepens Wrigley but does not erase the ivy/brick identity. */
body.theme-wrigley.dark-mode .app-shell{
  background:
    linear-gradient(rgba(0,6,3,.58),rgba(0,6,3,.62)),
    var(--wrigley-brick-image) center/420px auto repeat!important;
}
body.theme-wrigley.dark-mode .game-info,
body.theme-wrigley.dark-mode .matchup-selector,
body.theme-wrigley.dark-mode .standings-overview,
body.theme-wrigley.dark-mode .team-scorebook{
  filter:brightness(.78)!important;
}

/* Mobile: preserve realism without crowding the UI. */
@media(max-width:600px){
  body.theme-wrigley .game-info,
  body.theme-wrigley .matchup-selector,
  body.theme-wrigley .standings-overview,
  body.theme-wrigley .team-scorebook{
    padding:7px!important;
    margin-top:12px!important;
    background:
      var(--wrigley-ivy-v) left center/22px 90% no-repeat,
      var(--wrigley-ivy-v) right center/22px 90% no-repeat,
      var(--wrigley-brick-image) center/240px auto repeat!important;
  }
  body.theme-wrigley .game-info::before,
  body.theme-wrigley .matchup-selector::before,
  body.theme-wrigley .standings-overview::before,
  body.theme-wrigley .team-scorebook::before,
  body.theme-wrigley .game-info::after,
  body.theme-wrigley .matchup-selector::after,
  body.theme-wrigley .standings-overview::after,
  body.theme-wrigley .team-scorebook::after{
    height:21px!important;
    background-size:auto 21px!important;
  }
  body.theme-wrigley .game-info::before,
  body.theme-wrigley .matchup-selector::before,
  body.theme-wrigley .standings-overview::before,
  body.theme-wrigley .team-scorebook::before{top:-12px!important}
  body.theme-wrigley .game-info::after,
  body.theme-wrigley .matchup-selector::after,
  body.theme-wrigley .standings-overview::after,
  body.theme-wrigley .team-scorebook::after{bottom:-12px!important}
  body.theme-wrigley .wrigley-footer{height:66px!important}
}



/* ==========================================================
   v11 unified-grid compatibility + reference-screen polish
   Keeps the v10 aligned/scrolling structure while restoring
   the approved Wrigley ivy/brick presentation.
   ========================================================= */
body.theme-wrigley .unified-score-table,
body.theme-wrigley .unified-score-table th,
body.theme-wrigley .unified-score-table td{
  background:#082519!important;
  color:#eee4c8!important;
  border-color:#756644!important;
}
body.theme-wrigley .unified-score-table thead th,
body.theme-wrigley .unified-score-table .sticky-lineup-banner,
body.theme-wrigley .unified-score-table .sticky-totals-label,
body.theme-wrigley .unified-score-table .unified-totals-row td{
  background:linear-gradient(180deg,#103721,#0b2d1c)!important;
  color:#eee4c8!important;
  border-color:#887247!important;
}
body.theme-wrigley .unified-score-table tbody .sticky-ord,
body.theme-wrigley .unified-score-table tbody .sticky-player,
body.theme-wrigley .unified-score-table tbody .sticky-pos{
  background:#082519!important;
  color:#eee4c8!important;
}
body.theme-wrigley .full-width-pitch,
body.theme-wrigley .full-width-pitch .pitch-table th,
body.theme-wrigley .full-width-pitch .pitch-table td{
  background:#082519!important;
  color:#eee4c8!important;
  border-color:#756644!important;
}
body.theme-wrigley .full-width-pitch .pane-title,
body.theme-wrigley .full-width-pitch .pitch-table th{
  background:linear-gradient(180deg,#103721,#0b2d1c)!important;
  color:#eee4c8!important;
}
body.theme-wrigley .team-scorebook-body{
  overflow:hidden!important;
}
body.theme-wrigley .team-scorebook-scroll,
body.theme-wrigley .full-width-pitch .pitch-scroll{
  scrollbar-color:#a98b56 rgba(0,0,0,.18)!important;
}
body.theme-wrigley .team-scorebook-scroll::-webkit-scrollbar-thumb,
body.theme-wrigley .full-width-pitch .pitch-scroll::-webkit-scrollbar-thumb{
  background:#a98b56!important;
}
body.theme-wrigley .matchup-selector .versus-mark{
  min-height:100%;
  display:grid;
  place-items:center;
  background:var(--wrigley-brick-image) center/150px auto repeat!important;
  border:1px solid #6f5135;
  border-radius:6px;
  color:#eee4c8!important;
  text-shadow:0 1px 2px #000;
}
body.theme-wrigley #darkBtn{
  width:auto!important;
  min-width:104px!important;
  padding:0 12px!important;
  white-space:nowrap;
}
body.theme-wrigley #darkBtn::after{content:'  Dark Mode';font-size:12px;font-weight:850}
body.theme-wrigley.dark-mode #darkBtn::after{content:'  Light Mode'}
body.theme-wrigley main{
  position:relative;
  z-index:2;
}
/* Dense outer ivy rails like the approved reference screen. */
body.theme-wrigley::before,
body.theme-wrigley::after{
  content:'';
  position:fixed;
  top:0;
  bottom:0;
  width:56px;
  z-index:12;
  pointer-events:none;
  background:var(--wrigley-ivy-v) left top/56px auto repeat-y;
  filter:drop-shadow(0 0 7px rgba(0,0,0,.45));
  opacity:.98;
}
body.theme-wrigley::before{left:0}
body.theme-wrigley::after{right:0;transform:scaleX(-1)}
body.theme-wrigley .topbar{z-index:15!important}

@media(max-width:600px){
  body.theme-wrigley::before,
  body.theme-wrigley::after{width:25px;background-size:25px auto;opacity:.94}
  body.theme-wrigley #darkBtn{min-width:39px!important;width:39px!important;padding:0!important}
  body.theme-wrigley #darkBtn::after{display:none}
  body.theme-wrigley .matchup-selector .versus-mark{border-radius:4px}
}


/* ==========================================================
   v12 RESPONSIVE EXPERIENCE — mobile + tablet + desktop
   No inning navigator and no standings-tab conversion.
   ========================================================== */
:root{--livebar-h:48px}
html{scroll-behavior:smooth}
body{padding-bottom:0}
main{max-width:1480px!important;padding:12px 14px 44px!important}
.save-status{position:absolute;left:50%;bottom:7px;transform:translateX(-50%);font-size:10px;color:var(--muted);font-weight:800;opacity:.82;white-space:nowrap;transition:opacity .2s,color .2s}
.save-status.is-saved{color:var(--accent);opacity:1}
.live-game-bar{position:sticky;top:0;z-index:24;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;min-height:var(--livebar-h);margin:0 0 12px;padding:7px 12px;background:color-mix(in srgb,var(--panel2) 94%,#000)!important;border-color:var(--line)!important;box-shadow:0 6px 16px rgba(0,0,0,.22)}
.live-team{display:flex;align-items:baseline;gap:9px;min-width:0}.live-team.right{justify-content:flex-end;text-align:right}.live-team strong{font-size:16px;color:var(--accent)}.live-team span{font-size:11px;color:var(--muted);white-space:nowrap}.live-team b{color:var(--text);font-size:14px}.live-inning{text-align:center;min-width:92px}.live-inning strong{display:block;font-size:13px;color:var(--accent)}.live-inning small{display:block;margin-top:2px;font-size:9px;color:var(--muted)}
.team-scorebook{overflow:visible!important;scroll-margin-top:calc(var(--livebar-h) + 8px)}
.team-scorebook-head{position:sticky!important;top:var(--livebar-h)!important;z-index:18!important;box-shadow:0 5px 12px rgba(0,0,0,.16)}
.team-scorebook-body{overflow:hidden!important}
.team-scorebook-scroll{scroll-snap-type:x proximity!important;scroll-behavior:smooth!important}
.unified-score-table{
 --ord-w:30px;--player-w:180px;--pos-w:44px;--inning-w:66px;--stat-w:66px;
 --sticky-total:calc(var(--ord-w) + var(--player-w) + var(--pos-w));
 --head1-h:34px;--head2-h:31px;--row-h:58px;--total-h:34px;
 width:1376px!important;min-width:1376px!important
}
.unified-score-table .score-head-primary th{font-size:11px!important}.unified-score-table .score-head-secondary th{font-size:10px!important}
.unified-score-table .sticky-lineup-banner{font-size:11px!important;padding-left:10px!important}
.unified-score-table .sticky-player{padding:4px 7px!important}.unified-score-table .player-main{font-size:12px!important;line-height:1.1!important}.unified-score-table .player-subs{font-size:9px!important;line-height:1.1!important}
.unified-score-table .sticky-ord,.unified-score-table .sticky-pos,.unified-score-table .stat-cell{font-size:11px!important}
.unified-score-table .score-head-inning{scroll-snap-align:start;scroll-margin-left:var(--sticky-total)}
.unified-score-table .play-cell{cursor:pointer;touch-action:manipulation;outline:none}
.unified-score-table .play-cell:focus-visible{box-shadow:inset 0 0 0 3px var(--accent)!important;z-index:3}
.unified-score-table .play-cell.active-inning-col,.unified-score-table .active-inning-col{background:color-mix(in srgb,var(--selected) 42%,var(--panel))!important}
.unified-score-table .score-head-inning.active-inning-col{background:color-mix(in srgb,var(--selected) 70%,var(--panel2))!important;color:#fff!important}
.unified-score-table .current-batter>.sticky-ord,.unified-score-table .current-batter>.sticky-player,.unified-score-table .current-batter>.sticky-pos{box-shadow:inset 0 2px 0 var(--accent),inset 0 -2px 0 var(--accent)!important}
.play-entry svg{inset:5px!important;width:calc(100% - 10px)!important;height:calc(100% - 10px)!important}.play-code{font-size:11px!important;right:4px!important;bottom:3px!important}.standalone-out{font-size:20px!important}.rbi-code{font-size:8px!important;right:3px!important;top:3px!important}.pa-count{font-size:8px!important}.event-marker{height:12px!important;font-size:8px!important}
.full-width-pitch .pitch-table{width:100%!important;min-width:930px!important}.pitch-table .pitcher-name{width:34%!important}.pitch-table th{height:31px!important;font-size:10px!important}.pitch-table td{height:42px!important}.pitch-table input{height:40px!important;font-size:12px!important;padding:4px 6px!important}.pane-title{height:34px!important;font-size:11px!important}
.standings-head{font-size:10px!important;height:34px!important}.standings-grid{font-size:9px!important}.standings-grid .head{font-size:8px!important}.standings-grid .team img{width:16px!important;height:16px!important;flex-basis:16px!important}.standings-grid>div{padding:7px 4px!important}.standings-foot{font-size:8px!important;padding:6px!important}
.team-header-name{font-size:15px!important}.team-logo{width:44px!important;height:44px!important;flex-basis:44px!important}.team-scorebook-head{min-height:54px!important}.section-collapse{width:38px!important;height:38px!important;flex-basis:38px!important}
.full-width-pitch .pitch-scroll{overscroll-behavior-x:contain!important}

/* Desktop mouse/keyboard affordances */
@media (hover:hover) and (pointer:fine){
 .unified-score-table .play-cell:hover{background:color-mix(in srgb,var(--selected) 34%,var(--panel))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 78%,transparent)}
 .player-cell:hover,.pos-cell:hover{background:color-mix(in srgb,var(--selected) 28%,var(--panel))!important;cursor:pointer}
 .team-scorebook-scroll::-webkit-scrollbar,.pitch-scroll::-webkit-scrollbar{height:10px}.team-scorebook-scroll::-webkit-scrollbar-thumb,.pitch-scroll::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--accent) 55%,transparent);border-radius:8px}
}

/* Tablet / compact laptop: 5–8 innings remain comfortably visible. */
@media(min-width:601px) and (max-width:1100px){
 main{max-width:100%!important;padding:10px 10px 40px!important}
 .unified-score-table{--ord-w:28px;--player-w:160px;--pos-w:40px;--inning-w:76px;--stat-w:58px;--head1-h:32px;--head2-h:30px;--row-h:54px;--total-h:33px;width:1430px!important;min-width:1430px!important}
 .unified-score-table .player-main{font-size:11px!important}.unified-score-table .player-subs{font-size:8.5px!important}.unified-score-table .play-code{font-size:10px!important}
 .full-width-pitch .pitch-table{min-width:900px!important}.pitch-table input{font-size:11px!important}
 .live-team span{font-size:10px}
}

/* Mobile: frozen lineup + ~3–4 large innings visible; no tiny text. */
@media(max-width:600px){
 :root{--livebar-h:44px}
 body{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
 main{padding:7px 6px 24px!important}
 .topbar{min-height:82px!important}.topbar h1{font-size:24px!important}.save-status{bottom:5px;font-size:9px}
 .top-action{font-size:12px!important}.top-icon,.top-action{min-height:44px!important}
 .game-field{grid-template-columns:32px minmax(0,1fr)!important;padding:9px 7px!important}.game-info-icon{width:30px!important;height:30px!important;font-size:20px!important}.game-field label{font-size:9px!important}.game-field input{height:38px!important;font-size:16px!important;min-width:0!important}
 .matchup-team{grid-template-columns:38px minmax(0,1fr)!important;gap:2px 5px!important}.matchup-team img{width:38px!important;height:38px!important}.matchup-label{font-size:8px!important}.matchup-team select{height:40px!important;font-size:16px!important;min-width:0!important}.versus-mark{font-size:12px!important}
 .overview-title,.card-title{min-height:40px!important;font-size:10px!important}.standings-head{height:30px!important;font-size:8px!important}.refresh-mini{width:28px!important;height:28px!important;font-size:13px!important}.standings-grid{font-size:7.2px!important}.standings-grid .head{font-size:6.5px!important}.standings-grid>div{padding:5px 2px!important}.standings-grid .team img{width:12px!important;height:12px!important;flex-basis:12px!important}.standings-foot{font-size:6.5px!important;padding:5px!important}
 .live-game-bar{grid-template-columns:1fr 82px 1fr;gap:5px;min-height:44px;margin:0 0 8px;padding:5px 7px;border-radius:10px}.live-team{display:grid;gap:0}.live-team.right{justify-items:end}.live-team strong{font-size:12px}.live-team span{font-size:7.5px}.live-team b{font-size:10px}.live-inning{min-width:0}.live-inning strong{font-size:11px}.live-inning small{font-size:7px}
 .team-scorebook{margin-bottom:12px!important;scroll-margin-top:52px}.team-scorebook-head{top:var(--livebar-h)!important;min-height:48px!important;padding:4px 7px!important}.team-logo{width:36px!important;height:36px!important;flex-basis:36px!important}.team-header-name{font-size:12px!important}.section-collapse{width:34px!important;height:34px!important;flex-basis:34px!important}
 .team-scorebook-scroll{scroll-padding-left:172px!important;scroll-snap-type:x proximity!important}
 .unified-score-table{--ord-w:24px;--player-w:112px;--pos-w:36px;--inning-w:54px;--stat-w:52px;--head1-h:31px;--head2-h:29px;--row-h:52px;--total-h:32px;width:1080px!important;min-width:1080px!important}
 .unified-score-table .score-head-primary th{font-size:9px!important}.unified-score-table .score-head-secondary th{font-size:8.5px!important}.unified-score-table .sticky-lineup-banner{font-size:9px!important;padding-left:5px!important}.unified-score-table .sticky-player{padding:3px 4px!important}.unified-score-table .player-main{font-size:10.5px!important;line-height:1.06!important}.unified-score-table .player-subs{font-size:8px!important;line-height:1.05!important}.unified-score-table .sticky-ord,.unified-score-table .sticky-pos,.unified-score-table .stat-cell{font-size:9px!important}
 .play-entry svg{inset:4px!important;width:calc(100% - 8px)!important;height:calc(100% - 8px)!important}.play-code{font-size:9.5px!important;right:3px!important;bottom:2px!important}.standalone-out{font-size:18px!important}.rbi-code{font-size:7px!important}.event-marker{height:11px!important;font-size:7px!important}
 .pane-title{height:34px!important;font-size:10px!important}.full-width-pitch .pitch-table{width:760px!important;min-width:760px!important}.pitch-table .pitcher-name{width:220px!important}.pitch-table th{height:30px!important;font-size:9px!important}.pitch-table td{height:42px!important}.pitch-table input{height:40px!important;font-size:16px!important;padding:3px 5px!important}
 .modal{place-items:end stretch!important;padding:0!important;background:rgba(0,0,0,.66)!important}.modal-card{width:100%!important;max-width:none!important;max-height:88dvh!important;margin:0!important;border-radius:20px 20px 0 0!important;padding:14px 12px calc(16px + env(safe-area-inset-bottom))!important;box-shadow:0 -14px 40px rgba(0,0,0,.38)!important}.modal-head{position:sticky;top:-14px;z-index:3;background:inherit;padding:10px 0}.modal-head button{min-width:44px;min-height:44px;font-size:28px!important}.modal label{font-size:10px!important}.modal input,.modal select{min-height:46px!important;font-size:16px!important}.small-btn,.modal-actions button,.settings-buttons button,.quick-plays button{min-height:44px!important;font-size:14px!important}.modal-actions{position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom));background:inherit;padding:10px 0 calc(12px + env(safe-area-inset-bottom));flex-wrap:wrap}.modal-actions button{flex:1 1 120px}.sub-row{grid-template-columns:60px minmax(100px,1fr) 48px 62px 48px 40px!important;overflow-x:auto}.setting-toggle{margin-top:12px!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;font-size:13px!important}.setting-toggle input{min-height:20px!important;width:20px!important}
 .mobile-action-bar{display:grid!important}
 body.focus-mode .topbar{display:none!important}
 body.focus-mode main{padding-top:5px!important}
 body.focus-mode .live-game-bar{top:0!important}
 body.focus-mode .team-scorebook-head{top:var(--livebar-h)!important}
 body.focus-mode .wrigley-footer,body.focus-mode .postseason-footer{display:none!important}
 body.theme-wrigley .game-info,body.theme-wrigley .matchup-selector,body.theme-wrigley .standings-overview,body.theme-wrigley .team-scorebook{padding:6px!important;background:var(--wrigley-ivy-v) left center/16px 88% no-repeat,var(--wrigley-ivy-v) right center/16px 88% no-repeat,var(--wrigley-brick-image) center/240px auto repeat!important}
 body.theme-wrigley .game-info::before,body.theme-wrigley .matchup-selector::before,body.theme-wrigley .standings-overview::before,body.theme-wrigley .team-scorebook::before,body.theme-wrigley .game-info::after,body.theme-wrigley .matchup-selector::after,body.theme-wrigley .standings-overview::after,body.theme-wrigley .team-scorebook::after{height:18px!important;background-size:auto 18px!important}
}
.mobile-action-bar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:110;grid-template-columns:repeat(4,1fr);padding:5px max(6px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));background:color-mix(in srgb,var(--panel2) 96%,#000);border-top:1px solid var(--line);box-shadow:0 -8px 22px rgba(0,0,0,.28)}
.mobile-action-bar button{min-height:52px;border:0;background:transparent;color:var(--text);display:grid;place-items:center;gap:1px;border-radius:10px}.mobile-action-bar button:active{background:color-mix(in srgb,var(--selected) 55%,transparent)}.mobile-action-bar button:disabled{opacity:.38}.mobile-action-bar span{font-size:20px;line-height:1}.mobile-action-bar small{font-size:9px;font-weight:800;color:var(--muted)}
.inning-transition{position:fixed;left:50%;top:18px;transform:translateX(-50%);z-index:160;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--accent);border-radius:12px;background:color-mix(in srgb,var(--panel2) 96%,#000);color:var(--text);box-shadow:0 12px 35px rgba(0,0,0,.35)}.inning-transition strong{color:var(--accent)}.inning-transition span{font-size:12px}.inning-transition button{width:30px;height:30px;border:0;border-radius:50%;background:rgba(255,255,255,.08);color:inherit}

/* Wrigley compatibility for active/sticky responsive states. */
body.theme-wrigley .live-game-bar{background:linear-gradient(180deg,#103721,#0b2d1c)!important;border-color:#887247!important}
body.theme-wrigley .unified-score-table .play-cell.active-inning-col,body.theme-wrigley .unified-score-table .active-inning-col{background:#124129!important}
body.theme-wrigley .unified-score-table .score-head-inning.active-inning-col{background:#1d5a35!important}
body.theme-wrigley .team-scorebook-head{backdrop-filter:blur(3px)}


/* ==========================================================
   v13 WRIGLEY REFINEMENT — approved ivy-bordered brick sections
   - removes overlapping/printed ivy assets
   - uses ivy-only section borders
   - brick lives in section wrappers only
   - score grids stay clean official-green
   - lighter selected-team highlight in standings
   ========================================================== */
body.theme-wrigley{
  --wrigley-green:#0f3b2e;
  --wrigley-green2:#0b2f24;
  --wrigley-green3:#143f31;
  --wrigley-cream:#f3ecd5;
  --wrigley-gold:#b99a60;
  --wrigley-line:#8d7948;
  --wrigley-brick-pattern:
    linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,.18)),
    linear-gradient(180deg,#8f5844 0 45%,#6f4031 45% 52%,#87513d 52% 97%,#66392c 97% 100%) 0 0/100% 28px repeat,
    linear-gradient(90deg,transparent 0 47%,rgba(93,51,37,.95) 47% 53%,transparent 53% 100%) 0 0/112px 56px repeat,
    linear-gradient(90deg,transparent 0 47%,rgba(93,51,37,.95) 47% 53%,transparent 53% 100%) 56px 28px/112px 56px repeat,
    linear-gradient(180deg,#8b5642,#6e3f31);
}
body.theme-wrigley .app-shell{
  background:linear-gradient(180deg,#12392d,#0b261f)!important;
}
body.theme-wrigley::before,
body.theme-wrigley::after{
  content:none!important;
  display:none!important;
}
body.theme-wrigley .topbar{
  background:
    linear-gradient(180deg,rgba(9,44,33,.92),rgba(9,44,33,.86)),
    var(--wrigley-brick-pattern)!important;
  border-bottom:1px solid var(--wrigley-line)!important;
  box-shadow:0 8px 18px rgba(0,0,0,.30)!important;
}
body.theme-wrigley .topbar h1{
  font-family:"Baskerville Old Face","Palatino Linotype","Book Antiqua","Goudy Old Style",Georgia,serif!important;
  font-size:clamp(30px,4.1vw,54px)!important;
  font-weight:700!important;
  letter-spacing:.02em!important;
}
body.theme-wrigley .top-icon,
body.theme-wrigley .top-action,
body.theme-wrigley .live-game-bar,
body.theme-wrigley .drawer,
body.theme-wrigley .modal-card{
  background:linear-gradient(180deg,var(--wrigley-green3),var(--wrigley-green2))!important;
  border-color:var(--wrigley-line)!important;
  color:var(--wrigley-cream)!important;
}

body.theme-wrigley .game-info,
body.theme-wrigley .matchup-selector,
body.theme-wrigley .standings-overview,
body.theme-wrigley .team-scorebook{
  position:relative!important;
  isolation:isolate!important;
  overflow:visible!important;
  margin-top:14px!important;
  padding:10px!important;
  border:1px solid rgba(103,69,48,.95)!important;
  border-radius:14px!important;
  background:var(--wrigley-brick-pattern)!important;
  box-shadow:0 10px 22px rgba(0,0,0,.28), inset 0 0 0 1px rgba(240,224,186,.08)!important;
}
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before{
  content:""!important;
  position:absolute!important;
  inset:-7px!important;
  border-radius:18px!important;
  z-index:0!important;
  pointer-events:none!important;
  opacity:.97!important;
  background:
    radial-gradient(ellipse at center,rgba(94,133,67,.98) 0 56%,transparent 61%) 0 0/26px 16px repeat-x,
    radial-gradient(ellipse at center,rgba(56,95,44,.98) 0 56%,transparent 61%) 13px 100%/26px 16px repeat-x,
    radial-gradient(ellipse at center,rgba(94,133,67,.98) 0 56%,transparent 61%) 0 0/16px 26px repeat-y,
    radial-gradient(ellipse at center,rgba(56,95,44,.98) 0 56%,transparent 61%) 100% 13px/16px 26px repeat-y;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.42))!important;
}
body.theme-wrigley .game-info::after,
body.theme-wrigley .matchup-selector::after,
body.theme-wrigley .standings-overview::after,
body.theme-wrigley .team-scorebook::after{
  content:""!important;
  position:absolute!important;
  inset:3px!important;
  border-radius:10px!important;
  border:1px solid rgba(244,230,188,.13)!important;
  z-index:0!important;
  pointer-events:none!important;
}
body.theme-wrigley .game-info > *,
body.theme-wrigley .matchup-selector > *,
body.theme-wrigley .standings-overview > *,
body.theme-wrigley .team-scorebook > *{
  position:relative!important;
  z-index:2!important;
}

body.theme-wrigley .game-field,
body.theme-wrigley .matchup-team,
body.theme-wrigley .overview-title,
body.theme-wrigley .standings-card,
body.theme-wrigley .team-scorebook-head,
body.theme-wrigley .team-scorebook-body,
body.theme-wrigley .matchup-selector .versus-mark{
  background:linear-gradient(180deg,var(--wrigley-green),var(--wrigley-green2))!important;
  border:1px solid var(--wrigley-line)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03)!important;
}
body.theme-wrigley .standings-card,
body.theme-wrigley .team-scorebook-body{overflow:hidden!important}
body.theme-wrigley .overview-title,
body.theme-wrigley .team-scorebook-head,
body.theme-wrigley .unified-score-table thead th,
body.theme-wrigley .unified-score-table .sticky-lineup-banner,
body.theme-wrigley .unified-score-table .sticky-totals-label,
body.theme-wrigley .unified-score-table .unified-totals-row td,
body.theme-wrigley .full-width-pitch .pane-title,
body.theme-wrigley .full-width-pitch .pitch-table th,
body.theme-wrigley .standings-grid .head,
body.theme-wrigley .standings-head{
  background:linear-gradient(180deg,var(--wrigley-green3),var(--wrigley-green2))!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley .team-scorebook-canvas,
body.theme-wrigley .team-left-stack,
body.theme-wrigley .lineup-pane,
body.theme-wrigley .pitch-pane,
body.theme-wrigley .scoring-pane,
body.theme-wrigley .lineup-only-table th,
body.theme-wrigley .lineup-only-table td,
body.theme-wrigley .scoring-only-table th,
body.theme-wrigley .scoring-only-table td,
body.theme-wrigley .pitch-table th,
body.theme-wrigley .pitch-table td,
body.theme-wrigley .unified-score-table,
body.theme-wrigley .unified-score-table th,
body.theme-wrigley .unified-score-table td,
body.theme-wrigley .full-width-pitch,
body.theme-wrigley .full-width-pitch .pitch-table td,
body.theme-wrigley .standings-grid > div,
body.theme-wrigley .standings-foot{
  background:#0f3b2e!important;
  color:var(--wrigley-cream)!important;
  border-color:var(--wrigley-line)!important;
}
body.theme-wrigley .unified-score-table tbody .sticky-ord,
body.theme-wrigley .unified-score-table tbody .sticky-player,
body.theme-wrigley .unified-score-table tbody .sticky-pos{
  background:#0f3b2e!important;
}
body.theme-wrigley .play-cell.active-inning-col,
body.theme-wrigley .unified-score-table .active-inning-col,
body.theme-wrigley .unified-score-table .score-head-inning.active-inning-col{
  background:#174c3b!important;
}
body.theme-wrigley .standings-selected{
  background:linear-gradient(90deg,rgba(208,215,124,.12),rgba(208,215,124,.22))!important;
  color:var(--wrigley-cream)!important;
  box-shadow:inset 3px 0 0 rgba(243,236,213,.36)!important;
  font-weight:900!important;
}
body.theme-wrigley .team-header-name,
body.theme-wrigley .overview-title strong{
  text-shadow:0 1px 1px rgba(0,0,0,.75)!important;
}
body.theme-wrigley .wrigley-footer{
  background:linear-gradient(180deg,#0d3429,#0b291f)!important;
  border-top:1px solid var(--wrigley-line)!important;
  box-shadow:none!important;
}
body.theme-wrigley .wrigley-footer::before{display:none!important}

@media (max-width:600px){
  body.theme-wrigley .topbar{min-height:78px!important}
  body.theme-wrigley .topbar h1{font-size:22px!important}
  body.theme-wrigley .top-action{font-size:10px!important;padding:0 8px!important}
  body.theme-wrigley .top-icon,body.theme-wrigley .top-action{min-height:40px!important}
  body.theme-wrigley .game-info,
  body.theme-wrigley .matchup-selector,
  body.theme-wrigley .standings-overview,
  body.theme-wrigley .team-scorebook{
    padding:8px!important;
    margin-top:12px!important;
  }
  body.theme-wrigley .game-info::before,
  body.theme-wrigley .matchup-selector::before,
  body.theme-wrigley .standings-overview::before,
  body.theme-wrigley .team-scorebook::before{
    inset:-5px!important;
    border-radius:15px!important;
    background:
      radial-gradient(ellipse at center,rgba(94,133,67,.96) 0 56%,transparent 61%) 0 0/20px 12px repeat-x,
      radial-gradient(ellipse at center,rgba(56,95,44,.96) 0 56%,transparent 61%) 10px 100%/20px 12px repeat-x,
      radial-gradient(ellipse at center,rgba(94,133,67,.96) 0 56%,transparent 61%) 0 0/12px 20px repeat-y,
      radial-gradient(ellipse at center,rgba(56,95,44,.96) 0 56%,transparent 61%) 100% 10px/12px 20px repeat-y!important;
  }
  body.theme-wrigley .game-field label{font-size:7.8px!important}
  body.theme-wrigley .game-field input{font-size:14px!important;height:34px!important}
  body.theme-wrigley .matchup-label{font-size:7px!important}
  body.theme-wrigley .matchup-team select{font-size:13px!important;height:36px!important}
  body.theme-wrigley .overview-title,.card-title{font-size:9px!important;min-height:36px!important}
  body.theme-wrigley .standings-head{font-size:7px!important;height:28px!important}
  body.theme-wrigley .standings-grid{font-size:6.4px!important}
  body.theme-wrigley .standings-grid .head{font-size:5.8px!important}
  body.theme-wrigley .standings-grid > div{padding:4px 2px!important}
  body.theme-wrigley .standings-grid .team img{width:10px!important;height:10px!important;flex-basis:10px!important}
  body.theme-wrigley .standings-foot{font-size:6px!important}
  body.theme-wrigley .team-header-name{font-size:11px!important}
  body.theme-wrigley .section-collapse{width:32px!important;height:32px!important;flex-basis:32px!important}
  body.theme-wrigley .unified-score-table{
    --player-w:102px;
    --inning-w:50px;
    --stat-w:46px;
    width:988px!important;
    min-width:988px!important;
  }
  body.theme-wrigley .unified-score-table .score-head-primary th{font-size:7.8px!important}
  body.theme-wrigley .unified-score-table .score-head-secondary th{font-size:7.3px!important}
  body.theme-wrigley .unified-score-table .sticky-lineup-banner{font-size:8px!important}
  body.theme-wrigley .unified-score-table .player-main{font-size:9.4px!important}
  body.theme-wrigley .unified-score-table .player-subs{font-size:7.2px!important}
  body.theme-wrigley .unified-score-table .sticky-ord,
  body.theme-wrigley .unified-score-table .sticky-pos,
  body.theme-wrigley .unified-score-table .stat-cell{font-size:8.2px!important}
  body.theme-wrigley .play-code{font-size:8.8px!important}
  body.theme-wrigley .pane-title{font-size:9px!important;height:32px!important}
  body.theme-wrigley .pitch-table th{font-size:8px!important}
  body.theme-wrigley .pitch-table input{font-size:13px!important;height:36px!important}
}

/* ==========================================================
   v15 BUG FIX + WRIGLEY POLISH
   ========================================================== */
body.theme-wrigley{
  --wrigley-ivy-clean-h:url("assets/theme/wrigley-ivy-clean-horizontal.png");
  --wrigley-ivy-clean-v:url("assets/theme/wrigley-ivy-clean-vertical.png");
}

/* Pure ivy artwork only — no scorecard/standings remnants in the border. */
body.theme-wrigley .game-info::before,
body.theme-wrigley .matchup-selector::before,
body.theme-wrigley .standings-overview::before,
body.theme-wrigley .team-scorebook::before{
  inset:-9px!important;
  border-radius:18px!important;
  opacity:1!important;
  background:
    var(--wrigley-ivy-clean-h) top center/auto 38px repeat-x,
    var(--wrigley-ivy-clean-h) bottom center/auto 38px repeat-x,
    var(--wrigley-ivy-clean-v) left center/38px auto repeat-y,
    var(--wrigley-ivy-clean-v) right center/38px auto repeat-y!important;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.46))!important;
}

/* Restore the team title bar that was being lost in the Wrigley mobile flow. */
body.theme-wrigley .team-scorebook-head{
  position:sticky!important;
  top:var(--livebar-h)!important;
  z-index:18!important;
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  min-width:0!important;
}
body.theme-wrigley .team-scorebook-name{min-width:0!important}
body.theme-wrigley .team-header-name{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

/* More reliable long-text fit across all mobile themes. */
@media(max-width:600px){
  .game-field input{
    font-size:12px!important;
    padding-inline:2px!important;
    letter-spacing:-.01em!important;
    text-overflow:clip!important;
  }
  .matchup-team select{
    font-size:10.5px!important;
    padding-left:1px!important;
    padding-right:16px!important;
    letter-spacing:-.015em!important;
  }
  .matchup-label{font-size:6.8px!important}
  body.theme-wrigley .game-field input{font-size:11.5px!important}
  body.theme-wrigley .matchup-team select{font-size:10px!important}
  body.theme-wrigley .team-scorebook-head{
    position:sticky!important;
    top:var(--livebar-h)!important;
    min-height:44px!important;
    padding:4px 6px!important;
    margin:0!important;
  }
  body.theme-wrigley .team-header-name{font-size:10px!important}
  body.theme-wrigley .team-logo{width:32px!important;height:32px!important;flex-basis:32px!important}
  body.theme-wrigley .game-info::before,
  body.theme-wrigley .matchup-selector::before,
  body.theme-wrigley .standings-overview::before,
  body.theme-wrigley .team-scorebook::before{
    inset:-6px!important;
    background:
      var(--wrigley-ivy-clean-h) top center/auto 26px repeat-x,
      var(--wrigley-ivy-clean-h) bottom center/auto 26px repeat-x,
      var(--wrigley-ivy-clean-v) left center/26px auto repeat-y,
      var(--wrigley-ivy-clean-v) right center/26px auto repeat-y!important;
  }
}

/* Make the scored base path clearly visible again. */
.play-entry svg line{
  vector-effect:non-scaling-stroke;
  filter:drop-shadow(0 0 1px rgba(0,0,0,.35));
}
body.theme-wrigley .play-entry svg line{
  filter:drop-shadow(0 0 1px rgba(255,255,255,.22));
}

/* Play Editor follows the currently selected theme instead of opening as a generic light card. */
.play-card{
  background:linear-gradient(180deg,var(--panel2),var(--panel))!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
  box-shadow:0 18px 50px rgba(0,0,0,.38)!important;
}
.play-card .modal-head{border-color:var(--line)!important}
.play-card .modal-head strong{color:var(--accent)!important}
.play-card .modal-head small,
.play-card .quick-label{color:var(--muted)!important}
.play-card .modal-head button{color:var(--text)!important}
.play-card label{color:var(--muted)!important}
.play-card input,
.play-card select{
  background:color-mix(in srgb,var(--panel) 90%,#000)!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}
.play-card .situation{
  background:color-mix(in srgb,var(--selected) 72%,var(--panel2))!important;
  color:var(--text)!important;
  border:1px solid var(--line)!important;
}
.play-card .quick-plays button,
.play-card .modal-actions button{
  background:color-mix(in srgb,var(--panel2) 82%,#fff 4%)!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}
.play-card .quick-plays button:active,
.play-card .modal-actions button:active{
  background:var(--selected)!important;
}
.play-card .modal-actions .primary{
  background:var(--accent)!important;
  color:#111!important;
  border-color:var(--accent)!important;
}
.play-card .modal-actions .danger{color:#ff8b83!important}
body.theme-wrigley .play-card{
  font-family:Georgia,"Times New Roman",serif!important;
  background:linear-gradient(180deg,#123f31,#0f3126)!important;
  border-color:var(--wrigley-gold)!important;
}
body.theme-wrigley .play-card .situation{
  background:linear-gradient(180deg,#174c3b,#123b2f)!important;
  border-color:var(--wrigley-line)!important;
}
body.theme-wrigley .play-card .quick-plays button,
body.theme-wrigley .play-card .modal-actions button,
body.theme-wrigley .play-card input,
body.theme-wrigley .play-card select{
  background:#0d3026!important;
  border-color:var(--wrigley-line)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley .play-card .modal-actions .primary{
  background:var(--wrigley-gold)!important;
  color:#102117!important;
}
body.theme-wrigley.dark-mode .play-card{
  background:linear-gradient(180deg,#081d16,#06150f)!important;
  border-color:#6d5c39!important;
}
body.theme-wrigley.dark-mode .play-card .situation,
body.theme-wrigley.dark-mode .play-card .quick-plays button,
body.theme-wrigley.dark-mode .play-card .modal-actions button,
body.theme-wrigley.dark-mode .play-card input,
body.theme-wrigley.dark-mode .play-card select{
  background:#071a13!important;
}

/* Shorter mobile action bar with a definite safe area above it. */
@media(max-width:600px){
  body{padding-bottom:calc(54px + env(safe-area-inset-bottom))!important}
  .mobile-action-bar{
    padding-top:3px!important;
    padding-bottom:calc(3px + env(safe-area-inset-bottom))!important;
  }
  .mobile-action-bar button{min-height:44px!important}
  .mobile-action-bar span{font-size:18px!important}
  .mobile-action-bar small{font-size:8px!important}
  main{padding-bottom:34px!important}
}


/* ==========================================================
   v15 RESTORED APPROVED PLAY-PATH LOGIC
   ========================================================== */
.team-scorebook-scroll{scroll-snap-type:none!important;scroll-behavior:auto!important;overscroll-behavior-x:contain!important}
.play-entry .diamond{overflow:visible!important}
.play-entry .diamond-fill{stroke:none}
.play-entry .base{stroke:transparent;stroke-width:2.2;vector-effect:non-scaling-stroke}
.play-entry .base.origin,.play-entry .base.advance{stroke:#f1f3ef;stroke-width:4.1;stroke-linecap:round;vector-effect:non-scaling-stroke}
.play-entry .runner-out-path{stroke:#ef554f!important;stroke-width:4.5!important;stroke-linecap:round;vector-effect:non-scaling-stroke;filter:none!important}
.play-entry .runner-out-mark{stroke:#ef554f!important;stroke-width:4.2!important;stroke-linecap:round;vector-effect:non-scaling-stroke;filter:none!important}
.play-entry .runner-out-label{fill:#ef554f;stroke:rgba(5,17,25,.92);stroke-width:2.1px;paint-order:stroke fill;font-size:7px;font-weight:950;text-anchor:middle;dominant-baseline:middle}
.play-entry .advance-reason-label{fill:#f5f2ea;stroke:rgba(4,15,12,.94);stroke-width:2px;paint-order:stroke fill;font-size:7px;font-weight:950;text-anchor:middle;dominant-baseline:middle}
.play-entry.scored .diamond-fill{fill:#4aaa5e!important;fill-opacity:.78!important}
body.theme-wrigley .play-entry .base.origin,body.theme-wrigley .play-entry .base.advance{stroke:#f1e6c8!important}
body.theme-custom:not(.dark-mode) .play-entry .base.origin,body.theme-custom:not(.dark-mode) .play-entry .base.advance{stroke:#f5f2ea!important}
body.theme-postseason .play-entry .base.origin,body.theme-postseason .play-entry .base.advance{stroke:#f4efe4!important}
.play-entry.runner-out .play-code{color:var(--text)!important}
.runner-out-fields{margin:10px 0 2px;padding:10px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--panel2) 80%,#000 8%)}
.runner-out-title{margin-bottom:8px;color:#ef746e;font-size:9px;font-weight:950;letter-spacing:.12em}
.runner-out-count{margin:3px 0 0!important}
.play-card .runner-out-fields input,.play-card .runner-out-fields select{min-height:42px}
body.theme-wrigley .runner-out-fields{border-color:var(--wrigley-line)!important;background:linear-gradient(180deg,#123f31,#0c2d23)!important}
body.theme-wrigley .runner-out-title{color:#ef736d!important}
@media(max-width:600px){
 .play-entry .runner-out-label,.play-entry .advance-reason-label{font-size:6.4px!important;stroke-width:1.8px!important}
 .play-entry .base.origin,.play-entry .base.advance{stroke-width:3.5!important}
 .play-entry .runner-out-path{stroke-width:4!important}.play-entry .runner-out-mark{stroke-width:3.8!important}
 .runner-out-fields{padding:8px;margin-top:8px}
}


/* ==========================================================
   v16 — restore approved scoring marks and freeze score position
   ========================================================== */
main,.team-scorebook,.team-scorebook-body,.team-scorebook-scroll,.unified-score-table{overflow-anchor:none!important}
.team-scorebook-scroll{scroll-snap-type:none!important;scroll-behavior:auto!important}
.unified-score-table .score-head-inning{scroll-snap-align:none!important}
.play-entry .diamond{overflow:visible!important}
.play-entry .diamond-fill{stroke:none!important}
.play-entry .base{stroke:transparent!important;stroke-width:2.15!important;vector-effect:non-scaling-stroke}
.play-entry .base.origin,.play-entry .base.advance{
  stroke:#111!important;stroke-width:4.7!important;stroke-linecap:round!important;vector-effect:non-scaling-stroke;
  filter:drop-shadow(0 0 .7px rgba(245,239,220,.62));
}
.play-entry .advance-reason-label{
  fill:#111!important;stroke:#f8f5e9!important;stroke-width:2.2px!important;paint-order:stroke fill!important;
  font-size:7px!important;font-weight:950!important;text-anchor:middle!important;dominant-baseline:middle!important;
}
.play-entry .runner-out-path{
  stroke:#d83a34!important;stroke-width:5!important;stroke-linecap:round!important;vector-effect:non-scaling-stroke!important;filter:none!important
}
.play-entry .runner-out-mark{
  stroke:#d83a34!important;stroke-width:4.6!important;stroke-linecap:round!important;vector-effect:non-scaling-stroke!important;filter:none!important
}
.play-entry .runner-out-label{
  fill:#d83a34!important;stroke:#fff!important;stroke-width:2.4px!important;paint-order:stroke fill!important;
  font-size:7px!important;font-weight:950!important;text-anchor:middle!important;dominant-baseline:middle!important
}
.play-entry .play-code,.play-entry.runner-out .play-code{
  color:#111!important;text-shadow:0 0 1px rgba(248,245,233,.78)!important
}
.play-entry.out .play-code,.standalone-out{color:#d83a34!important;text-shadow:none!important}
.play-entry.scored .diamond-fill{fill:#43b86a!important;fill-opacity:.82!important}
#advanceReasonField.hidden{display:none!important}
@media(max-width:600px){
 .play-entry .base.origin,.play-entry .base.advance{stroke-width:4.2!important}
 .play-entry .runner-out-path{stroke-width:4.5!important}.play-entry .runner-out-mark{stroke-width:4.2!important}
 .play-entry .advance-reason-label,.play-entry .runner-out-label{font-size:6.5px!important}
}


/* ==========================================================
   v17 VISUAL REFINEMENT ONLY
   - no layout/logic/function changes
   - improves score-grid contrast
   - makes subthemes more visually distinct
   - refines drawer/menu presentation
   - makes dark mode intentionally different
   ========================================================== */

/* ---------- Visual tokens for scorekeeping contrast ---------- */
body{
  --score-grid-bg:var(--panel);
  --score-grid-bg2:var(--panel2);
  --score-grid-head:var(--panel2);
  --score-grid-line:var(--line);
  --score-grid-sticky:var(--panel);
  --score-mark:#f5f2ea;
  --score-mark-outline:rgba(5,13,21,.92);
  --score-mark-text:#f5f2ea;
  --score-note:#f5f2ea;
  --score-out:#d94a43;
  --score-run:#45bb69;
  --score-col-highlight:rgba(255,255,255,.06);
  --score-col-head-highlight:rgba(255,255,255,.10);
}

/* ---------- Drawer / menu refinement ---------- */
.drawer{
  backdrop-filter:blur(14px);
  box-shadow:12px 0 28px rgba(0,0,0,.26);
}
.drawer-head{
  padding:6px 0 14px;
}
.drawer-head strong{
  font-size:22px;
  letter-spacing:.02em;
}
.drawer-head button{
  width:38px;height:38px;border-radius:10px;border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);color:inherit;
}
.drawer-label{
  font-size:9px;
  letter-spacing:.16em;
  opacity:.86;
}
.drawer-nav,.theme-choice,.drawer-tools>button,.import-button{
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  min-height:54px;
  padding:8px 10px;
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}
.drawer-nav span:nth-child(2),.drawer-tools>button span:nth-child(2),.import-button span:nth-child(2){font-weight:850}
.drawer-nav.active,.theme-choice.active{
  box-shadow:0 10px 18px rgba(0,0,0,.18), inset 0 0 0 1px color-mix(in srgb,var(--accent) 56%, transparent);
}
.theme-choice{grid-template-columns:52px minmax(0,1fr) 22px;gap:10px}
.theme-choice strong{font-size:11px;letter-spacing:.02em}
.theme-choice small{font-size:7.4px;line-height:1.2;color:color-mix(in srgb,var(--text) 65%, #8da0b3 35%)}
.theme-check{font-size:16px;font-weight:950}
.theme-swatch{
  width:46px;height:46px;border-radius:12px;display:block;position:relative;overflow:hidden;
  border:1px solid rgba(255,255,255,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.04), 0 6px 14px rgba(0,0,0,.18);
}
.theme-swatch::after{
  content:'';position:absolute;inset:auto 0 0 0;height:13px;
  background:linear-gradient(90deg,rgba(255,255,255,.14),rgba(255,255,255,0));
}
.custom-swatch{background:linear-gradient(135deg,#0c2944 0 50%,#173a58 50% 72%,#d1b375 72%)}
.wrigley-swatch{background:linear-gradient(135deg,#103825 0 50%,#154730 50% 72%,#8d5840 72%)}
.playoff-swatch{background:linear-gradient(135deg,#041427 0 52%,#091f36 52% 74%,#e0af4f 74%)}
.theme-sub{
  margin:8px 4px 12px 18px;
  padding:10px 10px 10px 12px;
  border-left:none;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  background:rgba(0,0,0,.16);
}
.theme-sub label{gap:6px;font-size:8.2px;letter-spacing:.11em}
.theme-sub select,.theme-sub input[type=color]{
  min-height:38px;border:1px solid rgba(255,255,255,.16);border-radius:10px;
  background:rgba(5,17,26,.82);box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.theme-sub select{padding:0 10px}
.color-row{gap:10px;margin-bottom:10px}
.color-row label{gap:6px}
.color-row input[type=color]{padding:3px;background:rgba(5,17,26,.82)}

/* ---------- Score grid readability across all themes ---------- */
.unified-score-table,
.unified-score-table td,
.unified-score-table th,
.full-width-pitch .pitch-table td,
.full-width-pitch .pitch-table th{
  border-color:var(--score-grid-line)!important;
}
.unified-score-table td,
.full-width-pitch .pitch-table td{
  background:var(--score-grid-bg)!important;
}
.unified-score-table thead th,
.unified-score-table .sticky-lineup-banner,
.unified-score-table .sticky-totals-label,
.unified-score-table .unified-totals-row td,
.full-width-pitch .pane-title,
.full-width-pitch .pitch-table th,
.team-scorebook-head,
.overview-title,
.standings-head,
.standings-grid .head,
.live-game-bar{
  background:var(--score-grid-head)!important;
  border-color:var(--score-grid-line)!important;
}
.unified-score-table tbody .sticky-ord,
.unified-score-table tbody .sticky-player,
.unified-score-table tbody .sticky-pos,
.full-width-pitch,
.standings-grid>div,
.standings-foot{
  background:var(--score-grid-sticky)!important;
  border-color:var(--score-grid-line)!important;
}
.unified-score-table .play-cell.active-inning-col,
.unified-score-table .active-inning-col{
  background:color-mix(in srgb,var(--score-grid-bg) 86%, white 14%)!important;
}
.unified-score-table .score-head-inning.active-inning-col{
  background:color-mix(in srgb,var(--score-grid-head) 78%, white 22%)!important;
}
.play-entry .base.origin,.play-entry .base.advance{
  stroke:var(--score-mark)!important;
  filter:drop-shadow(0 0 1px rgba(0,0,0,.28));
}
.play-entry .advance-reason-label{
  fill:var(--score-note)!important;
  stroke:var(--score-mark-outline)!important;
}
.play-entry .play-code,
.play-entry.runner-out .play-code{
  color:var(--score-mark-text)!important;
  text-shadow:0 0 1px rgba(0,0,0,.42)!important;
}
.play-entry .runner-out-path,
.play-entry .runner-out-mark{
  stroke:var(--score-out)!important;
}
.play-entry .runner-out-label,
.play-entry.out .play-code,
.standalone-out{
  fill:var(--score-out)!important;
  color:var(--score-out)!important;
}
.play-entry .runner-out-label{
  stroke:#fff!important;
}
.play-entry.scored .diamond-fill{fill:var(--score-run)!important;fill-opacity:.84!important}
.rbi-code{color:var(--score-run)!important;text-shadow:0 0 1px rgba(0,0,0,.35)!important}
.event-marker{background:color-mix(in srgb,var(--score-mark) 16%, #000)!important;color:var(--score-mark)!important}

/* ---------- Default theme / subthemes ---------- */
body.theme-custom{
  --score-grid-bg:color-mix(in srgb,var(--custom-bg) 78%, #041422 22%);
  --score-grid-sticky:color-mix(in srgb,var(--custom-bg) 84%, #061729 16%);
  --score-grid-head:color-mix(in srgb,var(--custom-panel2) 74%, var(--custom-accent) 8%);
  --score-grid-line:color-mix(in srgb,var(--custom-accent) 54%, #56708a 46%);
  --score-mark:#f7f4eb;
  --score-mark-text:#f7f4eb;
  --score-note:#f7f4eb;
  --score-mark-outline:rgba(7,16,29,.95);
  --score-run:#4fc672;
  --score-out:#f05a4f;
}
body.theme-custom .topbar h1{letter-spacing:.01em}
body.theme-custom.custom-modern{
  --score-grid-head:linear-gradient(180deg,#133056,#10284a);
}
body.theme-custom.custom-modern .topbar{
  background:linear-gradient(180deg,#0d2c49,#0a223a)!important;
}
body.theme-custom.custom-modern .card,
body.theme-custom.custom-modern .drawer-nav,
body.theme-custom.custom-modern .theme-choice{box-shadow:none}
body.theme-custom.custom-modern .team-header-name,
body.theme-custom.custom-modern .overview-title strong,
body.theme-custom.custom-modern .topbar h1{font-family:Inter,system-ui,sans-serif!important}

body.theme-custom.custom-classic{
  --score-grid-bg:#0d2842;
  --score-grid-sticky:#102d49;
  --score-grid-head:linear-gradient(180deg,#183655,#112b44);
  --score-grid-line:#7a8ea0;
  --score-mark:#f3ead8;
  --score-mark-text:#f3ead8;
}
body.theme-custom.custom-classic .app-shell{
  background:linear-gradient(180deg,#0a2237,#081a2e)!important;
}
body.theme-custom.custom-classic .topbar,
body.theme-custom.custom-classic .team-scorebook-head,
body.theme-custom.custom-classic .overview-title{
  background:linear-gradient(180deg,#183656,#112941)!important;
}
body.theme-custom.custom-classic .team-header-name,
body.theme-custom.custom-classic .overview-title strong,
body.theme-custom.custom-classic .topbar h1{
  font-family:Georgia,"Times New Roman",serif!important;
}
body.theme-custom.custom-classic .card{box-shadow:0 8px 20px rgba(0,0,0,.15), inset 0 0 0 1px rgba(243,234,216,.04)}

body.theme-custom.custom-heritage{
  --score-grid-bg:#103142;
  --score-grid-sticky:#123749;
  --score-grid-head:linear-gradient(180deg,#1c3c4e,#173448);
  --score-grid-line:#8f7a55;
  --score-mark:#f1e3c3;
  --score-mark-text:#f1e3c3;
  --score-run:#55c77a;
}
body.theme-custom.custom-heritage .app-shell{
  background:
    linear-gradient(180deg,rgba(199,163,93,.06),rgba(199,163,93,0) 22%),
    linear-gradient(180deg,#0f2a39,#0a1f2f)!important;
}
body.theme-custom.custom-heritage .topbar{
  background:linear-gradient(180deg,#173446,#102839)!important;
}
body.theme-custom.custom-heritage .team-header-name,
body.theme-custom.custom-heritage .overview-title strong,
body.theme-custom.custom-heritage .topbar h1{
  font-family:Georgia,"Times New Roman",serif!important;
  letter-spacing:.02em;
}
body.theme-custom.custom-heritage .card{
  box-shadow:0 8px 22px rgba(0,0,0,.17), inset 0 0 0 1px rgba(241,227,195,.05);
}

/* true dark for default theme */
body.theme-custom.dark-mode{
  --custom-bg:#04101b;--custom-bg2:#020910;--custom-panel:#071627;--custom-panel2:#0b1e34;--custom-line:#39506d;
  --custom-text:#eef2f5;--custom-selected:#172742;
  --score-grid-bg:#041225;
  --score-grid-sticky:#06152b;
  --score-grid-head:linear-gradient(180deg,#0a1f3a,#07182f);
  --score-grid-line:#436084;
  --score-mark:#f8f5ed;
  --score-mark-text:#f8f5ed;
  --score-note:#f8f5ed;
  --score-mark-outline:rgba(4,10,18,.96);
}
body.theme-custom.dark-mode .app-shell{background:linear-gradient(180deg,#031019,#02070d)!important}
body.theme-custom.dark-mode .topbar{background:linear-gradient(180deg,#081a2e,#061220)!important}
body.theme-custom.dark-mode .drawer{background:linear-gradient(180deg,#09162a,#060f1f)!important}
body.theme-custom.dark-mode .modal-card{background:#0a1525!important;border-color:#365173!important}

/* ---------- Wrigley subthemes ---------- */
body.theme-wrigley{
  --score-grid-bg:#0f3b2e;
  --score-grid-sticky:#0f3b2e;
  --score-grid-head:linear-gradient(180deg,#184c38,#123d2f);
  --score-grid-line:#8f7a4e;
  --score-mark:#f3e6c8;
  --score-mark-text:#f3e6c8;
  --score-note:#f3e6c8;
  --score-mark-outline:rgba(7,17,10,.94);
  --score-run:#53c277;
  --score-out:#df4b43;
}
body.theme-wrigley.wrigley-scoreboard .topbar{
  background:
    linear-gradient(90deg,rgba(4,21,12,.82),rgba(8,42,23,.54),rgba(4,21,12,.84)),
    url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important;
}
body.theme-wrigley.wrigley-scoreboard .game-info,
body.theme-wrigley.wrigley-scoreboard .matchup-selector,
body.theme-wrigley.wrigley-scoreboard .standings-overview,
body.theme-wrigley.wrigley-scoreboard .team-scorebook{box-shadow:0 10px 22px rgba(0,0,0,.22), inset 0 0 0 1px rgba(243,230,200,.04)}

body.theme-wrigley.wrigley-ivybrick{
  --score-grid-bg:#0c3a2a;
  --score-grid-sticky:#0c3a2a;
  --score-grid-head:linear-gradient(180deg,#144734,#103b2d);
  --score-grid-line:#90734f;
  --score-mark:#efe1c2;
}
body.theme-wrigley.wrigley-ivybrick .game-info,
body.theme-wrigley.wrigley-ivybrick .matchup-selector,
body.theme-wrigley.wrigley-ivybrick .standings-overview,
body.theme-wrigley.wrigley-ivybrick .team-scorebook{
  background:
    linear-gradient(rgba(15,59,46,.05),rgba(15,59,46,.05)),
    var(--wrigley-brick-pattern)!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info::before,
body.theme-wrigley.wrigley-ivybrick .matchup-selector::before,
body.theme-wrigley.wrigley-ivybrick .standings-overview::before,
body.theme-wrigley.wrigley-ivybrick .team-scorebook::before{opacity:1!important;filter:drop-shadow(0 2px 4px rgba(0,0,0,.38))}

body.theme-wrigley.wrigley-night{
  --score-grid-bg:#081f18;
  --score-grid-sticky:#081f18;
  --score-grid-head:linear-gradient(180deg,#0f2e24,#0a221b);
  --score-grid-line:#9c8658;
  --score-mark:#fbf2dc;
  --score-mark-text:#fbf2dc;
  --score-note:#fbf2dc;
  --score-run:#5fd986;
}
body.theme-wrigley.wrigley-night .app-shell{
  background:
    radial-gradient(circle at 50% 0,rgba(126,173,132,.09),transparent 28%),
    linear-gradient(180deg,#06110d,#040906)!important;
}
body.theme-wrigley.wrigley-night .topbar{filter:none!important;background:linear-gradient(180deg,rgba(3,12,8,.9),rgba(6,19,14,.82)),url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important}
body.theme-wrigley.wrigley-night .team-scorebook-head,
body.theme-wrigley.wrigley-night .overview-title,
body.theme-wrigley.wrigley-night .live-game-bar{box-shadow:inset 0 0 0 1px rgba(252,242,220,.04)}

body.theme-wrigley.dark-mode{
  --bg:#030906;--panel:#07130e;--panel2:#0b1d16;--line:#415045;
  --score-grid-bg:#071a13;
  --score-grid-sticky:#071a13;
  --score-grid-head:linear-gradient(180deg,#0b241c,#081914);
  --score-grid-line:#8d774b;
  --score-mark:#fdf3dc;
  --score-mark-text:#fdf3dc;
  --score-note:#fdf3dc;
}
body.theme-wrigley.dark-mode .drawer{background:linear-gradient(180deg,#081711,#06110d)!important}
body.theme-wrigley.dark-mode .modal-card{background:#0a1711!important;border-color:#556652!important;color:#f7f1df!important}

/* ---------- Postseason rounds ---------- */
body.theme-postseason{
  --score-grid-bg:#06182c;
  --score-grid-sticky:#06182c;
  --score-grid-head:linear-gradient(180deg,#0b2641,#061b31);
  --score-grid-line:#a17536;
  --score-mark:#f5f0e5;
  --score-mark-text:#f5f0e5;
  --score-note:#f5f0e5;
  --score-mark-outline:rgba(3,8,14,.95);
  --score-run:#56ca79;
  --score-out:#f1584d;
}
body.theme-postseason .topbar h1,
body.theme-postseason .team-header-name,
body.theme-postseason .overview-title strong{letter-spacing:.02em}
body.theme-postseason.playoff-wild-card{
  --score-grid-bg:#0b2033;
  --score-grid-sticky:#0b2033;
  --score-grid-head:linear-gradient(180deg,#173149,#11263c);
  --score-grid-line:#8ea0b5;
  --score-mark:#eef4f8;
  --score-mark-text:#eef4f8;
}
body.theme-postseason.playoff-wild-card .topbar{box-shadow:inset 0 -1px 0 rgba(142,160,181,.24)}

body.theme-postseason.playoff-division-series{
  --score-grid-bg:#07192d;
  --score-grid-sticky:#07192d;
  --score-grid-head:linear-gradient(180deg,#102845,#0a2037);
  --score-grid-line:#b28641;
  --score-mark:#f8f0de;
}
body.theme-postseason.playoff-division-series .topbar{background:linear-gradient(180deg,#07172a,#05111f)!important}

body.theme-postseason.playoff-championship-series{
  --score-grid-bg:#0d1a2f;
  --score-grid-sticky:#0d1a2f;
  --score-grid-head:linear-gradient(90deg,#17263b,#3b2028,#17263b);
  --score-grid-line:#b87e58;
  --score-mark:#f7efe4;
  --score-mark-text:#f7efe4;
}
body.theme-postseason.playoff-championship-series .team-header-name,
body.theme-postseason.playoff-championship-series .overview-title strong,
body.theme-postseason.playoff-championship-series .topbar h1{font-family:Georgia,"Times New Roman",serif!important}

body.theme-postseason.playoff-world-series{
  --score-grid-bg:#071423;
  --score-grid-sticky:#071423;
  --score-grid-head:linear-gradient(180deg,#10243b,#0a1828);
  --score-grid-line:#d0a458;
  --score-mark:#fff7e4;
  --score-mark-text:#fff7e4;
  --score-run:#61d786;
}
body.theme-postseason.playoff-world-series .topbar{background:linear-gradient(180deg,#0a1523,#040a12)!important}
body.theme-postseason.playoff-world-series .team-scorebook-head,
body.theme-postseason.playoff-world-series .overview-title,
body.theme-postseason.playoff-world-series .live-game-bar{box-shadow:inset 0 0 0 1px rgba(255,247,228,.06)}

body.theme-postseason.dark-mode{
  --score-grid-bg:#040f1c;
  --score-grid-sticky:#040f1c;
  --score-grid-head:linear-gradient(180deg,#08182c,#05111f);
  --score-grid-line:#8b6a34;
  --score-mark:#fcf6ea;
  --score-mark-text:#fcf6ea;
  --score-note:#fcf6ea;
}
body.theme-postseason.dark-mode .app-shell{background:radial-gradient(circle at 50% 0,rgba(225,177,88,.10),transparent 24%),linear-gradient(180deg,#020911,#01050a)!important}
body.theme-postseason.dark-mode .drawer{background:linear-gradient(180deg,#081222,#050d19)!important}
body.theme-postseason.dark-mode .modal-card{background:#08111d!important;border-color:#6d5427!important;color:#f7f3ea!important}

/* theme-aware modal/editor refinement */
body.theme-custom .modal-card,
body.theme-custom .situation{box-shadow:0 10px 22px rgba(0,0,0,.18)}
body.theme-wrigley .play-card .situation,
body.theme-wrigley .settings-card .settings-section h3,
body.theme-wrigley .modal-head strong{color:#f2e6c9!important}
body.theme-wrigley .play-card .situation{background:linear-gradient(180deg,#184a39,#10372b)!important}
body.theme-postseason .play-card .situation,
body.theme-postseason .settings-card .settings-section h3,
body.theme-postseason .modal-head strong{color:#f2dca8!important}
body.theme-postseason .play-card .situation{background:linear-gradient(180deg,#102846,#0a2037)!important}

/* stronger mobile drawer / menu appearance without changing structure */
@media(max-width:600px){
  .drawer{width:min(304px,84vw)}
  .drawer-head strong{font-size:20px}
  .drawer-nav,.theme-choice,.drawer-tools>button,.import-button{min-height:48px;padding:7px 8px}
  .theme-choice{grid-template-columns:44px minmax(0,1fr) 20px;gap:8px}
  .theme-swatch{width:40px;height:40px;border-radius:10px}
  .theme-sub{margin-left:10px;padding:9px 9px 9px 10px}
  .theme-sub select,.theme-sub input[type=color]{min-height:35px}
}


/* ==========================================================
   v18 POLISH REFINEMENT
   - quick access clear action
   - uppercase visual treatment for all name fields
   ========================================================== */
.name-input,
#starterName,
.pitch-table .pitcher-name input{
  text-transform:uppercase!important;
}
.mobile-action-bar{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  box-shadow:0 -10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.04);
}
.mobile-action-bar button{
  position:relative;
}
.mobile-action-bar button span{transition:transform .16s ease}
.mobile-action-bar button:active span{transform:scale(.94)}
.mobile-action-bar .danger-quick small,
.mobile-action-bar .danger-quick span{
  color:#e36d66!important;
}
.mobile-action-bar .danger-quick{
  background:linear-gradient(180deg,rgba(211,75,68,.10),rgba(211,75,68,.02))!important;
  border-left:1px solid rgba(211,75,68,.18);
  border-right:1px solid rgba(211,75,68,.18);
}
.settings-buttons #clearGameBtn{
  color:#b63f39!important;
  border-color:rgba(182,63,57,.35)!important;
  background:linear-gradient(180deg,rgba(182,63,57,.08),rgba(182,63,57,.02))!important;
}
body.theme-wrigley .mobile-action-bar .danger-quick{
  background:linear-gradient(180deg,rgba(210,93,79,.12),rgba(210,93,79,.03))!important;
}
body.theme-postseason .mobile-action-bar .danger-quick{
  background:linear-gradient(180deg,rgba(221,87,73,.11),rgba(221,87,73,.02))!important;
}
@media(max-width:600px){
  .mobile-action-bar small{font-size:7.6px!important}
  .mobile-action-bar span{font-size:17px!important}
  .mobile-action-bar button{min-height:46px!important}
}


/* ==========================================================
   v19 THEME + DARK MODE POLISH ONLY
   No scorecard structure, scoring geometry, scrolling, or game logic changes.
   ========================================================== */

/* ---------- Shared menu polish ---------- */
.drawer-section{position:relative}
.drawer-section+.drawer-section::before{
  content:'';position:absolute;left:4px;right:4px;top:0;height:1px;
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--accent) 24%,transparent),transparent);
}
.drawer-label{display:flex;align-items:center;gap:7px}
.drawer-label::after{content:'';height:1px;flex:1;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 28%,transparent),transparent)}
.theme-choice{position:relative;overflow:hidden}
.theme-choice::before{
  content:'';position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;
  background:transparent;transition:background .18s ease,box-shadow .18s ease;
}
.theme-choice.active::before{background:var(--accent);box-shadow:0 0 12px color-mix(in srgb,var(--accent) 52%,transparent)}
.theme-sub select{font-weight:850;color:var(--text)}
.drawer-tools>button,.import-button{transition:transform .14s ease,background .14s ease,border-color .14s ease}
@media(hover:hover) and (pointer:fine){
  .drawer-nav:hover,.theme-choice:hover,.drawer-tools>button:hover,.import-button:hover{transform:translateX(2px);background:rgba(255,255,255,.065)}
}

/* ---------- Dark-mode control should visibly read as active ---------- */
body.dark-mode #darkBtn{
  border-color:color-mix(in srgb,var(--accent) 75%,#fff 25%)!important;
  background:color-mix(in srgb,var(--panel2) 82%,#fff 5%)!important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent),0 0 18px color-mix(in srgb,var(--accent) 13%,transparent)!important;
}
body.dark-mode .topbar{filter:none!important}
body.dark-mode .card,
body.dark-mode .team-left-stack,
body.dark-mode .lineup-pane,
body.dark-mode .pitch-pane,
body.dark-mode .scoring-pane{filter:none!important}

/* ---------- DEFAULT: stronger subtheme identities ---------- */
body.theme-custom.custom-modern:not(.dark-mode){
  --custom-bg:#e8edf3;--custom-bg2:#dfe6ee;--custom-panel:#f8fafc;--custom-panel2:#e8eef5;--custom-line:#70849a;
  --custom-text:#142538;--custom-selected:#d5e1ed;
  --score-grid-bg:#f8fafc;--score-grid-sticky:#f4f7fa;--score-grid-head:linear-gradient(180deg,#e8eef5,#dde7f0);
  --score-grid-line:#8ea0b2;--score-mark:#17202a;--score-mark-text:#17202a;--score-note:#17202a;--score-mark-outline:#fff;
  --score-out:#c83e38;--score-run:#2c9953;
}
body.theme-custom.custom-modern:not(.dark-mode) .app-shell{background:linear-gradient(180deg,#edf2f7,#e0e7ef)!important}
body.theme-custom.custom-modern:not(.dark-mode) .topbar{background:linear-gradient(180deg,#16334e,#102a43)!important;color:#fff}
body.theme-custom.custom-modern:not(.dark-mode) .team-scorebook,
body.theme-custom.custom-modern:not(.dark-mode) .standings-overview,
body.theme-custom.custom-modern:not(.dark-mode) .game-info,
body.theme-custom.custom-modern:not(.dark-mode) .matchup-selector{box-shadow:0 8px 20px rgba(20,37,56,.08)!important}
body.theme-custom.custom-modern:not(.dark-mode) .play-entry .runner-out-label{stroke:#fff!important}

body.theme-custom.custom-classic:not(.dark-mode){
  --custom-bg:#0c263e;--custom-bg2:#091d31;--custom-panel:#102e49;--custom-panel2:#173b5c;--custom-line:#b49a67;
  --custom-text:#f1eadb;--custom-selected:#263e55;
  --score-grid-bg:#102d47;--score-grid-sticky:#102d47;--score-grid-head:linear-gradient(180deg,#193b5b,#122f49);
  --score-grid-line:#a78e61;--score-mark:#f5ead2;--score-mark-text:#f5ead2;--score-note:#f5ead2;
}
body.theme-custom.custom-classic:not(.dark-mode) .app-shell{background:linear-gradient(180deg,#0f2b44,#091c2f)!important}
body.theme-custom.custom-classic:not(.dark-mode) .topbar{background:linear-gradient(180deg,#173957,#102c46)!important;border-bottom-color:#a78e61!important}
body.theme-custom.custom-classic:not(.dark-mode) .team-scorebook-head,
body.theme-custom.custom-classic:not(.dark-mode) .overview-title{border-bottom-color:#a78e61!important}

body.theme-custom.custom-heritage:not(.dark-mode){
  --custom-bg:#24352f;--custom-bg2:#17251f;--custom-panel:#31483e;--custom-panel2:#3a5347;--custom-line:#b39a68;
  --custom-text:#f0e5cb;--custom-selected:#4b5e4c;
  --score-grid-bg:#31483e;--score-grid-sticky:#31483e;--score-grid-head:linear-gradient(180deg,#405b4d,#354c41);
  --score-grid-line:#ae9463;--score-mark:#f4e7c8;--score-mark-text:#f4e7c8;--score-note:#f4e7c8;--score-run:#63bd78;
}
body.theme-custom.custom-heritage:not(.dark-mode) .app-shell{
  background:
    repeating-linear-gradient(0deg,rgba(239,225,194,.018) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,#2b4036,#18271f)!important;
}
body.theme-custom.custom-heritage:not(.dark-mode) .topbar{background:linear-gradient(180deg,#374e42,#293e34)!important;border-bottom-color:#b39a68!important}
body.theme-custom.custom-heritage:not(.dark-mode) .card{border-color:#a98e5e!important}

/* Default dark mode is a true night palette regardless of subtheme, while preserving identity accents. */
body.theme-custom.dark-mode{
  --custom-bg:#020812;--custom-bg2:#01050b;--custom-panel:#06101e;--custom-panel2:#09182a;--custom-line:#365274;--custom-text:#f0f4f8;
  --score-grid-bg:#040c18;--score-grid-sticky:#040c18;--score-grid-head:linear-gradient(180deg,#0b1b31,#071326);--score-grid-line:#446586;
  --score-mark:#fbf8ef;--score-mark-text:#fbf8ef;--score-note:#fbf8ef;--score-out:#f26359;--score-run:#62d487;
}
body.theme-custom.custom-classic.dark-mode{--score-grid-line:#806f53;--custom-line:#665b48}
body.theme-custom.custom-heritage.dark-mode{--score-grid-line:#7d704e;--custom-line:#5f664d;--custom-panel2:#102019}
body.theme-custom.dark-mode .app-shell{background:radial-gradient(circle at 50% 0,rgba(39,89,135,.10),transparent 30%),linear-gradient(180deg,#030914,#01050a)!important}
body.theme-custom.dark-mode .topbar{background:linear-gradient(180deg,#07172a,#040d19)!important}
body.theme-custom.dark-mode .drawer{background:linear-gradient(180deg,#071426,#030b16)!important}
body.theme-custom.dark-mode .game-info,
body.theme-custom.dark-mode .matchup-selector,
body.theme-custom.dark-mode .standings-overview,
body.theme-custom.dark-mode .team-scorebook{box-shadow:0 12px 26px rgba(0,0,0,.32)!important}

/* ---------- WRIGLEY: three clearly different presentations ---------- */
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode){
  --score-grid-bg:#113e2f;--score-grid-sticky:#113e2f;--score-grid-head:linear-gradient(180deg,#194c3a,#123d30);--score-grid-line:#8c794d;
}
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .app-shell{background:linear-gradient(180deg,#12372b,#0c2a21)!important}
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .game-info,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .matchup-selector,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .standings-overview,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .team-scorebook{
  background:linear-gradient(180deg,#173d30,#123126)!important;
  border-color:#8a774d!important;
}
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .game-info::before,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .matchup-selector::before,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .standings-overview::before,
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode) .team-scorebook::before{opacity:.45!important}

body.theme-wrigley.wrigley-ivybrick:not(.dark-mode){
  --score-grid-bg:#103b2b;--score-grid-sticky:#103b2b;--score-grid-head:linear-gradient(180deg,#174836,#123a2d);--score-grid-line:#987a50;
}
body.theme-wrigley.wrigley-ivybrick:not(.dark-mode) .app-shell{
  background:linear-gradient(rgba(10,35,25,.18),rgba(10,35,25,.18)),var(--wrigley-brick-pattern)!important;
}
body.theme-wrigley.wrigley-ivybrick:not(.dark-mode) .game-info,
body.theme-wrigley.wrigley-ivybrick:not(.dark-mode) .matchup-selector,
body.theme-wrigley.wrigley-ivybrick:not(.dark-mode) .standings-overview,
body.theme-wrigley.wrigley-ivybrick:not(.dark-mode) .team-scorebook{box-shadow:0 11px 25px rgba(0,0,0,.27),inset 0 0 0 1px rgba(239,222,185,.08)!important}

body.theme-wrigley.wrigley-night,
body.theme-wrigley.dark-mode{
  --score-grid-bg:#061812;--score-grid-sticky:#061812;--score-grid-head:linear-gradient(180deg,#0c281f,#071b15);--score-grid-line:#9a8355;
  --score-mark:#fff3d8;--score-mark-text:#fff3d8;--score-note:#fff3d8;--score-out:#f05b50;--score-run:#6bdd8f;
}
body.theme-wrigley.wrigley-night .app-shell,
body.theme-wrigley.dark-mode .app-shell{
  background:
    radial-gradient(ellipse at 50% -8%,rgba(231,228,190,.13),transparent 28%),
    linear-gradient(180deg,#06110d,#020705)!important;
}
body.theme-wrigley.wrigley-night .game-info,
body.theme-wrigley.wrigley-night .matchup-selector,
body.theme-wrigley.wrigley-night .standings-overview,
body.theme-wrigley.wrigley-night .team-scorebook,
body.theme-wrigley.dark-mode .game-info,
body.theme-wrigley.dark-mode .matchup-selector,
body.theme-wrigley.dark-mode .standings-overview,
body.theme-wrigley.dark-mode .team-scorebook{box-shadow:0 13px 30px rgba(0,0,0,.42),inset 0 0 0 1px rgba(255,244,218,.045)!important}
body.theme-wrigley.dark-mode .topbar{background:linear-gradient(180deg,rgba(2,8,5,.89),rgba(4,16,11,.84)),url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important}
body.theme-wrigley.dark-mode .game-info::before,
body.theme-wrigley.dark-mode .matchup-selector::before,
body.theme-wrigley.dark-mode .standings-overview::before,
body.theme-wrigley.dark-mode .team-scorebook::before{filter:brightness(.66) saturate(.82) drop-shadow(0 2px 3px rgba(0,0,0,.5))!important}

/* ---------- POSTSEASON: round identity escalation ---------- */
body.theme-postseason.playoff-wild-card:not(.dark-mode){
  --score-grid-bg:#13283b;--score-grid-sticky:#13283b;--score-grid-head:linear-gradient(180deg,#20384f,#172d42);--score-grid-line:#a2b1bf;
  --score-mark:#f5f8fa;--score-mark-text:#f5f8fa;
}
body.theme-postseason.playoff-wild-card:not(.dark-mode) .app-shell{
  background:
    repeating-linear-gradient(135deg,rgba(222,231,238,.035) 0 1px,transparent 1px 11px),
    linear-gradient(180deg,#102336,#071321)!important;
}
body.theme-postseason.playoff-wild-card:not(.dark-mode) .topbar{background:linear-gradient(180deg,#182e44,#102338)!important;border-bottom-color:#91a4b5!important}

body.theme-postseason.playoff-division-series:not(.dark-mode){
  --score-grid-bg:#0b2036;--score-grid-sticky:#0b2036;--score-grid-head:linear-gradient(180deg,#13304e,#0d253e);--score-grid-line:#c0994e;
}
body.theme-postseason.playoff-division-series:not(.dark-mode) .app-shell{
  background:
    linear-gradient(90deg,transparent 49%,rgba(223,174,77,.035) 50%,transparent 51%) 0 0/96px 96px,
    linear-gradient(180deg,#091b31,#04101f)!important;
}
body.theme-postseason.playoff-division-series:not(.dark-mode) .topbar{border-bottom:2px solid #ae8641!important}

body.theme-postseason.playoff-championship-series:not(.dark-mode){
  --score-grid-bg:#121c31;--score-grid-sticky:#121c31;--score-grid-head:linear-gradient(90deg,#172942,#4b252d,#172942);--score-grid-line:#c78660;
}
body.theme-postseason.playoff-championship-series:not(.dark-mode) .app-shell{
  background:radial-gradient(circle at 50% 0,rgba(180,54,58,.10),transparent 30%),linear-gradient(180deg,#10192b,#070d18)!important;
}
body.theme-postseason.playoff-championship-series:not(.dark-mode) .topbar{background:linear-gradient(90deg,#14263e,#56262e 50%,#14263e)!important;border-bottom-color:#bd7a53!important}

body.theme-postseason.playoff-world-series:not(.dark-mode){
  --score-grid-bg:#081726;--score-grid-sticky:#081726;--score-grid-head:linear-gradient(180deg,#132b43,#0b1b2c);--score-grid-line:#d5ae62;
  --score-mark:#fff8e8;--score-mark-text:#fff8e8;
}
body.theme-postseason.playoff-world-series:not(.dark-mode) .app-shell{
  background:
    radial-gradient(circle at 50% 0,rgba(239,199,111,.18),transparent 25%),
    radial-gradient(circle at 15% 15%,rgba(255,255,255,.025),transparent 12%),
    linear-gradient(180deg,#071421,#01070c)!important;
}
body.theme-postseason.playoff-world-series:not(.dark-mode) .topbar{
  background:linear-gradient(180deg,#0b1c2c,#05101a)!important;
  border-bottom:2px solid #d2a858!important;
  box-shadow:0 8px 24px rgba(0,0,0,.28),0 2px 18px rgba(210,168,88,.07)!important;
}
body.theme-postseason.playoff-world-series:not(.dark-mode) .team-scorebook,
body.theme-postseason.playoff-world-series:not(.dark-mode) .standings-overview{box-shadow:0 10px 26px rgba(0,0,0,.24),inset 0 0 0 1px rgba(255,236,191,.05)!important}

body.theme-postseason.dark-mode{
  --score-grid-bg:#020914;--score-grid-sticky:#020914;--score-grid-head:linear-gradient(180deg,#071427,#030d1b);--score-grid-line:#8e6d36;
  --score-mark:#fffaf0;--score-mark-text:#fffaf0;--score-note:#fffaf0;--score-run:#67dd8c;--score-out:#f46358;
}
body.theme-postseason.dark-mode .app-shell{background:radial-gradient(circle at 50% -5%,rgba(224,173,77,.09),transparent 26%),linear-gradient(180deg,#01050a,#000204)!important}
body.theme-postseason.dark-mode .topbar{background:linear-gradient(180deg,#030b15,#01050b)!important}
body.theme-postseason.dark-mode .team-scorebook,
body.theme-postseason.dark-mode .standings-overview,
body.theme-postseason.dark-mode .game-info,
body.theme-postseason.dark-mode .matchup-selector{box-shadow:0 14px 30px rgba(0,0,0,.38)!important}

/* ---------- Theme-aware editor controls: same layout, clearer identity ---------- */
body.theme-custom .play-card .quick-plays button,
body.theme-custom .play-card select,
body.theme-custom .play-card input{border-color:color-mix(in srgb,var(--custom-line) 78%,#fff 22%)}
body.theme-wrigley .play-card .quick-plays button,
body.theme-wrigley .play-card select,
body.theme-wrigley .play-card input{border-color:#8c774e!important}
body.theme-postseason .play-card .quick-plays button,
body.theme-postseason .play-card select,
body.theme-postseason .play-card input{border-color:color-mix(in srgb,var(--accent) 54%,#526476 46%)!important}
body.dark-mode .play-card .quick-plays button,
body.dark-mode .play-card select,
body.dark-mode .play-card input{background:color-mix(in srgb,var(--panel) 90%,#fff 3%)!important;color:var(--text)!important}

/* ---------- Mobile-specific theme polish without changing dimensions ---------- */
@media(max-width:600px){
  body.dark-mode .mobile-action-bar{box-shadow:0 -12px 28px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.035)}
  .theme-choice.active{box-shadow:0 7px 16px rgba(0,0,0,.16),inset 0 0 0 1px color-mix(in srgb,var(--accent) 52%,transparent)}
}


/* ==========================================================
   v20 SCORE-MARK DYNAMIC COLOR TUNING
   - baseline segments / neutral notations now follow theme + dark mode
   - red outs and green run markers stay semantically fixed
   ========================================================== */

/* Let neutral scoring marks follow the active palette instead of older static overrides */
body.theme-custom .play-entry .base.origin,
body.theme-custom .play-entry .base.advance,
body.theme-wrigley .play-entry .base.origin,
body.theme-wrigley .play-entry .base.advance,
body.theme-postseason .play-entry .base.origin,
body.theme-postseason .play-entry .base.advance{
  stroke:var(--score-mark)!important;
}
body.theme-custom .play-entry .advance-reason-label,
body.theme-wrigley .play-entry .advance-reason-label,
body.theme-postseason .play-entry .advance-reason-label{
  fill:var(--score-note)!important;
  stroke:var(--score-mark-outline)!important;
}
body.theme-custom .play-entry .play-code,
body.theme-wrigley .play-entry .play-code,
body.theme-postseason .play-entry .play-code,
body.theme-custom .event-marker,
body.theme-wrigley .event-marker,
body.theme-postseason .event-marker{
  color:var(--score-mark-text)!important;
}
body.theme-custom .event-marker,
body.theme-wrigley .event-marker,
body.theme-postseason .event-marker{
  background:color-mix(in srgb,var(--score-mark) 14%, transparent)!important;
  border:1px solid color-mix(in srgb,var(--score-mark) 18%, transparent)!important;
}

/* Default theme: light modes get dark marks, dark modes get light marks */
body.theme-custom.custom-modern:not(.dark-mode){
  --score-mark:#172738;
  --score-mark-text:#172738;
  --score-note:#172738;
  --score-mark-outline:rgba(255,255,255,.96);
}
body.theme-custom.custom-classic:not(.dark-mode){
  --score-mark:#f3ead4;
  --score-mark-text:#f3ead4;
  --score-note:#f3ead4;
  --score-mark-outline:rgba(7,16,28,.94);
}
body.theme-custom.custom-heritage:not(.dark-mode){
  --score-mark:#f3e5c6;
  --score-mark-text:#f3e5c6;
  --score-note:#f3e5c6;
  --score-mark-outline:rgba(10,18,14,.94);
}
body.theme-custom.dark-mode{
  --score-mark:#fbf8ef;
  --score-mark-text:#fbf8ef;
  --score-note:#fbf8ef;
  --score-mark-outline:rgba(4,10,18,.96);
}



/* ==========================================================
   v21 CUSTOM COLOR LEGIBILITY GUARDS
   - keeps custom theme text readable for a wider range of user color choices
   ========================================================== */
body.theme-custom .theme-choice.active::before{background:var(--custom-accent-safe,var(--accent))!important}
body.theme-custom .theme-choice.active{box-shadow:0 10px 18px rgba(0,0,0,.18), inset 0 0 0 1px color-mix(in srgb,var(--custom-accent-safe,var(--accent)) 54%, transparent)!important}
body.theme-custom .drawer-label::after,
body.theme-custom .drawer-section+.drawer-section::before{background:linear-gradient(90deg,color-mix(in srgb,var(--custom-accent-safe,var(--accent)) 28%,transparent),transparent)!important}
body.theme-custom #darkBtn,
body.theme-custom #focusBtn,
body.theme-custom .top-action,
body.theme-custom .top-icon{color:var(--text)!important;border-color:var(--line)!important}
body.theme-custom .theme-sub select,
body.theme-custom .theme-sub input[type=color],
body.theme-custom .drawer-tools>button,
body.theme-custom .import-button,
body.theme-custom .drawer-nav,
body.theme-custom .theme-choice{color:var(--text)!important}
body.theme-custom .theme-choice small,
body.theme-custom .drawer-nav small,
body.theme-custom .drawer-tools>button small{color:var(--muted)!important}
body.theme-custom .page-title,
body.theme-custom .team-header-name,
body.theme-custom .overview-title strong,
body.theme-custom .matchup-label,
body.theme-custom .game-field label,
body.theme-custom .standings-foot,
body.theme-custom .section-subtext{color:var(--text)!important}
body.theme-custom .game-field input,
body.theme-custom .matchup-team select,
body.theme-custom .pitch-table input,
body.theme-custom .notes-area,
body.theme-custom input,
body.theme-custom select,
body.theme-custom textarea{color:var(--text)!important}
body.theme-custom .theme-sub select,
body.theme-custom .theme-sub input[type=color]{border-color:var(--line)!important;background:color-mix(in srgb,var(--panel) 88%, #fff 4%)!important}
body.theme-custom .color-row label{color:var(--text)!important}
body.theme-custom.custom-modern:not(.dark-mode) .theme-sub select,
body.theme-custom.custom-modern:not(.dark-mode) .theme-sub input[type=color],
body.theme-custom.custom-modern:not(.dark-mode) .drawer-tools>button,
body.theme-custom.custom-modern:not(.dark-mode) .drawer-nav,
body.theme-custom.custom-modern:not(.dark-mode) .theme-choice{
  background:rgba(255,255,255,.28)!important;
}


/* ==========================================================
   v22 MENU READABILITY + LIVE THEME PREVIEW POLISH
   visual-only presentation changes
   ========================================================== */
.drawer{
  padding-bottom:calc(84px + env(safe-area-inset-bottom))!important;
  scrollbar-color:color-mix(in srgb,var(--accent) 48%,transparent) transparent;
}
.drawer::-webkit-scrollbar{width:6px}
.drawer::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--accent) 42%,transparent);border-radius:8px}
.drawer-section{padding:12px 0!important}
.drawer-section:first-of-type{padding-top:8px!important}
.drawer-label{font-size:9.5px!important;line-height:1.1;color:var(--muted)!important}
.drawer-nav,.theme-choice,.drawer-tools>button,.import-button{
  min-height:50px!important;
  padding:8px 10px!important;
}
.drawer-nav+.drawer-nav,.theme-choice+.theme-sub+.theme-choice,.drawer-tools>button+.drawer-tools>button{margin-top:5px}
.drawer-nav span:nth-child(2),.drawer-tools>button span:nth-child(2),.import-button span:nth-child(2){font-size:11px!important}
.theme-choice strong{font-size:11.4px!important;line-height:1.15}
.theme-choice small{font-size:7.8px!important;line-height:1.25;margin-top:2px;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.theme-choice{align-items:center!important}
.theme-swatch{flex:none;transition:background .18s ease,filter .18s ease,box-shadow .18s ease!important}
.theme-choice.active .theme-swatch{box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 0 0 2px color-mix(in srgb,var(--accent) 28%,transparent),0 7px 16px rgba(0,0,0,.20)!important}
.theme-sub{margin-top:6px!important;margin-bottom:10px!important}
.theme-sub label{font-size:8.4px!important}
.theme-sub select{font-size:10px!important;padding-right:28px!important}
.color-row input[type=color]{height:38px!important}
.drawer-tools{padding-bottom:20px!important}
body.dark-mode .theme-swatch{filter:saturate(.92) brightness(.92)}
@media(max-width:600px){
  .drawer{width:min(294px,82vw)!important;padding-left:12px!important;padding-right:12px!important}
  .drawer-head{padding-bottom:10px!important}
  .drawer-head strong{font-size:19px!important}
  .drawer-section{padding:10px 0!important}
  .drawer-nav,.theme-choice,.drawer-tools>button,.import-button{min-height:46px!important;padding:7px 8px!important}
  .theme-choice{grid-template-columns:42px minmax(0,1fr) 18px!important;gap:8px!important}
  .theme-swatch{width:38px!important;height:38px!important}
  .theme-choice strong{font-size:10.5px!important}
  .theme-choice small{font-size:7.3px!important}
  .theme-sub{margin-left:6px!important;padding:8px!important}
  .theme-sub select,.theme-sub input[type=color]{min-height:34px!important}
}


/* v23 preset-based default theme */
.custom-sub{display:grid;gap:10px}.custom-sub .color-row{display:none!important}
.custom-sub select{width:100%}


/* v24 curated Default palette polish */
body.theme-custom .custom-sub label:first-child select{
  font-weight:900;
  letter-spacing:.01em;
}
body.theme-custom .custom-sub label:first-child::after{
  content:'Four balanced presets tuned for readable score marks and cohesive panels.';
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:6.8px;
  font-weight:700;
  letter-spacing:.01em;
  line-height:1.25;
}


/* ==========================================================
   v25 WRIGLEY BASE-SEGMENT VISIBILITY FIX
   The previous self-referential score-mark variables could resolve invalid,
   causing SVG paths to fall back to no stroke. These are explicit on purpose.
   ========================================================== */
body.theme-wrigley:not(.dark-mode):not(.wrigley-night){
  --score-mark:#f3e6c8;
  --score-mark-text:#f3e6c8;
  --score-note:#f3e6c8;
  --score-mark-outline:#07110a;
}
body.theme-wrigley.wrigley-night,
body.theme-wrigley.dark-mode{
  --score-mark:#fff3dc;
  --score-mark-text:#fff3dc;
  --score-note:#fff3dc;
  --score-mark-outline:#07110c;
}
body.theme-wrigley .play-entry .base.origin,
body.theme-wrigley .play-entry .base.advance{
  stroke:var(--score-mark)!important;
  stroke-width:4.7!important;
  stroke-linecap:round!important;
  opacity:1!important;
  visibility:visible!important;
}
@media(max-width:600px){
  body.theme-wrigley .play-entry .base.origin,
  body.theme-wrigley .play-entry .base.advance{stroke-width:4.2!important}
}


/* ==========================================================
   v28 DEFAULT THEME COHESION PASS
   Subthemes may change typography/depth, but the selected palette owns color.
   ========================================================== */
body.theme-custom{
  --bg:var(--custom-bg)!important;
  --panel:var(--custom-panel)!important;
  --panel2:var(--custom-panel2)!important;
  --line:var(--custom-line)!important;
  --accent:var(--custom-accent-safe,var(--custom-accent))!important;
  --selected:var(--custom-selected)!important;
  --text:var(--custom-text)!important;
  --muted:var(--custom-muted)!important;
  --score-grid-bg:var(--custom-grid)!important;
  --score-grid-sticky:var(--custom-grid-sticky)!important;
  --score-grid-head:var(--custom-grid-head)!important;
  --score-grid-line:var(--custom-grid-line)!important;
  --score-mark:var(--custom-score-mark)!important;
  --score-mark-text:var(--custom-score-mark)!important;
  --score-note:var(--custom-score-mark)!important;
  --score-mark-outline:var(--custom-score-outline)!important;
}
body.theme-custom,
body.theme-custom .app-shell{
  background:linear-gradient(180deg,var(--custom-bg),var(--custom-bg2))!important;
  color:var(--custom-text)!important;
}
body.theme-custom .topbar{
  background:linear-gradient(180deg,var(--custom-header),color-mix(in srgb,var(--custom-header) 88%,#000 12%))!important;
  color:var(--custom-text)!important;
  border-bottom-color:var(--custom-line)!important;
}
body.theme-custom .game-info,
body.theme-custom .matchup-selector,
body.theme-custom .standings-overview,
body.theme-custom .team-scorebook,
body.theme-custom .card{
  background:var(--custom-panel)!important;
  border-color:var(--custom-line)!important;
  color:var(--custom-text)!important;
}
body.theme-custom .game-field,
body.theme-custom .matchup-team,
body.theme-custom .matchup-selector .versus-mark,
body.theme-custom .overview-title,
body.theme-custom .standings-card,
body.theme-custom .team-scorebook-head,
body.theme-custom .team-scorebook-body,
body.theme-custom .live-game-bar{
  background:var(--custom-panel2)!important;
  border-color:var(--custom-line)!important;
  color:var(--custom-text)!important;
}
body.theme-custom .live-game-bar{
  background:linear-gradient(180deg,var(--custom-header),var(--custom-panel2))!important;
  box-shadow:0 7px 18px rgba(0,0,0,.20)!important;
}
body.theme-custom .team-scorebook-head,
body.theme-custom .overview-title{
  background:linear-gradient(180deg,var(--custom-panel2),color-mix(in srgb,var(--custom-panel2) 90%,#000 10%))!important;
}
body.theme-custom .unified-score-table td,
body.theme-custom .full-width-pitch .pitch-table td,
body.theme-custom .team-scorebook-canvas,
body.theme-custom .team-left-stack,
body.theme-custom .lineup-pane,
body.theme-custom .pitch-pane,
body.theme-custom .scoring-pane{
  background:var(--custom-grid)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-grid-line)!important;
}
body.theme-custom .unified-score-table thead th,
body.theme-custom .unified-score-table .sticky-lineup-banner,
body.theme-custom .unified-score-table .sticky-totals-label,
body.theme-custom .unified-score-table .unified-totals-row td,
body.theme-custom .full-width-pitch .pane-title,
body.theme-custom .full-width-pitch .pitch-table th,
body.theme-custom .standings-grid .head,
body.theme-custom .standings-head{
  background:var(--custom-grid-head)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-grid-line)!important;
}
body.theme-custom .unified-score-table tbody .sticky-ord,
body.theme-custom .unified-score-table tbody .sticky-player,
body.theme-custom .unified-score-table tbody .sticky-pos,
body.theme-custom .standings-grid>div,
body.theme-custom .standings-foot{
  background:var(--custom-grid-sticky)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-grid-line)!important;
}
body.theme-custom .unified-score-table .play-cell.active-inning-col,
body.theme-custom .unified-score-table .active-inning-col{
  background:color-mix(in srgb,var(--custom-grid) 82%,var(--custom-accent-safe) 18%)!important;
}
body.theme-custom .unified-score-table .score-head-inning.active-inning-col{
  background:var(--custom-accent-safe)!important;
  color:var(--custom-accent-ink)!important;
}
body.theme-custom .play-entry .base.origin,
body.theme-custom .play-entry .base.advance{stroke:var(--custom-score-mark)!important}
body.theme-custom .play-entry .advance-reason-label{fill:var(--custom-score-mark)!important;stroke:var(--custom-score-outline)!important}
body.theme-custom .play-entry .play-code,
body.theme-custom .play-entry.runner-out .play-code{color:var(--custom-score-mark)!important;text-shadow:0 1px 1px rgba(0,0,0,.48)!important}
body.theme-custom .drawer{
  background:linear-gradient(180deg,var(--custom-drawer),var(--custom-drawer2))!important;
  border-color:var(--custom-line)!important;color:var(--custom-text)!important;
}
body.theme-custom .drawer-nav,
body.theme-custom .theme-choice,
body.theme-custom .drawer-tools>button,
body.theme-custom .import-button,
body.theme-custom .theme-sub{
  background:color-mix(in srgb,var(--custom-panel) 88%,var(--custom-accent-safe) 12%)!important;
  border-color:var(--custom-line)!important;color:var(--custom-text)!important;
}
body.theme-custom .theme-choice.active,
body.theme-custom .drawer-nav.active{
  background:color-mix(in srgb,var(--custom-panel) 72%,var(--custom-accent-safe) 28%)!important;
}
body.theme-custom .theme-sub select,
body.theme-custom .theme-sub input{
  background:var(--custom-grid)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom .mobile-action-bar{
  background:linear-gradient(180deg,var(--custom-header),color-mix(in srgb,var(--custom-header) 84%,#000 16%))!important;
  border-top-color:var(--custom-line)!important;color:var(--custom-text)!important;
}
body.theme-custom .mobile-action-bar button,
body.theme-custom .mobile-action-bar small{color:var(--custom-text)!important}
body.theme-custom .mobile-action-bar .danger-quick span,
body.theme-custom .mobile-action-bar .danger-quick small{color:#ef7169!important}
body.theme-custom .modal-card,
body.theme-custom .play-card,
body.theme-custom .settings-card{
  background:var(--custom-panel)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom .play-card .situation,
body.theme-custom .play-card .quick-plays button,
body.theme-custom .play-card input,
body.theme-custom .play-card select,
body.theme-custom .modal-actions button{
  background:var(--custom-grid)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom .play-card .modal-actions .primary{
  background:var(--custom-accent-safe)!important;color:var(--custom-accent-ink)!important;
}
/* Style choices keep character without changing palette hue. */
body.theme-custom.custom-modern .topbar h1,
body.theme-custom.custom-modern .team-header-name,
body.theme-custom.custom-modern .overview-title strong{font-family:Inter,system-ui,sans-serif!important}
body.theme-custom.custom-modern .card,
body.theme-custom.custom-modern .team-scorebook{box-shadow:0 7px 18px rgba(0,0,0,.13)!important}
body.theme-custom.custom-classic .topbar h1,
body.theme-custom.custom-classic .team-header-name,
body.theme-custom.custom-classic .overview-title strong{font-family:Georgia,"Times New Roman",serif!important}
body.theme-custom.custom-classic .card,
body.theme-custom.custom-classic .team-scorebook{box-shadow:0 9px 22px rgba(0,0,0,.20),inset 0 0 0 1px color-mix(in srgb,var(--custom-accent-safe) 10%,transparent)!important}
body.theme-custom.custom-heritage .topbar h1,
body.theme-custom.custom-heritage .team-header-name,
body.theme-custom.custom-heritage .overview-title strong{font-family:Georgia,"Times New Roman",serif!important;letter-spacing:.025em}
body.theme-custom.custom-heritage .card,
body.theme-custom.custom-heritage .team-scorebook{box-shadow:0 8px 22px rgba(0,0,0,.18),inset 0 0 0 1px color-mix(in srgb,var(--custom-accent-safe) 16%,transparent)!important}




/* ==========================================================
   v29 DEFAULT PALETTE OWNERSHIP — verified cascade fix
   The chosen palette owns every Default-theme surface. Generic Style may
   change typography/depth only; it cannot inject blue/green/white colors.
   ========================================================== */
body.theme-custom.custom-modern,
body.theme-custom.custom-classic,
body.theme-custom.custom-heritage{
  --bg:var(--custom-bg)!important;
  --panel:var(--custom-panel)!important;
  --panel2:var(--custom-panel2)!important;
  --line:var(--custom-line)!important;
  --accent:var(--custom-accent-safe)!important;
  --selected:var(--custom-selected)!important;
  --text:var(--custom-text)!important;
  --muted:var(--custom-muted)!important;
  --score-grid-bg:var(--custom-grid)!important;
  --score-grid-sticky:var(--custom-grid-sticky)!important;
  --score-grid-head:var(--custom-grid-head)!important;
  --score-grid-line:var(--custom-grid-line)!important;
  --score-mark:var(--custom-score-mark)!important;
  --score-mark-text:var(--custom-score-mark)!important;
  --score-note:var(--custom-score-mark)!important;
  --score-mark-outline:var(--custom-score-outline)!important;
}
body.theme-custom.custom-modern .app-shell,
body.theme-custom.custom-classic .app-shell,
body.theme-custom.custom-heritage .app-shell{
  background:linear-gradient(180deg,var(--custom-bg),var(--custom-bg2))!important;
  color:var(--custom-text)!important;
}
body.theme-custom.custom-modern .topbar,
body.theme-custom.custom-classic .topbar,
body.theme-custom.custom-heritage .topbar{
  background:linear-gradient(180deg,var(--custom-header),color-mix(in srgb,var(--custom-header) 88%,#000 12%))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .game-info,
body.theme-custom.custom-modern .matchup-selector,
body.theme-custom.custom-modern .standings-overview,
body.theme-custom.custom-modern .team-scorebook,
body.theme-custom.custom-classic .game-info,
body.theme-custom.custom-classic .matchup-selector,
body.theme-custom.custom-classic .standings-overview,
body.theme-custom.custom-classic .team-scorebook,
body.theme-custom.custom-heritage .game-info,
body.theme-custom.custom-heritage .matchup-selector,
body.theme-custom.custom-heritage .standings-overview,
body.theme-custom.custom-heritage .team-scorebook{
  background:var(--custom-panel)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .game-field,
body.theme-custom.custom-modern .matchup-team,
body.theme-custom.custom-modern .matchup-selector .versus-mark,
body.theme-custom.custom-modern .standings-card,
body.theme-custom.custom-modern .team-scorebook-head,
body.theme-custom.custom-modern .team-scorebook-body,
body.theme-custom.custom-modern .overview-title,
body.theme-custom.custom-classic .game-field,
body.theme-custom.custom-classic .matchup-team,
body.theme-custom.custom-classic .matchup-selector .versus-mark,
body.theme-custom.custom-classic .standings-card,
body.theme-custom.custom-classic .team-scorebook-head,
body.theme-custom.custom-classic .team-scorebook-body,
body.theme-custom.custom-classic .overview-title,
body.theme-custom.custom-heritage .game-field,
body.theme-custom.custom-heritage .matchup-team,
body.theme-custom.custom-heritage .matchup-selector .versus-mark,
body.theme-custom.custom-heritage .standings-card,
body.theme-custom.custom-heritage .team-scorebook-head,
body.theme-custom.custom-heritage .team-scorebook-body,
body.theme-custom.custom-heritage .overview-title{
  background:var(--custom-panel2)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .live-game-bar,
body.theme-custom.custom-classic .live-game-bar,
body.theme-custom.custom-heritage .live-game-bar{
  background:linear-gradient(180deg,var(--custom-header),var(--custom-panel2))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .unified-score-table td,
body.theme-custom.custom-modern .full-width-pitch .pitch-table td,
body.theme-custom.custom-modern .team-scorebook-canvas,
body.theme-custom.custom-modern .team-left-stack,
body.theme-custom.custom-modern .lineup-pane,
body.theme-custom.custom-modern .pitch-pane,
body.theme-custom.custom-modern .scoring-pane,
body.theme-custom.custom-classic .unified-score-table td,
body.theme-custom.custom-classic .full-width-pitch .pitch-table td,
body.theme-custom.custom-classic .team-scorebook-canvas,
body.theme-custom.custom-classic .team-left-stack,
body.theme-custom.custom-classic .lineup-pane,
body.theme-custom.custom-classic .pitch-pane,
body.theme-custom.custom-classic .scoring-pane,
body.theme-custom.custom-heritage .unified-score-table td,
body.theme-custom.custom-heritage .full-width-pitch .pitch-table td,
body.theme-custom.custom-heritage .team-scorebook-canvas,
body.theme-custom.custom-heritage .team-left-stack,
body.theme-custom.custom-heritage .lineup-pane,
body.theme-custom.custom-heritage .pitch-pane,
body.theme-custom.custom-heritage .scoring-pane{
  background:var(--custom-grid)!important;color:var(--custom-text)!important;border-color:var(--custom-grid-line)!important;
}
body.theme-custom.custom-modern .unified-score-table thead th,
body.theme-custom.custom-modern .unified-score-table .sticky-lineup-banner,
body.theme-custom.custom-modern .unified-score-table .sticky-totals-label,
body.theme-custom.custom-modern .unified-score-table .unified-totals-row td,
body.theme-custom.custom-modern .full-width-pitch .pane-title,
body.theme-custom.custom-modern .full-width-pitch .pitch-table th,
body.theme-custom.custom-modern .standings-grid .head,
body.theme-custom.custom-modern .standings-head,
body.theme-custom.custom-classic .unified-score-table thead th,
body.theme-custom.custom-classic .unified-score-table .sticky-lineup-banner,
body.theme-custom.custom-classic .unified-score-table .sticky-totals-label,
body.theme-custom.custom-classic .unified-score-table .unified-totals-row td,
body.theme-custom.custom-classic .full-width-pitch .pane-title,
body.theme-custom.custom-classic .full-width-pitch .pitch-table th,
body.theme-custom.custom-classic .standings-grid .head,
body.theme-custom.custom-classic .standings-head,
body.theme-custom.custom-heritage .unified-score-table thead th,
body.theme-custom.custom-heritage .unified-score-table .sticky-lineup-banner,
body.theme-custom.custom-heritage .unified-score-table .sticky-totals-label,
body.theme-custom.custom-heritage .unified-score-table .unified-totals-row td,
body.theme-custom.custom-heritage .full-width-pitch .pane-title,
body.theme-custom.custom-heritage .full-width-pitch .pitch-table th,
body.theme-custom.custom-heritage .standings-grid .head,
body.theme-custom.custom-heritage .standings-head{
  background:var(--custom-grid-head)!important;color:var(--custom-text)!important;border-color:var(--custom-grid-line)!important;
}
body.theme-custom.custom-modern .unified-score-table tbody .sticky-ord,
body.theme-custom.custom-modern .unified-score-table tbody .sticky-player,
body.theme-custom.custom-modern .unified-score-table tbody .sticky-pos,
body.theme-custom.custom-modern .standings-grid>div,
body.theme-custom.custom-modern .standings-foot,
body.theme-custom.custom-classic .unified-score-table tbody .sticky-ord,
body.theme-custom.custom-classic .unified-score-table tbody .sticky-player,
body.theme-custom.custom-classic .unified-score-table tbody .sticky-pos,
body.theme-custom.custom-classic .standings-grid>div,
body.theme-custom.custom-classic .standings-foot,
body.theme-custom.custom-heritage .unified-score-table tbody .sticky-ord,
body.theme-custom.custom-heritage .unified-score-table tbody .sticky-player,
body.theme-custom.custom-heritage .unified-score-table tbody .sticky-pos,
body.theme-custom.custom-heritage .standings-grid>div,
body.theme-custom.custom-heritage .standings-foot{
  background:var(--custom-grid-sticky)!important;color:var(--custom-text)!important;border-color:var(--custom-grid-line)!important;
}
body.theme-custom.custom-modern .drawer,
body.theme-custom.custom-classic .drawer,
body.theme-custom.custom-heritage .drawer{
  background:linear-gradient(180deg,var(--custom-drawer),var(--custom-drawer2))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .mobile-action-bar,
body.theme-custom.custom-classic .mobile-action-bar,
body.theme-custom.custom-heritage .mobile-action-bar{
  background:linear-gradient(180deg,var(--custom-header),color-mix(in srgb,var(--custom-header) 82%,#000 18%))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern .modal-card,
body.theme-custom.custom-classic .modal-card,
body.theme-custom.custom-heritage .modal-card{
  background:var(--custom-panel)!important;color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
/* Current inning is a palette accent, not a foreign hue. */
body.theme-custom.custom-modern .unified-score-table .play-cell.active-inning-col,
body.theme-custom.custom-classic .unified-score-table .play-cell.active-inning-col,
body.theme-custom.custom-heritage .unified-score-table .play-cell.active-inning-col{
  background:color-mix(in srgb,var(--custom-grid) 80%,var(--custom-accent-safe) 20%)!important;
}
body.theme-custom.custom-modern .unified-score-table .score-head-inning.active-inning-col,
body.theme-custom.custom-classic .unified-score-table .score-head-inning.active-inning-col,
body.theme-custom.custom-heritage .unified-score-table .score-head-inning.active-inning-col{
  background:var(--custom-accent-safe)!important;color:var(--custom-accent-ink)!important;
}
/* Neutral score marks use one color per palette; red/green semantics stay fixed. */
body.theme-custom.custom-modern .play-entry .base.origin,
body.theme-custom.custom-modern .play-entry .base.advance,
body.theme-custom.custom-classic .play-entry .base.origin,
body.theme-custom.custom-classic .play-entry .base.advance,
body.theme-custom.custom-heritage .play-entry .base.origin,
body.theme-custom.custom-heritage .play-entry .base.advance{stroke:var(--custom-score-mark)!important}
body.theme-custom.custom-modern .play-entry .play-code,
body.theme-custom.custom-classic .play-entry .play-code,
body.theme-custom.custom-heritage .play-entry .play-code{color:var(--custom-score-mark)!important}


/* v29 specificity guard against legacy :not(.dark-mode) Default rules. */
body.theme-custom.custom-modern:not(.dark-mode) .app-shell,
body.theme-custom.custom-classic:not(.dark-mode) .app-shell,
body.theme-custom.custom-heritage:not(.dark-mode) .app-shell,
body.theme-custom.custom-modern.dark-mode .app-shell,
body.theme-custom.custom-classic.dark-mode .app-shell,
body.theme-custom.custom-heritage.dark-mode .app-shell{
  background:linear-gradient(180deg,var(--custom-bg),var(--custom-bg2))!important;
  color:var(--custom-text)!important;
}
body.theme-custom.custom-modern:not(.dark-mode) .topbar,
body.theme-custom.custom-classic:not(.dark-mode) .topbar,
body.theme-custom.custom-heritage:not(.dark-mode) .topbar,
body.theme-custom.custom-modern.dark-mode .topbar,
body.theme-custom.custom-classic.dark-mode .topbar,
body.theme-custom.custom-heritage.dark-mode .topbar{
  background:linear-gradient(180deg,var(--custom-header),color-mix(in srgb,var(--custom-header) 88%,#000 12%))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;
}
body.theme-custom.custom-modern:not(.dark-mode) .drawer,
body.theme-custom.custom-classic:not(.dark-mode) .drawer,
body.theme-custom.custom-heritage:not(.dark-mode) .drawer,
body.theme-custom.custom-modern.dark-mode .drawer,
body.theme-custom.custom-classic.dark-mode .drawer,
body.theme-custom.custom-heritage.dark-mode .drawer{
  background:linear-gradient(180deg,var(--custom-drawer),var(--custom-drawer2))!important;
  color:var(--custom-text)!important;border-color:var(--custom-line)!important;filter:none!important;
}
body.theme-custom.custom-modern:not(.dark-mode) .card,
body.theme-custom.custom-classic:not(.dark-mode) .card,
body.theme-custom.custom-heritage:not(.dark-mode) .card,
body.theme-custom.custom-modern.dark-mode .card,
body.theme-custom.custom-classic.dark-mode .card,
body.theme-custom.custom-heritage.dark-mode .card{
  border-color:var(--custom-line)!important;color:var(--custom-text)!important;
}


/* ==========================================================
   v30 SCORING EDITOR + PITCHING REFINEMENT
   ========================================================== */
.play-card .editor-section-title{
  margin:12px 0 7px;padding-top:10px;border-top:1px solid color-mix(in srgb,var(--line) 72%,transparent);
  font-size:8px;font-weight:950;letter-spacing:.15em;color:var(--muted);
}
.play-card .situation + .editor-section-title{border-top:0;padding-top:0;margin-top:12px}
.play-card .field-help{display:block;margin-top:2px;font-size:6.5px;font-weight:700;letter-spacing:.02em;color:var(--muted);text-transform:none}
.play-card .editor-grid label{min-width:0}
.play-card #outResult,.play-card #advanceReason{font-weight:850;letter-spacing:.02em}
.play-card .modal-actions{margin-top:14px}
.quick-label,.quick-plays{display:none!important}

.full-width-pitch .pane-title{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important}
.add-pitcher-btn{
  width:28px;height:28px;min-width:28px;padding:0;border:1px solid currentColor;border-radius:999px;background:transparent;color:inherit;
  font-size:18px;font-weight:850;line-height:1;display:grid;place-items:center;opacity:.9;
}
.add-pitcher-btn:active{transform:scale(.95)}

.play-entry .play-code.notation-compact{font-size:7.4px!important;max-width:40%;line-height:.95;text-align:right}
.play-entry .play-code.notation-tiny{font-size:6.2px!important;max-width:44%;line-height:.92;text-align:right}
.play-entry .rbi-code.notation-compact{font-size:5.8px!important;max-width:42%;line-height:.95;text-align:right}
.play-entry .rbi-code.notation-tiny{font-size:5px!important;max-width:44%;line-height:.92;text-align:right}
.play-entry .standalone-out.notation-compact{font-size:17px!important}
.play-entry .standalone-out.notation-tiny{font-size:14px!important}

@media(max-width:600px){
  .play-card .editor-section-title{font-size:7.5px;margin-top:10px}
  .play-card .field-help{font-size:6px}
  .play-card .editor-grid{gap:8px!important}
  .add-pitcher-btn{width:26px;height:26px;min-width:26px;font-size:16px}
  .play-entry .play-code.notation-compact{font-size:6.8px!important}
  .play-entry .play-code.notation-tiny{font-size:5.7px!important}
  .play-entry .rbi-code{right:2px!important;top:2px!important}
  .play-entry .rbi-code.notation-compact{font-size:5.3px!important}
  .play-entry .rbi-code.notation-tiny{font-size:4.7px!important}
}


/* ==========================================================
   v31 APPLICATION EXPERIENCE REFINEMENT
   Presentation + workflow polish only; scoring geometry retained.
   ========================================================== */
html{background:var(--bg);-webkit-text-size-adjust:100%}
body{min-height:100dvh;-webkit-tap-highlight-color:transparent}
.app-shell{min-height:100dvh}
button,.play-cell,.player-cell,select,input{-webkit-touch-callout:none}

/* Persistent status / final state */
.live-game-bar{position:sticky;top:0;z-index:24;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.live-game-bar.is-final .live-inning strong{letter-spacing:.12em}
.game-complete{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:12px 14px;border-color:color-mix(in srgb,var(--accent) 70%,var(--line));background:color-mix(in srgb,var(--panel2) 88%,var(--accent) 7%)}
.game-complete>div:first-child{display:grid;gap:3px}.game-complete small{font-size:8px;font-weight:950;letter-spacing:.15em;color:var(--muted)}.game-complete strong{font-size:14px}.game-complete-actions{display:flex;gap:7px}.game-complete-actions button{min-height:38px;padding:0 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);font-weight:900}

/* Current scoring state */
.unified-score-table .current-batter .sticky-ord,
.unified-score-table .current-batter .sticky-player,
.unified-score-table .current-batter .sticky-pos{box-shadow:inset 3px 0 0 color-mix(in srgb,var(--accent) 75%,transparent);background:color-mix(in srgb,var(--selected) 22%,var(--score-grid-sticky))!important}
.unified-score-table .score-head-inning.active-inning-col{box-shadow:inset 0 -3px 0 var(--accent)}
.play-cell:focus-visible{outline:2px solid var(--accent);outline-offset:-3px;z-index:4}

/* App-like motion */
.card,.team-scorebook-head,.drawer,.modal-card,.mobile-action-bar button{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease,opacity .16s ease}
.play-cell.flash-update{animation:cellPulse .42s ease}
@keyframes cellPulse{0%{box-shadow:inset 0 0 0 0 color-mix(in srgb,var(--accent) 60%,transparent)}45%{box-shadow:inset 0 0 0 3px color-mix(in srgb,var(--accent) 60%,transparent)}100%{box-shadow:inset 0 0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}}

/* Native-style mobile sheets */
.sheet-handle,.modal-card::before{content:'';display:none}
@media(max-width:600px){
  .modal-card{will-change:transform;touch-action:pan-y}
  .modal-card::before{display:block;position:sticky;top:-8px;z-index:5;width:42px;height:5px;margin:-4px auto 7px;border-radius:99px;background:color-mix(in srgb,var(--text) 36%,transparent)}
  .modal-card.sheet-dragging{transition:none!important}
  .modal-head{touch-action:none}
  .play-card{max-height:94dvh!important}
  .confirm-card{max-height:none!important;padding-bottom:calc(18px + env(safe-area-inset-bottom))!important}
  .confirm-card .modal-head small{display:block;max-width:290px;font-size:12px;line-height:1.35;margin-top:5px;color:var(--muted)}
  .shortcut-card{max-height:72dvh!important}
}

/* Mobile action bar */
.mobile-action-bar{min-height:64px;padding-top:4px!important}
.mobile-action-bar button{min-width:0;position:relative;overflow:hidden}
.mobile-action-bar button.is-active{background:color-mix(in srgb,var(--selected) 42%,transparent)!important;box-shadow:inset 0 2px 0 var(--accent)}
.mobile-action-bar button:active{transform:scale(.97)}
.mobile-action-bar .danger-quick::after{content:'';position:absolute;left:8px;right:8px;bottom:2px;height:2px;transform:scaleX(0);transform-origin:left;border-radius:2px;background:#e36d66}
.mobile-action-bar .danger-quick.holding::after{animation:holdClear .65s linear forwards}
@keyframes holdClear{to{transform:scaleX(1)}}

/* Touch forgiveness without visually enlarging cells */
@media(pointer:coarse){
  .play-cell,.player-cell,.section-collapse,.add-pitcher-btn{touch-action:manipulation}
  .play-cell{cursor:pointer}
  .section-collapse,.add-pitcher-btn,.top-icon,.top-action{min-width:44px;min-height:44px}
}

/* More systematic text fitting */
.team-header-name,.matchup-team select,.player-main,.pitcher-name input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.play-entry .play-code,.play-entry .rbi-code,.standalone-out{font-size:clamp(5px,1.7vw,11px)}
.play-entry .play-code.notation-compact{font-size:clamp(5.8px,1.4vw,8px)!important}.play-entry .play-code.notation-tiny{font-size:clamp(5px,1.2vw,6.8px)!important}.play-entry .rbi-code.notation-compact{font-size:clamp(4.8px,1.15vw,6.2px)!important}.play-entry .rbi-code.notation-tiny{font-size:clamp(4.2px,1vw,5.4px)!important}

/* Shortcut / confirmation sheets */
.shortcut-grid{display:grid;grid-template-columns:max-content 1fr;gap:10px 14px;align-items:center;padding:8px 2px}.shortcut-grid kbd{min-width:80px;padding:6px 8px;border:1px solid var(--line);border-bottom-width:3px;border-radius:7px;background:var(--panel2);color:var(--text);font-size:11px;font-weight:900;text-align:center}.shortcut-grid span{font-size:12px;color:var(--muted)}
.confirm-actions .danger{color:#ff837b!important;border-color:rgba(226,83,73,.5)!important}

/* Desktop becomes a true workspace */
@media(min-width:1100px){
  main{max-width:1580px!important;padding-left:20px!important;padding-right:20px!important}
  .unified-score-table{--ord-w:30px;--player-w:180px;--pos-w:44px;--inning-w:82px;--stat-w:62px;width:1510px!important;min-width:1510px!important}
  .team-scorebook-scroll{scrollbar-gutter:stable}
  body.has-play-inspector main{padding-right:470px!important;transition:padding-right .18s ease}
  #playModal:not(.hidden){display:block!important;position:fixed;inset:0 0 0 auto;width:450px;background:transparent!important;pointer-events:none;z-index:120;padding:0!important}
  #playModal .play-card{pointer-events:auto;width:450px!important;max-width:450px!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:18px 0 0 18px!important;overflow-y:auto!important;padding:18px!important;box-shadow:-18px 0 42px rgba(0,0,0,.34)!important}
  #playModal .modal-head{position:sticky;top:-18px;z-index:5;padding:14px 0;background:inherit}
  #playModal .modal-actions{position:sticky;bottom:-18px;background:inherit;padding:12px 0 18px}
  .play-cell[title]{position:relative}
  .play-cell:hover{z-index:3}
  .player-cell:hover{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 62%,transparent)}
}

/* Installed PWA safe areas */
@media(display-mode:standalone),(display-mode:fullscreen){
  .topbar{padding-top:calc(12px + env(safe-area-inset-top))}
  .mobile-action-bar{padding-bottom:calc(5px + env(safe-area-inset-bottom))!important}
  body::after{content:'';position:fixed;left:0;right:0;bottom:0;height:env(safe-area-inset-bottom);pointer-events:none;background:color-mix(in srgb,var(--panel2) 96%,#000);z-index:109}
}


/* ==========================================================
   v32 LAUNCH HOME + MOTION SYSTEM
   ========================================================== */
body.home-page{overflow-x:hidden;background:var(--bg)}
body.home-page .topbar,body.home-page #mobileActionBar{display:none!important}
body.home-page main{max-width:none!important;padding:0!important;margin:0!important}
body.home-page .wrigley-footer{display:none!important}

.launch-home{position:relative;min-height:100dvh;overflow:hidden;background:linear-gradient(160deg,var(--bg),color-mix(in srgb,var(--panel2) 90%,#000));color:var(--text);isolation:isolate}
.launch-home::before{content:'';position:absolute;inset:0;z-index:-3;background:radial-gradient(circle at 50% -10%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 38%),linear-gradient(180deg,transparent 60%,rgba(0,0,0,.22));animation:stadiumGlow 7s ease-in-out infinite alternate}
.launch-home::after{content:'';position:absolute;inset:0;z-index:-2;opacity:.16;background-image:linear-gradient(color-mix(in srgb,var(--line) 25%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--line) 20%,transparent) 1px,transparent 1px);background-size:52px 52px;mask-image:linear-gradient(to bottom,#000,transparent 70%);animation:gridDrift 20s linear infinite}
.launch-bg{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.launch-bg i{position:absolute;width:360px;height:360px;border-radius:50%;filter:blur(80px);opacity:.10;background:var(--accent);animation:orbFloat 14s ease-in-out infinite}
.launch-bg i:nth-child(1){left:-120px;top:8%}.launch-bg i:nth-child(2){right:-140px;top:35%;animation-delay:-5s}.launch-bg i:nth-child(3){left:35%;bottom:-180px;animation-delay:-9s}
.launch-inner{width:min(1120px,calc(100% - 34px));min-height:100dvh;margin:0 auto;padding:clamp(42px,8vh,86px) 0 calc(34px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);grid-template-areas:'brand game' 'actions game' 'footer footer';gap:26px 38px;align-content:center}
.launch-brand{grid-area:brand;max-width:620px;animation:launchReveal .75s cubic-bezier(.2,.8,.2,1) both}.launch-brand small{display:block;margin:12px 0 9px;font-size:11px;font-weight:950;letter-spacing:.22em;color:var(--accent)}.launch-brand h1{margin:0;font-family:"Baskerville Old Face","Palatino Linotype",Georgia,serif;font-size:clamp(52px,7vw,88px);line-height:.95;letter-spacing:-.02em;text-shadow:0 8px 34px rgba(0,0,0,.24)}.launch-brand p{max-width:540px;margin:18px 0 0;font-size:16px;line-height:1.55;color:var(--muted)}
.launch-diamond{width:58px;height:58px;display:grid;place-items:center;transform:rotate(45deg);border:3px solid var(--accent);border-radius:9px;box-shadow:0 0 0 7px color-mix(in srgb,var(--accent) 7%,transparent),0 12px 28px rgba(0,0,0,.22);animation:diamondIntro .9s cubic-bezier(.2,.85,.2,1) both,diamondFloat 4.5s ease-in-out 1.1s infinite}.launch-diamond span{width:17px;height:17px;border-radius:50%;background:var(--accent);box-shadow:0 0 22px color-mix(in srgb,var(--accent) 72%,transparent)}
.launch-game-card{grid-area:game;align-self:center;padding:20px;border:1px solid color-mix(in srgb,var(--line) 82%,var(--accent) 18%);border-radius:26px;background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 92%,#fff 3%),color-mix(in srgb,var(--panel) 96%,#000 4%));box-shadow:0 26px 60px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.04);backdrop-filter:blur(18px);animation:cardRise .8s .12s cubic-bezier(.2,.8,.2,1) both;overflow:hidden;position:relative}.launch-game-card::after{content:'';position:absolute;inset:-30% auto -30% -38%;width:32%;transform:skewX(-18deg);background:linear-gradient(90deg,transparent,rgba(255,255,255,.09),transparent);animation:sheen 5.8s 1.8s ease-in-out infinite;pointer-events:none}
.launch-game-top{display:flex;justify-content:space-between;gap:12px;align-items:center;padding-bottom:15px;border-bottom:1px solid var(--line);font-size:10px;font-weight:950;letter-spacing:.14em;color:var(--muted)}.launch-game-top span{color:var(--accent)}
.launch-matchup{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:14px;padding:28px 0}.launch-team{min-width:0;text-align:center}.launch-team img{display:block;width:74px;height:74px;object-fit:contain;margin:0 auto 10px;filter:drop-shadow(0 8px 14px rgba(0,0,0,.22))}.launch-team strong{display:block;font-size:24px}.launch-team small{display:block;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:10px}.launch-score{text-align:center}.launch-score strong{display:flex;align-items:center;gap:10px;font-size:32px}.launch-score strong span{font-size:18px;color:var(--accent)}.launch-score small{display:block;margin-top:5px;max-width:150px;color:var(--muted);font-size:9px;line-height:1.3}
.launch-primary{position:relative;width:100%;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 19px;border:1px solid color-mix(in srgb,var(--accent) 70%,var(--line));border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 23%,var(--panel2)),color-mix(in srgb,var(--accent) 10%,var(--panel)));color:var(--text);font-size:15px;font-weight:950;overflow:hidden;box-shadow:0 10px 26px rgba(0,0,0,.18);transition:transform .18s ease,box-shadow .18s ease}.launch-primary b{font-size:25px;color:var(--accent);transition:transform .18s ease}.launch-primary:hover{transform:translateY(-2px);box-shadow:0 16px 34px rgba(0,0,0,.24)}.launch-primary:hover b{transform:translateX(4px)}.launch-primary:active{transform:scale(.985)}
.launch-actions{grid-area:actions;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;animation:cardRise .8s .22s cubic-bezier(.2,.8,.2,1) both}.launch-actions button{min-height:112px;padding:16px;text-align:left;border:1px solid var(--line);border-radius:18px;background:color-mix(in srgb,var(--panel) 93%,#fff 2%);color:var(--text);box-shadow:0 12px 28px rgba(0,0,0,.13);transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease}.launch-actions button:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--accent) 58%,var(--line));background:color-mix(in srgb,var(--panel2) 90%,var(--accent) 5%);box-shadow:0 18px 34px rgba(0,0,0,.18)}.launch-actions button:active{transform:scale(.985)}.launch-action-icon{display:grid;width:34px;height:34px;place-items:center;margin-bottom:12px;border:1px solid color-mix(in srgb,var(--accent) 50%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--accent) 10%,transparent);color:var(--accent);font-size:17px}.launch-actions strong{display:block;font-size:13px}.launch-actions small{display:block;margin-top:4px;font-size:9px;color:var(--muted)}
.launch-footer{grid-area:footer;display:flex;align-items:center;justify-content:space-between;padding-top:4px;color:var(--muted);font-size:10px;animation:launchReveal .7s .35s both}.launch-footer button{border:0;background:transparent;color:var(--muted);font-weight:850;padding:8px 0}.launch-footer button:hover{color:var(--text)}

/* Page transition and richer app motion */
#main.page-enter{animation:pageEnter .48s cubic-bezier(.2,.8,.2,1)}
.drawer.open{animation:drawerSpring .36s cubic-bezier(.2,.8,.2,1)}
.modal:not(.hidden) .modal-card{animation:sheetSpring .32s cubic-bezier(.2,.85,.2,1)}
.team-scorebook-head,.overview-title,.card,.live-game-bar{will-change:transform}
@media(hover:hover) and (pointer:fine){.team-scorebook:hover .team-scorebook-head{box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--accent) 35%,transparent),0 5px 18px rgba(0,0,0,.09)}}

@keyframes launchReveal{from{opacity:0;transform:translateY(16px);filter:blur(6px)}to{opacity:1;transform:none;filter:none}}
@keyframes diamondIntro{0%{opacity:0;transform:rotate(0deg) scale(.5)}65%{opacity:1;transform:rotate(50deg) scale(1.08)}100%{transform:rotate(45deg) scale(1)}}
@keyframes diamondFloat{0%,100%{translate:0 0}50%{translate:0 -7px}}
@keyframes cardRise{from{opacity:0;transform:translateY(26px) scale(.985)}to{opacity:1;transform:none}}
@keyframes stadiumGlow{0%{opacity:.7;transform:scale(1)}100%{opacity:1;transform:scale(1.04)}}
@keyframes gridDrift{to{background-position:52px 52px}}
@keyframes orbFloat{0%,100%{transform:translate3d(0,0,0) scale(1)}50%{transform:translate3d(38px,-24px,0) scale(1.12)}}
@keyframes sheen{0%,70%{left:-38%}88%,100%{left:120%}}
@keyframes pageEnter{from{opacity:0;transform:translateY(10px);filter:blur(3px)}to{opacity:1;transform:none;filter:none}}
@keyframes drawerSpring{0%{transform:translateX(-102%)}70%{transform:translateX(1.5%)}100%{transform:none}}
@keyframes sheetSpring{0%{opacity:0;transform:translateY(26px) scale(.985)}100%{opacity:1;transform:none}}

@media(max-width:760px){
  .launch-inner{width:min(100% - 24px,620px);min-height:100dvh;padding:calc(34px + env(safe-area-inset-top)) 0 calc(26px + env(safe-area-inset-bottom));grid-template-columns:1fr;grid-template-areas:'brand' 'game' 'actions' 'footer';gap:18px;align-content:start}
  .launch-brand{text-align:center;margin-top:clamp(12px,4vh,32px)}.launch-diamond{width:48px;height:48px;margin:0 auto}.launch-brand small{font-size:8px;margin-top:15px}.launch-brand h1{font-size:48px}.launch-brand p{max-width:430px;margin:12px auto 0;font-size:12px;line-height:1.45}
  .launch-game-card{padding:15px;border-radius:20px}.launch-matchup{padding:20px 0}.launch-team img{width:56px;height:56px}.launch-team strong{font-size:19px}.launch-team small{font-size:7.5px}.launch-score strong{font-size:26px}.launch-score small{max-width:105px;font-size:7px}.launch-primary{min-height:52px;border-radius:14px;font-size:13px}
  .launch-actions{gap:9px}.launch-actions button{min-height:92px;padding:12px;border-radius:15px}.launch-action-icon{width:29px;height:29px;margin-bottom:8px;border-radius:8px;font-size:14px}.launch-actions strong{font-size:11px}.launch-actions small{font-size:7.5px}.launch-footer{font-size:8px}
}
@media(max-width:390px){.launch-brand h1{font-size:42px}.launch-game-card{padding:13px}.launch-team img{width:50px;height:50px}.launch-actions button{min-height:86px}}
@media(prefers-reduced-motion:reduce){.launch-home::before,.launch-home::after,.launch-bg i,.launch-diamond,.launch-game-card::after,.launch-brand,.launch-game-card,.launch-actions,.launch-footer,#main.page-enter,.drawer.open,.modal:not(.hidden) .modal-card{animation:none!important}}


/* ==========================================================
   v33 PREMIUM MOBILE APP EXPERIENCE
   - static launch Home on phone
   - reliable bottom command bar semantics
   - deliberate Score primary action
   ========================================================== */
@media(max-width:760px){
  body.home-page{
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    height:100dvh!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
    touch-action:manipulation;
  }
  body.home-page main{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.home-page .launch-home{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.home-page .launch-inner{
    box-sizing:border-box!important;
    width:min(calc(100% - 22px),620px)!important;
    height:100dvh!important;
    min-height:0!important;
    padding:calc(max(12px,env(safe-area-inset-top)) + 8px) 0 calc(max(10px,env(safe-area-inset-bottom)) + 8px)!important;
    grid-template-columns:1fr!important;
    grid-template-areas:'brand' 'game' 'actions' 'footer'!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    gap:clamp(8px,1.4vh,13px)!important;
    align-content:stretch!important;
  }
  body.home-page .launch-brand{
    margin:0!important;
    text-align:center!important;
  }
  body.home-page .launch-diamond{width:36px!important;height:36px!important;border-width:2px!important;margin:0 auto!important;border-radius:7px!important}
  body.home-page .launch-diamond span{width:11px!important;height:11px!important}
  body.home-page .launch-brand small{font-size:7px!important;margin:8px 0 4px!important;letter-spacing:.20em!important}
  body.home-page .launch-brand h1{font-size:clamp(34px,10vw,44px)!important;line-height:.94!important}
  body.home-page .launch-brand p{margin:7px auto 0!important;font-size:10px!important;line-height:1.3!important;max-width:340px!important}
  body.home-page .launch-game-card{
    padding:clamp(10px,1.6vh,14px)!important;
    border-radius:19px!important;
    box-shadow:0 18px 46px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.045)!important;
  }
  body.home-page .launch-game-top{padding-bottom:9px!important;font-size:7.5px!important}
  body.home-page .launch-matchup{padding:clamp(8px,1.7vh,15px) 0!important;gap:8px!important}
  body.home-page .launch-team img{width:clamp(38px,11vw,50px)!important;height:clamp(38px,11vw,50px)!important;margin-bottom:5px!important}
  body.home-page .launch-team strong{font-size:16px!important}.launch-team small{font-size:6.8px!important}
  body.home-page .launch-score strong{font-size:23px!important;gap:7px!important}.launch-score strong span{font-size:13px!important}
  body.home-page .launch-score small{font-size:6.8px!important;margin-top:3px!important}
  body.home-page .launch-primary{min-height:44px!important;border-radius:13px!important;font-size:12px!important;padding:0 15px!important}
  body.home-page .launch-primary b{font-size:20px!important}
  body.home-page .launch-actions{
    min-height:0!important;
    height:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    align-self:stretch!important;
  }
  body.home-page .launch-actions button{
    min-height:0!important;
    height:100%!important;
    padding:10px 11px!important;
    border-radius:15px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
  }
  body.home-page .launch-action-icon{width:27px!important;height:27px!important;margin-bottom:6px!important;font-size:13px!important;border-radius:8px!important}
  body.home-page .launch-actions strong{font-size:10.5px!important}.launch-actions small{font-size:7px!important;margin-top:2px!important}
  body.home-page .launch-footer{padding-top:0!important;font-size:7.5px!important;min-height:24px!important}
  body.home-page .launch-footer button{padding:3px 0!important;font-size:8px!important}

  /* Native-like bottom command bar */
  body:not(.home-page) .mobile-action-bar{
    height:calc(66px + env(safe-area-inset-bottom))!important;
    min-height:0!important;
    padding:5px max(7px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:2px!important;
    background:color-mix(in srgb,var(--panel2) 88%,#000 12%)!important;
    border-top:1px solid color-mix(in srgb,var(--line) 75%,transparent)!important;
    box-shadow:0 -16px 36px rgba(0,0,0,.30),inset 0 1px rgba(255,255,255,.04)!important;
    backdrop-filter:blur(22px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(22px) saturate(135%)!important;
  }
  body:not(.home-page) .mobile-action-bar button{
    min-height:54px!important;
    height:54px!important;
    border-radius:14px!important;
    gap:3px!important;
    overflow:visible!important;
    transition:transform .15s ease,background .18s ease,color .18s ease,box-shadow .18s ease!important;
  }
  body:not(.home-page) .mobile-action-bar button span{font-size:18px!important;transition:transform .15s ease!important}
  body:not(.home-page) .mobile-action-bar button small{font-size:7.5px!important;font-weight:900!important;letter-spacing:.01em!important}
  body:not(.home-page) .mobile-action-bar button.is-active{
    background:color-mix(in srgb,var(--accent) 13%,var(--panel2))!important;
    box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 34%,transparent)!important;
  }
  body:not(.home-page) .mobile-action-bar button.is-active::before{
    content:'';position:absolute;top:4px;left:50%;width:18px;height:3px;transform:translateX(-50%);border-radius:99px;background:var(--accent);box-shadow:0 0 12px color-mix(in srgb,var(--accent) 42%,transparent)
  }
  body:not(.home-page) .mobile-action-bar .score-command{
    transform:translateY(-7px)!important;
    height:61px!important;
    border-radius:18px!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 18%,var(--panel2)),color-mix(in srgb,var(--panel2) 94%,#000))!important;
    border:1px solid color-mix(in srgb,var(--accent) 40%,var(--line))!important;
    box-shadow:0 8px 20px rgba(0,0,0,.25)!important;
  }
  body:not(.home-page) .mobile-action-bar .score-command span{font-size:22px!important;color:var(--accent)!important}
  body:not(.home-page) .mobile-action-bar .score-command.is-active{box-shadow:0 10px 24px rgba(0,0,0,.28),0 0 0 1px color-mix(in srgb,var(--accent) 42%,transparent)!important}
  body:not(.home-page) .mobile-action-bar .score-command.is-active::before{display:none!important}
  body:not(.home-page) .mobile-action-bar button.is-mode-on:not(.is-active)::after{
    content:'';position:absolute;top:8px;right:13px;width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px color-mix(in srgb,var(--accent) 65%,transparent)
  }
  .score-target-pulse{animation:scoreTargetPulse .52s ease both!important}
}
@keyframes scoreTargetPulse{0%{box-shadow:inset 0 0 0 0 color-mix(in srgb,var(--accent) 0%,transparent)}45%{box-shadow:inset 0 0 0 4px color-mix(in srgb,var(--accent) 72%,transparent),0 0 20px color-mix(in srgb,var(--accent) 24%,transparent)}100%{box-shadow:inset 0 0 0 0 transparent}}
@media(max-width:760px) and (max-height:730px){
  body.home-page .launch-brand p{display:none!important}
  body.home-page .launch-brand h1{font-size:34px!important}
  body.home-page .launch-diamond{width:30px!important;height:30px!important}
  body.home-page .launch-matchup{padding:7px 0!important}
  body.home-page .launch-team img{width:36px!important;height:36px!important}
  body.home-page .launch-actions button{padding:7px 9px!important}
  body.home-page .launch-action-icon{margin-bottom:3px!important}
}
@media(max-width:760px) and (max-height:650px){
  body.home-page .launch-brand small{display:none!important}
  body.home-page .launch-brand h1{font-size:30px!important}
  body.home-page .launch-game-card{padding:9px!important}
  body.home-page .launch-team small{display:none!important}
  body.home-page .launch-primary{min-height:39px!important}
  body.home-page .launch-footer span{display:none!important}
}

/* ==========================================================
   v34 SCORING MODES + ADVANCED FIELD
   Basic keeps the existing editor. Advanced and Pitch modes
   progressively reveal richer controls without changing the
   scorecard's core geometry.
   ========================================================== */
.mode-pill,.live-mode{
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid color-mix(in srgb,var(--accent) 55%,transparent);
  border-radius:999px;padding:3px 8px;font-style:normal;font-size:7px;font-weight:950;
  letter-spacing:.08em;text-transform:uppercase;color:var(--accent);
  background:color-mix(in srgb,var(--panel2) 88%,#000 6%);
}
.launch-game-top{gap:8px}.launch-game-top .mode-pill{margin-left:auto}.launch-game-top>b{margin-left:0}
.live-mode{margin-left:5px;vertical-align:1px;font-size:6px;padding:2px 6px}

.mode-card{max-width:920px!important}
.mode-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}
.mode-option{
  min-height:220px;padding:18px;text-align:left;border:1px solid var(--line);border-radius:18px;
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 92%,#fff 3%),var(--panel));
  color:var(--text);display:flex;flex-direction:column;gap:8px;position:relative;overflow:hidden;
  box-shadow:0 10px 24px rgba(0,0,0,.14);transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.mode-option::after{content:'';position:absolute;inset:auto -30% -45% 25%;height:130px;transform:rotate(-12deg);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--accent) 16%,transparent),transparent)}
.mode-option:hover{transform:translateY(-3px);border-color:var(--accent);box-shadow:0 15px 28px rgba(0,0,0,.22)}
.mode-option.featured{border-color:color-mix(in srgb,var(--accent) 70%,var(--line));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 12%,transparent),0 12px 26px rgba(0,0,0,.19)}
.mode-option .mode-icon{font-size:28px;color:var(--accent);line-height:1}
.mode-option strong{font-size:18px;letter-spacing:.03em;text-transform:uppercase}.mode-option small{font-size:10px;font-weight:900;color:var(--accent)}
.mode-option p{margin:0;color:var(--muted);font-size:10px;line-height:1.5;max-width:28ch}
.mode-note{margin-top:13px;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--panel2) 82%,#000 8%);border:1px solid var(--line);font-size:9px;color:var(--muted)}
.settings-hint{display:block;margin-top:6px;color:var(--muted);font-size:8px;line-height:1.35}

.advanced-tools,.pitch-tools{margin-top:16px;padding-top:2px}
.advanced-title{display:flex!important;align-items:center;justify-content:space-between}
.advanced-title b,#pitchCountBadge{font-size:8px;letter-spacing:.1em;padding:4px 8px;border:1px solid var(--accent);border-radius:999px;color:var(--accent)}
.advanced-layout{display:grid;grid-template-columns:minmax(300px,.9fr) minmax(320px,1.1fr);gap:12px}
.defense-field-card,.advanced-runner-card,.pitch-tools{
  border:1px solid var(--line);border-radius:16px;padding:12px;background:color-mix(in srgb,var(--panel) 90%,#000 4%);
}
.field-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}
.field-card-head strong{display:block;font-size:10px;letter-spacing:.08em}.field-card-head small{display:block;margin-top:3px;font-size:7px;color:var(--muted)}
.field-card-head button{min-height:30px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--text);font-size:8px;font-weight:900}
.baseball-field{position:relative;aspect-ratio:1.25/1;border-radius:16px;overflow:hidden;background:linear-gradient(180deg,#265b3c,#17432f);border:1px solid color-mix(in srgb,var(--accent) 34%,var(--line));box-shadow:inset 0 -35px 65px rgba(0,0,0,.18)}
.field-grass{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 108%,rgba(211,184,124,.28) 0 25%,transparent 26%),repeating-linear-gradient(105deg,rgba(255,255,255,.025) 0 14px,rgba(0,0,0,.025) 14px 28px)}
.field-diamond{position:absolute;left:50%;top:61%;width:35%;aspect-ratio:1;transform:translate(-50%,-50%) rotate(45deg);border:2px solid rgba(238,220,176,.82);background:rgba(178,145,85,.15)}
.field-team-label{position:absolute;left:10px;top:8px;font-size:7px;font-weight:950;letter-spacing:.08em;color:rgba(255,255,255,.68)}
.field-pos{position:absolute;transform:translate(-50%,-50%);width:52px;height:52px;border-radius:50%;border:1px solid rgba(238,228,201,.45);background:rgba(6,33,22,.84);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;box-shadow:0 5px 12px rgba(0,0,0,.22);transition:transform .15s ease,border-color .15s ease,background .15s ease}
.field-pos:hover,.field-pos.selected{transform:translate(-50%,-50%) scale(1.08);border-color:#f0d99d;background:#245c42;box-shadow:0 0 0 2px rgba(240,217,157,.12),0 7px 15px rgba(0,0,0,.26)}
.field-pos b{font-size:9px;line-height:1}.field-pos small{display:block;max-width:44px;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:5.5px;color:#ddd9cb}
.fielder-selection{margin-top:8px;padding:7px 9px;border-radius:9px;background:var(--panel2);font-size:8px;font-weight:850;color:var(--text);border:1px solid var(--line)}

.advanced-runner-list{display:grid;gap:8px}.runner-empty,.pitch-empty{padding:18px 12px;text-align:center;border:1px dashed var(--line);border-radius:10px;color:var(--muted);font-size:9px}
.advanced-runner-row{display:grid;grid-template-columns:minmax(105px,1.25fr) minmax(92px,.8fr) minmax(108px,1fr) minmax(86px,.75fr);gap:7px;align-items:end;padding:9px;border:1px solid var(--line);border-radius:11px;background:color-mix(in srgb,var(--panel2) 88%,#000 4%)}
.runner-ident b{display:block;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.runner-ident small{font-size:6.5px;color:var(--muted)}
.advanced-runner-row label{font-size:6.5px;color:var(--muted);font-weight:900;letter-spacing:.04em}.advanced-runner-row select,.advanced-runner-row input{width:100%;height:34px;margin-top:4px;padding:0 7px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font-size:8px;font-weight:850}

.pitch-tools>.editor-section-title{display:flex!important;justify-content:space-between;align-items:center;margin-top:0}
.pitch-entry-grid{display:grid;grid-template-columns:1fr .75fr 1.25fr auto;gap:8px;align-items:end}.pitch-entry-grid label{font-size:7px;color:var(--muted);font-weight:900}.pitch-entry-grid select,.pitch-entry-grid input{width:100%;height:38px;margin-top:4px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:0 8px}.pitch-entry-grid button{height:38px;padding:0 14px;border:1px solid var(--accent);border-radius:9px;background:var(--panel2);color:var(--text);font-weight:950;font-size:9px}
.pitch-sequence{display:flex;gap:6px;overflow-x:auto;padding:10px 1px 8px;scrollbar-width:thin}.pitch-chip{flex:0 0 auto;display:grid;grid-template-columns:auto auto;gap:2px 6px;align-items:center;padding:7px 9px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);font-size:8px;color:var(--text)}.pitch-chip>b{color:var(--accent)}.pitch-chip small{grid-column:1/-1;font-size:6px;color:var(--muted)}

@media(max-width:900px){.mode-options{grid-template-columns:1fr}.mode-option{min-height:128px}.advanced-layout{grid-template-columns:1fr}.pitch-entry-grid{grid-template-columns:1fr 1fr}.pitch-entry-grid button{grid-column:1/-1}.advanced-runner-row{grid-template-columns:1fr 1fr}.runner-ident{grid-column:1/-1}}
@media(max-width:600px){
 .mode-card{max-height:min(88dvh,760px)!important;overflow:auto!important}.mode-options{gap:8px}.mode-option{min-height:116px;padding:13px;border-radius:15px}.mode-option .mode-icon{font-size:21px}.mode-option strong{font-size:15px}.mode-option p{font-size:8px}.mode-note{font-size:7px}
 .play-card .advanced-tools,.play-card .pitch-tools{margin-left:-2px;margin-right:-2px}.defense-field-card,.advanced-runner-card,.pitch-tools{padding:9px;border-radius:13px}
 .baseball-field{aspect-ratio:1.15/1}.field-pos{width:44px;height:44px}.field-pos b{font-size:8px}.field-pos small{font-size:5px;max-width:38px}
 .advanced-runner-row{grid-template-columns:1fr 1fr;gap:6px}.advanced-runner-row select,.advanced-runner-row input{height:36px;font-size:8px}.runner-ident{grid-column:1/-1}
 .pitch-entry-grid{grid-template-columns:1fr 1fr}.pitch-entry-grid label:nth-child(3){grid-column:1/-1}.pitch-entry-grid button{grid-column:1/-1}
 .mode-pill{font-size:5.8px;padding:2px 5px}.live-mode{display:none}
}

/* ==========================================================
   v35 ADVANCED EDITOR + TEAM DEFENSIVE ALIGNMENT
   - Play Editor uses an even 3x3 fielder picker.
   - Advanced/Pitch scorebooks show a full defensive field
     below each lineup and above the pitching section.
   ========================================================== */
.advanced-layout{
  grid-template-columns:minmax(280px,.82fr) minmax(360px,1.18fr);
  gap:10px;
  align-items:start;
}
.defense-field-card,.advanced-runner-card{
  min-width:0;
  padding:11px;
}
.field-card-head{
  min-height:38px;
  margin-bottom:8px;
}
.field-card-head>div{min-width:0}
.field-card-head strong{font-size:9.5px;line-height:1.1}
.field-card-head small{font-size:6.7px;line-height:1.3}

/* Editor fielder selector: intentionally not a field diagram. The
   permanent lineup field below the scorecard handles that role. */
.fielder-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  padding:7px;
  border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line));
  border-radius:13px;
  background:color-mix(in srgb,var(--panel2) 88%,#000 5%);
}
.fielder-grid-team{
  grid-column:1/-1;
  padding:2px 3px 4px;
  font-size:6.5px;
  font-weight:950;
  letter-spacing:.1em;
  color:var(--muted);
}
.fielder-grid-pos{
  min-width:0;
  min-height:62px;
  padding:7px 5px 6px;
  border:1px solid var(--line);
  border-radius:10px;
  background:color-mix(in srgb,var(--panel) 86%,#fff 2%);
  color:var(--text);
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-rows:auto auto;
  align-items:center;
  gap:3px 5px;
  text-align:left;
  transition:transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.fielder-grid-pos>span{
  grid-row:1/3;
  width:27px;height:27px;border-radius:8px;
  display:grid;place-items:center;
  border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));
  color:var(--accent);font-size:8.5px;font-weight:950;
  background:color-mix(in srgb,var(--panel2) 90%,#000 4%);
}
.fielder-grid-pos>strong{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:7px;line-height:1.15;color:var(--text);
}
.fielder-grid-pos>small{
  font-size:6px;font-weight:900;color:var(--muted);
}
.fielder-grid-pos:hover,.fielder-grid-pos.selected{
  transform:translateY(-1px);
  border-color:var(--accent);
  background:color-mix(in srgb,var(--panel2) 82%,var(--accent) 8%);
  box-shadow:0 5px 12px rgba(0,0,0,.16);
}
.fielder-grid-pos.selected>span{
  background:var(--accent);color:var(--bg);
}
.fielder-selection{
  min-height:30px;
  display:flex;align-items:center;
  margin-top:7px;padding:7px 9px;
  font-size:7.5px;
}

/* Team-level defensive field. */
.team-defense-pane{
  margin:12px 0 0;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:color-mix(in srgb,var(--panel) 92%,#000 3%);
  box-shadow:0 8px 20px rgba(0,0,0,.12);
}
.defense-pane-title{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  min-height:42px;
  padding:0 13px;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--panel2) 92%,#000 4%);
}
.defense-pane-title>small{
  font-size:6.5px;font-weight:950;letter-spacing:.08em;
  color:var(--accent);
}
.team-defense-field{
  position:relative;
  height:330px;
  overflow:hidden;
  isolation:isolate;
  background:linear-gradient(180deg,#285f40 0%,#17422e 72%,#123723 100%);
}
.team-defense-grass{
  position:absolute;inset:0;z-index:-4;
  background:
    repeating-linear-gradient(106deg,rgba(255,255,255,.025) 0 24px,rgba(0,0,0,.025) 24px 48px),
    radial-gradient(ellipse at 50% 103%,rgba(205,181,126,.18) 0 21%,transparent 22%);
}
.team-defense-cutout{
  position:absolute;left:50%;bottom:-95px;width:76%;height:285px;
  transform:translateX(-50%);
  border:2px solid rgba(235,220,177,.25);
  border-radius:50% 50% 0 0;
  background:radial-gradient(ellipse at 50% 78%,rgba(186,145,85,.33) 0 25%,transparent 26%);
  z-index:-3;
}
.team-defense-diamond{
  position:absolute;left:50%;top:64%;width:27%;aspect-ratio:1;
  transform:translate(-50%,-50%) rotate(45deg);
  border:2px solid rgba(245,227,183,.86);
  background:rgba(190,151,87,.16);
  box-shadow:0 0 0 1px rgba(0,0,0,.07);
  z-index:-1;
}
.team-defense-home{
  position:absolute;left:50%;top:91%;width:10px;height:10px;
  transform:translate(-50%,-50%) rotate(45deg);
  border:1px solid rgba(255,245,220,.9);background:rgba(255,245,220,.82);
  z-index:0;
}
.team-defense-pos{
  position:absolute;
  transform:translate(-50%,-50%);
  width:88px;
  min-height:47px;
  padding:5px 6px;
  border:1px solid rgba(242,232,205,.42);
  border-radius:12px;
  background:rgba(5,29,20,.88);
  color:#fff;
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:auto auto;
  gap:2px 6px;
  align-items:center;
  text-align:left;
  box-shadow:0 6px 15px rgba(0,0,0,.22);
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
  transition:transform .15s ease,border-color .15s ease,background .15s ease;
}
.team-defense-pos>span{
  grid-row:1/3;
  width:27px;height:27px;border-radius:9px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.17);
  color:#f4dca6;font-size:8px;font-weight:950;
}
.team-defense-pos>strong{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:6.8px;line-height:1.12;
}
.team-defense-pos>small{
  font-size:5.7px;font-weight:850;color:rgba(255,255,255,.65);
}
.team-defense-pos.is-open{opacity:.58;border-style:dashed}
.team-defense-pos.is-filled:hover{
  transform:translate(-50%,-50%) scale(1.04);
  border-color:#f0d99d;
  background:rgba(20,68,47,.94);
}
.team-defense-foot{
  min-height:34px;padding:0 12px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-top:1px solid var(--line);
  color:var(--muted);font-size:6.5px;font-weight:800;
  background:color-mix(in srgb,var(--panel2) 90%,#000 5%);
}
.defense-mode-note{color:var(--accent);white-space:nowrap}

/* Wrigley field treatment stays intentionally field-green but inherits
   the scorecard framing so it reads as part of the same section. */
body.theme-wrigley .team-defense-pane{border-color:color-mix(in srgb,var(--accent) 72%,#6c5c34)}
body.theme-wrigley .team-defense-field{background:linear-gradient(180deg,#24573a,#103725 74%,#0c2e1e)}
body.theme-wrigley .team-defense-pos{background:rgba(5,31,20,.91)}

@media(max-width:900px){
  .advanced-layout{grid-template-columns:1fr;gap:8px}
  .team-defense-field{height:300px}
  .team-defense-pos{width:80px;min-height:44px}
}
@media(max-width:600px){
  .advanced-tools{margin-top:12px}
  .advanced-title{margin-bottom:6px!important}
  .defense-field-card,.advanced-runner-card{padding:8px;border-radius:12px}
  .fielder-grid{gap:5px;padding:5px;border-radius:11px}
  .fielder-grid-pos{min-height:55px;padding:5px 4px;border-radius:9px;gap:2px 4px}
  .fielder-grid-pos>span{width:24px;height:24px;border-radius:7px;font-size:7.5px}
  .fielder-grid-pos>strong{font-size:6.2px}
  .fielder-grid-pos>small{font-size:5.5px}
  .advanced-runner-list{gap:6px}
  .advanced-runner-row{padding:7px}

  .team-defense-pane{margin-top:9px;border-radius:13px}
  .defense-pane-title{min-height:37px;padding:0 9px}
  .defense-pane-title>span{font-size:8px}
  .defense-pane-title>small{font-size:5.6px}
  .team-defense-field{height:258px}
  .team-defense-pos{width:67px;min-height:39px;padding:4px;border-radius:10px;gap:1px 4px}
  .team-defense-pos>span{width:22px;height:22px;border-radius:7px;font-size:7px}
  .team-defense-pos>strong{font-size:5.5px}
  .team-defense-pos>small{font-size:4.8px}
  .team-defense-foot{min-height:29px;padding:0 8px;font-size:5.5px}
}
@media(max-width:390px){
  .team-defense-field{height:238px}
  .team-defense-pos{width:61px;min-height:37px}
  .team-defense-pos>span{width:20px;height:20px;font-size:6.4px}
  .team-defense-pos>strong{font-size:5px}
  .team-defense-pos>small{font-size:4.4px}
}

/* ==========================================================
   v36 PITCH-BY-PITCH EDITOR POLISH
   A clear at-bat workflow: pitch tracker first, final play
   details second. Advanced and Basic scoring behavior remains
   unchanged.
   ========================================================== */
.pitch-tools{
  margin:12px 0 16px!important;
  padding:0!important;
  border:1px solid color-mix(in srgb,var(--accent) 62%,var(--line))!important;
  border-radius:18px!important;
  overflow:hidden;
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 92%,#000 3%),color-mix(in srgb,var(--panel) 94%,#000 3%))!important;
  box-shadow:0 14px 30px rgba(0,0,0,.17),inset 0 1px 0 rgba(255,255,255,.035);
}
.pitch-tools-head{
  min-height:86px;
  padding:15px 16px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  border-bottom:1px solid var(--line);
  background:linear-gradient(105deg,color-mix(in srgb,var(--panel2) 92%,#000 4%),color-mix(in srgb,var(--accent) 8%,var(--panel2)));
}
.pitch-title-copy{min-width:0}.pitch-title-copy .pitch-kicker{
  display:block;margin-bottom:4px;color:var(--accent);font-size:7px;font-weight:950;letter-spacing:.16em;text-transform:uppercase;
}
.pitch-title-copy>strong{display:block;color:var(--text);font-size:15px;line-height:1.1;letter-spacing:.06em}
.pitch-title-copy>small{display:block;max-width:54ch;margin-top:6px;color:var(--muted);font-size:7.5px;line-height:1.42;font-weight:700}
.pitch-count-card{
  min-width:116px;padding:9px 12px;border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:13px;
  display:grid;grid-template-columns:auto auto;grid-template-areas:"label next" "count count" "sub sub";align-items:center;
  background:color-mix(in srgb,var(--panel) 90%,#000 4%);box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.pitch-count-card>small{grid-area:label;color:var(--muted);font-size:6.5px;font-weight:950;letter-spacing:.12em}
.pitch-count-card>b{grid-area:count;color:var(--accent);font-size:28px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:.02em;margin:4px 0 3px}
.pitch-count-card>span{grid-area:sub;color:var(--muted);font-size:5.5px;font-weight:900;letter-spacing:.08em}
.pitch-count-card>em{grid-area:next;justify-self:end;color:var(--text);font-style:normal;font-size:6px;font-weight:900;padding:3px 6px;border-radius:999px;background:var(--panel2);border:1px solid var(--line)}
.pitch-count-lights{
  display:flex;gap:18px;align-items:center;padding:9px 16px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--panel) 94%,#000 4%);
}
.pitch-light-group{display:flex;align-items:center;gap:8px}.pitch-light-group small{font-size:6px;font-weight:950;letter-spacing:.1em;color:var(--muted)}
.pitch-light-group>span{display:flex;gap:5px}.pitch-light-group i{display:block;width:10px;height:10px;border-radius:50%;border:1px solid color-mix(in srgb,var(--accent) 38%,var(--line));background:color-mix(in srgb,var(--panel2) 82%,#000 8%);box-shadow:inset 0 1px 2px rgba(0,0,0,.25)}
.pitch-light-group i.on{background:var(--accent);border-color:var(--accent);box-shadow:0 0 9px color-mix(in srgb,var(--accent) 35%,transparent)}
.pitch-light-group.strikes i.on{background:color-mix(in srgb,var(--accent) 72%,var(--text) 28%)}
.pitch-entry-card{padding:13px 16px 15px;border-bottom:1px solid var(--line)}
.pitch-entry-card-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:10px}
.pitch-entry-card-head strong,.pitch-sequence-head strong{display:block;color:var(--text);font-size:9px;letter-spacing:.08em}
.pitch-entry-card-head small,.pitch-sequence-head small{display:block;margin-top:3px;color:var(--muted);font-size:6.8px;line-height:1.35}
.pitch-entry-grid{
  display:grid!important;
  grid-template-columns:minmax(170px,1.15fr) minmax(120px,.7fr) minmax(190px,1.25fr) minmax(150px,.8fr)!important;
  gap:9px!important;align-items:end!important;
}
.pitch-entry-grid label{display:block;min-width:0;color:var(--muted)!important;font-size:6.7px!important;font-weight:950!important;letter-spacing:.05em}
.pitch-entry-grid label>span{display:flex;align-items:center;gap:4px;margin-bottom:5px}.pitch-entry-grid label>span small{font-size:5.7px;color:var(--muted);font-weight:700;letter-spacing:0}
.pitch-entry-grid select,.pitch-entry-grid input{
  height:43px!important;margin:0!important;padding:0 10px!important;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--panel)!important;color:var(--text)!important;font-size:9px!important;font-weight:850!important;outline:none!important;
}
.pitch-entry-grid select:focus,.pitch-entry-grid input:focus{border-color:var(--accent)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 13%,transparent)!important}
.pitch-velo-wrap{display:grid;grid-template-columns:1fr auto;align-items:center;height:43px;border:1px solid var(--line);border-radius:10px;background:var(--panel);overflow:hidden}
.pitch-velo-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 13%,transparent)}
.pitch-velo-wrap input{width:100%!important;height:41px!important;border:0!important;border-radius:0!important;text-align:center!important;font-size:13px!important;font-variant-numeric:tabular-nums}.pitch-velo-wrap input:focus{box-shadow:none!important}
.pitch-velo-wrap>b{padding:0 9px 0 3px;color:var(--muted);font-size:6px;letter-spacing:.08em}
.record-pitch-btn{
  height:43px!important;padding:0 12px!important;border:1px solid var(--accent)!important;border-radius:11px!important;
  display:grid!important;grid-template-columns:auto 1fr!important;grid-template-rows:auto auto!important;column-gap:7px!important;align-content:center!important;text-align:left!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 18%,var(--panel2)),var(--panel2))!important;color:var(--text)!important;box-shadow:0 7px 15px rgba(0,0,0,.14)!important;
}
.record-pitch-btn>span{grid-row:1/3;font-size:16px;line-height:1;color:var(--accent)}.record-pitch-btn>strong{font-size:8px;line-height:1.1}.record-pitch-btn>small{font-size:5.7px;color:var(--muted);line-height:1.1}
.record-pitch-btn:hover{transform:translateY(-1px);background:color-mix(in srgb,var(--accent) 15%,var(--panel2))!important}.record-pitch-btn:active{transform:translateY(0) scale(.985)}
.record-pitch-btn.pitch-added{animation:pitchRecorded .35s ease}
@keyframes pitchRecorded{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 40%,transparent)}50%{box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 16%,transparent),0 8px 18px rgba(0,0,0,.16)}100%{box-shadow:0 7px 15px rgba(0,0,0,.14)}}
.pitch-sequence-card{padding:13px 16px 14px}.pitch-sequence-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}
.pitch-sequence-head .small-btn{min-height:30px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--text);font-size:7px;font-weight:900}
.pitch-sequence{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;max-height:218px;overflow-y:auto!important;overflow-x:hidden!important;padding:1px!important;scrollbar-width:thin;
}
.pitch-chip{
  min-width:0!important;min-height:52px;padding:7px 9px!important;border:1px solid var(--line)!important;border-radius:11px!important;
  display:grid!important;grid-template-columns:28px minmax(0,1fr) auto!important;gap:8px!important;align-items:center!important;background:color-mix(in srgb,var(--panel2) 90%,#000 3%)!important;color:var(--text)!important;
}
.pitch-chip-no{width:27px;height:27px;border-radius:8px;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--accent) 52%,var(--line));color:var(--accent);font-size:8px;font-weight:950;background:color-mix(in srgb,var(--panel) 88%,#000 3%)}
.pitch-chip-main{min-width:0}.pitch-chip-main>strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7.7px;color:var(--text)}.pitch-chip-main>small{display:block;margin-top:3px;font-size:6px;color:var(--muted);font-weight:800}
.pitch-chip>b{justify-self:end;max-width:105px;padding:4px 6px;border-radius:7px;background:var(--panel);border:1px solid var(--line);color:var(--text)!important;font-size:6.3px!important;text-align:center;line-height:1.15}
.pitch-chip.is-ball>b{border-color:color-mix(in srgb,var(--accent) 35%,var(--line))}.pitch-chip.is-strike>b,.pitch-chip.is-play>b,.pitch-chip.is-hbp>b{border-color:color-mix(in srgb,var(--accent) 70%,var(--line));color:var(--accent)!important}
.pitch-empty{grid-column:1/-1!important;min-height:72px!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:12px!important}.pitch-empty>strong{font-size:8px;color:var(--text)}.pitch-empty>small{font-size:6.5px;color:var(--muted)}
.pitch-workflow-note{display:flex;gap:9px;align-items:flex-start;padding:10px 16px 12px;border-top:1px solid var(--line);background:color-mix(in srgb,var(--panel2) 88%,#000 5%)}
.pitch-workflow-note>span{flex:0 0 auto;margin-top:1px;padding:3px 6px;border:1px solid color-mix(in srgb,var(--accent) 60%,var(--line));border-radius:999px;color:var(--accent);font-size:5.5px;font-weight:950;letter-spacing:.12em}.pitch-workflow-note p{margin:0;color:var(--muted);font-size:6.8px;line-height:1.4}.pitch-workflow-note b{color:var(--text)}
.pitch-mode-editor>.situation{margin-bottom:0!important}.pitch-mode-editor>.pitch-tools+ .editor-section-title{margin-top:14px!important}

@media(max-width:900px){
  .pitch-entry-grid{grid-template-columns:1fr 1fr!important}.pitch-result-field{grid-column:1/-1}.record-pitch-btn{grid-column:1/-1!important}
  .pitch-sequence{grid-template-columns:1fr!important;max-height:250px}
}
@media(max-width:600px){
  .pitch-mode-editor{padding-bottom:max(10px,env(safe-area-inset-bottom))!important}
  .pitch-tools{margin:8px 0 12px!important;border-radius:14px!important}
  .pitch-tools-head{min-height:75px;padding:11px 10px;gap:8px;grid-template-columns:minmax(0,1fr) 94px}
  .pitch-title-copy .pitch-kicker{font-size:5.5px;margin-bottom:3px}.pitch-title-copy>strong{font-size:11px}.pitch-title-copy>small{font-size:6px;line-height:1.3;margin-top:4px;max-width:38ch}
  .pitch-count-card{min-width:94px;padding:7px 8px;border-radius:11px}.pitch-count-card>small{font-size:5px}.pitch-count-card>b{font-size:23px;margin:3px 0 2px}.pitch-count-card>span{font-size:4.5px}.pitch-count-card>em{font-size:4.8px;padding:2px 5px}
  .pitch-count-lights{padding:7px 10px;gap:15px}.pitch-light-group{gap:6px}.pitch-light-group small{font-size:5px}.pitch-light-group>span{gap:4px}.pitch-light-group i{width:8px;height:8px}
  .pitch-entry-card{padding:10px}.pitch-entry-card-head{margin-bottom:8px}.pitch-entry-card-head strong,.pitch-sequence-head strong{font-size:7.5px}.pitch-entry-card-head small,.pitch-sequence-head small{font-size:5.7px}
  .pitch-entry-grid{grid-template-columns:1fr 1fr!important;gap:7px!important}.pitch-entry-grid label{font-size:5.8px!important}.pitch-entry-grid label>span{margin-bottom:4px}.pitch-entry-grid select,.pitch-entry-grid input,.pitch-velo-wrap{height:40px!important}.pitch-velo-wrap input{height:38px!important;font-size:12px!important}.pitch-velo-wrap>b{font-size:5px;padding-right:7px}
  .pitch-result-field{grid-column:1/-1}.record-pitch-btn{grid-column:1/-1!important;height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;text-align:center!important}.record-pitch-btn>span{font-size:15px}.record-pitch-btn>strong{font-size:7.5px}.record-pitch-btn>small{display:none}
  .pitch-sequence-card{padding:10px}.pitch-sequence-head{margin-bottom:7px}.pitch-sequence-head .small-btn{min-height:28px;padding:0 8px;font-size:6px}.pitch-sequence{grid-template-columns:1fr!important;gap:5px!important;max-height:204px}
  .pitch-chip{min-height:47px!important;padding:6px 7px!important;grid-template-columns:24px minmax(0,1fr) auto!important;gap:6px!important;border-radius:9px!important}.pitch-chip-no{width:23px;height:23px;border-radius:7px;font-size:7px}.pitch-chip-main>strong{font-size:6.7px}.pitch-chip-main>small{font-size:5.3px}.pitch-chip>b{max-width:88px;font-size:5.5px!important;padding:3px 5px}
  .pitch-workflow-note{padding:8px 10px 9px;gap:7px}.pitch-workflow-note>span{font-size:4.8px}.pitch-workflow-note p{font-size:5.8px}
}
@media(max-width:380px){
  .pitch-tools-head{grid-template-columns:minmax(0,1fr) 86px}.pitch-title-copy>small{max-width:29ch}.pitch-count-card>b{font-size:21px}
  .pitch-entry-grid{grid-template-columns:minmax(0,1fr) 92px!important}.pitch-entry-grid select{font-size:8px!important}.pitch-chip>b{max-width:76px}
}


/* ==========================================================
   v37 PREMIUM MOBILE POLISH + GUIDED SCORING
   Presentation-only refinements. Existing score geometry and
   scoring data behavior are intentionally preserved.
   ========================================================== */

/* Drawer: one transform transition only — no overshoot animation. */
.drawer{
  transform:translate3d(-102%,0,0)!important;
  transition:transform .24s cubic-bezier(.22,.72,.22,1)!important;
  will-change:transform;
  animation:none!important;
  contain:layout paint style;
}
.drawer.open{
  transform:translate3d(0,0,0)!important;
  animation:none!important;
}
.drawer-shade{
  opacity:0;
  visibility:visible;
  transition:opacity .20s ease!important;
  will-change:opacity;
}
.drawer-shade.open{opacity:1}

/* Long team names: preserve the full selected name by scaling the
   typography before the select is allowed to truncate. */
.matchup-team select.team-name-long{font-size:9px!important;letter-spacing:-.025em!important;padding-right:14px!important}
.matchup-team select.team-name-xlong{font-size:8px!important;letter-spacing:-.035em!important;padding-right:13px!important}
.team-header-name.team-name-long{font-size:clamp(8.5px,2.5vw,12px)!important;letter-spacing:-.025em!important}
.team-header-name.team-name-xlong{font-size:clamp(7.6px,2.2vw,11px)!important;letter-spacing:-.035em!important}

/* Selected standings team reads as one continuous highlighted row. */
.standings-grid .standings-selected{
  background:color-mix(in srgb,var(--selected) 74%,var(--panel2) 26%)!important;
  color:var(--text)!important;
  font-weight:950!important;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--accent) 32%,transparent),inset 0 -1px 0 color-mix(in srgb,var(--accent) 32%,transparent)!important;
}
.standings-grid .standings-selected span,.standings-grid .standings-selected b{font-weight:950!important;color:inherit!important}
.standings-grid .standings-selected-start{
  border-left:3px solid color-mix(in srgb,var(--accent) 80%,#fff 20%)!important;
  padding-left:4px!important;
}
.standings-grid .standings-selected-end{box-shadow:inset -1px 0 0 color-mix(in srgb,var(--accent) 34%,transparent),inset 0 1px 0 color-mix(in srgb,var(--accent) 32%,transparent),inset 0 -1px 0 color-mix(in srgb,var(--accent) 32%,transparent)!important}
body.theme-wrigley .standings-grid .standings-selected{
  background:linear-gradient(90deg,rgba(55,122,71,.74),rgba(39,100,58,.62))!important;
  color:#fff7df!important;
  text-shadow:0 1px 1px rgba(0,0,0,.24);
}
body.theme-wrigley .standings-grid .standings-selected-start{border-left-color:#d8c18a!important}

/* Beginner-friendly path through richer scoring modes. */
.editor-guide{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
  margin:8px 0 12px;
  padding:7px;
  border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line));
  border-radius:12px;
  background:color-mix(in srgb,var(--panel2) 90%,var(--accent) 4%);
}
.editor-guide span{
  min-width:0;
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:6.8px;
  font-weight:850;
  line-height:1.2;
}
.editor-guide b{
  flex:0 0 auto;
  width:20px;height:20px;
  display:grid;place-items:center;
  border-radius:7px;
  background:color-mix(in srgb,var(--accent) 14%,var(--panel));
  border:1px solid color-mix(in srgb,var(--accent) 48%,var(--line));
  color:var(--accent);
  font-size:7px;
}

@media(max-width:760px){
  /* Home is a fixed phone dashboard. The action grid no longer stretches
     vertically on tall iPhones, which keeps labels large and easy to tap. */
  body.home-page .launch-inner{
    grid-template-rows:auto auto auto auto!important;
    align-content:center!important;
    gap:clamp(7px,1.2dvh,11px)!important;
    padding:calc(max(8px,env(safe-area-inset-top)) + 5px) 0 calc(max(7px,env(safe-area-inset-bottom)) + 5px)!important;
  }
  body.home-page .launch-brand p{font-size:9.5px!important;margin-top:5px!important}
  body.home-page .launch-game-card{padding:clamp(9px,1.25dvh,12px)!important;border-radius:17px!important}
  body.home-page .launch-game-top{padding-bottom:7px!important}
  body.home-page .launch-matchup{padding:clamp(5px,1dvh,9px) 0!important}
  body.home-page .launch-team img{width:clamp(35px,10vw,44px)!important;height:clamp(35px,10vw,44px)!important;margin-bottom:3px!important}
  body.home-page .launch-team strong{font-size:15px!important}
  body.home-page .launch-team small{font-size:6.6px!important;max-width:125px;margin-inline:auto!important}
  body.home-page .launch-score strong{font-size:21px!important}
  body.home-page .launch-primary{min-height:41px!important;font-size:11.5px!important}
  body.home-page .launch-actions{
    height:auto!important;
    min-height:0!important;
    grid-template-rows:repeat(2,clamp(72px,10.5dvh,92px))!important;
    gap:7px!important;
  }
  body.home-page .launch-actions button{
    height:auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:31px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-content:center!important;
    align-items:center!important;
    column-gap:9px!important;
    row-gap:2px!important;
    padding:9px 10px!important;
    border-radius:14px!important;
  }
  body.home-page .launch-action-icon{
    grid-row:1/3!important;
    width:30px!important;height:30px!important;
    margin:0!important;
    font-size:14px!important;
  }
  body.home-page .launch-actions strong{font-size:12px!important;line-height:1.05!important}
  body.home-page .launch-actions small{font-size:8px!important;line-height:1.15!important;margin:0!important}
  body.home-page .launch-footer{min-height:18px!important;font-size:7.5px!important}

  /* Make selected team names fit in the Wrigley matchup cards without
     sacrificing the logo or collapse control. */
  .matchup-team select.team-name-long{font-size:8.6px!important}
  .matchup-team select.team-name-xlong{font-size:7.6px!important}
  body.theme-wrigley .matchup-team select.team-name-long{font-size:8.4px!important}
  body.theme-wrigley .matchup-team select.team-name-xlong{font-size:7.4px!important}
  body.theme-wrigley .team-header-name.team-name-long{font-size:8.8px!important}
  body.theme-wrigley .team-header-name.team-name-xlong{font-size:8px!important}

  .editor-guide{grid-template-columns:1fr 1fr;gap:5px;margin:6px 0 9px;padding:6px;border-radius:10px}
  .editor-guide span{font-size:6.2px;gap:5px}.editor-guide b{width:18px;height:18px;font-size:6.5px}
}

@media(max-width:760px) and (max-height:700px){
  body.home-page .launch-brand p{display:none!important}
  body.home-page .launch-actions{grid-template-rows:repeat(2,68px)!important}
  body.home-page .launch-actions strong{font-size:11px!important}
  body.home-page .launch-actions small{font-size:7.2px!important}
}

@media(prefers-reduced-motion:reduce){
  .drawer,.drawer-shade{transition:none!important}
}


/* ==========================================================
   v38 VERIFIED MOBILE DELIVERY + NATIVE HOME/DRAWER
   This section is intentionally last and highly specific.
   It also ships with cache-busted CSS/JS URLs so deployments
   cannot silently show an older UI shell.
   ========================================================== */
@media (max-width:760px){
  /* Home: compact native dashboard. Nothing stretches to consume leftover height. */
  body.home-page .launch-inner{
    width:min(calc(100% - 24px),600px)!important;
    height:100dvh!important;
    min-height:0!important;
    padding:calc(max(10px,env(safe-area-inset-top)) + 4px) 0 calc(max(8px,env(safe-area-inset-bottom)) + 4px)!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-areas:'brand' 'game' 'actions' 'footer'!important;
    grid-template-rows:max-content max-content max-content max-content!important;
    align-content:start!important;
    gap:clamp(7px,1dvh,10px)!important;
    overflow:hidden!important;
  }
  body.home-page .launch-brand{margin:0!important;padding:0!important}
  body.home-page .launch-diamond{width:34px!important;height:34px!important;margin:0 auto!important}
  body.home-page .launch-brand small{margin:7px 0 3px!important;font-size:7px!important}
  body.home-page .launch-brand h1{font-size:clamp(34px,10vw,42px)!important;line-height:.95!important}
  body.home-page .launch-brand p{margin:5px auto 0!important;font-size:9.4px!important;line-height:1.25!important;max-width:330px!important}

  body.home-page .launch-game-card{
    padding:10px!important;
    border-radius:18px!important;
    box-shadow:0 12px 28px rgba(0,0,0,.20),inset 0 1px rgba(255,255,255,.035)!important;
  }
  body.home-page .launch-game-top{padding-bottom:7px!important;font-size:7.2px!important;letter-spacing:.11em!important}
  body.home-page .launch-game-top .mode-pill{font-size:6.4px!important;padding:4px 7px!important}
  body.home-page .launch-matchup{padding:7px 0!important;gap:6px!important}
  body.home-page .launch-team img{width:40px!important;height:40px!important;margin-bottom:2px!important}
  body.home-page .launch-team strong{font-size:15px!important;line-height:1!important}
  body.home-page .launch-team small{font-size:6.8px!important;margin-top:3px!important;max-width:116px!important}
  body.home-page .launch-score strong{font-size:21px!important;gap:6px!important}
  body.home-page .launch-score small{font-size:6.4px!important;margin-top:2px!important}
  body.home-page .launch-primary{min-height:42px!important;border-radius:12px!important;padding:0 14px!important;font-size:11.5px!important}

  /* The four choices are compact horizontal tiles, not giant empty squares. */
  body.home-page .launch-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,74px)!important;
    gap:8px!important;
    height:156px!important;
    min-height:156px!important;
    align-self:start!important;
  }
  body.home-page .launch-actions button{
    width:100%!important;
    height:74px!important;
    min-height:74px!important;
    padding:9px 10px!important;
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-content:center!important;
    align-items:center!important;
    justify-content:stretch!important;
    column-gap:9px!important;
    row-gap:2px!important;
    border-radius:14px!important;
    text-align:left!important;
  }
  body.home-page .launch-action-icon{
    grid-column:1!important;grid-row:1/3!important;
    width:34px!important;height:34px!important;margin:0!important;
    border-radius:10px!important;font-size:15px!important;
  }
  body.home-page .launch-actions strong{
    grid-column:2!important;grid-row:1!important;
    font-size:12.5px!important;line-height:1.05!important;margin:0!important;
  }
  body.home-page .launch-actions small{
    grid-column:2!important;grid-row:2!important;
    font-size:8.2px!important;line-height:1.1!important;margin:0!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  body.home-page .launch-footer{min-height:20px!important;padding:0!important;font-size:7.5px!important}
  body.home-page .launch-footer button{font-size:8.2px!important;padding:2px 0!important}

  /* Mobile hamburger menu: NO horizontal slide. It opens as a floating app sheet.
     Only opacity + small vertical scale/translation are animated, eliminating left/right jitter. */
  .drawer{
    left:12px!important;
    right:12px!important;
    top:calc(env(safe-area-inset-top) + 66px)!important;
    bottom:calc(env(safe-area-inset-bottom) + 76px)!important;
    width:auto!important;
    max-width:none!important;
    padding:12px!important;
    border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line))!important;
    border-radius:20px!important;
    overflow-y:auto!important;
    transform:translate3d(0,-8px,0) scale(.985)!important;
    transform-origin:50% 0!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transition:opacity .16s ease,transform .18s cubic-bezier(.2,.75,.25,1),visibility 0s linear .18s!important;
    animation:none!important;
    contain:paint!important;
    box-shadow:0 22px 54px rgba(0,0,0,.40)!important;
  }
  .drawer.open{
    transform:translate3d(0,0,0) scale(1)!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transition:opacity .16s ease,transform .18s cubic-bezier(.2,.75,.25,1),visibility 0s!important;
    animation:none!important;
  }
  .drawer-shade{
    opacity:0!important;
    transition:opacity .16s ease!important;
    backdrop-filter:blur(2px)!important;
  }
  .drawer-shade.open{opacity:1!important}

  /* Team selectors: use available card width before ellipsis. */
  .matchup-team{min-width:0!important;grid-template-columns:32px minmax(0,1fr)!important;column-gap:5px!important}
  .matchup-team select{min-width:0!important;width:100%!important;padding-left:4px!important;padding-right:17px!important;text-overflow:ellipsis!important}
  .matchup-team select.team-name-long{font-size:8.1px!important;letter-spacing:-.03em!important}
  .matchup-team select.team-name-xlong{font-size:7.3px!important;letter-spacing:-.045em!important}
  body.theme-wrigley .matchup-team select.team-name-long{font-size:8px!important}
  body.theme-wrigley .matchup-team select.team-name-xlong{font-size:7.2px!important}

  /* Stronger full-row selection in standings. */
  .standings-grid .standings-selected{
    background:color-mix(in srgb,var(--accent) 18%,var(--selected) 82%)!important;
    color:var(--text)!important;
    font-weight:950!important;
  }
  body.theme-wrigley .standings-grid .standings-selected{
    background:#2c6840!important;
    color:#fff6dd!important;
    font-weight:950!important;
  }
  .standings-grid .standings-selected-start{border-left:4px solid var(--accent)!important}
  body.theme-wrigley .standings-grid .standings-selected-start{border-left-color:#d7bf87!important}
}

@media (max-width:390px){
  body.home-page .launch-actions{grid-template-rows:repeat(2,70px)!important;height:148px!important;min-height:148px!important}
  body.home-page .launch-actions button{height:70px!important;min-height:70px!important;padding:8px 9px!important}
  body.home-page .launch-actions strong{font-size:11.8px!important}
  body.home-page .launch-actions small{font-size:7.7px!important}
}

@media (max-width:760px) and (max-height:720px){
  body.home-page .launch-brand p{display:none!important}
  body.home-page .launch-diamond{width:30px!important;height:30px!important}
  body.home-page .launch-brand h1{font-size:34px!important}
  body.home-page .launch-actions{grid-template-rows:repeat(2,64px)!important;height:136px!important;min-height:136px!important}
  body.home-page .launch-actions button{height:64px!important;min-height:64px!important}
  body.home-page .launch-game-card{padding:8px!important}
  body.home-page .launch-matchup{padding:5px 0!important}
  body.home-page .launch-team img{width:34px!important;height:34px!important}
}

/* ==========================================================
   v39 MOBILE VIEWPORT + THEME COHESION PASS
   - modal sheets return to 1x after scorecard pinch zoom
   - 16px mobile form controls prevent iOS focus-zoom
   - settings team selectors use full width
   - all modal controls inherit the active theme + dark mode
   - default-theme standings use a true full-row highlight
   - Home actions stay compact instead of becoming empty boxes
   ========================================================== */

/* Theme all app sheets from the same variables used by the scorecard. */
.modal-card{
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 94%,#fff 2%),var(--panel))!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
  box-shadow:0 22px 60px rgba(0,0,0,.38)!important;
}
.modal-head{border-color:var(--line)!important}
.modal-head strong,.settings-section h3,.section-row strong{color:var(--text)!important}
.modal-head small,.modal label,.settings-hint,.setting-toggle,.mode-note{color:var(--muted)!important}
.modal-head button{color:var(--text)!important}
.settings-section{border-color:var(--line)!important}
.modal input,.modal select,.modal textarea,
.settings-buttons button,.small-btn,.history-actions button,.modal-actions button{
  background:color-mix(in srgb,var(--panel2) 84%,#fff 4%)!important;
  color:var(--text)!important;
  border-color:color-mix(in srgb,var(--line) 86%,var(--accent) 14%)!important;
  box-shadow:none!important;
}
.modal input::placeholder,.modal textarea::placeholder{color:color-mix(in srgb,var(--muted) 78%,transparent)!important}
.modal select option{background:var(--panel2)!important;color:var(--text)!important}
.modal-actions .primary,.record-pitch-btn{
  background:var(--accent)!important;
  color:#102017!important;
  border-color:var(--accent)!important;
}
.modal button:disabled{opacity:.44!important;color:var(--muted)!important}
.setting-toggle input{accent-color:var(--accent)}
body.theme-postseason .modal-actions .primary,
body.theme-postseason .record-pitch-btn{color:#101821!important}
body.dark-mode .modal-card{
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 92%,#000 8%),color-mix(in srgb,var(--panel) 96%,#000 4%))!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}
body.dark-mode .modal input,body.dark-mode .modal select,body.dark-mode .modal textarea,
body.dark-mode .settings-buttons button,body.dark-mode .small-btn,body.dark-mode .history-actions button,
body.dark-mode .modal-actions button{background:color-mix(in srgb,var(--panel2) 90%,#000 10%)!important;color:var(--text)!important}

/* Full-row standings selection. This is intentionally after the palette rules. */
.standings-grid>.standings-selected{
  background:color-mix(in srgb,var(--accent) 24%,var(--panel2) 76%)!important;
  color:var(--text)!important;
  font-weight:950!important;
  border-top:1px solid color-mix(in srgb,var(--accent) 64%,var(--line))!important;
  border-bottom:1px solid color-mix(in srgb,var(--accent) 64%,var(--line))!important;
  text-shadow:0 1px 1px rgba(0,0,0,.16);
}
.standings-grid>.standings-selected-start{
  border-left:4px solid var(--accent)!important;
  border-radius:6px 0 0 6px;
}
.standings-grid>.standings-selected-end{
  border-right:1px solid color-mix(in srgb,var(--accent) 64%,var(--line))!important;
  border-radius:0 6px 6px 0;
}
body.theme-custom .standings-grid>.standings-selected{
  background:color-mix(in srgb,var(--custom-accent-safe,var(--accent)) 25%,var(--custom-grid-head) 75%)!important;
  color:var(--custom-text)!important;
  font-weight:950!important;
}
body.theme-custom.dark-mode .standings-grid>.standings-selected{
  background:color-mix(in srgb,var(--custom-accent-safe,var(--accent)) 20%,var(--custom-panel2) 80%)!important;
  color:var(--custom-text)!important;
}
body.theme-wrigley .standings-grid>.standings-selected{
  background:color-mix(in srgb,#d7bf87 15%,#245b39 85%)!important;
  color:#fff6dd!important;
}
body.theme-postseason .standings-grid>.standings-selected{
  background:color-mix(in srgb,var(--accent) 22%,#10273c 78%)!important;
  color:#fff8e9!important;
}

@media(max-width:760px){
  /* Reset sheets to an app-sized viewport; JS locks the viewport at 1x while any sheet is open. */
  html.modal-viewport-locked,html.modal-viewport-locked body{touch-action:pan-y!important}
  .modal{
    padding:calc(6px + env(safe-area-inset-top)) 6px calc(6px + env(safe-area-inset-bottom))!important;
    align-items:end!important;
    overflow:hidden!important;
  }
  .modal-card{
    width:100%!important;
    max-width:620px!important;
    max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px)!important;
    margin:0 auto!important;
    border-radius:22px 22px 12px 12px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  /* iOS Safari zooms focused form controls smaller than 16px. Keep every sheet control at 16px. */
  .modal input,.modal select,.modal textarea,
  .play-card input,.play-card select,.settings-card select,
  .sub-row input,.sub-row select,.pitch-entry-grid input,.pitch-entry-grid select{
    font-size:16px!important;
    line-height:1.2!important;
  }
  .modal label{font-size:11px!important;line-height:1.25!important}
  .modal .field-help{font-size:9px!important}

  /* Settings: one team per row gives long MLB names the entire phone width. */
  .settings-card{padding:14px!important}
  .settings-card .form-grid.two{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  .settings-card #awayTeamSetting,.settings-card #homeTeamSetting{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    min-height:48px!important;padding:8px 38px 8px 12px!important;
    font-size:16px!important;font-weight:850!important;white-space:nowrap!important;text-overflow:ellipsis!important;
  }
  .settings-card .settings-buttons{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .settings-card .settings-buttons button{min-width:0!important;min-height:46px!important;padding:9px 8px!important;font-size:12px!important}
  .settings-card .settings-section h3{font-size:22px!important;margin-bottom:9px!important}
  .settings-card #scoringModeSetting{width:100%!important;min-height:48px!important}

  /* Play Editor returns to normal phone proportions after scorecard zoom. */
  #playModal .play-card{width:100%!important;max-width:620px!important;max-height:calc(100dvh - env(safe-area-inset-top) - 8px)!important}
  #playModal .modal-actions{position:sticky!important;bottom:-1px!important;z-index:8!important;background:var(--panel)!important;padding:10px 0 calc(8px + env(safe-area-inset-bottom))!important}

  /* Home: do not add filler tabs. Make the four useful actions dense and easy to scan. */
  body.home-page .launch-inner{
    gap:clamp(6px,.8dvh,9px)!important;
    align-content:center!important;
  }
  body.home-page .launch-actions{
    grid-template-rows:repeat(2,66px)!important;
    height:140px!important;min-height:140px!important;gap:8px!important;
  }
  body.home-page .launch-actions button{
    height:66px!important;min-height:66px!important;padding:8px 10px!important;
    grid-template-columns:36px minmax(0,1fr)!important;column-gap:9px!important;
  }
  body.home-page .launch-action-icon{width:32px!important;height:32px!important}
  body.home-page .launch-actions strong{font-size:12px!important}
  body.home-page .launch-actions small{font-size:8px!important}
  body.home-page .launch-game-card{padding:9px!important}
  body.home-page .launch-matchup{padding:6px 0!important}
}

@media(max-width:390px){
  body.home-page .launch-actions{grid-template-rows:repeat(2,62px)!important;height:132px!important;min-height:132px!important}
  body.home-page .launch-actions button{height:62px!important;min-height:62px!important}
  .settings-card .settings-buttons{grid-template-columns:1fr 1fr!important}
}
/* Preserve semantic danger actions after generic theme-aware button styling. */
.modal .danger,.settings-card .danger,.confirm-actions .danger{
  color:#ff8178!important;
  border-color:color-mix(in srgb,#ff8178 58%,var(--line))!important;
}

/* ==========================================================
   v40 MODE WORKSPACES + MOBILE NAVIGATION REFINEMENT
   ========================================================== */
.mode-workspace-tabs{
  display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:7px;
  margin:10px 0;padding:6px;border:1px solid var(--line);border-radius:15px;
  background:color-mix(in srgb,var(--panel2) 90%,#000 5%);box-shadow:0 8px 22px rgba(0,0,0,.12)
}
.mode-workspace-tabs button{
  min-height:42px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);
  display:flex;align-items:center;justify-content:center;gap:7px;font-size:10px;font-weight:900;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .14s ease
}
.mode-workspace-tabs button span{font-size:14px;color:var(--accent)}
.mode-workspace-tabs button.active{background:color-mix(in srgb,var(--accent) 12%,var(--panel));border-color:color-mix(in srgb,var(--accent) 40%,var(--line));color:var(--text);box-shadow:inset 0 -2px 0 color-mix(in srgb,var(--accent) 72%,transparent)}
.mode-workspace-tabs button:active{transform:scale(.98)}
.mode-page-shell{max-width:1120px;margin:0 auto;padding:0 0 24px}
.mode-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:16px 2px 12px;padding:0 2px}
.mode-page-head small{display:block;color:var(--accent);font-size:8px;font-weight:950;letter-spacing:.14em}
.mode-page-head h2{margin:4px 0 3px;font-family:Georgia,'Times New Roman',serif;font-size:28px;color:var(--text)}
.mode-page-head p{margin:0;max-width:690px;color:var(--muted);font-size:10px;line-height:1.5}
.mode-page-head>span{flex:0 0 auto;padding:6px 10px;border:1px solid var(--line);border-radius:999px;background:var(--panel2);color:var(--accent);font-size:8px;font-weight:950;letter-spacing:.05em}
.mode-empty{padding:28px;text-align:center;color:var(--muted)}.mode-empty strong{display:block;color:var(--text);font-size:15px}.mode-empty span{display:block;margin-top:6px;font-size:10px}

/* Automatic play log */
.play-log{display:grid;gap:10px}.play-log-inning{padding:0;overflow:hidden}.play-log-inning-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:var(--panel2);border-bottom:1px solid var(--line)}.play-log-inning-head strong{font-size:11px;color:var(--text)}.play-log-inning-head small{font-size:8px;color:var(--muted)}
.play-log-row{width:100%;min-height:66px;display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 12px;border:0;border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent);background:transparent;color:var(--text);text-align:left}.play-log-row:last-child{border-bottom:0}.play-log-row:active{background:color-mix(in srgb,var(--accent) 9%,var(--panel2))}.play-log-seq{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;border:1px solid var(--line);background:var(--panel2);color:var(--accent);font-size:8px;font-weight:950}.play-log-main{min-width:0}.play-log-main strong,.play-log-main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.play-log-main strong{font-size:10px}.play-log-main b{margin-top:2px;font-size:9px;color:var(--accent)}.play-log-main small,.play-log-main em{display:block;margin-top:3px;font-size:7.5px;color:var(--muted);font-style:normal;line-height:1.35}.play-log-main em{color:color-mix(in srgb,var(--text) 78%,var(--muted))}.play-log-edit{font-size:8px;font-weight:900;color:var(--accent)}

/* Pitch Center */
.pitch-dashboard-grid,.stats-team-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pitch-dashboard-card{padding:13px}.pitch-dashboard-head,.stats-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding-bottom:10px;border-bottom:1px solid var(--line)}.pitch-dashboard-head small,.stats-card-head small{display:block;font-size:7px;font-weight:950;color:var(--accent);letter-spacing:.1em}.pitch-dashboard-head strong,.stats-card-head strong{display:block;margin-top:3px;font-size:15px;color:var(--text)}.pitch-dashboard-head>b{font-size:11px;color:var(--accent)}.stats-card-head>span{font-size:7px;color:var(--muted)}
.pitch-kpis,.stats-kpi-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:10px}.pitch-kpis span,.stats-kpi-row span{padding:9px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--panel2) 90%,#000 4%);text-align:center}.pitch-kpis b,.stats-kpi-row b{display:block;font-size:15px;color:var(--text)}.pitch-kpis small,.stats-kpi-row small{display:block;margin-top:2px;font-size:6.5px;color:var(--muted)}
.pitch-usage{display:grid;gap:6px;margin-top:10px}.pitch-usage>div{display:grid;grid-template-columns:70px 1fr auto;align-items:center;gap:8px;padding:7px 9px;border-radius:9px;background:color-mix(in srgb,var(--panel2) 84%,transparent);border:1px solid color-mix(in srgb,var(--line) 70%,transparent)}.pitch-usage strong{font-size:9px;color:var(--accent)}.pitch-usage span{font-size:8px;font-weight:900;color:var(--text)}.pitch-usage small{font-size:7px;color:var(--muted)}.pitch-usage-empty{display:block!important;text-align:center;color:var(--muted);font-size:8px}
.pitch-atbats{margin-top:14px}.section-page-title{display:flex;justify-content:space-between;align-items:center;margin:0 2px 8px}.section-page-title strong{font-size:10px;color:var(--text);letter-spacing:.08em}.section-page-title small{font-size:8px;color:var(--muted)}.pitch-atbat{display:block;width:100%;padding:11px;margin-bottom:8px;text-align:left;color:var(--text)}.pitch-atbat-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pitch-atbat-head strong,.pitch-atbat-head small{display:block}.pitch-atbat-head strong{font-size:10px}.pitch-atbat-head small{margin-top:2px;font-size:7px;color:var(--muted)}.pitch-atbat-head>b{font-size:8px;color:var(--accent)}.pitch-atbat-seq{display:flex;gap:6px;overflow-x:auto;padding:9px 0 6px;scrollbar-width:none}.pitch-atbat-seq::-webkit-scrollbar{display:none}.pitch-atbat-seq>span{flex:0 0 auto;min-width:74px;padding:7px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);font-size:7px;font-weight:900}.pitch-atbat-seq>span>b{margin-right:5px;color:var(--accent)}.pitch-atbat-seq>span small{display:block;margin-top:3px;color:var(--muted);font-weight:700}.pitch-atbat-seq>span.is-strike{border-color:color-mix(in srgb,var(--accent) 60%,var(--line))}.pitch-atbat-seq>span.is-ball{opacity:.82}.pitch-atbat-seq>span.is-play{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 28%,transparent)}.pitch-atbat-result{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:6px;border-top:1px solid color-mix(in srgb,var(--line) 72%,transparent)}.pitch-atbat-result span{font-size:7px;color:var(--muted)}.pitch-atbat-result strong{font-size:8px;color:var(--text)}

/* Automatic stats */
.stats-card{padding:12px;min-width:0}.stats-team-grid{margin-bottom:10px}.stats-scroll{overflow-x:auto;margin:9px -4px -4px;padding:0 4px 4px}.advanced-stats-table{border-collapse:separate;border-spacing:0;min-width:820px;width:100%;font-size:8px}.advanced-stats-table.compact{min-width:360px}.advanced-stats-table th,.advanced-stats-table td{padding:7px 8px;border-right:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-bottom:1px solid color-mix(in srgb,var(--line) 60%,transparent);text-align:center;white-space:nowrap}.advanced-stats-table th{background:var(--panel2);color:var(--accent);font-size:7px}.advanced-stats-table td{color:var(--text)}.advanced-stats-table th:first-child,.advanced-stats-table td:first-child{text-align:left;position:sticky;left:0;z-index:1;background:var(--panel)}.advanced-stats-table th:first-child{background:var(--panel2)}.stats-empty{padding:20px 8px;text-align:center;color:var(--muted);font-size:8px}.fielding-grid{align-items:start}.pitch-stat-summary{margin-bottom:10px}.pitch-stat-summary .stats-kpi-row{grid-template-columns:repeat(4,minmax(0,1fr))}

/* Home Game Center fills tall phone space with useful mode-specific destinations. */
.launch-mode-hub{grid-area:hub;border:1px solid var(--line);border-radius:15px;background:color-mix(in srgb,var(--panel) 92%,#fff 2%);padding:9px 10px;box-shadow:0 10px 24px rgba(0,0,0,.11)}
.launch-hub-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}.launch-hub-head span{font-size:7px;font-weight:950;letter-spacing:.12em;color:var(--accent)}.launch-hub-head em{font-size:6px;font-style:normal;font-weight:900;color:var(--muted)}.launch-hub-actions{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px}.launch-hub-actions button{min-height:36px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);display:flex;align-items:center;justify-content:center;gap:6px;font-size:8px;font-weight:900}.launch-hub-actions button span{color:var(--accent);font-size:11px}

.settings-buttons #settingsDark.is-on{border-color:color-mix(in srgb,var(--accent) 72%,var(--line))!important;background:color-mix(in srgb,var(--accent) 14%,var(--panel2))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent)!important}

@media(max-width:760px){
  /* Mobile header is intentionally title-only. Menu / Focus / Dark live in the bottom bar. */
  body:not(.home-page) .topbar{grid-template-columns:1fr!important;min-height:calc(62px + env(safe-area-inset-top))!important;padding:calc(8px + env(safe-area-inset-top)) 12px 8px!important}
  body:not(.home-page) .topbar #menuBtn,body:not(.home-page) .topbar .top-actions{display:none!important}
  body:not(.home-page) .topbar h1{grid-column:1!important;font-size:22px!important;justify-self:center!important}
  body:not(.home-page) .topbar .save-status{bottom:4px!important;font-size:7px!important}
  body:not(.home-page) .postseason-banner{grid-column:1!important}

  /* Bottom controls: Menu · Undo · Score · Focus · Dark. Destructive All Clear stays in Settings. */
  body:not(.home-page) .mobile-action-bar{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  body:not(.home-page) .mobile-action-bar #mobileScore{grid-column:3!important}
  body:not(.home-page) .mobile-action-bar #mobileDark.is-mode-on span,body:not(.home-page) .mobile-action-bar #mobileFocus.is-mode-on span{color:var(--accent)!important}

  /* Home content now uses the full phone height without making the four main tiles huge. */
  body.home-page .launch-inner{
    grid-template-areas:'brand' 'game' 'actions' 'hub' 'footer'!important;
    grid-template-rows:auto auto auto auto auto!important;
    align-content:space-between!important;
    gap:clamp(6px,1dvh,10px)!important;
    padding:calc(max(10px,env(safe-area-inset-top)) + 6px) 0 calc(max(9px,env(safe-area-inset-bottom)) + 7px)!important;
  }
  body.home-page .launch-brand{margin-top:0!important}
  body.home-page .launch-actions{height:auto!important;min-height:0!important;grid-template-rows:repeat(2,68px)!important}
  body.home-page .launch-actions button{height:68px!important;min-height:68px!important}
  body.home-page .launch-mode-hub{padding:7px 8px!important;border-radius:13px!important}
  body.home-page .launch-hub-head{margin-bottom:5px!important}.launch-hub-actions{gap:5px!important}.launch-hub-actions button{min-height:34px!important;font-size:7.5px!important;padding:0 4px!important}

  .mode-workspace-tabs{position:sticky;top:calc(62px + env(safe-area-inset-top));z-index:24;margin:7px 0;padding:4px;gap:4px;border-radius:13px;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
  .mode-workspace-tabs button{min-height:39px;gap:4px;font-size:7.5px;padding:0 4px}.mode-workspace-tabs button span{font-size:12px}
  .mode-page-head{margin:12px 3px 9px;align-items:flex-start}.mode-page-head h2{font-size:23px}.mode-page-head p{font-size:8px}.mode-page-head>span{font-size:7px}
  .pitch-dashboard-grid,.stats-team-grid{grid-template-columns:1fr}.pitch-dashboard-card,.stats-card{padding:10px}.pitch-kpis{gap:5px}.pitch-kpis span{padding:7px 4px}.pitch-kpis b{font-size:13px}.pitch-usage>div{grid-template-columns:58px 1fr auto}.play-log-row{grid-template-columns:28px minmax(0,1fr) auto;padding:8px 9px;gap:7px}.play-log-main strong{font-size:9px}.play-log-main b{font-size:8.5px}.play-log-main small,.play-log-main em{font-size:7px}.pitch-stat-summary .stats-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-stats-table{font-size:7.5px}
}

@media(max-width:390px){
  body.home-page .launch-actions{grid-template-rows:repeat(2,64px)!important}.launch-hub-actions button b{font-size:7px}.mode-workspace-tabs button b{font-size:7px}
}
/* v40 grid placement guard for desktop Home and hidden mode drawer items. */
.launch-inner{grid-template-areas:'brand game' 'actions game' 'hub game' 'footer footer'}
.drawer-nav[hidden]{display:none!important}

/* v41 — Automatic mode-workspace refinement */
.mode-help-strip{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 12px;margin-bottom:10px;background:color-mix(in srgb,var(--panel) 94%,var(--accent) 2%);border-color:color-mix(in srgb,var(--line) 74%,var(--accent) 16%)}
.mode-help-strip b{font-size:9px;color:var(--text);white-space:nowrap}.mode-help-strip span{font-size:7.5px;line-height:1.45;color:var(--muted);text-align:right}
.mode-summary-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:0 0 10px}
.mode-summary-kpis>span{padding:9px 8px;border:1px solid var(--line);border-radius:11px;background:var(--panel);text-align:center}
.mode-summary-kpis b{display:block;font-size:15px;color:var(--text)}.mode-summary-kpis small{display:block;margin-top:2px;font-size:6.5px;color:var(--muted);font-weight:800}
.play-log-filter{display:inline-grid;grid-auto-flow:column;gap:4px;padding:4px;margin:0 0 9px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.play-log-filter button{min-width:72px;height:32px;padding:0 12px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:7.5px;font-weight:950}
.play-log-filter button.active{background:var(--panel2);color:var(--text);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 45%,var(--line))}
.play-log-inning-head>span strong,.play-log-inning-head>span small{display:block}.play-log-inning-head>em{font-size:7px;font-style:normal;font-weight:900;color:var(--accent);white-space:nowrap}
.play-log-player{display:flex!important;align-items:center;gap:6px;min-width:0}.play-log-player strong{min-width:0;flex:0 1 auto}.play-kind{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:17px;padding:0 6px;border-radius:999px;border:1px solid var(--line);font-size:5.5px!important;font-style:normal!important;font-weight:950!important;letter-spacing:.05em;line-height:1;color:var(--muted)!important;background:var(--panel2)}
.play-kind.hit{color:var(--text)!important;border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:color-mix(in srgb,var(--accent) 14%,var(--panel2))}.play-kind.out{color:#fff!important;border-color:color-mix(in srgb,#c44 52%,var(--line));background:color-mix(in srgb,#8f2929 60%,var(--panel2))}.play-kind.onbase{color:var(--text)!important;border-color:color-mix(in srgb,var(--accent) 40%,var(--line))}.play-kind.runner{color:var(--accent)!important}

/* Pitch Center: outcome analytics, usage bars, inning totals */
.pitch-kpis-four{grid-template-columns:repeat(4,minmax(0,1fr))}
.pitch-outcomes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px}.pitch-outcomes span{padding:7px 4px;border:1px solid color-mix(in srgb,var(--line) 75%,transparent);border-radius:9px;background:color-mix(in srgb,var(--panel2) 88%,transparent);text-align:center}.pitch-outcomes b{display:block;font-size:11px;color:var(--text)}.pitch-outcomes small{display:block;margin-top:2px;font-size:6px;color:var(--muted)}
.pitch-usage{display:grid;gap:5px;margin-top:9px}.pitch-usage>div:not(.pitch-usage-empty){display:grid;grid-template-columns:42px minmax(60px,1fr) 62px 70px;align-items:center;gap:7px;padding:7px 8px;border:1px solid color-mix(in srgb,var(--line) 66%,transparent);border-radius:9px;background:color-mix(in srgb,var(--panel2) 82%,transparent)}.pitch-usage>div>strong{font-size:8px;color:var(--accent)}.pitch-usage>div>span{position:relative;height:6px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--line) 42%,transparent)}.pitch-usage>div>span i{display:block;height:100%;border-radius:999px;background:var(--accent)}.pitch-usage>div>b{font-size:7px;color:var(--text);text-align:right}.pitch-usage>div>small{font-size:6.5px;color:var(--muted);text-align:right}
.pitch-inning-card{padding:11px;margin:10px 0}.pitch-inning-grid{margin-top:8px;border:1px solid color-mix(in srgb,var(--line) 70%,transparent);border-radius:10px;overflow:hidden}.pitch-inning-grid>div{display:grid;grid-template-columns:70px repeat(2,minmax(0,1fr));min-height:32px;align-items:center;border-bottom:1px solid color-mix(in srgb,var(--line) 55%,transparent)}.pitch-inning-grid>div:last-child{border-bottom:0}.pitch-inning-grid span,.pitch-inning-grid strong,.pitch-inning-grid b{text-align:center;font-size:7.5px;color:var(--text)}.pitch-inning-grid strong{color:var(--accent)}.pitch-inning-grid .pitch-inning-head{background:var(--panel2)}.pitch-inning-grid .pitch-inning-head b{font-size:6.5px;color:var(--muted);letter-spacing:.08em}
.pitch-atbat-result strong{display:flex;align-items:center;gap:6px;justify-content:flex-end}.pitch-atbat-result .play-kind{vertical-align:middle}

/* Stats: useful overview + mobile player cards */
.team-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px}.team-stat-overview{padding:11px}.team-stat-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:9px;border-bottom:1px solid var(--line)}.team-stat-head>span{display:grid;grid-template-columns:30px auto;grid-template-rows:auto auto;column-gap:8px;align-items:center}.team-stat-head img{grid-row:1/3;width:30px;height:30px;object-fit:contain}.team-stat-head b{font-size:11px;color:var(--text)}.team-stat-head small{font-size:6.5px;color:var(--muted)}.team-stat-head>strong{font-size:12px;color:var(--text);white-space:nowrap}.team-stat-head>strong i{font-size:6px;font-style:normal;color:var(--muted)}
.team-stat-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:8px}.team-stat-kpis span{padding:8px 4px;border:1px solid color-mix(in srgb,var(--line) 70%,transparent);border-radius:9px;background:var(--panel2);text-align:center}.team-stat-kpis b{display:block;font-size:11px;color:var(--text)}.team-stat-kpis small{display:block;margin-top:2px;font-size:5.8px;color:var(--muted)}.team-stat-detail{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.team-stat-detail span{padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--panel2) 86%,transparent);border:1px solid color-mix(in srgb,var(--line) 60%,transparent);font-size:6.5px;color:var(--muted);font-weight:800}
.mobile-player-stats{display:none}.player-stat-card{border-bottom:1px solid color-mix(in srgb,var(--line) 62%,transparent)}.player-stat-card:last-child{border-bottom:0}.player-stat-card summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 2px;cursor:pointer}.player-stat-card summary::-webkit-details-marker{display:none}.player-stat-card summary>span:first-child{min-width:0}.player-stat-card summary strong,.player-stat-card summary small{display:block}.player-stat-card summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:var(--text)}.player-stat-card summary small{margin-top:2px;font-size:6.5px;color:var(--muted)}.player-stat-card summary>span:last-child{text-align:right}.player-stat-card summary>span:last-child b{font-size:12px;color:var(--accent)}.player-stat-card summary>span:last-child small{font-size:5.5px}.player-stat-card[open] summary{border-bottom:1px dashed color-mix(in srgb,var(--line) 60%,transparent)}.player-stat-rates{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:8px 0}.player-stat-rates span{text-align:center;padding:6px 3px;border-radius:8px;background:var(--panel2)}.player-stat-rates b{display:block;font-size:9px;color:var(--text)}.player-stat-rates small{display:block;font-size:5.5px;color:var(--muted)}.player-stat-more{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:0 0 9px}.player-stat-more span{padding:5px 4px;border:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-radius:7px;text-align:center;font-size:6px;color:var(--muted)}.player-stat-more b{color:var(--text)}
.fielding-stat-list{display:grid;gap:5px;margin-top:9px}.fielding-stat-list>div{display:grid;grid-template-columns:42px repeat(4,minmax(0,1fr));align-items:center;gap:5px;padding:7px;border:1px solid color-mix(in srgb,var(--line) 65%,transparent);border-radius:9px;background:color-mix(in srgb,var(--panel2) 84%,transparent)}.fielding-stat-list>div>strong{color:var(--accent);font-size:9px}.fielding-stat-list span{text-align:center}.fielding-stat-list b,.fielding-stat-list small{display:block}.fielding-stat-list b{font-size:9px;color:var(--text)}.fielding-stat-list small{font-size:5.5px;color:var(--muted)}

@media(max-width:760px){
  .mode-help-strip{align-items:flex-start;flex-direction:column;gap:3px;padding:9px 10px}.mode-help-strip b{font-size:8px}.mode-help-strip span{text-align:left;font-size:7px}
  .mode-summary-kpis{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.mode-summary-kpis>span{padding:7px 3px}.mode-summary-kpis b{font-size:13px}.mode-summary-kpis small{font-size:5.8px}
  .play-log-filter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.play-log-filter button{min-width:0}.play-log-inning-head>em{font-size:6.5px}.play-log-player{gap:4px}.play-kind{padding:0 5px;font-size:5px!important}
  .pitch-kpis-four{grid-template-columns:repeat(2,minmax(0,1fr))}.pitch-outcomes{grid-template-columns:repeat(4,minmax(0,1fr))}.pitch-outcomes b{font-size:10px}.pitch-outcomes small{font-size:5.5px}
  .pitch-usage>div:not(.pitch-usage-empty){grid-template-columns:34px minmax(58px,1fr) 55px 58px;gap:5px;padding:6px}.pitch-usage>div>small{font-size:6px}.pitch-inning-grid>div{grid-template-columns:55px repeat(2,minmax(0,1fr))}
  .team-overview-grid{grid-template-columns:1fr}.team-stat-overview{padding:9px}.team-stat-kpis span{padding:7px 3px}.team-stat-detail{gap:4px}.desktop-stats-table{display:none}.mobile-player-stats{display:block}.batting-stats-card{padding-bottom:2px}.player-stat-more{grid-template-columns:repeat(5,minmax(0,1fr))}.fielding-stat-list>div{grid-template-columns:34px repeat(4,minmax(0,1fr))}
}

/* ==========================================================
   v42 PLAY EDITOR READABILITY + ALIGNMENT
   Presentation-only. Keeps all scoring logic and editor order.
   ========================================================== */
.play-card{
  --editor-control-h:44px;
  --editor-label-h:22px;
}
.play-card .modal-head{
  padding-bottom:7px!important;
}
.play-card .modal-head strong{
  font-size:17px;
  line-height:1.05;
  letter-spacing:.015em;
  color:var(--text)!important;
}
.play-card .modal-head small{
  margin-top:4px!important;
  font-size:9px;
  line-height:1.25;
  color:color-mix(in srgb,var(--muted) 92%,var(--text) 8%)!important;
}
.play-card .situation{
  margin-top:8px!important;
  padding:9px 11px!important;
  min-height:40px;
  display:flex;
  align-items:center;
  font-size:13px;
  line-height:1;
  border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line))!important;
}
.play-card .editor-section-title{
  margin:12px 0 5px!important;
  padding-top:10px!important;
  font-size:9px!important;
  line-height:1!important;
  letter-spacing:.12em!important;
  color:color-mix(in srgb,var(--text) 88%,var(--accent) 12%)!important;
}
.play-card .situation + .editor-section-title{
  margin-top:10px!important;
  padding-top:0!important;
}
.play-card .editor-grid{
  margin-top:0!important;
  gap:9px 12px!important;
  align-items:stretch!important;
}
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-end!important;
  margin:0!important;
  gap:0!important;
  color:var(--text)!important;
  font-weight:850!important;
}
.play-card .field-label,
.play-card .runner-out-fields .form-grid.two>label>.field-label{
  min-height:var(--editor-label-h)!important;
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:7px!important;
  padding:0 1px 5px!important;
  color:color-mix(in srgb,var(--text) 84%,var(--muted) 16%)!important;
  font-size:10px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:.01em!important;
  white-space:nowrap;
}
.play-card .field-help{
  display:inline!important;
  flex:0 1 auto;
  margin:0!important;
  padding:0!important;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--muted)!important;
  font-size:7px!important;
  font-weight:750!important;
  line-height:1!important;
  letter-spacing:0!important;
  text-transform:none!important;
  text-align:right;
}
.play-card .editor-grid select,
.play-card .editor-grid input,
.play-card .runner-out-fields .form-grid.two select,
.play-card .runner-out-fields .form-grid.two input{
  box-sizing:border-box!important;
  width:100%!important;
  height:var(--editor-control-h)!important;
  min-height:var(--editor-control-h)!important;
  margin:0!important;
  padding:0 12px!important;
  border-width:1px!important;
  border-radius:10px!important;
  font-size:12px!important;
  font-weight:850!important;
  line-height:1.15!important;
}
.play-card .check-label{
  min-height:var(--editor-control-h)!important;
  margin:var(--editor-label-h) 0 0!important;
  padding:0 11px!important;
  border:1px solid color-mix(in srgb,var(--line) 84%,var(--accent) 16%);
  border-radius:10px;
  background:color-mix(in srgb,var(--panel2) 88%,transparent);
  color:var(--text)!important;
  font-size:10px!important;
  font-weight:850!important;
}
.play-card .check-label input{
  flex:0 0 auto!important;
  margin:0 7px 0 0!important;
}
.play-card .runner-out-fields{
  margin:11px 0 3px!important;
  padding:10px!important;
}
.play-card .runner-out-title{
  margin-bottom:6px!important;
  font-size:8px!important;
}
.play-card .runner-out-count{
  margin:8px 0 0!important;
}
.play-card .modal-actions{
  gap:8px!important;
  margin-top:12px!important;
}
.play-card .modal-actions button{
  min-height:44px!important;
  padding:0 14px!important;
  border-radius:10px!important;
  font-size:11px!important;
  line-height:1!important;
}

/* Advanced: same 3x3 layout, but every tile has the same dimensions/rhythm. */
.play-card .advanced-tools{
  margin-top:12px!important;
}
.play-card .advanced-layout{
  gap:10px!important;
}
.play-card .defense-field-card,
.play-card .advanced-runner-card{
  padding:10px!important;
  border-radius:13px!important;
}
.play-card .field-card-head{
  min-height:34px!important;
  margin-bottom:7px!important;
}
.play-card .field-card-head strong{
  font-size:9px!important;
}
.play-card .field-card-head small{
  margin-top:2px!important;
  font-size:6.5px!important;
}
.play-card .fielder-grid{
  grid-auto-rows:58px!important;
  gap:6px!important;
  padding:6px!important;
  border-radius:11px!important;
}
.play-card .fielder-grid-pos{
  width:100%!important;
  height:58px!important;
  min-height:58px!important;
  box-sizing:border-box!important;
  padding:6px!important;
  border-radius:9px!important;
}
.play-card .fielder-grid-pos>span{
  width:25px!important;
  height:25px!important;
  border-radius:7px!important;
  font-size:8px!important;
}
.play-card .fielder-grid-pos>strong{
  font-size:7.3px!important;
}
.play-card .fielder-grid-pos>small{
  font-size:5.8px!important;
}
.play-card .fielder-selection{
  min-height:28px!important;
  margin-top:6px!important;
  padding:6px 8px!important;
  font-size:7px!important;
}

/* Pitch-by-Pitch: keep the same sections, reclaim space from explanations. */
.play-card .pitch-tools{
  margin:8px 0 10px!important;
  border-radius:13px!important;
}
.play-card .pitch-tools-head{
  min-height:68px!important;
  padding:10px 12px!important;
  gap:10px!important;
}
.play-card .pitch-title-copy .pitch-kicker{
  margin-bottom:3px!important;
  font-size:5.5px!important;
}
.play-card .pitch-title-copy>strong{
  font-size:13px!important;
  line-height:1!important;
}
.play-card .pitch-title-copy>small{
  max-width:46ch!important;
  margin-top:4px!important;
  font-size:6.5px!important;
  line-height:1.28!important;
}
.play-card .pitch-count-card{
  padding:7px 9px!important;
  border-radius:10px!important;
}
.play-card .pitch-count-card>b{
  margin:2px 0!important;
  font-size:24px!important;
}
.play-card .pitch-count-lights{
  padding:7px 12px!important;
}
.play-card .pitch-entry-card{
  padding:10px 12px 11px!important;
}
.play-card .pitch-entry-card-head{
  margin-bottom:7px!important;
}
.play-card .pitch-entry-card-head strong,
.play-card .pitch-sequence-head strong{
  font-size:8.5px!important;
}
.play-card .pitch-entry-card-head small,
.play-card .pitch-sequence-head small{
  margin-top:2px!important;
  font-size:6px!important;
  line-height:1.25!important;
}
.play-card .pitch-entry-grid{
  gap:8px!important;
}
.play-card .pitch-entry-grid label{
  color:var(--text)!important;
  font-size:8.5px!important;
  font-weight:900!important;
}
.play-card .pitch-entry-grid label>span{
  min-height:20px!important;
  margin-bottom:4px!important;
  align-items:flex-end!important;
}
.play-card .pitch-entry-grid label>span small{
  font-size:6px!important;
}
.play-card .pitch-entry-grid select,
.play-card .pitch-entry-grid input,
.play-card .pitch-velo-wrap{
  box-sizing:border-box!important;
  height:44px!important;
  min-height:44px!important;
  border-radius:10px!important;
}
.play-card .pitch-velo-wrap input{
  height:42px!important;
}
.play-card .record-pitch-btn{
  min-height:44px!important;
  border-radius:10px!important;
}
.play-card .pitch-sequence-card{
  padding:10px 12px 11px!important;
}
.play-card .pitch-sequence-head{
  margin-bottom:7px!important;
}
.play-card .pitch-sequence-head .small-btn{
  min-height:30px!important;
  padding:0 9px!important;
  font-size:7px!important;
}
.play-card .pitch-empty{
  min-height:58px!important;
  padding:9px!important;
  gap:3px!important;
}
.play-card .pitch-empty>strong{
  font-size:8px!important;
}
.play-card .pitch-empty>small{
  font-size:6px!important;
}
.play-card .pitch-workflow-note{
  padding:8px 12px!important;
  gap:7px!important;
}
.play-card .pitch-workflow-note p{
  font-size:6.2px!important;
  line-height:1.3!important;
}
.play-card .editor-guide{
  gap:5px!important;
  margin:7px 0 10px!important;
  padding:6px!important;
}
.play-card .editor-guide span{
  font-size:6.8px!important;
}
.play-card .editor-guide b{
  width:19px!important;
  height:19px!important;
}

@media(max-width:760px){
  .play-card{
    --editor-control-h:48px;
    --editor-label-h:25px;
    padding-inline:12px!important;
  }
  .play-card .modal-head{
    padding:4px 0 9px!important;
  }
  .play-card .modal-head strong{
    font-size:19px!important;
  }
  .play-card .modal-head small{
    font-size:11px!important;
    margin-top:4px!important;
  }
  .play-card .modal-head button{
    width:42px!important;
    height:42px!important;
    font-size:27px!important;
  }
  .play-card .situation{
    min-height:46px!important;
    padding:10px 12px!important;
    font-size:15px!important;
    border-radius:11px!important;
  }
  .play-card .editor-section-title{
    margin:11px 0 5px!important;
    padding-top:10px!important;
    font-size:10.5px!important;
  }
  .play-card .situation + .editor-section-title{
    margin-top:10px!important;
    padding-top:0!important;
  }
  .play-card .editor-grid{
    column-gap:10px!important;
    row-gap:8px!important;
  }
  .play-card .field-label,
  .play-card .runner-out-fields .form-grid.two>label>.field-label{
    min-height:25px!important;
    padding:0 1px 6px!important;
    font-size:13px!important;
    line-height:1!important;
  }
  .play-card .field-help{
    font-size:9px!important;
  }
  /* Preserve Safari anti-zoom while making values visually prominent. */
  .play-card .editor-grid select,
  .play-card .editor-grid input,
  .play-card .runner-out-fields .form-grid.two select,
  .play-card .runner-out-fields .form-grid.two input,
  .play-card .pitch-entry-grid select,
  .play-card .pitch-entry-grid input,
  .play-card .pitch-velo-wrap input{
    font-size:16px!important;
    font-weight:850!important;
  }
  .play-card .check-label{
    min-height:48px!important;
    margin-top:25px!important;
    padding:0 10px!important;
    font-size:12px!important;
  }
  .play-card .modal-actions{
    padding:8px 0 calc(7px + env(safe-area-inset-bottom))!important;
    gap:7px!important;
  }
  .play-card .modal-actions button{
    min-height:48px!important;
    padding:0 8px!important;
    font-size:13px!important;
    border-radius:10px!important;
  }
  .play-card .editor-guide{
    grid-template-columns:1fr 1fr!important;
    margin:6px 0 9px!important;
    padding:5px!important;
  }
  .play-card .editor-guide span{
    min-height:26px!important;
    font-size:7.5px!important;
  }
  .play-card .editor-guide b{
    width:20px!important;
    height:20px!important;
    font-size:7px!important;
  }
  .play-card .pitch-tools-head{
    min-height:66px!important;
    padding:9px 10px!important;
    grid-template-columns:minmax(0,1fr) 100px!important;
  }
  .play-card .pitch-title-copy>strong{
    font-size:14px!important;
  }
  .play-card .pitch-title-copy>small{
    font-size:7px!important;
    line-height:1.25!important;
  }
  .play-card .pitch-count-card{
    min-width:100px!important;
    padding:7px 8px!important;
  }
  .play-card .pitch-count-card>b{
    font-size:24px!important;
  }
  .play-card .pitch-count-lights{
    padding:6px 10px!important;
    gap:16px!important;
  }
  .play-card .pitch-light-group small{
    font-size:6px!important;
  }
  .play-card .pitch-entry-card{
    padding:9px 10px 10px!important;
  }
  .play-card .pitch-entry-card-head{
    margin-bottom:7px!important;
  }
  .play-card .pitch-entry-card-head strong,
  .play-card .pitch-sequence-head strong{
    font-size:9px!important;
  }
  .play-card .pitch-entry-card-head small,
  .play-card .pitch-sequence-head small{
    font-size:6.5px!important;
  }
  .play-card .pitch-entry-grid{
    grid-template-columns:minmax(0,1fr) minmax(112px,.78fr)!important;
    gap:8px!important;
  }
  .play-card .pitch-entry-grid label{
    font-size:11px!important;
  }
  .play-card .pitch-entry-grid label>span{
    min-height:22px!important;
    margin-bottom:5px!important;
  }
  .play-card .pitch-entry-grid label>span small{
    font-size:8px!important;
  }
  .play-card .pitch-entry-grid select,
  .play-card .pitch-entry-grid input,
  .play-card .pitch-velo-wrap{
    height:48px!important;
    min-height:48px!important;
  }
  .play-card .pitch-velo-wrap input{
    height:46px!important;
  }
  .play-card .pitch-velo-wrap>b{
    font-size:7px!important;
  }
  .play-card .pitch-result-field{
    grid-column:1/-1!important;
  }
  .play-card .record-pitch-btn{
    grid-column:1/-1!important;
    min-height:48px!important;
    font-size:12px!important;
  }
  .play-card .record-pitch-btn>strong{
    font-size:11px!important;
  }
  .play-card .pitch-sequence-card{
    padding:9px 10px!important;
  }
  .play-card .pitch-empty{
    min-height:56px!important;
  }
  .play-card .pitch-workflow-note{
    padding:7px 10px!important;
  }
  .play-card .pitch-workflow-note p{
    font-size:7px!important;
  }
  .play-card .advanced-layout{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  .play-card .fielder-grid{
    grid-auto-rows:54px!important;
    gap:6px!important;
  }
  .play-card .fielder-grid-pos{
    height:54px!important;
    min-height:54px!important;
    padding:5px!important;
  }
  .play-card .fielder-grid-pos>span{
    width:24px!important;
    height:24px!important;
    font-size:8px!important;
  }
  .play-card .fielder-grid-pos>strong{
    font-size:8px!important;
  }
  .play-card .fielder-grid-pos>small{
    font-size:6px!important;
  }
}

@media(max-width:390px){
  .play-card{
    padding-inline:10px!important;
  }
  .play-card .editor-grid{
    column-gap:8px!important;
  }
  .play-card .field-label{
    font-size:12px!important;
  }
  .play-card .field-help{
    font-size:8px!important;
  }
  .play-card .modal-actions button{
    font-size:12px!important;
  }
}
\n\n/* ==========================================================
   v43 PLAY EDITOR — VISIBLE READABILITY PASS
   Stronger than v42: real live markup, fixed paired geometry,
   larger primary values, shorter secondary copy, less dead space.
   ========================================================== */
.play-card{
  --v43-control-h:50px;
  --v43-label-row:27px;
}
.play-card .editor-section-title{
  margin:10px 0 6px!important;
  padding-top:9px!important;
  font-size:10px!important;
  letter-spacing:.11em!important;
  line-height:1!important;
}
.play-card .editor-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:10px!important;
  row-gap:8px!important;
  align-items:start!important;
}
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label:not(.check-label){
  display:grid!important;
  grid-template-rows:var(--v43-label-row) var(--v43-control-h)!important;
  align-content:start!important;
  min-width:0!important;
  gap:0!important;
}
.play-card .field-label,
.play-card .runner-out-fields .form-grid.two>label>.field-label{
  display:flex!important;
  align-items:center!important;
  min-height:var(--v43-label-row)!important;
  height:var(--v43-label-row)!important;
  padding:0 1px 5px!important;
  font-size:11.5px!important;
  font-weight:900!important;
  line-height:1!important;
  color:var(--text)!important;
}
.play-card .field-help{
  margin-left:auto!important;
  max-width:48%!important;
  font-size:7.5px!important;
  font-weight:800!important;
  line-height:1!important;
  color:color-mix(in srgb,var(--muted) 82%,var(--text) 18%)!important;
  white-space:nowrap!important;
}
.play-card .editor-grid select,
.play-card .editor-grid input,
.play-card .runner-out-fields .form-grid.two select,
.play-card .runner-out-fields .form-grid.two input{
  height:var(--v43-control-h)!important;
  min-height:var(--v43-control-h)!important;
  padding:0 13px!important;
  border-radius:10px!important;
  border-width:1.5px!important;
  font-size:14px!important;
  font-weight:900!important;
  line-height:1!important;
  color:var(--text)!important;
}
.play-card .editor-grid input::placeholder,
.play-card .runner-out-fields input::placeholder{
  color:color-mix(in srgb,var(--muted) 78%,transparent)!important;
  font-weight:750!important;
  opacity:1!important;
}
.play-card .check-label{
  height:var(--v43-control-h)!important;
  min-height:var(--v43-control-h)!important;
  margin:var(--v43-label-row) 0 0!important;
  padding:0 12px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
}
.play-card .situation{
  min-height:44px!important;
  margin-top:7px!important;
  padding:8px 12px!important;
  font-size:14px!important;
  font-weight:950!important;
}
.play-card .modal-head strong{font-size:18px!important}
.play-card .modal-head small{font-size:9.5px!important}

/* Pitch-by-pitch: retain workflow, compress explanatory chrome. */
.play-card .pitch-tools{margin:7px 0 9px!important}
.play-card .pitch-tools-head{
  min-height:58px!important;
  padding:8px 10px!important;
}
.play-card .pitch-title-copy .pitch-kicker{font-size:5.8px!important;margin-bottom:2px!important}
.play-card .pitch-title-copy>strong{font-size:14px!important}
.play-card .pitch-title-copy>small{
  margin-top:3px!important;
  font-size:6.6px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.play-card .pitch-count-card{padding:6px 8px!important}
.play-card .pitch-count-card>b{font-size:25px!important}
.play-card .pitch-count-lights{padding:5px 10px!important}
.play-card .pitch-entry-card{padding:8px 10px 9px!important}
.play-card .pitch-entry-card-head{margin-bottom:5px!important}
.play-card .pitch-entry-card-head strong{font-size:9px!important}
.play-card .pitch-entry-card-head small{font-size:6.2px!important}
.play-card .pitch-entry-grid{
  grid-template-columns:minmax(0,1.15fr) minmax(110px,.85fr)!important;
  gap:8px!important;
}
.play-card .pitch-entry-grid label{font-size:9.5px!important;color:var(--text)!important}
.play-card .pitch-entry-grid label>span{height:23px!important;min-height:23px!important;margin:0 0 4px!important;align-items:center!important}
.play-card .pitch-entry-grid label>span small{font-size:6.5px!important}
.play-card .pitch-entry-grid select,
.play-card .pitch-entry-grid input,
.play-card .pitch-velo-wrap{
  height:48px!important;
  min-height:48px!important;
  border-radius:10px!important;
}
.play-card .pitch-result-field{grid-column:1/-1!important}
.play-card .record-pitch-btn{grid-column:1/-1!important;min-height:46px!important;border-radius:10px!important}
.play-card .record-pitch-btn>strong{font-size:11px!important}
.play-card .record-pitch-btn>small{font-size:6px!important}
.play-card .pitch-sequence-card{padding:8px 10px!important}
.play-card .pitch-sequence-head{margin-bottom:5px!important}
.play-card .pitch-empty{min-height:42px!important;padding:7px!important}
.play-card .pitch-empty>strong{font-size:8.5px!important}
.play-card .pitch-empty>small{font-size:6px!important}
.play-card .pitch-workflow-note{padding:6px 9px!important}
.play-card .pitch-workflow-note p{font-size:6.4px!important;line-height:1.2!important}
.play-card .editor-guide{margin:6px 0 8px!important;padding:5px!important;gap:4px!important}
.play-card .editor-guide span{min-height:24px!important;font-size:7.2px!important}
.play-card .editor-guide b{width:19px!important;height:19px!important}

/* Advanced tiles: truly uniform dimensions. */
.play-card .fielder-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:54px!important;
  gap:6px!important;
}
.play-card .fielder-grid-pos{
  width:100%!important;
  height:54px!important;
  min-height:54px!important;
  padding:5px 6px!important;
  box-sizing:border-box!important;
}

@media(max-width:760px){
  .play-card{
    --v43-control-h:52px;
    --v43-label-row:30px;
    padding-inline:12px!important;
  }
  .play-card .modal-head{padding:3px 0 7px!important}
  .play-card .modal-head strong{font-size:21px!important}
  .play-card .modal-head small{font-size:11px!important;color:color-mix(in srgb,var(--muted) 78%,var(--text) 22%)!important}
  .play-card .situation{min-height:48px!important;font-size:16px!important;padding:8px 12px!important}
  .play-card .editor-section-title{font-size:11px!important;margin:10px 0 5px!important}
  .play-card .field-label,
  .play-card .runner-out-fields .form-grid.two>label>.field-label{
    height:30px!important;
    min-height:30px!important;
    padding-bottom:6px!important;
    font-size:14px!important;
  }
  .play-card .field-help{font-size:9px!important;max-width:46%!important}
  .play-card .editor-grid select,
  .play-card .editor-grid input,
  .play-card .runner-out-fields .form-grid.two select,
  .play-card .runner-out-fields .form-grid.two input{
    height:52px!important;
    min-height:52px!important;
    padding:0 13px!important;
    font-size:17px!important;
    border-width:1.5px!important;
  }
  .play-card .check-label{height:52px!important;min-height:52px!important;margin-top:30px!important;font-size:13px!important}
  .play-card .pitch-tools-head{min-height:60px!important;padding:7px 9px!important;grid-template-columns:minmax(0,1fr) 98px!important}
  .play-card .pitch-title-copy>strong{font-size:15px!important}
  .play-card .pitch-title-copy>small{font-size:7px!important}
  .play-card .pitch-count-card{min-width:98px!important}
  .play-card .pitch-count-card>b{font-size:25px!important}
  .play-card .pitch-entry-grid label{font-size:12px!important}
  .play-card .pitch-entry-grid label>span{height:25px!important;min-height:25px!important;margin-bottom:4px!important}
  .play-card .pitch-entry-grid label>span small{font-size:8px!important}
  .play-card .pitch-entry-grid select,
  .play-card .pitch-entry-grid input,
  .play-card .pitch-velo-wrap{height:52px!important;min-height:52px!important}
  .play-card .pitch-velo-wrap input{height:50px!important;font-size:17px!important}
  .play-card .record-pitch-btn{min-height:50px!important}
  .play-card .pitch-empty{min-height:44px!important}
  .play-card .editor-guide{grid-template-columns:1fr 1fr!important}
  .play-card .editor-guide span{font-size:8.2px!important}
  .play-card .modal-actions button{min-height:50px!important;font-size:14px!important}
}

@media(max-width:390px){
  .play-card .editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;column-gap:8px!important}
  .play-card .field-label{font-size:13px!important}
  .play-card .field-help{font-size:8px!important}
  .play-card .editor-grid select,.play-card .editor-grid input{font-size:16px!important}
}

/* ==========================================================
   v44 UNIFIED PLAY EDITOR — MOBILE READABILITY SYSTEM
   Applies to Basic, Advanced, and Pitch-by-Pitch.
   Same workflow/layout; larger readable copy and tighter chrome.
   ========================================================== */
.play-card{
  --v44-control-h:52px;
  --v44-label-h:30px;
}
.play-card .editor-section-title{
  margin:12px 0 7px!important;
  padding-top:10px!important;
  font-size:12px!important;
  font-weight:950!important;
  letter-spacing:.1em!important;
  line-height:1.1!important;
  color:var(--accent)!important;
}
.play-card .editor-grid,
.play-card .runner-out-fields .form-grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:12px!important;
  row-gap:9px!important;
  align-items:start!important;
}
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label:not(.check-label){
  display:grid!important;
  grid-template-rows:var(--v44-label-h) var(--v44-control-h)!important;
  min-width:0!important;
  gap:0!important;
  align-content:start!important;
}
.play-card .field-label,
.play-card .runner-out-fields .form-grid.two>label>.field-label{
  display:flex!important;
  align-items:center!important;
  min-height:var(--v44-label-h)!important;
  height:var(--v44-label-h)!important;
  padding:0 2px 6px!important;
  color:var(--text)!important;
  font-size:14px!important;
  font-weight:950!important;
  line-height:1!important;
}
.play-card .field-help{
  display:inline!important;
  margin:0 0 0 auto!important;
  max-width:52%!important;
  color:color-mix(in srgb,var(--muted) 72%,var(--text) 28%)!important;
  font-size:9.5px!important;
  font-weight:800!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.play-card .editor-grid select,
.play-card .editor-grid input,
.play-card .runner-out-fields .form-grid.two select,
.play-card .runner-out-fields .form-grid.two input{
  width:100%!important;
  height:var(--v44-control-h)!important;
  min-height:var(--v44-control-h)!important;
  box-sizing:border-box!important;
  padding:0 14px!important;
  border-width:1.5px!important;
  border-radius:11px!important;
  color:var(--text)!important;
  font-size:17px!important;
  font-weight:900!important;
  line-height:1.1!important;
}
.play-card .editor-grid input::placeholder,
.play-card .runner-out-fields input::placeholder{
  color:color-mix(in srgb,var(--muted) 76%,var(--text) 24%)!important;
  font-size:16px!important;
  font-weight:750!important;
  opacity:.86!important;
}
.play-card .check-label{
  height:var(--v44-control-h)!important;
  min-height:var(--v44-control-h)!important;
  margin:var(--v44-label-h) 0 0!important;
  padding:0 12px!important;
  font-size:13px!important;
  font-weight:850!important;
}
.play-card .situation{
  min-height:50px!important;
  margin-top:7px!important;
  padding:10px 14px!important;
  font-size:17px!important;
  font-weight:950!important;
  line-height:1!important;
}
.play-card .modal-head strong{font-size:21px!important;line-height:1!important}
.play-card .modal-head small{margin-top:5px!important;font-size:12px!important;line-height:1.2!important}
.play-card .runner-out-title{font-size:11px!important}
.play-card .modal-actions button{font-size:14px!important;font-weight:950!important}

/* Advanced — keep the 3x3 grid but stop using miniature typography. */
.play-card .advanced-title{margin-top:14px!important}
.play-card .field-card-head{min-height:42px!important;margin-bottom:8px!important}
.play-card .field-card-head strong{font-size:12px!important;line-height:1.1!important}
.play-card .field-card-head small{margin-top:4px!important;font-size:10px!important;line-height:1.2!important}
.play-card .field-card-head button{min-height:34px!important;font-size:10px!important}
.play-card .fielder-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:68px!important;
  gap:7px!important;
}
.play-card .fielder-grid-pos{
  height:68px!important;
  min-height:68px!important;
  padding:7px 8px!important;
  gap:3px 7px!important;
}
.play-card .fielder-grid-pos>span{
  width:29px!important;height:29px!important;
  font-size:10px!important;
}
.play-card .fielder-grid-pos>strong{
  font-size:10px!important;
  line-height:1.08!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.play-card .fielder-grid-pos>small{font-size:8px!important;line-height:1!important}
.play-card .fielder-selection{min-height:34px!important;padding:8px 10px!important;font-size:10px!important}
.play-card .advanced-runner-row{gap:8px!important;padding:9px!important}
.play-card .advanced-runner-row label{font-size:11px!important;line-height:1.15!important}
.play-card .advanced-runner-row select,
.play-card .advanced-runner-row input{height:48px!important;min-height:48px!important;font-size:16px!important}
.play-card .runner-ident strong{font-size:12px!important}.play-card .runner-ident small{font-size:9px!important}
.play-card .runner-empty{font-size:11px!important;line-height:1.35!important;padding:13px!important}

/* Pitch-by-Pitch — larger copy, fewer tiny explanatory lines. */
.play-card[data-editor-mode="pitch"] .pitch-tools{margin:8px 0 10px!important}
.play-card .pitch-tools-head{
  min-height:72px!important;
  padding:10px 12px!important;
  grid-template-columns:minmax(0,1fr) 112px!important;
  gap:12px!important;
}
.play-card .pitch-title-copy .pitch-kicker{
  margin-bottom:4px!important;
  font-size:9px!important;
  font-weight:950!important;
  letter-spacing:.12em!important;
}
.play-card .pitch-title-copy>strong{font-size:18px!important;line-height:1!important}
.play-card .pitch-title-copy>small{
  display:block!important;
  margin-top:5px!important;
  max-width:34ch!important;
  font-size:10.5px!important;
  line-height:1.25!important;
  white-space:normal!important;
}
.play-card .pitch-count-card{padding:8px 9px!important}
.play-card .pitch-count-card>small{font-size:8px!important}
.play-card .pitch-count-card>b{font-size:25px!important}
.play-card .pitch-count-card>span{font-size:7.5px!important}
.play-card .pitch-count-card>em{font-size:7.5px!important}
.play-card .pitch-count-lights{padding:8px 12px!important;gap:18px!important}
.play-card .pitch-light-group small{font-size:9px!important}
.play-card .pitch-entry-card{padding:10px 12px 11px!important}
.play-card .pitch-entry-card-head{margin-bottom:8px!important}
.play-card .pitch-entry-card-head strong,
.play-card .pitch-sequence-head strong{font-size:12px!important;line-height:1.1!important}
.play-card .pitch-entry-card-head small,
.play-card .pitch-sequence-head small{margin-top:3px!important;font-size:9.5px!important;line-height:1.25!important}
.play-card .pitch-entry-grid{gap:9px!important}
.play-card .pitch-entry-grid label{font-size:14px!important;font-weight:950!important;line-height:1!important}
.play-card .pitch-entry-grid label>span{min-height:27px!important;margin-bottom:5px!important;align-items:center!important}
.play-card .pitch-entry-grid label>span small{font-size:9px!important}
.play-card .pitch-entry-grid select,
.play-card .pitch-entry-grid input,
.play-card .pitch-velo-wrap{
  height:52px!important;
  min-height:52px!important;
  border-radius:11px!important;
}
.play-card .pitch-entry-grid select,
.play-card .pitch-entry-grid input{font-size:17px!important;font-weight:900!important}
.play-card .pitch-velo-wrap input{height:50px!important}
.play-card .pitch-velo-wrap>b{font-size:9px!important}
.play-card .record-pitch-btn{min-height:52px!important;border-radius:11px!important}
.play-card .record-pitch-btn>strong{font-size:14px!important}
.play-card .record-pitch-btn>small{display:none!important}
.play-card .pitch-sequence-card{padding:10px 12px!important}
.play-card .pitch-sequence-head{margin-bottom:7px!important}
.play-card .pitch-sequence-head .small-btn{min-height:34px!important;font-size:10px!important}
.play-card .pitch-empty{
  min-height:48px!important;
  padding:8px 10px!important;
  gap:3px!important;
}
.play-card .pitch-empty>strong{font-size:11px!important}
.play-card .pitch-empty>small{font-size:9.5px!important}
.play-card .pitch-chip{font-size:11px!important;padding:9px 10px!important}
.play-card .pitch-chip small{font-size:9px!important}
.play-card .pitch-workflow-note{padding:8px 10px!important;gap:8px!important}
.play-card .pitch-workflow-note>span{font-size:8px!important}
.play-card .pitch-workflow-note p{font-size:10px!important;line-height:1.25!important}
.play-card .editor-guide{gap:6px!important;margin:7px 0 10px!important;padding:7px!important}
.play-card .editor-guide span{min-height:30px!important;font-size:10px!important;font-weight:850!important}
.play-card .editor-guide b{width:22px!important;height:22px!important;font-size:8px!important}

@media(max-width:760px){
  .play-card{--v44-control-h:54px;--v44-label-h:32px;padding-inline:13px!important}
  .play-card .editor-section-title{font-size:12.5px!important;margin:12px 0 7px!important}
  .play-card .field-label,
  .play-card .runner-out-fields .form-grid.two>label>.field-label{font-size:15px!important}
  .play-card .field-help{font-size:10px!important}
  .play-card .editor-grid select,
  .play-card .editor-grid input,
  .play-card .runner-out-fields .form-grid.two select,
  .play-card .runner-out-fields .form-grid.two input{font-size:18px!important}
  .play-card .editor-grid input::placeholder,
  .play-card .runner-out-fields input::placeholder{font-size:17px!important}
  .play-card .modal-head strong{font-size:22px!important}
  .play-card .modal-head small{font-size:13px!important}
  .play-card .situation{font-size:18px!important}
  .play-card .modal-actions button{min-height:52px!important;font-size:15px!important}
  .play-card .advanced-layout{grid-template-columns:1fr!important}
  .play-card .field-card-head strong{font-size:13px!important}
  .play-card .field-card-head small{font-size:10.5px!important}
  .play-card .fielder-grid{grid-auto-rows:70px!important}
  .play-card .fielder-grid-pos{height:70px!important;min-height:70px!important}
  .play-card .fielder-grid-pos>strong{font-size:10.5px!important}
  .play-card .fielder-grid-pos>small{font-size:8.5px!important}
  .play-card .advanced-runner-row label{font-size:12px!important}
  .play-card .pitch-title-copy>strong{font-size:19px!important}
  .play-card .pitch-title-copy>small{font-size:11px!important;max-width:28ch!important}
  .play-card .pitch-light-group small{font-size:9.5px!important}
  .play-card .pitch-entry-card-head strong,
  .play-card .pitch-sequence-head strong{font-size:13px!important}
  .play-card .pitch-entry-card-head small,
  .play-card .pitch-sequence-head small{font-size:10px!important}
  .play-card .pitch-entry-grid label{font-size:15px!important}
  .play-card .pitch-entry-grid select,
  .play-card .pitch-entry-grid input{font-size:18px!important}
  .play-card .pitch-workflow-note p{font-size:10.5px!important}
  .play-card .editor-guide span{font-size:10.5px!important}
}

@media(max-width:390px){
  .play-card{padding-inline:10px!important}
  .play-card .editor-grid{column-gap:8px!important}
  .play-card .field-label{font-size:14px!important}
  .play-card .field-help{font-size:9px!important}
  .play-card .pitch-tools-head{grid-template-columns:minmax(0,1fr) 102px!important}
  .play-card .pitch-title-copy>small{font-size:10px!important;max-width:25ch!important}
  .play-card .pitch-entry-grid{grid-template-columns:minmax(0,1.1fr) minmax(105px,.8fr)!important}
  .play-card .fielder-grid-pos>strong{font-size:9.5px!important}
}


/* ==========================================================
   v45 MODAL SCROLL LOCK + SCORING GRID REFINEMENT
   - Background page stays fixed while any editor/modal is open.
   - Scoring is an even 2x2 field system in every scoring mode.
   - Checkbox controls no longer inherit giant generic input sizing.
   ========================================================== */
html.modal-scroll-locked,
body.modal-scroll-locked{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
.modal:not(.hidden){overscroll-behavior:contain!important}
.modal:not(.hidden) .modal-card{
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y!important;
}

.play-card .scoring-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px 12px!important;
  align-items:start!important;
  margin-top:0!important;
}
.play-card .scoring-grid>label{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  display:grid!important;
  grid-template-rows:var(--v44-label-h) var(--v44-control-h)!important;
  gap:0!important;
  align-content:start!important;
}
.play-card .scoring-grid .field-label{
  width:100%!important;
  height:var(--v44-label-h)!important;
  min-height:var(--v44-label-h)!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  padding:0 2px 6px!important;
  text-align:left!important;
}
.play-card .scoring-grid select{
  width:100%!important;
  max-width:none!important;
  height:var(--v44-control-h)!important;
  min-height:var(--v44-control-h)!important;
  margin:0!important;
  padding:0 14px!important;
  box-sizing:border-box!important;
  border-width:1.5px!important;
  border-radius:11px!important;
  font-size:17px!important;
  font-weight:900!important;
  line-height:1!important;
}
.play-card .batter-scored-field{
  display:grid!important;
  grid-template-rows:var(--v44-label-h) var(--v44-control-h)!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  gap:0!important;
}
.play-card .score-check-control{
  width:100%!important;
  height:var(--v44-control-h)!important;
  min-height:var(--v44-control-h)!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:11px!important;
  padding:0 14px!important;
  border:1.5px solid var(--line)!important;
  border-radius:11px!important;
  background:var(--panel2)!important;
  color:var(--text)!important;
  font-size:14px!important;
  font-weight:900!important;
  line-height:1.05!important;
  overflow:hidden!important;
}
.play-card .score-check-control input[type="checkbox"]{
  -webkit-appearance:auto!important;
  appearance:auto!important;
  display:block!important;
  flex:0 0 22px!important;
  width:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  height:22px!important;
  min-height:22px!important;
  max-height:22px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:5px!important;
  accent-color:var(--accent)!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card .score-check-control>span{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
/* All checkbox rows in the editor stay compact even under generic modal input rules. */
.play-card .check-label input[type="checkbox"]{
  -webkit-appearance:auto!important;
  appearance:auto!important;
  width:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  height:22px!important;
  min-height:22px!important;
  max-height:22px!important;
  margin:0 9px 0 0!important;
  padding:0!important;
  flex:0 0 22px!important;
  accent-color:var(--accent)!important;
}

@media(max-width:760px){
  .play-card .scoring-grid{gap:9px 10px!important}
  .play-card .scoring-grid select{font-size:18px!important}
  .play-card .score-check-control{font-size:14px!important;padding:0 12px!important;gap:9px!important}
}
@media(max-width:390px){
  .play-card .scoring-grid{gap:8px!important}
  .play-card .score-check-control{font-size:13px!important;padding:0 10px!important}
}

/* ==========================================================
   v46 SCORING PANEL + HARD iOS MODAL LOCK
   New markup intentionally avoids inherited form-grid/label sizing.
   ========================================================== */
html.modal-scroll-locked,
body.modal-scroll-locked{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.modal-scroll-locked #appShell,
body.modal-scroll-locked #main{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
.modal:not(.hidden){
  position:fixed!important;
  inset:0!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
.modal:not(.hidden)>.modal-card{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
}

.play-card .scoring-title{
  margin-bottom:8px!important;
}
.play-card .scoring-panel{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  align-items:stretch!important;
}
.play-card .score-field-card{
  min-width:0!important;
  min-height:84px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-rows:20px 1fr!important;
  align-content:stretch!important;
  padding:9px 12px 8px!important;
  border:1.5px solid var(--line)!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--panel2) 92%,#000 3%)!important;
  color:var(--text)!important;
  overflow:hidden!important;
}
body.theme-wrigley .play-card .score-field-card{
  background:#0d3026!important;
  border-color:var(--wrigley-line)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley.dark-mode .play-card .score-field-card{
  background:#071a13!important;
  border-color:#6d5c39!important;
}
.play-card .score-field-title{
  display:block!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  color:color-mix(in srgb,var(--text) 78%,var(--muted) 22%)!important;
  font-size:11px!important;
  font-weight:950!important;
  line-height:1!important;
  letter-spacing:.055em!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  text-align:left!important;
}
body.theme-wrigley .play-card .score-field-title{color:color-mix(in srgb,var(--wrigley-cream) 76%,var(--wrigley-gold) 24%)!important}
.play-card .score-field-card>select{
  -webkit-appearance:auto!important;
  appearance:auto!important;
  display:block!important;
  width:100%!important;
  max-width:none!important;
  height:45px!important;
  min-height:45px!important;
  margin:0!important;
  padding:0 30px 0 0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
  font-size:20px!important;
  font-weight:950!important;
  line-height:1!important;
  text-align:left!important;
}
body.theme-wrigley .play-card .score-field-card>select{background:transparent!important;border:0!important;color:var(--wrigley-cream)!important}
.play-card .score-toggle-control{
  position:relative!important;
  min-width:0!important;
  width:100%!important;
  height:45px!important;
  min-height:45px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  color:inherit!important;
  cursor:pointer!important;
}
.play-card .score-toggle-control>input[type="checkbox"]{
  position:absolute!important;
  width:1px!important;
  min-width:1px!important;
  max-width:1px!important;
  height:1px!important;
  min-height:1px!important;
  max-height:1px!important;
  margin:-1px!important;
  padding:0!important;
  opacity:0!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  white-space:nowrap!important;
  border:0!important;
  pointer-events:none!important;
}
.play-card .score-toggle-copy{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:inherit!important;
  font-size:16px!important;
  font-weight:900!important;
  line-height:1!important;
}
.play-card .score-toggle-track{
  flex:0 0 46px!important;
  width:46px!important;
  height:26px!important;
  padding:2px!important;
  box-sizing:border-box!important;
  border:1.5px solid var(--line)!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--panel) 86%,#000 8%)!important;
  transition:background .16s ease,border-color .16s ease!important;
}
.play-card .score-toggle-track>i{
  display:block!important;
  width:20px!important;
  height:20px!important;
  border-radius:50%!important;
  background:var(--muted)!important;
  transform:translateX(0)!important;
  transition:transform .16s ease,background .16s ease!important;
}
.play-card .score-toggle-control>input:checked~.score-toggle-track{
  background:color-mix(in srgb,var(--accent) 34%,var(--panel2))!important;
  border-color:var(--accent)!important;
}
.play-card .score-toggle-control>input:checked~.score-toggle-track>i{
  transform:translateX(20px)!important;
  background:var(--accent)!important;
}
.play-card .score-toggle-control:focus-within .score-toggle-track{
  outline:2px solid color-mix(in srgb,var(--accent) 65%,transparent)!important;
  outline-offset:2px!important;
}

@media(max-width:760px){
  .play-card .scoring-panel{gap:8px!important}
  .play-card .score-field-card{min-height:78px!important;padding:8px 10px 7px!important;grid-template-rows:18px 1fr!important;border-radius:11px!important}
  .play-card .score-field-title{font-size:10px!important}
  .play-card .score-field-card>select{height:43px!important;min-height:43px!important;font-size:18px!important}
  .play-card .score-toggle-control{height:43px!important;min-height:43px!important}
  .play-card .score-toggle-copy{font-size:15px!important}
}
@media(max-width:365px){
  .play-card .score-toggle-copy{font-size:13px!important}
  .play-card .score-toggle-track{flex-basis:42px!important;width:42px!important;height:24px!important}
  .play-card .score-toggle-track>i{width:18px!important;height:18px!important}
  .play-card .score-toggle-control>input:checked~.score-toggle-track>i{transform:translateX(18px)!important}
}

/* ==========================================================
   v47 UX PHASE 1 — GUIDED NEW GAME + UNIFORM MENU
   Core scorecard and scoring geometry are intentionally unchanged.
   ========================================================== */

/* Uniform hamburger menu rows. Theme is now a normal row that opens
   its own sheet instead of dominating the drawer. */
.drawer-head>div{display:flex;flex-direction:column;gap:2px}.drawer-head>div small{font-size:8px;color:var(--muted);font-weight:800;letter-spacing:.04em}
.drawer .menu-row{
  width:100%!important;min-height:52px!important;height:52px!important;
  display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;
  align-items:center!important;gap:9px!important;padding:6px 9px!important;margin:0!important;
  border:1px solid transparent!important;border-radius:11px!important;background:transparent!important;
  color:var(--text)!important;text-align:left!important;transform:none!important;box-shadow:none!important;
  transition:background .14s ease,border-color .14s ease,opacity .14s ease!important;
}
.drawer .menu-row+.menu-row{margin-top:5px!important}
.drawer .menu-row:hover{transform:none!important;background:color-mix(in srgb,var(--panel2) 82%,#fff 6%)!important}
.drawer .drawer-nav.active{background:color-mix(in srgb,var(--selected) 78%,var(--panel2) 22%)!important;border-color:color-mix(in srgb,var(--accent) 34%,transparent)!important}
.drawer .menu-glyph{width:28px!important;height:28px!important;font-size:16px!important;color:var(--accent)!important;display:grid!important;place-items:center!important}
.drawer .menu-copy{min-width:0;display:flex;flex-direction:column;gap:2px!important;line-height:1.05}
.drawer .menu-copy strong{font-size:11px!important;color:var(--text)!important;font-weight:900!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drawer .menu-copy small{font-size:7.5px!important;line-height:1.15!important;color:var(--muted)!important;font-weight:750!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drawer .menu-trailing{font-size:15px;color:var(--accent);opacity:.85}
.drawer .menu-value{max-width:118px;padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--panel) 72%,transparent);color:var(--muted);font-size:7px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drawer .menu-badge{min-width:24px!important;padding:4px 7px!important;border-radius:999px!important;background:color-mix(in srgb,var(--accent) 14%,var(--panel))!important;color:var(--accent)!important;font-size:7px!important}
.drawer .import-button{cursor:pointer}.drawer .desktop-menu-row{display:grid!important}
.drawer-section{padding:10px 0!important}.drawer-label{margin:0 8px 7px!important}

/* Dedicated theme picker — equal visual weight for each theme. */
.theme-picker-card{max-width:720px!important}.theme-picker-list{display:grid;gap:8px;margin-top:10px}
.theme-picker-list .theme-choice{width:100%;min-height:68px!important;display:grid;grid-template-columns:44px minmax(0,1fr) 24px;align-items:center;gap:10px;padding:9px 11px;border:1px solid var(--line);border-radius:13px;background:var(--panel2);color:var(--text);text-align:left}
.theme-picker-list .theme-choice strong{font-size:12px!important}.theme-picker-list .theme-choice small{font-size:8px!important;color:var(--muted)!important}
.theme-picker-list .theme-choice.active{border-color:var(--accent)!important;background:color-mix(in srgb,var(--selected) 74%,var(--panel2) 26%)!important}
.theme-picker-list .theme-sub{margin:0 8px 3px 54px!important;padding:8px 9px!important}

/* Guided New Game setup. */
.setup-card{max-width:860px!important;overflow:auto!important}.setup-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0 14px}
.setup-progress span{position:relative;min-width:0;display:flex;align-items:center;justify-content:center;gap:7px;padding:7px 8px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--panel2) 88%,transparent);color:var(--muted)}
.setup-progress span b{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;border:1px solid var(--line);font-size:8px}.setup-progress span em{font-size:8px;font-style:normal;font-weight:900}
.setup-progress span.active{border-color:var(--accent);color:var(--text);background:color-mix(in srgb,var(--accent) 10%,var(--panel2))}.setup-progress span.active b,.setup-progress span.done b{background:var(--accent);border-color:var(--accent);color:var(--accent-ink,#08120d)}
.setup-progress span.done{color:var(--text)}
.first-game-tip{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;padding:10px 12px;margin-bottom:12px;border:1px solid color-mix(in srgb,var(--accent) 46%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--accent) 8%,var(--panel2))}
.first-game-tip strong{font-size:10px;color:var(--accent)}.first-game-tip span{font-size:8px;line-height:1.4;color:var(--muted);font-weight:750}
.setup-step{display:none}.setup-step.active{display:block;animation:setupStepIn .22s ease both}@keyframes setupStepIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.setup-heading{display:flex;flex-direction:column;gap:4px;margin:4px 0 12px}.setup-heading strong{font-size:18px;color:var(--text)}.setup-heading small{font-size:9px;line-height:1.35;color:var(--muted)}
.setup-card .mode-options{grid-template-columns:1fr!important;gap:8px!important}.setup-card .mode-option{min-height:92px!important;display:grid!important;grid-template-columns:34px minmax(0,1fr) auto!important;grid-template-rows:auto!important;align-items:center!important;gap:11px!important;padding:10px 12px!important;border-radius:13px!important;transform:none!important}
.setup-card .mode-option:hover{transform:none!important}.setup-card .mode-option.selected{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 10%,var(--panel2))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent)!important}
.setup-card .mode-icon{font-size:22px!important}.setup-card .mode-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.setup-card .mode-copy strong{font-size:14px!important}.setup-card .mode-copy small{font-size:8px!important;color:var(--accent)!important}.setup-card .mode-copy p{font-size:8px!important;line-height:1.3!important;color:var(--muted)!important;max-width:none!important}.setup-card .mode-option>em{font-size:6.5px;font-style:normal;font-weight:950;letter-spacing:.05em;color:var(--muted);padding:4px 7px;border:1px solid var(--line);border-radius:999px;white-space:nowrap}.setup-card .mode-option.selected>em{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 52%,var(--line))}
.setup-matchup{display:grid;grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr);gap:10px;align-items:end}.setup-matchup label,.setup-details-grid label{display:flex;flex-direction:column;gap:6px;font-size:9px;font-weight:900;color:var(--muted)}
.setup-matchup select,.setup-details-grid input{width:100%;min-height:50px;border:1px solid var(--line);border-radius:11px;background:var(--panel2);color:var(--text);padding:0 12px;font-size:14px;font-weight:850}
#setupSwapTeams{height:50px;border:1px solid var(--line);border-radius:11px;background:var(--panel2);color:var(--accent);font-size:18px;font-weight:900;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}#setupSwapTeams small{font-size:6px;color:var(--muted)}
.setup-matchup-preview{margin-top:12px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--panel2) 88%,transparent)}
.setup-matchup-preview>div{min-width:0;display:grid;grid-template-columns:46px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;align-items:center}.setup-matchup-preview img{grid-row:1/3;width:46px;height:46px;object-fit:contain}.setup-matchup-preview strong{font-size:15px;color:var(--text)}.setup-matchup-preview small{font-size:7px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.setup-matchup-preview>span{font-size:9px;font-weight:950;color:var(--accent)}
.setup-details-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.setup-details-grid .setup-wide{grid-column:1/-1}.setup-details-grid label>span small{font-size:7px;color:var(--muted);font-weight:700}
.setup-ready-card{margin-top:12px;padding:12px 14px;border:1px solid color-mix(in srgb,var(--accent) 44%,var(--line));border-radius:13px;background:color-mix(in srgb,var(--accent) 7%,var(--panel2));display:grid;gap:3px}.setup-ready-card span{font-size:7px;font-weight:950;letter-spacing:.12em;color:var(--accent)}.setup-ready-card strong{font-size:17px;color:var(--text)}.setup-ready-card small{font-size:8px;color:var(--muted)}
.setup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.setup-actions button{min-width:120px;min-height:46px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);font-weight:900}.setup-actions .primary{background:color-mix(in srgb,var(--accent) 76%,var(--panel));border-color:var(--accent);color:var(--accent-ink,#07120d)}

@media(max-width:760px){
  .drawer .menu-row{height:50px!important;min-height:50px!important}.drawer .menu-copy strong{font-size:10.8px!important}.drawer .menu-copy small{font-size:7.1px!important}.drawer .desktop-menu-row{display:none!important}
  .theme-picker-card{max-height:min(86dvh,720px)!important}.theme-picker-list .theme-choice{min-height:62px!important}
  .setup-card{max-height:min(90dvh,780px)!important}.setup-progress{gap:5px;margin:6px 0 10px}.setup-progress span{padding:6px 4px;gap:4px}.setup-progress span em{font-size:7px}.first-game-tip{grid-template-columns:1fr;gap:3px;padding:8px 10px}.first-game-tip strong{font-size:9px}.first-game-tip span{font-size:7.5px}
  .setup-heading strong{font-size:16px}.setup-heading small{font-size:8px}.setup-card .mode-option{min-height:82px!important;grid-template-columns:28px minmax(0,1fr) auto!important;gap:8px!important;padding:8px 9px!important}.setup-card .mode-icon{font-size:19px!important}.setup-card .mode-copy strong{font-size:13px!important}.setup-card .mode-copy small{font-size:7.5px!important}.setup-card .mode-copy p{font-size:7.2px!important}.setup-card .mode-option>em{font-size:5.7px;padding:3px 5px}
  .setup-matchup{grid-template-columns:1fr 54px 1fr;gap:6px}.setup-matchup select,.setup-details-grid input{min-height:48px;font-size:16px}#setupSwapTeams{height:48px}.setup-matchup-preview{gap:7px;padding:10px}.setup-matchup-preview>div{grid-template-columns:34px minmax(0,1fr);column-gap:6px}.setup-matchup-preview img{width:34px;height:34px}.setup-matchup-preview strong{font-size:12px}.setup-matchup-preview small{font-size:6.4px}
  .setup-details-grid{gap:8px}.setup-actions{position:sticky;bottom:-1px;background:var(--panel);margin-left:-4px;margin-right:-4px;padding:10px 4px 4px;z-index:2}.setup-actions button{flex:1;min-width:0;min-height:46px;font-size:12px}
}

@media(prefers-reduced-motion:reduce){.setup-step.active{animation:none!important}}

/* ==========================================================
   v49 RECOVERY HOTFIX
   - Restores v47's direct score-cell click/scroll behavior.
   - No custom double-tap interception or VisualViewport transform layer.
   - Play modal remains fixed; background remains locked while open.
   ========================================================== */
@media(max-width:900px){
  .team-scorebook-scroll{
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x pan-y pinch-zoom!important;
  }
  .unified-score-table .play-cell{
    touch-action:pan-x pan-y pinch-zoom!important;
  }
  .modal:not(.hidden){
    position:fixed!important;
    inset:0!important;
  }
}


/* ==========================================================
   v50 UX MOTION + CONTEXT GUIDANCE
   Stable v49 tap/scroll behavior intentionally untouched.
   All motion is transform/opacity/box-shadow only: no layout shifts.
   ========================================================== */
.editor-context-hint{
  display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;
  margin:7px 0 9px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--accent) 34%,var(--line));
  border-radius:11px;background:color-mix(in srgb,var(--panel2) 92%,var(--accent) 4%);overflow:hidden;
}
.editor-context-hint>span{padding:4px 7px;border-radius:999px;border:1px solid color-mix(in srgb,var(--accent) 52%,var(--line));color:var(--accent);font-size:7px;font-weight:950;letter-spacing:.11em}
.editor-context-hint>p{margin:0;color:var(--text);font-size:10px;font-weight:800;line-height:1.3}
.editor-context-hint[data-tone="out"]{border-color:color-mix(in srgb,#d94b4b 46%,var(--line))}
.editor-context-hint[data-tone="out"]>span{color:#e55f5f;border-color:color-mix(in srgb,#d94b4b 58%,var(--line))}
.editor-context-hint[data-tone="run"],.editor-context-hint[data-tone="complete"]{border-color:color-mix(in srgb,#43b86a 48%,var(--line))}
.editor-context-hint[data-tone="run"]>span,.editor-context-hint[data-tone="complete"]>span{color:#68c985;border-color:color-mix(in srgb,#43b86a 58%,var(--line))}
.editor-context-hint.hint-refresh p{animation:v50HintIn .2s ease both}
@keyframes v50HintIn{from{opacity:.45;transform:translateY(2px)}to{opacity:1;transform:none}}

/* Generic save confirmation: border pulse + path draw, never changes cell dimensions. */
.play-cell.play-confirm .play-entry{animation:v50EntryConfirm .36s ease both}
.play-cell.play-confirm .diamond line.base.origin,
.play-cell.play-confirm .diamond line.base.advance{stroke-dasharray:48;animation:v50PathDraw .42s ease both}
@keyframes v50PathDraw{from{stroke-dashoffset:48;opacity:.45}to{stroke-dashoffset:0;opacity:1}}
@keyframes v50EntryConfirm{0%{transform:scale(.985)}55%{transform:scale(1.025)}100%{transform:none}}

/* Home run: the diamond itself pulses; the table cell never grows. */
.play-cell.hr-celebrate .diamond{transform-origin:50% 50%;animation:v50HomeRunPulse .62s cubic-bezier(.2,.85,.25,1) both}
.play-cell.hr-celebrate .diamond-fill{animation:v50RunGlow .72s ease both}
.play-cell.hr-celebrate{animation:v50HrCellGlow .72s ease both}
@keyframes v50HomeRunPulse{0%{transform:scale(.88)}42%{transform:scale(1.16)}68%{transform:scale(.98)}84%{transform:scale(1.045)}100%{transform:scale(1)}}
@keyframes v50RunGlow{0%,100%{filter:none}45%{filter:drop-shadow(0 0 7px rgba(67,184,106,.72))}}
@keyframes v50HrCellGlow{0%,100%{box-shadow:inset 0 0 0 0 transparent}45%{box-shadow:inset 0 0 0 3px color-mix(in srgb,#43b86a 56%,transparent),0 0 14px color-mix(in srgb,#43b86a 22%,transparent)}}

/* A normal run gets a quieter home-plate/diamond confirmation. */
.play-cell.run-celebrate .diamond{transform-origin:50% 50%;animation:v50RunPulse .46s ease both}
.play-cell.run-celebrate{animation:v50RunCell .55s ease both}
@keyframes v50RunPulse{0%{transform:scale(.94)}50%{transform:scale(1.085)}100%{transform:scale(1)}}
@keyframes v50RunCell{0%,100%{box-shadow:inset 0 0 0 0 transparent}50%{box-shadow:inset 0 0 0 3px color-mix(in srgb,#43b86a 45%,transparent)}}

/* Outs use a quick red edge confirmation without recoloring neutral score marks. */
.play-cell.out-confirm{animation:v50OutConfirm .42s ease both}
@keyframes v50OutConfirm{0%,100%{box-shadow:inset 0 0 0 0 transparent}48%{box-shadow:inset 0 0 0 3px color-mix(in srgb,#d94b4b 58%,transparent)}}

/* Next batter is acknowledged in-place — no scrollIntoView or viewport movement. */
.unified-score-table .next-batter-ready>.sticky-ord,
.unified-score-table .next-batter-ready>.sticky-player,
.unified-score-table .next-batter-ready>.sticky-pos{animation:v50NextBatter .62s ease both}
@keyframes v50NextBatter{0%,100%{filter:none}45%{filter:brightness(1.14);box-shadow:inset 3px 0 0 var(--accent),inset 0 0 0 1px color-mix(in srgb,var(--accent) 28%,transparent)}}

/* Pitch count feedback. New light pops independently from the rest of the editor. */
.pitch-light-group i.just-on{position:relative;transform-origin:center}
.pitch-light-group i.ball-pop{animation:v50BallLight .42s ease both}
.pitch-light-group i.strike-pop{animation:v50StrikeLight .46s cubic-bezier(.2,.9,.25,1) both}
.pitch-light-group i.strike-pop::after,.pitch-light-group i.ball-pop::after{content:'';position:absolute;inset:-1px;border:1px solid currentColor;border-radius:50%;animation:v50PitchRing .46s ease-out both;pointer-events:none}
@keyframes v50BallLight{0%{transform:scale(.5);opacity:.45}62%{transform:scale(1.22)}100%{transform:scale(1);opacity:1}}
@keyframes v50StrikeLight{0%{transform:scale(.45)}48%{transform:scale(1.42)}72%{transform:scale(.9)}100%{transform:scale(1)}}
@keyframes v50PitchRing{0%{opacity:.75;transform:scale(.65)}100%{opacity:0;transform:scale(2.4)}}
.pitch-chip.pitch-chip-new{animation:v50PitchChipIn .3s ease both}
@keyframes v50PitchChipIn{from{opacity:.45;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:none}}

/* Uniform menu gets tactile press feedback while preserving every row's size. */
.drawer .menu-row{transform-origin:center;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,transform .12s ease,opacity .15s ease!important}
.drawer .menu-row:active{transform:scale(.985)!important;background:color-mix(in srgb,var(--panel2) 78%,var(--accent) 8%)!important}

@media(max-width:600px){
  .editor-context-hint{margin:6px 0 8px;padding:8px 9px;gap:8px}
  .editor-context-hint>span{font-size:8px}
  .editor-context-hint>p{font-size:11.5px;line-height:1.28}
}
@media(prefers-reduced-motion:reduce){
  .editor-context-hint.hint-refresh p,.play-cell.play-confirm .play-entry,.play-cell.play-confirm .diamond line.base.origin,.play-cell.play-confirm .diamond line.base.advance,
  .play-cell.hr-celebrate .diamond,.play-cell.hr-celebrate .diamond-fill,.play-cell.hr-celebrate,.play-cell.run-celebrate .diamond,.play-cell.run-celebrate,.play-cell.out-confirm,
  .unified-score-table .next-batter-ready>.sticky-ord,.unified-score-table .next-batter-ready>.sticky-player,.unified-score-table .next-batter-ready>.sticky-pos,
  .pitch-light-group i.ball-pop,.pitch-light-group i.strike-pop,.pitch-light-group i.strike-pop::after,.pitch-light-group i.ball-pop::after,.pitch-chip.pitch-chip-new{animation:none!important}
}
\n\n/* ==========================================================\n   v51 VIEWPORT-STABLE PLAY FEEDBACK\n   - Never repositions/fixes the document while an editor is open.\n   - Background gestures remain blocked by JS; the fixed sheet is the only\n     scrollable interaction surface.\n   - No next-batter animation competes with the recorded-play animation.\n   ========================================================== */\nhtml.modal-scroll-locked,\nbody.modal-scroll-locked{\n  overflow:visible!important;\n  overscroll-behavior:auto!important;\n}\nbody.modal-scroll-locked #appShell,\nbody.modal-scroll-locked #main{\n  overflow:visible!important;\n  overscroll-behavior:auto!important;\n}\n.modal:not(.hidden){\n  position:fixed!important;\n  inset:0!important;\n  overscroll-behavior:none!important;\n}\n.modal:not(.hidden)>.modal-card{\n  overflow-y:auto!important;\n  overflow-x:hidden!important;\n  overscroll-behavior:contain!important;\n  -webkit-overflow-scrolling:touch!important;\n}\n/* v50's HR and pitch animations are preserved exactly. The animated\n   next-batter pulse is retired; current-batter styling remains static. */\n.unified-score-table .next-batter-ready>.sticky-ord,\n.unified-score-table .next-batter-ready>.sticky-player,\n.unified-score-table .next-batter-ready>.sticky-pos{\n  animation:none!important;\n}\n

/* ==========================================================
   v52 GUIDED RECOVERY UX
   - No score-grid touch/scroll changes.
   - Context focus uses shadow/opacity only; never changes layout.
   - Confirmation/Undo floats above the action bar without moving content.
   ========================================================== */
#batterResultGrid,#runnerGrid,#scoringPanel,#advancedTools,#pitchTools{
  position:relative;
  transition:box-shadow .18s ease,filter .18s ease,background-color .18s ease;
}
.context-focus{
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 62%,transparent),0 6px 22px color-mix(in srgb,var(--accent) 10%,transparent)!important;
  animation:v52ContextFocus .42s ease both;
}
@keyframes v52ContextFocus{
  0%{filter:brightness(1)}
  45%{filter:brightness(1.075)}
  100%{filter:brightness(1)}
}
#advancedTools.context-focus,#pitchTools.context-focus{
  border-radius:14px;
}
#applyPlayBtn{
  transition:transform .13s ease,box-shadow .16s ease,filter .16s ease!important;
}
#applyPlayBtn:active{transform:scale(.985)!important}
.app-action-toast{
  position:fixed;left:50%;bottom:28px;transform:translateX(-50%);
  z-index:420;display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:9px;min-width:min(360px,calc(100vw - 28px));max-width:min(520px,calc(100vw - 28px));
  padding:10px 11px;border:1px solid color-mix(in srgb,var(--accent) 52%,var(--line));
  border-radius:14px;background:color-mix(in srgb,var(--panel) 94%,#050807 6%);
  color:var(--text);box-shadow:0 14px 38px rgba(0,0,0,.28);
  animation:v52ToastIn .22s cubic-bezier(.2,.8,.25,1) both;overflow:hidden;
}
.app-action-toast .toast-check{
  width:25px;height:25px;border-radius:50%;display:grid;place-items:center;
  background:color-mix(in srgb,#43b86a 20%,var(--panel2));color:#69d38b;
  border:1px solid color-mix(in srgb,#43b86a 52%,var(--line));font-weight:950;font-size:12px
}
.app-action-toast strong{font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-action-toast button{
  min-height:34px!important;padding:7px 11px!important;border-radius:10px!important;
  border:1px solid color-mix(in srgb,var(--accent) 65%,var(--line))!important;
  background:color-mix(in srgb,var(--accent) 13%,var(--panel2))!important;
  color:var(--accent)!important;font-size:11px!important;font-weight:950!important
}
.app-action-toast>i{
  position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--accent);
  transform-origin:left center;animation:v52ToastTimer 4.2s linear both;opacity:.72
}
.app-action-toast.toast-leave{animation:v52ToastOut .16s ease both}
@keyframes v52ToastIn{from{opacity:0;transform:translate(-50%,8px) scale(.985)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes v52ToastOut{to{opacity:0;transform:translate(-50%,6px) scale(.985)}}
@keyframes v52ToastTimer{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@media(max-width:700px){
  .app-action-toast{bottom:calc(78px + env(safe-area-inset-bottom));min-width:calc(100vw - 24px);padding:10px}
  .app-action-toast strong{font-size:12.5px}
  .app-action-toast button{font-size:12px!important}
}
@media(prefers-reduced-motion:reduce){
  .context-focus,.app-action-toast,.app-action-toast.toast-leave,.app-action-toast>i{animation:none!important}
}

.app-action-toast.toast-info .toast-check{
  background:color-mix(in srgb,var(--accent) 12%,var(--panel2));
  color:var(--accent);
  border-color:color-mix(in srgb,var(--accent) 42%,var(--line));
}


/* ==========================================================
   v53 LIVE GAME FLOW UX
   Clear inning / outs / current-batter state without viewport movement.
   ========================================================== */
.live-game-bar{min-height:58px!important;grid-template-columns:minmax(0,1fr) minmax(138px,auto) minmax(0,1fr)!important;padding:7px 12px!important}
.live-inning{min-width:138px!important;display:grid;justify-items:center;align-content:center;gap:2px}
.live-inning>strong{font-size:13px!important;line-height:1!important;letter-spacing:.075em}
.live-status-row{display:flex;align-items:center;justify-content:center;gap:6px;min-height:14px;color:var(--muted);font-size:8px;font-weight:950;letter-spacing:.04em}
.live-out-dots{display:inline-flex;align-items:center;gap:3px}
.live-out-dots i{display:block;width:7px;height:7px;border-radius:50%;border:1px solid color-mix(in srgb,var(--accent) 64%,var(--line));background:transparent;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.live-out-dots i.on{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 14%,transparent)}
.live-inning .live-batter{max-width:160px;margin:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:8px!important;font-weight:800}
.live-inning .live-batter b{color:var(--text);font-weight:950}
.live-game-bar.is-final{min-height:52px!important}

.inning-transition{left:50%!important;top:max(14px,env(safe-area-inset-top))!important;width:min(430px,calc(100vw - 24px));transform:translateX(-50%)!important;display:grid!important;grid-template-columns:auto minmax(0,1fr) 34px!important;align-items:center!important;gap:10px!important;padding:10px 10px 10px 12px!important;border-radius:14px!important;animation:v53InningIn .24s cubic-bezier(.2,.8,.2,1) both;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.inning-transition.leaving{animation:v53InningOut .17s ease both}
.inning-transition-outs{display:flex;gap:3px;padding:8px;border:1px solid color-mix(in srgb,var(--accent) 48%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--panel) 84%,transparent)}
.inning-transition-outs i{width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 14%,transparent)}
.inning-transition-copy{display:grid;min-width:0;gap:2px}
.inning-transition-copy small{font-size:7px;font-weight:950;letter-spacing:.16em;color:var(--muted)}
.inning-transition-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px!important;color:var(--text)!important;letter-spacing:.035em}
.inning-transition-copy em{font-style:normal;font-size:9px;font-weight:850;color:var(--accent)}
.inning-transition button{width:34px!important;height:34px!important;min-width:34px;border:1px solid var(--line)!important;background:color-mix(in srgb,var(--panel) 82%,transparent)!important;font-size:18px;line-height:1}
@keyframes v53InningIn{from{opacity:0;transform:translate(-50%,-12px) scale(.985)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes v53InningOut{to{opacity:0;transform:translate(-50%,-8px) scale(.99)}}

@media(max-width:600px){
 :root{--livebar-h:56px!important}
 .live-game-bar{min-height:56px!important;grid-template-columns:minmax(0,1fr) 126px minmax(0,1fr)!important;gap:4px!important;padding:5px 7px!important}
 .live-team strong{font-size:12px!important}.live-team span{font-size:7.2px!important}.live-team b{font-size:10px!important}
 .live-inning{min-width:126px!important;gap:1px!important}.live-inning>strong{font-size:11px!important}
 .live-status-row{gap:5px;font-size:7px}.live-out-dots{gap:2.5px}.live-out-dots i{width:6px;height:6px}
 .live-inning .live-batter{max-width:124px;font-size:7.4px!important}
 .inning-transition{top:max(10px,env(safe-area-inset-top))!important;width:calc(100vw - 18px);padding:9px!important;gap:8px!important}
 .inning-transition-copy strong{font-size:11px!important}.inning-transition-copy em{font-size:8.5px}
 .inning-transition-outs{padding:7px}.inning-transition-outs i{width:7px;height:7px}
}

body.theme-wrigley .live-out-dots i.on,body.theme-wrigley .inning-transition-outs i{background:#c5a567;border-color:#c5a567}
body.theme-postseason .live-out-dots i.on,body.theme-postseason .inning-transition-outs i{background:var(--accent);border-color:var(--accent)}
@media(prefers-reduced-motion:reduce){.inning-transition,.inning-transition.leaving{animation:none!important}}


/* ==========================================================
   v54 POSTGAME EXPERIENCE
   User-facing completion flow only. Score-grid touch/scroll geometry untouched.
   ========================================================== */
.postgame-banner>div:first-child span{font-size:8px;color:var(--muted);font-weight:750;margin-top:1px}
.postgame-banner .primary{background:var(--accent)!important;color:var(--bg)!important;border-color:var(--accent)!important}
.postgame-card{width:min(780px,calc(100vw - 24px))!important;max-height:min(860px,calc(100dvh - 24px))!important}
#postgameContent{display:grid;gap:10px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
.postgame-hero{display:grid;gap:8px;padding:15px;border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:16px;background:linear-gradient(145deg,color-mix(in srgb,var(--panel2) 90%,var(--accent) 8%),var(--panel));text-align:center;overflow:hidden;position:relative}
.postgame-hero:after{content:"";position:absolute;inset:auto 12% -42px;height:75px;border-radius:50%;background:var(--accent);filter:blur(38px);opacity:.09;pointer-events:none}
.postgame-hero>small{font-size:8px;font-weight:950;letter-spacing:.16em;color:var(--accent)}
.postgame-hero>p{margin:0;font-size:9px;color:var(--muted);font-weight:750}
.postgame-matchup{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px}
.postgame-team{display:grid;justify-items:center;gap:3px;min-width:0}.postgame-team img{width:54px;height:54px;object-fit:contain}.postgame-team b{font-size:16px}.postgame-team span{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;color:var(--muted);font-weight:800}.postgame-team.winner img{filter:drop-shadow(0 0 9px color-mix(in srgb,var(--accent) 45%,transparent))}.postgame-team.winner b{color:var(--accent)}
.postgame-final-score{display:grid;justify-items:center;gap:2px;min-width:118px}.postgame-final-score strong{font-size:35px;line-height:1;font-weight:950}.postgame-final-score strong i{font-style:normal;color:var(--accent);padding:0 7px}.postgame-final-score span{font-size:9px;color:var(--accent);font-weight:900;text-align:center}
.postgame-team-kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px}.postgame-team-kpis>div{display:grid;grid-template-columns:auto repeat(5,1fr);align-items:center;gap:5px;padding:9px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.postgame-team-kpis small{font-size:9px;color:var(--accent);font-weight:950}.postgame-team-kpis span{display:grid;justify-items:center;font-size:8px;color:var(--muted);font-weight:800}.postgame-team-kpis b{font-size:12px;color:var(--text)}
.postgame-pitch-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.postgame-pitch-kpis span{display:grid;justify-items:center;gap:2px;padding:9px 5px;border:1px solid var(--line);border-radius:11px;background:var(--panel)}.postgame-pitch-kpis b{font-size:17px;color:var(--accent)}.postgame-pitch-kpis small{font-size:7px;color:var(--muted);font-weight:800;text-align:center}
.postgame-line-card,.summary-v54-line{border:1px solid var(--line);border-radius:13px;background:var(--panel);overflow:hidden}.postgame-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;border-bottom:1px solid var(--line)}.postgame-section-head strong{font-size:10px;letter-spacing:.08em}.postgame-section-head small{font-size:8px;color:var(--muted);font-weight:750}.postgame-linescore-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:7px}.postgame-linescore{border-collapse:collapse;width:100%;min-width:470px}.postgame-linescore th,.postgame-linescore td{min-width:31px;padding:6px 5px;border:1px solid color-mix(in srgb,var(--line) 82%,transparent);text-align:center;font-size:8px}.postgame-linescore th{font-size:7px;color:var(--muted);background:color-mix(in srgb,var(--panel2) 80%,transparent)}.postgame-linescore td:first-child,.postgame-linescore th:first-child{position:sticky;left:0;z-index:1;background:var(--panel2)}.postgame-linescore .total{background:color-mix(in srgb,var(--accent) 8%,var(--panel2))}
.postgame-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.postgame-actions button,.summary-v54-actions button{display:grid;justify-items:center;gap:3px;min-height:58px!important;padding:8px!important;border:1px solid var(--line)!important;border-radius:11px!important;background:var(--panel)!important;color:var(--accent)!important;font-size:16px!important;font-weight:950!important}.postgame-actions button span,.summary-v54-actions button span{font-size:8px;color:var(--text);font-weight:900}.postgame-footer-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.postgame-footer-actions button{min-height:44px!important;border-radius:11px!important;font-weight:950!important}.postgame-footer-actions .primary{background:var(--accent)!important;color:var(--bg)!important;border-color:var(--accent)!important}
.launch-postgame{width:100%;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;min-height:52px;padding:8px 12px;border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--accent) 7%,var(--panel));color:var(--text);text-align:left}.launch-postgame>span{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:color-mix(in srgb,var(--accent) 14%,var(--panel2));color:var(--accent);font-weight:950}.launch-postgame b{font-size:10px}.launch-postgame small{font-size:7px;color:var(--muted);font-weight:750}.launch-postgame em{font-style:normal;color:var(--accent);font-size:16px}
.summary-page-v54{display:grid;gap:9px}.summary-v54-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}.summary-v54-head small{font-size:8px;color:var(--accent);font-weight:950;letter-spacing:.15em}.summary-v54-head h2{margin:2px 0 1px;font-size:20px}.summary-v54-head p{margin:0;font-size:8px;color:var(--muted);font-weight:750}.summary-v54-head>span{padding:5px 8px;border:1px solid var(--line);border-radius:9px;font-size:8px;color:var(--muted);font-weight:850}
.summary-final-hero{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:14px;gap:10px;overflow:hidden}.summary-v54-team{display:grid;grid-template-columns:46px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;column-gap:8px}.summary-v54-team img{grid-row:1/3;width:46px;height:46px;object-fit:contain}.summary-v54-team strong{font-size:15px}.summary-v54-team small{font-size:8px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-v54-team.right{grid-template-columns:minmax(0,1fr) 46px;text-align:right}.summary-v54-team.right img{grid-column:2}.summary-v54-score{display:grid;justify-items:center;gap:2px}.summary-v54-score>small{font-size:7px;letter-spacing:.14em;color:var(--muted);font-weight:950}.summary-v54-score strong{font-size:30px;line-height:1}.summary-v54-score i{font-style:normal;color:var(--accent);padding:0 5px}.summary-v54-score span{max-width:170px;font-size:8px;color:var(--accent);font-weight:900;text-align:center}.summary-final-hero.is-final{border-color:color-mix(in srgb,var(--accent) 65%,var(--line));animation:v54FinalSettle .38s cubic-bezier(.2,.8,.2,1) both}
.summary-v54-kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px}.summary-v54-kpis>div{display:grid;grid-template-columns:auto repeat(5,1fr);align-items:center;gap:4px;padding:8px;border:1px solid var(--line);border-radius:11px;background:var(--panel)}.summary-v54-kpis small{color:var(--accent);font-size:8px;font-weight:950}.summary-v54-kpis span{display:grid;justify-items:center;font-size:7px;color:var(--muted);font-weight:800}.summary-v54-kpis b{font-size:11px;color:var(--text)}
.summary-v54-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;padding:8px}.summary-v54-actions .postgame{border-color:color-mix(in srgb,var(--accent) 64%,var(--line))!important;background:color-mix(in srgb,var(--accent) 9%,var(--panel))!important}.summary-v54-notes>div:last-child{padding:11px;font-size:10px;white-space:pre-wrap;color:var(--text);min-height:42px}
@keyframes v54FinalSettle{from{opacity:.7;transform:scale(.992)}to{opacity:1;transform:scale(1)}}
@media(max-width:700px){
 .postgame-card{width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important}
 .postgame-hero{padding:12px}.postgame-matchup{gap:6px}.postgame-team img{width:45px;height:45px}.postgame-team span{max-width:105px;font-size:7px}.postgame-final-score{min-width:104px}.postgame-final-score strong{font-size:31px}
 .postgame-team-kpis>div,.summary-v54-kpis>div{grid-template-columns:auto repeat(5,1fr);padding:7px 5px;gap:2px}.postgame-team-kpis span,.summary-v54-kpis span{font-size:6.8px}.postgame-team-kpis b,.summary-v54-kpis b{font-size:10px}
 .postgame-pitch-kpis{gap:5px}.postgame-pitch-kpis b{font-size:14px}.postgame-pitch-kpis small{font-size:6.5px}
 .summary-v54-head{padding:0 3px}.summary-v54-head h2{font-size:18px}.summary-final-hero{padding:10px 8px;gap:5px}.summary-v54-team{grid-template-columns:38px minmax(0,1fr);column-gap:5px}.summary-v54-team img{width:38px;height:38px}.summary-v54-team strong{font-size:12px}.summary-v54-team small{font-size:6.8px}.summary-v54-team.right{grid-template-columns:minmax(0,1fr) 38px}.summary-v54-score strong{font-size:27px}.summary-v54-score span{font-size:7px;max-width:110px}
 .postgame-actions button,.summary-v54-actions button{min-height:54px!important}.postgame-footer-actions button{min-height:42px!important}
 .game-complete.postgame-banner{display:grid!important}.game-complete-actions{width:100%;display:grid!important;grid-template-columns:repeat(3,1fr)}
}
@media(prefers-reduced-motion:reduce){.summary-final-hero.is-final{animation:none!important}}

/* ==========================================================
   v55 UI THEME POLISH
   Cleaner theme-aware drawer + cleaner play editor + richer Wrigley realism.
   Visual-only pass. No scoring logic changes.
   ========================================================== */

/* ---------- DRAWER / MENU COHESION ---------- */
.drawer-shade{
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.drawer{
  background:
    linear-gradient(180deg,color-mix(in srgb,var(--panel2) 94%,#000 6%),color-mix(in srgb,var(--panel) 96%,#000 4%))!important;
  border-right:1px solid color-mix(in srgb,var(--line) 78%,transparent)!important;
  box-shadow:22px 0 44px rgba(0,0,0,.34)!important;
}
.drawer-head{
  padding:4px 4px 14px!important;
  margin-bottom:2px!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 65%,transparent)!important;
}
.drawer-head strong{letter-spacing:.02em}
.drawer-head small{display:block;margin-top:3px;color:var(--muted)}
.drawer-section{
  padding:14px 0!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 48%,transparent)!important;
}
.drawer-label{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  margin:0 8px 10px!important;
  font-size:10px!important;
  font-weight:950!important;
  letter-spacing:.16em!important;
  color:color-mix(in srgb,var(--muted) 82%,var(--text) 18%)!important;
}
.drawer-label::after{
  content:'';
  flex:1 1 auto;
  height:1px;
  background:color-mix(in srgb,var(--line) 56%,transparent);
}

/* Apply one shared row system to every drawer row so the menu feels uniform. */
.menu-row,
.drawer-nav,
.drawer-tools>button,
.import-button,
.theme-choice{
  position:relative!important;
  width:100%!important;
  min-height:58px!important;
  display:grid!important;
  grid-template-columns:30px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px 12px!important;
  margin:0!important;
  border:1px solid color-mix(in srgb,var(--line) 74%,transparent)!important;
  border-radius:16px!important;
  background:color-mix(in srgb,var(--panel2) 84%,var(--panel) 16%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03),0 7px 16px rgba(0,0,0,.14)!important;
  color:var(--text)!important;
  transition:transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease!important;
}
.menu-row::before,
.drawer-nav::before,
.drawer-tools>button::before,
.import-button::before,
.theme-choice::before{
  content:'';
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:3px;
  border-radius:999px;
  background:transparent;
  transition:background .14s ease,opacity .14s ease;
  opacity:.0;
}
.menu-row:hover,
.drawer-nav:hover,
.drawer-tools>button:hover,
.import-button:hover,
.theme-choice:hover{
  transform:translateX(1px)!important;
  background:color-mix(in srgb,var(--panel2) 72%,var(--selected) 28%)!important;
  border-color:color-mix(in srgb,var(--accent) 30%,var(--line))!important;
}
.drawer-nav.active,
.menu-row.active,
.theme-choice.active{
  background:color-mix(in srgb,var(--selected) 68%,var(--panel2) 32%)!important;
  border-color:color-mix(in srgb,var(--accent) 46%,var(--line))!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent),0 10px 18px rgba(0,0,0,.16)!important;
}
.drawer-nav.active::before,
.menu-row.active::before,
.theme-choice.active::before{
  background:var(--accent)!important;
  opacity:1!important;
}
.menu-glyph{
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
  font-size:19px!important;
  color:color-mix(in srgb,var(--accent) 56%,var(--text) 44%)!important;
}
.menu-copy{min-width:0!important}
.menu-copy strong{
  display:block!important;
  font-size:11.8px!important;
  line-height:1.12!important;
  color:var(--text)!important;
}
.menu-copy small{
  display:block!important;
  margin-top:3px!important;
  font-size:8px!important;
  line-height:1.25!important;
  color:var(--muted)!important;
}
.menu-trailing,
.menu-value,
.menu-badge,
.theme-check{
  align-self:center!important;
}
.menu-trailing,
.menu-value{
  font-size:9px!important;
  font-weight:900!important;
  color:color-mix(in srgb,var(--muted) 70%,var(--text) 30%)!important;
}
.menu-badge{
  min-width:24px!important;
  padding:5px 7px!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--selected) 68%,var(--panel2))!important;
  color:var(--text)!important;
  border:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
}
.theme-choice{
  grid-template-columns:42px minmax(0,1fr) 20px!important;
}
.theme-swatch{
  width:36px!important;
  height:36px!important;
  border-radius:11px!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 6px 12px rgba(0,0,0,.18)!important;
}
.theme-sub{
  margin:8px 0 0 12px!important;
  padding:10px 11px!important;
  border-left:2px solid color-mix(in srgb,var(--accent) 62%,transparent)!important;
  border-radius:0 12px 12px 0!important;
  background:color-mix(in srgb,var(--panel) 90%,#000 10%)!important;
}

/* Wrigley drawer: make the menu feel like part of the scoreboard theme. */
body.theme-wrigley .drawer{
  background:
    linear-gradient(180deg,rgba(7,29,18,.96),rgba(12,42,27,.95)),
    url("assets/theme/wrigley-scoreboard.jpg") center top/cover no-repeat!important;
  border-right:1px solid color-mix(in srgb,var(--wrigley-gold) 44%,#2e3f31)!important;
}
body.theme-wrigley .menu-row,
body.theme-wrigley .drawer-nav,
body.theme-wrigley .drawer-tools>button,
body.theme-wrigley .import-button,
body.theme-wrigley .theme-choice{
  background:linear-gradient(180deg,rgba(17,63,49,.96),rgba(12,42,32,.96))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 34%,#385541)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 8px 16px rgba(0,0,0,.18)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley .menu-row:hover,
body.theme-wrigley .drawer-nav:hover,
body.theme-wrigley .drawer-tools>button:hover,
body.theme-wrigley .import-button:hover,
body.theme-wrigley .theme-choice:hover{
  background:linear-gradient(180deg,rgba(22,79,61,.98),rgba(15,56,43,.98))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 52%,#45664d)!important;
}
body.theme-wrigley .drawer-nav.active,
body.theme-wrigley .menu-row.active,
body.theme-wrigley .theme-choice.active{
  background:linear-gradient(180deg,#1a5b46,#114033)!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 78%,#56714a)!important;
  box-shadow:inset 0 0 0 1px rgba(238,228,200,.08),0 10px 18px rgba(0,0,0,.22)!important;
}
body.theme-wrigley .drawer-nav.active::before,
body.theme-wrigley .menu-row.active::before,
body.theme-wrigley .theme-choice.active::before{
  background:linear-gradient(180deg,var(--wrigley-gold),#eadcb6)!important;
}
body.theme-wrigley .menu-glyph{color:color-mix(in srgb,var(--wrigley-gold) 48%,var(--wrigley-cream) 52%)!important}
body.theme-wrigley .menu-copy strong,
body.theme-wrigley .menu-copy small,
body.theme-wrigley .menu-value,
body.theme-wrigley .menu-trailing,
body.theme-wrigley .drawer-label,
body.theme-wrigley .drawer-head small{color:var(--wrigley-cream)!important}
body.theme-wrigley .menu-copy small,
body.theme-wrigley .drawer-label,
body.theme-wrigley .menu-trailing,
body.theme-wrigley .menu-value{opacity:.84}
body.theme-wrigley .theme-sub{
  background:rgba(9,34,24,.68)!important;
  border-left-color:var(--wrigley-gold)!important;
}

/* ---------- PLAY EDITOR CLEANUP ---------- */
.play-card{
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel2) 96%,#fff 4%),color-mix(in srgb,var(--panel) 98%,#000 2%))!important;
  box-shadow:0 24px 54px rgba(0,0,0,.38)!important;
}
.play-card .modal-head{
  padding:2px 0 10px!important;
  margin-bottom:2px!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 52%,transparent)!important;
}
.play-card .modal-head strong{
  font-size:18px!important;
  letter-spacing:.035em!important;
}
.play-card .modal-head small{
  max-width:42ch!important;
  line-height:1.35!important;
}
.play-card .situation{
  margin-top:10px!important;
  padding:11px 13px!important;
  min-height:44px!important;
  border-radius:14px!important;
  background:color-mix(in srgb,var(--selected) 52%,var(--panel2) 48%)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 14%,transparent)!important;
}
.play-card .editor-section-title{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  margin:14px 0 8px!important;
  padding-top:4px!important;
  font-size:8.5px!important;
  letter-spacing:.16em!important;
}
.play-card .editor-section-title::after{
  content:'';
  flex:1 1 auto;
  height:1px;
  background:color-mix(in srgb,var(--line) 56%,transparent);
}
.play-card .editor-grid{
  gap:10px!important;
}
/* single clean card per field instead of double-heavy borders */
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label{
  padding:10px 12px 11px!important;
  border:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
  border-radius:14px!important;
  background:color-mix(in srgb,var(--panel2) 76%,var(--panel) 24%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03)!important;
}
.play-card .field-label,
.play-card .runner-out-fields .form-grid.two>label>.field-label{
  min-height:18px!important;
  padding:0 0 7px!important;
  color:color-mix(in srgb,var(--text) 88%,var(--muted) 12%)!important;
}
.play-card .editor-grid select,
.play-card .editor-grid input,
.play-card .runner-out-fields .form-grid.two select,
.play-card .runner-out-fields .form-grid.two input{
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card .check-label{
  border-radius:14px!important;
  background:color-mix(in srgb,var(--panel2) 80%,var(--panel) 20%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03)!important;
}
.play-card .runner-out-fields,
.play-card .advanced-tools,
.play-card .pitch-tools{
  border:1px solid color-mix(in srgb,var(--line) 66%,transparent)!important;
  border-radius:16px!important;
  background:color-mix(in srgb,var(--panel) 88%,#000 12%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
.play-card .runner-out-fields{padding:11px 12px!important}
.play-card .advanced-tools{padding:10px 10px 12px!important}
.play-card .advanced-layout{gap:10px!important}
.play-card .defense-field-card,
.play-card .advanced-runner-card,
.play-card .pitch-entry-card,
.play-card .pitch-sequence-card,
.play-card .pitch-workflow-note,
.play-card .pitch-count-card{
  border:1px solid color-mix(in srgb,var(--line) 58%,transparent)!important;
  border-radius:14px!important;
  background:color-mix(in srgb,var(--panel2) 82%,var(--panel) 18%)!important;
  box-shadow:none!important;
}
.play-card .field-card-head,
.play-card .pitch-entry-card-head,
.play-card .pitch-sequence-head{
  padding-bottom:7px!important;
  margin-bottom:8px!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 42%,transparent)!important;
}
.play-card .fielder-grid,
.play-card .pitch-count-lights{
  background:color-mix(in srgb,var(--panel) 80%,#000 20%)!important;
  border:1px solid color-mix(in srgb,var(--line) 44%,transparent)!important;
}
.play-card .fielder-selection,
.play-card .pitch-empty,
.play-card .editor-guide{
  background:color-mix(in srgb,var(--panel2) 76%,var(--panel) 24%)!important;
  border:1px solid color-mix(in srgb,var(--line) 48%,transparent)!important;
  border-radius:12px!important;
}
.play-card .modal-actions{
  gap:10px!important;
  margin-top:14px!important;
}
.play-card .modal-actions button{
  min-height:50px!important;
  border-radius:15px!important;
  border-width:1px!important;
  font-weight:900!important;
  letter-spacing:.01em!important;
  box-shadow:0 10px 18px rgba(0,0,0,.14)!important;
}
.play-card .modal-actions .primary{
  background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 90%,#fff 10%),color-mix(in srgb,var(--accent) 88%,#000 12%))!important;
}

/* scoring cards: keep the same structure, but make them calmer and cleaner */
.play-card .scoring-title{margin-bottom:6px!important}
.play-card .scoring-panel{gap:9px!important}
.play-card .score-field-card{
  min-height:80px!important;
  padding:9px 12px 8px!important;
  border-radius:14px!important;
  border:1px solid color-mix(in srgb,var(--line) 70%,transparent)!important;
  background:color-mix(in srgb,var(--panel2) 80%,var(--panel) 20%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03)!important;
}
.play-card .score-field-title{
  font-size:10px!important;
  letter-spacing:.07em!important;
}
.play-card .score-field-card>select{
  height:42px!important;
  min-height:42px!important;
  font-size:19px!important;
}
.play-card .score-toggle-control{height:42px!important;min-height:42px!important}
.play-card .score-toggle-copy{font-size:15px!important}
.play-card .score-toggle-track{
  border-color:color-mix(in srgb,var(--line) 68%,transparent)!important;
  background:color-mix(in srgb,var(--panel) 82%,#000 18%)!important;
}

/* Wrigley play editor refinement */
body.theme-wrigley .play-card{
  background:
    linear-gradient(180deg,rgba(14,50,39,.98),rgba(10,34,27,.98)),
    url("assets/theme/wrigley-scoreboard.jpg") center top/cover no-repeat!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 68%,#324537)!important;
}
body.theme-wrigley .play-card .modal-head,
body.theme-wrigley .play-card .field-card-head,
body.theme-wrigley .play-card .pitch-entry-card-head,
body.theme-wrigley .play-card .pitch-sequence-head{
  border-color:rgba(169,139,86,.34)!important;
}
body.theme-wrigley .play-card .situation{
  background:linear-gradient(180deg,rgba(24,74,57,.96),rgba(15,51,40,.96))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 54%,#45614a)!important;
}
body.theme-wrigley .play-card .editor-grid>label:not(.check-label),
body.theme-wrigley .play-card .runner-out-fields .form-grid.two>label,
body.theme-wrigley .play-card .check-label,
body.theme-wrigley .play-card .score-field-card,
body.theme-wrigley .play-card .runner-out-fields,
body.theme-wrigley .play-card .advanced-tools,
body.theme-wrigley .play-card .pitch-tools,
body.theme-wrigley .play-card .defense-field-card,
body.theme-wrigley .play-card .advanced-runner-card,
body.theme-wrigley .play-card .pitch-entry-card,
body.theme-wrigley .play-card .pitch-sequence-card,
body.theme-wrigley .play-card .pitch-workflow-note,
body.theme-wrigley .play-card .pitch-count-card,
body.theme-wrigley .play-card .fielder-selection,
body.theme-wrigley .play-card .pitch-empty,
body.theme-wrigley .play-card .editor-guide{
  background:linear-gradient(180deg,rgba(15,54,42,.95),rgba(10,38,29,.95))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 42%,#385541)!important;
}
body.theme-wrigley .play-card .fielder-grid,
body.theme-wrigley .play-card .pitch-count-lights{
  background:rgba(9,33,25,.84)!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 32%,#314a3a)!important;
}
body.theme-wrigley .play-card .modal-actions button{
  background:linear-gradient(180deg,rgba(15,54,42,.98),rgba(10,37,29,.98))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 46%,#395341)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley .play-card .modal-actions .primary{
  background:linear-gradient(180deg,#baa06e,#9f834f)!important;
  border-color:#c3ab7d!important;
  color:#132319!important;
}

/* ---------- WRIGLEY SCOREBOARD + IVY/BRICK REALISM ---------- */
body.theme-wrigley.wrigley-scoreboard:not(.dark-mode){
  --wrigley-green:#0b2418;
  --wrigley-green2:#123628;
  --wrigley-cream:#efe2c2;
  --wrigley-gold:#ad935d;
  --wrigley-line:#866c43;
}
body.theme-wrigley.wrigley-scoreboard .app-shell{
  background:
    radial-gradient(circle at 50% -10%,rgba(255,242,210,.05),transparent 26%),
    linear-gradient(180deg,#13382c,#0d2a21)!important;
}
body.theme-wrigley.wrigley-scoreboard .topbar{
  background:
    linear-gradient(180deg,rgba(5,18,12,.82),rgba(8,30,20,.74)),
    url("assets/theme/wrigley-scoreboard.jpg") center 22%/cover no-repeat!important;
  border-bottom:1px solid rgba(239,226,194,.12)!important;
  box-shadow:inset 0 -30px 50px rgba(0,0,0,.25)!important;
}
body.theme-wrigley.wrigley-scoreboard .topbar h1{
  color:var(--wrigley-cream)!important;
  text-shadow:0 1px 0 rgba(0,0,0,.55),0 0 22px rgba(239,226,194,.10)!important;
}
body.theme-wrigley.wrigley-scoreboard .game-info,
body.theme-wrigley.wrigley-scoreboard .matchup-selector,
body.theme-wrigley.wrigley-scoreboard .standings-overview,
body.theme-wrigley.wrigley-scoreboard .team-scorebook{
  background:
    linear-gradient(180deg,rgba(18,58,44,.97),rgba(11,39,29,.98)),
    url("assets/theme/wrigley-scoreboard.jpg") center/cover no-repeat!important;
  box-shadow:0 12px 26px rgba(0,0,0,.24),inset 0 0 0 1px rgba(239,226,194,.04)!important;
}
body.theme-wrigley.wrigley-scoreboard .game-field,
body.theme-wrigley.wrigley-scoreboard .matchup-team,
body.theme-wrigley.wrigley-scoreboard .overview-title,
body.theme-wrigley.wrigley-scoreboard .standings-card,
body.theme-wrigley.wrigley-scoreboard .team-scorebook-head,
body.theme-wrigley.wrigley-scoreboard .team-scorebook-body{
  background:linear-gradient(180deg,rgba(18,69,52,.97),rgba(12,45,34,.97))!important;
}

/* Ivy & brick: richer, more realistic masonry texture with controlled readability. */
body.theme-wrigley.wrigley-ivybrick .app-shell{
  background:
    linear-gradient(180deg,rgba(8,20,13,.78),rgba(18,26,19,.86)),
    url("assets/theme/wrigley-real-brick.jpg") center/420px auto repeat!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info,
body.theme-wrigley.wrigley-ivybrick .matchup-selector,
body.theme-wrigley.wrigley-ivybrick .standings-overview,
body.theme-wrigley.wrigley-ivybrick .team-scorebook{
  background:
    linear-gradient(180deg,rgba(10,34,23,.78),rgba(14,44,30,.82)),
    url("assets/theme/wrigley-real-ivy-vertical.png") left center/34px 94% no-repeat,
    url("assets/theme/wrigley-real-ivy-vertical.png") right center/34px 94% no-repeat,
    url("assets/theme/wrigley-real-brick.jpg") center/320px auto repeat!important;
  box-shadow:0 14px 28px rgba(0,0,0,.26),inset 0 0 0 1px rgba(241,227,195,.06)!important;
}
body.theme-wrigley.wrigley-ivybrick .game-field,
body.theme-wrigley.wrigley-ivybrick .matchup-team,
body.theme-wrigley.wrigley-ivybrick .overview-title,
body.theme-wrigley.wrigley-ivybrick .standings-card,
body.theme-wrigley.wrigley-ivybrick .team-scorebook-head,
body.theme-wrigley.wrigley-ivybrick .team-scorebook-body{
  background:linear-gradient(180deg,rgba(15,49,37,.96),rgba(11,38,29,.96))!important;
}

@media(max-width:760px){
  .drawer{width:min(312px,86vw)!important}
  .menu-row,
  .drawer-nav,
  .drawer-tools>button,
  .import-button,
  .theme-choice{
    min-height:54px!important;
    padding:9px 10px!important;
    border-radius:14px!important;
  }
  .menu-copy strong{font-size:11px!important}
  .menu-copy small{font-size:7.8px!important}
  .play-card{
    padding-inline:12px!important;
  }
  .play-card .modal-head strong{font-size:17px!important}
  .play-card .situation{font-size:14px!important}
  .play-card .editor-section-title{font-size:9.5px!important}
  .play-card .editor-grid>label:not(.check-label),
  .play-card .runner-out-fields .form-grid.two>label{padding:9px 10px 10px!important}
  .play-card .editor-grid select,
  .play-card .editor-grid input,
  .play-card .runner-out-fields .form-grid.two select,
  .play-card .runner-out-fields .form-grid.two input,
  .play-card .pitch-entry-grid select,
  .play-card .pitch-entry-grid input,
  .play-card .pitch-velo-wrap input{
    min-height:38px!important;
    height:38px!important;
    font-size:16px!important;
  }
  .play-card .score-field-card{min-height:76px!important}
  .play-card .score-field-card>select{font-size:18px!important}
  .play-card .score-toggle-copy{font-size:14px!important}
  .play-card .modal-actions button{min-height:48px!important;font-size:12.5px!important}
}

/* ==========================================================
   v56 — APPROVED WRIGLEY DESIGNS + EDITOR SIMPLIFICATION
   ========================================================== */

/* Theme masthead is opt-in for Wrigley styles only. */
.wrigley-theme-masthead{display:none}
body.theme-wrigley .topbar{overflow:visible}
body.theme-wrigley.wrigley-scoreboard .topbar,
body.theme-wrigley.wrigley-ivybrick .topbar{
  grid-template-columns:44px minmax(0,1fr) 44px!important;
  grid-template-rows:auto auto!important;
  min-height:148px!important;
  padding:calc(8px + env(safe-area-inset-top)) 12px 10px!important;
}
body.theme-wrigley.wrigley-scoreboard .topbar>h1,
body.theme-wrigley.wrigley-ivybrick .topbar>h1{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important}
body.theme-wrigley.wrigley-scoreboard .topbar .top-actions,
body.theme-wrigley.wrigley-ivybrick .topbar .top-actions{display:none!important}
body.theme-wrigley.wrigley-scoreboard .topbar .save-status,
body.theme-wrigley.wrigley-ivybrick .topbar .save-status{display:none!important}
body.theme-wrigley.wrigley-scoreboard .wrigley-theme-masthead,
body.theme-wrigley.wrigley-ivybrick .wrigley-theme-masthead{
  grid-column:1/-1;
  grid-row:1/3;
  display:grid;
  justify-items:center;
  align-items:center;
  pointer-events:none;
  min-width:0;
}
body.theme-wrigley.wrigley-scoreboard .menu-icon,
body.theme-wrigley.wrigley-ivybrick .menu-icon{
  position:absolute!important;
  left:12px!important;
  bottom:14px!important;
  z-index:5!important;
  width:42px!important;
  height:42px!important;
  border:1px solid color-mix(in srgb,var(--wrigley-gold) 52%,transparent)!important;
  border-radius:10px!important;
  background:rgba(7,29,18,.84)!important;
  color:var(--wrigley-cream)!important;
}
.wrigley-masthead-brand{display:grid;place-items:center}
.wrigley-clock-face{
  display:none;
  position:relative;
  width:86px;
  aspect-ratio:1;
  border:5px solid var(--wrigley-cream);
  border-radius:50%;
  background:
    radial-gradient(circle at 50% 50%,#173a2a 0 61%,transparent 62%),
    repeating-conic-gradient(from -1.5deg,var(--wrigley-cream) 0 3deg,transparent 3deg 30deg),
    #102d20;
  box-shadow:0 7px 16px rgba(0,0,0,.38),inset 0 0 0 2px rgba(255,255,255,.05);
}
.wrigley-clock-face::after{
  content:'';
  position:absolute;
  inset:9px;
  border-radius:50%;
  background:#102d20;
  z-index:0;
}
.wrigley-clock-face i{position:absolute;left:50%;top:50%;z-index:2;display:block;transform-origin:50% 100%;border-radius:999px;background:var(--wrigley-cream);box-shadow:0 1px 2px rgba(0,0,0,.45)}
.wrigley-clock-face .clock-hour{width:6px;height:25px;margin-left:-3px;margin-top:-25px;transform:rotate(var(--hour-angle,0deg))}
.wrigley-clock-face .clock-minute{width:4px;height:34px;margin-left:-2px;margin-top:-34px;transform:rotate(var(--minute-angle,0deg))}
.wrigley-clock-face .clock-pin{width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;background:var(--wrigley-cream);transform:none}
.wrigley-plaque-copy{display:none;text-align:center;line-height:1}
.wrigley-date-time{
  width:min(620px,84vw);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:7px 14px;
  margin-top:7px;
  border:1px solid color-mix(in srgb,var(--wrigley-gold) 50%,#314739);
  border-radius:5px;
  background:rgba(10,39,29,.92);
  color:var(--wrigley-cream);
  font-family:Georgia,'Times New Roman',serif;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 4px 10px rgba(0,0,0,.22);
}
body.theme-wrigley.wrigley-scoreboard .wrigley-clock-face{display:block}
body.theme-wrigley.wrigley-scoreboard .wrigley-masthead-brand::after{
  content:'SCORECARD';
  display:block;
  margin-top:4px;
  color:var(--wrigley-cream);
  font-family:Arial,Helvetica,sans-serif;
  font-size:18px;
  line-height:1;
  font-weight:950;
  letter-spacing:.06em;
  text-shadow:0 2px 2px rgba(0,0,0,.42);
}
body.theme-wrigley.wrigley-scoreboard .topbar{
  background:
    linear-gradient(180deg,rgba(4,16,10,.24),rgba(4,19,12,.50)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/cover repeat!important;
  border-bottom:2px solid rgba(239,226,194,.32)!important;
  box-shadow:inset 0 -16px 28px rgba(0,0,0,.23),0 4px 16px rgba(0,0,0,.18)!important;
}
body.theme-wrigley.wrigley-scoreboard .wrigley-date-time{
  border-color:rgba(239,226,194,.46);
  background:linear-gradient(180deg,rgba(13,48,35,.96),rgba(8,31,23,.96));
}

/* Approved Ivy & Brick masthead: brick wall + vintage plaque. */
body.theme-wrigley.wrigley-ivybrick .topbar{
  min-height:154px!important;
  background:
    linear-gradient(180deg,rgba(27,18,14,.12),rgba(19,14,11,.28)),
    url("assets/theme/wrigley-brick-v56.jpg") center/430px auto repeat!important;
  border-bottom:1px solid rgba(170,139,86,.48)!important;
  box-shadow:inset 0 -18px 32px rgba(0,0,0,.28),0 4px 16px rgba(0,0,0,.22)!important;
}
body.theme-wrigley.wrigley-ivybrick .topbar::before,
body.theme-wrigley.wrigley-ivybrick .topbar::after{
  content:'';
  position:absolute;
  top:0;
  bottom:0;
  width:48px;
  pointer-events:none;
  background:var(--wrigley-ivy-clean-v) center/42px auto repeat-y;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.45));
  opacity:.92;
}
body.theme-wrigley.wrigley-ivybrick .topbar::before{left:0}
body.theme-wrigley.wrigley-ivybrick .topbar::after{right:0;transform:scaleX(-1)}
body.theme-wrigley.wrigley-ivybrick .wrigley-clock-face{display:none}
body.theme-wrigley.wrigley-ivybrick .wrigley-plaque-copy{
  display:block;
  min-width:230px;
  padding:10px 34px 9px;
  border:2px solid color-mix(in srgb,var(--wrigley-gold) 76%,#3e4e3e);
  border-radius:16px 16px 10px 10px / 12px 12px 16px 16px;
  background:
    linear-gradient(180deg,rgba(14,48,35,.98),rgba(8,31,23,.98)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/cover repeat;
  box-shadow:0 7px 16px rgba(0,0,0,.34),inset 0 0 0 1px rgba(238,226,197,.06);
}
body.theme-wrigley.wrigley-ivybrick .wrigley-plaque-copy b{
  display:block;
  color:#c9a66b;
  font-family:Georgia,'Times New Roman',serif;
  font-size:26px;
  line-height:.95;
  font-style:italic;
  font-weight:800;
  letter-spacing:.01em;
  text-shadow:0 2px 1px rgba(0,0,0,.55);
}
body.theme-wrigley.wrigley-ivybrick .wrigley-plaque-copy small{
  display:block;
  margin-top:6px;
  color:var(--wrigley-cream);
  font-family:Georgia,'Times New Roman',serif;
  font-size:9px;
  font-weight:900;
  letter-spacing:.28em;
  text-transform:uppercase;
}
body.theme-wrigley.wrigley-ivybrick .wrigley-date-time{
  width:min(530px,78vw);
  background:linear-gradient(180deg,rgba(14,48,35,.97),rgba(9,34,25,.97));
  border-color:color-mix(in srgb,var(--wrigley-gold) 62%,#485141);
}

/* Use real, clean texture assets throughout each approved Wrigley style. */
body.theme-wrigley.wrigley-scoreboard .app-shell{
  background:
    linear-gradient(180deg,rgba(5,19,12,.22),rgba(6,24,16,.28)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/620px auto repeat!important;
}
body.theme-wrigley.wrigley-scoreboard .game-info,
body.theme-wrigley.wrigley-scoreboard .matchup-selector,
body.theme-wrigley.wrigley-scoreboard .standings-overview,
body.theme-wrigley.wrigley-scoreboard .team-scorebook{
  background:
    linear-gradient(180deg,rgba(15,55,41,.92),rgba(10,38,29,.94)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/520px auto repeat!important;
  border:1px solid rgba(239,226,194,.22)!important;
  box-shadow:0 9px 22px rgba(0,0,0,.22),inset 0 0 0 1px rgba(239,226,194,.03)!important;
}
body.theme-wrigley.wrigley-scoreboard .game-info::before,
body.theme-wrigley.wrigley-scoreboard .matchup-selector::before,
body.theme-wrigley.wrigley-scoreboard .standings-overview::before,
body.theme-wrigley.wrigley-scoreboard .team-scorebook::before,
body.theme-wrigley.wrigley-scoreboard .game-info::after,
body.theme-wrigley.wrigley-scoreboard .matchup-selector::after,
body.theme-wrigley.wrigley-scoreboard .standings-overview::after,
body.theme-wrigley.wrigley-scoreboard .team-scorebook::after{display:none!important}

body.theme-wrigley.wrigley-ivybrick .app-shell{
  background:
    linear-gradient(180deg,rgba(16,12,9,.18),rgba(17,12,9,.26)),
    url("assets/theme/wrigley-brick-v56.jpg") center/420px auto repeat!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info,
body.theme-wrigley.wrigley-ivybrick .matchup-selector,
body.theme-wrigley.wrigley-ivybrick .standings-overview,
body.theme-wrigley.wrigley-ivybrick .team-scorebook{
  background:
    var(--wrigley-ivy-clean-v) left center/30px auto repeat-y,
    var(--wrigley-ivy-clean-v) right center/30px auto repeat-y,
    url("assets/theme/wrigley-brick-v56.jpg") center/330px auto repeat!important;
  border:1px solid rgba(169,139,86,.56)!important;
  padding:10px!important;
  box-shadow:0 11px 24px rgba(0,0,0,.26),inset 0 0 0 1px rgba(239,226,194,.04)!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info::before,
body.theme-wrigley.wrigley-ivybrick .matchup-selector::before,
body.theme-wrigley.wrigley-ivybrick .standings-overview::before,
body.theme-wrigley.wrigley-ivybrick .team-scorebook::before,
body.theme-wrigley.wrigley-ivybrick .game-info::after,
body.theme-wrigley.wrigley-ivybrick .matchup-selector::after,
body.theme-wrigley.wrigley-ivybrick .standings-overview::after,
body.theme-wrigley.wrigley-ivybrick .team-scorebook::after{
  height:24px!important;
  left:22px!important;
  right:22px!important;
  background:var(--wrigley-ivy-clean-h) center/auto 24px repeat-x!important;
  opacity:.92!important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.42))!important;
}
body.theme-wrigley.wrigley-ivybrick .game-info::before,
body.theme-wrigley.wrigley-ivybrick .matchup-selector::before,
body.theme-wrigley.wrigley-ivybrick .standings-overview::before,
body.theme-wrigley.wrigley-ivybrick .team-scorebook::before{top:-12px!important}
body.theme-wrigley.wrigley-ivybrick .game-info::after,
body.theme-wrigley.wrigley-ivybrick .matchup-selector::after,
body.theme-wrigley.wrigley-ivybrick .standings-overview::after,
body.theme-wrigley.wrigley-ivybrick .team-scorebook::after{bottom:-12px!important;transform:rotate(180deg)!important}
body.theme-wrigley.wrigley-ivybrick .game-field,
body.theme-wrigley.wrigley-ivybrick .matchup-team,
body.theme-wrigley.wrigley-ivybrick .overview-title,
body.theme-wrigley.wrigley-ivybrick .standings-card,
body.theme-wrigley.wrigley-ivybrick .team-scorebook-head,
body.theme-wrigley.wrigley-ivybrick .team-scorebook-body{
  background:
    linear-gradient(180deg,rgba(15,53,40,.97),rgba(9,36,27,.98)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/420px auto repeat!important;
  border-color:rgba(169,139,86,.52)!important;
}

/* ---------- v56 editor friction fixes ---------- */
.play-card #outResult::placeholder,
.play-card #advanceReason::placeholder,
.play-card [data-runner-reason]::placeholder{color:color-mix(in srgb,var(--muted) 88%,transparent)!important;opacity:.78!important}

/* Basic: same readable type, materially less vertical air. */
.play-card[data-editor-mode="basic"] .modal-head{padding-bottom:7px!important}
.play-card[data-editor-mode="basic"] .situation{min-height:42px!important;padding:8px 12px!important;margin-top:7px!important}
.play-card[data-editor-mode="basic"] .editor-hint{padding:8px 10px!important;margin:7px 0 8px!important;min-height:0!important}
.play-card[data-editor-mode="basic"] .editor-section-title{margin:9px 0 5px!important;padding-top:2px!important}
.play-card[data-editor-mode="basic"] .editor-grid{row-gap:7px!important;column-gap:8px!important}
.play-card[data-editor-mode="basic"] .editor-grid>label:not(.check-label){padding:7px 10px 8px!important;border-radius:12px!important}
.play-card[data-editor-mode="basic"] .field-label{min-height:16px!important;padding-bottom:5px!important}
.play-card[data-editor-mode="basic"] .editor-grid select,
.play-card[data-editor-mode="basic"] .editor-grid input{height:32px!important;min-height:32px!important}
.play-card[data-editor-mode="basic"] .scoring-panel{gap:7px!important}
.play-card[data-editor-mode="basic"] .score-field-card{min-height:68px!important;padding:7px 10px 6px!important;grid-template-rows:15px 1fr!important}
.play-card[data-editor-mode="basic"] .score-field-card>select{height:38px!important;min-height:38px!important}
.play-card[data-editor-mode="basic"] .score-toggle-control{height:38px!important;min-height:38px!important}
.play-card[data-editor-mode="basic"] .modal-actions{margin-top:10px!important}

/* Advanced / PBP: remove the box-in-box-in-box effect. */
.play-card .advanced-tools{
  margin-top:10px!important;
  padding:0!important;
  border:0!important;
  border-top:1px solid color-mix(in srgb,var(--line) 58%,transparent)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card .advanced-title{margin:9px 0 7px!important;padding-top:8px!important}
.play-card .advanced-layout{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
.play-card .defense-field-card,
.play-card .advanced-runner-card{
  padding:10px!important;
  border:1px solid color-mix(in srgb,var(--line) 58%,transparent)!important;
  border-radius:14px!important;
  background:color-mix(in srgb,var(--panel2) 76%,var(--panel) 24%)!important;
}
.play-card .field-card-head{
  min-height:0!important;
  margin:0 0 7px!important;
  padding:0 0 7px!important;
  border-bottom:1px solid color-mix(in srgb,var(--line) 40%,transparent)!important;
}
.play-card .field-card-head strong{font-size:11.5px!important}
.play-card .field-card-head small{font-size:9px!important;margin-top:2px!important}
.play-card .fielder-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:auto!important;
  gap:6px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
}
.play-card .fielder-grid-team{
  grid-column:1/-1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  min-height:26px!important;
  padding:0 2px 4px!important;
  border:0!important;
  font-size:8px!important;
}
.play-card .fielder-grid-team span{font-weight:950!important;letter-spacing:.08em!important;color:var(--muted)!important}
.play-card .fielder-grid-team small{font-size:7px!important;font-weight:800!important;letter-spacing:0!important;color:var(--muted)!important;text-transform:none!important}
.play-card .fielder-grid-pos{
  height:50px!important;
  min-height:50px!important;
  padding:5px 7px!important;
  border:1px solid color-mix(in srgb,var(--line) 68%,transparent)!important;
  border-radius:10px!important;
  background:color-mix(in srgb,var(--panel) 86%,#fff 2%)!important;
  grid-template-columns:auto 1fr auto!important;
  grid-template-rows:1fr!important;
  gap:5px!important;
}
.play-card .fielder-grid-pos>span{
  grid-row:auto!important;
  width:28px!important;
  height:28px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:8px!important;
  font-size:9px!important;
}
.play-card .fielder-grid-pos>strong{font-size:9px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.play-card .fielder-grid-pos>small{font-size:7px!important}
.play-card .fielder-selection{
  min-height:32px!important;
  margin-top:7px!important;
  padding:7px 9px!important;
  border:1px solid color-mix(in srgb,var(--line) 50%,transparent)!important;
  border-radius:10px!important;
  background:color-mix(in srgb,var(--panel) 76%,transparent)!important;
  font-size:8px!important;
}
.play-card .runner-empty{min-height:52px!important;padding:14px 10px!important}

/* Pitch tracker retains approved lights but uses the same lighter framing. */
.play-card .pitch-tools{
  border:0!important;
  border-top:1px solid color-mix(in srgb,var(--line) 58%,transparent)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  margin-top:10px!important;
}
.play-card .pitch-entry-card,
.play-card .pitch-sequence-card,
.play-card .pitch-workflow-note{
  border-color:color-mix(in srgb,var(--line) 54%,transparent)!important;
  box-shadow:none!important;
}

/* Wrigley editor gets the same vintage material without extra outlines. */
body.theme-wrigley .play-card{
  background:
    linear-gradient(180deg,rgba(13,46,35,.97),rgba(8,31,23,.98)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/520px auto repeat!important;
}
body.theme-wrigley .play-card .editor-grid>label:not(.check-label),
body.theme-wrigley .play-card .score-field-card,
body.theme-wrigley .play-card .defense-field-card,
body.theme-wrigley .play-card .advanced-runner-card,
body.theme-wrigley .play-card .pitch-entry-card,
body.theme-wrigley .play-card .pitch-sequence-card{
  background:
    linear-gradient(180deg,rgba(16,57,44,.94),rgba(10,39,30,.96)),
    url("assets/theme/wrigley-scoreboard-green-v56.jpg") center/400px auto repeat!important;
  border-color:rgba(169,139,86,.48)!important;
}
body.theme-wrigley .play-card .advanced-tools,
body.theme-wrigley .play-card .pitch-tools{border-top-color:rgba(169,139,86,.40)!important}
body.theme-wrigley .play-card .fielder-grid-pos{
  background:rgba(8,34,25,.78)!important;
  border-color:rgba(169,139,86,.52)!important;
}
body.theme-wrigley .play-card .fielder-selection{background:rgba(8,33,24,.62)!important;border-color:rgba(169,139,86,.36)!important}

@media(max-width:760px){
  body.theme-wrigley.wrigley-scoreboard .topbar,
  body.theme-wrigley.wrigley-ivybrick .topbar{min-height:138px!important}
  .wrigley-clock-face{width:76px!important;border-width:4px!important}
  body.theme-wrigley.wrigley-scoreboard .wrigley-masthead-brand::after{font-size:16px!important}
  .wrigley-date-time{width:min(520px,80vw)!important;font-size:9px!important;padding:6px 10px!important}
  body.theme-wrigley.wrigley-ivybrick .wrigley-plaque-copy{min-width:210px!important;padding:9px 28px 8px!important}
  body.theme-wrigley.wrigley-ivybrick .wrigley-plaque-copy b{font-size:23px!important}
  .play-card[data-editor-mode="basic"] .modal-head strong{font-size:21px!important}
  .play-card[data-editor-mode="basic"] .editor-grid select,
  .play-card[data-editor-mode="basic"] .editor-grid input{height:36px!important;min-height:36px!important;font-size:17px!important}
  .play-card[data-editor-mode="basic"] .score-field-card{min-height:72px!important}
  .play-card .defense-field-card,.play-card .advanced-runner-card{padding:9px!important}
  .play-card .fielder-grid-pos{height:52px!important;min-height:52px!important;padding:5px 6px!important}
  .play-card .fielder-grid-pos>strong{font-size:9.5px!important}
  .play-card .fielder-grid-team small{display:none!important}
}

/* ==========================================================
   v57 PLAY EDITOR DENSITY + OVERLAY FIXES
   Fixes screenshot issues without changing score-grid behavior.
   ========================================================== */

/* Make the sticky header fully opaque and keep scrolled content from peeking through it. */
#playModal .play-card{
  scroll-padding-top:92px!important;
  scroll-padding-bottom:96px!important;
}
#playModal .modal-head{
  position:sticky!important;
  top:0!important;
  z-index:20!important;
  margin:0 -2px 4px!important;
  padding:8px 2px 10px!important;
  background:var(--panel)!important;
  box-shadow:0 8px 14px rgba(0,0,0,.18)!important;
}
body.theme-wrigley #playModal .modal-head{
  background:#0b2e23!important;
  border-bottom-color:rgba(169,139,86,.38)!important;
}

/* Keep the guidance useful, but reclaim the large block of vertical space. */
.play-card .editor-context-hint{
  min-height:0!important;
  margin:7px 0 8px!important;
  padding:8px 10px!important;
  gap:9px!important;
  border-radius:12px!important;
}
.play-card .editor-context-hint>span{
  flex:0 0 auto!important;
  padding:5px 9px!important;
  font-size:8px!important;
}
.play-card .editor-context-hint>p{
  margin:0!important;
  font-size:11px!important;
  line-height:1.25!important;
}
.play-card .editor-guide{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:5px!important;
  min-height:0!important;
  margin:6px 0 9px!important;
  padding:5px!important;
  border-radius:11px!important;
}
.play-card .editor-guide span{
  min-width:0!important;
  min-height:42px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  padding:4px 2px!important;
  text-align:center!important;
  font-size:8.5px!important;
  line-height:1.05!important;
  white-space:nowrap!important;
}
.play-card .editor-guide b{
  width:20px!important;
  height:20px!important;
  display:grid!important;
  place-items:center!important;
  font-size:7px!important;
}

/* Editor field cards: keep the current readable type size, remove dead height. */
.play-card .editor-grid,
.play-card .runner-out-fields .form-grid.two{
  align-items:start!important;
}
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label:not(.check-label){
  display:grid!important;
  grid-template-rows:22px 38px!important;
  min-height:0!important;
  height:auto!important;
  align-content:start!important;
  padding:7px 10px 8px!important;
  gap:0!important;
}
.play-card .field-label,
.play-card .runner-out-fields .form-grid.two>label>.field-label{
  height:22px!important;
  min-height:22px!important;
  padding:0 1px 5px!important;
  font-size:15px!important;
  line-height:1!important;
}
.play-card .field-help{
  font-size:10px!important;
}
.play-card .editor-grid select,
.play-card .editor-grid input,
.play-card .runner-out-fields .form-grid.two select,
.play-card .runner-out-fields .form-grid.two input{
  height:38px!important;
  min-height:38px!important;
  padding:0 28px 0 0!important;
  font-size:18px!important;
  line-height:1!important;
}
.play-card .editor-grid input::placeholder,
.play-card .runner-out-fields input::placeholder{
  font-size:16px!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}

/* Use a visible, theme-aware chevron instead of the black native Safari arrow. */
.play-card select,
.play-card .score-field-card>select,
.play-card .pitch-entry-grid select{
  -webkit-appearance:none!important;
  appearance:none!important;
  background-image:
    linear-gradient(45deg,transparent 50%,var(--text) 50%),
    linear-gradient(135deg,var(--text) 50%,transparent 50%)!important;
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%!important;
  background-size:5px 5px,5px 5px!important;
  background-repeat:no-repeat!important;
  padding-right:30px!important;
}
body.theme-wrigley .play-card select,
body.theme-wrigley .play-card .score-field-card>select,
body.theme-wrigley .play-card .pitch-entry-grid select{
  background-image:
    linear-gradient(45deg,transparent 50%,var(--wrigley-cream) 50%),
    linear-gradient(135deg,var(--wrigley-cream) 50%,transparent 50%)!important;
}

/* When Advance On is not relevant, don't leave a dead half-column. */
.play-card #runnerGrid:has(#advanceReasonField.hidden){
  grid-template-columns:minmax(0,1fr)!important;
}
.play-card #runnerGrid:has(#advanceReasonField.hidden)>label:first-child{
  grid-column:1/-1!important;
}

/* Scoring: same text size, materially shorter cards. */
.play-card .scoring-panel{
  gap:8px!important;
}
.play-card .score-field-card{
  min-height:68px!important;
  height:68px!important;
  grid-template-rows:18px 38px!important;
  padding:7px 10px 5px!important;
  border-radius:12px!important;
}
.play-card .score-field-title{
  font-size:10px!important;
  line-height:1!important;
}
.play-card .score-field-card>select{
  height:38px!important;
  min-height:38px!important;
  font-size:18px!important;
}
.play-card .score-toggle-control{
  height:38px!important;
  min-height:38px!important;
}
.play-card .score-toggle-copy{font-size:15px!important}

/* Advanced fielding: one clean panel, defense label directly above positions. */
.play-card .advanced-tools{
  padding:0!important;
  border:0!important;
  border-top:1px solid color-mix(in srgb,var(--line) 50%,transparent)!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card .advanced-title{
  margin:8px 0 6px!important;
  padding-top:8px!important;
}
.play-card .defense-field-card{
  padding:8px 9px 9px!important;
  border:1px solid color-mix(in srgb,var(--line) 54%,transparent)!important;
  border-radius:13px!important;
  background:color-mix(in srgb,var(--panel2) 70%,var(--panel) 30%)!important;
}
.play-card .field-card-head{
  min-height:0!important;
  margin:0 0 5px!important;
  padding:0 0 6px!important;
  border-bottom:0!important;
}
.play-card .field-card-head strong{font-size:13px!important}
.play-card .field-card-head small{font-size:10px!important}
.play-card .field-card-head button{
  min-height:38px!important;
  padding:0 11px!important;
  border-radius:9px!important;
}
.play-card .fielder-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:auto!important;
  gap:5px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
.play-card .fielder-grid-team{
  grid-column:1/-1!important;
  min-height:20px!important;
  height:20px!important;
  padding:0 2px 3px!important;
  margin:0!important;
  border:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
}
.play-card .fielder-grid-pos{
  height:48px!important;
  min-height:48px!important;
  padding:5px 7px!important;
  border-radius:9px!important;
  grid-template-columns:30px minmax(0,1fr) auto!important;
  grid-template-rows:1fr!important;
  gap:6px!important;
}
.play-card .fielder-grid-pos>span{
  width:28px!important;
  height:28px!important;
  font-size:9px!important;
}
.play-card .fielder-grid-pos>strong{
  font-size:10px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.play-card .fielder-grid-pos>small{font-size:7.5px!important}
.play-card .fielder-selection{
  min-height:30px!important;
  margin-top:6px!important;
  padding:6px 9px!important;
  font-size:9px!important;
}
.play-card .advanced-runner-card{
  padding:8px 9px!important;
  border-radius:13px!important;
}
.play-card .runner-empty{
  min-height:42px!important;
  padding:10px!important;
}

/* Sticky action row stays available but cannot obscure the last editor section. */
#playModal .modal-actions{
  position:sticky!important;
  bottom:0!important;
  z-index:18!important;
  margin:10px -2px 0!important;
  padding:9px 2px calc(8px + env(safe-area-inset-bottom))!important;
  background:var(--panel)!important;
  box-shadow:0 -10px 18px rgba(0,0,0,.20)!important;
}
body.theme-wrigley #playModal .modal-actions{background:#0b2e23!important}
.play-card[data-editor-mode="advanced"] .advanced-tools,
.play-card[data-editor-mode="pitch"] .advanced-tools{
  margin-bottom:78px!important;
}

@media(max-width:760px){
  #playModal .play-card{
    max-height:calc(100dvh - env(safe-area-inset-top) - 8px)!important;
  }
  #playModal .modal-head{
    top:0!important;
    padding:7px 2px 9px!important;
  }
  .play-card .modal-head strong{font-size:22px!important}
  .play-card .modal-head small{font-size:13px!important}
  .play-card .editor-context-hint>p{font-size:11.5px!important}
  .play-card .editor-guide span{font-size:8.5px!important}
  .play-card .editor-section-title{
    margin:9px 0 5px!important;
    padding-top:4px!important;
    font-size:11px!important;
  }
  .play-card .editor-grid{
    row-gap:7px!important;
    column-gap:8px!important;
  }
  .play-card .editor-grid>label:not(.check-label),
  .play-card .runner-out-fields .form-grid.two>label:not(.check-label){
    grid-template-rows:22px 38px!important;
    padding:7px 9px!important;
  }
  .play-card .field-label,
  .play-card .runner-out-fields .form-grid.two>label>.field-label{
    height:22px!important;
    min-height:22px!important;
    font-size:15px!important;
  }
  .play-card .editor-grid select,
  .play-card .editor-grid input,
  .play-card .runner-out-fields .form-grid.two select,
  .play-card .runner-out-fields .form-grid.two input{
    height:38px!important;
    min-height:38px!important;
    font-size:18px!important;
  }
  .play-card .score-field-card{
    height:66px!important;
    min-height:66px!important;
    grid-template-rows:17px 37px!important;
    padding:7px 9px 5px!important;
  }
  .play-card .score-field-card>select,
  .play-card .score-toggle-control{
    height:37px!important;
    min-height:37px!important;
  }
  .play-card .modal-actions button{
    min-height:48px!important;
    font-size:14px!important;
  }
  .play-card .fielder-grid-pos{
    height:46px!important;
    min-height:46px!important;
  }
}

@media(max-width:390px){
  .play-card .editor-guide span{font-size:7.8px!important}
  .play-card .score-toggle-copy{font-size:14px!important}
  .play-card .fielder-grid-pos>strong{font-size:9px!important}
}

/* ==========================================================
   v58 REAL-MOBILE PLAY EDITOR FIX
   Fixes the actual iOS Safari rendering shown in v57 screenshots.
   ========================================================== */

/* 1) Never let Safari paint our editor selects as light/native slabs. */
#playModal select{
  -webkit-appearance:none!important;
  appearance:none!important;
  color-scheme:dark!important;
  background-image:none!important;
  background-color:color-mix(in srgb,var(--panel) 84%,#000 16%)!important;
  color:var(--text)!important;
  -webkit-text-fill-color:var(--text)!important;
  border:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
  border-radius:9px!important;
  box-shadow:none!important;
}
body.theme-wrigley #playModal select{
  background-image:none!important;
  background-color:#0a281e!important;
  color:var(--wrigley-cream)!important;
  -webkit-text-fill-color:var(--wrigley-cream)!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 44%,#365240)!important;
}
#playModal select option{
  background:var(--panel)!important;
  color:var(--text)!important;
}
body.theme-wrigley #playModal select option{
  background:#0b2e23!important;
  color:var(--wrigley-cream)!important;
}

/* A CSS chevron belongs to the container, not the select paint layer. */
#playModal .editor-grid>label:has(>select),
#playModal .runner-out-fields label:has(>select),
#playModal .pitch-entry-grid>label:has(>select),
#playModal .score-field-card:has(>select){position:relative!important}
#playModal .editor-grid>label:has(>select)::after,
#playModal .runner-out-fields label:has(>select)::after,
#playModal .pitch-entry-grid>label:has(>select)::after,
#playModal .score-field-card:has(>select)::after{
  content:''!important;
  position:absolute!important;
  width:7px!important;
  height:7px!important;
  right:14px!important;
  bottom:20px!important;
  border-right:2px solid color-mix(in srgb,var(--text) 82%,var(--muted))!important;
  border-bottom:2px solid color-mix(in srgb,var(--text) 82%,var(--muted))!important;
  transform:rotate(45deg)!important;
  pointer-events:none!important;
  z-index:2!important;
}
body.theme-wrigley #playModal .editor-grid>label:has(>select)::after,
body.theme-wrigley #playModal .runner-out-fields label:has(>select)::after,
body.theme-wrigley #playModal .pitch-entry-grid>label:has(>select)::after,
body.theme-wrigley #playModal .score-field-card:has(>select)::after{
  border-color:var(--wrigley-cream)!important;
}
#playModal .score-field-card:has(>select)::after{bottom:16px!important}
#playModal .pitch-entry-grid>label:has(>select)::after{bottom:16px!important}

/* Explicit control padding now that the arrow is external. */
#playModal .editor-grid select,
#playModal .runner-out-fields select{
  padding:0 34px 0 10px!important;
}
#playModal .score-field-card>select{
  padding:0 34px 0 0!important;
  border:0!important;
  background-color:transparent!important;
}
body.theme-wrigley #playModal .score-field-card>select{
  background-color:transparent!important;
  border:0!important;
}
#playModal .pitch-entry-grid select{
  padding:0 36px 0 12px!important;
}

/* 2) Pitch-by-Pitch should read in one logical direction. */
.play-card.pitch-mode-editor .editor-context-hint{margin-top:8px!important}
.play-card.pitch-mode-editor .editor-guide{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  min-height:38px!important;
  padding:4px 7px!important;
  margin:5px 0 8px!important;
  gap:4px!important;
}
.play-card.pitch-mode-editor .editor-guide span{
  min-height:30px!important;
  display:grid!important;
  grid-template-columns:20px minmax(0,1fr)!important;
  align-items:center!important;
  justify-items:start!important;
  gap:5px!important;
  padding:2px 4px!important;
  font-size:8px!important;
  white-space:nowrap!important;
}
.play-card.pitch-mode-editor .editor-guide b{
  width:20px!important;
  height:20px!important;
  margin:0!important;
}
.play-card.pitch-mode-editor .pitch-workflow-note{display:none!important}

/* 3) Compact the Pitch Tracker without reducing important type. */
.play-card.pitch-mode-editor .pitch-tools{
  margin:5px 0 9px!important;
  border-radius:14px!important;
}
.play-card.pitch-mode-editor .pitch-tools-head{
  min-height:82px!important;
  padding:9px 11px!important;
}
.play-card.pitch-mode-editor .pitch-title-copy>strong{font-size:15px!important}
.play-card.pitch-mode-editor .pitch-title-copy>small{
  margin-top:4px!important;
  font-size:8px!important;
  line-height:1.2!important;
}
.play-card.pitch-mode-editor .pitch-count-lights{padding:6px 10px!important}
.play-card.pitch-mode-editor .pitch-entry-card{padding:9px 10px 10px!important}
.play-card.pitch-mode-editor .pitch-entry-card-head{margin-bottom:6px!important;padding-bottom:6px!important}
.play-card.pitch-mode-editor .pitch-entry-grid{gap:7px!important}
.play-card.pitch-mode-editor .pitch-entry-grid label>span{min-height:18px!important;margin-bottom:4px!important}
.play-card.pitch-mode-editor .pitch-entry-grid select,
.play-card.pitch-mode-editor .pitch-velo-wrap,
.play-card.pitch-mode-editor .pitch-velo-wrap input{
  height:42px!important;
  min-height:42px!important;
}
.play-card.pitch-mode-editor .record-pitch-btn{min-height:46px!important}
.play-card.pitch-mode-editor .pitch-sequence-card{padding:8px 10px 9px!important}
.play-card.pitch-mode-editor .pitch-sequence-head{margin-bottom:5px!important;padding-bottom:5px!important}
.play-card.pitch-mode-editor .pitch-empty{min-height:48px!important;padding:7px 8px!important}

/* 4) Action buttons are part of the document flow. They never cover editor content. */
#playModal .modal-actions{
  position:static!important;
  bottom:auto!important;
  z-index:auto!important;
  margin:12px 0 0!important;
  padding:9px 0 calc(10px + env(safe-area-inset-bottom))!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.theme-wrigley #playModal .modal-actions{background:transparent!important}
.play-card[data-editor-mode="advanced"] .advanced-tools,
.play-card[data-editor-mode="pitch"] .advanced-tools{margin-bottom:0!important}
#playModal .play-card{
  scroll-padding-bottom:24px!important;
  padding-bottom:calc(14px + env(safe-area-inset-bottom))!important;
}

/* 5) Fielders: no phantom space before the 3x3 grid. */
.play-card .fielder-grid-team{
  padding:1px 2px 4px!important;
  height:22px!important;
  min-height:22px!important;
}
.play-card .fielder-grid{
  align-content:start!important;
  min-height:0!important;
}
.play-card .defense-field-card{overflow:visible!important}

@media(max-width:760px){
  #playModal select{font-size:16px!important}
  .play-card.pitch-mode-editor .editor-context-hint>p{font-size:10.5px!important}
  .play-card.pitch-mode-editor .editor-guide span{font-size:7.5px!important}
  .play-card.pitch-mode-editor .pitch-tools-head{grid-template-columns:minmax(0,1fr) 94px!important}
  .play-card.pitch-mode-editor .pitch-count-card{min-width:94px!important;padding:6px 7px!important}
  .play-card.pitch-mode-editor .pitch-count-card>b{font-size:21px!important}
  .play-card.pitch-mode-editor .pitch-entry-grid select,
  .play-card.pitch-mode-editor .pitch-entry-grid input,
  .play-card.pitch-mode-editor .pitch-velo-wrap{height:42px!important;min-height:42px!important}
  #playModal .modal-actions{gap:7px!important}
  #playModal .modal-actions button{min-height:48px!important;font-size:13px!important}
}

/* v58 final mobile alignment corrections from live render QA. */
#playModal .play-card::before{display:none!important}
#playModal .modal-head{
  padding-top:20px!important;
}
#playModal .modal-head::before{
  content:'';
  position:absolute;
  top:7px;
  left:50%;
  width:42px;
  height:5px;
  transform:translateX(-50%);
  border-radius:999px;
  background:color-mix(in srgb,var(--text) 34%,transparent);
  pointer-events:none;
}
/* A full-width field must use the full grid track, not preserve the old flex-end track. */
#playModal .editor-grid>label:not(.check-label),
#playModal .runner-out-fields .form-grid.two>label:not(.check-label){
  justify-content:stretch!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
}
#playModal #runnerGrid:has(#advanceReasonField.hidden)>label:first-child,
#playModal #runnerGrid:has(#advanceReasonField.hidden)>label:first-child>select{
  width:100%!important;
  max-width:none!important;
}
#playModal .play-card{padding-top:0!important}

/* ==========================================================
   v59 THEME / DARK MODE + DEVICE CONSISTENCY
   Presentation-only QA pass. Core score-grid / scoring behavior unchanged.
   ========================================================== */

/* 1) One theme-aware surface language across secondary workspaces. */
.modal-card,
.settings-card,
.confirm-card,
.postgame-card,
.history-item,
.summary-hero,
.summary-v54-line,
.summary-v54-actions,
.summary-v54-notes,
.team-stat-overview,
.batting-stats-card,
.pitch-inning-card,
.mode-help-strip,
.mode-summary-kpis>span,
.play-log-filter,
.pitch-outcomes span,
.pitch-usage>div:not(.pitch-usage-empty),
.fielding-stat-list>div{
  background:color-mix(in srgb,var(--panel) 94%,#000 6%)!important;
  color:var(--text)!important;
  border-color:color-mix(in srgb,var(--line) 82%,transparent)!important;
}
.modal-card input,
.modal-card select,
.modal-card textarea,
.settings-card input,
.settings-card select,
.settings-card textarea{
  background:color-mix(in srgb,var(--panel2) 90%,#000 10%)!important;
  color:var(--text)!important;
  border-color:color-mix(in srgb,var(--line) 82%,transparent)!important;
  caret-color:var(--accent)!important;
}
.modal-card input::placeholder,
.modal-card textarea::placeholder{color:color-mix(in srgb,var(--muted) 82%,transparent)!important;opacity:1!important}
.modal-card button,
.settings-card button,
.history-actions button,
.summary-v54-actions button,
.postgame-actions button,
.postgame-footer-actions button{
  color:var(--text)!important;
  border-color:color-mix(in srgb,var(--line) 82%,transparent)!important;
}
.modal-card button:not(.primary):not(.danger),
.settings-card button:not(.primary):not(.danger),
.history-actions button,
.summary-v54-actions button,
.postgame-actions button:not(.primary),
.postgame-footer-actions button:not(.primary){
  background:color-mix(in srgb,var(--panel2) 90%,#fff 2%)!important;
}
.modal-card button:focus-visible,
.settings-card button:focus-visible,
.modal-card input:focus-visible,
.modal-card select:focus-visible,
.modal-card textarea:focus-visible,
.drawer .menu-row:focus-visible{
  outline:2px solid color-mix(in srgb,var(--accent) 74%,transparent)!important;
  outline-offset:2px!important;
}
button:disabled,input:disabled,select:disabled,textarea:disabled{
  opacity:.48!important;
  filter:saturate(.55)!important;
  cursor:not-allowed!important;
}

/* 2) Selected / active state is intentionally the same pattern in every theme. */
.drawer .drawer-nav.active,
.play-log-filter button.active,
.mode-workspace-tabs button.active,
.workspace-tabs button.active{
  color:var(--text)!important;
  background:color-mix(in srgb,var(--selected) 74%,var(--panel2) 26%)!important;
  border-color:color-mix(in srgb,var(--accent) 48%,var(--line))!important;
  box-shadow:inset 3px 0 0 var(--accent),inset 0 0 0 1px color-mix(in srgb,var(--accent) 10%,transparent)!important;
}
body.theme-wrigley .drawer .drawer-nav.active,
body.theme-wrigley .play-log-filter button.active,
body.theme-wrigley .mode-workspace-tabs button.active,
body.theme-wrigley .workspace-tabs button.active{
  color:var(--wrigley-cream)!important;
  background:linear-gradient(180deg,#1a5b46,#114033)!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 72%,#4e684d)!important;
  box-shadow:inset 3px 0 0 var(--wrigley-gold),inset 0 0 0 1px rgba(238,228,200,.05)!important;
}
body.theme-postseason .drawer .drawer-nav.active,
body.theme-postseason .play-log-filter button.active,
body.theme-postseason .mode-workspace-tabs button.active,
body.theme-postseason .workspace-tabs button.active{
  background:color-mix(in srgb,var(--selected) 72%,#08172a 28%)!important;
  border-color:color-mix(in srgb,var(--accent) 58%,#526476)!important;
}

/* 3) Dark mode is a true surface swap, not just dimming. */
body.dark-mode{
  color-scheme:dark;
}
body.dark-mode .card,
body.dark-mode .modal-card,
body.dark-mode .history-item,
body.dark-mode .summary-v54-line,
body.dark-mode .summary-v54-actions,
body.dark-mode .summary-v54-notes,
body.dark-mode .team-stat-overview,
body.dark-mode .pitch-inning-card{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 8px 20px rgba(0,0,0,.18)!important;
}
body.dark-mode .drawer-shade,
body.dark-mode .modal{background:rgba(0,0,0,.72)!important}
body.dark-mode .modal-card input,
body.dark-mode .modal-card select,
body.dark-mode .modal-card textarea{
  background:color-mix(in srgb,var(--panel2) 84%,#000 16%)!important;
}
body.dark-mode .summary-v54-head p,
body.dark-mode .postgame-section-head small,
body.dark-mode .history-item small,
body.dark-mode .team-stat-head small,
body.dark-mode .play-log-player small{color:color-mix(in srgb,var(--muted) 90%,#fff 10%)!important}

/* 4) Wrigley / postseason secondary screens stay inside their theme. */
body.theme-wrigley .modal-card,
body.theme-wrigley .history-item,
body.theme-wrigley .summary-v54-line,
body.theme-wrigley .summary-v54-actions,
body.theme-wrigley .summary-v54-notes,
body.theme-wrigley .team-stat-overview,
body.theme-wrigley .pitch-inning-card{
  background:linear-gradient(180deg,rgba(15,55,42,.98),rgba(9,37,28,.98))!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 40%,#3b5542)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-wrigley .modal-card input,
body.theme-wrigley .modal-card select,
body.theme-wrigley .modal-card textarea,
body.theme-wrigley .settings-card input,
body.theme-wrigley .settings-card select{
  background:#0b3025!important;
  color:var(--wrigley-cream)!important;
  border-color:color-mix(in srgb,var(--wrigley-gold) 38%,#3e5a46)!important;
}
body.theme-postseason .modal-card,
body.theme-postseason .history-item,
body.theme-postseason .summary-v54-line,
body.theme-postseason .summary-v54-actions,
body.theme-postseason .summary-v54-notes,
body.theme-postseason .team-stat-overview,
body.theme-postseason .pitch-inning-card{
  background:linear-gradient(180deg,#0b2037,#07182a)!important;
  border-color:color-mix(in srgb,var(--accent) 38%,#4f6277)!important;
  color:#f7f3ea!important;
}
body.theme-postseason .modal-card input,
body.theme-postseason .modal-card select,
body.theme-postseason .modal-card textarea,
body.theme-postseason .settings-card input,
body.theme-postseason .settings-card select{
  background:#071a2d!important;
  color:#f7f3ea!important;
  border-color:color-mix(in srgb,var(--accent) 35%,#506277)!important;
}

/* 5) Long team/player names: fit first, wrap only where useful, ellipsis last. */
.team-header-name{
  max-width:100%!important;
  min-width:0!important;
  letter-spacing:-.01em!important;
  line-height:1.02!important;
}
.team-header-name.team-name-long{font-size:clamp(9px,2.9vw,13px)!important;letter-spacing:-.025em!important}
.team-header-name.team-name-xlong{font-size:clamp(8.2px,2.55vw,12px)!important;letter-spacing:-.04em!important}
.matchup-team select{
  min-width:0!important;
  width:100%!important;
  text-overflow:ellipsis!important;
}
.launch-team,
.summary-v54-team,
.postgame-team,
.team-stat-head>span,
.play-log-player,
.player-stat-card summary>span:first-child{min-width:0!important}
.launch-team small,
.summary-v54-team small,
.postgame-team small{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  overflow-wrap:anywhere!important;
  line-height:1.15!important;
  min-height:2.3em!important;
}
.team-stat-head b,
.player-stat-card summary strong,
.play-log-player strong,
.fielder-grid-pos>strong{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.fielder-grid-pos>strong{font-size:clamp(6.3px,2vw,8px)!important}

/* 6) Small-phone safeguards. Keep touch targets >=44px while reclaiming decoration. */
@media(max-width:390px){
  main{padding-left:7px!important;padding-right:7px!important}
  .drawer{width:min(300px,88vw)!important}
  .drawer .menu-row{min-height:48px!important;height:auto!important;padding:7px 9px!important}
  .drawer .menu-copy strong{font-size:10.5px!important}
  .drawer .menu-copy small{font-size:7px!important}
  .drawer .menu-value{max-width:94px!important}
  .live-game-bar{margin-left:0!important;margin-right:0!important}
  .team-header-name{font-size:10.5px!important}
  .team-header-name.team-name-long{font-size:9px!important}
  .team-header-name.team-name-xlong{font-size:8.1px!important}
  .matchup-team select.team-name-long{font-size:8px!important}
  .matchup-team select.team-name-xlong{font-size:7.2px!important}
  .summary-v54-head{gap:8px!important}
  .summary-v54-head h2{font-size:20px!important}
  .summary-v54-team small,.postgame-team small,.launch-team small{font-size:6.5px!important}
  .postgame-card{width:100%!important;max-width:none!important}
  .mobile-action-bar button{min-width:0!important}
  .mobile-action-bar small{white-space:nowrap!important}
}
@media(max-width:350px){
  .drawer{width:min(286px,91vw)!important}
  .mobile-action-bar span{font-size:16px!important}
  .mobile-action-bar small{font-size:7px!important}
  .team-header-name.team-name-long{font-size:8.4px!important}
  .team-header-name.team-name-xlong{font-size:7.6px!important}
  .summary-v54-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .postgame-actions,.postgame-footer-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* 7) Landscape iPhone: sheets use available height and preserve safe areas. */
@media(max-height:520px) and (orientation:landscape){
  .modal{align-items:stretch!important;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important}
  .modal-card{
    width:min(720px,92vw)!important;
    max-width:720px!important;
    max-height:100%!important;
    margin:auto!important;
    border-radius:16px!important;
    padding:10px 12px!important;
  }
  #playModal .play-card{
    width:min(760px,94vw)!important;
    max-width:760px!important;
    height:100%!important;
    max-height:100%!important;
    border-radius:16px!important;
    padding-bottom:calc(10px + env(safe-area-inset-bottom))!important;
  }
  #playModal .modal-head{padding-top:14px!important}
  #playModal .modal-head::before{top:4px!important}
  .mobile-action-bar{padding-bottom:calc(2px + env(safe-area-inset-bottom))!important}
}

/* 8) Reduce-motion covers v50+ UX effects globally. */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
}

/* ==========================================================
   v60 DESKTOP WORKSPACE + SAVED GAMES UX
   Desktop-first refinement and game-library polish.
   Mobile score-grid / scoring behavior intentionally unchanged.
   ========================================================== */

/* Saved Games becomes a real game library instead of utility rows. */
.saved-games-page{max-width:1180px;margin:0 auto;padding:4px 0 28px}
.saved-games-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:4px 0 14px;padding:0 2px}
.saved-games-head>div{min-width:0}.saved-games-head small{display:block;font-size:7px;font-weight:950;letter-spacing:.16em;color:var(--accent)}
.saved-games-head h2{margin:4px 0 3px;font-size:25px;line-height:1.05;color:var(--text)}
.saved-games-head p{max-width:650px;margin:0;color:var(--muted);font-size:8.5px;line-height:1.45}
.saved-games-head>span{flex:0 0 auto;padding:7px 10px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted);font-size:7px;font-weight:900}
.saved-games-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.saved-game-card{min-width:0;padding:0;overflow:hidden;border-radius:15px!important}
.saved-game-top{display:flex;align-items:center;gap:7px;min-height:38px;padding:7px 10px;border-bottom:1px solid color-mix(in srgb,var(--line) 66%,transparent);background:color-mix(in srgb,var(--panel2) 90%,var(--panel) 10%)}
.saved-game-top .saved-status{display:inline-flex;align-items:center;min-height:21px;padding:0 7px;border:1px solid var(--line);border-radius:999px;font-size:5.8px;font-weight:950;letter-spacing:.08em;color:var(--muted)}
.saved-game-top .saved-status.live{color:#dfeadf;border-color:color-mix(in srgb,#68a676 65%,var(--line));background:color-mix(in srgb,#285f37 46%,var(--panel2))}
.saved-game-top .saved-status.final{color:var(--text);border-color:color-mix(in srgb,var(--accent) 62%,var(--line));background:color-mix(in srgb,var(--accent) 13%,var(--panel2))}
.saved-game-top .saved-status.reopened{color:var(--text);border-color:color-mix(in srgb,#7b9fc3 60%,var(--line));background:color-mix(in srgb,#315d83 36%,var(--panel2))}
.saved-game-top>em{font-size:6.5px;font-style:normal;font-weight:850;color:var(--muted)}
.saved-game-top>b{margin-left:auto;font-size:6.5px;color:var(--accent);letter-spacing:.05em}
.saved-matchup{display:grid;grid-template-columns:minmax(0,1fr) 108px minmax(0,1fr);align-items:center;gap:8px;padding:13px 12px 11px}
.saved-team{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:8px;min-width:0}
.saved-team.right{grid-template-columns:minmax(0,1fr) 38px;text-align:right}.saved-team.right img{grid-column:2}.saved-team.right span{grid-column:1;grid-row:1}
.saved-team img{width:38px;height:38px;object-fit:contain}.saved-team span{min-width:0}.saved-team strong,.saved-team small{display:block;min-width:0}
.saved-team strong{font-size:13px;color:var(--text)}.saved-team small{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:6.5px;color:var(--muted)}
.saved-score{text-align:center;min-width:0}.saved-score strong{display:block;font-size:27px;line-height:1;color:var(--text)}.saved-score strong i{margin:0 7px;color:var(--muted);font-style:normal;font-weight:500}.saved-score span{display:block;margin-top:5px;font-size:6.5px;font-weight:900;color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.saved-game-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:0 12px 11px}.saved-game-meta span{min-width:0;padding:6px 7px;border-radius:8px;background:color-mix(in srgb,var(--panel2) 72%,transparent);border:1px solid color-mix(in srgb,var(--line) 48%,transparent);font-size:6px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.saved-game-actions{display:grid;grid-template-columns:1.2fr 1fr auto;gap:7px;padding:10px 12px 12px;border-top:1px solid color-mix(in srgb,var(--line) 58%,transparent)}
.saved-game-actions button{min-height:38px;padding:0 11px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--text);font-size:7px;font-weight:900}
.saved-game-actions .saved-primary{background:color-mix(in srgb,var(--accent) 16%,var(--panel2));border-color:color-mix(in srgb,var(--accent) 52%,var(--line));color:var(--text)}
.saved-game-actions .saved-delete{padding-inline:10px;color:#e78880!important;border-color:color-mix(in srgb,#c5574f 45%,var(--line))!important;background:color-mix(in srgb,#7d2b27 16%,var(--panel2))!important}
.saved-games-empty{display:grid;place-items:center;max-width:560px;margin:40px auto;padding:34px 24px;text-align:center}.saved-games-empty>span{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:var(--panel2);border:1px solid var(--line);color:var(--accent);font-size:22px}.saved-games-empty strong{margin-top:12px;font-size:15px}.saved-games-empty p{max-width:360px;margin:6px 0 15px;color:var(--muted);font-size:8px;line-height:1.5}.saved-games-empty button{min-height:40px;padding:0 15px;border:1px solid color-mix(in srgb,var(--accent) 50%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--accent) 14%,var(--panel2));color:var(--text);font-weight:900;font-size:8px}

body.theme-wrigley .saved-game-card{background:linear-gradient(180deg,rgba(15,55,42,.98),rgba(9,37,28,.98))!important;border-color:color-mix(in srgb,var(--wrigley-gold) 40%,#3b5542)!important}
body.theme-wrigley .saved-game-top{background:linear-gradient(180deg,#124232,#0d3428)!important;border-color:color-mix(in srgb,var(--wrigley-gold) 35%,#3c5643)!important}
body.theme-wrigley .saved-game-actions button{background:#0b3025!important;border-color:color-mix(in srgb,var(--wrigley-gold) 34%,#3f5946)!important;color:var(--wrigley-cream)!important}
body.theme-wrigley .saved-game-actions .saved-primary{background:linear-gradient(180deg,#1a5b46,#114033)!important;border-color:color-mix(in srgb,var(--wrigley-gold) 68%,#50694e)!important}

/* Desktop should feel like a workspace, not a stretched phone. */
@media(min-width:1100px){
  body:not(.home-page) main{max-width:1540px!important;padding:12px 22px 40px!important}
  .mode-page-shell{max-width:1380px!important}
  .saved-games-page{max-width:1280px!important}
  .summary-page-v54{max-width:1320px!important;margin:0 auto}
  .live-game-bar{border-radius:12px!important}
  .mode-workspace-tabs{max-width:760px;margin:8px auto 12px!important}
  .mode-page-head{padding:5px 2px 12px!important}
  .mode-page-head h2{font-size:25px!important}
  .mode-page-head p{max-width:760px!important;font-size:8px!important}
  .mode-help-strip{padding:11px 13px!important}
  .play-log{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .play-log-inning{break-inside:avoid}
  .pitch-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
  .stats-team-grid,.team-overview-grid{gap:14px!important}
  .stats-card,.pitch-dashboard-card,.team-stat-overview{border-radius:14px!important}
  .advanced-stats-table th,.advanced-stats-table td{padding:8px 9px!important}

  /* Desktop scorebook: strong selection / hover and comfortable keyboard navigation. */
  .team-scorebook{border-radius:15px!important}
  .team-scorebook-scroll{scrollbar-gutter:stable both-edges!important}
  .play-cell{transition:background .12s ease,box-shadow .12s ease,transform .12s ease}
  .play-cell:hover{background:color-mix(in srgb,var(--selected) 24%,var(--panel))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 34%,transparent)!important}
  .play-cell:focus-visible,.player-cell:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 76%,transparent)!important;outline-offset:-3px!important;z-index:5!important}
  .play-cell[aria-selected="true"]{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 70%,transparent)!important}

  /* Right-side editor becomes a genuine inspector. */
  body.has-play-inspector main{padding-right:500px!important}
  #playModal:not(.hidden){width:476px!important}
  #playModal .play-card{width:476px!important;max-width:476px!important;border-radius:18px 0 0 18px!important;padding:0 18px 28px!important;scrollbar-gutter:stable!important}
  #playModal .modal-head{top:0!important;margin:0 -18px 6px!important;padding:19px 18px 12px!important;border-radius:18px 0 0 0!important}
  #playModal .modal-head::before{top:7px!important}
  #playModal .modal-actions{position:sticky!important;bottom:-28px!important;margin:16px -18px -28px!important;padding:12px 18px 18px!important;background:color-mix(in srgb,var(--panel) 96%,#000 4%)!important;border-top:1px solid color-mix(in srgb,var(--line) 64%,transparent)!important;box-shadow:0 -10px 22px rgba(0,0,0,.18)!important;z-index:9!important}
  body.theme-wrigley #playModal .modal-actions{background:#0b2e23!important}
  #playModal .editor-grid{column-gap:10px!important}
  #playModal .pitch-entry-grid{grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr)!important}
  #playModal .pitch-result-field,#playModal .record-pitch-btn{grid-column:1/-1!important}
  #playModal .advanced-layout{grid-template-columns:1fr!important}
}

@media(min-width:1450px){
  .saved-games-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .saved-matchup{grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr)}
  .saved-team small{font-size:6.2px}
}

/* Mobile Saved Games stays compact and thumb-friendly. */
@media(max-width:760px){
  .saved-games-page{padding:0 0 20px}.saved-games-head{align-items:flex-start;margin:3px 2px 10px}.saved-games-head p{font-size:7.2px}.saved-games-head>span{font-size:6.2px;padding:6px 8px}.saved-games-grid{grid-template-columns:1fr;gap:9px}
  .saved-game-card{border-radius:13px!important}.saved-matchup{grid-template-columns:minmax(0,1fr) 92px minmax(0,1fr);padding:11px 9px 9px}.saved-team{grid-template-columns:32px minmax(0,1fr);gap:6px}.saved-team.right{grid-template-columns:minmax(0,1fr) 32px}.saved-team img{width:32px;height:32px}.saved-score strong{font-size:23px}.saved-game-meta{grid-template-columns:1fr 1fr;padding:0 9px 9px}.saved-game-meta span:last-child{grid-column:1/-1}.saved-game-actions{grid-template-columns:1fr 1fr auto;padding:9px}.saved-game-actions button{min-height:44px;font-size:7px}.saved-game-actions .saved-delete{min-width:54px}
}

/* ==========================================================
   v61 CROSS-GAME UX SAFETY + RELEASE-CANDIDATE POLISH
   Appearance is global to the app: saved/imported games keep the
   currently selected theme, dark mode and focus state.
   ========================================================== */
.saved-appearance-note{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line));
  border-radius:13px;
  background:color-mix(in srgb,var(--panel) 92%,var(--accent) 4%);
  color:var(--text);
}
.saved-appearance-note>span{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));
  border-radius:10px;
  background:var(--panel2);
  color:var(--accent);
  font-size:15px;
}
.saved-appearance-note>div{min-width:0}
.saved-appearance-note strong,
.saved-appearance-note small{display:block}
.saved-appearance-note strong{font-size:9px;line-height:1.15;color:var(--text)}
.saved-appearance-note small{margin-top:3px;font-size:7px;line-height:1.35;color:var(--muted)}
.saved-appearance-note em{
  justify-self:end;
  max-width:210px;
  padding:6px 8px;
  border:1px solid color-mix(in srgb,var(--line) 72%,transparent);
  border-radius:999px;
  background:var(--panel2);
  color:var(--accent);
  font-size:6.5px;
  line-height:1.2;
  font-style:normal;
  font-weight:900;
  text-align:right;
  white-space:normal;
}
body.theme-wrigley .saved-appearance-note{
  background:linear-gradient(180deg,rgba(16,58,44,.95),rgba(10,38,29,.95));
  border-color:color-mix(in srgb,var(--wrigley-gold) 42%,#385541);
}
body.theme-wrigley .saved-appearance-note>span,
body.theme-wrigley .saved-appearance-note em{
  border-color:color-mix(in srgb,var(--wrigley-gold) 46%,#385541);
  color:var(--wrigley-cream);
}
body.theme-postseason .saved-appearance-note{
  border-color:color-mix(in srgb,var(--accent) 38%,var(--line));
}

/* Release-candidate consistency: cross-game actions have a clear focus state. */
.saved-game-actions button:focus-visible,
.launch-actions button:focus-visible,
.launch-primary:focus-visible,
.mode-workspace-tabs button:focus-visible{
  outline:2px solid var(--accent)!important;
  outline-offset:2px!important;
}

/* Keep Saved Games metadata readable without widening cards on small phones. */
@media(max-width:760px){
  .saved-appearance-note{
    grid-template-columns:32px minmax(0,1fr);
    gap:9px;
    padding:9px 10px;
  }
  .saved-appearance-note em{
    grid-column:1/-1;
    justify-self:stretch;
    max-width:none;
    text-align:left;
    border-radius:9px;
  }
  .saved-appearance-note strong{font-size:8.5px}
  .saved-appearance-note small{font-size:6.8px}
}

/* ==========================================================
   v62 RELEASE-CANDIDATE SAFETY + NAVIGATION POLISH
   Cross-game data safety and Saved Games clarity. Core scoring untouched.
   ========================================================== */
.saved-game-card.is-current{
  border-color:color-mix(in srgb,var(--accent) 72%,var(--line))!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent),0 12px 28px rgba(0,0,0,.18)!important;
}
.saved-game-card.is-current .saved-game-top{
  background:color-mix(in srgb,var(--selected) 66%,var(--panel2) 34%)!important;
}
.saved-current{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:21px;
  padding:0 7px;
  border:1px solid color-mix(in srgb,var(--accent) 68%,var(--line));
  border-radius:999px;
  background:color-mix(in srgb,var(--accent) 15%,var(--panel2));
  color:var(--text);
  font-size:5.7px;
  font-weight:950;
  letter-spacing:.08em;
}
.saved-game-card.is-current .saved-primary{
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 22%,transparent)!important;
}
.saved-appearance-note{
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 7%,transparent)!important;
}
.saved-appearance-note>span::after{
  content:'✓';
  position:absolute;
  right:-4px;
  bottom:-4px;
  display:grid;
  place-items:center;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--accent);
  color:var(--accent-ink,#111);
  font-size:7px;
  font-weight:950;
  border:2px solid var(--panel);
}
.saved-appearance-note>span{position:relative}
.drawer-nav[aria-current="page"],
.mode-workspace-tabs button[aria-current="page"]{
  outline-offset:-2px;
}
@media(max-width:760px){
  .saved-game-top{flex-wrap:wrap!important;row-gap:5px!important}
  .saved-game-top>b{margin-left:auto!important}
  .saved-current{min-height:19px;padding-inline:6px;font-size:5.3px}
  .saved-appearance-note small{line-height:1.4!important}
}
body.theme-wrigley .saved-game-card.is-current{
  border-color:color-mix(in srgb,var(--wrigley-gold) 78%,#4b684f)!important;
  box-shadow:inset 0 0 0 1px rgba(239,226,194,.06),0 12px 28px rgba(0,0,0,.25)!important;
}
body.theme-wrigley .saved-current{
  border-color:var(--wrigley-gold)!important;
  background:rgba(169,139,86,.15)!important;
  color:var(--wrigley-cream)!important;
}
body.theme-postseason .saved-game-card.is-current{
  border-color:color-mix(in srgb,var(--accent) 74%,#61748c)!important;
}

/* ---------- v63 refinement pass ----------
   - uniform theme-aware menu rows
   - calmer active states
   - reduced divider density in play editor
*/

/* MENU: make every row share the same card language so nothing feels randomly highlighted. */
.drawer .menu-row,
.drawer .drawer-nav,
.drawer .drawer-action,
.drawer .drawer-tools>button,
.drawer .import-button{
  background:color-mix(in srgb,var(--panel2) 84%,var(--panel) 16%)!important;
  border:1px solid color-mix(in srgb,var(--line) 52%,transparent)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03)!important;
}
.drawer .menu-row:hover,
.drawer .drawer-nav:hover,
.drawer .drawer-action:hover,
.drawer .drawer-tools>button:hover,
.drawer .import-button:hover{
  background:color-mix(in srgb,var(--panel2) 88%,var(--accent) 5%)!important;
  border-color:color-mix(in srgb,var(--accent) 24%,var(--line) 76%)!important;
}
.drawer .drawer-nav.active,
.drawer .menu-row.active{
  background:color-mix(in srgb,var(--panel2) 90%,var(--accent) 10%)!important;
  border-color:color-mix(in srgb,var(--accent) 30%,var(--line) 70%)!important;
  box-shadow:inset 3px 0 0 color-mix(in srgb,var(--accent) 78%,transparent), inset 0 1px 0 rgba(255,255,255,.05)!important;
}
.drawer .drawer-nav.active::before,
.drawer .menu-row.active::before{
  opacity:.16!important;
}
.drawer .menu-badge{
  background:color-mix(in srgb,var(--panel) 74%,var(--accent) 14%)!important;
  border:1px solid color-mix(in srgb,var(--accent) 20%,transparent)!important;
}
.drawer .menu-value,
.drawer .menu-trailing{
  background:transparent!important;
  box-shadow:none!important;
}
.drawer .drawer-label::after,
.drawer-section+.drawer-section::before{
  opacity:.45!important;
}

/* WRIGLEY menu: keep scoreboard look but avoid isolated highlighted blocks. */
body.theme-wrigley .drawer .menu-row,
body.theme-wrigley .drawer .drawer-nav,
body.theme-wrigley .drawer .drawer-action,
body.theme-wrigley .drawer .drawer-tools>button,
body.theme-wrigley .drawer .import-button{
  background:linear-gradient(180deg,rgba(18,58,44,.94),rgba(12,41,31,.94))!important;
  border-color:rgba(169,139,86,.34)!important;
}
body.theme-wrigley .drawer .menu-row:hover,
body.theme-wrigley .drawer .drawer-nav:hover,
body.theme-wrigley .drawer .drawer-action:hover,
body.theme-wrigley .drawer .drawer-tools>button:hover,
body.theme-wrigley .drawer .import-button:hover{
  background:linear-gradient(180deg,rgba(24,73,56,.96),rgba(14,48,37,.96))!important;
  border-color:rgba(190,160,107,.44)!important;
}
body.theme-wrigley .drawer .drawer-nav.active,
body.theme-wrigley .drawer .menu-row.active{
  background:linear-gradient(180deg,rgba(29,84,62,.98),rgba(18,56,42,.96))!important;
  border-color:rgba(200,171,115,.5)!important;
  box-shadow:inset 4px 0 0 rgba(210,179,118,.9), inset 0 1px 0 rgba(255,255,255,.04)!important;
}
body.theme-wrigley .drawer .menu-badge{
  background:rgba(17,43,34,.9)!important;
  border-color:rgba(190,160,107,.34)!important;
}

/* PLAY EDITOR: reduce the number of dividing lines. */
.play-card .editor-section-title{
  margin:12px 0 6px!important;
  padding-top:0!important;
  gap:0!important;
}
.play-card .editor-section-title::after{
  display:none!important;
}
.play-card .editor-section-title > span,
.play-card .editor-section-title > b,
.play-card .editor-section-title{
  letter-spacing:.13em!important;
}
.play-card .editor-grid{gap:9px!important}
.play-card .editor-grid>label:not(.check-label),
.play-card .runner-out-fields .form-grid.two>label,
.play-card .score-field-card,
.play-card .check-label{
  border-color:color-mix(in srgb,var(--line) 52%,transparent)!important;
  box-shadow:none!important;
}
.play-card .runner-out-fields,
.play-card .advanced-tools,
.play-card .pitch-tools{
  border-color:color-mix(in srgb,var(--line) 42%,transparent)!important;
  box-shadow:none!important;
}
.play-card .runner-out-fields{padding:10px 11px!important}
.play-card .advanced-tools{padding:8px 9px 10px!important}
.play-card .pitch-tools{padding:9px 10px 10px!important}
.play-card .field-card-head,
.play-card .pitch-entry-card-head,
.play-card .pitch-sequence-head{
  padding-bottom:4px!important;
  margin-bottom:5px!important;
  border-bottom:0!important;
}
.play-card .defense-field-card,
.play-card .advanced-runner-card,
.play-card .pitch-entry-card,
.play-card .pitch-sequence-card,
.play-card .pitch-workflow-note,
.play-card .pitch-count-card{
  border-color:color-mix(in srgb,var(--line) 44%,transparent)!important;
  box-shadow:none!important;
}
.play-card .fielder-grid,
.play-card .pitch-count-lights{
  border-color:color-mix(in srgb,var(--line) 34%,transparent)!important;
}
.play-card .fielder-selection,
.play-card .pitch-empty,
.play-card .editor-guide{
  border-color:color-mix(in srgb,var(--line) 36%,transparent)!important;
}
.play-card .score-field-card{min-height:74px!important}

/* Wrigley editor: keep richness, but declutter. */
body.theme-wrigley .play-card .runner-out-fields,
body.theme-wrigley .play-card .advanced-tools,
body.theme-wrigley .play-card .pitch-tools,
body.theme-wrigley .play-card .defense-field-card,
body.theme-wrigley .play-card .advanced-runner-card,
body.theme-wrigley .play-card .pitch-entry-card,
body.theme-wrigley .play-card .pitch-sequence-card,
body.theme-wrigley .play-card .pitch-workflow-note,
body.theme-wrigley .play-card .pitch-count-card,
body.theme-wrigley .play-card .editor-grid>label:not(.check-label),
body.theme-wrigley .play-card .runner-out-fields .form-grid.two>label,
body.theme-wrigley .play-card .score-field-card,
body.theme-wrigley .play-card .check-label{
  border-color:rgba(169,139,86,.28)!important;
}
body.theme-wrigley .play-card .fielder-grid,
body.theme-wrigley .play-card .pitch-count-lights,
body.theme-wrigley .play-card .fielder-selection,
body.theme-wrigley .play-card .pitch-empty,
body.theme-wrigley .play-card .editor-guide{
  border-color:rgba(169,139,86,.22)!important;
}

/* ==========================================================
   v64 — ALL-THEME CONSISTENCY AUDIT
   High-specificity final rules intentionally use #drawer/#playModal
   so older per-theme selectors cannot create uneven row/card treatment.
   ========================================================== */

/* One menu surface system for EVERY theme and every menu action. */
#drawer .menu-row,
#drawer .drawer-nav,
#drawer .drawer-action,
#drawer .drawer-tools > button,
#drawer .import-button{
  background:color-mix(in srgb,var(--panel2) 86%,var(--panel) 14%)!important;
  border:1px solid color-mix(in srgb,var(--line) 54%,transparent)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
  color:var(--text)!important;
}
#drawer .menu-row:hover,
#drawer .drawer-nav:hover,
#drawer .drawer-action:hover,
#drawer .drawer-tools > button:hover,
#drawer .import-button:hover{
  background:color-mix(in srgb,var(--panel2) 88%,var(--accent) 6%)!important;
  border-color:color-mix(in srgb,var(--line) 66%,var(--accent) 34%)!important;
}
/* Only actual navigation destinations can have the active-page treatment. */
#drawer .drawer-nav.active{
  background:color-mix(in srgb,var(--panel2) 84%,var(--accent) 16%)!important;
  border-color:color-mix(in srgb,var(--line) 58%,var(--accent) 42%)!important;
  box-shadow:inset 4px 0 0 color-mix(in srgb,var(--accent) 82%,transparent),inset 0 1px 0 rgba(255,255,255,.04)!important;
}
#drawer .drawer-nav.active::before{display:none!important}
#drawer .drawer-action,
#drawer .drawer-tools > button,
#drawer .import-button{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
#drawer .menu-glyph{
  color:color-mix(in srgb,var(--accent) 72%,var(--text) 28%)!important;
}
#drawer .menu-copy strong{color:var(--text)!important}
#drawer .menu-copy small{color:var(--muted)!important}
#drawer .menu-trailing,
#drawer .menu-value{color:color-mix(in srgb,var(--muted) 82%,var(--text) 18%)!important}
#drawer .menu-value{
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
}
#drawer .menu-badge{
  color:color-mix(in srgb,var(--accent) 72%,var(--text) 28%)!important;
  background:color-mix(in srgb,var(--panel) 82%,var(--accent) 18%)!important;
  border:1px solid color-mix(in srgb,var(--line) 58%,var(--accent) 22%)!important;
}
#drawer .drawer-label{
  color:color-mix(in srgb,var(--muted) 88%,var(--text) 12%)!important;
}
#drawer .drawer-label::after,
#drawer .drawer-section + .drawer-section::before{
  background:color-mix(in srgb,var(--line) 44%,transparent)!important;
  opacity:1!important;
}

/* Wrigley keeps its painted scoreboard character, but the same menu hierarchy. */
body.theme-wrigley #drawer .menu-row,
body.theme-wrigley #drawer .drawer-nav,
body.theme-wrigley #drawer .drawer-action,
body.theme-wrigley #drawer .drawer-tools > button,
body.theme-wrigley #drawer .import-button{
  background:linear-gradient(180deg,rgba(18,58,44,.94),rgba(12,41,31,.94))!important;
  border-color:rgba(169,139,86,.30)!important;
}
body.theme-wrigley #drawer .drawer-nav.active{
  background:linear-gradient(180deg,rgba(28,79,60,.98),rgba(17,54,41,.97))!important;
  border-color:rgba(200,171,115,.48)!important;
  box-shadow:inset 4px 0 0 rgba(214,184,123,.94),inset 0 1px 0 rgba(255,255,255,.035)!important;
}
body.theme-wrigley #drawer .menu-glyph,
body.theme-wrigley #drawer .menu-badge{color:var(--wrigley-cream)!important}

/* Play Editor: one section-heading system globally. No repeated horizontal rule. */
#playModal .editor-section-title{
  margin:13px 0 7px!important;
  padding:0!important;
  display:block!important;
  border:0!important;
  background:none!important;
  box-shadow:none!important;
  color:color-mix(in srgb,var(--accent) 76%,var(--text) 24%)!important;
}
#playModal .editor-section-title::before,
#playModal .editor-section-title::after{display:none!important;content:none!important}
#playModal .editor-section-title + .editor-grid,
#playModal .editor-section-title + .scoring-panel{margin-top:0!important}
#playModal .field-card-head,
#playModal .pitch-entry-card-head,
#playModal .pitch-sequence-head{
  border-bottom:0!important;
  padding-bottom:3px!important;
  margin-bottom:5px!important;
}
#playModal .runner-out-fields,
#playModal .advanced-tools,
#playModal .pitch-tools{
  border-color:color-mix(in srgb,var(--line) 34%,transparent)!important;
  box-shadow:none!important;
}
#playModal .editor-grid > label:not(.check-label),
#playModal .runner-out-fields .form-grid.two > label,
#playModal .score-field-card,
#playModal .check-label,
#playModal .defense-field-card,
#playModal .advanced-runner-card,
#playModal .pitch-entry-card,
#playModal .pitch-sequence-card,
#playModal .pitch-workflow-note,
#playModal .pitch-count-card{
  border-color:color-mix(in srgb,var(--line) 40%,transparent)!important;
  box-shadow:none!important;
}
#playModal .fielder-grid,
#playModal .pitch-count-lights,
#playModal .fielder-selection,
#playModal .pitch-empty,
#playModal .editor-guide{
  border-color:color-mix(in srgb,var(--line) 28%,transparent)!important;
  box-shadow:none!important;
}
/* Advanced title has a mode badge, but no decorative divider bars. */
#playModal .advanced-title{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
}
#playModal .advanced-title > b{
  flex:0 0 auto!important;
}

@media(max-width:760px){
  #drawer .menu-row,
  #drawer .drawer-nav,
  #drawer .drawer-action,
  #drawer .drawer-tools > button,
  #drawer .import-button{min-height:50px!important}
  #playModal .editor-section-title{margin:11px 0 6px!important}
}

/* ==========================================================
   v65 — Mobile Interaction + Empty-State Polish
   Release-candidate refinement. No score-grid geometry/touch changes.
   ========================================================== */

/* Modal scrolling should stay inside the sheet and remain usable around iOS keyboard/safe areas. */
.modal-card{
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}
.modal-card input:focus-visible,
.modal-card select:focus-visible,
.modal-card textarea:focus-visible,
.modal-card button:focus-visible,
#drawer button:focus-visible,
#drawer label:focus-within{
  outline:2px solid color-mix(in srgb,var(--accent) 78%,#fff 22%)!important;
  outline-offset:2px!important;
}
@media(max-width:900px){
  .modal-card{
    scroll-padding-top:82px!important;
    scroll-padding-bottom:calc(112px + env(safe-area-inset-bottom))!important;
    max-height:min(88dvh,calc(100dvh - env(safe-area-inset-top)))!important;
  }
  .modal-card input,
  .modal-card select,
  .modal-card textarea{font-size:16px!important}
  .modal-card .modal-head{isolation:isolate!important}
}
@media(max-width:900px) and (orientation:landscape){
  .modal-card{
    max-height:calc(100dvh - max(6px,env(safe-area-inset-top)))!important;
    scroll-padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }
}

/* One theme-aware empty-state language across History / Plays / Pitches / Stats. */
.empty-state,
.saved-games-empty,
.stats-empty,
.runner-empty,
.pitch-usage-empty{
  color:var(--muted)!important;
}
.mode-empty.empty-state{
  min-height:178px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  padding:24px 18px!important;
  text-align:center!important;
  border:1px dashed color-mix(in srgb,var(--line) 64%,transparent)!important;
  border-radius:16px!important;
  background:color-mix(in srgb,var(--panel2) 68%,var(--panel) 32%)!important;
  box-shadow:none!important;
}
.empty-state-icon{
  width:42px!important;
  height:42px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:13px!important;
  background:color-mix(in srgb,var(--selected) 60%,var(--panel2) 40%)!important;
  border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line) 72%)!important;
  color:var(--accent)!important;
  font-size:20px!important;
  line-height:1!important;
}
.mode-empty.empty-state strong{
  color:var(--text)!important;
  font-size:14px!important;
}
.mode-empty.empty-state>span:not(.empty-state-icon){
  max-width:46ch!important;
  color:var(--muted)!important;
  font-size:9px!important;
  line-height:1.45!important;
}
.mode-empty.empty-state button{
  min-height:40px!important;
  margin-top:5px!important;
  padding:0 16px!important;
  border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line) 58%)!important;
  border-radius:11px!important;
  background:color-mix(in srgb,var(--selected) 68%,var(--panel2) 32%)!important;
  color:var(--text)!important;
  font-size:9px!important;
  font-weight:900!important;
}
body.theme-wrigley .mode-empty.empty-state{
  background:linear-gradient(180deg,rgba(16,55,42,.94),rgba(10,39,30,.94))!important;
  border-color:rgba(173,147,93,.38)!important;
}
body.theme-postseason .mode-empty.empty-state{
  border-color:color-mix(in srgb,var(--accent) 36%,var(--line) 64%)!important;
}
@media(max-width:520px){
  .mode-empty.empty-state{min-height:152px!important;padding:20px 14px!important}
  .empty-state-icon{width:38px!important;height:38px!important;font-size:18px!important}
  .mode-empty.empty-state strong{font-size:13px!important}
  .mode-empty.empty-state>span:not(.empty-state-icon){font-size:8.5px!important}
}

/* ==========================================================
   v66 — Cross-mode guided editor refinement
   Keeps all scoring controls available while clarifying progression.
   ========================================================== */

/* Active/completed step language for Advanced + Pitch-by-Pitch. */
#playModal .editor-guide span{
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,opacity .16s ease,transform .16s ease!important;
  opacity:.72;
}
#playModal .editor-guide span.is-active{
  opacity:1!important;
  background:color-mix(in srgb,var(--selected) 68%,var(--panel2) 32%)!important;
  border-color:color-mix(in srgb,var(--accent) 42%,var(--line) 58%)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 10%,transparent)!important;
}
#playModal .editor-guide span.is-active b{
  background:var(--accent)!important;
  color:var(--accent-ink,#101820)!important;
  border-color:var(--accent)!important;
}
#playModal .editor-guide span.is-done{
  opacity:.86!important;
}
#playModal .editor-guide span.is-done b{
  border-color:color-mix(in srgb,var(--accent) 55%,var(--line))!important;
  color:var(--accent)!important;
}

/* Secondary sections stay available but stop competing with the current step. */
#playModal #advancedTools.is-secondary{
  background:color-mix(in srgb,var(--panel) 92%,transparent)!important;
  border-color:color-mix(in srgb,var(--line) 26%,transparent)!important;
}
#playModal #advancedTools.is-secondary .advanced-title{opacity:.78}
#playModal #runnerGrid.is-secondary{opacity:.88}
#playModal #scoringPanel.is-ready .score-field-card{
  border-color:color-mix(in srgb,var(--accent) 28%,var(--line) 72%)!important;
}

/* Empty advanced-runner state no longer consumes a full runner card. */
#playModal .advanced-runner-card.is-empty{
  padding:10px 12px!important;
  min-height:0!important;
}
#playModal .advanced-runner-card.is-empty .field-card-head{
  margin-bottom:5px!important;
  padding-bottom:0!important;
}
#playModal .advanced-runner-card.is-empty .field-card-head small{
  display:none!important;
}
#playModal .advanced-runner-card.is-empty .advanced-runner-list{
  min-height:0!important;
}
#playModal .advanced-runner-card.is-empty .runner-empty{
  min-height:42px!important;
  padding:8px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  border:0!important;
  background:color-mix(in srgb,var(--panel2) 72%,var(--panel) 28%)!important;
  border-radius:10px!important;
  color:var(--muted)!important;
}
#playModal .advanced-runner-card.is-empty .runner-empty b{
  color:var(--text)!important;
  font-size:11px!important;
  white-space:nowrap;
}
#playModal .advanced-runner-card.is-empty .runner-empty span{
  font-size:8px!important;
  text-align:right;
}

/* Give the current context enough emphasis without adding more divider lines. */
#playModal .context-focus{
  box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 26%,transparent),0 10px 24px rgba(0,0,0,.10)!important;
}

/* Theme-specific guide states inherit theme accent automatically. */
body.theme-wrigley #playModal .editor-guide span.is-active{
  background:linear-gradient(180deg,rgba(28,78,59,.96),rgba(17,54,41,.96))!important;
  border-color:rgba(190,160,107,.46)!important;
}
body.theme-postseason #playModal .editor-guide span.is-active{
  background:linear-gradient(180deg,rgba(30,49,80,.96),rgba(17,35,61,.96))!important;
}

@media(max-width:760px){
  #playModal .editor-guide span{min-height:45px!important;padding:6px 5px!important}
  #playModal .advanced-runner-card.is-empty .runner-empty{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:2px!important;
  }
  #playModal .advanced-runner-card.is-empty .runner-empty span{text-align:left!important}
}

/* ==========================================================
   v67 — Final Play Editor + interaction audit
   Cross-mode consistency without changing score-grid behavior.
   ========================================================== */

/* Make the active guide step obvious but compact across every theme. */
#playModal .editor-guide{
  gap:7px!important;
}
#playModal .editor-guide span{
  min-height:42px!important;
  border-radius:10px!important;
}
#playModal .editor-guide span.is-active{
  transform:translateY(-1px);
}
#playModal .editor-guide span.is-done b{
  font-size:9px!important;
}

/* Current section emphasis uses a soft outline only; no extra divider bars. */
#playModal .context-focus{
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 22%,transparent),0 8px 18px rgba(0,0,0,.08)!important;
}
#playModal #batterResultGrid.context-focus,
#playModal #runnerGrid.context-focus,
#playModal #scoringPanel.context-focus{
  border-radius:14px!important;
}

/* Runner-out controls audited for CS / PO / custom runner outs. */
#playModal .runner-out-fields:not(.hidden){
  display:block!important;
  margin-top:9px!important;
  padding:10px!important;
}
#playModal .runner-out-title{
  margin-bottom:7px!important;
  font-size:9px!important;
  letter-spacing:.13em!important;
}
#playModal .runner-out-count{
  margin-top:7px!important;
  min-height:40px!important;
}

/* Defensive notation + runner review read as one workflow without adding borders. */
#playModal #advancedTools.context-focus .defense-field-card,
#playModal #advancedTools.context-focus .advanced-runner-card{
  border-color:color-mix(in srgb,var(--accent) 24%,var(--line) 76%)!important;
}
#playModal #advancedTools.is-secondary{
  opacity:.92!important;
}

/* Cross-mode control geometry audit. */
#playModal .editor-grid>label:not(.check-label),
#playModal .score-field-card,
#playModal .runner-out-fields .form-grid.two>label{
  min-height:72px!important;
}
#playModal .editor-grid select,
#playModal .editor-grid input,
#playModal .runner-out-fields select,
#playModal .runner-out-fields input{
  min-height:38px!important;
}
#playModal input::placeholder{
  opacity:.72!important;
}

/* Wrigley / Postseason inherit the same audit behavior. */
body.theme-wrigley #playModal .context-focus{
  box-shadow:0 0 0 2px rgba(190,160,107,.26),0 8px 18px rgba(0,0,0,.10)!important;
}
body.theme-postseason #playModal .context-focus{
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 26%,transparent),0 8px 18px rgba(0,0,0,.10)!important;
}

@media(max-width:760px){
  #playModal .editor-guide{gap:5px!important}
  #playModal .editor-guide span{min-height:40px!important;padding:5px 4px!important}
  #playModal .editor-grid>label:not(.check-label),
  #playModal .score-field-card,
  #playModal .runner-out-fields .form-grid.two>label{min-height:68px!important}
  #playModal .runner-out-fields .form-grid.two{gap:8px!important}
}

/* ==========================================================
   v68 — Existing baserunner out-location support
   ========================================================== */
#playModal .advanced-runner-row.is-runner-out .runner-advance-reason{display:none!important}
#playModal .advanced-runner-row .runner-out-location.hidden,
#playModal .advanced-runner-row .runner-out-code.hidden{display:none!important}
#playModal .advanced-runner-row .runner-out-location,
#playModal .advanced-runner-row .runner-out-code{display:block}
#playModal .advanced-runner-row.is-runner-out{
  grid-template-columns:minmax(105px,1.15fr) minmax(92px,.8fr) minmax(118px,1fr) minmax(100px,.9fr)!important;
}
#playModal .advanced-runner-row.is-runner-out .runner-out-location select,
#playModal .advanced-runner-row.is-runner-out .runner-out-code input{
  border-color:color-mix(in srgb,var(--out) 38%,var(--line))!important;
}
@media(max-width:900px){
  #playModal .advanced-runner-row.is-runner-out{grid-template-columns:1fr 1fr!important}
  #playModal .advanced-runner-row.is-runner-out .runner-ident{grid-column:1/-1!important}
}

/* v69 lifecycle reliability: feedback stays inside the active theme. */
.save-status.is-saved{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,transparent)}
.saved-game-card.is-current .saved-current{letter-spacing:.08em}

/* v70 release-candidate audit: structural styling intentionally unchanged from v69. */


/* ==========================================================
   v71 — Double-play notation + out-count refinement
   ========================================================== */
.play-entry.out.standalone .standalone-out{
  position:relative;
  z-index:2;
}
.play-cell.third-out .play-entry.out.standalone .standalone-out{
  margin-bottom:2px;
}

/* ==========================================================
   v72 — DP batter-OUT rendering correction
   Rendering logic now sends DP + batter OUT through the existing
   centered standalone-out presentation. No structural CSS changes.
   ========================================================== */


/* ==========================================================
   v74 MULTI-RUNNER + EDITOR FIT PASS
   - multi-runner cards remain readable when TP exposes 2–3 runners
   - modal sheets stay at 1x while open after scoregrid pinch zoom
   ========================================================== */
@media(max-width:760px){
  html.modal-viewport-locked{overflow:hidden!important}
  html.modal-viewport-locked body{overscroll-behavior:none!important}
  #playModal .advanced-runner-list{display:grid!important;gap:10px!important}
  #playModal .advanced-runner-row{scroll-margin-top:74px!important}
  #playModal .advanced-runner-row .runner-ident{min-width:0!important}
  #playModal .advanced-runner-row .runner-ident b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* v75 — Pitch-caused runner events + uncaught third strike */
.play-card .runner-event-head{align-items:flex-end!important;gap:10px!important;flex-wrap:wrap}
.play-card .runner-event-control{display:grid;grid-template-columns:auto minmax(150px,210px);align-items:center;gap:7px;margin-left:auto;color:var(--muted);font-size:7px;font-weight:950;letter-spacing:.05em}
.play-card .runner-event-control>span{white-space:nowrap}
.play-card .runner-event-control select{width:100%;height:34px;min-height:34px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:0 8px;font-size:8px;font-weight:850}
.play-card .pitch-entry-grid{grid-template-columns:minmax(130px,1fr) minmax(86px,.68fr) minmax(125px,1fr) minmax(135px,1fr) auto!important}
.play-card .pitch-event-field select{border-color:color-mix(in srgb,var(--accent) 60%,var(--line))!important}
.play-card .pitch-chip.is-event{border-color:color-mix(in srgb,var(--accent) 70%,var(--line));background:color-mix(in srgb,var(--panel2) 82%,var(--accent) 8%)}
.pitch-event-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px}
.pitch-event-kpis span{padding:6px 4px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--panel2) 88%,transparent);text-align:center}
.pitch-event-kpis b{display:block;font-size:10px;color:var(--text)}
.pitch-event-kpis small{display:block;margin-top:2px;font-size:5.8px;color:var(--muted)}
@media(max-width:900px){
  .play-card .runner-event-control{grid-template-columns:auto minmax(135px,1fr);width:100%;margin-left:0}
  .play-card .runner-event-control select{height:42px;min-height:42px;font-size:11px}
  .play-card .pitch-entry-grid{grid-template-columns:1fr 1fr!important}
  .play-card .pitch-entry-grid .pitch-result-field,.play-card .pitch-entry-grid .pitch-event-field{grid-column:auto!important}
  .play-card .record-pitch-btn{grid-column:1/-1!important}
}
@media(max-width:520px){
  .play-card .pitch-entry-grid{grid-template-columns:1fr 1fr!important}
  .play-card .pitch-entry-grid .pitch-result-field,.play-card .pitch-entry-grid .pitch-event-field{grid-column:1/-1!important}
  .pitch-event-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* v76 — Basic runner movement + hard Play Editor zoom isolation */

.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only.basic-runners-empty{display:none!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only{
  display:block!important;
  margin-top:10px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only>.advanced-title,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .defense-field-card,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-event-control,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-advance-reason,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-location,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-code{
  display:none!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-layout{
  display:block!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-card{
  width:100%!important;
  margin:0!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head{
  margin-bottom:8px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head strong::after{
  content:' · BASIC';
  opacity:.62;
  font-size:.72em;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head small{
  font-size:0!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head small::after{
  content:'Set where each current runner ends this play';
  font-size:9px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
  grid-template-columns:minmax(0,1fr) minmax(132px,.8fr)!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label[data-basic-hide]{display:none!important}

@media(max-width:900px){
  /* The scoregrid may be pinch-zoomed, but the Play Editor is its own non-zoomable surface. */
  #playModal:not(.hidden),
  #playModal:not(.hidden) .play-card,
  #playModal:not(.hidden) .play-card *{
    touch-action:pan-y!important;
  }
  #playModal:not(.hidden) .play-card input,
  #playModal:not(.hidden) .play-card select,
  #playModal:not(.hidden) .play-card button{
    touch-action:manipulation!important;
  }
  #playModal{
    overscroll-behavior:none!important;
    -webkit-user-select:none;
  }
  #playModal input,#playModal select,#playModal textarea{
    -webkit-user-select:text;
    user-select:text;
  }
}


/* ==========================================================
   v77 — Basic Runner Movement terminology + visual-viewport Play Editor
   ========================================================== */
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only>.advanced-title{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  margin:12px 0 6px!important;
  padding:10px 0 0!important;
  border-top:1px solid color-mix(in srgb,var(--line) 76%,transparent)!important;
}
.play-card[data-editor-mode="basic"] #editorDetailTitle{
  font-size:9px!important;
  letter-spacing:.12em!important;
  color:color-mix(in srgb,var(--text) 90%,var(--accent) 10%)!important;
}
.play-card[data-editor-mode="basic"] #editorModeBadge{display:none!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .defense-field-card,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-event-control,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-advance-reason,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-location,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-code{display:none!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-layout{display:block!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-card{
  width:100%!important;margin:0!important;padding:9px!important;border-radius:12px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head{
  min-height:0!important;margin:0 0 8px!important;padding:0!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head strong::after{content:none!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head strong{
  font-size:8px!important;letter-spacing:.08em!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head small{
  display:block!important;margin-top:3px!important;font-size:8px!important;line-height:1.25!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .field-card-head small::after{content:none!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
  grid-template-columns:minmax(0,1fr) minmax(142px,.9fr)!important;
  padding:9px!important;gap:8px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row .runner-ident b{font-size:9px!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row .runner-ident small{font-size:7px!important}

@media(max-width:900px){
  #playModal:not(.hidden){
    box-sizing:border-box!important;
    max-width:none!important;max-height:none!important;
    overflow:hidden!important;
    contain:layout paint style;
  }
  #playModal:not(.hidden) .play-card{
    box-sizing:border-box!important;
    width:100%!important;max-width:none!important;
    max-height:100%!important;
    margin:0!important;
  }
  html.modal-viewport-locked #playModal:not(.hidden),
  html.modal-viewport-locked #playModal:not(.hidden) .play-card,
  html.modal-viewport-locked #playModal:not(.hidden) .play-card *{
    touch-action:pan-y!important;
  }
  html.modal-viewport-locked #playModal:not(.hidden) input,
  html.modal-viewport-locked #playModal:not(.hidden) select,
  html.modal-viewport-locked #playModal:not(.hidden) textarea,
  html.modal-viewport-locked #playModal:not(.hidden) button{
    touch-action:manipulation!important;
  }
}
/* Basic has one runner heading only; remove the nested runner-card header. */
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-card>.field-card-head{
  display:none!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-card{
  padding-top:8px!important;
}

/* ==========================================================
   v78 — Compact Basic Runner Movement + Safari modal reset
   ========================================================== */
@media(max-width:900px){
  #playModal.viewport-resetting{visibility:hidden!important}
  #playModal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    transform:none!important;
    zoom:1!important;
    padding:calc(6px + env(safe-area-inset-top)) 6px calc(6px + env(safe-area-inset-bottom))!important;
    display:flex!important;
    align-items:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    contain:none!important;
  }
  #playModal:not(.hidden) .play-card{
    position:relative!important;
    width:100%!important;
    height:100%!important;
    max-width:620px!important;
    max-height:none!important;
    margin:0 auto!important;
    transform:none!important;
    zoom:1!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    border-radius:20px!important;
  }
  html.modal-viewport-locked #playModal,
  html.modal-viewport-locked #playModal .play-card,
  html.modal-viewport-locked #playModal .play-card *{touch-action:pan-y!important}
  html.modal-viewport-locked #playModal input,
  html.modal-viewport-locked #playModal select,
  html.modal-viewport-locked #playModal textarea,
  html.modal-viewport-locked #playModal button{touch-action:manipulation!important}
}

/* Basic Runner Movement should look like one compact control, not nested Advanced cards. */
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only{
  margin-top:8px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only>.advanced-title{
  margin:8px 0 6px!important;
  padding:8px 0 0!important;
}
.play-card[data-editor-mode="basic"] #editorDetailTitle{font-size:9px!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-layout,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-card{
  padding:0!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-list{
  display:grid!important;
  gap:7px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
  display:grid!important;
  grid-template-columns:minmax(92px,.62fr) minmax(0,1.38fr)!important;
  align-items:center!important;
  gap:10px!important;
  min-height:64px!important;
  padding:8px 10px!important;
  border:1px solid color-mix(in srgb,var(--line) 74%,transparent)!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--panel2) 72%,transparent)!important;
  box-shadow:none!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-ident{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:2px!important;
  min-width:0!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-ident b{
  font-size:10px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-ident small{font-size:8px!important}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label{
  position:relative!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
  margin:0!important;
  padding:0!important;
  min-width:0!important;
  border:0!important;
  background:transparent!important;
  font-size:8px!important;
  font-weight:900!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label>select{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0 34px 0 11px!important;
  border-radius:10px!important;
  font-size:15px!important;
  font-weight:850!important;
}
@media(max-width:430px){
  .play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
    grid-template-columns:1fr!important;
    gap:6px!important;
    min-height:0!important;
  }
  .play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label{
    grid-template-columns:64px minmax(0,1fr)!important;
  }
}


/* ==========================================================
   v79 — Visual-viewport compensated Play Editor + equal Basic runner fields
   ========================================================== */
@media(max-width:900px){
  /* Normal 1x editor */
  #playModal:not(.hidden){
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    transform:none!important;
    padding:calc(6px + env(safe-area-inset-top)) 6px calc(6px + env(safe-area-inset-bottom))!important;
    overflow:hidden!important;
    display:flex!important;
    align-items:stretch!important;
    justify-content:center!important;
  }
  #playModal:not(.hidden) .play-card{
    box-sizing:border-box!important;
    width:100%!important;
    height:100%!important;
    max-width:620px!important;
    max-height:none!important;
    margin:0 auto!important;
    transform:none!important;
    transform-origin:0 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  /* If Safari still has the scoregrid pinched, make the OUTER modal match
     the live visual viewport. Only the inner card is inverse-scaled. */
  #playModal.visual-zoom-compensated:not(.hidden){
    inset:auto!important;
    left:var(--editor-vv-left)!important;
    top:var(--editor-vv-top)!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--editor-vv-width)!important;
    height:var(--editor-vv-height)!important;
    padding:0!important;
    display:block!important;
    overflow:hidden!important;
  }
  #playModal.visual-zoom-compensated:not(.hidden) .play-card{
    position:absolute!important;
    left:0!important;
    top:0!important;
    width:var(--editor-layout-width)!important;
    height:var(--editor-layout-height)!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    transform:scale(var(--editor-inverse-scale))!important;
    transform-origin:0 0!important;
    border-radius:20px!important;
  }
}

/* Basic Runner Movement: identity on top, two genuinely equal controls below. */
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:8px 10px!important;
  align-items:end!important;
  min-height:0!important;
  padding:9px 10px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row .runner-ident{
  grid-column:1 / -1!important;
  min-width:0!important;
  padding:0 1px 1px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-advance-reason{
  display:grid!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto 44px!important;
  gap:4px!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  font-size:8px!important;
  line-height:1.05!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label>select,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label>input{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  border-radius:10px!important;
  font-size:14px!important;
  font-weight:800!important;
  line-height:1!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label>select{
  padding:0 34px 0 11px!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row>label>input{
  padding:0 10px!important;
  text-overflow:ellipsis!important;
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-advance-reason input::placeholder{
  opacity:.72!important;
  font-size:12px!important;
}
@media(max-width:350px){
  .play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row{
    grid-template-columns:1fr!important;
  }
  .play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row .runner-ident{grid-column:1!important}
}


/* ==========================================================
   v80 — Force/Tag/Appeal/Interference runner-out semantics
   ========================================================== */
#playModal .advanced-runner-row .runner-out-type.hidden{display:none!important}
#playModal .advanced-runner-row .runner-out-type{display:block}
#playModal .advanced-runner-row.is-runner-out{
  grid-template-columns:minmax(100px,1.05fr) minmax(84px,.72fr) minmax(105px,.9fr) minmax(118px,1.05fr) minmax(100px,.9fr)!important;
}
#playModal .advanced-runner-row.is-runner-out .runner-out-type select{border-color:color-mix(in srgb,var(--accent) 42%,var(--line))!important}
#playModal .advanced-runner-row.is-runner-out .runner-out-type,
#playModal .advanced-runner-row.is-runner-out .runner-out-location,
#playModal .advanced-runner-row.is-runner-out .runner-out-code{min-width:0!important}
@media(max-width:900px){
  #playModal .advanced-runner-row.is-runner-out{grid-template-columns:1fr 1fr!important}
  #playModal .advanced-runner-row.is-runner-out .runner-ident{grid-column:1/-1!important}
}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-type,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-location,
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .runner-out-code{display:none!important}
/* In Basic mode an OUT destination has no advanced semantic fields, so let the destination use the full row. */
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .advanced-runner-row.is-runner-out>label:first-of-type{
  grid-column:1 / -1!important;
}


/* v81 — official error accounting + extra-inning state */
#playModal .official-error-card{
  border:1px solid var(--line);border-radius:16px;padding:14px;display:grid;gap:12px;background:color-mix(in srgb,var(--panel2) 72%,transparent);
}
#playModal .official-error-card.hidden{display:none!important}
#playModal .official-error-card .field-card-head{margin:0;padding:0;border:0}
#playModal .official-error-card>label:not(.official-error-toggle){display:grid;gap:6px;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
#playModal .official-error-card select{width:100%;min-height:44px}
#playModal .official-error-toggle{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--line) 65%,transparent);border-radius:12px}
#playModal .official-error-toggle input{width:20px;height:20px;flex:0 0 auto}
#playModal .official-error-toggle span{text-transform:none;letter-spacing:0;font-weight:800}
#playModal #officialErrorHelp{color:var(--muted);line-height:1.35}
.play-card[data-editor-mode="basic"] .advanced-tools.basic-runner-only .official-error-card{display:none!important}
.fielding-stat-list>div>strong{min-width:42px}

#playModal .official-error-card{grid-column:1/-1}

.play-cell .auto-runner-cell{position:absolute;left:4px;top:4px;z-index:4;font-size:7px;line-height:1;font-weight:900;letter-spacing:.06em;padding:3px 4px;border-radius:5px;border:1px solid color-mix(in srgb,var(--accent) 70%,transparent);background:color-mix(in srgb,var(--grid) 88%,transparent);color:var(--accent);white-space:nowrap;pointer-events:none}


/* v82 MLB game + lineup integration */
.mlb-link-strip{display:flex;align-items:center;gap:12px;padding:12px 14px;margin-top:10px;border-radius:14px;min-height:62px}
.mlb-link-strip .mlb-link-icon{display:grid;place-items:center;min-width:42px;height:34px;padding:0 8px;border-radius:9px;background:rgba(34,95,170,.16);border:1px solid rgba(89,139,204,.32);font-size:11px;font-weight:900;letter-spacing:.08em}
.mlb-link-strip>div{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}.mlb-link-strip strong{font-size:12px;letter-spacing:.055em}.mlb-link-strip small{font-size:11px;opacity:.72;white-space:normal;line-height:1.35}
.mlb-link-strip>button{min-height:36px;padding:0 13px;border-radius:9px;font-weight:800;white-space:nowrap}.mlb-link-strip.linked{box-shadow:inset 3px 0 0 rgba(74,162,101,.78)}
.mlb-finder-card{width:min(760px,calc(100vw - 28px));max-height:min(88dvh,820px);overflow:auto}
.mlb-finder-top{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.mlb-finder-top label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:800;letter-spacing:.05em}.mlb-finder-top input,.mlb-finder-top button{height:44px}.mlb-finder-top button{padding:0 16px;border-radius:10px;font-weight:800}
.mlb-finder-status{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:12px 0 8px;padding:8px 2px}.mlb-finder-status span{font-size:12px;font-weight:900}.mlb-finder-status small{font-size:10px;opacity:.62;text-align:right}
.mlb-games-list{display:flex;flex-direction:column;gap:8px;max-height:310px;overflow:auto;padding:2px}
.mlb-game-row{display:grid;grid-template-columns:76px 1fr 76px;align-items:center;gap:8px;width:100%;min-height:72px;padding:9px 10px;border-radius:12px;text-align:left}.mlb-game-row.selected{outline:2px solid currentColor;outline-offset:-2px}.mlb-game-team{display:flex;align-items:center;gap:6px;min-width:0}.mlb-game-team.home{justify-content:flex-end}.mlb-game-team img{width:28px;height:28px;object-fit:contain}.mlb-game-team b{font-size:12px}.mlb-game-center{display:flex;flex-direction:column;gap:3px;min-width:0;text-align:center}.mlb-game-center strong{font-size:12px;line-height:1.25}.mlb-game-center small{font-size:10px;opacity:.68;white-space:normal;line-height:1.3}
.mlb-game-preview{margin-top:12px;padding:13px;border:1px solid rgba(128,128,128,.24);border-radius:13px}.mlb-preview-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.mlb-preview-head>div{display:flex;align-items:center;gap:9px}.mlb-preview-head span{font-size:18px;font-weight:900}.mlb-preview-head b{font-size:11px;opacity:.55}.mlb-preview-head small{font-size:10px;font-weight:800;opacity:.68}.mlb-preview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:12px}.mlb-preview-grid>span{display:flex;flex-direction:column;gap:4px;padding:9px;border-radius:9px;background:rgba(128,128,128,.08);min-width:0}.mlb-preview-grid small{font-size:9px;font-weight:800;opacity:.62}.mlb-preview-grid b{font-size:11px;white-space:normal;line-height:1.25;overflow-wrap:anywhere}.mlb-preview-note{margin-top:10px;padding:9px 10px;border-radius:9px;background:rgba(172,117,38,.12);font-size:10px;line-height:1.4}.mlb-preview-note.ready{background:rgba(54,142,82,.13)}
.mlb-finder-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:100px;text-align:center;padding:18px}.mlb-finder-empty.compact{min-height:58px}.mlb-finder-empty b{font-size:12px}.mlb-finder-empty small{font-size:10px;opacity:.65;line-height:1.35}.mlb-modal-actions{display:flex;justify-content:flex-end;gap:8px}.mlb-modal-actions button{min-width:150px}
@media(max-width:600px){.mlb-link-strip{gap:9px;padding:10px 11px}.mlb-link-strip .mlb-link-icon{min-width:38px}.mlb-link-strip>button{padding:0 10px}.mlb-finder-card{width:100vw;max-width:none;height:100dvh;max-height:100dvh;border-radius:0}.mlb-finder-top{grid-template-columns:1fr 118px}.mlb-game-row{grid-template-columns:54px 1fr 54px;padding:8px 7px}.mlb-game-team{flex-direction:column;gap:2px}.mlb-game-team.home{flex-direction:column-reverse}.mlb-game-team img{width:25px;height:25px}.mlb-game-team b{font-size:10px}.mlb-game-center strong{font-size:11px}.mlb-preview-grid{grid-template-columns:1fr 1fr}.mlb-modal-actions{position:sticky;bottom:0;padding-top:10px}.mlb-modal-actions button{flex:1;min-width:0}.mlb-finder-status{align-items:flex-start;flex-direction:column}.mlb-finder-status small{text-align:left}}

/* v83 — MLB lineup name + jersey number fit refinement */
.unified-score-table .sticky-player{
  container-type:inline-size;
}
.unified-score-table .player-main{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  column-gap:3px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
}
.unified-score-table .player-main .player-name{
  min-width:0!important;
  max-width:100%!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  hyphens:auto!important;
}
.unified-score-table .player-main .player-num{
  flex:none!important;
  justify-self:end!important;
  white-space:nowrap!important;
  font-size:.86em!important;
  line-height:1!important;
  opacity:.96;
}
.unified-score-table .player-main.fit-long{font-size:11px!important}
.unified-score-table .player-main.fit-xlong{font-size:10.2px!important}
.unified-score-table .player-main.fit-xxlong{font-size:9.5px!important}
.unified-score-table .player-main .player-placeholder{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
@media(max-width:600px){
  .unified-score-table{
    --player-w:132px!important;
    --sticky-total:calc(var(--ord-w) + var(--player-w) + var(--pos-w))!important;
  }
  .team-scorebook-scroll{scroll-padding-left:192px!important}
  .unified-score-table .sticky-player{padding:3px 5px!important}
  .unified-score-table .player-main{font-size:9.8px!important;line-height:1.03!important;column-gap:2px!important}
  .unified-score-table .player-main.fit-long{font-size:9.2px!important}
  .unified-score-table .player-main.fit-xlong{font-size:8.6px!important}
  .unified-score-table .player-main.fit-xxlong{font-size:8px!important}
  .unified-score-table .player-main .player-name{line-height:1.05!important}
  .unified-score-table .player-main .player-num{font-size:.9em!important}
}
@media(max-width:390px){
  .unified-score-table{--player-w:128px!important}
  .team-scorebook-scroll{scroll-padding-left:188px!important}
}


/* ==========================================================
   v84 GAME REPORT / EXPORT CENTER
   ========================================================== */
.game-report-page{display:grid;gap:10px;padding-bottom:20px}.game-report-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.game-report-head small{font-size:8px;font-weight:950;letter-spacing:.15em;color:var(--accent)}.game-report-head h2{margin:2px 0;font-size:21px}.game-report-head p{margin:0;color:var(--muted);font-size:8px;font-weight:750}.game-report-head>span{padding:5px 8px;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:8px;font-weight:850}.game-report-card{overflow:hidden}.report-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border-bottom:1px solid var(--line)}.report-section-head>div{display:grid;gap:1px}.report-section-head small{font-size:7px;color:var(--accent);font-weight:950;letter-spacing:.12em}.report-section-head strong{font-size:11px}.report-section-head>span{font-size:7px;color:var(--muted);font-weight:800;text-align:right}.report-two-col{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:start}.report-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:7px}.report-table{width:100%;min-width:720px;border-collapse:collapse}.report-table.pitching{min-width:560px}.report-table th,.report-table td{padding:7px 6px;border:1px solid color-mix(in srgb,var(--line) 82%,transparent);font-size:7.5px;text-align:center;white-space:nowrap}.report-table th{font-size:7px;color:var(--muted);background:color-mix(in srgb,var(--panel2) 86%,transparent);position:sticky;top:0}.report-table td:first-child,.report-table th:first-child{text-align:left;position:sticky;left:0;z-index:1;background:var(--panel)}.report-table td:first-child{min-width:145px}.report-table td small{font-size:6.5px;color:var(--accent)}.report-table td em{font-style:normal;font-size:6.5px;color:var(--muted)}.report-table tfoot td{font-weight:900;background:color-mix(in srgb,var(--accent) 7%,var(--panel2))}.decision-tag{display:inline-block!important;padding:2px 4px;border-radius:5px;background:color-mix(in srgb,var(--accent) 16%,var(--panel2));color:var(--accent)!important;font-weight:950}.report-decision-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:10px}.report-decision-grid label,.report-decision-grid>div{display:grid;gap:5px}.report-decision-grid label>span,.report-decision-grid>div>span{font-size:7px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.report-decision-grid select{min-width:0;width:100%;height:42px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);font:inherit;font-size:9px;font-weight:850;padding:0 9px}.report-decision-grid>div b{min-height:38px;display:flex;align-items:center;padding:0 9px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);font-size:9px}.report-note{display:block;padding:0 11px 10px;color:var(--muted);font-size:7px;line-height:1.45}.report-pitch-auto{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;padding:8px;border-top:1px solid var(--line)}.report-pitch-auto span{display:grid;justify-items:center;gap:1px;padding:6px 3px;border-radius:8px;background:var(--panel2)}.report-pitch-auto b{font-size:12px;color:var(--accent)}.report-pitch-auto small{font-size:6px;color:var(--muted);font-weight:800}.report-fielding-grid{display:grid;padding:7px}.report-fielding-grid>div{display:grid;grid-template-columns:minmax(60px,1.1fr) repeat(5,1fr);align-items:center;gap:4px;padding:7px;border-bottom:1px solid color-mix(in srgb,var(--line) 76%,transparent)}.report-fielding-grid>div:last-child{border-bottom:0}.report-fielding-grid>div>strong{font-size:9px}.report-fielding-grid span{display:grid;justify-items:center}.report-fielding-grid b{font-size:10px}.report-fielding-grid small{font-size:5.8px;color:var(--muted)}.report-empty{padding:18px 12px;color:var(--muted);font-size:8px;text-align:center}.report-recap{padding:6px}.report-recap-inning{border-bottom:1px solid var(--line);padding:7px 5px}.report-recap-inning:last-child{border-bottom:0}.report-recap-inning>div:first-child{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.report-recap-inning>div strong{font-size:9px;color:var(--accent)}.report-recap-inning>div small{font-size:6.5px;color:var(--muted)}.report-recap-inning p{display:grid;grid-template-columns:minmax(120px,180px) 1fr;gap:8px;margin:0;padding:5px 3px}.report-recap-inning p b{font-size:8px}.report-recap-inning p span{font-size:7.5px;color:var(--muted)}.report-notes>div:last-child{padding:12px;font-size:9px;white-space:pre-wrap;min-height:42px}.game-report-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:8px}.game-report-actions button{min-height:54px!important;display:grid;place-items:center;gap:2px;padding:7px!important;border:1px solid var(--line)!important;border-radius:11px!important;background:var(--panel)!important;color:var(--accent)!important;font-size:15px!important;font-weight:950!important}.game-report-actions button span{font-size:7px;color:var(--text);font-weight:900}.game-report-actions button.primary{background:var(--accent)!important;color:var(--bg)!important}.game-report-actions button.primary span{color:var(--bg)!important}.auto-runner-report-note{display:flex;gap:10px;align-items:center;padding:9px 11px;border:1px solid color-mix(in srgb,var(--accent) 36%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--accent) 6%,var(--panel))}.auto-runner-report-note b{font-size:8px;color:var(--accent);white-space:nowrap}.auto-runner-report-note span{font-size:7px;color:var(--muted);line-height:1.4}.saved-game-report-strip{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:7px 10px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--panel2) 82%,transparent)}.saved-game-report-strip span{font-size:7px;color:var(--muted)}.saved-game-report-strip b{color:var(--accent)}
.export-center-card{width:min(610px,calc(100vw - 20px))!important}.export-center-intro{padding:10px 12px;color:var(--muted);font-size:8px;line-height:1.5}.export-center-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 12px 14px}.export-center-grid button{display:grid;grid-template-columns:36px 1fr;grid-template-rows:auto auto;column-gap:8px;text-align:left;align-items:center;padding:11px!important;min-height:72px!important;border:1px solid var(--line)!important;border-radius:12px!important;background:var(--panel)!important;color:var(--text)!important}.export-center-grid button>span{grid-row:1/3;font-size:22px;color:var(--accent);text-align:center}.export-center-grid button strong{font-size:10px}.export-center-grid button small{font-size:7px;color:var(--muted);line-height:1.3}
#printReport{display:none}
@media(max-width:700px){.game-report-head{padding:0 3px}.game-report-head h2{font-size:18px}.report-two-col{grid-template-columns:1fr}.report-decision-grid{grid-template-columns:1fr}.game-report-actions{grid-template-columns:repeat(4,1fr)}.game-report-actions button[data-report-finish]{grid-column:1/-1}.report-recap-inning p{grid-template-columns:105px 1fr}.report-table td:first-child{min-width:125px}.report-pitch-auto{grid-template-columns:repeat(3,1fr)}.auto-runner-report-note{align-items:flex-start;flex-direction:column;gap:3px}.saved-game-report-strip{grid-template-columns:1fr}.export-center-grid{grid-template-columns:1fr}.export-center-grid button{min-height:64px!important}}
@media print{body.printing-game-report{background:#fff!important;color:#111!important}body.printing-game-report #app,body.printing-game-report>.modal,body.printing-game-report>.mobile-action-bar{display:none!important}body.printing-game-report #printReport{display:block!important;background:#fff!important;color:#111!important;padding:18px;font-family:Arial,sans-serif}#printReport .print-game-report header{text-align:center;border-bottom:2px solid #111;padding-bottom:10px;margin-bottom:14px}#printReport h1{font-size:28px;margin:3px 0}#printReport h2{font-size:13px;margin:12px 0 6px;text-transform:uppercase;letter-spacing:.06em}#printReport p,#printReport small{font-size:9px}#printReport .print-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}#printReport table{width:100%;border-collapse:collapse;min-width:0!important}#printReport th,#printReport td{border:1px solid #bbb;padding:4px;font-size:7px;text-align:center;position:static!important;background:#fff!important;color:#111!important}#printReport th:first-child,#printReport td:first-child{text-align:left}#printReport .postgame-linescore-scroll{overflow:visible;padding:0}#printReport .postgame-linescore{min-width:0}#printReport .print-decisions{font-size:9px;padding:8px;border:1px solid #bbb;margin-top:10px}@page{size:landscape;margin:10mm}}


/* ==========================================================
   v85 SCOREBOOK LIBRARY + SEASON STATISTICS
   ========================================================== */
.scorebook-library-page{display:grid;gap:10px;padding-bottom:22px}.library-controls{display:grid;grid-template-columns:minmax(150px,1fr) minmax(220px,1.5fr) auto;gap:8px;padding:10px;align-items:end}.library-controls label{display:grid;gap:4px}.library-controls label>span{font-size:6.5px;color:var(--muted);font-weight:900;letter-spacing:.08em;text-transform:uppercase}.library-controls select{height:42px;min-width:0;width:100%;padding:0 9px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);font:inherit;font-size:9px;font-weight:850}.library-controls button{height:42px;padding:0 13px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--accent) 9%,var(--panel2));color:var(--accent);font-size:12px;font-weight:950;white-space:nowrap}.library-controls button span{font-size:8px;color:var(--text);margin-left:4px}.library-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:5px;border:1px solid var(--line);border-radius:13px;background:color-mix(in srgb,var(--panel) 94%,transparent);position:sticky;top:52px;z-index:5;backdrop-filter:blur(12px)}.library-tabs button{min-height:45px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;font-weight:900}.library-tabs button b{font-size:8px}.library-tabs button.active{border-color:color-mix(in srgb,var(--accent) 48%,var(--line));background:color-mix(in srgb,var(--accent) 11%,var(--panel2));color:var(--accent)}.library-content{display:grid;gap:10px}.library-game-filters{display:flex;gap:6px;overflow-x:auto;padding:1px 1px 3px;-webkit-overflow-scrolling:touch}.library-game-filters button{flex:0 0 auto;min-height:34px;padding:0 11px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--muted);font-size:7px;font-weight:900}.library-game-filters button.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 11%,var(--panel));color:var(--accent)}.saved-collectible-row{display:flex;align-items:center;gap:6px;padding:6px 9px;border-top:1px solid color-mix(in srgb,var(--line) 74%,transparent);border-bottom:1px solid color-mix(in srgb,var(--line) 74%,transparent);background:color-mix(in srgb,var(--panel2) 70%,transparent)}.saved-collectible-row>span{min-width:0;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:6.5px;font-weight:800}.saved-collectible-row button{min-height:28px;padding:0 7px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);font-size:9px;font-weight:950}.saved-collectible-row button b{font-size:6px}.saved-collectible-row button.active{border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:color-mix(in srgb,var(--accent) 12%,var(--panel));color:var(--accent)}.season-overview{display:grid;gap:10px}.season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;padding:16px;overflow:hidden;position:relative}.season-hero:after{content:"";position:absolute;width:180px;height:180px;right:-70px;bottom:-110px;border-radius:50%;background:var(--accent);opacity:.06;filter:blur(12px)}.season-team{display:flex;align-items:center;gap:12px;min-width:0}.season-team img{width:68px;height:68px;object-fit:contain}.season-team span{display:grid;gap:2px;min-width:0}.season-team small{font-size:7px;color:var(--accent);font-weight:950;letter-spacing:.12em}.season-team strong{font-size:20px;line-height:1.05}.season-team em{font-size:7px;color:var(--muted);font-style:normal;font-weight:800}.season-record{display:grid;justify-items:end;gap:2px;position:relative;z-index:1}.season-record small{font-size:6px;color:var(--muted);font-weight:900}.season-record strong{font-size:34px;line-height:1;color:var(--accent)}.season-record span{font-size:7px;color:var(--muted);font-weight:850}.season-kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.season-kpis span{display:grid;justify-items:center;gap:2px;padding:11px 5px;border:1px solid var(--line);border-radius:11px;background:var(--panel)}.season-kpis b{font-size:16px;color:var(--accent)}.season-kpis small{font-size:6px;color:var(--muted);font-weight:850}.season-collection-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:10px}.season-collection-grid>section{padding:11px}.season-collection-grid>section>small{display:block;margin-bottom:8px;font-size:6.5px;color:var(--accent);font-weight:950;letter-spacing:.1em}.season-collection-grid>section:first-child>div{display:grid;grid-template-columns:1fr 1fr;gap:7px}.season-collection-grid>section:first-child span{display:grid;padding:8px;border-radius:9px;background:var(--panel2)}.season-collection-grid span b{font-size:15px}.season-collection-grid span em{font-size:6px;color:var(--muted);font-style:normal;font-weight:800}.season-recent div{display:grid;grid-template-columns:24px 42px 44px 1fr;align-items:center;gap:5px;padding:5px 0;border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}.season-recent div:last-child{border-bottom:0}.season-recent div>b{width:22px;height:22px;display:grid;place-items:center;border-radius:6px;background:var(--panel2);font-size:7px}.season-recent div>b.w{color:#5ccf87}.season-recent div>b.l{color:#e06a6a}.season-recent div>b.t{color:var(--muted)}.season-recent div span{font-size:8px;font-weight:900}.season-recent div strong{font-size:9px}.season-recent div em{justify-self:end;font-size:6.5px;color:var(--muted);font-style:normal}.season-source-note{margin:0;padding:0 4px;color:var(--muted);font-size:7px;line-height:1.45}.season-stat-section{display:grid;gap:9px}.season-stat-section>header{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;padding:2px}.season-stat-section>header small{font-size:7px;color:var(--accent);font-weight:950;letter-spacing:.1em}.season-stat-section>header h3{margin:2px 0 0;font-size:19px}.season-stat-section>header>span{font-size:7px;color:var(--muted);font-weight:800}.season-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.season-table{width:100%;min-width:980px;border-collapse:collapse}.season-table.pitching{min-width:780px}.season-table th,.season-table td{padding:7px 6px;border-right:1px solid color-mix(in srgb,var(--line) 76%,transparent);border-bottom:1px solid color-mix(in srgb,var(--line) 76%,transparent);font-size:7px;text-align:center;white-space:nowrap}.season-table th{background:var(--panel2);color:var(--muted);font-size:6.5px}.season-table td:first-child,.season-table th:first-child{position:sticky;left:0;z-index:2;min-width:150px;text-align:left;background:var(--panel)}.season-table th:first-child{background:var(--panel2)}.season-table td small{font-size:6px;color:var(--accent)}.season-player-cards,.season-pitch-cards{display:none}.library-empty{display:grid;justify-items:center;text-align:center;padding:34px 20px}.library-empty>span{font-size:26px;color:var(--accent)}.library-empty strong{margin-top:7px;font-size:13px}.library-empty p{max-width:430px;margin:6px 0 0;color:var(--muted);font-size:8px;line-height:1.5}
body.theme-wrigley .library-tabs,body.theme-wrigley .library-controls,body.theme-wrigley .season-hero,body.theme-wrigley .season-kpis span,body.theme-wrigley .season-collection-grid>section,body.theme-wrigley .season-table-scroll{border-color:color-mix(in srgb,var(--wrigley-gold) 34%,#3b5542)!important}
@media(max-width:700px){.scorebook-library-page{gap:8px}.library-controls{grid-template-columns:1fr 1.35fr;gap:6px;padding:8px}.library-controls button{grid-column:1/-1;height:36px}.library-tabs{top:48px;gap:3px;padding:4px}.library-tabs button{min-height:40px;gap:4px}.library-tabs button b{font-size:6.6px}.saved-collectible-row>span{font-size:5.8px}.saved-collectible-row button{padding:0 6px}.saved-collectible-row button b{font-size:5.5px}.season-hero{grid-template-columns:1fr;padding:12px}.season-team img{width:54px;height:54px}.season-team strong{font-size:16px}.season-record{justify-items:start;padding-top:9px;border-top:1px solid var(--line)}.season-record strong{font-size:28px}.season-kpis{grid-template-columns:repeat(3,1fr);gap:5px}.season-kpis span{padding:8px 3px}.season-kpis b{font-size:13px}.season-collection-grid{grid-template-columns:1fr}.season-table-scroll{display:none}.season-player-cards,.season-pitch-cards{display:grid;gap:7px}.season-player-cards details,.season-pitch-cards article{border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}.season-player-cards summary{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px;list-style:none}.season-player-cards summary::-webkit-details-marker{display:none}.season-player-cards summary>span{display:grid;gap:2px;min-width:0}.season-player-cards summary strong{font-size:9px}.season-player-cards summary span small{font-size:6.5px;color:var(--muted)}.season-player-cards summary>b{display:grid;justify-items:end;font-size:14px;color:var(--accent)}.season-player-cards summary>b small{font-size:5.5px;color:var(--muted)}.season-player-cards details>div,.season-pitch-cards article>div{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:8px;border-top:1px solid var(--line)}.season-player-cards details>div span,.season-pitch-cards article>div span{display:grid;justify-items:center;padding:6px 2px;border-radius:7px;background:var(--panel2)}.season-player-cards details>div b,.season-pitch-cards article>div b{font-size:10px}.season-player-cards details>div small,.season-pitch-cards article>div small{font-size:5px;color:var(--muted)}.season-pitch-cards article{padding:10px}.season-pitch-cards article>strong{font-size:9px}.season-pitch-cards article>small{display:block;margin-top:2px;font-size:6.5px;color:var(--muted)}.season-pitch-cards article>div{margin:8px -10px -10px}.season-stat-section>header h3{font-size:16px}}
