/* A short, contained reveal. Combat and the one-screen hub remain visible. */
.workshop{position:relative;isolation:isolate}
.chest-opening-layer{position:absolute;inset:0;z-index:8;display:grid;place-items:center;overflow:hidden;border-radius:inherit;background:radial-gradient(ellipse,#fff8e9 5%,#f5efdd 68%,#dedfcf);animation:chest-stage-fade var(--open-duration) both;cursor:wait;contain:layout paint}
.chest-opening-scene{position:relative;width:260px;height:260px;pointer-events:none;--chest-size:170px;--loot-lift:-46px}
.chest-ground-shadow{position:absolute;left:26%;right:26%;top:85%;height:7%;border-radius:50%;background:#53452c40;filter:blur(5px);animation:chest-shadow var(--open-duration) both}
.chest-charge{position:absolute;inset:10%;border-radius:50%;background:radial-gradient(ellipse,#fff 0%,color-mix(in srgb,var(--reveal-color),#ffe5a4 65%) 22%,transparent 68%);animation:chest-charge var(--open-duration) both}
.chest-opening-art{position:absolute;width:var(--chest-size);height:var(--chest-size);left:50%;top:65%;margin-left:calc(var(--chest-size)/-2);margin-top:calc(var(--chest-size)/-2);transform-origin:50% 85%;animation:chest-anticipate var(--open-duration) both;perspective:450px}
.chest-piece{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;image-rendering:auto;max-width:none;max-height:none;filter:drop-shadow(0 5px 4px #49342525)}
.chest-base{z-index:2}
.chest-lid{z-index:4;transform-origin:50% 53%;animation:chest-hinge var(--open-duration) cubic-bezier(.18,.8,.25,1) both;backface-visibility:visible}
.chest-lock{z-index:5;animation:chest-unlatch var(--open-duration) both}
.chest-mouth-light{position:absolute;z-index:3;left:12%;right:13%;top:43%;height:16%;border-radius:50%;background:radial-gradient(ellipse,#fff 0%,#fff2a9 40%,var(--reveal-color) 76%,transparent);filter:blur(4px);animation:chest-light var(--open-duration) both}
.chest-rays{position:absolute;inset:7%;background:conic-gradient(from 15deg,transparent 0deg 14deg,#f2cd682e 16deg 23deg,transparent 26deg 44deg,#f2cd6840 46deg 53deg,transparent 56deg 74deg,#f2cd682e 76deg 83deg,transparent 86deg 104deg,#f2cd6840 106deg 113deg,transparent 116deg 134deg,#f2cd682e 136deg 143deg,transparent 146deg 164deg,#f2cd6840 166deg 173deg,transparent 176deg 194deg,#f2cd682e 196deg 203deg,transparent 206deg 224deg,#f2cd6840 226deg 233deg,transparent 236deg 254deg,#f2cd682e 256deg 263deg,transparent 266deg 284deg,#f2cd6840 286deg 293deg,transparent 296deg 314deg,#f2cd682e 316deg 323deg,transparent 326deg 344deg,#f2cd6840 346deg 353deg,transparent 356deg);border-radius:50%;mask-image:radial-gradient(ellipse,#000 10%,transparent 70%);animation:chest-rays var(--open-duration) both}
.chest-burst-ring{position:absolute;left:50%;top:50%;width:90px;height:90px;margin:-45px;border-radius:50%;border:3px solid #f1d590;box-shadow:0 0 15px #fff4c4,inset 0 0 12px #fff4c4;animation:chest-ring var(--open-duration) both}
.chest-sparks{position:absolute;inset:0;z-index:6}
.chest-spark{position:absolute;left:50%;top:58%;width:4px;height:13px;border-radius:2px;background:linear-gradient(#fff,var(--reveal-color));box-shadow:0 0 7px #ffe9a8;animation:chest-spark var(--open-duration) both;animation-delay:var(--spark-delay)}
.star-spark{width:12px;height:12px;clip-path:polygon(50% 0,62% 36%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 36%);background:#fff5cb}
.chest-loot-reveal{position:absolute;z-index:7;left:0;right:0;top:19%;display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;animation:chest-loot var(--open-duration) both;transform-origin:50% 80%}
.loot-jewel{position:relative;display:grid;place-items:center;width:94px;height:94px;border:2px solid color-mix(in srgb,var(--reveal-color),#fff 40%);border-radius:18px;background:radial-gradient(ellipse at 32% 20%,#fffef2,var(--reveal-color));box-shadow:0 5px 0 color-mix(in srgb,var(--reveal-color),#344a43 45%),0 12px 24px #4b453b30,inset 0 1px 5px #fff;overflow:hidden}
.loot-jewel>.pixel-icon{width:80px;height:80px;image-rendering:auto!important;filter:drop-shadow(0 5px 3px #263b3530)}
.loot-glint{position:absolute;inset:-25% -80%;background:linear-gradient(115deg,transparent 44%,#fff9 49%,#fffe 50%,transparent 56%);animation:chest-glint var(--open-duration) both;transform:translateX(-70%)}
.chest-loot-reveal>b{font:900 17px/1.15 'Trebuchet MS',sans-serif;letter-spacing:1.7px;color:color-mix(in srgb,var(--reveal-color),#263f38 45%);background:#fffbed;border:1px solid color-mix(in srgb,var(--reveal-color),#fff 55%);border-radius:5px;padding:3px 10px;box-shadow:0 2px 8px #44513d20;text-shadow:none;max-width:95%}
.chest-loot-reveal>small{font:700 11px/1.2 'Trebuchet MS',sans-serif;color:#52634e;background:#fffbedf5;border-radius:4px;padding:2px 7px;max-width:95%}
.chest-loot-reveal>em{font:900 10px/1.2 'Trebuchet MS',sans-serif;font-style:normal;letter-spacing:1px;color:#2b805e;background:#e5f1d6;border:1px solid #a8c298;padding:3px 7px;border-radius:9px}
.loot-sunburst{position:absolute;z-index:-1;left:50%;top:45px;width:180px;height:180px;margin:-90px;background:radial-gradient(ellipse,color-mix(in srgb,var(--reveal-color),transparent 35%),transparent 68%);border-radius:50%}
.special-drop .loot-jewel{box-shadow:0 5px 0 color-mix(in srgb,var(--reveal-color),#344a43 45%),0 0 30px color-mix(in srgb,var(--reveal-color),transparent 35%),inset 0 1px 5px #fff}
@keyframes chest-stage-fade{0%{opacity:0}5%,93%{opacity:1}100%{opacity:0}}
@keyframes chest-shadow{0%,34%{transform:scale(1)}40%{transform:scale(1.2,.75);opacity:.5}51%,100%{transform:scale(1);opacity:1}}
@keyframes chest-charge{0%,9%{opacity:0;transform:scale(.25)}31%{opacity:.65;transform:scale(.8)}36%{opacity:1;transform:scale(1.3)}48%{opacity:.3;transform:scale(1.45)}85%,100%{opacity:0;transform:scale(1.5)}}
@keyframes chest-anticipate{0%,6%{transform:scale(1)}12%{transform:translateY(3px) scale(1.04,.96) rotate(-2deg)}18%{transform:translateY(4px) scale(1.05,.95) rotate(2deg)}23%{transform:translateY(5px) scale(1.06,.94) rotate(-3deg)}27%{transform:translateY(5px) scale(1.07,.93) rotate(3deg)}31%,34%{transform:translateY(7px) scale(1.1,.9) rotate(-1deg)}39%{transform:translateY(-12px) scale(.92,1.12)}46%{transform:translateY(3px) scale(1.07,.94)}54%{transform:translateY(-2px) scale(.99,1.02)}64%,100%{transform:scale(1)}}
@keyframes chest-hinge{0%,34%{transform:rotateX(0) translateY(0)}41%{transform:translateY(-32px) rotateX(82deg) rotate(-3deg)}48%{transform:translateY(-22px) rotateX(57deg) rotate(1deg)}59%,100%{transform:translateY(-25px) rotateX(65deg)}}
@keyframes chest-unlatch{0%,28%{opacity:1;transform:translateY(0) rotate(0)}33%{opacity:1;transform:translateY(-4px) rotate(-8deg)}39%{opacity:1;transform:translate(13px,-38px) rotate(24deg)}54%,100%{opacity:0;transform:translate(42px,34px) rotate(100deg)}}
@keyframes chest-light{0%,32%{opacity:0;transform:scale(.4,.15)}35%{opacity:.8;transform:scale(1,.35)}39%{opacity:1;transform:scale(1.6,3.4)}57%{opacity:.7;transform:scale(1.2,2)}95%,100%{opacity:0;transform:scale(1)}}
@keyframes chest-rays{0%,35%{opacity:0;transform:scale(.25) rotate(-15deg)}46%{opacity:1;transform:scale(1.25) rotate(0)}88%{opacity:.6;transform:scale(1.35) rotate(18deg)}100%{opacity:0;transform:scale(1.4) rotate(22deg)}}
@keyframes chest-ring{0%,35%{opacity:0;transform:translateY(20px) scale(.15)}38%{opacity:1;transform:translateY(20px) scale(.65)}60%,100%{opacity:0;transform:translateY(20px) scale(3)}}
@keyframes chest-spark{0%,35%{opacity:0;transform:translate(0,0) scale(.2)}40%{opacity:1}66%{opacity:.95;transform:translate(var(--spark-x),var(--spark-y)) rotate(var(--spark-turn)) scale(.8)}94%,100%{opacity:0;transform:translate(var(--spark-x),calc(var(--spark-y) + 40px)) rotate(var(--spark-turn)) scale(.15)}}
@keyframes chest-loot{0%,43%{opacity:0;transform:translateY(72px) scale(.08) rotate(-14deg)}49%{opacity:1;transform:translateY(8px) scale(.85) rotate(-5deg)}59%{opacity:1;transform:translateY(calc(var(--loot-lift) - 9px)) scale(1.15) rotate(3deg)}68%{transform:translateY(calc(var(--loot-lift) + 3px)) scale(.96) rotate(-1deg)}77%,100%{opacity:1;transform:translateY(var(--loot-lift)) scale(1) rotate(0)}}
@keyframes chest-glint{0%,66%{transform:translateX(-70%)}88%,100%{transform:translateX(70%)}}
@media(max-width:740px){
 .chest-opening-scene{width:220px;height:160px;--chest-size:122px;--loot-lift:-14px}
 .chest-opening-art{top:65%}
 .chest-loot-reveal{top:6%;gap:3px}
 .loot-jewel{width:62px;height:62px;border-radius:11px}
 .loot-jewel>.pixel-icon{width:54px;height:54px}
 .chest-loot-reveal>b{font-size:13px;letter-spacing:1px;padding:2px 8px}
 .chest-loot-reveal>small{font-size:9px}
 .chest-loot-reveal>em{font-size:8px;padding:2px 5px}
}
.still-reveal{animation:none;background:#f9f4e6}
.still-reveal .chest-opening-art,.still-reveal .chest-charge,.still-reveal .chest-ground-shadow,.still-reveal .chest-rays,.still-reveal .chest-burst-ring,.still-reveal .chest-sparks,.still-reveal .loot-glint{display:none}
.still-reveal .chest-loot-reveal{animation:none;opacity:1;top:50%;transform:translateY(-50%)}
@media(prefers-reduced-motion:reduce){.chest-opening-layer,.chest-opening-layer *{animation:none!important}.chest-opening-art,.chest-charge,.chest-ground-shadow,.chest-rays,.chest-burst-ring,.chest-sparks,.loot-glint{display:none}.chest-loot-reveal{opacity:1;top:50%;transform:translateY(-50%)}}
