/* A hidden island chest opens to reveal the last lens piece. */
.game[data-scene=treasure] .stage{border-top-color:#aa895b;background:linear-gradient(160deg,#fffcf3,#ecf4e4)}
.treasure-scene{position:relative;isolation:isolate;overflow:hidden;margin:1rem 0;border:1px solid #a5c4aa;border-radius:19px;background:#b9d5c1;box-shadow:0 4px 0 #d4e0ce}
.treasure-photo{display:block;width:100%;height:clamp(180px,30vw,260px);object-fit:cover;object-position:center 58%}
.treasure-scene::before{content:'';position:absolute;z-index:1;inset:40% 0 0;pointer-events:none;background:linear-gradient(transparent,#1e392b66)}
.treasure-chest{position:absolute;z-index:2;left:50%;bottom:12%;width:clamp(100px,24%,150px);height:clamp(57px,13%,78px);transform:translateX(-50%);border:4px solid #56321c;border-radius:5px 5px 15px 15px;background:repeating-linear-gradient(0deg,transparent 0 16px,#60351c66 17px 19px),linear-gradient(90deg,#72401f,#bd7739 20%,#a96430 50%,#d39450 76%,#73411f);box-shadow:inset 0 3px 3px #f2ba7288,inset 0 -6px 8px #46281566,0 9px 10px #142a1d88;font-size:0;perspective:300px}
.treasure-chest::before{content:'';position:absolute;z-index:2;left:-4px;right:-4px;bottom:calc(100% - 4px);height:67%;border:4px solid #56321c;border-bottom:5px solid #9b732d;border-radius:70% 70% 7px 7px/100% 100% 7px 7px;background:linear-gradient(90deg,transparent 22%,#e7ba4d 23% 28%,transparent 29% 70%,#e7ba4d 71% 76%,transparent 77%),linear-gradient(160deg,#d69b57,#a55e2c 54%,#65381e);box-shadow:inset 0 3px 3px #ffe1a177,0 2px 1px #42271477;transform-origin:50% 100%;transition:transform .7s ease}
.treasure-chest::after{content:'◆';position:absolute;z-index:3;top:12%;left:50%;display:grid;place-items:center;width:24px;height:27px;transform:translateX(-50%);border:2px solid #77511c;border-radius:4px;background:linear-gradient(#fbe39c,#d19c38);color:#563618;font:bold 13px/1 system-ui;box-shadow:0 2px 3px #44280f55;transition:top .6s ease,transform .6s ease,filter .6s ease}
.treasure-chest.is-open{box-shadow:inset 0 3px 3px #f2ba7288,inset 0 -6px 8px #46281566,0 0 30px 8px #ffe89b99,0 9px 10px #142a1d88}
.treasure-chest.is-open::before{transform:rotateX(-105deg)}
.treasure-chest.is-open::after{content:'★';top:-62%;width:38px;height:38px;border:0;background:none;color:#ffdb58;font-size:38px;text-shadow:0 2px 2px #916212,0 0 12px #fff5a5;box-shadow:none;animation:treasure-star-found 1s ease-out both}
.treasure-question{margin:1.1rem 0;color:#173e4c;font-size:clamp(1.6rem,4vw,2.25rem);font-weight:850;line-height:1.2}
.treasure-status{padding:.75rem 1rem;background:#fffaf0;color:#635239;font-size:.88rem;font-weight:750;line-height:1.4}
@keyframes treasure-star-found{0%{opacity:0;transform:translate(-50%,30px) scale(.45) rotate(-25deg)}65%{opacity:1;transform:translate(-50%,-6px) scale(1.18) rotate(8deg)}100%{opacity:1;transform:translate(-50%,0) scale(1) rotate(0)}}
@media(max-width:390px){.treasure-scene{border-radius:15px}.treasure-photo{height:180px}.treasure-chest{bottom:10%;width:100px;height:57px}.treasure-status{padding:.7rem .8rem}}
@media(prefers-reduced-motion:reduce){.treasure-chest::before,.treasure-chest::after{transition:none}.treasure-chest.is-open::after{animation:none}}
