/* Keep the game shell independent of canvas intrinsic size and dynamic vh support. */
html{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body:not(.login-page){position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;overflow-anchor:none}
body:not(.login-page)>header{position:absolute;top:0;left:0;right:0;width:100%;min-width:0;height:var(--office-header-height);z-index:6}
body:not(.login-page)>footer{position:absolute;left:0;right:0;bottom:0;width:100%;max-width:100%;z-index:6}
body:not(.login-page) #viewport{position:absolute;top:var(--office-header-height);left:0;right:0;bottom:var(--office-footer-height);width:auto;height:auto;min-width:0;min-height:0;contain:size layout;overflow:hidden}
body.has-team-board #viewport{bottom:calc(var(--office-footer-height) + var(--team-dock-height));height:auto;width:auto}
#viewport>#world{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;display:block}
body.has-team-board #teamBoard{position:absolute;bottom:calc(var(--office-footer-height) + 8px);max-width:calc(100% - 24px);min-width:0;overflow:hidden;z-index:7}
body.shop-open #viewport{height:auto;bottom:398px;bottom:min(398px,max(0px,calc(100% - var(--office-header-height) - 180px)))}
@media(max-width:700px){body.shop-open #viewport{height:auto;bottom:435px;bottom:min(435px,max(0px,calc(100% - var(--office-header-height) - 180px)))}}
@media(max-width:620px){body.has-team-board #teamBoard{max-width:calc(100% - 12px)}}

body.shop-open .shop-dock{max-height:calc(100% - var(--office-header-height) - 204px)!important}

/* Keep the animated bitmap inside its own paint/stacking boundary. */
body:not(.login-page) #viewport{contain:size layout paint;isolation:isolate;z-index:0}
#viewport>#world{z-index:0}
#viewport>.world-tools,#viewport>.walk-hint,#viewport>.scene-caption{z-index:2}
#viewport>#loading,#viewport>#connectionBanner,#viewport>#toast{z-index:3}
