/* Room pages fit the visible viewport; only the shop/inventory panel scrolls. */
body.room-fit{height:var(--game-height,100dvh);overflow:hidden;overscroll-behavior:none}
.room-fit #app{height:100%;min-height:0}
.room-fit #app>main{height:100%;min-height:0;margin:0;padding:0 0 var(--game-nav-height,80px);display:flex;flex-direction:column;overflow:hidden}
.room-fit .topbar{flex:0 0 auto;position:relative;top:auto;min-height:60px;height:auto;padding:6px 12px;gap:8px;display:grid;grid-template-columns:minmax(40px,1fr) auto}
.room-fit .name-button{max-width:100%;min-width:0;overflow:hidden;font-size:16px}
.room-fit .top-actions{gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:100%}
.room-fit #cloud-status{font-size:10px;max-width:70px}
.room-fit .top-actions button{min-height:44px}
.room-fit .content.room-content{flex:1 1 auto;min-height:0;max-width:none;width:100%;margin:0;padding:0 6px;overflow:hidden;display:flex;flex-direction:column}
.room-fit .simple-home{flex:1;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:4px}
.room-fit .home-meta{min-height:24px}
.room-fit .home-meta>span{font-size:14px}
.room-fit .simple-home{display:block;position:relative}
.room-fit .simple-home>.home-meta{position:absolute;top:4px;left:6px;z-index:3;pointer-events:none}
.room-fit .simple-home>.home-room{position:absolute;inset:0;height:auto;align-items:flex-end}
.room-fit .party-workspace{height:100%;min-height:0;position:relative;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:5px}
.room-fit .party-title{min-height:28px;gap:8px;flex-wrap:nowrap}
.room-fit .party-title h1{font-size:20px;white-space:nowrap}
.room-fit .party-title>span{font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-fit .party-title small{font-size:11px;white-space:nowrap}
.room-fit .home-room,.room-fit .party-room{height:100%;min-height:0;width:100%;max-width:none;margin:0;position:relative}
.room-fit .home-room,.room-fit .room-stage{display:flex;align-items:center;justify-content:center;min-height:0;overflow:visible}
.room-fit .party-room{display:flex;flex-direction:column;padding:0}
.room-fit .party-room .room-stage{flex:1 1 auto;width:100%}
/* Camera host uses the whole workspace. Fixed UI sits in the empty corners,
   rather than removing two rows from the room's available height. */
.room-fit .party-workspace{display:block}
.room-fit .party-workspace>.party-room{position:absolute;inset:0;height:auto}
.room-fit .party-workspace>.party-title{position:absolute;z-index:3;top:4px;left:6px;right:120px;pointer-events:none}
.room-fit .party-workspace>.party-room .room-stage{align-items:flex-end}
.room-fit .home-room>svg#room,.room-fit .party-room .room-stage>svg#room{flex:none;display:block;max-width:none;max-height:none;min-width:0;min-height:0;margin:0;aspect-ratio:auto;overflow:visible;touch-action:none;transition:none}
.room-fit #furniture-bar{position:absolute;right:0;top:0;z-index:4;max-width:100%;pointer-events:none}
.room-fit .party-workspace #furniture-bar{top:36px}
.room-fit .floating-tools{position:static;bottom:auto;left:auto;right:auto;transform:none;margin:0;padding:4px;gap:4px;border-radius:12px;max-width:100%;pointer-events:auto}
.room-fit .floating-tools button{min-height:44px;font-size:14px;padding:7px 10px;white-space:nowrap;touch-action:manipulation}
.room-fit .party-tools{width:100%;display:flex;justify-content:center;gap:6px;padding:0;min-height:44px}
.room-fit .party-tools button{min-width:0;min-height:44px;flex:1;max-width:240px;font-size:16px;padding:6px 10px;border-radius:12px}
.room-fit .party-workspace>.party-tools{position:absolute;z-index:4;left:6px;bottom:6px;width:min(420px,36%);margin:0;min-height:44px}
/* Narrow screens reserve only the touch-control row. The camera never changes
   when drawers, a Mission or object controls open. */
@media(max-width:899px){.room-fit .party-workspace>.party-room{bottom:48px}.room-fit .party-workspace>.party-tools{left:0;bottom:0;width:100%}}
.room-fit .party-panel{position:absolute;z-index:6;left:0;top:38px;bottom:54px;display:flex;flex-direction:column;width:min(360px,40%);height:auto;min-height:0;max-height:none;margin:0;border-radius:14px;overflow:hidden;box-shadow:0 8px 28px #34493f26}
.room-fit .party-panel>header{flex:0 0 auto;padding:4px 10px;gap:8px;min-height:44px}
.room-fit .party-panel>header h2{font-size:18px;margin:0}
.room-fit .party-panel>header button{min-height:44px;min-width:44px}
.room-fit .panel-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding:10px 10px calc(16px + env(safe-area-inset-bottom))}
.room-fit .party-panel .sheet-products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.room-fit .party-panel .sheet-venues{grid-template-columns:1fr}
.room-fit .sheet-product{min-width:0}
.room-fit .sheet-product button{min-height:44px;touch-action:manipulation}
.room-fit #party-play-panel{top:var(--room-top,100px);right:12px;width:110px;max-height:calc(var(--game-height,100dvh) - var(--room-top,100px) - 100px)}
.room-fit:has(.floating-tools) #party-play-panel{top:calc(var(--room-top,100px) + 56px)}
.room-fit:has(.party-workspace) #party-play-panel{top:calc(var(--room-top,100px) + 36px)}
.room-fit:has(.party-workspace .floating-tools) #party-play-panel{top:calc(var(--room-top,100px) + 92px)}
@media(max-width:600px){.room-fit .content.room-content{padding:4px 6px}.room-fit .topbar{min-height:54px;padding:4px 6px}.room-fit .top-actions button{font-size:12px;padding:5px}.room-fit .name-button{font-size:13px}.room-fit .avatar{width:26px;height:26px}.room-fit .coin-pill{font-size:12px;padding:5px}.room-fit .settings-button{width:36px}.room-fit .party-title>span{display:none}.room-fit .party-panel{top:auto;left:0;right:0;bottom:50px;width:100%;height:46%;max-height:360px}.room-fit .party-panel .sheet-products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.room-fit .sheet-product{padding:7px}.room-fit .sheet-product>svg{height:95px}.room-fit #party-play-panel{right:6px;width:100px}.room-fit .floating-tools button{font-size:13px;padding:6px 8px}}
@media(max-height:500px){.room-fit .topbar{min-height:48px;padding-block:2px}.room-fit .party-title{min-height:22px}.room-fit .party-title h1{font-size:17px}.room-fit .bottom-navigation .nav-button{min-height:48px;font-size:11px;padding:3px}.room-fit .bottom-navigation .nav-icon{font-size:20px}.room-fit .bottom-navigation .nav-icon svg{width:22px;height:22px}.room-fit .bottom-navigation{padding-top:2px;padding-bottom:calc(2px + env(safe-area-inset-bottom))}.room-fit .party-tools button{min-height:40px;padding:4px}.room-fit .sheet-product>svg{height:68px}}

/* Reclaim the header row only on wide/landscape views. Account/music controls
   stay in the existing empty upper corners, outside the walking area. */
.room-fit.room-near #app>main{position:relative}
.room-fit.room-near .topbar{position:absolute;inset:0 0 auto;z-index:5;background:transparent;border:0;pointer-events:none}
.room-fit.room-near .topbar>*{pointer-events:auto}
.room-fit.room-near .name-button{justify-self:start;width:auto;max-width:min(260px,35vw);justify-content:flex-start}
.room-fit.room-near .top-actions{max-width:45vw}
.room-fit.room-near .party-workspace>.party-title,.room-fit.room-near .simple-home>.home-meta{top:62px}
.room-fit.room-near .party-workspace #furniture-bar{top:96px}
.room-fit.room-near:has(.party-workspace) #party-play-panel{top:calc(var(--room-top,0px) + 104px)}
.room-fit.room-near:has(.party-workspace .floating-tools) #party-play-panel{top:calc(var(--room-top,0px) + 160px)}
.room-fit .home-room,.room-fit .room-stage{overflow:hidden}

/* The actual slab front (world y=665) sits just above the bottom controls.
   Absolute bottom anchoring cannot inherit auto margins or vertical centering. */
.room-fit .home-room,.room-fit .party-room{background:none}
.room-fit .room-stage{position:relative}
.room-fit .home-room>svg#room,.room-fit .party-room .room-stage>svg#room{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);transform-origin:center bottom;margin:0}

/* Room and controls remain within one screen; shop drawers scroll independently. */
.room-fit.room-near .content.room-content{overflow:hidden}

/* The avatar stays beside a separately scrolling clothing picker. */
.room-fit .party-panel.wardrobe-panel{width:min(560px,calc(100% - 12px))}
.room-fit .wardrobe-panel .panel-body{display:flex;flex-direction:column;overflow:hidden;padding:8px 10px calc(10px + env(safe-area-inset-bottom));gap:8px}
.room-fit .wardrobe-panel .panel-body>.shop-filters:first-child{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex:none;margin:0}
.room-fit .wardrobe-panel .panel-body>.shop-filters:first-child button{min-width:0;min-height:44px;padding:6px 4px;font-size:14px;white-space:normal}
.room-fit .wardrobe-panel .wardrobe-products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.room-fit .wardrobe-panel .wardrobe-product>svg{width:48px;height:52px}
@media(max-width:600px){.room-fit .party-panel.wardrobe-panel{left:0;right:0;top:38px;bottom:50px;width:100%;height:auto;max-height:none}}
@media(max-width:420px){.room-fit .wardrobe-panel .wardrobe-product>svg{width:36px;height:48px}}
@media(max-height:700px){.room-fit .party-panel.wardrobe-panel{position:fixed;left:8px;right:auto;top:8px;bottom:calc(8px + env(safe-area-inset-bottom));width:min(640px,calc(100% - 16px));height:auto;max-height:none;z-index:12}}
@media(max-height:500px){.room-fit .wardrobe-panel .wardrobe-person>.wardrobe-avatar{height:100px}.room-fit .wardrobe-panel .wardrobe-help{display:none}.room-fit .wardrobe-panel .panel-body{gap:4px;padding-block:4px}.wardrobe-editor{gap:4px}.wardrobe-current{padding-top:5px}.wardrobe-select label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.room-fit .wardrobe-panel .wardrobe-products{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){.room-fit .wardrobe-panel .wardrobe-products{grid-template-columns:minmax(0,1fr)}}
