/* Keep the room within the game shell; narrow screens use a readable vertical flow. */
body[data-screen="room"] .room-heading,
body[data-screen="room"] .room-heading>div,
body[data-screen="room"] .room-layout,
body[data-screen="room"] .room-column,
body[data-screen="room"] .quest-journal,
body[data-screen="room"] .journal-task div{min-width:0;min-height:0}
body[data-screen="room"] .room-heading h1{font-size:clamp(25px,2.5vw,36px);overflow-wrap:break-word}
body[data-screen="room"] .room-heading .back-link{margin-bottom:4px}
body[data-screen="room"] .room-heading .eyebrow{margin-bottom:4px;letter-spacing:1px}
body[data-screen="room"] .journal-task{min-height:58px}
body[data-screen="room"] .journal-task strong,
body[data-screen="room"] .journal-task small{overflow-wrap:break-word}
body[data-screen="room"] .direction-pad button{min-width:40px;min-height:44px}
body[data-screen="room"] .quest-journal{scrollbar-gutter:stable;overscroll-behavior:contain}

@media screen and (min-width:901px) and (min-height:600px){
 body[data-screen="room"] #screen{height:calc(100dvh - var(--hud-height));min-height:0;max-width:none;margin-left:92px;margin-right:0;padding:clamp(12px,2dvh,24px) clamp(16px,2vw,34px);display:flex;flex-direction:column;gap:14px}
 body[data-screen="room"] .room-heading{flex:0 0 auto;flex-wrap:nowrap;gap:20px;margin:0}
 body[data-screen="room"] .room-heading>div:first-child{min-width:0}
 body[data-screen="room"] .room-counter{flex:0 0 auto}
 body[data-screen="room"] .room-heading>.outline-button{flex:0 0 auto}
 body[data-screen="room"] .room-layout{flex:1;grid-template-columns:minmax(0,1fr) clamp(250px,24vw,330px);gap:clamp(14px,1.7vw,25px);align-items:stretch}
 body[data-screen="room"] .room-column{display:flex;flex-direction:column;gap:8px}
 body[data-screen="room"] .museum-scene{flex:1;min-height:0;aspect-ratio:auto;width:100%}
 body[data-screen="room"] .room-controls{flex:0 0 auto;padding:8px 0 0;gap:12px}
 body[data-screen="room"] .room-controls p{font-size:13px;line-height:1.5}
 body[data-screen="room"] .room-controls small{font-size:12px;margin-top:2px}
 body[data-screen="room"] .direction-pad{flex:0 0 auto;max-width:none;flex-wrap:nowrap}
 body[data-screen="room"] #movement-status{flex:0 0 auto;min-height:22px;margin:0;font-size:12px;line-height:1.6}
 body[data-screen="room"] .quest-journal{overflow:auto;padding:clamp(14px,1.5vw,22px)}
 body[data-screen="room"] .quest-journal>.eyebrow{font-size:11px;letter-spacing:1px;margin-bottom:6px}
 body[data-screen="room"] .quest-journal h2{font-size:clamp(23px,2vw,29px);margin:8px 0}
 body[data-screen="room"] .quest-journal h2 br{display:none}
 body[data-screen="room"] .journal-intro{font-size:14px;line-height:1.65;margin-bottom:8px}
 body[data-screen="room"] .journal-task{padding:12px 0;gap:9px}
 body[data-screen="room"] .journal-task strong{font-size:14px;line-height:1.5}
 body[data-screen="room"] .journal-task small{font-size:12px;line-height:1.5;margin-top:2px}
 body[data-screen="room"] .quest-journal .guide-card{margin:10px 0;padding:8px 0}
 body[data-screen="room"] .quest-journal .guide-card p,
 body[data-screen="room"] .quest-journal .guide-card strong,
 body[data-screen="room"] .storage-status,
 body[data-screen="room"] .editorial-note{font-size:12px;line-height:1.6}
 body[data-screen="room"] .editorial-note{margin-bottom:0;padding-top:8px}
 body[data-screen="room"] .hotspot{max-width:190px}
 body[data-screen="room"] .artifact{height:clamp(38px,8dvh,82px);line-height:1.2;overflow:hidden}
 body[data-screen="room"] .hotspot:nth-child(2) .artifact{height:clamp(45px,9dvh,90px);line-height:1.2}
 body[data-screen="room"] .hotspot strong{font-size:clamp(11px,1vw,14px);line-height:1.4}
 body[data-screen="room"] .hotspot small{font-size:11px;margin-top:2px}
 body[data-screen="room"] .room-wall{padding-top:0}
 body[data-screen="room"] .room-wall>span{position:absolute;top:-22px;left:6%;width:88%;font-size:12px}
 body[data-screen="room"] .room-wall small{margin-top:4px;font-size:11px}
 body[data-screen="room"] .restored-room{flex:0 0 auto;margin-top:0;padding:8px 12px;gap:12px}
 body[data-screen="room"] .restored-room h2{font-size:19px;margin-bottom:2px}
 body[data-screen="room"] .restored-room p{font-size:12px}
 body[data-screen="room"] .restored-room>.gold-button{padding:8px 12px;min-height:40px;font-size:13px;flex-shrink:0}
}
@media screen and (min-width:901px) and (min-height:600px) and (max-height:740px){
 body[data-screen="room"] #screen{gap:10px}
 body[data-screen="room"] .room-heading h1{font-size:27px}
 body[data-screen="room"] .room-heading .eyebrow{font-size:11px}
 body[data-screen="room"] .room-controls small{display:none}
 body[data-screen="room"] .hotspot small{display:none}
 body[data-screen="room"] .room-wall small{display:none}
 body[data-screen="room"] .quest-journal h2{font-size:23px}
 body[data-screen="room"] .journal-task{padding:9px 0}
}
@media screen and (max-width:900px),screen and (max-height:599px){
 body[data-screen="room"] .room-layout{grid-template-columns:minmax(0,1fr);gap:20px}
 body[data-screen="room"] .room-column{display:flex;flex-direction:column}
 body[data-screen="room"] .museum-scene{width:100%;aspect-ratio:1.5;min-height:310px}
 body[data-screen="room"] .room-heading{gap:12px;margin-bottom:18px;flex-wrap:wrap}
 body[data-screen="room"] .room-heading>div:first-child{flex-basis:100%;min-width:0}
 body[data-screen="room"] .room-counter{margin-right:auto}
 body[data-screen="room"] .room-controls{gap:12px;flex-wrap:wrap;padding-top:18px}
 body[data-screen="room"] .room-controls p{max-width:none;flex:1 1 180px}
 body[data-screen="room"] .direction-pad{max-width:none;justify-content:flex-start;gap:6px;flex-wrap:wrap}
 body[data-screen="room"] .quest-journal{padding:20px}
 body[data-screen="room"] .quest-journal h2{font-size:27px}
 body[data-screen="room"] .quest-journal h2 br{display:none}
 body[data-screen="room"] .journal-task{padding:14px 0}
 body[data-screen="room"] .restored-room{margin-top:8px}
}
@media screen and (max-width:600px){
 body[data-screen="room"] #screen{padding:16px 12px calc(88px + env(safe-area-inset-bottom))}
 body[data-screen="room"] .room-heading .eyebrow{font-size:11px;letter-spacing:.3px}
 body[data-screen="room"] .room-heading>.outline-button{font-size:13px;min-height:44px;padding:8px 12px}
 body[data-screen="room"] .room-counter strong{font-size:14px}
 body[data-screen="room"] .room-counter progress{width:120px;margin-top:6px}
 body[data-screen="room"] .museum-scene{aspect-ratio:1.05;min-height:300px}
 body[data-screen="room"] .hotspot{width:28%}
 body[data-screen="room"] .hotspot strong{font-size:11px;line-height:1.4}
 body[data-screen="room"] .artifact{height:40px}
 body[data-screen="room"] .hotspot:nth-child(2) .artifact{height:48px}
 body[data-screen="room"] .room-wall{padding-top:0}
 body[data-screen="room"] .room-wall>span{position:absolute;top:-18px;left:4%;width:92%;font-size:9px;letter-spacing:.3px}
 body[data-screen="room"] .room-wall small{font-size:10px;margin-top:0}
 body[data-screen="room"] .room-entry{font-size:9px}
 body[data-screen="room"] .room-controls p{font-size:13px}
 body[data-screen="room"] .room-controls small{font-size:12px}
 body[data-screen="room"] .direction-pad{width:100%;display:grid;grid-template-columns:repeat(4,44px) minmax(0,1fr)}
 body[data-screen="room"] .direction-pad button{padding:8px 4px;font-size:14px}
 body[data-screen="room"] #movement-status{font-size:12px;margin:10px 0}
 body[data-screen="room"] .quest-journal{padding:16px}
 body[data-screen="room"] .journal-task strong{font-size:15px}
 body[data-screen="room"] .journal-task small{font-size:13px}
 body[data-screen="room"] .restored-room .gold-button{margin-top:12px}
}
