:root{color-scheme:light;--cream:#fff1ce;--ink:#372a20;--teal:#299f96;--coral:#ed7557;--shadow:#412919;--gold:#f6c457}*{box-sizing:border-box}body{margin:0;background:#342c22;color:var(--cream);font:600 14px 'Trebuchet MS','Segoe UI',sans-serif}main{position:relative;max-width:1680px;margin:auto;height:100svh;min-height:650px;overflow:hidden;background:#bda579}button,select,summary{font:800 13px 'Trebuchet MS','Segoe UI',sans-serif}button,select{min-height:44px;border:2px solid var(--cream);border-radius:13px;padding:8px 14px;color:var(--cream);background:#624b36;cursor:pointer;box-shadow:0 3px 0 #392b2090}button:hover,select:hover{filter:brightness(1.1)}button:active{filter:brightness(.91)}button:disabled{cursor:default;filter:saturate(.55);opacity:.58}button:focus-visible,select:focus-visible,summary:focus-visible,input:focus-visible,#meter-arc:focus-visible{outline:3px solid #ffc946;outline-offset:4px}button.primary{color:#332b22;background:linear-gradient(#ffda76,#efb53f);border:3px solid #fff0c6;box-shadow:inset 0 3px 0 #ffe8a0,0 5px 0 #98602c,0 7px 12px #452c2840;font-weight:900}.sr-only,#counts-0,#counts-1{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}[hidden]{display:none!important}
/* The scene is the screen; HUD clusters float around its edges. */
#play-area{position:absolute;inset:0}#stage{position:absolute;inset:0;overflow:hidden;background:#cdb282}#viewport{width:100%;height:100%}canvas{display:block;width:100%;height:100%;touch-action:none}#stage:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(#1d29182b,transparent 22%,transparent 66%,#38230e45)}#readout,#stage-note,#opponent-grip{display:none!important}#swing-guide{height:100%!important}#hand-hint{position:absolute;pointer-events:none;transform:translate(-50%,-150%);padding:8px 12px;border:2px solid var(--cream);border-radius:12px;background:#247d70;color:var(--cream);font-weight:900;white-space:nowrap;z-index:2}.mark-label{position:absolute;pointer-events:none;transform:translate(-50%,0);font-weight:900;font-size:11px;color:#176d5e;background:#fff0ccc9;padding:2px 5px;border-radius:5px;z-index:2}.mark-label.p2{color:#a84020}#error{position:absolute;inset:20%;padding:22px;background:#633a27;color:var(--cream);z-index:35}#result{position:absolute;top:23%;left:50%;transform:translateX(-50%) rotate(-3deg);text-align:center;pointer-events:none;z-index:5;min-width:220px;color:#fff3ce;text-shadow:0 3px 0 #4c301e,2px 0 #4c301e,-2px 0 #4c301e;filter:drop-shadow(0 3px 6px #452b2350)}#result-title{display:block;font-size:clamp(36px,4.8vw,62px);font-weight:1000;line-height:1.1;letter-spacing:1px}#result-detail{display:inline-block;margin-top:5px;padding:6px 13px;border-radius:20px;background:#205b4fe8;font-size:13px;text-shadow:none}#result[data-kind=miss] #result-detail{background:#764a32ef}
header{position:absolute;inset:0;z-index:11;pointer-events:none}.wordmark{position:absolute;top:18px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;filter:drop-shadow(0 4px 2px #4d2e2880)}h1{display:flex;margin:0;font-family:'Arial Black','Trebuchet MS',sans-serif;font-size:clamp(36px,4.3vw,67px);font-weight:1000;line-height:1;color:#fff1ca;letter-spacing:1px;-webkit-text-stroke:1px #4f351f;text-shadow:0 5px #673f26}h1 span{display:inline-block}h1 span:nth-child(1){transform:rotate(-12deg) translateY(6px)}h1 span:nth-child(2){transform:rotate(-7deg) translateY(1px)}h1 span:nth-child(7){transform:rotate(7deg) translateY(1px)}h1 span:nth-child(8){transform:rotate(12deg) translateY(6px)}.ribbon{width:46px;height:28px;margin-top:8px;border:2px solid #ffe5aa;border-radius:2px;box-shadow:0 3px #654127;transform:rotate(-4deg)}.header-tools{position:absolute;bottom:25px;left:24px;pointer-events:auto;display:flex;flex-direction:column;gap:9px;align-items:stretch}#swing-mode{width:155px;background:#5d4a33e8}#mode-bar label{display:none}.quick-controls{display:flex;gap:8px}.quick-controls button{font-size:11px;padding:7px 9px;min-width:60px;background:#55452ee8}#reset{max-width:87px}
#scoreboard{position:absolute;top:27px;left:22px;right:22px;z-index:12;pointer-events:none}.players{display:grid;grid-template-columns:1fr 1fr;gap:38%}.player{position:relative;display:grid;grid-template-columns:74px 1fr;grid-template-rows:24px 34px;min-width:0;align-items:center;column-gap:0;filter:drop-shadow(0 3px 3px #3d291c70)}.player-token{grid-column:1;grid-row:1/3;position:relative;z-index:2;width:80px;height:80px;border-radius:50%;border:4px solid #fff0cc;overflow:hidden;background:#238c81;box-shadow:0 0 0 2px #836842}.player-token svg{display:block;width:100%;height:100%}.player b{grid-column:2;grid-row:1;font-size:17px;font-weight:1000;letter-spacing:.8px;padding-left:14px;text-shadow:0 2px #4b351e}.hud-health{grid-column:2;grid-row:2;height:34px;border:4px solid #fff1cf;border-left:0;border-radius:0 11px 11px 0;background:#322e27;overflow:hidden;box-shadow:0 2px #887048}.hud-health>div{height:100%;width:100%;background:linear-gradient(#4dbbb0,#239e95);transition:width .25s}.player strong{position:absolute;right:10px;bottom:2px;height:28px;display:flex;align-items:center;font-size:23px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;text-shadow:0 2px #506043;z-index:3}.player.active .player-token{box-shadow:0 0 0 3px #efc259,0 0 18px #fff0a740}#player-1{grid-template-columns:1fr 74px}#player-1 .player-token{grid-column:2;justify-self:end;background:#d86548}#player-1 b{grid-column:1;text-align:right;padding-right:14px;padding-left:0}#player-1 .hud-health{grid-column:1;border:4px solid #fff1cf;border-right:0;border-radius:11px 0 0 11px;direction:rtl}#hud-health-1{background:linear-gradient(#fb926c,#e4654c)}#player-1 strong{right:84px}.match-top{position:absolute;left:32%;right:32%;top:108px;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;text-shadow:0 2px 3px #4a341b}#game-label{font-size:11px;letter-spacing:2px;text-transform:uppercase;color:#ffedbc}#turn-label{font-size:14px}#game-clock{display:none}
#meter-panel{position:absolute;z-index:12;left:50%;bottom:26px;transform:translateX(-50%);width:min(610px,55%);display:grid;grid-template-columns:minmax(0,1fr) 175px;gap:18px;align-items:center;padding:0;background:none;border:0}#meter-arc{display:block;width:100%;height:155px;overflow:visible;cursor:pointer;touch-action:manipulation;filter:drop-shadow(0 2px 1px #4a341750)}#meter-arc text{fill:#fff1ce;font-family:'Trebuchet MS',sans-serif;font-weight:900;paint-order:stroke;stroke:#67462d;stroke-width:1px;stroke-linejoin:round}#meter-action{width:100%;height:68px;min-height:68px;padding:8px;border-radius:29px;font-size:25px;font-weight:1000;letter-spacing:.3px;white-space:nowrap}#meter-panel>div{position:relative;padding:0}#meter-status{position:absolute;left:calc(-100% - 225px);right:0;top:-76px;height:34px;text-align:center;margin:0;font-size:13px;text-shadow:0 2px 3px #432a16;display:grid;align-items:center}#meter-status>span,#meter-summary>span{grid-area:1/1}.message-sizer{visibility:hidden;pointer-events:none;user-select:none}#meter-summary{position:absolute;top:79px;left:-10px;right:-10px;height:30px;text-align:center;font-size:10px;line-height:1.35;text-shadow:0 1px 3px #352516;display:grid;align-items:start;margin:0}.meter-shortcut{display:none}
#seed-inspectors{position:absolute;z-index:13;right:22px;bottom:24px;width:176px;border:3px solid #fff1ce;border-radius:19px;padding:8px;background:#5b4737;box-shadow:0 4px 0 #89643f,0 5px 12px #32271455}.inspect-top{text-align:center}.inspect-top>strong{font-size:15px;font-weight:1000;letter-spacing:1px}.seed-tabs{display:flex;gap:5px;justify-content:center;margin-top:5px}.seed-tabs button{min-height:30px;padding:3px 13px;border-width:1px;border-color:#c6a678;border-radius:8px;box-shadow:none;font-size:11px;background:#70563e}.seed-tabs button[aria-selected=true]{background:#ebc270;color:#38291d;border-color:#fff0cf}.seed-card{padding:0}.seed-heading,.seed-health-row,.seed-health{display:none}.seed-view{height:115px;width:100%}.seed-inspect-controls{display:flex;flex-direction:column;gap:4px;align-items:stretch}.seed-inspect-controls span{font-size:10px;color:#ffe2a6;text-align:center;min-height:14px}.seed-inspect-controls button{min-height:32px;padding:4px 6px;font-size:10px;border-width:1px;border-color:#cba97a;border-radius:9px;box-shadow:none;background:#74583f}.seed-damage{font-size:9px;line-height:1.3;min-height:24px;text-align:center;margin:6px 0 0;color:#ffe5b8}#seed-inspectors[data-owner='0'] #seed-card-1,#seed-inspectors[data-owner='1'] #seed-card-0{display:none}#inspect-toggle{display:none}#pause-banner,#match-outcome{position:absolute;z-index:25;top:34%;left:50%;transform:translateX(-50%);background:#423b29ef;border:3px solid #fff1ce;border-radius:24px;box-shadow:0 7px #452d20;padding:26px;min-width:280px;max-width:85%;text-align:center}#pause-banner strong{display:block;font-size:35px;margin-bottom:18px}#pause-banner button{min-width:210px}#match-outcome{display:none}body[data-stage=won] #match-outcome{display:flex;flex-direction:column;gap:18px}#match-message{font-size:21px;line-height:1.35}#new-match{font-size:22px;min-height:58px}#handoff{display:none!important}
/* Tuning controls live in a game menu, away from the active HUD. */
#settings{position:absolute;z-index:30;top:117px;right:23px;max-width:calc(100% - 32px);color:#fff0ce}#settings>summary{list-style:none;cursor:pointer;min-height:44px;padding:10px 14px;border:2px solid #fff1ce;border-radius:13px;background:#59442de8;box-shadow:0 3px #392b2090;font-size:14px;user-select:none;text-align:right}#settings>summary::-webkit-details-marker{display:none}#settings[open]{width:430px;max-height:calc(100% - 150px);overflow:auto;background:#493d2bf5;border:3px solid #ffedbf;border-radius:19px;padding:12px;box-shadow:0 10px 30px #20180e70}#settings[open]>summary{box-shadow:none;border:0;background:none;padding:2px 4px 12px;border-bottom:1px solid #897450;border-radius:0}.settings-title{font-size:20px;letter-spacing:.5px;margin:15px 0}.controls{display:grid;gap:12px}.panel{border-top:1px solid #88704f;padding:12px 0}.label,label{font-size:12px;display:block;margin-bottom:7px}#settings .row{display:flex;gap:7px;flex-wrap:wrap}#settings button,#settings select{font-size:11px;min-height:44px;border-width:1px;box-shadow:none}#settings .small{font-size:11px;line-height:1.5;color:#d9c9a8;font-weight:400}.check{display:flex;align-items:center;gap:8px;min-height:36px}.check input{width:18px;height:18px;accent-color:#edbd5c}input[type=range]{width:100%;height:30px;accent-color:#eebd61}.grip-top{display:flex;justify-content:space-between;align-items:center;font-size:12px}.grip-top label{margin:0}#settings summary{cursor:pointer;padding:12px 0;min-height:44px}#settings table{width:100%;font-size:10px;text-align:left;border-collapse:collapse}#settings td,#settings th{padding:6px}.table-scroll{overflow:auto}#settings textarea{width:100%}#settings .session-top{border-top:1px solid #88704f;padding-top:12px}#settings .session-top b{font-size:12px}body[data-mode=timing] #guide-controls,body[data-mode=timing] #grip-panel{display:none}footer{display:none}body[data-mode=freehand] .header-tools{bottom:25px}
@media(max-width:1050px){.players{gap:34%}.player{grid-template-columns:60px 1fr;grid-template-rows:22px 30px}.player-token{width:66px;height:66px}.player b{font-size:14px}.hud-health{height:30px}.player strong{font-size:20px;bottom:0}#player-1{grid-template-columns:1fr 60px}#player-1 strong{right:68px}h1{font-size:42px}.wordmark{top:25px}.match-top{top:99px}#meter-panel{width:52%;grid-template-columns:minmax(0,1fr) 145px;gap:12px}#meter-action{font-size:21px;height:60px;min-height:60px}#seed-inspectors{width:151px;right:14px}.header-tools{left:14px}#swing-mode{width:137px}#meter-status{font-size:11px;left:-220px}#meter-summary{top:73px}}
@media(max-width:700px){main{min-height:650px;height:100svh}.wordmark{top:max(10px,env(safe-area-inset-top))}h1{font-size:32px}.ribbon{width:30px;height:20px;margin-top:4px}#scoreboard{top:83px;left:12px;right:12px}.players{gap:15px}.player{grid-template-columns:48px 1fr;grid-template-rows:19px 27px}.player-token{width:52px;height:52px;border-width:3px}.player b{font-size:12px;padding-left:7px;letter-spacing:.2px}.hud-health{height:27px;border-width:3px}.player strong{font-size:18px;right:7px;bottom:-1px;height:25px}#player-1{grid-template-columns:1fr 48px}#player-1 strong{right:53px}#player-1 b{padding-right:7px}#player-1 .hud-health{border-width:3px}.match-top{top:68px;left:5%;right:5%;gap:2px}#game-label{font-size:9px}#turn-label{font-size:12px}.header-tools{bottom:max(13px,env(safe-area-inset-bottom));left:12px;right:12px;flex-direction:row;align-items:center;gap:6px;justify-content:space-between}#swing-mode{width:133px;font-size:11px}.quick-controls{gap:6px}.quick-controls button{min-width:54px;font-size:10px;padding:6px}.quick-controls #reset{max-width:none}.header-tools:after{content:'';width:49px;flex-shrink:0}#settings{top:12px;right:12px}#settings>summary{width:44px;height:44px;padding:10px;text-align:center;font-size:19px}.options-label{display:none}#settings[open]{top:12px;right:12px;max-height:calc(100% - 24px);max-width:calc(100% - 24px);width:430px}#settings[open]>summary{width:auto;text-align:right}#settings[open] .options-label{display:inline;font-size:13px}#meter-panel{width:calc(100% - 30px);bottom:90px;grid-template-columns:minmax(0,1fr) 133px;gap:12px}#meter-arc{height:124px}#meter-action{height:57px;min-height:57px;font-size:20px;border-radius:24px}#meter-status{left:-210px;right:0;top:-44px;font-size:11px;height:33px}#meter-summary{font-size:10px;top:67px;height:28px}#meter-arc text{font-size:13px}#meter-arc text:first-of-type,#meter-arc text:nth-of-type(2){display:none}#result{top:25%;min-width:190px}#result-title{font-size:38px}#result-detail{font-size:11px}#seed-inspectors{display:none;bottom:225px;right:12px;width:166px}body[data-inspect=open] #seed-inspectors{display:block}.seed-tabs button,.seed-inspect-controls button{min-height:44px}#inspect-toggle{display:block;position:absolute;bottom:max(13px,env(safe-area-inset-bottom));right:12px;z-index:15;width:49px;min-height:44px;font-size:10px;padding:6px;border-color:#fff1ce;background:#644b33}#pause-banner,#match-outcome{top:32%;min-width:250px;padding:22px}#match-message{font-size:19px}body[data-mode=freehand] .header-tools{bottom:max(13px,env(safe-area-inset-bottom))}}
@media(max-height:600px) and (min-width:701px){main{min-height:360px}.wordmark{top:10px}h1{font-size:34px}.ribbon{display:none}#scoreboard{top:18px}.match-top{top:61px}#game-label{display:none}#settings{top:88px}#seed-inspectors{width:140px;bottom:12px}.seed-view{height:77px}.seed-damage{display:none}#meter-panel{bottom:15px}#meter-arc{height:118px}#meter-status{top:-50px}#meter-action{height:55px;min-height:55px;font-size:20px}#meter-summary{top:64px;font-size:9px}.header-tools{bottom:15px}#result{top:24%}}
@media(prefers-reduced-motion:reduce){.hud-health>div{transition:none}}

@media(max-width:700px){#meter-panel{width:min(320px,calc(100% - 40px));bottom:91px;grid-template-columns:1fr;gap:1px}#meter-arc{height:123px;width:100%}#meter-panel>div{width:180px;justify-self:center}#meter-action{height:55px;min-height:55px;font-size:23px}#meter-status{left:-74px;right:-74px;top:-151px;font-size:11px;height:27px}#meter-summary{top:62px;left:-25px;right:-25px;font-size:10px}#seed-inspectors{bottom:307px}#meter-arc text{font-size:15px}#result{top:24%}}
/* Long state labels wrap inside their existing hit target, without moving it. */
button{white-space:normal;overflow-wrap:anywhere;line-height:1.15;min-width:0}
#meter-action{white-space:normal;overflow-wrap:normal;text-wrap:balance;line-height:1.05;padding:4px 8px}
#meter-action[data-label=complete]{font-size:18px;letter-spacing:0}
#settings .row>button{max-width:100%}
/* v49: action-first layout, readable phases and seed-focused results. */
main{min-height:360px}
.header-tools{top:max(112px,env(safe-area-inset-top));bottom:auto;left:24px}
.quick-controls button{font-size:13px;min-width:70px}
.header-tools:after{display:none}
#menu-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
#menu-actions #inspect-toggle{display:block;position:static;width:auto;font-size:12px}
#menu-actions #reset{max-width:none}#mode-bar label{display:block}#swing-mode{width:160px}
#settings .small{font-size:12px}#settings .check{min-height:44px}
#settings>summary{min-width:104px;padding:10px 12px}
#developer-tools{border-top:1px solid #88704f;margin-top:12px}
#turn-label{background:#19594fe8;border:2px solid #fff1ce;border-radius:20px;padding:7px 16px;font-size:15px}
body[data-active='1'] #turn-label{background:#8f3f2ce8}
.player.active b:before{content:'▸ ';color:#ffe193}
.seed-resource{position:absolute;left:85px;bottom:4px;display:flex;align-items:center;gap:4px;font-size:10px;text-shadow:0 1px #251e17}
.seed-resource svg{width:16px;height:22px}#player-1 .seed-resource{left:12px}
.damage-pop{position:absolute;right:12px;top:67px;font-size:24px;color:#ffecaf;text-shadow:0 2px 2px #542b16}#player-1 .damage-pop{right:85px}
#meter-panel{width:min(650px,58%);bottom:28px}
#meter-status{font-size:13px;top:-66px;left:-360px}
#meter-arc{height:144px}
#meter-panel[data-phase=power] #meter-fill{stroke:#f6c457}
#meter-panel[data-phase=accuracy] #meter-fill{stroke:#299f96;opacity:.7}
#meter-label{font-size:15px}
#seed-inspectors{width:190px;padding:10px 8px;background:#5b4737}
.inspect-top>strong{font-size:12px;letter-spacing:.4px}
#impact-caption{font-size:14px;color:#ffda7b;margin-top:5px;min-height:18px}
.seed-view{height:172px}
#inspect-expand{position:absolute;right:0;top:0;width:44px;height:44px;min-height:44px;padding:0;background:transparent;border:0;box-shadow:none;font-size:23px}
.inspect-top{padding-right:24px}
.seed-tabs,.seed-inspect-controls,.seed-damage{display:none}
#seed-inspectors[data-expanded=true] .seed-tabs{display:flex}
#seed-inspectors[data-expanded=true] .seed-inspect-controls{display:flex}
#seed-inspectors[data-expanded=true] .seed-damage{display:block}
.seed-tabs button,.seed-inspect-controls button{min-height:44px;font-size:12px}
body[data-impact=show] #seed-inspectors{border-color:#ffd675;box-shadow:0 0 0 3px #d89a32,0 6px 20px #32271455}
body[data-stage=won] #meter-panel,body[data-stage=won] .header-tools,body[data-stage=won] #settings,body[data-stage=won] #result{display:none}
body[data-stage=won] #match-outcome{display:none}
body[data-victory=show] #match-outcome{display:flex;align-items:center;gap:12px;top:50%;transform:translate(-50%,-50%);width:340px;max-height:calc(100svh - 24px);overflow:auto;padding:20px;background:#423b29fa}
.victory-kicker{font-size:12px;color:#ffd477;letter-spacing:2px}
#match-message{order:-1;font-size:25px}#victory-seed{width:100%}
#victory-seed #seed-inspectors{display:block;position:static;width:100%;border:0;box-shadow:none;padding:0;background:#5b4737;border-radius:16px;pointer-events:none}
#victory-seed .seed-view{height:190px}
#victory-seed #inspect-expand,#victory-seed .seed-tabs,#victory-seed .seed-inspect-controls,#victory-seed .seed-damage{display:none}
#victory-seed .inspect-top{padding:10px 0 0}#new-match{width:100%}
@media(max-width:1050px){.seed-resource{left:69px;font-size:9px}.seed-resource svg{width:13px}#meter-panel{width:57%}#seed-inspectors{width:160px}.seed-view{height:142px}#meter-status{left:-260px}}
@media(max-width:700px){
 main{height:100svh;min-height:480px}
 #stage{top:102px;bottom:195px}
 .wordmark{top:max(10px,env(safe-area-inset-top));left:50%}h1{font-size:26px}.ribbon{display:none}
 #scoreboard{top:57px;left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right))}
 .players{gap:18px}.player b{font-size:10px;padding-left:6px}.player-token{width:46px;height:46px}.player{grid-template-columns:42px 1fr;grid-template-rows:17px 26px}#player-1{grid-template-columns:1fr 42px}
 .player strong{font-size:16px}#player-1 strong{right:47px}.seed-resource{left:48px;bottom:2px}.seed-resource span{display:none}.seed-resource svg{width:13px;height:19px}#player-1 .seed-resource{left:7px}
 .match-top{top:54px;left:0;right:0}#game-label{display:none}#turn-label{font-size:12px;padding:5px 12px}
 .header-tools{top:max(7px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:auto;bottom:auto!important;display:block}
 .quick-controls button{min-width:58px;font-size:11px;min-height:44px}
 #settings{top:max(7px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right))}#settings>summary{min-width:44px}
 #meter-panel{width:min(350px,calc(100% - 28px));bottom:max(35px,calc(env(safe-area-inset-bottom) + 25px));grid-template-columns:1fr;gap:0}
 #meter-arc{height:102px}#meter-panel>div{width:180px}#meter-action{height:52px;min-height:52px;font-size:22px}
 #meter-status{top:-134px;left:-80px;right:-80px;font-size:11px;height:26px}#meter-summary{top:58px;font-size:10px}
 #seed-inspectors{display:none;top:151px;bottom:auto;right:10px;width:144px}.seed-view{height:120px}
 body[data-impact=show] #seed-inspectors,body[data-inspect=open] #seed-inspectors{display:block}
 #seed-inspectors[data-expanded=true]{top:145px;width:180px;max-height:calc(100svh - 340px);overflow:auto}
 .damage-pop{top:48px;font-size:20px}#player-1 .damage-pop{right:48px}
 #result{top:19%}#result-title{font-size:32px}
 body[data-victory=show] #match-outcome{width:300px}#victory-seed .seed-view{height:165px}
}
@media(max-height:600px) and (min-width:701px){
 .header-tools{top:88px;bottom:auto}#meter-panel{width:53%;bottom:18px}#meter-arc{height:100px}#meter-status{top:-44px;font-size:11px}
 #seed-inspectors{width:140px;bottom:12px;padding:7px}.seed-view{height:115px}#impact-caption{font-size:12px}.inspect-top>strong{font-size:10px}
 #turn-label{padding:4px 12px;font-size:12px}.damage-pop{top:57px}
 body[data-victory=show] #match-outcome{width:470px;padding:14px;gap:5px}#victory-seed .seed-view{height:105px}#victory-seed .inspect-top{display:none}#new-match{min-height:46px;font-size:20px}#match-message{font-size:22px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
body[data-mode=timing] #concede{display:none}
#inspect-close{display:none}
#victory-seed #inspect-close{display:none}
@media(max-width:700px){#inspect-close{display:block;position:absolute;left:0;top:0;width:44px;height:44px;padding:0;font-size:22px;background:none;border:0;box-shadow:none}.inspect-top{padding:35px 0 0}#victory-seed .inspect-top{padding:10px 0 0}}
@media(max-width:700px) and (orientation:landscape){
 main{min-height:320px}#stage{inset:0}
 .wordmark{top:12px}h1{font-size:24px}
 #scoreboard{top:16px}.players{gap:34%}.player b{font-size:9px}.player.active b:before{display:none}.player strong{font-size:14px}.seed-resource{display:none}
 .match-top{top:50px}#turn-label{font-size:11px;padding:3px 8px}
 .header-tools{top:80px}.quick-controls button{min-width:54px}
 #settings{top:80px}#settings[open]{top:8px}
 #meter-panel{width:350px;grid-template-columns:1fr 130px;bottom:20px;gap:8px}#meter-panel>div{width:130px}#meter-action{font-size:18px}
 #meter-status{top:-42px;left:-210px;right:0;font-size:10px}#meter-summary{top:59px;font-size:9px}#meter-arc{height:85px}
 #seed-inspectors{width:125px;top:132px;right:8px}.seed-view{height:90px}.inspect-top>strong{font-size:10px}#impact-caption{font-size:11px}
 #seed-inspectors[data-expanded=true]{top:8px;max-height:calc(100svh - 16px);width:190px}
 body[data-victory=show] #match-outcome{width:340px;padding:12px;gap:5px}#victory-seed .seed-view{height:90px}#victory-seed .inspect-top{display:none}#new-match{min-height:44px;font-size:18px}#match-message{font-size:21px}
}
@media(max-width:700px) and (orientation:portrait){
 #seed-inspectors:not([data-expanded=true]){top:auto;bottom:207px;width:220px;height:124px;padding:8px;right:10px}
 #seed-inspectors:not([data-expanded=true]) .inspect-top{position:absolute;left:4px;top:0;width:101px;padding:44px 3px 0}
 #seed-inspectors:not([data-expanded=true]) .inspect-top>strong{font-size:10px}
 #seed-inspectors:not([data-expanded=true]) #impact-caption{font-size:12px}
 #seed-inspectors:not([data-expanded=true]) .seed-card{margin-left:94px}
 #seed-inspectors:not([data-expanded=true]) .seed-view{height:104px}
 #victory-seed #seed-inspectors:not([data-expanded=true]){position:static;width:100%;height:auto}
 #victory-seed #seed-inspectors:not([data-expanded=true]) .inspect-top{position:static;width:auto;padding:10px 0 0}
 #victory-seed #seed-inspectors:not([data-expanded=true]) .seed-card{margin-left:0}
 #victory-seed #seed-inspectors:not([data-expanded=true]) .seed-view{height:165px}
}
#opponent-options{border-bottom:1px solid #88704f;padding-bottom:10px;margin-bottom:14px;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;align-items:center}
#opponent-options label{margin:0}#opponent-options select{width:100%;min-width:0}#opponent-help{grid-column:1/-1;margin:4px 0}
body[data-cpu=true] #meter-arc{cursor:default}body[data-cpu=true] #meter-action{opacity:.85}
#match-outcome #opponent-options{width:100%;text-align:left;margin:0;padding:8px 0;border-top:1px solid #88704f;border-bottom:0;flex-shrink:0}
#match-outcome #opponent-options label{font-size:12px}#match-outcome #opponent-options select{font-size:12px;padding:6px;min-height:44px}
#match-outcome #opponent-help{display:none}#match-outcome #new-match{flex-shrink:0}
@media(max-height:600px) and (orientation:landscape){#match-outcome #opponent-options{grid-template-columns:auto 1fr auto 1fr;gap:6px}#match-outcome #opponent-options label{font-size:10px}}
/* Extend each health bar under its portrait so both borders meet the curve. */
#player-0 .hud-health{margin-left:-24px}
#player-1 .hud-health{margin-right:-24px}
/* Center the resource label in the visible bar, excluding the portrait overlap. */
.hud-health{position:relative}
#player-0 .seed-resource,#player-1 .seed-resource{top:0;bottom:0;display:flex;justify-content:center;align-items:center;direction:ltr;pointer-events:none}
#player-0 .seed-resource{left:28px;right:0}
#player-1 .seed-resource{left:0;right:28px}
@media(max-width:700px) and (orientation:landscape){#player-0 .seed-resource,#player-1 .seed-resource{display:none}}
.audio-controls{display:grid;gap:6px}.audio-controls .audio-level{display:flex;align-items:center;justify-content:space-between;gap:12px}.audio-level label{margin:0}.audio-level output{font-size:12px;font-variant-numeric:tabular-nums}.audio-controls input[type=range]{min-height:44px;margin:0}.audio-controls select{width:100%;min-width:0}.audio-controls #music-status{min-height:36px;margin:2px 0 6px}
/* Character selection: cosmetic roster, with the current match paused beneath. */
body[data-screen=start] main{filter:blur(4px)}
#start-screen{position:fixed;inset:0;z-index:100;overflow:auto;background:radial-gradient(ellipse at 90% 0,#bc994460,transparent 50%),linear-gradient(140deg,#163f38f7,#315b4df5);color:#fff1ce;padding:28px max(18px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
.start-wrap{max-width:920px;margin:auto}.start-brand{text-align:center;font:1000 48px 'Arial Black','Trebuchet MS',sans-serif;letter-spacing:2px;text-shadow:0 4px #533c24;line-height:1.15}.start-brand>span{display:block;font:800 11px 'Trebuchet MS',sans-serif;letter-spacing:3px;color:#f8d382;margin:9px 0 20px;text-shadow:none}
#start-title{font-size:30px;text-align:center;margin:0 0 7px}#start-note{text-align:center;font-size:14px;color:#e3dac3;margin:0 0 18px}
.character-owner{display:flex;justify-content:center;gap:10px}.character-owner button{min-width:145px;background:#25493f;border-color:#708c70;box-shadow:none}.character-owner button[aria-pressed=true]{color:#332b22;background:#f6cd78;border-color:#fff0c6}
#roster-prompt{font-size:13px;letter-spacing:1px;text-transform:uppercase;margin:22px 0 10px;color:#f7dfb1}
#character-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.character-card{position:relative;display:flex;align-items:center;gap:12px;min-height:158px;text-align:left;padding:18px 13px;border-radius:19px;border:3px solid #938365;background:#f3e3bf;color:#3b3027;box-shadow:0 5px #16392e;transition:background .12s,border-color .12s}
.character-card:hover{background:#fff0ce;filter:none}.character-card[aria-pressed=true]{border-color:#ffce60;background:#fff2cc;box-shadow:0 0 0 2px #ffce60,0 5px #16392e}
.character-portrait{display:block;width:92px;height:92px;flex:0 0 92px;border-radius:50%;overflow:hidden;border:3px solid #fff7e5;box-shadow:0 2px 0 #bda77b}.character-portrait svg{display:block;width:100%;height:100%}
.character-copy{display:flex;flex-direction:column;gap:5px;min-width:0}.character-copy strong{font-size:21px;line-height:1.1}.character-nickname{font-size:12px;color:#665135;line-height:1.3}.character-look{font-size:10px;font-weight:600;line-height:1.4;color:#665d48;margin-top:3px}
.character-check{display:none;position:absolute;top:5px;right:8px;color:#315948;font-size:20px}.character-card[aria-pressed=true] .character-check{display:block}
.start-bottom{display:flex;align-items:end;justify-content:space-between;gap:28px;margin-top:24px;padding-top:20px;border-top:1px solid #9d9b7755}.start-game-options{display:flex;gap:14px}.start-game-options label{font-size:12px;margin:0}.start-game-options select{display:block;margin-top:7px;min-width:142px;background:#284b40;border-color:#a69d7c}
.start-action{min-width:250px;text-align:center}#character-lineup{font-size:13px;margin:0 0 9px;color:#fce6b6}#start-play{width:100%;min-height:60px;border-radius:24px;font-size:21px}
@media(max-width:760px){#start-screen{padding-top:max(18px,env(safe-area-inset-top))}.start-brand{font-size:34px}.start-brand>span{margin-bottom:16px}#start-title{font-size:25px}#start-note{font-size:12px;line-height:1.4}.character-owner button{min-width:130px}#character-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.character-card{flex-direction:column;gap:9px;text-align:center;min-height:190px;padding:13px 7px}.character-portrait{width:76px;height:76px;flex-basis:76px}.character-copy strong{font-size:19px}.character-nickname{font-size:11px}.character-look{font-size:10px}.start-bottom{flex-direction:column;align-items:stretch;gap:16px;margin-top:20px}.start-game-options{display:grid;grid-template-columns:1fr 1fr}.start-game-options select{min-width:0;width:100%}.start-action{min-width:0}#start-play{min-height:56px}#roster-prompt{margin-top:18px}}
@media(max-height:650px) and (min-width:761px){#start-screen{padding-top:15px}.start-brand{font-size:32px}.start-brand>span{margin-bottom:10px}#start-title{font-size:22px}.character-card{min-height:118px;padding:12px}.character-portrait{width:72px;height:72px;flex-basis:72px}.start-bottom{margin-top:16px;padding-top:12px}}
@media(prefers-reduced-motion:reduce){.character-card{transition:none}}
/* Welcome: cream paper and patio colors, above the native modal backdrop. */
#gallitos-welcome{width:min(600px,calc(100vw - 28px));max-height:calc(100svh - 28px);box-sizing:border-box;overflow:auto;border:3px solid #f8d88f;border-radius:24px;padding:0;background:#f7e9c9;color:#3b3027;box-shadow:0 15px 70px #081c1999;font-weight:500}
#gallitos-welcome::backdrop{background:#102e29bd;backdrop-filter:blur(5px)}
.welcome-heading{background:#244e43;color:#fff1ce;padding:25px 28px 22px;border-bottom:4px solid #dfb260;text-align:center}.welcome-heading>span{font-size:11px;font-weight:800;letter-spacing:2px;color:#f3cf81}.welcome-heading h2{margin:8px 0;font:900 32px 'Trebuchet MS',sans-serif;line-height:1.12}.welcome-heading p{margin:0;font-size:14px;color:#eadbb5}
.welcome-story,.welcome-play{padding:18px 28px 0}.welcome-story h3,.welcome-play h3{font-size:17px;color:#245448;margin:0 0 9px}.welcome-story p,.welcome-play p{font-size:14px;line-height:1.5;margin:8px 0}.welcome-play ol{margin:8px 0;padding-left:22px}.welcome-play li{font-size:14px;line-height:1.5;margin:8px 0;padding-left:3px}.welcome-play li::marker{font-weight:900;color:#7c4f22}.welcome-play .welcome-aside{font-size:12px;color:#695a40}.welcome-source{display:inline-flex;align-items:center;min-height:44px;margin:0 28px;color:#315f51;font-size:12px;text-underline-offset:3px}
.welcome-footer{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#f7e9c9;padding:14px 28px 20px;border-top:1px solid #d5c298}.welcome-footer label{display:flex;align-items:center;gap:9px;min-height:44px;font-size:12px;cursor:pointer;margin:0}.welcome-footer input{width:19px;height:19px;accent-color:#316b59}.welcome-footer button{min-width:156px;min-height:48px;font-size:17px}.welcome-link{display:block;margin:14px auto 0;background:transparent;border:0;box-shadow:none;color:#f9dfaa;text-decoration:underline;text-underline-offset:4px;font-size:12px}
@media(max-width:480px){.welcome-heading{padding:20px 18px 16px}.welcome-heading h2{font-size:27px}.welcome-story,.welcome-play{padding:15px 20px 0}.welcome-source{margin:0 20px}.welcome-footer{padding:10px 18px 16px;gap:8px;flex-wrap:wrap}.welcome-footer button{flex:1;min-width:125px}.welcome-footer label{font-size:11px}.welcome-story p,.welcome-play p,.welcome-play li{font-size:13px}}
#welcome-title:focus{outline:none}
