/* Keep the established illustrated frames; only requested HUD layout changes. */
html,body,#game,#game *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none;touch-action:pan-x pan-y;-webkit-text-size-adjust:100%;text-size-adjust:100%}
#game input,#game select,#game textarea{font-size:16px}
#game #world,#game .combat,#game .combat *,#game #quickItems *{touch-action:none}
#game #statusStack{left:12px;width:260px;gap:4px}
#game #statusStack .hero-hud{width:100%!important;gap:8px;padding:8px;background:#10242bed;border:1px solid #c0a069;border-radius:5px;box-shadow:0 2px 8px #0009}
#game #statusStack .hero-name strong{font-size:16px;color:#fff4d9}
#game #statusStack .hero-name span{font-size:14px;color:#fff9e9;font-weight:700;white-space:nowrap}
#game #statusStack .hero-info{flex:1}
#game #statusStack .meter.health{height:18px;border:1px solid #f2d4a0;background:#281619;margin-top:4px}
#game #statusStack .meter.health i{background:linear-gradient(#dc6557,#b32e39)}
#game #statusStack .meter.stamina{position:relative;height:18px;border:1px solid #d6d79e;background:#142321;margin-top:4px;overflow:hidden}
#game #statusStack .meter.stamina i{background:linear-gradient(#548c6b,#205343)}
#game #stamText{position:absolute;inset:0;text-align:center;font:700 12px/16px sans-serif;color:#fffce7;text-shadow:0 1px 2px #000,1px 0 2px #000}
#game #statusStack #taskToggle{pointer-events:auto;align-self:flex-start;width:78px;height:36px;min-height:36px;padding:0 4px;font-size:13px;border-width:5px!important;border-image-width:5px!important}
#game #statusStack #battleTracker{max-height:min(180px,24vh);margin:0}
#game #statusStack.tasks-collapsed #battleTracker{display:none!important}
#game #statusStack.tasks-collapsed #taskToggle{margin-left:-12px}
#game #quickItems{position:absolute;z-index:7;left:8px;right:auto;top:auto;bottom:calc(88px + env(safe-area-inset-bottom));transform:none;display:flex;align-items:end;gap:3px;pointer-events:auto;width:194px}
#game #quickItems button{width:39px;min-width:0;min-height:58px;height:58px;padding:2px;flex:0 0 39px;border-width:4px!important;border-image-width:4px!important;overflow:hidden}
#game #quickItems button .painted-icon{width:30px;height:30px;margin:0}
#game #quickItems button b{font-size:10px;line-height:1.1;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game #quickItems button small{font-size:10px!important;line-height:1.1!important}
#game #quickItems button>span{height:24px;line-height:1}
#game #quickItems .supply-icon{width:24px;height:24px}
#game #quickItems .quick-config{width:26px!important;flex-basis:26px;height:44px;min-height:44px;padding:0}
#game #quickItems.hidden{display:none!important}
#game #interactionDock{bottom:calc(335px + env(safe-area-inset-bottom));width:min(280px,74vw)}
#game:not(.safe-scene) #interactionDock{bottom:calc(335px + env(safe-area-inset-bottom))}
#game .combat,#game.is-battle .combat{position:absolute;right:8px;bottom:calc(88px + env(safe-area-inset-bottom));width:258px;height:232px;pointer-events:none;transform:none}
#game .combat .skills-row,#game .combat .attack-row{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;pointer-events:none}
#game .combat button{pointer-events:auto;position:absolute;margin:0;touch-action:none}
#game .combat .ability{width:78px;height:78px;min-width:78px;min-height:78px;border-radius:50%;padding:3px}
#game .combat .ability>.painted-icon{width:60px;height:60px}
#game .combat [data-action="whirl"]{left:0;top:94px}
#game .combat [data-action="shock"]{left:52px;top:12px}
#game .combat [data-action="heal"]{left:140px;top:24px}
#game .combat [data-action="dodge"]{left:88px;bottom:0;top:auto;width:64px;height:64px;min-width:64px;min-height:64px}
#game .combat [data-action="dodge"]>.painted-icon{width:48px;height:48px}
#game .combat .attack{right:0;bottom:0;top:auto;left:auto;width:96px;height:96px;min-width:96px;min-height:96px;padding:4px}
#game .combat .attack>.painted-icon{width:74px;height:74px}
#game .combat .ability b,#game .combat .attack b{font-size:13px!important;line-height:1.2;text-shadow:0 1px 3px #000,1px 0 3px #000}
#game #auto{left:auto;right:0;top:-34px;bottom:auto;width:74px;height:44px;min-height:44px;padding:0 2px;font-size:12px;border-width:5px!important;border-image-width:5px!important;display:flex;align-items:center;justify-content:center;gap:3px}
#game #auto span{font-size:12px}
#game #navigationStatus{bottom:calc(382px + env(safe-area-inset-bottom));max-width:70%;font-size:12px}
#game #minimapDock{position:absolute;z-index:8;top:calc(80px + env(safe-area-inset-top));right:8px;width:118px;pointer-events:auto;color:#fff0d0}
#game #minimapDock:has(#worldMinimap.hidden){display:none}
#game:has(#worldMinimap:not(.hidden)) .location{display:none!important}
#game #minimapToggle{position:absolute;top:0;right:0;width:32px;height:32px;min-height:32px;padding:0 3px;font-size:12px;border-width:5px!important;border-image-width:5px!important;z-index:1}
#game #minimapView{margin-top:0;position:relative;background:#142a31ed;border:1px solid #c1a267;border-radius:4px;overflow:hidden}
#game #worldMinimap{position:static;display:block;width:100%;height:auto;aspect-ratio:3/2;max-width:none;border:0;opacity:1;pointer-events:auto;cursor:zoom-in;background:#13262c;box-shadow:none}
#game #worldMinimap.hidden{display:none!important}
#game #minimapExpand{display:block;width:calc(100% - 32px);height:32px;min-height:32px;font-size:11px;padding:0;border-width:4px!important;border-image-width:4px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game .map-legend{display:none}
#game #minimapDock.collapsed{right:0;width:72px}
#game #minimapDock.collapsed #minimapToggle{width:72px}
#game #minimapDock.collapsed #minimapView{display:none}
#game #minimapDock.expanded{position:absolute;top:50%;left:50%;right:auto;transform:translate(-50%,-50%);width:min(88vw,650px,115dvh);z-index:19;filter:drop-shadow(0 8px 20px #000b)}
#game #minimapDock.expanded #minimapView{margin-top:0}
#game #minimapDock.expanded #minimapToggle{display:none}
#game #minimapDock.expanded #minimapExpand{width:100%;height:44px;min-height:44px;font-size:16px}
#game #minimapDock.expanded #worldMinimap{cursor:zoom-out}
#game #minimapDock.expanded .map-legend{display:block;margin:0;padding:6px;text-align:center;color:#fff2cc;font-size:12px;line-height:1.5}
#game:has(#panel:not(.hidden)) #minimapDock,#game:has(#welcome:not(.hidden)) #minimapDock,#game:has(#sceneLoading:not(.hidden)) #minimapDock,#game:has(#panel:not(.hidden)) #quickItems,#game:has(#welcome:not(.hidden)) #quickItems,#game:has(#sceneLoading:not(.hidden)) #quickItems{visibility:hidden;pointer-events:none}
#game #panel .zone-levels span,#game #panel .zone-levels span *{color:#fff2cf!important;background-color:#1d3940;text-shadow:none;opacity:1}
#game #panel .zone-levels span{display:inline-block;padding:5px 8px;line-height:1.4}
#game #panel .system-guide{padding:10px 12px;border:1px solid #857344;border-radius:4px;background:#f7edcf;margin:0 0 12px;color:#362b23}
#game #panel .system-guide p{margin:6px 0;font-size:14px;line-height:1.65}
#game .guide-actions{display:flex;flex-wrap:wrap;gap:4px}
#game .guide-actions button{flex:1;font-size:12px;white-space:nowrap;padding:3px!important}
#game .bag-equipment{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:8px}
#game .bag-equipment .bag-equipped-slot{min-width:0;min-height:68px;display:flex;align-items:center;gap:3px;padding:3px!important;border-width:5px!important;border-image-width:5px!important}
#game .bag-equipped-slot>span{flex:none}
#game .bag-equipped-slot .painted-icon{width:34px;height:34px}
#game .bag-equipped-slot div{min-width:0}
#game .bag-equipped-slot b{font-size:12px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#game .bag-equipped-slot small{font-size:10px}
#game #panel .bag-equipped-slot>span{width:32px;height:32px;flex:0 0 32px}
#game #panel .bag-equipped-slot .painted-icon{width:32px;height:32px;flex:0 0 32px}
#game #panel .bag-equipped-slot b{font-size:12px!important;line-height:1.3;white-space:nowrap}
#game #panel .bag-equipped-slot small{font-size:10px!important;line-height:1.2!important;margin-top:2px}
#game #panel .bag-equipped-slot>div{width:100%;flex:0 1 auto}
#game .bag-tabs{display:flex;flex-wrap:wrap;gap:3px;margin:4px 0}
#game .bag-tabs>button{min-width:0;flex:1 0 24%;font-size:12px;min-height:36px;padding:2px!important;border-width:5px!important;border-image-width:5px!important}
#game .bag-tools{display:flex;gap:6px;align-items:center;justify-content:space-between;font-size:12px;margin:6px 0}
#game .bag-tools select{max-width:130px}
#game .bag-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
#game .bag-filters label{font-size:12px;min-width:0;color:#382c24}
#game .bag-filters select{display:block;width:100%;min-width:0;min-height:38px;padding:3px;color:#302b22!important;background:#fff9e4!important;border:1px solid #8b7c59;border-radius:3px}
#game #panel .bag-results{font-size:12px;margin:5px 0}
#game .modal-inventory .inventory-grid{grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:5px;max-height:none;padding:1px}
#game .inventory-grid .inv-cell{min-width:0}
#game .inventory-grid .inv-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:112px;min-height:112px;padding:5px 2px;gap:3px;overflow:hidden}
#game .inventory-grid .inv-tile .painted-icon{width:45px;height:45px}
#game .inventory-grid .inv-tile .supply-icon{width:40px;height:40px}
#game .inventory-grid .inv-tile>span{height:45px}
#game .inventory-grid .inv-tile strong{font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%;line-height:1.3;min-height:16px}
#game #panel .inventory-grid .inv-tile small{font-size:10px!important;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;line-height:1.3!important;display:block;flex-shrink:0}
#game .inventory-grid .inv-tile .tile-quantity{font-size:12px}
#game .batch-bar{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
#game .batch-bar button{font-size:12px;padding:3px!important;flex:1}
@media(orientation:portrait){
 #game #statusStack{top:calc(66px + env(safe-area-inset-top));left:8px;width:calc(100vw - 142px);max-width:260px}
 #game #statusStack .hero-hud{padding:6px;gap:5px}
 #game #statusStack .hero-name strong{font-size:14px}
 #game #statusStack .hero-name span{font-size:12px}
 #game #statusStack .portrait{width:38px;min-width:38px;height:42px}
 #game #statusStack .portrait-art{width:38px;height:42px}
 #game .modal-inventory .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 #game .bag-equipment .bag-equipped-slot{flex-direction:column;min-height:82px;text-align:center}
}
@media(orientation:portrait) and (max-width:360px){
 #game #statusStack{width:calc(100vw - 120px)}
 #game #minimapDock{width:100px}
 #game .combat,#game.is-battle .combat{width:234px;height:222px;bottom:calc(80px + env(safe-area-inset-bottom))}
 #game .combat .ability{width:72px;height:72px;min-width:72px;min-height:72px}
 #game .combat [data-action="shock"]{left:42px;top:14px}
 #game .combat [data-action="heal"]{left:125px;top:26px}
 #game .combat [data-action="dodge"]{left:88px;width:54px;min-width:54px;height:54px;min-height:54px}
 #game .combat .attack{width:90px;min-width:90px;height:90px;min-height:90px}
 #game #quickItems{width:156px;gap:2px;bottom:calc(80px + env(safe-area-inset-bottom))}
 #game #quickItems button{width:31px;flex-basis:31px;height:52px;min-height:52px}
 #game #quickItems .quick-config{width:24px!important;flex-basis:24px;min-height:44px;height:44px}
 #game #quickItems button .painted-icon{width:26px;height:26px}
 #game #quickItems button b{font-size:9px}
 #game #statusStack .hero-name span{font-size:11px}
 #game #statusStack .hero-hud .portrait{display:none}
 #game #statusStack #battleTracker{max-height:60px;min-height:0}
 #game #interactionDock,#game:not(.safe-scene) #interactionDock{bottom:calc(325px + env(safe-area-inset-bottom));width:180px;left:auto;right:8px;transform:none}
 #game #navigationStatus{bottom:calc(375px + env(safe-area-inset-bottom))}
 #game .bag-filters{grid-template-columns:1fr 1fr}
 #game .modal-inventory .inventory-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(orientation:landscape) and (max-height:600px){
 #game #statusStack{top:calc(8px + env(safe-area-inset-top));width:228px;left:8px}
 #game #statusStack .hero-hud{padding:5px}
 #game #statusStack .hero-name strong{font-size:14px}
 #game #statusStack .hero-name span{font-size:12px}
 #game #statusStack #battleTracker{max-height:85px}
 #game #minimapDock{top:calc(56px + env(safe-area-inset-top));width:108px}
 #game .combat,#game.is-battle .combat{bottom:calc(8px + env(safe-area-inset-bottom));width:258px;height:210px}
 #game .combat [data-action="whirl"]{top:72px}
 #game .combat [data-action="shock"]{top:-10px}
 #game .combat [data-action="heal"]{top:2px}
 #game #auto{top:-58px;right:124px}
 #game #quickItems{bottom:calc(8px + env(safe-area-inset-bottom))}
 #game #interactionDock,#game:not(.safe-scene) #interactionDock{bottom:calc(75px + env(safe-area-inset-bottom));width:min(260px,32vw)}
 #game #navigationStatus{bottom:calc(125px + env(safe-area-inset-bottom));max-width:32%}
 #game .location{max-width:30%}
 #game #minimapDock.expanded{top:50%;width:min(70vw,90dvh)}
 #game .modal-inventory .inventory-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(orientation:landscape) and (max-width:600px){
 #game #quickItems{width:158px;gap:2px}
 #game #quickItems button{width:31px;flex-basis:31px}
 #game #quickItems .quick-config{width:24px!important;flex-basis:24px}
 #game #statusStack{width:186px}
 #game #statusStack .hero-hud .portrait{display:none}
 #game #statusStack #battleTracker{max-height:62px}
 #game .combat,#game.is-battle .combat{transform:scale(.9);transform-origin:bottom right}
 #game #minimapDock{top:52px;width:96px}
 #game .combat [data-action="heal"]{top:32px}
 #game #interactionDock,#game:not(.safe-scene) #interactionDock{top:55px;bottom:auto;left:220px;right:auto;width:calc(100vw - 428px);transform:none}
 #game #interactionDock #interact{font-size:12px;padding:2px}
}
