/* Shared final alignment: equal title space on both sides of the close asset. */
#overlay .sheet{position:relative;display:flex;flex-direction:column;max-height:calc(100svh - 32px);width:min(94%,430px)}
#overlay[data-view] .sheet>header{position:relative;flex:none;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;justify-content:stretch;min-height:48px;height:auto;padding:0 42px;margin:0 0 16px}
#overlay[data-view] #sheet-title{max-width:none;width:100%;margin:0;text-align:center;font:normal clamp(22px,6.1vw,29px)/1.12 'Lilita One';letter-spacing:0}
#overlay #close{position:absolute;right:-3px;top:1px;width:42px;height:42px;min-height:42px;min-width:42px}
#overlay #sheet-body{min-height:0;max-height:none;overflow:auto;scrollbar-width:thin;scrollbar-color:#b59a57 transparent;padding-bottom:16px;overscroll-behavior:contain}
#overlay .sheet>header:after{display:none}
#overlay[data-view=settings] .sheet{padding:20px 17px 25px;max-height:calc(100svh - 28px)}
#overlay[data-view=settings] #sheet-body{padding:0 2px 10px;scroll-padding-bottom:12px}
#overlay[data-view=settings] #rules-settings{margin-bottom:6px;flex-shrink:0}
#overlay[data-view=collection] .sheet{padding:22px 16px 26px}
#overlay[data-view=collection] #sheet-title{font-size:clamp(20px,5.6vw,27px)}
#overlay[data-view=collection] .collection-count{margin:0 0 15px}
#overlay[data-view=collection] .jewel-card:not(.unseen){background-color:#fff3d2}
/* Gold-edged cream plinths separate both challenge icons from the scene. */
.challenge-shortcuts button{background:transparent url('assets/polish/tile.webp') center/100% 100% no-repeat;padding:7px;filter:none;box-shadow:0 3px 7px #001d26aa;border-radius:13px}
.challenge-shortcuts button.locked-mode{filter:none}
.challenge-shortcuts .locked-mode img{filter:grayscale(1) brightness(.8) drop-shadow(0 1px 1px #fff9da)}
.challenge-shortcuts button:not(.locked-mode) img{filter:drop-shadow(0 2px 2px #2a402c77)}
.challenge-shortcuts button:active{transform:scale(.9);filter:brightness(1.15)}
/* Two real expression images. The blink is brief, with still breathing pauses. */
.living-lemur{position:relative;display:block;width:180px;height:220px;flex-shrink:0;pointer-events:none;transform-origin:50% 93%;animation:lemur-breathe 6.7s ease-in-out infinite;filter:drop-shadow(0 5px 4px #46604420)}
.living-lemur>img{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;margin:0;pointer-events:none}
.living-lemur .lemur-blink-frame{opacity:0;animation:lemur-expression 7.3s steps(1,end) infinite}
.living-lemur .lemur-open{animation:lemur-eyes 7.3s steps(1,end) infinite}
.lemur-reassure{animation:lemur-reassure 7.4s ease-in-out infinite}
.lemur-invite{animation:lemur-invite 8.2s ease-in-out infinite}
.lemur-noads{animation:lemur-admire 6.9s ease-in-out infinite}
.lemur-cheer{animation:lemur-celebrate 4.6s ease-in-out infinite}
.lemur-hang{transform-origin:57% 89%;animation:lemur-peek 7.9s ease-in-out infinite}
.lemur-hang .lemur-blink-frame,.lemur-hang .lemur-open{animation-delay:1.9s}
.locked-lemur .living-lemur{width:min(80%,235px);height:clamp(185px,32svh,275px)}
.locked-lemur{padding:2px 0 0;gap:9px}.locked-lemur p{font-size:clamp(20px,5.7vw,26px);margin:5px 4px 0}
.challenge-list-hero>.living-lemur{width:100%;height:155px}
.challenge-list-hero>.living-lemur span{letter-spacing:0}
.challenge-celebration>.living-lemur{height:100%;width:90%;min-height:0}
.tutorial-stage>.living-lemur{position:absolute;left:-10px;bottom:0;width:100px;height:155px;z-index:2}
.intro-trial>.living-lemur{width:85px;height:110px}
/* His hands overlap the actual card edge. Space is reserved above the dialog. */
#overlay[data-view=tools]{padding:145px 12px 16px}
#overlay[data-view=tools] .sheet{max-height:calc(100svh - 161px);overflow:visible;padding:24px 18px 25px}
#overlay[data-view=tools] .shop-mascot{position:absolute;width:152px;height:152px;left:50%;bottom:calc(100% - 20px);translate:-50% 0;z-index:3}
#overlay[data-view=coins] .shop-mascot{display:none}
#overlay[data-view=tools] #sheet-body,#overlay[data-view=coins] #sheet-body{padding:0 2px 8px;overflow:auto;min-height:0}
#overlay[data-view=tools] .sheet>header,#overlay[data-view=coins] .sheet>header{padding:0 80px;margin-bottom:12px;border:0;min-height:45px}
#overlay[data-view=tools] #sheet-title,#overlay[data-view=coins] #sheet-title{font-size:27px}
#overlay[data-view=tools] .shop-wallet,#overlay[data-view=coins] .shop-wallet{position:absolute;left:0;top:6px;min-width:68px;padding:4px 6px;font-size:18px;height:30px;gap:3px}
#overlay[data-view=tools] .shop-wallet img,#overlay[data-view=coins] .shop-wallet img{width:20px;height:20px}
#overlay[data-view=coins] .sheet{padding:22px 18px 26px}
#overlay .adfree-info{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;width:100%;min-height:149px;padding:5px 2px 8px;background:none;border:0;border-image:none;box-shadow:none;text-shadow:none;color:#004b43}
.adfree-info>img{width:66px;height:66px;object-fit:contain}.adfree-info>strong{font:normal clamp(17px,4.7vw,22px)/1.05 'Lilita One';min-height:44px;display:grid;place-items:center}.adfree-info .offer-benefit{font-size:11px;min-height:26px}.adfree-info .offer-more{display:flex;align-items:center;gap:5px;font:12px 'Lilita One';color:#437466}.offer-more img{width:20px;height:20px;object-fit:contain}
.adfree-info:active{filter:brightness(1.12)}
#overlay[data-view=adfree-info] .sheet,#overlay[data-view=restart-confirm] .sheet{padding:22px 20px 25px}
.noads-hero{height:clamp(160px,31svh,260px);display:flex;justify-content:center}.noads-hero .living-lemur{width:90%;height:100%}
.noads-features{display:grid;gap:8px;margin:14px 0 8px}.noads-features>div{display:flex;gap:12px;align-items:center;justify-content:center}.noads-features img{width:38px;height:44px;object-fit:contain}.noads-features strong{font:normal 21px/1.15 'Lilita One';color:#005247;max-width:220px}
#overlay .noads-note,#overlay .restart-note{font:14px/1.4 system-ui;text-align:center;color:#526e60;margin:12px auto;max-width:270px}
#overlay[data-view=adfree-info] .primary,#overlay[data-view=restart-confirm] .primary{width:100%;min-width:0;height:60px;font-size:19px;margin-top:15px}
.restart-illustration{display:flex;justify-content:center;align-items:center;height:clamp(145px,27svh,220px);position:relative}
.restart-illustration .living-lemur{width:190px;height:100%}.restart-illustration>img{width:70px;height:80px;object-fit:contain;margin-left:-15px;filter:drop-shadow(0 3px 3px #9d772933)}
.restart-destination{display:flex;align-items:center;justify-content:center;gap:10px;margin:10px 0}.restart-destination>img{width:38px;height:45px;object-fit:contain}.restart-destination strong{font:normal 22px/1.1 'Lilita One';max-width:210px;color:#004b43}
.heart-price{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.heart-price img{width:32px!important;height:32px!important}
/* Local shimmer and sparse raster glints; no distortion of the waterfall. */
#overlay[data-view=mode-menu] .sheet{isolation:isolate;overflow:hidden;padding:30px 22px 26px}
#overlay[data-view=mode-menu] .sheet>header{min-height:180px;padding:0;margin:0 0 20px;z-index:2}
#overlay[data-view=mode-menu] #sheet-title{padding:0 10px}.mode-logo{width:260px;max-width:90%;animation:logo-glow 6s ease-in-out infinite}
#overlay[data-view=mode-menu] #sheet-body{overflow:visible;padding:0;z-index:1}
#overlay[data-view=mode-menu] .sheet:before{content:'';position:absolute;inset:-70%;z-index:0;pointer-events:none;background:linear-gradient(105deg,transparent 44%,#fffce377 49%,#fff5cba0 50%,transparent 56%);transform:translateX(-60%);animation:panel-sheen 9s ease-in-out infinite}
.panel-glints{position:absolute;inset:0;pointer-events:none;z-index:4}.panel-glints i{position:absolute;left:var(--x);top:var(--y);width:23px;height:23px;background:url('assets/fx-sparkle.webp') center/contain no-repeat;opacity:0;animation:panel-twinkle 4.5s calc(var(--i)*.61s) ease-in-out infinite}
@keyframes lemur-expression{0%,38%,42%,76%,80%,100%{opacity:0}40%,78%{opacity:1}}
@keyframes lemur-eyes{0%,38%,42%,76%,80%,100%{opacity:1}40%,78%{opacity:0}}
@keyframes lemur-breathe{0%,100%{transform:scale(1)}45%{transform:scale(1.008,1.018) rotate(-.5deg)}70%{transform:scale(1.003,1.006)}}
@keyframes lemur-reassure{0%,30%,100%{transform:rotate(0) scale(1)}42%{transform:rotate(-1.4deg) scale(1.006,.99)}54%{transform:rotate(.6deg) scale(1.006,1.016)}72%{transform:rotate(0)}}
@keyframes lemur-invite{0%,40%,100%{transform:rotate(0)}48%{transform:rotate(-1.8deg) scaleY(1.012)}60%{transform:rotate(.6deg)}76%{transform:rotate(0)}}
@keyframes lemur-admire{0%,100%{transform:rotate(0)}30%{transform:rotate(-1.5deg) scale(1.015)}58%{transform:rotate(.7deg) scaleY(1.01)}80%{transform:rotate(0)}}
@keyframes lemur-celebrate{0%,26%,100%{transform:translateY(0) scale(1)}7%{transform:translateY(2px) scale(1.025,.975)}14%{transform:translateY(-7px) scale(.99,1.015) rotate(-1.4deg)}20%{transform:translateY(1px) scale(1.015,.99)}60%{transform:rotate(1deg) scaleY(1.01)}}
@keyframes lemur-peek{0%,100%{transform:scale(1) rotate(0)}35%{transform:scale(1.01,.99) skewX(-.5deg)}52%{transform:scale(1.008,1.012) rotate(.6deg)}75%{transform:scale(1)}}
@keyframes logo-glow{0%,100%{filter:drop-shadow(0 4px 4px #00514333)}48%{filter:drop-shadow(0 3px 10px #e7b64488) brightness(1.1)}}
@keyframes panel-sheen{0%,55%{transform:translateX(-60%)}86%,100%{transform:translateX(60%)}}
@keyframes panel-twinkle{0%,22%,70%,100%{opacity:0;scale:.3;rotate:0deg}42%{opacity:.9;scale:1;rotate:25deg}}
@media(max-width:350px){#overlay[data-view] .sheet>header{padding:0 37px}#overlay[data-view=tools] .sheet>header,#overlay[data-view=coins] .sheet>header{padding:0 70px}#overlay[data-view=tools] #sheet-title,#overlay[data-view=coins] #sheet-title{font-size:24px}#overlay .shop-wallet{font-size:16px!important;min-width:61px!important}.tutorial-stage>.living-lemur{width:84px;height:134px}.challenge-list-hero>.living-lemur{height:140px}#overlay[data-view=restart-confirm] .primary{font-size:17px;gap:7px;padding:8px 12px}.noads-features strong{font-size:19px}.adfree-info>strong{font-size:17px}}
@media(max-height:600px){#overlay[data-view=tools]{padding-top:105px}#overlay[data-view=tools] .sheet{max-height:calc(100svh - 121px)}#overlay[data-view=tools] .shop-mascot{width:115px;height:115px;bottom:calc(100% - 18px)}.locked-lemur .living-lemur{height:160px}.noads-hero{height:145px}.restart-illustration{height:130px}}
@media(min-width:700px) and (min-height:900px){#overlay .sheet{width:min(80%,520px);padding:28px 25px 32px}#overlay[data-view] #sheet-title{font-size:31px}#overlay[data-view=tools] .sheet{padding-top:29px}#overlay[data-view=tools] .shop-mascot{width:180px;height:180px}.locked-lemur .living-lemur{width:270px;height:310px}.noads-hero{height:290px}#overlay[data-view=settings] .toggle-row{height:60px;margin-bottom:9px}#overlay[data-view=settings] .volume-row{height:75px}#overlay[data-view=settings] .settings-progress{height:78px}.adfree-info>strong{font-size:23px}.adfree-info .offer-benefit{font-size:13px}#overlay[data-view=collection] .jewel-card img{width:100%;height:100px}}
@media(prefers-reduced-motion:reduce){.living-lemur,.living-lemur>img,.mode-logo,.panel-glints i,#overlay[data-view=mode-menu] .sheet:before{animation:none}.living-lemur .lemur-blink-frame,.panel-glints,#overlay[data-view=mode-menu] .sheet:before{display:none}}

#overlay[data-view=challenge-locked] #sheet-body{padding-bottom:14px}.locked-lemur p{max-width:250px;margin-left:auto;margin-right:auto}
#overlay .adfree-info{gap:3px;min-height:144px;padding:3px 2px 5px}.adfree-info>img{width:56px;height:56px}.adfree-info>strong{min-height:26px;font-size:19px}.adfree-info .offer-benefit{min-height:25px}
@media(max-width:350px){.adfree-info>strong{font-size:17px;min-height:37px}}

@media(max-height:600px){
 #overlay[data-view=settings] .sheet{padding:15px 14px 19px}
 #overlay[data-view=settings] .sheet>header{min-height:44px;margin-bottom:9px}
 #overlay[data-view=settings] .toggle-row{height:44px;margin:0 0 3px;padding:4px 8px}
 #overlay[data-view=settings] .volume-row{height:52px}
 #overlay[data-view=settings] .settings-progress{height:56px;margin-bottom:5px}
 #overlay[data-view=settings] #restart{height:48px;min-height:48px;margin-top:5px}
 #overlay[data-view=settings] .restart-cost{height:18px;margin:2px 0;font-size:12px}
 #overlay[data-view=settings] #rules-settings{height:44px;min-height:44px;margin:5px 0 0}
 #overlay[data-view=settings] #sheet-body{padding-bottom:5px}
}
/* Keep the floating fullscreen control away from dialog hit targets. */
body:has(#overlay:not([hidden])) #fullscreen-toggle{visibility:hidden}
#overlay[data-view=tools] #sheet-body,#overlay[data-view=coins] #sheet-body{scrollbar-width:thin;scrollbar-color:#c0a262 transparent}
#overlay[data-view=coins] .coin-packs{gap:8px 12px;padding-top:8px}
#overlay[data-view=coins] .hourly-gift{padding:8px 0}
#overlay[data-view=coins] .adfree-offers{padding-bottom:8px}
#overlay[data-view=coins] .store-availability{margin-top:6px}

/* 0.23.1: one continuous guide silhouette; larger, labelled challenge tiles. */
.living-lemur.lemur-stable .lemur-open{animation:none;opacity:1}
.challenge-shortcuts{height:auto;gap:8px;align-items:center}
.challenge-shortcuts button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;width:clamp(68px,19vw,90px);height:clamp(80px,22vw,104px);padding:5px 5px 7px;flex:none}
.challenge-shortcuts button img{width:100%;height:calc(100% - 20px);min-height:0;object-fit:contain}
.challenge-access-level{display:block;flex:none;width:100%;height:20px;text-align:center;font:normal clamp(13px,3.6vw,17px)/20px 'Lilita One';letter-spacing:0;white-space:nowrap;color:#004a40;text-shadow:0 1px #fffbe9}
@media(max-width:350px){.challenge-shortcuts{gap:5px}#challenge-clock{font-size:14px;min-width:40px;padding:4px}}
