.chests-card{margin-top:16px}
.chest-preview{height:calc(200px * var(--scene-scale));border-radius:18px;background:radial-gradient(ellipse at 50% 78%,#f0cbe073,#f4e1ed00 68%)}
.chest-preview>img{position:absolute;left:50%;bottom:calc(-25px * var(--scene-scale));width:calc(328px * var(--scene-scale));max-width:100%;height:auto;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 6px 8px #9d5b8420)}
#chests-view{display:none;flex-direction:column;min-height:0;gap:clamp(5px,calc(8px * var(--scene-scale)),8px);padding:clamp(12px,calc(22px * var(--scene-scale)),22px) clamp(14px,calc(22px * var(--scene-scale)),22px) clamp(14px,calc(20px * var(--scene-scale)),20px);overflow:hidden}
#chests-view.active{display:flex}
#chests-view>h1{flex:none;margin:0;font-size:clamp(22px,calc(27px * var(--scene-scale)),27px);line-height:1.05}
.chest-prizes-label{flex:none;display:flex;align-items:center;justify-content:center;gap:7px;margin:0;color:#9b6b82;font-size:11px;line-height:14px}
.chest-brands{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:10px;line-height:1;font-weight:750;letter-spacing:-.2px}
.chest-brand-wb{color:#a32987}.chest-brand-ozon{color:#496ac3}
.chest-prizes{flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.chest-prize{height:clamp(44px,calc(58px * var(--scene-scale)),58px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:11px;color:#95647f}
.chest-prize>img{width:42px;height:30px;object-fit:contain}
.chest-certificate{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;isolation:isolate;overflow:hidden;border:1.5px solid #cda368;border-radius:11px;background:linear-gradient(145deg,#fff0f6 0%,#f6d1e0 30%,#e9a9c7 65%,#d894b7 100%);box-shadow:inset 0 1px 0 #fffaf1,inset 0 -2px 4px #ad668b16,0 4px 8px #b3758c1b;color:#8d4663;letter-spacing:-.3px;font-variant-numeric:tabular-nums}
.chest-certificate:before{content:"";position:absolute;inset:4px;border:1px solid #ffe3ad99;border-radius:7px;pointer-events:none}
.chest-certificate:after{content:"";position:absolute;right:7px;top:5px;width:7px;height:7px;background:#d6a764;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);opacity:.65}
.chest-certificate b{position:relative;z-index:1;font-weight:760;text-shadow:0 1px 0 #fff7}
.chest-certificate .chest-brands{position:relative;z-index:1;font-size:clamp(9px,5cqw,12px)}
.chest-certificate-mini{width:100%;height:clamp(32px,calc(43px * var(--scene-scale)),43px);font-size:clamp(13px,calc(16px * var(--scene-scale)),16px)}
.chests-prompt{flex:none;min-height:18px;margin:0;text-align:center;font-size:14px;line-height:18px;font-weight:600;color:#9b5b80}
.chests-choice{flex:none;display:flex;align-items:center;justify-content:center;gap:9px;min-height:22px}
.chests-cost{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:22px;font-size:14px;line-height:18px;font-weight:700;white-space:nowrap;color:#9b5b80;font-variant-numeric:tabular-nums}
.chests-cost>img{display:block;width:22px;height:22px;object-fit:contain}
.chests-cost.is-referral-progress{font-variant-numeric:tabular-nums;letter-spacing:.2px;color:#382923}
.chests-play{font-size:14px;white-space:nowrap;padding-inline:12px}
.chest-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(44px,1fr));gap:clamp(6px,calc(10px * var(--scene-scale)),10px)}
.chest-box{position:relative;min-width:0;min-height:44px;padding:0;overflow:visible;container-type:size;border:0;border-radius:clamp(15px,calc(22px * var(--scene-scale)),22px);background:none;box-shadow:none;transition:opacity .24s ease;isolation:isolate}
.chest-box:not(:disabled):hover{background:none}
.chest-box:focus-visible{outline:3px solid #cc66a0;outline-offset:-4px}
.chest-art{position:absolute;left:50%;top:50%;width:min(100cqw,100cqh);aspect-ratio:1;transform:translate(-50%,-50%);pointer-events:none}
.chest-art>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;transform-origin:50% 84%;filter:drop-shadow(0 5px 6px #9f648419);user-select:none;-webkit-user-drag:none;will-change:transform,opacity}
.chest-closed{z-index:2;opacity:1;transform:translateY(0)}
.chest-open{z-index:3;opacity:0;transform:translateY(-3.43%)}
.chest-glow{position:absolute;left:16%;right:16%;top:43%;bottom:31%;z-index:4;border-radius:50%;background:radial-gradient(ellipse,#fff9dfed 0%,#ffe8b889 36%,#f8d6dd00 73%);opacity:0;transform:scale(.8);pointer-events:none}
.has-selection .chest-box:not(.is-selected){opacity:.38}
.chest-box.is-selected{z-index:2;background:none}
.chest-box:not(:disabled) .chest-art{animation:chest-idle 5.6s ease-in-out var(--idle-delay) infinite alternate}
.chest-box.is-selected .chest-art{transform:translate(-50%,-50%) scale(1.055)}
.chest-box.is-preparing .chest-art{animation:chest-select .28s cubic-bezier(.22,.75,.25,1) both}
.chest-box.is-opening .chest-closed{animation:chest-hide .55s ease-in-out both}
.chest-box.is-opening .chest-open{animation:chest-reveal .55s cubic-bezier(.2,.65,.3,1) both}
.chest-box.is-opening .chest-glow{animation:chest-bloom .55s ease-out both}
.chest-box.is-magic .chest-closed,.chest-box.is-open .chest-closed{opacity:0}
.chest-box.is-magic .chest-open,.chest-box.is-open .chest-open{opacity:1}
.chest-box.is-magic .chest-glow{animation:chest-magic .42s ease-out both}
.chest-box.is-open .chest-glow{opacity:.35;transform:scale(1)}
.chest-box.is-resetting .chest-closed{animation:chest-reset-closed .25s ease-in-out both}
.chest-box.is-resetting .chest-open{animation:chest-reset-open .25s ease-in-out both}
.chest-sparks{position:absolute;inset:0;z-index:5;pointer-events:none}
.chest-spark{position:absolute;left:var(--spark-x);top:62%;width:6px;height:8px;background:linear-gradient(130deg,#fff7df,#efc087);clip-path:polygon(50% 0,62% 36%,100% 50%,62% 63%,50% 100%,38% 63%,0 50%,38% 36%);opacity:0}
.chest-spark:nth-child(even){width:3px;height:3px;clip-path:none;border-radius:50%;box-shadow:0 0 5px #ffe9be99}
.chest-box.is-fresh.is-magic .chest-spark,.chest-box.is-fresh.is-open .chest-spark{animation:chest-spark .9s ease-out var(--spark-delay) both}
.chest-result{position:absolute;left:50%;top:34%;z-index:5;width:min(84cqw,154px);height:min(43cqh,70px);font-size:clamp(17px,10cqw,24px);transform:translateX(-50%) rotate(-3deg);animation:chest-ticket-in .38s cubic-bezier(.2,.7,.25,1) both}
.chest-empty-result{top:18%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:min(80cqw,140px);height:auto;transform:translateX(-50%);animation-name:chest-empty-in}
.chest-empty-result>img{display:block;width:80%;height:clamp(28px,25cqh,52px);object-fit:contain}
.chest-empty-result>b{color:#95647f;font-size:clamp(12px,7cqw,16px);font-weight:600;line-height:1.2}
.chest-utility-result{top:18%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:min(84cqw,150px);height:auto;transform:translateX(-50%);animation-name:chest-empty-in}
.chest-utility-result>img{display:block;width:clamp(32px,35cqw,64px);height:clamp(32px,31cqh,64px);object-fit:contain}
.chest-utility-result>b{color:#382923;font-size:clamp(12px,7cqw,17px);font-weight:650;line-height:1.2;white-space:nowrap}
.chest-prize>span:not(.chest-certificate):not(.chest-brands){white-space:nowrap;font-size:clamp(9px,2.8vw,11px)}
.chest-prize>.chest-brands{font-size:9px;gap:3px}
#chests-view[data-result="empty"] .chests-prompt{visibility:hidden}
#chests-again{flex:none;align-self:center;width:min(100%,max(210px,calc(300px * var(--scene-scale))));min-height:44px;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .2s}
.chests-footer{flex:none;display:grid;place-items:center;min-height:44px;width:100%}
.chests-footer>.spin-button{grid-area:1/1;width:min(100%,max(210px,calc(300px * var(--scene-scale))));min-height:44px}
.chest-box.is-restored .chest-result{animation:none}
.has-result #chests-again{visibility:visible;opacity:1;pointer-events:auto}
.paused .chest-art,.paused .chest-box img,.paused .chest-glow,.paused .chest-spark,.paused .chest-result,#chests-view:not(.active) .chest-art,#chests-view:not(.active) .chest-box img,#chests-view:not(.active) .chest-glow,#chests-view:not(.active) .chest-spark,#chests-view:not(.active) .chest-result{animation-play-state:paused!important}
@keyframes chest-idle{from{transform:translate(-50%,-50%) rotate(-.7deg)}to{transform:translate(-50%,calc(-50% - 2px)) rotate(.7deg)}}
@keyframes chest-select{0%{transform:translate(-50%,-50%) scale(1)}58%{transform:translate(-50%,-50%) scale(1.085)}82%{transform:translate(-50%,-50%) scale(1.045)}100%{transform:translate(-50%,-50%) scale(1.055)}}
@keyframes chest-hide{0%{opacity:1}78%,100%{opacity:0}}
@keyframes chest-reveal{0%{opacity:0;transform:translateY(calc(-3.43% + 3px)) scale(.995)}100%{opacity:1;transform:translateY(-3.43%) scale(1)}}
@keyframes chest-bloom{0%{opacity:0;transform:scale(.8)}65%{opacity:.65}100%{opacity:.35;transform:scale(1)}}
@keyframes chest-magic{0%{opacity:.35;transform:scale(1)}45%{opacity:.85;transform:scale(1.06)}100%{opacity:.35;transform:scale(1)}}
@keyframes chest-reset-closed{from{opacity:0}to{opacity:1}}
@keyframes chest-reset-open{from{opacity:1}to{opacity:0}}
@keyframes chest-spark{0%{opacity:0;transform:translate3d(0,0,0) rotate(0) scale(.5)}18%{opacity:.8}100%{opacity:0;transform:translate3d(calc(var(--spark-drift) * var(--scene-scale)),calc(var(--spark-rise) * var(--scene-scale)),0) rotate(var(--spark-turn)) scale(.85)}}
@keyframes chest-ticket-in{from{opacity:0;transform:translate(-50%,8px) rotate(-3deg) scale(.96)}to{opacity:1;transform:translate(-50%,0) rotate(-3deg) scale(1)}}
@keyframes chest-empty-in{from{opacity:0;transform:translate(-50%,12px) scale(.9)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@media(prefers-reduced-motion:reduce){.chest-art{animation:none!important}.chest-box img,.chest-glow,.chest-spark,.chest-result{animation-duration:1ms!important;animation-delay:0s!important}.chest-spark{display:none}.chest-box,#chests-again{transition:none}}
