/* Keep the existing painted controls, with two independent thumb zones. */
#navigate{position:absolute;left:34px;top:410px;z-index:5;min-height:44px;max-width:235px;color:#493021;font-size:14px;display:flex;align-items:center;gap:4px}
#navigate .painted-icon{width:28px;height:28px}
#navigate[aria-pressed=true]{outline:2px solid #ffdb83}
#navigationStatus{position:absolute;left:50%;bottom:calc(92px + env(safe-area-inset-bottom));transform:translateX(-50%);padding:5px 10px;background:#231c18ed;color:#fff1d3;border:1px solid #ad8c53;border-radius:5px;z-index:4;max-width:60%;font-size:14px;text-align:center;pointer-events:none}
.joystick,.combat,.combat button{touch-action:none;-webkit-user-select:none;user-select:none}
.panel-content{min-height:0}.welcome{max-height:calc(100dvh - 20px);overflow:auto}
@media(max-width:640px) and (orientation:portrait){
 #navigate{left:12px;top:calc(330px + env(safe-area-inset-top));max-width:190px}
 .battle-track{max-height:168px}
}
@media(orientation:landscape) and (max-height:600px){
 #game .topbar{top:calc(8px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));right:calc(12px + env(safe-area-inset-right));height:44px;padding:0}
 #game .brand{display:none}#game .top-actions{margin-left:auto;gap:6px}
 #game .top-actions .icon-button{width:44px;height:44px;min-height:44px;padding:0;border-width:8px;border-image-width:8px}
 #game .hero-hud{top:calc(8px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));width:220px;gap:8px}
 #game .hero-hud .portrait{width:44px;height:44px;flex:0 0 44px}
 #game .hero-hud .portrait-art{width:44px;height:44px}#game .hero-name{font-size:14px}#game .hero-info{flex:1;min-width:0}
 #game .hero-hud .portrait b{font-size:14px;bottom:-4px;width:25px;height:25px;line-height:25px}
 #game .hero-hud .xp-row{display:none}
 #game .location{top:calc(12px + env(safe-area-inset-top));left:50%;right:auto;transform:translateX(-50%);text-align:center;max-width:28%;pointer-events:none}
 #game .location h1{font-size:17px;margin:0;letter-spacing:1px}#game .location .eyebrow{display:none}#game .location>span{font-size:12px}
 #game .battle-track{top:calc(64px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));width:208px;max-height:94px;min-height:0;padding:5px 8px}
 #game .battle-track small{display:none}#game .battle-track strong{font-size:14px;margin:0}#game .battle-track span{font-size:13px;line-height:1.35}
 #game #navigate{top:calc(164px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));max-width:208px;padding:1px 8px;min-height:44px}
 #game .quest,#game .desktop-hint,#game .world-minimap{display:none}
 #game .navigation,#game.is-battle .navigation{left:50%;right:auto;top:auto;bottom:env(safe-area-inset-bottom);transform:translateX(-50%);width:280px;max-width:38%;height:54px;flex-direction:row;gap:0;padding:2px 6px;background:#251d18e8;border:1px solid #967549;border-bottom:0;border-radius:8px 8px 0 0;z-index:12}
 #game .navigation button{flex:1;min-width:0;min-height:48px;padding:0}
 #game .navigation button>span.painted-icon{width:28px;height:28px}#game .navigation button b{font-size:12px;line-height:1}
 #game.is-battle .joystick{display:block;left:calc(35px + env(safe-area-inset-left));bottom:calc(18px + env(safe-area-inset-bottom));width:116px;height:116px}
 #game .joystick>span{bottom:0;font-size:12px}
 #game .stick{width:44px;height:44px;top:calc(50% - 22px);left:calc(50% - 22px)}
 #game.is-battle .combat{right:calc(16px + env(safe-area-inset-right));bottom:calc(14px + env(safe-area-inset-bottom));width:248px;height:184px}
 #game .skills-row{position:absolute;right:0;top:0;display:flex;gap:10px}
 #game .ability{width:68px;height:74px;min-height:74px;padding:0}
 #game .ability>.painted-icon{width:58px;height:58px}
 #game .ability b,#game .attack b{font-size:12px;line-height:1.1;white-space:nowrap}
 #game .attack-row{position:absolute;right:0;bottom:0;margin:0;gap:26px;align-items:center}
 #game .attack{width:88px;height:94px;padding:0}#game .attack>.painted-icon{width:78px;height:78px}
 #game .dodge{width:72px;height:78px}#game .auto-button{position:absolute;top:-48px;right:0;min-height:42px;padding:0 9px}
 #game kbd{display:none}
 #game #interact,#game.safe-scene #interact{left:50%;right:auto;bottom:calc(62px + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:34%;min-height:44px;font-size:14px;white-space:normal;padding:2px 10px}
 #game #navigationStatus{bottom:calc(114px + env(safe-area-inset-bottom));max-width:34%}
 #game .cast-status{left:auto;right:calc(22px + env(safe-area-inset-right));bottom:calc(210px + env(safe-area-inset-bottom));max-width:230px;font-size:13px}
 #game .combo-hud{top:62px;right:40%;font-size:14px}#game .boss-hud{top:60px;left:50%;transform:translateX(-50%);width:32%}
 #game .event-feed{left:50%;top:95px;bottom:auto;transform:translateX(-50%);max-width:30%;font-size:12px}
 #game .panel,#game.is-battle .panel{top:calc(6px + env(safe-area-inset-top));bottom:calc(60px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(780px,calc(100% - 110px));max-height:none}
 #game .panel>header{padding:0 8px}#game .panel h2{font-size:20px}#game .panel-content{padding:6px 10px 12px}
 #game .npc-dialogue-panel{width:calc(100% - 70px)}
 #game #panel.npc-dialogue-panel{top:6px;bottom:calc(60px + env(safe-area-inset-bottom));max-height:none}
 #game .npc-speaker{min-height:76px;gap:12px;padding:0 12px}#game .npc-character{height:82px;width:76px}#game .npc-character.hero-art{width:76px;height:76px}
 #game .npc-speaker strong{font-size:18px}#game #panel.npc-dialogue-panel .npc-speech{padding:10px 16px}#game #panel.npc-dialogue-panel .npc-speech p{font-size:16px;line-height:1.6}
 #game .lesson-hud{top:70px;left:50%;transform:translateX(-50%);max-width:40%}
 #game .banner{top:22%;font-size:22px}#game .toast{bottom:62px}
}
@media(orientation:landscape) and (max-height:370px){
 #game .battle-track{max-height:64px}#game #navigate{top:calc(133px + env(safe-area-inset-top))}
 #game.is-battle .joystick{width:104px;height:104px;left:calc(25px + env(safe-area-inset-left))}
 #game.is-battle .combat{height:166px}#game .ability{height:66px;min-height:66px}#game .ability>.painted-icon{width:52px;height:52px}
}
