.screen-toggle{position:fixed;z-index:20;right:max(16px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));display:flex;align-items:center;gap:6px;min-height:34px;padding:6px 10px;background:#0b1411d9;color:#e8ce94;border:1px solid #726448;font:600 10px var(--body);letter-spacing:1px;border-radius:4px}
.phone-help{padding:12px;border-left:2px solid var(--gold);background:#d5b5740c;font-size:13px;line-height:1.6}
#rotate-screen{max-width:none;width:100%;height:100%;max-height:none;inset:0;margin:0;padding:32px 24px;border:0;background:radial-gradient(ellipse at 50% 20%,#2d3020,#080e0b 65%);color:#d6d1b9;text-align:center;overflow:auto}
#rotate-screen[open]{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:18px}#rotate-screen::backdrop{background:#080e0b}
.rotate-phone{width:62px;height:95px;border:3px solid #d6b87c;border-radius:12px;color:#f2d49a;font:50px/90px var(--body);transform:rotate(-25deg);margin-bottom:18px}.rotate-eyebrow{font:600 10px var(--body);letter-spacing:3px;color:#bca375}#rotate-screen h2{font:800 40px/.95 var(--display);letter-spacing:2px;margin:0}#rotate-screen h2 span{color:#e7c581}#rotate-screen p{font:14px/1.6 var(--body);margin:0}#rotate-screen small{font:10px/1.6 var(--body);color:#8a9789;max-width:260px}
/* Controls sit over the arena's lower corners, leaving the health bars clear. */
.touch-controls{display:none!important}.touch-device #game{height:100dvh;min-height:0;padding:0;position:relative;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.touch-device #game .game-viewport{position:absolute;inset:calc(40px + env(safe-area-inset-top)) 0 0;width:100%;height:calc(100% - 40px - env(safe-area-inset-top));max-width:none;border:0;display:flex;align-items:center;justify-content:center;margin:0;background:#040807;box-shadow:none}
.touch-device #fight{width:100%;height:100%;object-fit:contain;aspect-ratio:auto;touch-action:none}
.touch-device .game-top{position:absolute;top:max(5px,env(safe-area-inset-top));left:max(9px,env(safe-area-inset-left));right:max(9px,env(safe-area-inset-right));margin:0;max-width:none;z-index:6;pointer-events:none;justify-content:space-between}
.touch-device .game-top>span{display:none}.touch-device .game-top button{pointer-events:auto;font:600 9px var(--body);padding:7px 10px;min-height:32px;background:#07110ce6;border:1px solid #87734c99;border-radius:4px}.touch-device #leave{font-size:0}.touch-device #leave:after{content:'‹ MENU';font-size:9px}.touch-device #pause kbd{display:none}.touch-device .fight-footer{display:none}
.touch-device:has(#game:not([hidden])) .screen-toggle{top:max(5px,env(safe-area-inset-top));right:max(94px,calc(env(safe-area-inset-right) + 94px));min-height:32px;font-size:9px;padding:6px 8px}.touch-device:has(#game:not([hidden])) .screen-toggle span{display:none}
.touch-device .touch-controls{display:flex!important;position:absolute;inset:0;z-index:4;margin:0;max-width:none;pointer-events:none;align-items:flex-end;justify-content:space-between;padding:0 max(16px,calc(env(safe-area-inset-right) + 10px)) max(13px,env(safe-area-inset-bottom)) max(16px,calc(env(safe-area-inset-left) + 10px));gap:0}
.touch-device .stick-area{position:relative;display:flex;align-items:center;flex-direction:column;gap:6px}.touch-caption{font:600 7px var(--body);letter-spacing:1px;color:#e7ddbd9c;text-shadow:0 1px 3px #000}
#joystick{width:132px;height:132px;position:relative;pointer-events:auto;touch-action:none;border:1px solid #d8c99a66;border-radius:50%;background:radial-gradient(circle,#15292080 45%,#0a1515ac 47%,#9f947418 49%,#0b171b7a 70%);box-shadow:inset 0 0 25px #0005,0 3px 16px #0005}
#joystick.held{border-color:#ead494b0;background-color:#25382e40}.stick-cross{position:absolute;inset:28%;border:1px solid #d5c38d33;transform:rotate(45deg)}#stick-thumb{position:absolute;width:54px;height:54px;border:1px solid #e2cb8c99;border-radius:50%;top:calc(50% - 27px);left:calc(50% - 27px);background:radial-gradient(circle at 35% 25%,#a99f7980,#363e31e0);box-shadow:0 3px 8px #0008;pointer-events:none}
.stick-arrow{position:absolute;font:18px var(--body);color:#d1c18b99;pointer-events:none}.north{top:5px;left:calc(50% - 6px)}.south{bottom:5px;left:calc(50% - 6px)}.west{left:7px;top:calc(50% - 10px)}.east{right:7px;top:calc(50% - 10px)}
.touch-device .touch-attacks{gap:13px;align-items:flex-end;display:flex;padding-bottom:5px}
.touch-device .touch-controls .touch-attacks button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;pointer-events:auto;touch-action:none;width:76px;height:76px;min-width:0;border-radius:50%;border:2px solid #d4b47199;background:radial-gradient(circle at 35% 20%,#a5773966,#322419d9);box-shadow:inset 0 0 0 4px #0003,0 3px 12px #0007;color:#f3deb1;font:700 9px var(--body);letter-spacing:1px;text-shadow:0 2px 1px #000}
.touch-device .touch-attacks button span{font:800 25px/1 var(--display)}.touch-device .touch-controls .touch-attacks button:last-child{margin-bottom:35px;background:radial-gradient(circle at 35% 20%,#9c493d77,#351819dd);border-color:#bc735e99}.touch-device .touch-controls .touch-attacks button.held{background:#bd954bbf;transform:scale(.95);color:#fff5d6;border-color:#fff0bb}
.touch-device #game:has(#game-overlay:not([hidden])) .touch-controls{visibility:hidden}.touch-device #game-overlay{z-index:5;padding:16px}.touch-device #game-overlay h2{font-size:40px;margin:0 0 8px}.touch-device #game-overlay p{margin:0 0 16px;font-size:12px}.touch-device #game-overlay .primary-button{padding:10px 24px}.touch-device dialog:not(#rotate-screen){max-height:calc(100dvh - 24px);max-width:min(620px,90vw);padding:25px 30px}
/* A horizontal console layout fits short phone screens without burying Confirm. */
@media(orientation:landscape){
.touch-device .console-screen{min-height:100dvh}.touch-device .screen-heading{font-size:27px;padding:15px 100px 12px;letter-spacing:2px}
.touch-device .console-bottom{padding:9px max(18px,env(safe-area-inset-right)) 9px max(18px,env(safe-area-inset-left));font-size:7px}.touch-device .console-bottom>span:first-child{font-size:0}.touch-device .console-bottom>span:first-child:after{content:'TOUCH TO SELECT';font-size:8px;letter-spacing:1px}.touch-device .press-start{font-size:0;margin-top:12px}.touch-device .press-start:after{content:'TAP A MODE TO BEGIN';font-size:9px}.touch-device .title-content{display:grid;grid-template-columns:1.15fr 1fr;align-items:center;padding:35px max(45px,env(safe-area-inset-right)) 45px max(32px,env(safe-area-inset-left));gap:22px}.touch-device .game-logo{margin:0}.touch-device .game-logo span{font-size:clamp(30px,5.5vw,65px)}.touch-device .game-logo strong{font-size:clamp(64px,11.5vw,137px)}.touch-device .title-menu{gap:4px}.touch-device .title-menu button{font-size:22px;padding:9px 25px;min-width:240px}.touch-device .press-start{grid-column:1 / -1}
.touch-device #stage-screen{padding:0 max(32px,env(safe-area-inset-right)) 36px max(32px,env(safe-area-inset-left))}.touch-device .stage-intro{margin:0 0 12px;font-size:8px}.touch-device .stage-picker{grid-template-columns:1fr 1fr;gap:20px;max-width:850px}.touch-device .stage-image{height:calc(100dvh - 214px);min-height:76px;max-height:290px;aspect-ratio:auto}.touch-device .stage-card>span+span{padding:9px 12px}.touch-device .stage-card b{font-size:21px}.touch-device .stage-card small{font-size:7px;margin-top:4px}.touch-device .stage-card i{bottom:25px;right:12px}.touch-device .stage-actions{margin:12px auto 0;max-width:850px}.touch-device .stage-actions .primary-button{font-size:18px;min-width:180px;min-height:40px;padding:8px 20px}
}
@media(orientation:landscape) and (max-height:370px){.touch-device #joystick{width:110px;height:110px}.touch-device .touch-controls .touch-attacks button{width:66px;height:66px}.touch-device .touch-attacks{gap:10px}.touch-device .screen-heading{font-size:23px;padding-top:10px;padding-bottom:8px}.touch-device .title-menu button{font-size:19px;padding:7px 25px}.touch-device .title-content{padding-top:25px;padding-bottom:35px;gap:12px}.touch-device .stage-intro{margin-bottom:8px}}
