/* One UI zoom per top-level surface. Canvas/world-space anchors and login/loading stay in physical pixels. */
:root{--hud-ui-scale:1;--ui-view-width:100vw;--ui-view-height:100dvh}
#game > :not(#world,#names,#mob-actors,#npc-actors,#talk-bubbles,#team-leader-markers,#xp-ko-counters,#join-screen,#fatal,.map-loading,.spell-swipe-feedback,#game-cursor,#carried-item,#carried-shortcut){zoom:var(--hud-ui-scale)}
.ui-size-setting{padding:12px 0;border-bottom:1px solid #b2a37044}
.ui-size-setting>label{display:flex;justify-content:space-between;align-items:center;gap:10px}
.ui-size-setting>p{font-size:11px;color:#bdccd0;margin:5px 0 8px}
.ui-size-controls{display:flex;align-items:center;gap:10px}
.ui-size-controls input{flex:1;min-width:0;accent-color:#c4aa69}
.ui-size-controls button{flex:none;min-height:30px;border:0;background:url('/ui/mobile/btnB.png?v=6985addbe008ac4c') center/100% 100% no-repeat;color:#f3e6c6;padding:6px 10px;font-size:11px}
.hud-reduced .parchment-panel{max-width:calc(var(--ui-view-width) - var(--ui-modal-padding-x,44px));max-height:calc(var(--ui-view-height) - var(--ui-modal-padding-y,174px))}
.hud-reduced .guild-window.guild-mobile{width:min(860px,calc(var(--ui-view-width) - 16px))}
/* Full-screen mobile sheets retain their baseline size, then shrink about the viewport center. */
.hud-reduced #mobile-hud .m-stage > :is(.m-sheet,.m-inspection,.m-shop,.m-trade){inset:auto;left:50%;top:50%;width:calc(100% * var(--hud-ui-scale));height:calc(100% * var(--hud-ui-scale));transform:translate(-50%,-50%);transform-origin:center}
.hud-reduced #mobile-hud .m-stage > .m-inspection{width:calc(100% * var(--m-scale) * var(--hud-ui-scale));height:calc(100% * var(--m-scale) * var(--hud-ui-scale));transform:translate(-50%,-50%) scale(calc(1 / var(--m-scale)))}
.hud-reduced #mobile-hud .m-stage > .m-chat{width:min(540px,calc(100% * var(--hud-ui-scale) - var(--safe-l)));height:calc(var(--kb-height,100%) * var(--hud-ui-scale));max-height:none;top:calc(var(--kb-top,0px) + var(--kb-height,100%) * (1 - var(--hud-ui-scale)) / 2)}
.hud-reduced #mobile-hud .m-stage > .m-dm{left:50%;right:auto;top:calc(var(--kb-top,0px) + var(--kb-height,100%) / 2);width:calc(100% * var(--hud-ui-scale) - var(--safe-l) - var(--safe-r) - 80px);height:calc(var(--kb-height,100%) * var(--hud-ui-scale) - 16px);max-height:none;transform:translate(-50%,-50%)}
.hud-reduced #game > :is(.chi-window,.jianghu-window){inset:auto;left:50%;top:50%;width:calc(var(--ui-view-width) - 24px);height:calc(var(--ui-view-height) - 24px);transform:translate(-50%,-50%)}
@media(orientation:portrait) and (max-width:600px){.hud-reduced #mobile-hud .m-stage > .m-sheet:has(.m-rtab.on[data-sheet-tab="status"]){width:calc(100% * var(--m-scale) * var(--hud-ui-scale));height:calc(100% * var(--m-scale) * var(--hud-ui-scale));transform:translate(-50%,-50%) scale(calc(1 / var(--m-scale)))}}
/* Spatial labels shrink at their existing world anchors; interaction regions/ground icons retain world size. */
.npc-actor span{transform:translateX(-50%) scale(var(--hud-ui-scale));transform-origin:center top}
.ground-drop span{transform:translateX(-50%) scale(var(--hud-ui-scale));transform-origin:center top}
.combat-damage{transform:translate(-50%,-100%) scale(var(--hud-ui-scale))}
#carried-item,#carried-shortcut{width:calc(43px * var(--hud-ui-scale));height:calc(43px * var(--hud-ui-scale))}

.hud-reduced #game > :is(.npc-dialogue,.toast){max-width:calc(var(--ui-view-width) - 32px)}
