/* Shared layout contract: scoreboard left, Menu / runners right, controls below. */
#practice,#pitching{--hud-edge:max(10px,env(safe-area-inset-left));--hud-top:calc(10px + env(safe-area-inset-top));--score-width:min(248px,calc(100% - 130px));--hud-ink:#f1eedb;--hud-muted:#bfd0c2}
#practice .scoreboard,#pitching .scoreboard{left:var(--hud-edge);top:var(--hud-top);width:var(--score-width);grid-template-columns:28px minmax(0,1fr);background:#10282ef2;border:1px solid #78927c80;border-radius:3px;box-shadow:3px 3px 0 #09202866;font-family:monospace}
.scoreboard .score-team{padding:5px 9px;gap:2px;border-color:#66807440}.scoreboard .score-team>b{font:700 11px/1.2 Arial;letter-spacing:.04em}.scoreboard .score-team>strong{font:700 21px/1 monospace}.scoreboard .score-team>small{font:10px/1.35 Arial;color:var(--hud-muted)}.scoreboard .scoreboard-inning{font:700 11px monospace;background:#d2dfaf}.scoreboard .scoreboard-count{font:700 10px/1.3 monospace;text-align:left;padding:6px 9px;letter-spacing:.6px;color:#dce7cd}.practice-scoreboard .scoreboard-count{padding-left:37px}
#practice .scoreboard .pitcher-energy,#pitching .scoreboard .pitcher-energy{position:static;grid-column:1/-1;display:flex;align-items:center;gap:8px;width:auto;margin:0;padding:6px 9px;border:0;border-top:1px solid #66807440;border-radius:0;background:none;box-shadow:none;font:8px monospace;letter-spacing:.5px}.scoreboard .pitcher-energy>span{flex:none}.scoreboard .pitcher-energy>b{font:9px monospace}.scoreboard .pitcher-energy meter{flex:1;min-width:0}.scoreboard .pitcher-energy[hidden]{display:none!important}#practice .scoreboard .pitcher-energy meter,#pitching .scoreboard .pitcher-energy meter{height:4px;width:auto;border-radius:0}.scoreboard .pitcher-energy meter::-webkit-meter-bar{height:4px}
#practice .match-hud,#practice .hud,#pitching .pitch-hud{position:absolute;inset:var(--hud-top) max(10px,env(safe-area-inset-right)) auto auto;width:104px;padding:0;background:none;display:block;pointer-events:none;z-index:5}.match-hud>div:first-child,.hud .topbar{display:flex;justify-content:flex-end;gap:6px}.match-hud>div:first-child>a{display:none!important}#practice .match-hud>div:first-child>button,#practice .tools button,#pitching #menu{min-height:44px;min-width:68px;padding:10px 14px;background:#132e36ed;border:1px solid #78927c80;border-radius:3px;font:700 12px Arial;color:#eef0d8;pointer-events:auto;box-shadow:2px 2px 0 #0b232c66}
#practice .diamond-bases,#pitching .diamond-bases{right:max(8px,env(safe-area-inset-right));top:calc(var(--hud-top) + 55px);width:104px;height:102px}.diamond-bases .steal-hint{font-size:8px;background:#153139e6;border-radius:2px}.steal-choice{border-radius:3px}.diamond-bases[hidden]{display:none!important}
#practice[data-mode=h2h] #duel-turn{position:fixed;top:calc(var(--hud-top) + 145px);left:var(--hud-edge);right:auto;max-width:calc(100vw - 145px);padding:6px 9px;background:#10282eef;border:1px solid #69867466;border-radius:3px;font:700 11px/1.3 monospace;color:#dbe8c2;white-space:nowrap}#duel-turn[data-urgent=true]{color:#ffd59b!important;border-color:#d99b68!important}#duel-turn:empty{display:none}
#practice[data-mode=h2h] .match-hud>div:last-child{position:fixed;top:calc(var(--hud-top) + 205px);bottom:auto;left:var(--hud-edge);right:auto;display:flex;gap:8px}#practice[data-mode=h2h] #duel-retry{min-height:44px;padding:10px 14px;font:700 12px Arial;background:#e1d297;color:#182f31;border-radius:3px}
#practice .match-hud #sync-state,#practice[data-mode=h2h] #duel-sync{position:fixed;top:calc(var(--hud-top) + 175px);left:var(--hud-edge);right:var(--hud-edge);max-width:420px;padding:8px 10px;border:1px solid #b38366;background:#3b3029f5;border-radius:3px;font:12px/1.4 Arial;color:#ffe5bd;opacity:1;pointer-events:none}#duel-sync:empty,#sync-state[hidden]{display:none!important}#practice .match-hud:has(#sync-state:not([hidden]))>div:last-child{position:fixed;left:var(--hud-edge);top:calc(var(--hud-top) + 225px);display:flex;gap:8px}#practice #sync-retry,#practice #sync-reload{min-height:44px;font-size:12px;padding:9px 12px}
#practice[data-phase] .feedback,#pitching #pitch-feedback{top:calc(var(--hud-top) + 178px);left:16px;right:16px;width:fit-content;max-width:min(360px,calc(100% - 80px));padding:8px 12px;border:0;border-radius:3px;background:#10282ee6;gap:4px;box-shadow:none}#practice[data-mode=h2h] .feedback{top:calc(var(--hud-top) + 185px)}#practice .feedback #match-call,#practice .feedback #duel-call,#practice .feedback #result{font:700 15px/1.3 Arial}#practice .feedback #match-detail,#practice .feedback #detail{font:10px/1.35 Arial}.feedback #duel-detail{font:11px/1.4 Arial;max-width:260px}
#practice:has(#duel-sync:not(:empty)) .feedback,#practice:has(#sync-state:not([hidden])) .feedback{visibility:hidden}
#pitching .pitch-controls,#practice .pitch-controls,#practice .batting-dock{left:0;right:0;bottom:0;width:auto;padding:10px 14px calc(env(safe-area-inset-bottom) + 12px);gap:7px;background:linear-gradient(transparent,#0d252d88);align-items:center}#practice .pitch-controls #arsenal,#pitching .pitch-controls #arsenal{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(67px,1fr);width:100%;max-width:460px;padding:3px 2px 5px;gap:5px;margin:0;overflow-x:auto;touch-action:pan-x}
#practice #arsenal .pitch-card,#pitching #arsenal .pitch-card{min-width:67px;min-height:54px;grid-template-columns:1fr;grid-template-rows:auto auto;gap:4px;padding:8px 6px;background:#142e36ed;border:1px solid #66817488;border-bottom:2px solid #3e5f53;border-radius:3px;box-shadow:none;transform:none}#practice #arsenal .pitch-card svg,#pitching #arsenal .pitch-card svg,#arsenal .pitch-card small{display:none}#arsenal .pitch-card strong{font:700 10px Arial}#arsenal .pitch-card span{font:10px monospace}#practice #arsenal .pitch-card[aria-pressed=true],#pitching #arsenal .pitch-card[aria-pressed=true]{background:#2d4641;border-color:var(--pitch-color);box-shadow:inset 0 -2px var(--pitch-color);transform:none}
#practice .aim-wrap,#pitching .aim-wrap{width:90px;height:90px}#practice #aim-control,#pitching #aim-control{width:78px;height:78px;border-radius:20px;border:1px solid #aac4a5;background:#25483edd;box-shadow:0 3px 0 #102932,inset 0 1px #d2e6bd44}#practice #aim-control:before,#pitching #aim-control:before{border-radius:15px}#practice #aim-control:after,#pitching #aim-control:after{display:none}#practice #aim-control[data-held=true],#pitching #aim-control[data-held=true]{background:#416453;transform:translateY(2px);box-shadow:0 1px #102932}#practice #control-label,#pitching #control-label{font:700 10px monospace}#instruction,#control-hint{font:10px/1.4 Arial!important;min-height:14px;margin:0!important;max-width:300px;text-align:center;color:#d0dcc6}#instruction:empty{display:none}
#practice #accuracy,#pitching #accuracy{top:auto;bottom:calc(env(safe-area-inset-bottom) + 65px);right:max(19px,env(safe-area-inset-right));width:14px;height:98px;border:1px solid #94aea0;border-radius:3px;background:#19343b;box-shadow:0 2px 6px #0b222d55;z-index:4}#practice #release-line,#pitching #release-line{width:24px;left:-6px;height:2px;box-shadow:0 0 2px #10252b}#accuracy:before{font:7px monospace;top:-18px;background:#173139;padding:3px;border-radius:2px}#release-line:before{display:none}
#practice .hr-celebration,#pitching .hr-celebration{top:calc(var(--hud-top) + 180px);border-radius:4px}.next-play{bottom:calc(env(safe-area-inset-bottom) + 130px);border-radius:3px}.trot-skip{border-radius:3px}.game-menu{border-radius:4px!important;border:1px solid #7d967e!important;box-shadow:6px 6px 0 #091d25aa!important;background:#17313a!important;color:#eeeeda!important;padding:20px!important;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 28px)!important;overflow:auto!important}.game-menu .dialog-top{gap:12px}.game-menu .dialog-top h1,#match-menu h1{font:700 23px/1.2 Arial!important;letter-spacing:-.5px!important;text-transform:none!important}.game-menu .dialog-top button{flex:none;min-height:44px}.game-menu p{font:13px/1.6 Arial;color:#bcd0bd}.game-menu .game-menu-group,.game-menu>details{padding:8px 0;border-top:1px solid #486658;margin-top:14px}.game-menu summary{min-height:44px;padding:12px 0;font:700 13px Arial;color:#d6e5b3;cursor:pointer}.game-menu button,.game-menu a.exit,.game-menu-actions a{min-height:44px;border-radius:3px;font:700 12px Arial}.game-menu-actions{display:grid;gap:12px;margin-top:18px}.game-menu-actions a{padding:13px;border:1px solid #71896f;text-align:center}.game-menu .menu-danger{background:#503934;color:#f4d4c2;border-color:#936e5c}.online-note{border-left:3px solid #d6bf7d;padding:8px 12px;background:#233d39}.session-stats{display:grid!important;grid-template-columns:1fr 1fr;gap:14px;padding:12px 0;text-shadow:none!important}.session-stats span{display:grid!important;font:11px monospace;color:#bfd0c2}.session-stats strong{font:700 23px monospace;color:#eef0d8;margin:4px 0 0!important}
@media(orientation:landscape){#practice,#pitching{--score-width:200px}#practice .diamond-bases,#pitching .diamond-bases{top:var(--hud-top);right:104px}#practice[data-mode=h2h] #duel-turn{top:calc(var(--hud-top) + 146px);max-width:205px}#practice[data-phase] .feedback,#pitching #pitch-feedback,#practice[data-mode=h2h] .feedback{top:var(--hud-top);left:222px;right:222px;max-width:calc(100% - 444px);margin:auto}#practice .pitch-controls,#pitching .pitch-controls,#practice .batting-dock{left:auto;right:70px;width:225px;padding:8px 0 calc(env(safe-area-inset-bottom) + 10px);background:none;gap:4px}#practice #arsenal .pitch-card,#pitching #arsenal .pitch-card{min-height:48px;padding:5px}#practice .pitch-controls #arsenal,#pitching .pitch-controls #arsenal{grid-auto-columns:68px}#practice #accuracy,#pitching #accuracy{right:26px;bottom:46px;height:90px}#practice .aim-wrap,#pitching .aim-wrap{width:76px;height:76px}#practice #aim-control,#pitching #aim-control{width:66px;height:66px}.next-play{bottom:22px;left:40%}#practice .hr-celebration,#pitching .hr-celebration{top:100px;width:300px}#practice .match-hud #sync-state,#practice[data-mode=h2h] #duel-sync{right:auto;width:200px;max-width:200px;font-size:11px}#practice[data-mode=h2h] .match-hud>div:last-child{top:calc(var(--hud-top) + 235px)}.game-menu{max-width:540px}}
@media(max-width:350px) and (orientation:portrait){#practice,#pitching{--score-width:calc(100% - 119px)}.scoreboard .score-team>b{font-size:10px}.scoreboard .score-team>small{font-size:9px}#practice .diamond-bases,#pitching .diamond-bases{right:4px}#practice[data-mode=h2h] #duel-turn{font-size:10px;max-width:200px}#practice #arsenal .pitch-card,#pitching #arsenal .pitch-card{min-width:64px}#practice #accuracy,#pitching #accuracy{right:15px}}
@media(prefers-reduced-motion:reduce){#practice *,#pitching *{scroll-behavior:auto!important}}
#practice .hud-recovery{position:absolute;top:calc(var(--hud-top) + 178px);left:var(--hud-edge);right:var(--hud-edge);max-width:390px;z-index:9;display:grid;gap:8px;pointer-events:none}#practice .hud-recovery #duel-sync,#practice .hud-recovery #sync-state{position:static!important;inset:auto!important;width:auto;max-width:none;margin:0;font:12px/1.45 Arial;padding:10px;border:1px solid #b38366;border-radius:3px;background:#3b3029f5;color:#ffe5bd;opacity:1}#practice .hud-recovery>div{position:static!important;display:flex;gap:8px;pointer-events:auto}#practice .hud-recovery button{min-height:44px;padding:10px 14px;font:700 12px Arial;border-radius:3px;pointer-events:auto}#practice .hud-recovery:has(#duel-sync:empty):not(:has(#duel-retry:not([hidden]))),#practice .hud-recovery:has(#sync-state[hidden]):not(:has(#sync-retry:not([hidden]))){display:none}.menu-connection:empty{display:none}.menu-connection:not(:empty){padding:10px;border:1px solid #b38366;color:#ffe5bd;background:#3b3029}
@media(orientation:landscape){#practice .hud-recovery{max-width:210px;top:calc(var(--hud-top) + 178px)}}
#practice[data-phase=aim] .feedback,#pitching[data-phase=aim] #pitch-feedback{visibility:hidden}
#pitching .pitch-hud{display:flex;justify-content:flex-end}
#practice #accuracy,#pitching #accuracy{bottom:calc(env(safe-area-inset-bottom) + 29px);height:82px}
#practice[data-mode=h2h] .scoreboard #duel-turn{position:static;grid-column:1/-1;inset:auto;max-width:none;margin:0;padding:7px 9px;border:0;border-top:1px solid #66807440;border-radius:0;background:#203a35;font:700 10px/1.3 monospace;white-space:normal}
@media(orientation:landscape){#practice #accuracy,#pitching #accuracy{bottom:46px;height:90px}}
.game-menu .session-stats{position:static;inset:auto;transform:none;margin:0;max-width:none}
