:root{color-scheme:dark;--paper:#fff0bb;--gold:#ffcf67;--muted:#b3c1ad;--edge:#4a6355;--panel:#223c32;--ink:#162b26;font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
*{box-sizing:border-box}
html{min-height:100%;background:#1a312c}
body{margin:0;min-height:100svh;color:var(--paper);background:radial-gradient(ellipse at 49% 35%,#385044 0,transparent 65%),repeating-linear-gradient(135deg,#21392f 0 2px,#20382f 2px 8px);overflow-x:hidden}
main{max-width:1120px;width:calc(100% - 64px);margin:0 auto;padding:clamp(14px,4.3vh,46px) 0 15px}
header,footer,.home-foot,.action-line,.inputs,.tools,.brand,.group,.power-info,.mode-buttons{display:flex;align-items:center}
header{justify-content:space-between;margin:0 3px 15px}
.brand{font-size:clamp(15px,2vw,22px);font-weight:900;letter-spacing:.085em;gap:7px}
#brand-icon{height:37px;width:35px;}
.tools{gap:8px}button{border:0;font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #fff5be;outline-offset:3px}button:disabled{cursor:default}
.tools button,#howto{background:transparent;font-size:13px;font-weight:650;color:#d9e0cb}.tools button{min-height:34px;padding:0 11px;border:1px solid #52695a;border-radius:5px;background:#1d342c}.tools .help,#pause{padding:0;width:34px;font-weight:850;font-family:monospace;font-size:17px}.soundmark{font:900 13px monospace;color:#e2c780;margin-right:6px}
.cabinet{border:2px solid #192923;border-radius:10px;padding:6px;background:#476052;box-shadow:inset 0 1px #87987c,0 5px #14251f,0 22px 70px #0d211e55}
#stage{position:relative;width:100%;aspect-ratio:16/9;isolation:isolate;overflow:hidden;background:#8cbfba;border:2px solid #243c31;border-radius:4px;container-type:inline-size}
#screen,#screen canvas{position:absolute;inset:0;width:100%!important;height:100%!important;display:block;image-rendering:pixelated;touch-action:none}
.home{position:absolute;inset:0;display:flex;align-items:center;background:linear-gradient(90deg,#172f30f2 0%,#1d3637e8 17%,#28413ecf 32%,#2946427a 46%,#334d4000 62%);pointer-events:none}
.intro{padding-left:6.5%;width:59%;pointer-events:auto}.map-label{font-size:clamp(10px,1.35cqw,15px);font-weight:650;letter-spacing:.12em;color:#e2e5c0;display:flex;gap:.7em;align-items:center}.map-dot{width:.56em;height:.56em;background:#a9d68d;box-shadow:2px 2px #44795c}.map-label i{width:1.5em;height:1px;background:#b4c298}
h1{margin:2.1cqw 0 1.7cqw;letter-spacing:-.055em;font-size:clamp(38px,7.7cqw,91px);line-height:.98;font-weight:1000;font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;-webkit-text-stroke:.065em #2e3833;paint-order:stroke fill;text-shadow:.045em .06em #384135,.074em .095em #192d29}
h1 span,h1 strong{display:block}h1 span{color:#fff2c7}h1 strong{color:#ffcb61;font-weight:1000;margin-top:.08em}.intro p{font-size:clamp(10px,1.6cqw,17px);color:#fff1c6;margin:0 0 2.7cqw;letter-spacing:.045em;font-weight:550}
.mode-buttons{gap:1.1cqw}.main-btn,.alt-btn{font-weight:850;border:2px solid #29362d;border-radius:5px;padding:.72em 1.05em;box-shadow:0 3px #172721;transition:filter .12s,transform .12s;white-space:nowrap}.main-btn{color:#343729;background:#ffce65;box-shadow:inset 0 2px #fff0a7,inset 0 -2px #dda451,0 3px #162924}.alt-btn{color:#f8edcc;background:#426454;box-shadow:inset 0 2px #709077,0 3px #172b24}.mode-buttons button{font-size:clamp(11px,1.57cqw,18px)}.mode-buttons b{margin-right:.2em;font-size:.85em}
button:hover:not(:disabled){filter:brightness(1.1)}button:active:not(:disabled){transform:translateY(1px)}
.home-foot{min-height:54px;justify-content:space-between;background:#263c31;color:#c1cdb4;padding:0 20px;margin-top:5px;border-radius:3px;font-size:13px}.pixel-key{display:inline-block;margin:0 4px 0 14px;padding:2px 5px;min-width:22px;text-align:center;border:1px solid #879077;border-bottom-width:2px;border-radius:3px;color:#eeebd0;font:650 12px monospace}.pixel-key:first-child{margin-left:0}#howto b{color:var(--gold);margin-left:4px}
footer{justify-content:space-between;font-size:12px;color:#b0bdab;margin:15px 4px 0;letter-spacing:.04em}footer i{display:inline-block;width:7px;height:7px;background:#a0c388;margin-right:6px}
[hidden]{display:none!important}
#hud{position:absolute;top:2.8%;left:2.5%;right:2.5%;display:flex;align-items:start;justify-content:space-between;pointer-events:none;color:#fff2cf;font-size:clamp(10px,1.4cqw,16px)}.team,.turn-card{background:#233a31ed;border:1px solid #798a6d;outline:2px solid #25342ccb;box-shadow:0 3px #263d3055;border-radius:3px}.team{display:flex;align-items:center;gap:.65em;padding:.42em .66em}.team b{font-size:.87em}.team1{text-align:right}.team-gem{height:2.05em;width:1.9em;background:#688664;border-bottom:2px solid #b9dda0;border-radius:3px}.team1 .team-gem{background:#916668;border-color:#ffb69f}
.hp{display:flex;gap:.3em;margin-top:.15em}.hp span{position:relative;width:2.6em;height:.38em;background:#152920;border-radius:.1em}.hp i{display:block;height:100%;background:#a9dc8d}.team1 .hp i{background:#ff9696}.turn-card{display:flex;gap:.65em;align-items:center;padding:.41em .7em;font-variant-numeric:tabular-nums}.turn-card span{color:#ffd279;font-family:monospace}
#turn-toast{position:absolute;bottom:5%;left:50%;transform:translate(-50%,3px);background:#23392feb;color:#fff3cd;border:1px solid #8fa07a;border-radius:4px;padding:.32em .75em;font-size:clamp(10px,1.38cqw,16px);opacity:0;pointer-events:none;transition:opacity .2s;white-space:nowrap}#turn-toast.show{opacity:1}
#controls{padding:8px 16px 11px;background:#263c31;margin-top:5px;border-radius:3px}.action-line,.inputs{justify-content:space-between;gap:8px}.action-line{margin:0 0 6px;color:#dce7cf;font-size:13px}.action-line b{margin-right:.5em}#active-color{display:inline-block;width:8px;height:8px;margin-right:6px;background:#a6d994}#phase-label,#angle{color:#c7cbb1}.power-info{gap:8px}.meter{display:block;width:70px;height:7px;background:#162b23;border:1px solid #627663}.meter i{display:block;height:100%;background:var(--gold)}.group{gap:5px}.inputs button{font-size:14px;min-height:36px;min-width:40px;border:1px solid #627561;background:#374f40;border-radius:4px;padding:5px 12px;touch-action:none;color:#f4ecd1;font-weight:680;user-select:none}.inputs button:disabled{opacity:.52}.inputs #fire{background:#ffd16c;color:#303629;border-color:#353c2d;min-width:96px}.inputs small{color:#f0cb80}
#modal{position:absolute;inset:0;z-index:5;background:#162c29bb;display:grid;place-items:center;padding:10px;overflow:auto}.dialog{background:#253c31;border:2px solid #95a17b;outline:3px solid #1c3028;box-shadow:0 6px #14281f;max-width:460px;width:min(94%,460px);border-radius:5px;color:#edeacb;text-align:center;padding:clamp(12px,2.4cqw,28px)}.dialog h2{margin:0 0 .4em;color:#ffe09a;font-size:clamp(18px,3.3cqw,36px);line-height:1.2}.dialog p{font-size:clamp(12px,1.65cqw,16px);line-height:1.6;margin:.4em 0}.dialog ul{padding:0;margin:.6em auto 1em;list-style:none;text-align:left;max-width:350px}.dialog li{font-size:clamp(11px,1.55cqw,15px);line-height:1.65}.dialog li b{color:#ffda89}.dialog button{font-size:clamp(12px,1.6cqw,16px);margin:.3em}.dialog canvas{height:54px;width:auto;image-rendering:pixelated}#loading{position:absolute;bottom:4%;right:3%;background:#233b30;padding:4px 10px;border-radius:3px;font-size:12px}
@media(max-width:700px){main{width:calc(100% - 16px);padding-top:12px}.cabinet{padding:3px}header{margin-bottom:8px}.home-foot{padding:0 8px;min-height:39px;font-size:11px}.pixel-key{margin-left:7px;padding:1px 3px;font-size:10px}#howto{font-size:11px}footer{margin-top:10px;font-size:10px}#controls{padding:6px 6px 8px}.inputs button{font-size:12px;min-width:30px;min-height:34px;padding:4px 8px}.inputs #fire{min-width:72px}.group{gap:3px}.dialog canvas{height:33px}}
@media(max-width:540px) and (orientation:portrait){main{padding-top:12px}.home-foot .pixel-key,.home-foot>div{display:none}.home-foot{justify-content:flex-end;min-height:32px}#stage:has(.home:not([hidden])){aspect-ratio:1.12}.home{align-items:flex-end;background:linear-gradient(0deg,#203a32fb 2%,#263e35ef 25%,#263c3880 55%,transparent 85%)}.intro{padding:0 5% 5%;width:100%}.map-label{font-size:10px}h1{margin:5px 0 4px;font-size:10.5cqw}h1 span,h1 strong{display:inline}h1 strong{margin-left:2px}.intro p{margin:6px 0 10px;font-size:12px}.mode-buttons button{font-size:13px;min-height:38px}.inputs{flex-wrap:wrap;justify-content:flex-start;gap:5px}.attacks{margin-left:auto}.inputs button{padding:4px 7px}.action-line{font-size:11px}.brand{font-size:17px}.dialog li{font-size:11px;line-height:1.45}.dialog{padding:9px}.dialog ul{margin:4px 0}.dialog p{font-size:11px}.dialog canvas{height:22px}.dialog h2{font-size:17px;margin-bottom:2px}}
@media(max-height:550px) and (orientation:landscape){main{width:min(calc((var(--toy-height,100svh) - 104px)*1.7778 + 14px),98%);padding:2px 0}header{margin:0 2px 2px}.brand{font-size:12px}#brand-icon{height:22px;width:21px}.tools button,.tools .help,#pause{min-height:22px;height:22px;font-size:10px}.tools .help,#pause{width:23px}.cabinet{padding:2px}.home-foot{min-height:25px}footer{display:none}#controls{padding:3px 5px 4px}.inputs button{min-height:23px;font-size:10px}.action-line{margin-bottom:2px;font-size:9px}.dialog canvas{height:24px}}
@media(max-width:540px) and (orientation:portrait){#stage:has(.home:not([hidden])) #screen{height:auto;aspect-ratio:16/9;bottom:auto}#stage:has(.home:not([hidden])){background:#334d3d}}
@media(max-width:540px) and (orientation:portrait){#stage:has(.home:not([hidden])) #screen{height:auto!important;width:135%!important;left:-35%;right:auto;bottom:auto;aspect-ratio:16/9}.inputs{display:grid;grid-template-columns:auto 1fr}.inputs .aiming{justify-self:end}.inputs .attacks{grid-column:1/-1;justify-self:stretch;width:100%;margin:3px 0 0}.attacks button{flex:1}.inputs button{min-height:42px;min-width:41px}.movement button,.aiming button{padding:6px 10px}.tools button{min-height:36px}.home{background:linear-gradient(0deg,#223a32 1%,#263e35f4 25%,#263c3860 50%,transparent 77%)}}
.skill-strip{display:flex;align-items:center;gap:12px;margin-top:9px;padding-top:8px;border-top:1px solid #49604e}
#skill{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:37px;padding:3px 10px 3px 7px;background:#314c3d;color:#f4eac4;border:1px solid #899d72;border-radius:4px;font-weight:750;font-size:14px}
#skill[aria-pressed="true"]{border-color:#f1d57f;background:#536043;box-shadow:inset 3px 0 #f1d57f}
#skill:disabled{opacity:.65}#skill-icon{width:26px;height:23px;image-rendering:pixelated}
#skill kbd{border:1px solid #9aa385;border-bottom-width:2px;border-radius:3px;font:11px monospace;padding:0 3px;color:#d1d6b6}
.skill-copy{display:flex;gap:.7em;align-items:baseline;font-size:13px;line-height:1.45;color:#ccd8be}.skill-copy b{white-space:nowrap;color:#e7d594;font-weight:680}
.skill-copy{flex:1;min-width:0}
#hole-tool{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:stretch;background:#3d354e;border:1px solid #a696b2;border-radius:4px;color:#f9e7cf;font:inherit;font-size:12px;font-weight:700;padding:2px 8px}
#hole-tool[aria-pressed="true"]{border-color:#ffce86;background:#584268;box-shadow:inset 0 -2px #ffc97c}
#hole-tool:disabled{opacity:.58}#hole-tool[hidden]{display:none}
.hole-glyph{position:relative;width:14px;height:14px;border-radius:50%;background:#181322;box-shadow:inset 0 0 0 1px #c7a1ed}
.hole-glyph::after{content:"";position:absolute;inset:4px -3px;border:1.5px solid #ffc88b;transform:rotate(-23deg);border-radius:50%}
@media(max-width:540px),(max-height:550px) and (orientation:landscape){#hole-tool{font-size:11px;padding:2px 6px;gap:4px}.hole-glyph{width:11px;height:11px}.hole-glyph::after{inset:3px -2px}}
.dialog{max-height:100%;overflow:auto;overscroll-behavior:contain}
@media(pointer:coarse){#skill kbd{display:none}}
@media(max-width:700px){.skill-strip{gap:7px;margin-top:6px;padding-top:6px}#skill{gap:4px;padding:3px 7px;font-size:12px}.skill-copy{font-size:11px}}
@media(max-width:540px) and (orientation:portrait){.skill-copy{display:block}.skill-copy b{display:block}#skill{min-height:44px}#skill-icon{width:23px;height:20px}}
@media(max-height:550px) and (orientation:landscape){main{width:min(calc((var(--toy-height,100svh) - 130px)*1.7778 + 14px),98%)}.skill-strip{margin-top:3px;padding-top:3px;gap:6px}#skill{min-height:23px;padding:0 5px;font-size:10px;gap:4px}#skill-icon{width:19px;height:17px}.skill-copy{font-size:9px}#skill kbd{font-size:9px}}
.cabinet{position:relative}
#lobby{background:#22392f;border:1px solid #26392e;border-radius:5px;padding:clamp(15px,2.8vw,36px);color:#ffedbd}
.lobby-head,.lobby-foot,.field-info,.hero-feature{display:flex;align-items:center}
.lobby-head{justify-content:space-between;border-bottom:1px solid #4f6754;padding-bottom:17px;margin-bottom:20px}
.format{display:flex;align-items:center;gap:.65em;color:#c1cfad;font-size:12px;letter-spacing:.05em;margin:0 0 5px}.format i{width:15px;height:1px;background:#94a789}
.lobby-head h1{font-size:clamp(28px,4.1vw,49px);line-height:1.1;color:#ffe09a;margin:0;letter-spacing:.02em;-webkit-text-stroke:0;text-shadow:0 3px #112b23}
.win-rule{color:#d0d9be;font-size:13px}.setup-grid{display:grid;grid-template-columns:1.18fr 1fr;gap:clamp(18px,2.5vw,34px)}
#lobby h2{margin:0 0 10px;font-size:15px;color:#f6edcc;letter-spacing:.08em}
.panorama{position:relative;overflow:hidden;border:2px solid #8c9c76;border-radius:5px;background:#314a3d;box-shadow:0 3px #142c24}
.panorama canvas{width:100%;height:auto;display:block;image-rendering:pixelated}.panorama span{position:absolute;right:6px;top:6px;border-radius:3px;background:#233b31de;color:#fff0cc;font:11px monospace;padding:4px 6px}
.field-info{gap:10px;margin-top:13px}.field-info h3,.hero-feature h3{font-size:24px;line-height:1.1;margin:0}.field-info span{color:#d9cd97;font-size:12px}
.field-info{flex-wrap:wrap;row-gap:4px}#field-music{margin-left:auto;color:#c4d9bc;white-space:nowrap}
.field-rule{display:flex;gap:9px;align-items:center;margin:9px 0;padding:7px 9px;background:#2d4538;border:1px solid #526a55;border-radius:4px}
.field-rule canvas{width:32px;height:32px;flex:none;image-rendering:pixelated}
.field-rule b{font-size:13px}.field-rule #field-hint{margin:1px 0 0;font-size:12px;line-height:1.4}
#battle-rule{position:absolute;left:2.5%;bottom:3%;display:flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 4px;border:1px solid #879b82;border-radius:4px;background:#21392fef;color:#fff1c7;font-size:clamp(10px,1.2cqw,14px);font-weight:700}
#battle-rule canvas{width:19px;height:19px;image-rendering:pixelated}
#bell-aim{position:absolute;right:2.5%;bottom:3%;padding:4px 9px;min-height:27px;border:1px solid #94dcca;border-radius:4px;background:#193d3cf2;color:#c4ffee;font-size:clamp(11px,1.3cqw,14px);font-weight:750}
#bell-aim .bell-ready,#bell-aim.aligned .bell-idle{display:none}
#bell-aim.aligned .bell-ready{display:inline}
#gate-scope{position:absolute;right:2.5%;top:18%;width:clamp(94px,23cqw,210px);border:1px solid #f8c8d8;border-radius:4px;box-shadow:0 2px 7px #23314366;overflow:hidden;pointer-events:none;background:#3f4757}
#gate-scope canvas{display:block;width:100%;height:auto;image-rendering:pixelated}
.prop-list{display:grid;gap:8px;text-align:left}.prop-list>div{display:flex;align-items:center;gap:10px;padding:6px;background:#30493c;border-radius:4px}.dialog .prop-list canvas{width:42px;height:42px;flex:none}.prop-list b{color:#ffe0a7}.prop-list p{margin:2px 0}
#gate-scope span{position:absolute;left:0;top:0;padding:1px 5px;border-radius:0 0 3px 0;background:#403349d9;color:#fff4db;font-size:clamp(8px,1.1cqw,11px);line-height:1.3;font-weight:700}
#bell-aim.aligned,.inputs #fire.relay{background:#a3eed9;color:#1d423a;box-shadow:inset 0 1px #f2ffdc,0 2px #2d5b51}
@media(max-height:550px) and (orientation:landscape){.field-rule{margin:4px 0;padding:2px 5px}.field-rule canvas{width:24px;height:24px}.field-rule #field-hint{font-size:10px}}
#field-hint,#hero-hint{font-size:13px;line-height:1.6;color:#d0d8be;margin:6px 0 11px}
.map-options{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.map-options button,.hero-options button{background:#30483b;color:#e6e7c8;border:1px solid #59715b;border-radius:4px;font-weight:650}
.map-options button{overflow:hidden;text-align:left;padding:0 0 5px;font-size:12px}.map-options canvas{display:block;width:100%;height:27px;margin-bottom:4px;image-rendering:pixelated}.map-options span{margin-left:7px}
#lobby button[aria-pressed=true]{outline:2px solid #f3cd70;outline-offset:-2px;color:#ffdc86;background:#41523b}
.hero-feature{background:linear-gradient(112deg,#48674d,#324c3d 66%,#30483a);border:1px solid #62785f;min-height:118px;padding:6px 12px 5px 4px;border-radius:5px;gap:6px;margin-bottom:10px}.hero-feature canvas{display:block;width:30%;max-width:124px;flex:none}.hero-feature b{color:#ffdc85;font-size:13px;display:block;margin-top:7px}.hero-feature h3{font-size:26px}.hero-feature #hero-hint{font-size:12px;margin:4px 0}
.hero-options{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px}.hero-options button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:57px;padding:5px 2px;font-size:12px}.hero-options canvas{width:29px;height:24px;image-rendering:pixelated}
.lobby-foot{justify-content:space-between;border-top:1px solid #4f6754;margin-top:20px;padding-top:15px}.lobby-foot #launch{font-size:16px;min-width:156px}.lobby-foot #launch span{margin-left:16px;color:#745b35}
#standings{display:flex;gap:4px;align-items:center;margin-bottom:7px}.standing{display:flex;flex:1;align-items:center;gap:5px;color:#dae5ce;font-size:11px;min-width:0}.standing i{width:6px;height:6px;background:var(--side);flex:none}.standing.out{opacity:.4;text-decoration:line-through}.standing.active{color:#fff0ae;font-weight:800}
#turn-hp{width:55px;height:3px;background:#1a2f27;margin-top:3px}#turn-hp i{display:block;height:100%}
#movement-readout{margin-top:3px;font-size:clamp(10px,1.1cqw,13px);color:#d2e7ad;white-space:nowrap;font-variant-numeric:tabular-nums}
#movement-readout.empty{color:#ffce8f}
.tools #music span:first-child{color:#e5cb87}
#modal{border-radius:5px}.dialog{max-height:95vh}
@media(max-width:740px){.win-rule{display:none}#lobby{padding:14px}.setup-grid{gap:14px}.hero-options{gap:4px}.hero-feature{padding:5px}.lobby-head{margin-bottom:12px;padding-bottom:10px}.field-info h3{font-size:19px}}
@media(max-width:740px){.hero-options{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:600px){.hero-options{grid-template-columns:repeat(4,minmax(0,1fr))}.setup-grid{grid-template-columns:1fr}.hero-feature{min-height:70px}.hero-feature canvas{width:77px}.hero-feature h3{font-size:21px}.hero-options button{min-height:42px;flex-direction:row}.hero-options canvas{width:23px;height:20px}.hero-feature b{margin-top:3px}.panorama canvas{max-height:146px}.map-options canvas{height:18px}.lobby-foot{margin-top:13px;padding-top:9px}.tools{gap:3px}.tools button{padding:0 5px;font-size:11px}#standings{display:grid;grid-template-columns:repeat(4,1fr)}.standing{font-size:10px}#turn-toast{bottom:17%}}
@media(max-height:550px) and (orientation:landscape){main:has(#lobby:not([hidden])){width:min(96%,900px)}#lobby{padding:10px 16px}.setup-grid{grid-template-columns:1.12fr 1fr}.lobby-head h1{font-size:23px}.lobby-head{padding-bottom:6px;margin-bottom:6px}.format{font-size:10px}.hero-feature{min-height:62px}.hero-feature canvas{width:62px}.panorama canvas{max-height:90px}.hero-options button{min-height:30px;flex-direction:row}.hero-options canvas{width:21px;height:18px}.map-options canvas{height:16px}.lobby-foot{margin-top:8px;padding-top:5px}.lobby-foot #launch{padding:5px 14px;min-height:30px}#lobby h2{margin-bottom:4px}#field-hint{margin:2px 0 5px}.field-info{margin-top:6px}#standings{margin-bottom:3px}.standing{font-size:8px}main:has(#controls:not([hidden])){width:min(calc((var(--toy-height,100svh) - 149px)*1.7778 + 14px),98%)}}
@media(min-height:551px) and (min-width:741px) and (orientation:landscape){main:has(#stage:not([hidden])){width:min(calc(100% - 48px),calc((var(--toy-height,100svh) - 223px)*1.7778),1120px);padding-top:12px}}
.map-options{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:420px){.map-options{gap:4px}.map-options span{display:block;text-align:center;margin:0;font-size:10px}}

@media(max-width:420px){.hero-options button{flex-direction:column;gap:2px;min-height:42px}.hero-options canvas{width:22px;height:17px}}

.brand-title{display:flex;align-items:baseline;gap:8px}.brand-title>span{white-space:nowrap}
#game-version{font:600 11px ui-monospace,monospace;color:#becbab;letter-spacing:.02em}
#battle-console{display:grid;grid-template-columns:minmax(0,36fr) minmax(0,64fr);grid-template-areas:"map controls";gap:5px;margin-top:5px}
#battle-console.swapped{grid-template-columns:minmax(0,64fr) minmax(0,36fr);grid-template-areas:"controls map"}
#controls{grid-area:controls;min-width:0;margin-top:0;container-type:inline-size}
#map-panel{grid-area:map;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:4px;border-radius:3px;background:#24392f;padding:6px 9px}
.map-toolbar,.map-toolbar>div{display:flex;align-items:center;gap:5px}.map-toolbar{justify-content:space-between}
.map-toolbar b{font-size:13px}.map-toolbar button{border:1px solid #607560;background:#334d3e;border-radius:4px;font-size:11px;min-height:26px;padding:2px 8px}
.map-toolbar button[aria-pressed=true]{color:#ffdf96;border-color:#b9a06a;background:#43533f}
#radar-input{display:block;width:100%;padding:0;border:1px solid #8d9f7d;border-radius:4px;overflow:hidden;background:#22382f;line-height:0;touch-action:none;user-select:none;cursor:crosshair}
#radar-input:active{cursor:grabbing;transform:none}#radar-input:hover{filter:none}
#radar{display:block;width:100%;height:auto}
#map-hint{font-size:11px;color:#cad6be;line-height:1.2}
#screen{cursor:crosshair;touch-action:none}#screen.panning{cursor:grabbing}
@container (max-width:555px){.inputs{display:grid;grid-template-columns:auto 1fr}.inputs .aiming{justify-self:end}.inputs .attacks{grid-column:1/-1;display:flex;width:100%;margin:0}.inputs .attacks button{flex:1}}
@container (max-width:405px){#standings{display:grid;grid-template-columns:repeat(4,1fr)}.power-info{gap:4px}.power-info .meter{width:42px}}
@media(max-width:700px){.brand-title{display:block;line-height:1.08}#game-version{display:block;font-size:10px;line-height:1.1}
  #battle-console,#battle-console.swapped{grid-template-columns:1fr;grid-template-areas:"map" "controls"}
  #battle-console.swapped{grid-template-areas:"controls" "map"}
  #map-panel{padding:5px 7px;gap:3px}.map-toolbar button{min-height:29px}#map-hint{font-size:10px}}
@media(min-height:551px) and (min-width:741px) and (orientation:landscape){main:has(#stage:not([hidden])){width:min(calc(100% - 48px),calc((var(--toy-height,100svh) - 254px)*1.7778),1120px)}}
@media(max-height:550px) and (orientation:landscape){
  main:has(#stage:not([hidden])){width:min(99%,1080px)}
  .cabinet:has(#stage:not([hidden])){display:grid;grid-template-columns:minmax(0,1.57fr) minmax(226px,1fr);gap:5px;align-items:center}
  #battle-console,#battle-console.swapped{grid-template-columns:1fr;grid-template-areas:"map" "controls";gap:3px;margin-top:0}
  #battle-console.swapped{grid-template-areas:"controls" "map"}
  #map-panel{padding:3px 5px}#map-hint{font-size:9px}.map-toolbar b{font-size:11px}.map-toolbar button{min-height:22px;font-size:10px}}
@media(max-height:660px) and (orientation:portrait){
  main:has(#stage:not([hidden])){padding:3px 0}
  main:has(#stage:not([hidden])) header{margin-bottom:2px}
  main:has(#stage:not([hidden])) footer{display:none}
  #controls{padding:4px 6px}
  #standings{margin-bottom:3px}.action-line{margin-bottom:3px}
  .inputs button,#skill{min-height:35px}
  .skill-strip{padding-top:4px;margin-top:4px}
  #map-panel{padding:3px 7px}.map-toolbar button{min-height:26px}}

#power-track{position:relative;isolation:isolate;width:clamp(72px,11cqw,126px);height:10px;border-radius:2px}
.lobby-actions{display:flex;align-items:center;gap:9px}
#trial{color:#ffe5a7;background:#493b42;border-color:#bd9267;font-size:14px}
#trial span{color:#ffca72}
.toy-container #modal{position:fixed;inset:var(--toy-insets);z-index:6}
.toy-container body:has(#modal:not([hidden])){overflow:hidden}
.toy-container .dialog{max-height:100%}
@media(max-width:540px){.lobby-actions{gap:5px}.lobby-foot #launch{min-width:0;padding:.7em .8em;font-size:13px}.lobby-foot #launch span{margin-left:3px}#trial{padding:.7em .52em;font-size:12px}}
#power-track.has-zone::after{content:"";position:absolute;inset-block:-2px;left:var(--zone-left);width:var(--zone-width);box-sizing:border-box;border:1px solid #fff0a7;background:repeating-linear-gradient(120deg,#e7a6419e 0 2px,#ffdc7755 2px 4px);pointer-events:none}
#power-track.armed::after{background:#fff3ba;box-shadow:0 0 6px #ffdc77}
#charge-cue{font-size:11px;color:#ffda87;white-space:nowrap}
.inputs #fire.armed{background:#ffe8a2;box-shadow:inset 0 1px white,0 0 0 2px #cf814b}
#hit-card{--edge-cut:11px;position:absolute;right:0;top:17%;max-width:62%;display:flex;gap:.65em;align-items:center;padding:.45em 1.1em .5em 1.65em;line-height:1.12;color:#fff2c1;background:linear-gradient(110deg,#753e59,#4f3449 55%,#302f3a);border-block:2px solid #ffd58b;clip-path:polygon(var(--edge-cut) 0,100% 0,100% 100%,0 100%);box-shadow:inset -4px 0 #f29b88;pointer-events:none;font-size:clamp(11px,1.7cqw,16px)}
#hit-card strong,#hit-card small{display:block}#hit-card strong{font-size:1.5em;font-weight:900;letter-spacing:.06em}#hit-card small{font-size:.78em;color:#ffdcc6;margin-top:.25em}
.hit-emblem{color:#ffe299;font-size:2.25em;line-height:1;text-shadow:-2px 2px #d87385}
.best-shot{display:grid;gap:4px;margin:12px auto 5px;padding:8px 12px;color:#ffe3a8;background:#334a3c;border-left:3px solid #edba72;text-align:left;width:fit-content}.best-shot small{font-size:.81em;color:#e7d9b8}
@container (max-width:405px){#power-track{width:62px}#charge-cue{font-size:10px}}
@media(max-width:385px){.action-line{column-gap:3px;flex-wrap:wrap}.hit-emblem{font-size:1.7em}}

.inputs #jump.leaf-action{background:#a6dfac;border-color:#d1ecb0;color:#244c3c}

#weather-chip{position:absolute;left:50%;top:calc(100% + 5px);transform:translateX(-50%);display:flex;align-items:center;gap:.38em;padding:.18em .55em .18em .24em;border-radius:3px;background:#253b3ae8;border:1px solid #93a99a;color:#fff2c8;font-size:clamp(9px,1.15cqw,13px);font-weight:700;white-space:nowrap;pointer-events:none;box-shadow:0 2px #182c27}
#weather-chip b{display:grid;place-items:center;width:1.6em;height:1.6em;border-radius:50%;background:#4c6a58;color:#fff2b4;font-size:.92em;font-weight:800}
#weather-chip[data-weather="rain"] b{background:#4a6a8b;color:#d9f2ff}
#weather-chip[data-weather="breeze"] b{background:#5a7b57;color:#e7ffd4}
#weather-chip[data-weather="updraft"] b{background:#5b6f7d;color:#effcff}
#weather-chip[data-weather="syrup"] b{background:#7d5a3c;color:#ffe4b0}

.lobby-links{display:flex;align-items:center;gap:12px}
#medals{background:transparent;font-size:13px;font-weight:650;color:#d9e0cb}
#medals b{color:#ffd071;font-weight:800;margin-left:2px}
.win-rule{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
#lobby-record{font:700 11px ui-monospace,monospace;color:#ffd88f}
.medal-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:10px 0}
.medal{background:#2f483b;border:1px solid #526a55;border-radius:5px;padding:5px 3px;text-align:center;opacity:.55}
.medal.got{opacity:1;border-color:#d8b46c;background:#3a5140}
.medal canvas{width:44px;height:44px;image-rendering:pixelated}
.medal b{display:block;font-size:11px;color:#ffe3a2;margin-top:1px;line-height:1.2}
.medal p{margin:2px 0 0;font-size:9px;line-height:1.35;color:#c6d2b9}
.medal-stats{color:#ffe9b5;font-weight:700}
.medal-unlock{color:#ffe09a;font-weight:700}
@media(max-width:600px){.medal-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.medal canvas{width:36px;height:36px}}
@media(max-height:550px) and (orientation:landscape){.medal canvas{width:30px;height:30px}.medal p{display:none}.medal-grid{gap:4px}}

#daily{color:#e9f1ce;background:#3b5745;border-color:#87a077;font-size:13px;box-shadow:inset 0 2px #6d886f,0 3px #172b24}
#daily small{display:block;font-size:10px;font-weight:600;color:#ffdf96;margin-top:1px;line-height:1.1}
@media(max-width:540px){#daily{font-size:11px;padding:.55em .5em}#daily small{font-size:9px}}

#run{color:#ffe9c0;background:#55413f;border-color:#b98c6c;font-size:13px;box-shadow:inset 0 2px #826154,0 3px #2a1c1a}
#run small{display:block;font-size:10px;font-weight:600;color:#ffd48f;margin-top:1px;line-height:1.1}
.lobby-actions{flex-wrap:wrap;justify-content:flex-end}
.blessing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}
.blessing{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 6px;background:#334b3d;border:1px solid #6e8367;border-radius:5px;text-align:center}
.blessing b{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#f0c879;color:#4b3a2b;font-size:15px}
.blessing strong{font-size:12px;color:#ffe6ae}.blessing span{font-size:10px;line-height:1.35;color:#d8dfc8}
.blessing:hover{border-color:#f0cc82}
@media(max-width:600px){.blessing-grid{grid-template-columns:1fr}.blessing{flex-direction:row;text-align:left}.blessing span{font-size:10px}}
@media(max-width:540px){#run{font-size:11px;padding:.55em .5em}#run small{font-size:9px}}

@media(max-width:540px) and (orientation:portrait){
  .lobby-foot{flex-wrap:wrap;gap:9px}
  .lobby-links{width:100%;justify-content:space-between;gap:8px}
  #howto{white-space:nowrap}
  .lobby-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:6px}
  .lobby-actions button{width:100%;min-height:40px}
}

.quip{color:#ffe2a3;font-style:italic;letter-spacing:.04em}

.duo-row{display:flex;align-items:center;gap:8px;margin-top:7px;flex-wrap:wrap}
#duo-mode{background:#334d3e;border:1px solid #607560;border-radius:4px;color:#e6e7c8;font-size:12px;font-weight:700;padding:4px 9px}
#duo-mode[aria-pressed=true]{border-color:#f0cd7d;color:#ffe09a;background:#475640}
#duo-picker{display:flex;align-items:center;gap:5px;font-size:12px;color:#d7dfc5}
#duo-picker select{background:#2d4538;color:#ffedbd;border:1px solid #718567;border-radius:3px;font:inherit;font-size:12px;padding:3px 4px;max-width:110px}
#duo-note{font-size:10px;color:#aebda5}
#duo-score{font:800 11px ui-monospace,monospace;color:#ffd88f;letter-spacing:.04em}
@media(max-width:600px){.duo-row{gap:5px}.duo-row #duo-note{display:none}}

#boss{color:#ffe2c4;background:#5a3c39;border-color:#c08a6f;font-size:13px;box-shadow:inset 0 2px #8a5d4c,0 3px #2a1c1a}
#boss small{display:block;font-size:10px;font-weight:600;color:#ffc38f;margin-top:1px;line-height:1.1}
@media(max-width:540px){#boss{font-size:11px;padding:.55em .5em}#boss small{font-size:9px}}
.replay-canvas{display:block;width:100%;height:auto;image-rendering:pixelated;border:1px solid #62785f;border-radius:4px;background:#162a2b}
.dialog canvas.replay-canvas{width:100%;height:auto;max-height:46vh}

#training{background:transparent;font-size:13px;font-weight:650;color:#cfe0c2}
@media(max-width:540px){#training{font-size:12px;white-space:nowrap}}
