/* The same museum, composed for fingers and shorter viewports. */
@media(max-width:800px){
 header{top:12px;left:20px;right:20px;gap:12px}
 header #home{display:flex;align-items:center;min-height:44px}
 body[data-view] #place{display:block;font-size:10px;max-width:51%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #dock,body[data-view="snake"] #dock{left:20px;right:20px;bottom:calc(12px + env(safe-area-inset-bottom,0px));gap:6px;flex-direction:column;align-items:stretch}
 #keys{justify-content:center;gap:4px;align-self:stretch}
 #keys button{width:36px;height:40px;flex-shrink:0}
 #keys .vertical{gap:4px}#keys .vertical button{height:28px}
 #keys .enter{width:36px;margin-left:2px}
 #keys .back-key{width:auto;min-width:84px;margin-left:6px;padding:0 7px;gap:6px}
 .back-key span{font-size:17px}.back-key small{font-size:10px}
 #key-hint{display:none!important}
 .dock-right,body[data-view="snake"] .dock-right{width:100%;position:static;align-self:stretch;justify-content:space-between;gap:12px}
 .dock-right button{min-width:64px;min-height:44px;font-size:10px;padding:8px 0}
 body[data-view="snake"] .dock-right{justify-content:flex-end}
 .gallery-scroll{inset:74px 0 calc(148px + env(safe-area-inset-bottom,0px));scroll-padding-block:0}
 .gallery-slide{min-height:calc(100svh - 222px - env(safe-area-inset-bottom,0px));padding:24px 24px 36px;gap:24px;align-content:center}
 .gallery-slide img{width:100%;height:auto;max-height:none;object-fit:contain}
 .gallery-slide .copy p,.gallery-opening p{font-size:13px;line-height:1.85}
 .gallery-slide h2{font-size:23px;margin:14px 0}
 .gallery-opening h1{font-size:28px;margin-bottom:18px}
 .gallery-credits{font-size:12px;overflow-wrap:anywhere}
 .worlds-entrance{padding:94px 20px calc(165px + env(safe-area-inset-bottom,0px))}
 .world-label small{font-size:10px}
 body[data-view="home"] .index{padding-left:20px;padding-right:20px;padding-bottom:165px}
 .museum-index a{scroll-margin-bottom:170px}
 .music-controls{left:20px;right:20px;bottom:calc(150px + env(safe-area-inset-bottom,0px));opacity:1}
 .music-controls input{height:44px;margin:0}
 .music-controls input::-webkit-slider-thumb{width:12px;height:12px;margin-top:-5px}
 .music-readout{font-size:11px;min-height:44px}
 .music-readout button{min-width:54px;min-height:44px;text-align:left}
 .experience-caption{bottom:calc(248px + env(safe-area-inset-bottom,0px));left:20px;right:20px;max-width:none;font-size:12px;line-height:1.7}
 body[data-view="draw"] .experience-caption{bottom:calc(155px + env(safe-area-inset-bottom,0px));font-size:11px}
 .start-music{font-size:14px}
 .scene-tools.draw-tools{top:78px;left:20px;right:20px;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;justify-items:center;align-items:center}
 .draw-tools button{min-height:44px;min-width:44px;font-size:11px;padding:0}
 .scene-tools .swatch{width:44px;height:44px;border:10px solid transparent;background-clip:content-box;outline-offset:-6px}
 dialog{max-height:calc(100dvh - 48px);overflow:auto;padding:28px 24px;width:calc(100% - 32px);margin:auto}
 dialog h2{font-size:23px;margin-right:30px}dialog p,dialog>a{font-size:13px}
 #close-credits{width:44px;height:44px;right:5px;top:5px}
 /* Controls inside the shared scene frames stay above the main navigation. */
 #motion{min-width:64px;min-height:44px;bottom:calc(150px + env(safe-area-inset-bottom,0px))!important;left:20px!important}
 #hint{bottom:calc(206px + env(safe-area-inset-bottom,0px))!important;left:20px!important;font-size:12px!important}
 #life footer{left:20px!important;bottom:calc(150px + env(safe-area-inset-bottom,0px))!important;gap:20px!important}
 #life button{min-height:44px;padding:8px 0!important;font-size:12px!important}
 #world{top:78px!important;left:20px!important;min-height:44px;max-width:calc(100% - 40px);font-size:12px!important;padding:8px!important}
 #caption{left:20px!important;bottom:calc(155px + env(safe-area-inset-bottom,0px))!important;font-size:12px!important;max-width:calc(100% - 40px)}
 .scene-nav-info{display:none!important}
 body[data-view="snake"] #keys .vertical button{height:40px}
 .room .foot{bottom:calc(182px + env(safe-area-inset-bottom,0px))!important;left:20px!important;right:20px!important}
 .room .mast{top:78px!important;left:20px!important;right:20px!important}
 .room .score{top:94px!important;left:20px!important}
 .room .icon{width:44px;height:44px}
}
@media(max-width:380px){body[data-view="home"] .index{padding-top:94px;gap:20px}.museum-index a{height:104px}.museum-index .sigil{height:41px;margin-bottom:5px}}
@media(max-height:500px) and (min-width:601px) and (max-width:1000px){
 header{top:12px}#dock{bottom:10px}.gallery-scroll{inset:68px 0 72px}.gallery-slide{min-height:calc(100svh - 140px);padding-top:24px;padding-bottom:32px}.gallery-slide img{height:auto;max-height:none}.music-controls{bottom:80px}.experience-caption{bottom:148px}.scene-tools{top:70px}.worlds-entrance{padding-top:90px}
}
@media(max-width:800px){.gallery-scroll:focus-visible{box-shadow:none}.gallery-scroll:focus-visible:before{content:'';position:fixed;top:76px;left:8px;width:8px;height:8px;border-top:1px solid #dbc9e8;border-left:1px solid #dbc9e8;pointer-events:none}}
/* Show seek focus at the thumb rather than a browser-blue box around the player. */
.music-controls input:focus-visible{outline:none}
.music-controls input:focus-visible::-webkit-slider-thumb{background:#e4d0ef;box-shadow:0 0 0 4px #cbb2df55}
.music-controls input:focus-visible::-moz-range-thumb{background:#e4d0ef;box-shadow:0 0 0 4px #cbb2df55}
@media(max-width:800px){.music-controls input::-moz-range-track{height:1px;background:#e1e5d244}.music-controls input::-moz-range-thumb{width:12px;height:12px;border:0;border-radius:50%;background:#dedfcf}}

@media(max-width:800px){#keys .back-key{height:44px}.room .best{left:20px!important;bottom:calc(182px + env(safe-area-inset-bottom,0px))!important;font-size:9px}.room .best strong{font-size:0}.room .best #best{font-size:11px}.room .score{font-size:10px}}

/* Landscape phones use one compact control row, leaving the scene visible. */
@media(max-height:500px) and (min-width:601px) and (max-width:1000px){
 #dock,body[data-view="snake"] #dock{left:20px;right:20px;bottom:calc(8px + env(safe-area-inset-bottom,0px));flex-direction:row;align-items:center;gap:16px}
 #keys{align-self:center;flex-shrink:0}.dock-right,body[data-view="snake"] .dock-right{width:auto;align-self:center;gap:16px}.dock-right button{min-width:50px;min-height:44px}
 .gallery-scroll{inset:68px 0 calc(88px + env(safe-area-inset-bottom,0px))}.gallery-slide{min-height:calc(100svh - 156px);padding-top:20px;padding-bottom:28px}
 .music-controls{bottom:calc(88px + env(safe-area-inset-bottom,0px));left:25%;right:20px;opacity:1}.music-controls input{height:44px}.music-readout{min-height:44px}.music-readout button{min-height:44px;min-width:54px}
 .experience-caption,body[data-view="draw"] .experience-caption{bottom:calc(105px + env(safe-area-inset-bottom,0px));left:20px;right:auto;max-width:18ch;font-size:10px}
 .scene-tools.draw-tools{top:68px;left:20px;right:20px;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;justify-items:center}.draw-tools button{min-width:44px;min-height:44px;font-size:11px}.scene-tools .swatch{width:44px;height:44px;border:10px solid transparent;background-clip:content-box;outline-offset:-6px}
 #motion,#life footer{bottom:calc(98px + env(safe-area-inset-bottom,0px))!important}#hint{bottom:154px!important}#caption{bottom:105px!important}#world{top:68px!important;min-height:44px}
 .room .best{bottom:calc(116px + env(safe-area-inset-bottom,0px))!important}.room .mast{top:68px!important}.room .score{top:84px!important}
}
@media(max-width:800px){#scene-choice{display:inline-block}}
@media(max-height:500px) and (min-width:601px) and (max-width:1000px){
 header #home{min-height:44px;display:flex;align-items:center}#place{font-size:10px}
 #keys{gap:4px}#keys button{width:36px;height:40px}#keys .vertical{gap:4px}#keys .vertical button{height:28px}#keys .enter{width:36px}#keys .back-key{width:auto;min-width:84px;height:44px}#key-hint{display:none!important}
 .music-readout{font-size:11px}.music-readout button{font-size:12px}.start-music{font-size:13px}
 .gallery-slide .copy p,.gallery-opening p{font-size:13px;line-height:1.85}
}
@media(max-width:800px){.gallery-slide .copy .tagline{font-size:11px}}
@media(max-height:500px) and (min-width:601px) and (max-width:1000px){.gallery-slide .copy .tagline{font-size:11px}}

/* Touch navigation: the scene is the interface, not a miniature keyboard. */
.touch-icon{display:none}
@media(max-width:800px),(max-height:500px) and (min-width:601px) and (max-width:1000px){
 #dock,body[data-view="snake"] #dock{flex-direction:row;align-items:center;justify-content:space-between;gap:16px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}

 #keys{display:flex;align-self:center;gap:0}
 #keys>button:not(.back-key),#keys .vertical,#key-hint{display:none!important}
 #keys .back-key{display:flex;align-items:center;justify-content:center;min-width:44px;width:44px;height:44px;margin:0;padding:0;border:0;background:transparent;border-radius:50%;color:#d9e2d5}
 #keys .back-key[hidden]{display:none}
 #keys .back-key .key-glyph,#keys .back-key small{display:none}
 .touch-icon{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
 #keys .back-key:active{background:#d4b4eb18;color:#dfc6ee}
 #keys .back-key:focus-visible{outline:1px solid #dfc6ee;outline-offset:-4px}
 .dock-right,body[data-view="snake"] .dock-right{width:auto;align-self:center;justify-content:flex-end;gap:22px;position:static}
 .dock-right button{min-width:44px;min-height:44px}
 body:not([data-view="home"]) #scene-choice,body:not([data-view="home"]) #credits{display:none!important}
 body[data-view="home"] #keys{display:none}body[data-view="home"] .dock-right{width:100%;justify-content:space-between}
 #touch-hint{position:absolute;left:50%;transform:translateX(-50%);font-size:10px;line-height:1.5;color:#c9d4c0;white-space:nowrap;pointer-events:none;animation:none}
 .gallery-scroll{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
 .gallery-slide{min-height:calc(100svh - 158px - env(safe-area-inset-bottom,0px))}
 .worlds-entrance{padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
 body[data-view="home"] .index{padding-bottom:100px}
 .music-controls{bottom:calc(82px + env(safe-area-inset-bottom,0px))}
 .experience-caption{bottom:calc(184px + env(safe-area-inset-bottom,0px))}
 body[data-view="draw"] .experience-caption{bottom:calc(90px + env(safe-area-inset-bottom,0px))}
 #motion,#life footer{bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
 #hint{bottom:calc(144px + env(safe-area-inset-bottom,0px))!important}
 #caption{bottom:calc(94px + env(safe-area-inset-bottom,0px))!important}
 body[data-view="snake"] #dock{height:144px;align-items:flex-end}
 body[data-view="snake"] #keys{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:4px;position:absolute;left:50%;bottom:0;transform:translateX(-50%);align-self:auto}
 body[data-view="snake"] #keys .vertical{display:contents!important}
 body[data-view="snake"] #keys button:not(.back-key){display:flex!important;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;margin:0;padding:0;border:1px solid #d7e4d01a;border-radius:12px;background:#0d1715c4;box-shadow:inset 0 1px #e6eddf0a;color:#c7d3c3;transition:background .16s,color .16s,border-color .16s}
 body[data-view="snake"] #keys .key-glyph{display:none}
 body[data-view="snake"] [data-key="ArrowUp"]{grid-column:2;grid-row:1}
 body[data-view="snake"] [data-key="ArrowLeft"]{grid-column:1;grid-row:2}
 body[data-view="snake"] [data-key="ArrowRight"]{grid-column:3;grid-row:2}
 body[data-view="snake"] [data-key="ArrowDown"]{grid-column:2;grid-row:3}
 body[data-view="snake"] #keys .enter{grid-column:2;grid-row:2;border-color:transparent;background:#b9cbb10b}
 body[data-view="snake"] #keys .back-key{position:fixed;left:calc(90px - 50vw);bottom:0}
 body[data-view="snake"] .dock-right{margin-left:auto;align-self:flex-end}
 body[data-view="snake"] #keys button.down,body[data-view="snake"] #keys button:active{background:#b693d838;border-color:#d9b7f07a;color:#edd9ff}
 body[data-view="snake"] #keys button:focus-visible{outline:1px solid #e0c5f1;outline-offset:3px}
 .game-toggle{width:16px;height:16px}.game-toggle .pause-mark{display:none}
 body[data-game-state="playing"] .game-toggle .play-mark{display:none}body[data-game-state="playing"] .game-toggle .pause-mark{display:block}
 .room .best,.room .foot{bottom:calc(176px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-height:500px) and (min-width:601px) and (max-width:1000px){
 body[data-view="snake"] #keys{left:auto;right:55px;transform:none;grid-template-columns:repeat(3,40px);grid-template-rows:repeat(3,40px)}
 body[data-view="snake"] #keys button:not(.back-key){width:40px;height:40px;min-width:40px}
 body[data-view="snake"] #keys .back-key{position:fixed;left:20px;bottom:12px}
 .experience-caption{bottom:100px}.music-controls{left:25%}
}
@keyframes touch-hint-away{0%,55%{opacity:.65}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){#touch-hint{animation:none;opacity:.65}body[data-view="snake"] #keys button{transition:none}}
@media(forced-colors:active){#keys .back-key:focus-visible,body[data-view="snake"] #keys button:focus-visible{outline:2px solid Highlight}}

@media(max-width:800px){body[data-view="gallery"] #touch-hint{animation:touch-hint-away 6s both}}
@media(prefers-reduced-motion:reduce){body[data-view="gallery"] #touch-hint{animation:none}}
