.ceremony[hidden],.ceremony [hidden]{display:none!important}
.ceremony{--reward-color:#e4c786;position:fixed;inset:0;z-index:10050;display:flex;align-items:flex-start;justify-content:center;padding:24px;background:radial-gradient(ellipse at 50% 40%,#183f47ed,#030b11f5 72%);backdrop-filter:blur(12px);overflow:auto;touch-action:manipulation;color:#f7eed9}
.ceremony-panel{margin:auto 0;flex-shrink:0;position:relative;width:min(620px,100%);text-align:center;padding:34px 34px 26px;border:1px solid #c7ad664a;background:linear-gradient(145deg,#172d32de,#071419f2);box-shadow:0 20px 100px #0009,inset 0 0 70px #c1ae7110;border-radius:6px;overflow:hidden;animation:ceremony-enter .45s ease-out}
.ceremony-panel:before,.ceremony-panel:after{content:"";position:absolute;width:48px;height:48px;border:2px solid #d1b56c;opacity:.55;pointer-events:none}.ceremony-panel:before{left:10px;top:10px;border-right:0;border-bottom:0}.ceremony-panel:after{right:10px;bottom:10px;border-left:0;border-top:0}
.ceremony-kicker{margin:0 0 10px;color:#c6ba98;font-size:12px;letter-spacing:.2em}.ceremony h2{margin:0;font-family:"STKaiti","KaiTi","Songti SC","Noto Serif CJK SC",serif;font-size:clamp(34px,6vw,54px);font-weight:800;line-height:1.2;letter-spacing:.14em;color:#f0dcaa;text-shadow:0 2px 0 #4a321e,0 0 30px #dba7542b}.ceremony-sub{font-size:13px;color:#abb9b3;margin:13px 0 2px;line-height:1.6}
.ceremony-stage{position:relative;height:188px;display:grid;place-items:center;isolation:isolate}.ceremony-halo{position:absolute;width:160px;height:160px;top:14px;left:calc(50% - 80px);border:1px solid #c9b77d40;border-radius:50%;box-shadow:0 0 0 13px #ba9a5509,0 0 0 14px #bcab6d25,0 0 65px #d4ad6d15}.ceremony-halo:before,.ceremony-halo:after{content:"";position:absolute;inset:14px;border:1px solid #cbb77c44;transform:rotate(45deg)}.ceremony-halo:after{transform:rotate(0deg);inset:30px}
.ceremony-seal{font-family:"STKaiti","KaiTi",serif;font-size:84px;font-weight:800;line-height:1;color:#e5d097;text-shadow:0 0 28px #d4a14544;transform:rotate(-6deg)}
.ceremony-money{display:flex;flex-direction:column;align-items:center;margin:-7px 0 20px}.ceremony-amount{font-variant-numeric:tabular-nums;font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:clamp(52px,11vw,86px);letter-spacing:-.035em;line-height:1.1;color:#f2dca4;text-shadow:0 0 42px #e3b34730}.ceremony-unit{margin-top:9px;letter-spacing:.15em;font-size:12px;color:#bbb79e}
.ceremony-extra{color:#a8bbb7;font-size:12px}.ceremony-extra p{margin:10px 0}.ceremony-extra small{display:block;margin-top:8px;font-size:11px;color:#98aaa6}.ceremony-box-reward{display:flex;align-items:center;justify-content:center;gap:16px;border:1px solid #c4a86766;border-radius:3px;background:linear-gradient(90deg,#bf924308,#bf92431c,#bf924308);padding:13px;max-width:320px;margin:auto;color:#f0d99f}.ceremony-box-reward b{border:1px solid #c4a867;transform:rotate(-5deg);padding:3px 6px;font:21px "STKaiti",serif}.ceremony-box-reward span{letter-spacing:.14em}.ceremony-box-reward strong{font:700 27px Georgia,serif}
.ceremony-status{min-height:18px;color:#91aaa4;font-size:12px;margin:18px 0}.ceremony-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.ceremony button{font-size:14px;min-height:46px;padding:11px 25px;border-radius:3px;cursor:pointer;touch-action:manipulation;letter-spacing:.08em}.ceremony-primary{border:1px solid #e3c888;background:linear-gradient(#f1d89b,#bea46a);color:#263329;font-weight:800;box-shadow:0 3px 16px #0004}.ceremony-secondary{border:1px solid #a6b5a74a;background:#12272ccc;color:#c2c7b7}.ceremony button:disabled{opacity:.6;cursor:default}.ceremony button:focus-visible{outline:2px solid #fff5cc;outline-offset:4px}
.ceremony[data-mode="draw"] .ceremony-stage{height:235px;margin-top:7px}.ceremony[data-mode="draw"] .ceremony-halo{width:210px;height:210px;left:calc(50% - 105px);top:12px;animation:ceremony-orbit 22s linear infinite}.ceremony[data-mode="draw"] .ceremony-stage:before{content:"";position:absolute;inset:10px 0;z-index:-1;background:radial-gradient(ellipse at center,var(--reward-color),transparent 62%);opacity:calc(.05 + var(--draw-progress,0)*.18);filter:blur(20px)}
.ceremony-chest{position:relative;width:138px;height:96px;transform:perspective(600px) rotateX(-7deg) rotateY(-12deg);filter:drop-shadow(0 16px 12px #0009);animation:ceremony-float 3s ease-in-out infinite}.chest-body{position:absolute;inset:30px 0 0;background:linear-gradient(125deg,#41665e,#173932 50%,#0c2527);border:3px solid #d4b778;border-radius:3px 3px 8px 8px;box-shadow:inset 0 0 0 6px #102a2a,inset 0 0 0 8px #9b875f}.chest-body:before,.chest-body:after{content:"";position:absolute;width:10px;inset:-2px auto -2px 18px;background:linear-gradient(90deg,#997847,#edce8b,#8c7045);border:1px solid #b99b5c}.chest-body:after{left:auto;right:18px}.chest-lid{position:absolute;left:-4px;right:-4px;top:3px;height:38px;background:linear-gradient(#55766b,#294c42 65%,#122d2d);border:3px solid #dec184;border-radius:14px 14px 2px 2px;z-index:1;box-shadow:0 7px 7px #0008,inset 0 7px 0 #ccd9b821}.chest-lock{position:absolute;left:56px;top:29px;width:25px;height:33px;border:2px solid #f3d69c;background:#a1864e;z-index:2;transform:rotate(45deg);box-shadow:0 0 20px #efc77544}.chest-lock:after{content:"";position:absolute;inset:7px;border:1px solid #ffe5b0;background:#16292a}
.ceremony-portrait{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 20px var(--reward-color));animation:ceremony-reveal .6s cubic-bezier(.16,.8,.2,1)}
.ceremony-rarity{color:var(--reward-color);font-size:12px;letter-spacing:.22em;margin:2px 0 8px}.ceremony-drop{font-family:"Songti SC","Noto Serif CJK SC",serif;font-size:30px;line-height:1.3;color:#fff4df;margin:0 0 10px;letter-spacing:.12em}.ceremony-note{font-size:13px;line-height:1.7;color:#c1c9be;margin:0 auto;max-width:380px}.ceremony-reward{animation:ceremony-enter .5s ease-out}.ceremony-track{height:2px;background:#bfad7425;width:65%;margin:19px auto 0;overflow:hidden}.ceremony-track i{display:block;height:100%;background:linear-gradient(90deg,#758a72,#f0da9b);transform-origin:left;transform:scaleX(0)}
.ceremony[data-phase="revealed"] .ceremony-halo{border-color:var(--reward-color);box-shadow:0 0 0 13px #ba9a5509,0 0 0 14px #bcab6d25,0 0 60px #d4ad6d28}.ceremony[data-tier="5"] .ceremony-halo{background:conic-gradient(from 0deg,#d7bcfd22,#affff622,#fff0a022,#ffbbca22,#d7bcfd22)}
body.ceremony-open{overflow:hidden}body.ceremony-open #touch{visibility:hidden}
@keyframes ceremony-enter{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}@keyframes ceremony-float{50%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) translateY(-9px)}}@keyframes ceremony-orbit{to{transform:rotate(360deg)}}@keyframes ceremony-reveal{from{opacity:0;transform:scale(.7) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}
@media(max-width:540px){.ceremony{padding:12px}.ceremony-panel{padding:27px 17px 20px}.ceremony-stage{height:158px}.ceremony-halo{transform:scale(.85);top:0}.ceremony h2{font-size:34px}.ceremony[data-mode="draw"] h2{font-size:28px}.ceremony[data-mode="draw"] .ceremony-stage{height:205px}.ceremony[data-mode="draw"] .ceremony-halo{width:180px;height:180px;left:calc(50% - 90px)}.ceremony-drop{font-size:27px}.ceremony-status{margin:14px 0}.ceremony button{padding:11px 17px}.ceremony-money{margin-bottom:16px}}
@media(max-height:650px) and (min-width:541px){.ceremony-panel{padding:18px 26px;max-width:590px}.ceremony-stage{height:120px}.ceremony-halo{width:108px;height:108px;left:calc(50% - 54px);top:6px}.ceremony-seal{font-size:58px}.ceremony-amount{font-size:62px}.ceremony[data-mode="draw"] .ceremony-stage{height:155px}.ceremony[data-mode="draw"] .ceremony-halo{width:138px;height:138px;left:calc(50% - 69px)}.ceremony h2{font-size:32px}.ceremony-chest{scale:.8}.ceremony-drop{font-size:25px}.ceremony-status{margin:10px 0}}
@media(prefers-reduced-motion:reduce){.ceremony *{animation:none!important;transition:none!important}.ceremony-portrait{filter:none}}

.chest-lid{transform-origin:50% 0;transition:transform .7s ease-out}.ceremony[data-phase="opening"] .chest-lid{transform:translateY(-21px) rotateX(60deg)}.ceremony[data-phase="opening"] .chest-lock{opacity:0;transition:opacity .3s}.ceremony[data-phase="opening"] .ceremony-chest{filter:drop-shadow(0 0 26px #f4d38b88)}
@media(max-height:720px) and (max-width:540px){.ceremony-panel{padding:20px 15px}.ceremony h2{font-size:31px}.ceremony-stage{height:120px}.ceremony-halo{top:-16px;scale:.78}.ceremony-seal{font-size:65px}.ceremony[data-mode="draw"] .ceremony-stage{height:165px}.ceremony[data-mode="draw"] .ceremony-halo{top:-6px}.ceremony-amount{font-size:62px}.ceremony-money{margin-bottom:10px}.ceremony-sub{margin-top:8px}.ceremony-status{margin:10px 0}}

/* The chest itself is the tap target. Tier determines taps; no extra instructional paragraphs. */
.ceremony button.ceremony-chest{display:block;width:138px;height:112px;min-height:112px;padding:0;border:0;border-radius:12px;background:transparent;box-shadow:none;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;opacity:1}
.ceremony button.ceremony-chest:disabled{cursor:default;opacity:1}
.ceremony button.ceremony-chest:focus-visible{outline:3px solid var(--reward-color);outline-offset:18px}
.ceremony-chest>*{pointer-events:none}.ceremony-chest .chest-body{bottom:16px}
.ceremony[data-mode="draw"] .ceremony-halo{border-color:var(--reward-color);box-shadow:0 0 0 12px #bfcbaa09,0 0 50px color-mix(in srgb,var(--reward-color) 30%,transparent);transition:border-color .2s,box-shadow .2s}
.ceremony[data-hit="odd"] .ceremony-chest{animation:ceremony-knock-a .3s ease-out}
.ceremony[data-hit="even"] .ceremony-chest{animation:ceremony-knock-b .3s ease-out}
.ceremony .chest-lock:before{content:"";position:absolute;inset:0;z-index:3;background:#f9fcff;clip-path:polygon(47% 0,70% 0,40% 38%,73% 47%,27% 100%,37% 58%,10% 48%);opacity:var(--tap-progress,0);filter:drop-shadow(0 0 4px var(--reward-color))}
.ceremony-taps{display:flex;justify-content:center;align-items:center;gap:10px;min-height:20px;margin:0 auto 8px}
.ceremony-taps i{display:block;width:12px;height:12px;border:1px solid var(--reward-color);border-radius:50%;background:#0d2329;transition:background .15s,box-shadow .15s,transform .15s}
.ceremony-taps i[data-filled="true"]{background:var(--reward-color);box-shadow:0 0 12px var(--reward-color);transform:scale(1.13)}
.ceremony[data-mode="draw"] .ceremony-status{font-size:15px;color:#e2e8dc;letter-spacing:.12em}
.ceremony[data-mode="draw"] .ceremony-track{margin-top:10px}
.ceremony[data-phase="opening"] .ceremony-chest{animation:ceremony-unseal .8s ease-out both;filter:drop-shadow(0 0 25px var(--reward-color))}
@keyframes ceremony-knock-a{0%,100%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg)}30%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(.88) rotate(-5deg)}65%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(1.06) rotate(4deg)}}
@keyframes ceremony-knock-b{0%,100%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg)}30%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(.88) rotate(5deg)}65%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(1.06) rotate(-4deg)}}
@keyframes ceremony-unseal{0%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg)}70%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(1.12)}100%{transform:perspective(600px) rotateX(-7deg) rotateY(-12deg) scale(1.03)}}
@media(prefers-reduced-motion:reduce){.ceremony-taps i,.ceremony[data-mode="draw"] .ceremony-halo{transition:none}}
.ceremony[data-phase="charging"] .ceremony-chest{animation:chest-invite 1.7s ease-in-out infinite}
.ceremony[data-phase="charging"][data-hit="odd"] .ceremony-chest{animation:ceremony-knock-a .3s ease-out,chest-invite 1.7s .3s ease-in-out infinite}
.ceremony[data-phase="charging"][data-hit="even"] .ceremony-chest{animation:ceremony-knock-b .3s ease-out,chest-invite 1.7s .3s ease-in-out infinite}
.ceremony[data-phase="opening"] .ceremony-chest{animation:ceremony-unseal 2s ease-out both;opacity:1}
.ceremony[data-phase="opening"][data-tier="4"] .ceremony-chest{animation:chest-crimson 2s ease-in-out both;filter:drop-shadow(0 0 30px #ff365e)}
.ceremony[data-phase="opening"][data-tier="5"] .ceremony-chest{animation:chest-prism 2s ease-in-out both;filter:drop-shadow(0 0 36px #d9a5ff)}
.ceremony[data-phase="opening"][data-tier="4"] .ceremony-halo{background:radial-gradient(circle,#ffbb9c88,#fb285d44,transparent 70%);border-color:#ff6587;box-shadow:0 0 65px #fa235b88;animation:ceremony-orbit 2s linear infinite}
.ceremony[data-phase="opening"][data-tier="5"] .ceremony-halo{background:conic-gradient(#ff87cb88,#a88bff88,#76f5ff88,#f9ec9488,#ff87cb88);box-shadow:0 0 60px #ac9cff88;animation:ceremony-orbit 1s linear infinite}
@keyframes chest-invite{0%,65%,100%{transform:translateY(0) rotate(0)}72%{transform:translateY(-5px) rotate(-5deg)}80%{transform:translateY(-5px) rotate(5deg)}88%{transform:translateY(-3px) rotate(-3deg)}}
@keyframes chest-crimson{0%{transform:scale(1)}20%{transform:translateY(-8px) rotate(-12deg)}35%{transform:translateY(-8px) rotate(12deg)}50%{transform:rotate(-15deg) scale(1.1)}65%{transform:rotate(15deg) scale(1.14)}85%,100%{transform:translateY(-12px) scale(1.2)}}
@keyframes chest-prism{0%{transform:rotateY(0) scale(1)}70%{transform:translateY(-18px) rotateY(720deg) rotate(-8deg) scale(1.16)}85%{transform:translateY(-12px) rotateY(720deg) rotate(8deg) scale(1.22)}100%{transform:translateY(-10px) rotateY(720deg) scale(1.2)}}
@media(prefers-reduced-motion:reduce){.ceremony .ceremony-chest,.ceremony .ceremony-halo{animation:none!important}.ceremony[data-phase="opening"] .ceremony-chest{box-shadow:0 0 35px var(--reward-color)}}
