.treasure-celebration{position:fixed;inset:0;margin:auto;width:min(360px,calc(100% - 28px));height:max-content;max-height:90dvh;overflow:auto;box-sizing:border-box;padding:26px 24px 20px;border:2px solid #efd18b;border-radius:26px;background:linear-gradient(160deg,#fffdf3,#fff1c8);color:#46301e;box-shadow:0 16px 60px #0004;text-align:center;z-index:2147483647;animation:treasure-appear .22s ease-out;font-family:inherit}.treasure-celebration::backdrop{background:transparent;pointer-events:none}.treasure-celebration .treasure-close{position:absolute;right:10px;top:7px;width:36px;height:36px;border:0;background:transparent;color:#654526;font-size:26px;cursor:pointer}.treasure-kicker{font-size:11px;font-weight:800;letter-spacing:.13em;margin:3px 0 12px;color:#805b22}.treasure-celebration h2{font-size:23px;line-height:1.2;margin:0;overflow-wrap:anywhere}.treasure-earned{color:#8a590a;font-size:30px;font-weight:800;margin:10px 0 0}.treasure-scene{height:180px;position:relative;overflow:hidden}.treasure-chest{position:absolute;width:225px;height:169px;left:50%;bottom:0;transform:translateX(-50%)}.treasure-lid{transform-origin:120px 89px;animation:treasure-open 2.1s ease-in-out both}.treasure-glow{position:absolute;width:180px;height:150px;left:50%;top:28px;transform:translateX(-50%);background:radial-gradient(ellipse,#ffda68aa,transparent 68%);animation:treasure-glow 2.1s ease-out both}.treasure-star{position:absolute;left:calc(50% - 15px);top:0;color:#e7ac12;font-size:32px;text-shadow:0 2px 0 #fff4ae;opacity:0;animation:treasure-fly 1.05s cubic-bezier(.3,.1,.5,1) var(--star-delay) both}.treasure-total{font-size:15px;font-weight:700;margin:0}.treasure-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@keyframes treasure-appear{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
@keyframes treasure-open{0%{transform:none}20%,75%{transform:translateY(-17px) rotate(-13deg)}100%{transform:none}}
@keyframes treasure-fly{0%{opacity:0;transform:translate(var(--star-x),-20px) scale(.55) rotate(-18deg)}20%{opacity:1}65%{opacity:1;transform:translate(calc(var(--star-x) * .45),54px) scale(1) rotate(10deg)}100%{opacity:0;transform:translate(0,110px) scale(.25) rotate(30deg)}}
@keyframes treasure-glow{0%,100%{opacity:0}25%,75%{opacity:1}}
@media(prefers-reduced-motion:reduce){.treasure-celebration,.treasure-celebration *{animation:none!important}.treasure-star{display:none}.treasure-glow{opacity:.5}}

/* Film scene: 4.8 seconds, entirely local and silent. */
.treasure-celebration{inset:0;margin:0;width:100%;height:100%;max-width:none;max-height:none;padding:16px;border:0;border-radius:0;display:grid;place-items:center;background:rgba(5,10,23,.92);color:#fff2cc;cursor:pointer;animation:treasure-screen .4s ease-out}
.treasure-celebration::backdrop{background:#050a1780}
.treasure-film{position:relative;text-align:center;width:min(600px,100%);box-sizing:border-box;padding:48px 20px 20px;border-radius:28px;background:radial-gradient(ellipse at 50% 48%,#59452e,#192132 48%,#101725 85%);box-shadow:0 28px 100px #0006;overflow:hidden}
.treasure-film .treasure-close{top:10px;right:14px;width:auto;min-height:36px;margin:0;padding:6px 12px;border:1px solid #bfb89d66;border-radius:20px;background:#121b2c;color:#e9e5d9;font:inherit;font-size:12px;z-index:5}
.treasure-film h2{font-size:clamp(23px,4vw,34px);color:#fff4d2;margin:8px 0}
.treasure-kicker{font-size:10px;color:#f3cf84;letter-spacing:.16em;margin:8px 0}
.treasure-scene{height:250px;max-width:470px;margin:auto;overflow:hidden}
.treasure-chest{width:285px;height:214px;bottom:-4px;overflow:visible;filter:drop-shadow(0 10px 12px #0005);animation:treasure-camera 4.8s ease-in-out both}
.treasure-lid{animation:treasure-open 4.8s ease-in-out both}
.treasure-glow{width:290px;height:210px;top:15px;background:radial-gradient(ellipse,#fff2aacc,#ffb63855 40%,transparent 70%);animation:treasure-light 4.8s ease-in-out both}
.treasure-rays{position:absolute;left:calc(50% - 140px);top:0;width:280px;height:220px;clip-path:polygon(45% 100%,0 0,100% 0,55% 100%);background:linear-gradient(0deg,#ffe99499,transparent);animation:treasure-light 4.8s ease-in-out both}
.treasure-star{font-size:38px;left:calc(50% - 19px);color:#ffe58c;text-shadow:0 0 14px #ffc94d,0 3px 0 #b57620;animation:treasure-fly 1.2s cubic-bezier(.28,.1,.55,1) var(--star-delay) both}
.treasure-star::after{content:'';position:absolute;left:45%;bottom:80%;width:5px;height:42px;border-radius:100%;background:linear-gradient(0deg,#ffde82,transparent);opacity:.6}
.treasure-spark{position:absolute;left:50%;top:60%;width:4px;height:4px;border-radius:50%;background:#fff0b0;box-shadow:0 0 8px #ffd16b;opacity:0;animation:treasure-spark 1.8s ease-out var(--delay) both}
.treasure-earned{font-size:clamp(30px,5vw,44px);color:#ffe197;margin:0 0 5px;animation:treasure-reveal 4.8s ease-out both}
.treasure-total{font-size:18px;margin:6px 0;color:#fff3d4;font-variant-numeric:tabular-nums}
.treasure-wish{font-size:15px;color:#eadcbb;margin:12px auto;max-width:460px;min-height:2.5em;line-height:1.45;animation:treasure-reveal 4.8s ease-out both}
.treasure-goal .treasure-wish{color:#ffe48c;font-weight:800}.treasure-goal .treasure-film{box-shadow:0 0 55px #ffcb5144,0 28px 100px #0006}
.treasure-skip{font-size:11px;color:#aaaeb8;margin:12px 0 0}
@keyframes treasure-screen{from{opacity:0}to{opacity:1}}
@keyframes treasure-camera{0%{transform:translateX(-50%) scale(.85) translateY(12px)}12%{transform:translateX(-50%) scale(.93) rotate(-2deg)}17%{transform:translateX(-50%) scale(.93) rotate(2deg)}22%{transform:translateX(-50%) scale(.94) rotate(-1deg)}35%,80%{transform:translateX(-50%) scale(1.03)}100%{transform:translateX(-50%) scale(1)}}
@keyframes treasure-open{0%,18%{transform:none}32%,100%{transform:translateY(-30px) rotate(-18deg)}}
@keyframes treasure-light{0%,16%{opacity:0}34%,72%{opacity:1}100%{opacity:.4}}
@keyframes treasure-fly{0%{opacity:0;transform:translate(var(--star-x),-15px) scale(.5) rotate(-25deg)}18%{opacity:1}60%{opacity:1;transform:translate(calc(var(--star-x) * .4),68px) scale(1) rotate(5deg)}100%{opacity:0;transform:translate(0,143px) scale(.15) rotate(25deg)}}
@keyframes treasure-spark{0%{opacity:0;transform:translate(0,0)}18%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(.3)}}
@keyframes treasure-reveal{0%,38%{opacity:0;transform:translateY(10px)}56%,100%{opacity:1;transform:none}}
@media(max-width:500px){.treasure-film{padding:40px 12px 14px}.treasure-scene{height:210px}.treasure-chest{width:255px;height:191px}.treasure-kicker{letter-spacing:.08em;font-size:9px}.treasure-wish{font-size:14px}}
@media(prefers-reduced-motion:reduce){.treasure-celebration,.treasure-celebration *{animation:none!important}.treasure-star,.treasure-spark,.treasure-rays{display:none}.treasure-glow{opacity:.35}.treasure-lid{transform:translateY(-25px) rotate(-15deg)}}
/* Local pirate film with live reward data. */
.treasure-film{width:min(960px,100%);padding:20px 0 14px;background:#17130f;border:1px solid #bc915144;border-radius:22px;box-shadow:0 24px 100px #0009}
.treasure-film h2{font-size:clamp(22px,3vw,30px);margin:5px 90px 14px}
.treasure-kicker{margin:0 100px 6px;font-size:9px}
.treasure-scene{height:auto;aspect-ratio:16/9;max-width:none;width:100%;margin:0;isolation:isolate;background:#21160e}
.treasure-poster,.treasure-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.treasure-video{opacity:0}.treasure-playing .treasure-video{opacity:1}.treasure-video[hidden]{display:none}
.treasure-earned{position:absolute;left:0;right:0;bottom:94px;margin:0;font-size:clamp(28px,4vw,40px);z-index:2;pointer-events:none;animation:treasure-video-reveal 1s ease-out 1.7s both}
.treasure-total{margin:60px 12px 0;font-size:17px}.treasure-wish{margin:8px auto 0;padding:0 18px;min-height:0;font-size:14px;animation:treasure-video-reveal .8s ease-out 2s both}
.treasure-skip{margin:8px 0 0;font-size:10px}.treasure-credit{display:inline-block;color:#b8a98f!important;font-size:9px;margin-top:7px;text-decoration:underline}
.treasure-film .treasure-close{background:#211c16;color:#f9e6c4;top:12px;right:12px}
.treasure-star{top:14%;left:calc(55% - 19px);z-index:2;animation-name:treasure-video-fly;animation-duration:1.7s;font-size:clamp(25px,4vw,42px)}
.treasure-spark{left:55%;top:77%;z-index:2}
@keyframes treasure-video-fly{0%{opacity:0;transform:translate(var(--star-x),-20px) scale(.4)}18%{opacity:1}75%{opacity:1}100%{opacity:0;transform:translate(0,clamp(100px,28vw,290px)) scale(.15) rotate(40deg)}}
@keyframes treasure-video-reveal{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media(max-width:500px){.treasure-celebration{padding:8px}.treasure-film{padding-top:50px;border-radius:18px}.treasure-kicker{margin:0 12px 6px}.treasure-film h2{margin:6px 12px 14px}.treasure-wish{font-size:13px}.treasure-earned{bottom:94px}}
@media(max-height:650px) and (min-width:650px){.treasure-film{width:min(680px,100%);padding-top:12px}.treasure-scene{max-height:48dvh;aspect-ratio:auto;height:48dvh}.treasure-film h2{font-size:22px;margin-bottom:8px}.treasure-kicker{display:none}.treasure-total{margin-top:46px}.treasure-earned{font-size:28px}}
@media(prefers-reduced-motion:reduce){.treasure-video{display:none}.treasure-celebration,.treasure-celebration *{animation:none!important}}
.treasure-film{display:flex;flex-direction:column;align-items:stretch}.treasure-film h2{order:1}.treasure-scene{order:2;flex-shrink:0}.treasure-earned{order:3;position:static;margin:12px 12px 0}.treasure-total{order:4;margin:2px 12px 0}.treasure-wish{order:5}.treasure-skip{order:6}.treasure-credit{order:7;align-self:center}
@media screen and (min-width:1120px){body>.treasure-celebration{zoom:calc(1 / var(--dashboard-zoom,1))}}
@media(min-width:650px){.treasure-film{width:min(960px,100%,calc((100dvh - 250px)*1.7));max-height:calc(100dvh - 32px);overflow:auto}}
