.roommate .bakery-scene{background-image:url('assets/apartment-portrait-v1.png');background-position:center center}
.roommate .baker{object-fit:contain}
.roommate #played-open{display:none}
.roommate .scene-controls{flex-wrap:wrap;gap:4px}
.roommate .scene-controls #continue-reply{border-color:#ffe278;color:#ffe278}
.roommate .identity strong{font-size:16px}
.roommate #belongings{padding:5px 10px 9px}
#belongings h3{font-size:13px;color:#ffe49b;margin:2px 0 7px}
.belonging-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.belonging-choice{min-width:0;min-height:48px;padding:6px 3px;background:#07343e;border:1px solid #2799a5;border-radius:8px;color:#e4f7ef;font-size:12px}
.belonging-choice small{display:block;font-size:10px;margin-top:3px;color:#96dae1}
.belonging-choice[aria-pressed=true]{border-color:#ffe278;box-shadow:0 0 7px #ddc05055}
.belonging-choice:disabled{opacity:.55}
.room-views{display:flex;gap:6px;margin-bottom:10px}.room-views button{flex:1;min-height:44px;background:#07343e;border:1px solid #2799a5;color:#e4f7ef;border-radius:7px}
.room-views button[aria-pressed=true]{border-color:#ffe278}
.room-picture{position:relative;width:100%;aspect-ratio:1672/941;background:#08262d;overflow:hidden;border-radius:8px}
.room-picture>img{width:100%;height:100%;object-fit:fill;display:block}
.room-object{position:absolute;display:block;padding:0;background:transparent;border:0;min-width:0!important;min-height:0!important}
.room-object img{display:block;width:100%;height:100%;object-fit:contain}
.room-object.revealed{outline:2px solid #ffe278;box-shadow:0 0 14px #ffe278;border-radius:5px;cursor:pointer;min-width:0!important;min-height:0!important}
.room-object:disabled{opacity:.6}
.room-instruction{font-size:13px;line-height:1.5;margin-bottom:0}
.continue-bakery{display:inline-flex;min-height:44px;align-items:center;padding:8px;border:1px solid #36c4d6;border-radius:7px;color:#80edf3}
@media(max-width:350px){.roommate .identity strong{font-size:13px}.roommate .scene-controls button{font-size:9px}.belonging-choice{font-size:11px}.belonging-choice small{font-size:9px}}

.room-object.revealed::after{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
/* Explicit belongings-phase exception: room interaction replaces the response hand. */
.roommate.apartment-exploration #npc{display:none}.roommate.apartment-exploration .bakery-scene{display:flex;flex-direction:column;background:none;overflow:hidden;min-height:0}
.apartment-inline{flex:1;min-height:0;overflow:hidden}.apartment-inline .apartment-panel{height:100%;display:flex;flex-direction:column}.apartment-inline .room-views{flex:none;margin:0;padding:4px 7px;gap:5px}.bakery .apartment-inline .room-views button{min-height:32px;font-size:10px;padding:4px}.apartment-inline .room-pan{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#52aeb8 #08262d;touch-action:pan-x pan-y}.apartment-inline .room-picture{height:100%;width:auto;min-width:100%;aspect-ratio:1672/941;overflow:visible;border-radius:0}.apartment-inline .room-picture>img{pointer-events:none}.apartment-inline .room-instruction{font-size:10px;line-height:1.3;padding:4px 8px;margin:0;background:#05232b}
.bakery .apartment-inline .room-object{padding:0!important;border:0!important;background:transparent!important;box-shadow:none}.bakery .apartment-inline .room-object.revealed{outline:2px solid #7ef7ed;filter:drop-shadow(0 0 5px #70eee5);box-shadow:0 0 12px #5df6df}.apartment-inline .room-object:disabled{opacity:1}
.roommate.apartment-exploration .bakery-scene .encounter-avatar{width:45px;height:64px;right:4px;bottom:34px;max-height:64px;object-fit:contain}
.explore-dialogue{flex:none;max-height:135px;overflow:auto;padding:4px 54px 4px 6px;background:#06232b}.explore-utterance{display:grid;grid-template-columns:minmax(0,1fr) 35px 35px;gap:3px;margin-bottom:3px}.bakery .explore-line{min-height:0;padding:4px!important;text-align:left;border-color:#b69b56;background:#332c16}.explore-line strong{font-size:12px;line-height:1.25;display:block;color:#ffe5a0}.explore-line em{font:italic 10px/1.2 Georgia;display:block;margin-top:3px;color:#d5e5df}.bakery .explore-audio{font-size:9px;padding:3px;min-height:32px}.roommate.apartment-exploration .scene-controls{position:static;flex:none;padding:3px 6px;background:#06232b;order:3}.roommate.apartment-exploration #workspace{padding-top:4px}.roommate.apartment-exploration #belongings{padding:2px 4px 5px}.roommate.apartment-exploration #belongings h3{text-align:center;font:700 19px Georgia;margin:1px 0 3px}.belongings-progress{font-size:10px;margin:0 0 5px;text-align:center;color:#9dd7de}.roommate.apartment-exploration .belonging-choice{min-height:44px;font-size:11px;padding:5px 2px}.roommate.apartment-exploration .belonging-choice small{font-size:9px}.roommate.apartment-exploration[data-building=true] .bakery-scene{display:block;background-image:url(assets/apartment-portrait-v1.png);background-size:cover;background-position:center}
@media(max-height:720px){.explore-dialogue{max-height:94px}.explore-line strong{font-size:11px}.roommate.apartment-exploration #belongings h3{font-size:17px}.apartment-inline .room-instruction{font-size:9px}}

.roommate .explore-dialogue{max-height:none;overflow:visible}.apartment-inline .room-instruction::after{content:' Swipe the room to look around.'}
/* Revision33: uninterrupted scene, with one shared speech panel at its bottom edge. */
.roommate.apartment-exploration:not([data-building=true]) .objective-line{display:none}
.roommate.apartment-exploration:not([data-building=true]) .scene-controls{display:none}
.roommate.apartment-exploration .apartment-inline{position:absolute;inset:0}
.roommate.apartment-exploration .apartment-inline .room-views,.roommate.apartment-exploration .apartment-inline .room-instruction{display:none}
.roommate.apartment-exploration .apartment-inline .room-pan{height:100%;flex:none}
.roommate.apartment-exploration .explore-dialogue{position:absolute;bottom:4px;left:5px;right:52px;display:flex;gap:4px;align-items:center;padding:4px;border:1px solid #54bac5;border-radius:8px;background:#052e39ed;z-index:12}
.explore-phrases{display:flex;flex:1;gap:6px;min-width:0}.bakery .explore-phrases .explore-line{flex:1;border:0;box-shadow:none;background:transparent;padding:2px!important;min-height:0;text-align:left}.explore-phrases strong{font-size:11px}.explore-phrases em{font-size:10px}.explore-playback{display:flex;flex-direction:column;gap:2px;flex:none}.bakery .explore-playback .explore-audio{width:33px;min-height:26px;height:26px;padding:2px;font-size:10px}
.roommate.apartment-exploration .bakery-scene .encounter-avatar{bottom:0;right:2px;height:65px;width:47px}
.roommate.apartment-exploration #workspace{padding-top:4px}
@media(max-width:350px){.explore-phrases{gap:4px}.explore-phrases strong{font-size:10px}.explore-phrases em{font-size:9px}.roommate.apartment-exploration .explore-dialogue{right:44px}.roommate.apartment-exploration .bakery-scene .encounter-avatar{width:40px}.bakery .explore-playback .explore-audio{width:30px}}

/* Portrait exploration keeps the established scene rectangle and fits the full
   artwork inside it. Item coordinates share this exact image coordinate space. */
.roommate.apartment-exploration .apartment-inline .room-pan{display:grid;place-items:center;overflow:hidden;touch-action:manipulation;background:#07222a}
.roommate.apartment-exploration .apartment-inline .room-picture{flex:none;min-width:0;max-width:100%;max-height:100%;aspect-ratio:auto;overflow:hidden}
.roommate.apartment-exploration .apartment-inline .room-picture>img{object-fit:contain}
.apartment-inline .room-instruction::after{content:none}

/* Revision42: portrait room fills the entire scene; overlays use the same box. */
.roommate.apartment-exploration .apartment-inline .room-picture[data-fit="fill"]>img{object-fit:fill}
/* Mobile pickup emphasis follows the transparent sprite, never its hit rectangle. */
.roommate .room-object.revealed,.bakery .apartment-inline .room-object.revealed{outline:0!important;border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;filter:none;transform:scale(1.15);transform-origin:50% 50%;z-index:4;opacity:1}
.roommate .room-object.revealed>img{filter:brightness(1.12) saturate(1.08) drop-shadow(0 0 1px #edffff) drop-shadow(0 0 3px #9cffff) drop-shadow(0 0 7px #20edff) drop-shadow(0 0 12px #00cadf);pointer-events:none}
.roommate .room-object.revealed:focus-visible{outline:0!important}
.roommate .room-object.revealed:focus-visible>img,.roommate .room-object.revealed:hover:not(:disabled)>img{filter:brightness(1.18) drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #a3ffff) drop-shadow(0 0 10px #13e9ff) drop-shadow(0 0 15px #00d9ed)}
@media(prefers-reduced-motion:no-preference){.roommate .room-object{transition:transform .18s ease-out}.roommate .room-object>img{transition:filter .18s ease-out}}
/* A clearer roommate portrait while asking where belongings are. */
.roommate.apartment-exploration:not([data-building=true]) .bakery-scene .encounter-avatar{width:86px;height:120px;max-height:120px;right:2px;bottom:0;object-fit:contain}
.roommate.apartment-exploration:not([data-building=true]) .explore-dialogue{right:91px}
@media(max-width:350px){.roommate.apartment-exploration:not([data-building=true]) .bakery-scene .encounter-avatar{width:72px;height:102px;max-height:102px}.roommate.apartment-exploration:not([data-building=true]) .explore-dialogue{right:77px}}
/* Standard played/response cards and toolbar now live exclusively in ui/encounter.css. */
/* Belongings selectors: use the available face for large icon/Spanish label. */
.roommate.apartment-exploration .belonging-choice{display:grid;grid-template-columns:25% minmax(0,1fr);column-gap:4px;row-gap:2px;align-content:center;align-items:center;text-align:left;min-height:64px;padding:8px 4px;font-size:clamp(14px,4.4vw,17px);line-height:1.15}
.roommate .belonging-choice .belonging-icon{grid-column:1;grid-row:1/3;justify-self:center;font-size:clamp(28px,8vw,34px);line-height:1}
.roommate .belonging-choice .belonging-label{font-weight:700;white-space:nowrap}
.roommate.apartment-exploration .belonging-choice small{grid-column:2;font-size:10px;line-height:1.1;margin:0;overflow-wrap:normal}

@media(max-width:350px){.roommate.apartment-exploration .belonging-choice{column-gap:2px;padding-left:2px;padding-right:2px;font-size:14px}}

/* Stable toolbar outside the replaced room picture; controls never cover objects/text. */
.apartment-toolbar{padding:4px 6px}
.bakery.roommate.apartment-exploration .apartment-toolbar>.scene-controls{display:grid!important;position:static!important;inset:auto!important;width:100%;margin:0}

/* Search prioritizes a large uninterrupted picture; utilities flank the heading. */
body:has(.roommate.apartment-exploration){overflow-y:auto}
.bakery.roommate.apartment-exploration{height:auto;min-height:100dvh;grid-template-rows:auto clamp(320px,48dvh,430px) auto auto}
.bakery.roommate.apartment-exploration #workspace{position:relative;max-height:none;min-height:0;padding-top:4px}
.bakery.roommate.apartment-exploration .apartment-toolbar{position:absolute;left:3px;right:3px;top:4px;padding:0;z-index:5;pointer-events:none}
.bakery.roommate.apartment-exploration .apartment-toolbar>.scene-controls{grid-template-columns:76px minmax(0,1fr) 76px;padding:0;gap:3px;background:transparent}
.bakery.roommate.apartment-exploration .apartment-toolbar #dialogue-history{grid-column:1;grid-row:2}
.bakery.roommate.apartment-exploration .apartment-toolbar #meaning-help{grid-column:3;grid-row:2}
.bakery.roommate.apartment-exploration .apartment-toolbar :is(#dialogue-history,#meaning-help){min-height:28px!important;height:28px;padding:3px 2px;font-size:8px;letter-spacing:0;pointer-events:auto}
.bakery.roommate.apartment-exploration #belongings h3{display:flex;align-items:center;justify-content:center;min-height:31px;padding:0 76px;margin:0 0 3px;font-size:17px}
.bakery.roommate.apartment-exploration #workspace:has(#continue-reply:not([hidden])) #belongings{padding-top:56px}
@media(min-width:700px){.bakery.roommate.apartment-exploration{min-height:80dvh;grid-template-rows:auto clamp(320px,38.4dvh,430px) auto auto}}

/* Draw attention to revealed belongings without moving their pickup targets. */
@keyframes roommate-item-glow{
 0%,100%{filter:brightness(1.08) saturate(1.08) drop-shadow(0 0 2px #9cffff) drop-shadow(0 0 5px #20edff)}
 50%{filter:brightness(1.25) saturate(1.15) drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #a3ffff) drop-shadow(0 0 11px #13e9ff) drop-shadow(0 0 16px #00d9ed)}
}
@media(prefers-reduced-motion:no-preference){
 .roommate.apartment-exploration .room-object.revealed>img{animation:roommate-item-glow 1.8s ease-in-out infinite}
}

/* Pickup instruction stays inside the scene without covering or intercepting items. */
.roommate .pickup-prompt{position:absolute;top:16%;left:50%;transform:translateX(-50%);width:max-content;max-width:64%;margin:0;padding:8px 11px;border:2px solid #fff1bc;border-radius:8px;background:#07343ef2;color:#fff5d7;font-size:clamp(13px,3.8vw,16px);font-weight:700;line-height:1.3;text-align:center;box-shadow:0 2px 10px #001b2490;z-index:8;pointer-events:none}
.roommate .pickup-prompt[hidden]{display:none}
