/* Phone-first LAN lobby and landscape touch arena. */
button,input,select{touch-action:manipulation}input{font:inherit;color:inherit;background:#19313f;border:1px solid #587370;border-radius:8px;min-width:0;padding:12px}input:focus-visible{outline:2px solid #e9c37a;outline-offset:2px}.connection-status{position:absolute;top:26%;right:4%;font-size:.75cqw;color:#b9d9cc;padding:5px 8px;border-radius:5px;background:#16303b80;pointer-events:none}.portrait-hint{display:none}#canvas:focus-visible{outline:none}
@media(pointer:coarse){
 html,body{width:100%;height:100%;overflow:hidden}body{-webkit-user-select:none;user-select:none}input,select{-webkit-user-select:text;user-select:text}
 #app{width:100vw;height:100dvh;max-height:none;aspect-ratio:auto;border-radius:0}.hero-detail{width:100%;margin-top:10px;padding:10px;gap:8px}.detail-role{font-size:9px;display:inline;margin-right:6px}.hero-detail strong{font-size:13px}.hero-detail p{font-size:10px;line-height:1.6;margin:4px 0 0}.detail-moves{min-width:92px;gap:5px}.detail-moves span{font-size:9px;gap:5px}kbd{font-size:9px;min-width:17px}.live-dot{font-size:10px}
 .in-battle #battle{top:0;height:100%;width:100%;transform:none}.in-battle #canvas{width:100%;height:100%}.hud{top:max(12px,env(safe-area-inset-top));left:max(24px,env(safe-area-inset-left));right:max(24px,env(safe-area-inset-right))}.name-line{font-size:13px;margin-bottom:5px}.name-line span{font-size:9px}.hp-track{height:12px;padding:2px}.sub-bars{margin-top:5px;gap:5px}.sub-bars>div{height:4px}.round-dots{margin-top:7px;gap:7px}.round-dots i{width:6px;height:6px}.timer{top:-2px}.timer small,.timer span{font-size:8px}.timer strong{font-size:30px}.battle-tools{top:76px;right:max(22px,env(safe-area-inset-right));gap:6px}.battle-tools button{font-size:13px;min-height:32px;min-width:34px;padding:4px 9px}.arena-label{top:83px;left:max(24px,env(safe-area-inset-left));font-size:9px}.arena-label span{font-size:7px}.resource-label{top:111px;left:max(24px,env(safe-area-inset-left));font-size:10px}.resource-label span:last-child{font-size:9px}.connection-status{top:114px;right:max(22px,env(safe-area-inset-right));font-size:9px;padding:4px 7px}.arena-message{font-size:14px;top:32%}
 #joystick{width:clamp(104px,29dvh,144px);left:max(22px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));box-shadow:inset 0 0 0 8px #769e9410}.stick-caption{font-size:9px;bottom:-13px}.action-button{width:clamp(54px,15.4dvh,70px);gap:3px;border-width:1px;background:linear-gradient(140deg,#3a5753b8,#1d3544d4)}.action-button b{font-size:12px}.action-button small{font-size:8px}.action-button.attack{width:clamp(70px,20dvh,92px);right:max(22px,env(safe-area-inset-right));bottom:max(19px,env(safe-area-inset-bottom))}.action-button.attack b{font-size:17px}.action-button.s1{right:calc(max(22px,env(safe-area-inset-right)) + 91px);bottom:99px}.action-button.s2{right:calc(max(22px,env(safe-area-inset-right)) + 3px);bottom:120px}.action-button.jump{right:calc(max(22px,env(safe-area-inset-right)) + 180px);bottom:20px}.action-button.dodge{right:calc(max(22px,env(safe-area-inset-right)) + 176px);bottom:101px}.action-button.ultimate{width:clamp(56px,16dvh,72px);right:calc(max(22px,env(safe-area-inset-right)) + 92px);bottom:15px}.action-button.s1 b,.action-button.s2 b{font-size:11px}.cooldown{font-size:22px}.ultimate.ready{animation:none;box-shadow:0 0 20px #e6bb5e80}
}
@media(pointer:coarse) and (orientation:portrait){.in-battle .portrait-hint{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#0d2332f5;z-index:8;padding:25px;text-align:center}.portrait-hint>span{font-size:60px;color:#e8c77f;margin-bottom:20px}.portrait-hint strong{font-size:21px}.portrait-hint p{font-size:13px;color:#a5bebb}.in-battle #battle{height:100%;top:0;transform:none}.in-battle .touch-controls{visibility:hidden}
}
@media(pointer:coarse) and (orientation:landscape){.hero-detail{grid-column:1}.detail-moves{display:none}
}
@media(pointer:coarse) and (max-height:360px) and (orientation:landscape){.battle-tools{top:65px}.arena-label{top:70px}.resource-label{top:98px}.connection-status{top:103px}.action-button.s2{bottom:108px}.action-button.s1{bottom:89px}.action-button.dodge{bottom:90px}}
@media(pointer:coarse){.action-button{padding:0}.action-button.s1 b,.action-button.s2 b{font-size:10px;white-space:nowrap;max-width:100%}.in-battle .portrait-hint{z-index:12}}

.action-button.ranged{right:27%;bottom:4%;border-color:#96d6d9;background:linear-gradient(145deg,#356878dc,#193b4cde)}.action-button.ranged b{font-size:1cqw}.action-button.ranged small{font-size:.58cqw}
@media(pointer:coarse){.action-button.ranged{right:calc(max(22px,env(safe-area-inset-right)) + 268px);bottom:21px;width:clamp(54px,15.4dvh,70px)}.action-button.ranged b{font-size:11px}.action-button.ranged small{font-size:8px}.action-feedback{bottom:40%;left:29%;max-width:40%}}

/* Apply outside pointer media queries: OEM desktop-mode browsers also need this. */
#battle,#battle *{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;-webkit-tap-highlight-color:transparent}
#battle .action-button,#battle .action-button *,#joystick,#joystick *{touch-action:none!important;-webkit-user-drag:none}
.fullscreen-help{z-index:30}.fullscreen-help p{line-height:1.7}.fullscreen-help .modal{max-width:560px}
.is-fullscreen,.is-fullscreen body{width:100%;height:100%;overflow:hidden}
.is-fullscreen #app{width:100vw;width:var(--play-width,100vw);height:100vh;height:var(--play-height,100dvh);max-width:none;max-height:none;aspect-ratio:auto;border-radius:0}
html:fullscreen{background:#091521}html:-webkit-full-screen{background:#091521}
@media(pointer:coarse){#app{width:var(--play-width,100vw);height:var(--play-height,100dvh)}#menuFullscreen{white-space:nowrap}}

.action-button.s3{right:27%;bottom:20%;border-color:#c7c2e1}.action-button.s3 b{font-size:.95cqw}
@media(pointer:coarse){.action-button.s3{right:calc(max(22px,env(safe-area-inset-right)) + 268px);bottom:101px;width:clamp(54px,15.4dvh,70px)}.action-button.s3 b{font-size:10px;white-space:nowrap}.action-button.s3 small{font-size:8px}.detail-moves{gap:4px}}
@media(pointer:coarse) and (max-height:360px) and (orientation:landscape){.action-button.s3{bottom:90px}}

/* Three thumb-sized rows, with a clear gap between every independent hit target. */
@media(pointer:coarse) and (orientation:landscape){
 .touch-controls{--key:clamp(50px,14.4dvh,64px);--gap:10px;--edge-r:max(16px,env(safe-area-inset-right));--edge-b:max(16px,env(safe-area-inset-bottom))}
 .touch-controls .action-button{width:var(--key);height:var(--key);bottom:auto;right:auto;aspect-ratio:1;border:1.5px solid #b8d7d799;background:linear-gradient(145deg,#294b5fe8,#102838ed);box-shadow:0 3px 10px #05131b55;gap:3px;isolation:isolate}
 .touch-controls .action-button b{font-size:clamp(10px,2.8dvh,12px);white-space:normal;line-height:1.15;max-width:94%;text-align:center}
 .touch-controls .action-button small{font-size:8px;color:#d0e2df}
 .touch-controls .attack{width:calc(var(--key)*1.4);height:calc(var(--key)*1.4);right:var(--edge-r);bottom:var(--edge-b);border:3px solid #ffe3a0;background:linear-gradient(135deg,#efd28a,#b88c35);color:#112b37}
 .touch-controls .attack b{font-size:20px}.touch-controls .attack small{color:#364d45}
 .touch-controls .dodge{width:calc(var(--key)*1.1);height:calc(var(--key)*1.1);right:calc(var(--edge-r) + var(--key)*1.4 + var(--gap));bottom:var(--edge-b);border:2px solid #b0ecd8;background:linear-gradient(135deg,#3a7467ed,#193b3bed)}
 .touch-controls .dodge b{font-size:15px}
 .touch-controls .ranged{right:calc(var(--edge-r) + var(--key)*2.5 + var(--gap)*2);bottom:var(--edge-b);border-color:#8fdde7}
 .touch-controls .s1{right:var(--edge-r);bottom:calc(var(--edge-b) + var(--key)*1.4 + var(--gap))}
 .touch-controls .s2{right:calc(var(--edge-r) + var(--key) + var(--gap));bottom:calc(var(--edge-b) + var(--key)*1.4 + var(--gap))}
 .touch-controls .s3{right:calc(var(--edge-r) + var(--key)*2 + var(--gap)*2);bottom:calc(var(--edge-b) + var(--key)*1.4 + var(--gap));border-color:#c7bee8}
 .touch-controls .ultimate{right:var(--edge-r);bottom:calc(var(--edge-b) + var(--key)*2.4 + var(--gap)*2);border:2px solid #dfbf78}
 .touch-controls .jump{right:calc(var(--edge-r) + var(--key) + var(--gap));bottom:calc(var(--edge-b) + var(--key)*2.4 + var(--gap)*2);background:#182f3fdd}
 #joystick{width:clamp(108px,31dvh,142px);left:max(22px,env(safe-area-inset-left));bottom:max(24px,env(safe-area-inset-bottom));border:2px solid #a6cec852;background:#112d3a66}
 .action-feedback{bottom:22%;left:28%;max-width:33%;font-size:12px}
 .touch-controls .pressed{filter:brightness(1.35);transform:scale(.92)}
 .touch-controls .cooldown{font-size:24px}
}
@media(pointer:coarse){#app{width:100vw;max-width:100vw;max-height:100dvh}.is-fullscreen #app{width:100vw;height:100dvh}}
