/* Final authority for layout. The board never stretches or crops its coordinate space. */
html,body{width:100%;overflow-x:clip}
.app{min-width:0;width:100%;max-width:1920px;min-height:100dvh}
.game-shell,body[data-phase="foresight"] .game-shell{height:auto;min-height:0;max-height:none;grid-template-columns:minmax(0,1fr) 320px;align-items:start}
.arena-wrap{width:100%;aspect-ratio:16/9;min-height:0;align-self:start;overflow:hidden}
.arena-wrap canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.arena-wrap .pixi-arena{pointer-events:none;width:100%!important;height:100%!important}.arena-wrap .pixi-input{opacity:0}
.side-panel{height:100%;max-height:calc((min(100vw,1920px) - 320px)*.5625);min-width:0;overflow-y:auto}
.economy{position:static;flex-shrink:0;background:#102029;margin-top:16px;padding:12px 0}
.side-panel .inspector{flex:0 0 auto}
.timeline-row{position:relative}
.topbar{height:auto;min-height:64px;gap:16px;flex-wrap:wrap;padding:12px 24px}
.planning{height:auto;min-height:190px;overflow:hidden}.timeline{min-width:0}
.footer{height:auto;min-height:64px;flex-wrap:wrap;gap:12px;padding:14px 24px}
.footer .logline{min-width:0;flex:1}.footer .actions{flex-shrink:0}
.inspector .hero-stage{height:100px}.inspector .hero-stage canvas{height:112px!important}
.attribute-sheet{gap:6px;grid-template-columns:repeat(3,minmax(0,1fr))}
.stat-menu{margin:14px 0}.stat-menu summary{cursor:pointer;font-size:11px;letter-spacing:1px;color:#dcc693;padding:10px 0;border-bottom:1px solid #c9b98d25;list-style:none}.stat-menu summary:after{content:'＋';float:right}.stat-menu[open] summary:after{content:'−'}
.attribute{border:1px solid #c9b98d25;border-radius:7px;padding:9px 7px;min-height:67px;background:linear-gradient(135deg,#26383a66,#112028);transition:background .15s,border-color .15s}
.attribute:hover,.attribute:focus-visible{border-color:#dfc58f;background:#324843;outline:none}
.attribute:disabled{opacity:.5;cursor:default}.attribute span{font-size:10px;min-height:22px}.attribute small{font-size:9px;color:#e0c693}.attribute em{width:5px;height:5px;margin-right:2px}
.stat-dialog{position:fixed;inset:0;z-index:1100;display:grid;place-items:center;background:#071016dd;backdrop-filter:blur(8px);padding:20px}
.stat-dialog section{width:min(460px,100%);max-height:90dvh;overflow:auto;background:linear-gradient(145deg,#23383c,#0c1821);border:1px solid #cfb57966;border-radius:16px;padding:28px;box-shadow:0 30px 100px #0009}
.stat-dialog h2{font:28px Georgia;margin:10px 0}.stat-dialog p{color:#aec5c1;font-size:14px;line-height:1.6}.stat-preview{display:flex;align-items:center;gap:18px;font:38px Georgia;color:#dfc58f;margin:20px 0}.stat-preview span{font:14px 'Segoe UI';color:#9caaa9}
.stat-impact{display:grid;gap:8px;margin:18px 0}.stat-impact div{display:flex;justify-content:space-between;border-bottom:1px solid #cbb98622;padding:8px 0;font-size:13px}.stat-impact b{color:#9cdec4}.stat-dialog .stat-actions{display:flex;gap:10px;margin-top:24px}.stat-dialog button{min-height:44px}.stat-dialog .primary-button{flex:1}.stat-wallet{font-size:12px;color:#cfbd94}
.match-overlay{overflow:auto;padding:74px 16px 24px}.draft-dialog,.training-dialog{width:min(1000px,100%);padding:24px}.training-dice{max-height:42dvh;overflow:auto;padding:18px 4px}.dojo-stage{max-height:36dvh;object-fit:contain}.skip-presentation{top:16px;right:16px}
.vision-overlay{padding:0;overflow:hidden}.vision-overlay canvas{width:100%;height:100%;object-fit:contain}.vision-caption{bottom:22px}.vision-caption b{font-size:24px}
.vision-time{display:block;color:#9bb8df;font-size:12px;margin-top:10px}
@media(min-width:1100px) and (max-height:820px){.game-shell{grid-template-columns:minmax(0,1fr) 300px}.side-panel{max-height:calc((100vw - 300px)*.5625);overflow-y:auto}.hero-stage{display:none}.planning{min-height:175px}}
@media(min-width:1001px){.arena-wrap{width:min(100%,calc((100dvh - 340px)*16/9));justify-self:center}.side-panel{max-height:min(calc((min(100vw,1920px) - 320px)*.5625),calc(100dvh - 340px))}}
@media(max-width:1000px){.game-shell,body[data-phase="foresight"] .game-shell{grid-template-columns:1fr}.side-panel{display:grid;grid-template-columns:160px minmax(0,1fr);gap:10px;padding:16px;max-height:none;overflow:visible}.side-head{grid-column:1}.squad{grid-column:1}.inspector{grid-column:2;grid-row:1/span 3}.economy{grid-column:1;align-self:end}.hero-stage{display:none}.hero-head h2{font-size:20px}.attribute-sheet{grid-template-columns:repeat(3,1fr)}.topbar{padding:10px 16px}.players{gap:8px}.planning{padding:16px}.planning-help{display:none}.draft-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.draft-pick canvas{height:110px}.match-overlay h1{font-size:26px}}
@media(max-width:600px){.brand strong{font-size:16px}.brand small{font-size:6px}.crest{font-size:24px}.match-state{order:3;width:100%;justify-content:center}.players{margin-left:auto;gap:6px}.players .ghost-button{padding:7px;font-size:8px}.players a{display:none}.player-life span{font-size:7px}.player-life b{font-size:22px}.topbar{gap:8px}.side-panel{display:block;padding:14px}.side-head{display:none}.squad{display:flex;gap:8px;margin-bottom:12px}.squad-slot{width:50px}.hero-head{display:grid;grid-template-columns:1fr auto}.hero-head .kicker,.hero-head p,.attribute-sheet,.derived-stats{grid-column:1/-1}.attribute{min-height:68px}.attribute span{font-size:11px}.attribute small{font-size:10px}.skills{justify-content:center;margin-top:12px}.economy{margin-top:14px}.planning h1{font-size:16px}.planning .kicker{font-size:7px}.timeline{overflow-x:auto}.timeline .timeline-row,.timeline .plan-tabs,.timeline .destiny-track{min-width:560px}.footer{padding:12px 14px}.footer .logline{display:none}.footer .secondary-button{font-size:9px}.footer .primary-button{padding:12px 16px;font-size:10px}.deployment-controls{left:8px;top:8px;gap:6px;font-size:8px}.deployment-controls button{padding:5px;font-size:8px}.fog-curtain{top:4px!important;right:2%!important;width:45%!important}.fog-curtain span{font-size:6px;letter-spacing:0;padding:5px 7px}.draft-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.draft-dialog{padding:16px}.draft-pick canvas{height:100px}.draft-grid{margin:16px 0}.match-overlay h1{font-size:23px}.d10{width:35px;height:40px;font-size:15px}.training-award b{font-size:44px}.vision-caption span{font-size:11px}.vision-caption b{font-size:18px}}
