/* Keep both thumbs, clues and menus reachable on the smallest screens. */
.map-picker{display:none}
@media(pointer:coarse),(max-width:650px),(max-height:500px) and (max-width:1000px){
 html,body{overscroll-behavior:none}
 #hud,#world canvas{-webkit-user-select:none;-webkit-touch-callout:none}
 #touch-controls{display:block}
 .hud-header{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));gap:8px}
 .hud-tools{gap:6px}.hud-tools [data-action="journal"]{display:none}
 .hud-tools .icon-button,.intro-tools .icon-button{width:44px;height:44px}
 .memory-display{min-width:110px;padding:7px 10px 9px;gap:7px}.memory-mark{width:20px;height:20px}
 .memory-count{white-space:nowrap}.memory-count strong{font-size:23px}.memory-count>span{font-size:11px}
 .clock-button{min-height:44px;padding:6px 10px}.clock-button #weather-label{font-size:11px}
 .hud-footer{left:16px;right:16px;bottom:calc(150px + env(safe-area-inset-bottom))}
 .location-block{max-width:calc(100vw - 32px)}#location-name{font-size:16px;line-height:1.4;margin:0 0 6px}
 .location-block .micro-label,.hint-link kbd,.camera-actions kbd,.movement-hints,.keyboard-intro{display:none}
 .hint-link{min-height:44px;font-size:12px;padding:9px 12px}
 .camera-actions,.aiming .camera-actions{position:fixed;left:auto;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));transform:none;gap:9px;width:min(146px,calc((100vw - 58px)/2))}
 .camera-button,.aiming .camera-button{min-height:44px;width:100%;padding:9px 10px;font-size:11px;letter-spacing:0;gap:8px}
 .shutter-button{width:64px;height:64px}.camera-button [data-icon]{width:18px;height:18px}
 #joystick{width:104px;height:104px;left:max(18px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom))}
 .touch-look-hint{right:max(18px,env(safe-area-inset-right));bottom:calc(172px + env(safe-area-inset-bottom));font-size:10px}
 .aiming .touch-look-hint,.aiming .location-block,.aiming #objective{display:none}
 #objective{left:12px;right:12px;top:126px;width:auto;max-width:340px;padding:12px 14px;max-height:calc(100dvh - 354px);overflow:auto;overscroll-behavior:contain;pointer-events:auto}
 #objective .micro-label{padding-right:34px;min-height:25px}#objective h2{font-size:18px;margin:3px 0 6px}
 #objective p{font-size:12px;line-height:1.75}#objective-distance{font-size:11px;line-height:1.65}
 .small-close{position:absolute;right:4px;top:4px;float:none;width:44px;height:44px;padding:0;font-size:22px}
 #objective-wait{min-height:44px;font-size:12px}
 #finder{width:88vw;top:43%}.finder-top{font-size:9px}.finder-bottom{font-size:11px;line-height:1.65;bottom:-52px}
 #shutter-hint{font-size:10px}#toast{font-size:12px;max-width:calc(100vw - 32px);line-height:1.6;padding:10px 12px}
 #photo-reveal{width:min(170px,48vw);right:16px;bottom:calc(176px + env(safe-area-inset-bottom));padding:6px 6px 8px}
 #photo-reveal figcaption{padding-top:6px;font-size:10px}
 dialog[open]{display:flex;flex-direction:column;width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}
 .dialog-top{flex:none;padding:14px 16px;gap:12px}.dialog-top h2{font-size:21px}.dialog-top .icon-button{width:44px;height:44px}
 #overlay-body{min-height:0;max-height:none;overflow-y:auto;padding:16px;flex:1 1 auto;-webkit-overflow-scrolling:touch}
 .dialog-intro,.settings-row p,.journal-entry p{font-size:12px}.dialog-actions{gap:10px;margin-top:20px}
 .settings-row{gap:12px;min-height:66px}.settings-row>span{min-width:0;flex:1}.settings-row select{font-size:16px;min-width:106px;max-width:112px;min-height:44px}
 .settings-row input[type="range"]{width:108px;height:44px;flex-shrink:0;touch-action:none}.settings-row input[type="checkbox"]{flex-shrink:0}
 .journal-tabs{flex-wrap:wrap}.journal-tabs button{min-height:44px;font-size:11px;padding:8px 10px}
 .journal-entry{grid-template-columns:60px minmax(0,1fr);gap:12px}.journal-entry .spirit-medallion{width:60px;height:74px;grid-column:1;grid-row:1 / span 2}
 .journal-entry>div,.journal-entry>.secondary-button{grid-column:2}.journal-entry>.secondary-button{min-height:44px}
 .journal-entry h3{font-size:16px}.journal-entry .entry-status{display:block;margin:3px 0 0}
 .photo-card a{display:inline-flex;align-items:center;min-height:44px;padding:10px 0}
 .map-picker{display:block;margin:0 0 14px;font-size:12px;color:var(--muted)}
 .map-picker select{display:block;width:100%;min-height:44px;margin-top:6px;font-size:16px;background:#213f36;color:var(--ivory);border:1px solid var(--line);padding:8px}
 .map-node{width:32px;height:32px}.map-details{padding-top:16px}
 .intro-tools{gap:6px}.intro-copy .text-button{min-height:44px;align-items:center;margin-top:8px}
 .intro-footer{bottom:max(18px,env(safe-area-inset-bottom))}
}
@media(max-width:650px){
 .clock-button{top:60px;left:0;transform:none}#compass{top:90px;right:16px}
 .intro-header{left:16px;right:16px;top:max(16px,env(safe-area-inset-top))}.wordmark{gap:8px;font-size:7px;letter-spacing:.12em}.brand-symbol{width:24px;height:24px}
 .intro-copy{left:22px;max-width:calc(100% - 44px)}.intro-poem{font-size:14px;white-space:normal}.intro-description{font-size:12px;letter-spacing:0}
}
@media(max-width:650px) and (max-height:620px){
 .intro-copy{top:23%}.intro-copy h1{font-size:39px;margin-bottom:20px}.intro-poem{margin-bottom:12px}.intro-description{margin-bottom:20px}
 .intro-copy .small-note{font-size:11px;margin-top:6px}.intro-signature{font-size:9px}
}
@media(max-height:500px) and (max-width:1000px) and (orientation:landscape){
 .intro-copy{top:72px}.intro-copy h1{font-size:34px;margin-bottom:12px}.intro-poem{margin-bottom:10px}.intro-description,.intro-footer,.intro-copy .small-note{display:none}
 .intro-copy .primary-button{min-height:44px}.intro-copy .text-button{min-height:44px;margin-top:4px}
 .hud-header{top:max(8px,env(safe-area-inset-top))}.memory-display{padding-top:4px;padding-bottom:5px}
 .clock-button{top:0;left:50%;transform:translateX(-50%)}#compass{top:61px;left:50%;right:auto;transform:translateX(-50%)}
 #finder{width:52vw;top:46%}.finder-top{display:none}.finder-bottom{bottom:-34px}
 .camera-actions,.aiming .camera-actions{bottom:max(12px,env(safe-area-inset-bottom));width:132px}.shutter-button{width:56px;height:56px}
 #joystick{width:96px;height:96px;bottom:max(12px,env(safe-area-inset-bottom))}.touch-look-hint{display:none}
 .location-block{display:block;position:fixed;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%)}#location-name{display:none}
 #objective{top:76px;max-width:340px;max-height:calc(100dvh - 194px);padding:10px 12px}
 #objective .micro-label{min-height:14px;font-size:9px}#objective h2{padding-right:36px;font-size:16px;line-height:1.3}
 #objective p{font-size:11px;line-height:1.65}#objective-distance{font-size:10px;line-height:1.6;margin-top:6px}
 #photo-reveal{width:132px;bottom:142px;right:18px}#toast{top:78px;max-width:52vw}
 .dialog-top{padding:10px 16px}.dialog-top h2{font-size:20px}
}
