/* 手机发布画布：以 B 站右侧移动预览的实际可用画布 375×645 等比显示，留白区域由外层黑边承接。 */
html,body,#app{min-height:100dvh;background:#000}
#home-screen.is-active,#game-screen.is-active,#collection-screen.is-active,#market-screen.is-active,#ranking-screen.is-active{
 position:fixed;left:50%;top:50%;width:min(100vw,58.1395dvh);height:min(100dvh,172vw);min-height:0;
 aspect-ratio:375/645;transform:translate(-50%,-50%);overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;background:#080b0c;
}
#collection-screen.is-active,#market-screen.is-active,#ranking-screen.is-active{height:min(100dvh,172vw)!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch}
#collection-screen.is-active .info-card,#market-screen.is-active .info-card,#ranking-screen.is-active .info-card{touch-action:pan-y}
#ranking-screen.is-active .ranking-list{max-height:none;overflow:visible;touch-action:auto}
#game-screen.is-active .mobile-game,#game-screen.is-active #game-stage{width:100%;height:100%}

/* 游戏端禁止长按选中或拖拽任何文字、图层与图片；制作器仍保留可编辑行为。 */
#home-screen,#game-screen,#collection-screen,#market-screen,#ranking-screen{
 -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
}
#game-screen,.mobile-game,#game-stage{touch-action:pan-y}
#home-screen img,#game-screen img,#collection-screen img,#market-screen img,#ranking-screen img{
 -webkit-user-drag:none;user-drag:none;-webkit-touch-callout:none;
}
#game-stage *,#game-stage .world-layer{-webkit-user-select:none;user-select:none}

/* 所有界面开放纵向滑动；玩家版仍通过 user-select/touch-callout 禁止长按选字。 */
html{
 overscroll-behavior-x:none;
 overscroll-behavior-y:auto;
 -webkit-text-size-adjust:100%;
 text-size-adjust:100%;
}

/* 开场视频结束并进入大地图后启用局内锁屏；菜单、战区选择和视频阶段不启用。 */
html.toy-input-locked,
html.toy-input-locked body{
 overflow:hidden!important;
 overscroll-behavior:none!important;
 touch-action:none!important;
 -webkit-overflow-scrolling:auto;
}
html.toy-input-locked body{
 position:fixed;
 inset:0;
 width:100%;
 height:100%;
 margin:0;
}
html.toy-input-locked body,
html.toy-input-locked body *{
 -webkit-user-select:none!important;
 user-select:none!important;
 -webkit-touch-callout:none!important;
 -webkit-tap-highlight-color:transparent;
}
html.toy-input-locked img,
html.toy-input-locked video,
html.toy-input-locked canvas{
 -webkit-user-drag:none;
 user-drag:none;
}
html.toy-input-locked #game-screen,
html.toy-input-locked #game-stage,
html.toy-input-locked #game-stage *{
 touch-action:none!important;
 overscroll-behavior:none!important;
}
html.toy-input-locked button{touch-action:manipulation!important}
html.toy-input-locked #game-stage .bag-drawer,
html.toy-input-locked #game-stage .run-result>div{
 max-height:calc(100% - 24px);
 overflow-y:auto;
 overscroll-behavior:contain!important;
 touch-action:pan-y!important;
 -webkit-overflow-scrolling:touch;
}

/* 制作器包（s）进入编辑界面时恢复页面滚动；玩家包（v）没有编辑器标记，不会启用此规则。 */
html.toy-editor-scroll body[data-editor-enabled="true"] #editor-screen.is-active{
 position:fixed;
 inset:0;
 display:block;
 width:100%;
 height:100dvh;
 min-height:0;
 overflow-x:hidden;
 overflow-y:auto;
 overscroll-behavior-y:contain;
 touch-action:pan-y;
 -webkit-overflow-scrolling:touch;
 scrollbar-gutter:stable;
}
html.toy-editor-scroll body[data-editor-enabled="true"] #editor-screen.is-active .editor-header,
html.toy-editor-scroll body[data-editor-enabled="true"] #editor-screen.is-active .editor-panel{
 touch-action:pan-y;
}
html.toy-editor-scroll body[data-editor-enabled="true"] #editor-screen.is-active .editor-map{
 touch-action:none;
}
html.toy-editor-scroll body[data-editor-enabled="true"] #editor-screen.is-active .editor-layout{
 padding-bottom:max(28px,var(--toy-inner-safe-bottom,env(safe-area-inset-bottom)));
}
