#adventureScreen{overflow:hidden;background:#312f22;isolation:isolate;color:#473b27}
#stageBagPanel[hidden],#mapZoom[hidden]{display:none}
#mapView,#adventureScreen .adv-body{position:absolute;inset:0;max-width:none;width:100%;height:100%;margin:0;padding:0}
#mapView[hidden]{display:none}
#mapView .map-frame,#lakeView,#treeView{position:absolute;inset:0;border:0;border-radius:0;box-shadow:none;background:#312f22}
#mapView canvas#dungeonCanvas,#mapView canvas#lakeCanvas,#mapView canvas#treeCanvas{display:block;width:100%;height:100dvh;min-height:0;touch-action:manipulation}
#mapView .tree-tools,#mapView .tree-language,#treeRoomHint,#adventureScreen .tree-top-nav,#adventureScreen .adv-foot,#advSaveStatus{display:none!important}
#treeView #livingTools[hidden],#treeView #storageTools[hidden]{display:none}
#adventureScreen .adv-top{position:absolute;inset:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) auto max(14px,env(safe-area-inset-left));display:flex;gap:8px;justify-content:flex-end;padding:0;background:none;border:0;pointer-events:none;z-index:3}
#adventureScreen .adv-top>div:first-child{margin-right:auto}
#adventureScreen .adv-top small{display:none}
#adventureScreen .adv-top h2{padding:9px 12px;background:#344631;color:#fff4d8;border-radius:13px;border:1px solid #c3b68a;font-size:clamp(.76rem,2.4vw,1rem);line-height:1.24;box-shadow:0 4px 14px #28221470}
#adventureScreen .adv-coins,#stageSettingsButton,.stage-dock{border:1px solid #876949;background:linear-gradient(160deg,#fff1d0,#e9d5a4);color:#4e3925;box-shadow:0 4px 14px #22180b6b,inset 0 0 0 2px #fff0c85c;border-radius:14px}
#adventureScreen .adv-coins{padding:9px 12px;font-weight:700;align-self:center;white-space:nowrap}
#stageSettingsButton,.stage-dock button,.stage-panel button,.stage-close{min-height:44px;font:inherit;font-weight:650;cursor:pointer}
#stageSettingsButton{pointer-events:auto;padding:4px 10px;white-space:nowrap}
.stage-dock{position:absolute;z-index:4;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;width:max-content;max-width:calc(100% - 18px);gap:5px;padding:6px}
.stage-dock button{border:1px solid transparent;border-radius:10px;min-width:65px;padding:4px 9px;background:transparent;color:#4e3925;font-size:13px;line-height:1.15}
.stage-dock button span{display:block}.stage-dock button span:first-child{font-size:24px;color:#665835}
.stage-dock button:hover,.stage-dock button:focus-visible{background:#e8e8bc;border-color:#92925c}
#stageBag{background:#dee0b0;border-color:#a3a875}
#adventureMessage{position:absolute;bottom:max(85px,calc(env(safe-area-inset-bottom) + 73px));right:max(14px,env(safe-area-inset-right));z-index:3;max-width:min(440px,calc(100% - 28px));margin:0;padding:8px 13px;min-height:0;border:1px solid #aaa977;border-radius:12px;background:#324432ed;color:#fff3d3;font-size:13px;opacity:0;pointer-events:none;transition:opacity .15s ease}
#adventureMessage.stage-message-visible{opacity:1}
#kitchenView:not([hidden]){position:absolute;z-index:7;inset:3dvh max(16px,7vw);border:1px solid #9e835d;border-radius:20px;padding:clamp(12px,2vw,24px);background:#fbf2de;overflow:auto;overscroll-behavior:contain;box-shadow:0 0 0 100vmax #252b2490;max-height:94dvh}
#kitchenView>.stage-book-close{position:sticky;top:0;float:right;z-index:4}
#adventureScreen[data-scene=kitchen] .adv-top,#adventureScreen[data-scene=kitchen] .stage-dock{visibility:hidden}
dialog.stage-panel{box-sizing:border-box;width:min(480px,calc(100% - 20px));max-height:90dvh;overflow:auto;overscroll-behavior:contain;padding:15px 18px 18px;border:1px solid #856644;border-radius:21px;color:#463823!important;background:linear-gradient(153deg,#fff6df,#ead8ac)!important;box-shadow:0 14px 52px #251b138c,inset 0 0 0 3px #fff3d4}
dialog.stage-panel::backdrop{background:#22261d91}
#stageBagPanel{margin: auto max(15px,4vw) auto auto}
.stage-panel header{display:flex;align-items:center;justify-content:space-between;padding:0 0 9px;border-bottom:1px solid #c3aa82;margin:0;gap:10px}
.stage-panel h2{margin:0;font-size:1.34rem;color:#4b3b28}
.stage-panel button,.stage-close{padding:5px 12px;border:1px solid #a08b65;border-radius:10px;background:#f9edcd;color:#503b23}
.stage-panel button:hover,.stage-close:hover{background:#e5e5bd}
.stage-close,.stage-panel .stage-close{min-width:44px;font-size:22px}
#stageBagPanel .bag-slots{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#stageBagPanel .bag-slot{min-height:64px;border-radius:10px;color:#504630}
#stageBagPanel .bag-title{font-size:13px;margin:8px 0}
#stageBagPanel .bag-title small{color:#5b6244}
#stageNavigation .stage-panel-body,.stage-setting-rows,.stage-languages{display:flex;flex-wrap:wrap;gap:7px;padding-top:10px}
.stage-languages{width:100%;padding-top:0}.stage-languages [aria-pressed=true]{background:#5b744c;color:#fff9e5}
#stageSettings #cloudAccount{margin:10px 0 0!important}
#lakeView #fishControls:not([hidden]){position:absolute;left:50%;bottom:max(87px,calc(env(safe-area-inset-bottom) + 73px));transform:translateX(-50%);width:min(375px,calc(100% - 24px));z-index:4}
#lakeView #fishReward:not([hidden]){top:68px;z-index:4;max-width:90vw}
#stageSettingsButton:focus-visible,.stage-panel button:focus-visible,.stage-dock button:focus-visible{outline:2px solid #436749;outline-offset:2px}
@media(max-width:640px){
  #stageBagPanel{margin:auto auto max(7px,env(safe-area-inset-bottom))}
  #kitchenView:not([hidden]){inset:8px;max-height:calc(100dvh - 16px)}
  #adventureScreen .adv-top{inset:max(7px,env(safe-area-inset-top)) 8px auto;align-items:center}
  #adventureScreen .adv-top h2{padding:7px}
  #adventureScreen .adv-coins{padding:8px;font-size:12px}
  #stageSettingsButton{padding:3px 7px;font-size:12px}
  .stage-dock{gap:2px}
  .stage-dock button{min-width:54px;padding:3px 7px;font-size:12px}
}
@media(max-height:520px){#lakeView #fishControls:not([hidden]){left:auto;right:12px;transform:none;max-width:42vw}.stage-dock button span:first-child{font-size:18px}.stage-dock button{min-height:44px}}


#treeView .map-frame{display:grid;place-items:center;background:radial-gradient(ellipse,#6c5338,#292a20 76%)}
#mapView canvas#treeCanvas{width:min(100vw,178dvh);height:auto;aspect-ratio:1000/562}
@media (orientation:portrait){
  #mapView .tree-expanded canvas#treeCanvas{width:100%;height:min(74dvh,125vw);aspect-ratio:auto}
}
#furniturePlacement:not([hidden]){position:absolute;z-index:5;bottom:83px;right:12px;width:min(390px,calc(100% - 24px));max-height:36dvh;overflow:auto}
#adventureScreen[data-scene=kitchen]{background:#312f22}

.stage-symbols{width:0;height:0;overflow:hidden;position:absolute;pointer-events:none}
.stage-glyph{width:30px;height:30px;stroke:#654727;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
#stageSettingsButton .stage-glyph{width:24px;height:24px;margin-right:3px}
@media(max-width:640px){.stage-glyph{width:26px;height:26px}#stageSettingsButton .stage-glyph{width:19px;height:19px}}
@media(max-height:520px){.stage-glyph{width:21px;height:21px}}

#adventureScreen .adv-top > div:first-child{min-width:0}
#adventureScreen .adv-top h2{overflow-wrap:anywhere}
@media(max-width:380px){
  .stage-dock{max-width:calc(100% - 14px);gap:1px;padding:4px}
  .stage-dock button{flex:1;min-width:0;padding-inline:4px}
}
