/* Touch controls and viewport-safe game surfaces. Desktop keeps its shortcuts. */
.lure-options>label{display:block;margin:12px 0 5px;font-size:13px;line-height:1.4}
.lure-options>small{display:block;margin:7px 0 10px;font-size:12px;line-height:1.5;color:#b6c7cd}
.lure-options>#lure-status{padding:9px 10px;margin:12px 0;border-left:2px solid #d7ac58;background:#d7ac5810;font-size:12px;line-height:1.5}
.touch-action-label,.mobile-menu-toggle,.touch-target-button,#touch-joystick{display:none}
#toolbar .mobile-menu-toggle{display:none!important}
.mobile-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mobile-menu-grid .menu-button{display:flex;align-items:center;gap:12px;text-align:left;min-height:64px;padding:12px}
.mobile-menu-grid img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated}
.device-settings label{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0;font-size:14px;color:#e7e5d9}
.device-settings label small{display:block;max-width:360px;font-size:12px;line-height:1.5;color:#a7bbc8;margin-top:5px}
.device-settings input[type=checkbox]{width:24px;height:24px;flex-shrink:0;accent-color:#efbf63}
.device-settings .device-zoom{display:grid;gap:12px}.device-zoom input{width:100%;min-height:32px;accent-color:#efbf63}.device-zoom output{float:right;color:#f4ce83}
.compact-hud .location-banner,.compact-hud #objectives-hud{display:none}
.reduce-motion *, .reduce-motion *::before,.reduce-motion *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}
.touch-ui .movement-hint{display:none}
.touch-ui #touch-joystick:not([hidden]){display:block;position:fixed;z-index:9;left:max(12px,env(safe-area-inset-left));bottom:calc(211px + env(safe-area-inset-bottom));width:86px;text-align:center;user-select:none}
.joystick-label{display:block;font-size:11px;font-weight:700;color:#e4ddc5;text-shadow:0 1px 3px #000;margin-bottom:4px}
.joystick-base{position:relative;width:86px;height:86px;border-radius:50%;border:1px solid #cfaf6880;background:radial-gradient(circle,#244044a0,#0b1c29b0);box-shadow:inset 0 0 0 12px #ffffff08;touch-action:none}
.joystick-base::before,.joystick-base::after{content:'';position:absolute;background:#e1d5aa25;pointer-events:none}
.joystick-base::before{left:50%;top:8px;bottom:8px;width:1px}.joystick-base::after{top:50%;left:8px;right:8px;height:1px}
.joystick-thumb{position:absolute;left:27px;top:27px;width:30px;height:30px;border-radius:50%;background:#e2bc6e;border:2px solid #ffe0a3;box-shadow:0 3px 12px #0006;pointer-events:none}
#touch-joystick.active .joystick-base{border-color:#ffd57d;background:#0b1c29dc}
.touch-ui .touch-target-button{display:block;position:fixed;right:max(12px,env(safe-area-inset-right));bottom:calc(212px + env(safe-area-inset-bottom));z-index:9;min-height:44px;padding:9px 14px;background:#10222fe8;border:1px solid #c7a75f;border-radius:22px;color:#f2d697;font:600 12px 'DM Sans',sans-serif}
.touch-ui .hotbar kbd{display:none}.touch-ui .touch-action-label{display:block}
.touch-ui :is(button,input,select,textarea,a){touch-action:manipulation}
.touch-ui .chat-compose input,.touch-ui .chat-recipient select{font-size:16px}
.touch-ui .window-button{min-width:44px;min-height:44px}

@media(max-width:1100px) and (max-height:680px) and (orientation:portrait){
 .touch-ui .location-banner,.touch-ui #objectives-hud,.touch-ui .world-context{display:none}
 .touch-ui .vitals{width:calc(100% - 16px);max-width:none;padding:6px}
 .touch-ui #active-effects{max-width:calc(100% - 16px)!important;flex-wrap:nowrap}
 .touch-ui #touch-joystick:not([hidden]){width:70px}.touch-ui .joystick-label{display:none}
 .touch-ui .joystick-base{width:70px;height:70px}.touch-ui .joystick-thumb{left:19px;top:19px}
}

@media(max-width:1100px){
 .game-world{height:100dvh;min-height:0;overflow:hidden}.game-world:before{height:calc(112px + env(safe-area-inset-top))}
 .world-brand{top:calc(10px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));height:30px}.world-brand img{width:22px;height:22px}.world-brand>div{font-size:16px}.world-brand small{display:none}
 .wallet{top:calc(5px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));gap:6px}.wallet>span{font-size:11px}.wallet>span img{width:17px;height:17px}.wallet-settings{width:40px;height:40px}.wallet>i{height:16px}
 #toolbar{position:absolute;top:calc(50px + env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));width:auto;height:56px;display:grid;grid-template-columns:minmax(102px,1.25fr) repeat(3,minmax(0,1fr));gap:6px;overflow:visible;padding:0;background:none;border:0;transform:none}
 #toolbar .tool-button{display:none!important;min-width:0;height:56px;font-size:11px;border:1px solid #385367;border-radius:9px;background:#122431f2}
 #toolbar :is([data-panel=character],[data-panel=backpack],.mobile-menu-toggle){display:flex!important;justify-content:center;gap:4px}
 #toolbar .tool-button .toolbar-sprite{width:26px;height:26px}#toolbar .tool-button span{font-size:11px}
 #toolbar .play-button{width:auto;min-width:0;min-height:56px;padding:6px 10px;border-radius:9px;gap:8px;font-size:22px;display:flex;align-items:center;justify-content:center}.play-button img{width:26px;height:30px}.play-button small{font-size:9px!important}
 .mobile-menu-toggle .mobile-menu-symbol{font-family:Arial,sans-serif;font-size:25px!important;line-height:26px}
 .vitals{left:max(8px,env(safe-area-inset-left));top:calc(116px + env(safe-area-inset-top));width:208px;min-width:0;max-width:208px;padding:9px;gap:6px}.vital-portrait{width:32px;flex-shrink:0}.vital-portrait img{max-width:32px}.vital-name strong{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vital-name>span{font-size:10px}.vital-bars{min-width:0}.vital-row{gap:4px}.vital-track{min-width:0}.vital-track strong{font-size:10px}.vital-xp-label{font-size:8px;gap:4px}.vital-xp-label>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .location-banner{top:calc(116px + env(safe-area-inset-top));left:auto;right:max(8px,env(safe-area-inset-right));width:calc(100% - 234px);max-width:220px;padding:8px;text-align:right;border:0;background:#10222fdb}.location-banner>span{display:block;font-size:8px;letter-spacing:.5px}.location-banner h1{font-size:16px;line-height:1.2;margin:5px 0;overflow-wrap:anywhere}.location-banner p{font-size:10px;line-height:1.4;max-width:none;white-space:normal}.location-banner>div>span{display:none}
 #active-effects{z-index:6;gap:4px;max-width:228px!important}#active-effects>button{min-height:36px;font-size:10px;padding:5px}.active-effects img{width:18px}#effect-description{font-size:12px}
 #objectives-hud{left:8px;top:268px;width:208px;z-index:5}#objectives-hud summary{min-height:36px;display:flex;align-items:center;font-size:11px;padding:8px 10px}#objectives-content{max-height:180px;overflow:auto}
 .hotbar{position:fixed;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));top:auto;transform:none;width:auto;max-width:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:6px;border-radius:12px;background:#0b1828f2;z-index:10}
 .hotbar .hotbar-button{width:100%;height:55px;min-width:0;margin:0;padding:3px 3px 15px;position:relative;display:flex;align-items:center;justify-content:center;border-radius:7px;overflow:hidden}.hotbar-button img{width:30px;height:30px}.hotbar-button small{top:3px;right:4px;bottom:auto;font-size:10px;text-shadow:0 1px 2px #000}.hotbar-button kbd{display:none}.hotbar-separator{display:none}
 .hotbar-button .touch-action-label{display:block;position:absolute;left:2px;right:2px;bottom:4px;font:600 10px 'DM Sans',sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;color:#f1e3c3;pointer-events:none}
 .hotbar-button[data-action=attack]{order:-1;background:#4a3820;border-color:#edbd64}.hotbar-button[data-action=attack] .touch-action-label{color:#ffdf91}
 .hunt-controls{position:fixed;left:max(8px,env(safe-area-inset-left));right:68px;top:auto;bottom:calc(142px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1.25fr 1fr .85fr;gap:3px;padding:3px;max-width:none;z-index:10;background:#102330ee;border-radius:10px}.hunt-controls button{min-height:44px;font-size:11px;padding:5px 4px;white-space:normal}.hunt-controls #quick-auto{min-width:0}
 #chat-launcher{right:max(8px,env(safe-area-inset-right));bottom:calc(144px + env(safe-area-inset-bottom));width:52px;height:48px;min-height:44px;padding:3px;border-radius:10px;font-size:10px;z-index:11}#chat-launcher img{width:22px;height:22px}#chat-launcher .chat-badges{position:absolute;top:-7px;right:0}
 .world-context{left:50%;right:auto;transform:translateX(-50%);bottom:calc(198px + env(safe-area-inset-bottom));max-width:calc(100% - 24px);width:max-content;font-size:10px;line-height:1.3;padding:5px 10px;min-height:0;pointer-events:none;white-space:normal;text-align:center}.world-context .context-help{display:none}.world-context .context-divider{display:none}
 .target-hud{left:50%;bottom:calc(240px + env(safe-area-inset-bottom));top:auto;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 220px);padding:6px;font-size:10px;white-space:normal;text-align:center;pointer-events:none}
 .world-status,.movement-hint,.mobile-panels{display:none}
 #challenge-hud{top:auto;bottom:calc(272px + env(safe-area-inset-bottom));max-width:calc(100% - 24px);font-size:11px;padding:5px;z-index:8}#challenge-hud .menu-button{min-height:40px;font-size:11px}
 #expedition-hud{top:auto;bottom:calc(269px + env(safe-area-inset-bottom));max-width:calc(100% - 24px);font-size:11px;min-height:40px}
 .topidle-hud{top:auto;bottom:calc(215px + env(safe-area-inset-bottom));max-width:calc(100% - 24px);font-size:11px;min-height:40px}
 #toast-stack{position:fixed;top:auto;bottom:calc(262px + env(safe-area-inset-bottom));width:calc(100% - 36px);z-index:80;pointer-events:none}.toast{font-size:12px;line-height:1.4;padding:10px 12px;max-width:100%}
 body:has(.game-window:not([hidden])) #chat-launcher{display:none}
 #game-modal[open]{position:fixed;display:flex;flex-direction:column;overflow:hidden;top:calc(var(--visual-top,0px) + env(safe-area-inset-top) + 8px);bottom:auto;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));margin:0 auto;width:auto;max-width:760px;max-height:calc(var(--visual-height,100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);border-radius:12px}
 #game-modal>header{flex-shrink:0;padding:10px 14px;gap:12px;min-height:60px}#game-modal>header h2{font-size:22px;line-height:1.2;min-width:0;overflow-wrap:anywhere}#game-modal>header>.window-button{width:44px;height:44px;min-width:44px;flex-shrink:0}
 #game-modal #modal-body{overflow:auto;overscroll-behavior:contain;min-height:0;padding:14px;font-size:14px;-webkit-overflow-scrolling:touch}
 #game-modal :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.game-window :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-width:0;max-width:100%}
 #game-modal :is(.menu-button,.action-button),.game-window :is(.menu-button,.panel-action){min-height:44px;font-size:13px}.dialog-actions{flex-wrap:wrap;gap:8px}.dialog-actions>button{flex:1 1 110px}.menu-tabs{flex-wrap:wrap;gap:6px}.menu-tabs>.menu-button{min-width:0}
 .travel-tabs{gap:8px;min-height:44px;flex-shrink:0}.travel-tabs .menu-button{padding:10px 8px;min-height:44px}
 .game-window[data-floating=true]{width:min(390px,calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)))!important;max-width:none!important;max-height:calc(var(--visual-height,100dvh) - 16px)!important;z-index:30}
 .game-window[data-floating=true] .window-header{min-height:52px;padding:5px 8px}.game-window .window-button{width:44px;height:44px}.game-window .window-controls{gap:4px}.game-window[data-floating=true] .window-body{padding:12px;max-height:var(--panel-space)!important;overflow:auto;overscroll-behavior:contain}
 .game-window .auto-setting{padding:9px}.auto-toggle{min-height:44px;min-width:54px}.auto-setting-title strong{font-size:13px}.auto-setting-title small{font-size:11px}.auto-setting select{min-height:42px}
 .backpack-window .inventory-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.inventory-grid .item-slot{width:100%;height:auto;min-height:46px;aspect-ratio:1}.bag-filters .menu-search{min-height:42px;font-size:14px}.bag-pages .menu-button{min-height:44px}.bag-move-help{font-size:12px}
 .chat-dock-window{max-height:calc(var(--visual-height,100dvh) - 16px);height:min(420px,calc(var(--visual-height,100dvh) - 16px));width:min(410px,calc(100vw - 16px));bottom:calc(var(--keyboard-inset,0px) + 8px);right:8px;z-index:60}
 .chat-drag{min-height:52px;padding:5px 10px;flex-shrink:0}.chat-drag button{width:44px;height:44px}.chat-tabs{flex-shrink:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:4px}.chat-tabs button{min-height:44px;padding:4px 2px;font-size:12px;min-width:0}.chat-compose{padding:8px;gap:6px;flex-shrink:0}.chat-compose input{font-size:16px;min-height:44px}.chat-compose button{min-height:44px}.chat-messages{min-height:40px;overscroll-behavior:contain}.chat-notice{font-size:10px;line-height:1.3;padding:0 10px 8px;flex-shrink:0}
 .chat-recipient{flex-shrink:0}.chat-recipient select{font-size:16px;min-height:40px}
 .store-columns{grid-template-columns:minmax(0,1fr)}.store-columns aside{display:block;min-width:0}.store-wallet{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px}.store-wallet .item-icon{width:40px;height:40px}.store-wallet b{font-size:17px}.store-wallet small{font-size:10px}.store-wallet .menu-button{width:auto;padding:8px;min-width:98px;grid-column:auto;margin:0}.store-currency-note{font-size:12px}
 .store-columns .category-list{display:flex;flex-direction:row;overflow-x:auto;gap:6px;padding:10px 0;scrollbar-width:thin}.store-columns .category-list button{flex:0 0 auto;min-height:44px!important;font-size:13px;padding:8px 12px;white-space:nowrap}.store-columns .category-list button span{margin-left:10px}.store-main{padding:12px}.store-heading{gap:10px}.store-heading h3{font-size:20px}.store-grid{grid-template-columns:1fr}
 .item-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.item-stat-grid>div{min-width:0;flex-wrap:wrap}.equipment-comparison{overflow-wrap:anywhere}.spell-library{grid-template-columns:1fr}.spell-library canvas{max-width:100%;height:auto}
 .route-editor{grid-template-columns:1fr}.route-editor canvas{max-width:100%;height:auto}.tree-layout{grid-template-columns:1fr}.market-row{flex-wrap:wrap}.saga-forms{grid-template-columns:repeat(3,minmax(0,1fr))}.saga-forms img{max-width:100%}
 .hunt-mode{min-height:80px}.hunt-mode small{font-size:11px}.saga-menu,.rpg-menu,.menu-main,.store-main,.market-main{min-width:0}
 .saga-hero-portrait .saga-badge{right:0;max-width:100%}
}
@media(max-width:380px){.world-brand>div{font-size:14px}.world-brand img{width:18px}.wallet{gap:4px}.wallet>span{font-size:10px}.wallet-settings{width:36px}.vitals{width:198px;max-width:198px}.location-banner{width:calc(100% - 222px)}#active-effects{max-width:198px!important}#objectives-hud{width:198px}.store-wallet{grid-template-columns:32px 1fr;gap:8px}.store-wallet .menu-button{grid-column:1/-1;width:100%}.hotbar .touch-action-label{font-size:9px}}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
 .game-world:before{height:calc(60px + env(safe-area-inset-top))}
 .world-brand{display:none}#toolbar{top:calc(6px + env(safe-area-inset-top));width:390px;height:48px;right:auto;grid-template-columns:1.2fr repeat(3,1fr)}#toolbar .tool-button,#toolbar .play-button{height:48px;min-height:48px}#toolbar .tool-button{flex-direction:row}#toolbar .tool-button .toolbar-sprite{width:22px;height:22px}#toolbar .play-button img{width:22px}#toolbar .play-button small{display:none}
 .wallet{top:8px}.vitals{top:64px;width:220px;max-width:220px}.location-banner{top:64px;width:210px;max-width:210px}.location-banner>div{display:none}
 .hotbar{grid-template-columns:repeat(10,minmax(0,1fr));gap:5px;bottom:calc(5px + env(safe-area-inset-bottom));padding:5px}.hotbar .hotbar-button{height:51px}
 .hunt-controls{bottom:calc(74px + env(safe-area-inset-bottom));left:calc(50% - 160px);right:auto;width:320px}.world-context{bottom:calc(126px + env(safe-area-inset-bottom));max-width:320px}.target-hud{bottom:calc(153px + env(safe-area-inset-bottom));max-width:280px}
 #chat-launcher{bottom:calc(76px + env(safe-area-inset-bottom))}.touch-ui #touch-joystick:not([hidden]){bottom:calc(77px + env(safe-area-inset-bottom));left:18px;width:76px}.joystick-base{width:76px;height:76px}.joystick-thumb{left:22px;top:22px}.joystick-label{display:none}
 .touch-ui .touch-target-button{right:74px;bottom:calc(77px + env(safe-area-inset-bottom))}
 #objectives-hud{left:auto;right:8px;top:110px!important;width:210px}#active-effects{top:164px!important;left:8px!important;max-width:220px!important}#objectives-content{max-height:110px}
 #challenge-hud,#expedition-hud{bottom:148px;top:auto}.mobile-menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.mobile-menu-grid .menu-button{min-height:54px}#toast-stack{top:65px;bottom:auto;width:380px}
}
