/* Keep controls usable without shrinking the jigsaw on compact phones. */
.corner-rune{z-index:1100;left:max(6px,env(safe-area-inset-left));bottom:max(4px,env(safe-area-inset-bottom))}
.game-shell{padding-top:env(safe-area-inset-top)}
.wood-button,.quiet-link{min-height:48px}
.tray-pager .wood-button{min-width:48px;min-height:48px}
.adventure-header .icon,.adventure-footer>.icon{min-width:48px;min-height:48px}
.adventure-header .wood-button,.adventure-footer>.wood-button,.gallery-top>.wood-button{min-height:48px}
.suspended *{animation-play-state:paused!important}
.final-cast{width:min(900px,100%)}
.final-cast img{flex:0 0 auto;width:22%;min-width:80px;max-width:180px}
.gallery{height:calc(100% - 45px)}
.reward-friends .reward-highfive{width:160px;height:95px;object-fit:contain;flex:0 0 160px}
.speech{position:relative}
.speech:before{content:"";position:absolute;top:-9px;left:calc(50% - 8px);width:16px;height:16px;background:#fff9eb;border-left:2px solid #d7bb8d;border-top:2px solid #d7bb8d;transform:rotate(45deg);border-radius:5px 0 0}
.print-picture-body{padding-bottom:max(45px,env(safe-area-inset-bottom))}
@media(orientation:landscape){
 .adventure-illustration{width:min(100%,calc((100dvh - 305px)*1.333333));justify-self:center}
 .adventure-menu .world-compass{margin-top:12px;margin-bottom:16px}
 .adventure-footer{margin-top:15px}
 .journey-finale{padding-top:20px}
 .journey-finale h1{font-size:42px;margin:8px 0 12px}
 .journey-finale>p{font-size:16px}
 .journey-pictures{max-width:1000px;margin:24px auto 18px}
 .journey-finale .final-highfive{width:180px;height:100px}
 .journey-finale .final-ori{margin:12px 0}
 .reward-view .reward-friends>img:not(.reward-highfive){height:110px;width:30%}
 .reward-view .reward-friends .reward-highfive{height:75px}
}
@media(orientation:portrait) and (max-width:599px){
 .workshop{grid-template-rows:60px minmax(0,1fr) 132px 60px;padding-bottom:max(23px,env(safe-area-inset-bottom))}
 .guide{height:60px}
 .guide>img{height:60px;width:48px}
 .speech h1{font-size:17px}
 .speech p{font-size:12px}
 .speech:before{top:calc(50% - 8px);left:-9px;transform:rotate(-45deg)}
 .reference{width:72px}
 .piece-shelf{height:132px;grid-template-columns:minmax(0,1fr) 104px;grid-template-rows:48px minmax(0,1fr);gap:4px 7px}
 .shelf-title{grid-column:1;grid-row:1}
 .tray-pager{grid-column:2;grid-row:1;flex-wrap:nowrap;gap:8px}
 .tray-pager .wood-button{width:48px;height:48px}
 .piece-tray{grid-column:1/-1;grid-row:2}
 .puzzle-tools{margin-left:12px}
 .puzzle-tools .wood-button{min-height:48px}
 .gallery .difficulty,.choose-pieces .difficulty{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .gallery .difficulty button,.choose-pieces .difficulty button{min-width:48px;min-height:56px}
 .pause-panel{padding:20px 12px}
 .pause-panel>div{gap:8px}
 .pause-panel .icon{width:60px;height:60px}
 .reward-friends .reward-highfive{width:125px;height:76px;flex-basis:125px}
 .reward-view{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;gap:12px;padding:16px 5% max(38px,env(safe-area-inset-bottom));overflow:hidden}
 .reward-title h1{font-size:28px}
 .reward-title p{font-size:14px;margin-top:6px}
 .reward-content{display:flex;flex-direction:column;justify-content:center;gap:10px;min-height:0;min-width:0;width:100%;height:100%;margin:0}
 .finished-picture{flex:0 1 auto;height:auto;width:90%;max-width:90%;max-height:calc(100% - 74px);aspect-ratio:4/3;align-self:center;border-width:5px;min-width:0}
 .finished-picture>svg{height:100%;width:100%}
 .gold-seal{width:48px;height:48px;font-size:31px;right:-15px;bottom:-10px}
 .reward-friends{flex:none;height:64px;max-width:none;flex-wrap:nowrap;gap:8px}
 .reward-friends>img:not(.reward-highfive){display:none}
 .reward-friends .reward-highfive{order:-1;flex:0 0 88px;width:88px;height:64px}
 .reward-friends p{flex:1;font-size:14px;padding:8px;margin:0}
 .reward-actions{gap:8px}
 .reward-actions .wood-button{font-size:13px;padding:8px 12px;min-height:48px}
 .reward-actions .icon{width:48px;height:48px}
 .reward-view .keepsake-actions{gap:8px;margin:0}
 .reward-view .keepsake-actions>span,.reward-view .reward-count{display:none}
 .reward-view .keepsake-actions>p{min-height:0;margin:0}
 .reward-view .keepsake-actions>p:empty{display:none}
 .reward-view .keepsake-actions .wood-button{font-size:13px;padding:8px 12px}
 .journey-finale{padding:16px 5% 40px}
 .journey-finale h1{font-size:28px;margin:5px 0 8px}
 .journey-finale>p{font-size:13px}
 .journey-pictures{gap:16px 10px;margin:20px auto 14px}
 .journey-pictures>div,.journey-pictures>div:last-child{width:29%;padding:3px 3px 7px}
 .journey-pictures span{width:25px;height:25px;font-size:17px;bottom:-10px;right:4px}
 .journey-finale .final-ori{gap:12px;margin:10px 0}
 .journey-finale .final-highfive{width:100px;height:65px}
 .journey-finale .final-ori>span{font-size:17px}
 .journey-finale .reward-actions{margin-top:10px}
 .journey-finale .keepsake-actions{margin-top:12px;gap:8px}
 .journey-finale .keepsake-actions>span{display:none}
 .journey-finale .keepsake-actions>p:empty{display:none}
}
@media(orientation:portrait) and (max-height:700px){.journey-finale>p{display:none}}
@media print{.print-picture-body{padding:0}}

/* The friendship book distinguishes earned discoveries from the open catalog. */
.empty-album{grid-column:1/-1;text-align:center;padding:18px;display:grid;justify-items:center;gap:12px}
.empty-album>img{width:100px;height:110px;object-fit:contain}
.empty-album p{font-size:16px;line-height:1.35}
.discovery-cast{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;width:min(800px,100%);margin:0 auto}
.discovery-cast figure{margin:0;min-width:0;padding:8px;background:#fff8e5b3;border:1px solid #d5bb8c;border-radius:18px}
.discovery-cast figure img{width:100%;height:125px;object-fit:contain;filter:drop-shadow(0 3px 3px #49392333)}
.discovery-cast figcaption{font-size:18px;margin-top:3px}
.discovery-cast .collection-empty-guide{grid-column:1/-1;width:120px;height:140px;object-fit:contain;justify-self:center}
.world-finale{gap:14px}
.world-finale .pager{margin:0}
@media(orientation:portrait) and (max-width:599px){
 .world-finale{padding:16px 5% 44px;gap:10px}
 .world-finale h1{font-size:28px}
 .world-finale>p{font-size:14px}
 .discovery-cast{gap:8px}
 .discovery-cast figure{padding:5px 2px;border-radius:12px}
 .discovery-cast figure img{height:68px}
 .discovery-cast figcaption{font-size:14px}
 .empty-album{padding:12px 3px}
 .empty-album h2{font-size:22px}
 .empty-album p{font-size:14px}
}


/* Keep the opening title readable over the illustrated canopy. */
.opening-title{color:#382814;text-shadow:0 0 12px #fff,0 0 25px #fff8df,0 2px 3px #fff}
.opening-title h1{paint-order:stroke fill;-webkit-text-stroke:5px #fffbed;text-shadow:0 0 12px #fff,0 0 26px #fff8df,0 3px 3px #fffbed}
.opening-title>span,.opening-title p{paint-order:stroke fill;-webkit-text-stroke:2.5px #fffbed;text-shadow:0 0 8px #fff,0 0 16px #fffbed}
.opening-title p{font-weight:600;font-size:clamp(16px,2vw,20px)}
