/* Mobile controls use one header and one bottom control area. */
#mobile-menu-open,#mobile-glasses{display:none}
#mobile-menu{width:min(520px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;background:#f6f0df;border:2px solid #a9b8b1;border-radius:12px;color:#405c70}
#mobile-menu::backdrop{background:#24364c88;backdrop-filter:blur(2px)}
.mobile-menu-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}.mobile-menu-head h2{margin:0;font-size:17px}.mobile-menu-head button{font:25px sans-serif;border:0;background:transparent;padding:4px 10px;color:#607c8a}
.mobile-menu-goal{background:#e9e3cf;border-radius:7px;padding:12px;line-height:1.8;font-size:12px}.mobile-menu-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:16px 0}.mobile-menu-grid button{min-height:56px;background:#fff8e7;border:1px solid #bec7b7;border-radius:7px;font-size:12px;color:#49677d}.mobile-menu-foot{display:flex;gap:8px;justify-content:space-between}.mobile-menu-foot button{background:none;border:0;color:#85918b;font-size:10px;padding:10px 4px}
@media(max-width:780px){
html,body{width:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
body{position:fixed;inset:0;background:#e3edf0}
header{position:absolute;top:0;left:0;right:0;z-index:20;height:48px;padding:0 12px;gap:12px;background:#f6f7ed;border-bottom:1px solid #c3d0ca}
.brand{font-size:14px;letter-spacing:0;line-height:1.3}.brand span{display:none}.top-actions{display:none}
#mobile-menu-open{display:block;padding:8px 13px;min-height:36px;background:#e8eee3;border:1px solid #b5c6bd;border-radius:7px;font-size:12px;color:#4a6a7b}
main{position:absolute;top:48px;bottom:0;left:0;right:0;display:block;width:100%;height:auto;min-height:0;margin:0;max-width:none}
.playfield{width:100%;height:100%;min-height:0;border:0;overflow:hidden}
#world{width:100%;height:100%;display:block}
aside{display:none!important}
.location{top:10px;left:12px;max-width:145px;padding:7px 9px;font-size:10px;gap:6px;box-shadow:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:6px}.location small{display:none}.live-dot{width:5px;height:5px;flex:none}
#hp{top:15px;right:12px;font-size:14px;letter-spacing:1px;text-shadow:0 1px #fff}
#mobile-glasses{position:absolute;z-index:9;display:block;top:10px;right:76px;padding:7px 8px;border:1px solid #b5b7c6;border-radius:6px;background:#f3edf4;color:#77758b;font:10px gal;min-height:29px}
#mobile-glasses[hidden]{display:none}
.pet-chip,#ticker,.vignette,#glasses,.mission-sheet,.map-button{display:none!important}
.current-goal{position:absolute;top:49px;left:12px;right:12px;max-width:none;height:30px;padding:6px 9px;border:1px solid #c8c6ad;border-radius:6px;background:#fff5ddeb;color:#637b7e;font-size:10px;line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;z-index:4}
.controls{left:14px;right:14px;bottom:max(18px,env(safe-area-inset-bottom));align-items:end;z-index:8;gap:15px}
#joystick{width:90px;height:90px;flex:none;border:2px solid #f9fbefd9;background:#e3ece679;box-shadow:0 2px 15px #536b7b22}
#stick{width:40px;height:40px;left:23px;top:23px;background:#809daabf;border:2px solid #f4f3df;box-shadow:0 3px 0 #58738333}
.action-area{max-width:160px;min-width:0}
#nearby{max-width:160px;font-size:10px;line-height:1.4;padding:6px 8px;margin:0 0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-shadow:0 2px 5px #536b7b15}
#nearby[hidden]{display:none}
#interact{min-width:88px;min-height:58px;padding:13px 18px;font-size:14px;border:2px solid #839c99;background:#fff5d9;color:#4e6c78;box-shadow:0 3px 0 #839c99;border-radius:9px}
#interact small{display:none}#interact:disabled{opacity:.45;box-shadow:none}
.toast{top:90px;max-width:calc(100% - 40px);padding:9px 12px;font-size:11px;z-index:12}
#held-item{bottom:119px;left:12px;max-width:calc(100% - 24px);padding:5px 8px;font-size:10px;pointer-events:none;z-index:5}
#reward-banner{bottom:124px;max-width:calc(100% - 32px);padding:7px 12px;min-height:58px;gap:10px}#reward-banner svg{width:42px;height:42px}#reward-banner b{font-size:12px}#reward-banner small{font-size:9px}
#thought{top:90px!important;bottom:auto!important;left:14px!important;right:14px!important;max-width:none!important;width:auto!important;font-size:12px;z-index:13}
#titan-alert{top:135px;padding:10px;font-size:12px;width:calc(100% - 32px);z-index:16}
#modal:not(.conversation){max-height:calc(100dvh - 24px);width:calc(100% - 24px);padding:18px;border-radius:10px}
#modal:not(.conversation)>#close{position:sticky;top:0;float:right;z-index:10;background:#faf5e5dd;border-radius:50%;line-height:28px;width:30px;height:30px;font-size:25px;padding:0}
#modal:not(.conversation) h2{font-size:18px;clear:none;margin:10px 0 15px}#modal p{font-size:12px}
.kakao-chat{max-height:55dvh}.archive-desktop,.archive-files{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:780px) and (max-height:520px){header{height:40px}main{top:40px}.current-goal{max-width:50%;top:45px}.controls{bottom:10px}#joystick{width:76px;height:76px}#stick{left:16px;top:16px}#interact{min-height:48px;padding:9px 16px}}
