/* ---------- Booster pack ---------- */
.pack-stage { position: relative; height: 560px; display: grid; place-items: center; }
.pack { position: relative; width: 320px; aspect-ratio: 370 / 494; cursor: pointer; z-index: 2; filter: drop-shadow(0 40px 50px rgba(0,0,0,.7)); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.pack:hover { transform: translateY(-8px); }
.pack-top, .pack-body { position: absolute; left: 0; right: 0; background-repeat: no-repeat; overflow: hidden; }
.pack-top { top: 0; height: 13%; background-size: 100% 769%; background-position: 0 0; z-index: 2;
  clip-path: polygon(0 0,100% 0,100% 82%,96% 100%,92% 82%,88% 100%,84% 82%,80% 100%,76% 82%,72% 100%,68% 82%,64% 100%,60% 82%,56% 100%,52% 82%,48% 100%,44% 82%,40% 100%,36% 82%,32% 100%,28% 82%,24% 100%,20% 82%,16% 100%,12% 82%,8% 100%,4% 82%,0 100%); }
.pack-body { top: 11%; bottom: 0; background-size: 100% 112.36%; background-position: 0 100%; }
.pack-foil { position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 45%, rgba(255,255,255,.18) 50%, transparent 55%); animation: foil 6s ease-in-out infinite; }
@keyframes foil { 0% { transform: translateX(-60%); } 50%, 100% { transform: translateX(60%); } }
.pack-glow { position: absolute; width: min(420px, 100vw); height: min(420px, 100vw); border-radius: 50%; background: radial-gradient(circle, rgba(111,76,177,.16), transparent 65%); }
.pack.charging { animation: pack-shake .09s linear infinite; }
@keyframes pack-shake { 0% { transform: translate(1px,-1px) rotate(-.6deg); } 50% { transform: translate(-1px,1px) rotate(.6deg); } 100% { transform: translate(1px,0) rotate(-.3deg); } }
.pack.torn .pack-top { animation: tear .6s cubic-bezier(.3,1.3,.5,1) forwards; }
@keyframes tear { to { transform: translate(70px,-220px) rotate(30deg); opacity: 0; } }
.pack.torn .pack-body { animation: pack-out .5s .2s ease-in forwards; }
@keyframes pack-out { to { transform: translateY(220px); opacity: 0; } }
.packs-counter { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; border: 1px solid var(--gold); color: var(--gold); flex-shrink: 0; }

/* ---------- Wallet ---------- */
.wallet-card { border-color: var(--line-2); }
.wallet-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; color: var(--gold); border: 1px solid rgba(111,76,177,.4); }
.cro-balance { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1; }
.cro-balance small { font-family: var(--sans); font-size: .75rem; color: var(--muted); letter-spacing: .1em; }
.cro-balance.bump { animation: bump .6s; }
@keyframes bump { 30% { color: var(--gold-2); } }
.net-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-green); vertical-align: middle; margin-left: 4px; }
.tx-list { display: flex; flex-direction: column; }
.tx-row { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.tx-row:last-child { border-bottom: 0; }
.tx-type { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); min-width: 92px; }
.tx-type.in { color: var(--c-green); }

/* ---------- Transaction modal ---------- */
.tx-modal { position: fixed; inset: 0; z-index: 2500; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in .2s; }
.tx-modal[hidden] { display: none; }
.tx-box { width: 360px; max-width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 1.5rem; box-shadow: 0 30px 80px rgba(0,0,0,.7); animation: rise .3s ease-out; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.tx-head { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: 1.1rem; }
.tx-amount { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; }
.tx-amount small { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.tx-lines > div { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.tx-lines > div.fw-bold { color: var(--text); }
.tx-spinner { width: 54px; height: 54px; margin: .5rem auto 0; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
.tx-progress { height: 2px; border-radius: 999px; background: var(--line); overflow: hidden; }
.tx-progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.tx-progress.run span { animation: txprog 2.2s ease-in-out forwards; }
@keyframes txprog { to { width: 100%; } }
.tx-check { width: 60px; height: 60px; margin: .3rem auto 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; border: 1px solid var(--c-green); color: var(--c-green); animation: rise .4s ease-out; }

/* ---------- Opening overlay ---------- */
.opening { position: fixed; inset: 0; z-index: 2000; background: rgba(5,6,9,.97); display: flex; align-items: center; justify-content: center; overflow-y: auto; overflow-x: hidden; animation: fade-in .35s; }
@keyframes fade-in { from { opacity: 0; } }
.opening[hidden] { display: none; }
.opening-rays { position: absolute; left: 50%; top: 50%; width: 140vmax; height: 140vmax; transform: translate(-50%,-50%); pointer-events: none; opacity: 0; transition: opacity 1s;
  background: radial-gradient(circle, rgba(111,76,177,.12), transparent 55%); }
.opening.legendary .opening-rays { opacity: 1; }
.opening.mythic .opening-rays { opacity: 1; background: radial-gradient(circle, rgba(232,207,138,.22), transparent 60%); }
.opening-flash { position: fixed; inset: 0; background: #fff3d6; opacity: 0; pointer-events: none; z-index: 5; }
.opening-flash.go { animation: flash .8s ease-out; }
@keyframes flash { 0% { opacity: .7; } 100% { opacity: 0; } }
.opening-inner { position: relative; z-index: 2; width: min(1180px, 94vw); padding: 2rem 0; text-align: center; }
.reveal-grid { display: grid; grid-template-columns: repeat(5, 1fr); column-gap: 1.3rem; row-gap: 2.6rem; perspective: 1500px; margin-bottom: 1.6rem; }
@media (max-width: 768px) { .reveal-grid { grid-template-columns: repeat(3, 1fr); column-gap: .7rem; row-gap: 2rem; } .pack { width: 250px; } .pack-stage { height: 420px; } }
.flip-card { position: relative; aspect-ratio: 400 / 556; cursor: pointer; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); animation: deal .6s cubic-bezier(.2,.8,.2,1) backwards; }
@keyframes deal { from { opacity: 0; transform: translateY(40px); } }
.flip-card.flipped { transform: rotateY(180deg); cursor: default; }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 4.6% / 3.3%; overflow: hidden; }
.flip-back { background: #0d1150 center / cover no-repeat; box-shadow: 0 10px 30px rgba(0,0,0,.6); transition: transform .3s, box-shadow .3s; }
.flip-card:not(.flipped):hover .flip-back { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,.7), 0 0 0 1px var(--hint, var(--line-2)); }
.flip-card[data-rarity="Epic"]:not(.flipped) .flip-back { --hint: var(--c-epic); }
.flip-card[data-rarity="Legendary"]:not(.flipped) .flip-back { --hint: var(--c-legendary); box-shadow: 0 0 0 1px var(--c-legendary), 0 0 30px rgba(217,162,91,.35); }
.flip-card[data-rarity="Mythic"]:not(.flipped) .flip-back { --hint: var(--c-mythic); box-shadow: 0 0 0 1px var(--c-mythic), 0 0 40px rgba(232,207,138,.45); }
.flip-front { transform: rotateY(180deg); }
.flip-front .tcg-card { height: 100%; }
.flip-card.flipped[data-rarity="Legendary"] .flip-front { box-shadow: 0 0 0 1px var(--c-legendary), 0 0 40px rgba(217,162,91,.4); }
.flip-card.flipped[data-rarity="Mythic"] .flip-front { box-shadow: 0 0 0 1px var(--c-mythic), 0 0 60px rgba(232,207,138,.55); }
.new-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotateY(180deg); z-index: 4; background: var(--gold); color: #fefee2; font-weight: 700; font-size: .58rem; letter-spacing: .2em; padding: .15rem .55rem; border-radius: 999px; backface-visibility: hidden; }
.rarity-label { position: absolute; bottom: -24px; left: 0; right: 0; transform: rotateY(180deg); backface-visibility: hidden; font-weight: 600; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; }
.opening-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2.4rem; flex-wrap: wrap; }
.pack-summary { margin-top: 1rem; color: var(--muted); min-height: 1.5em; font-size: .9rem; }
.shake { animation: screen-shake .4s; }
@keyframes screen-shake { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
.legend-banner { position: fixed; left: 0; right: 0; top: 42%; z-index: 2100; text-align: center; pointer-events: none; font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: .2em;
  animation: banner 2.2s ease forwards; text-shadow: 0 10px 40px rgba(0,0,0,.8); }
@keyframes banner { 0% { opacity: 0; letter-spacing: .5em; } 20% { opacity: 1; letter-spacing: .2em; } 75% { opacity: 1; } 100% { opacity: 0; } }

.new-tag.first { background: linear-gradient(90deg, #b9a2f0, #f5d27a, #9b7be0); color: #120a2a; white-space: nowrap; }

/* UX helpers */
.buy-btn.needs-cro { filter: saturate(.6); }
.faucet-link.pulse { color: #f3dc8f; animation: faucet-pulse 1.6s ease-in-out infinite; }
@keyframes faucet-pulse { 50% { text-shadow: 0 0 12px rgba(249,231,161,.9); transform: scale(1.06); } }
.stage-hint { transition: color .3s; }

/* on-chain purchase progress */
.chain-progress { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; background: rgba(4,5,16,0); backdrop-filter: blur(0); transition: background .3s, backdrop-filter .3s; }
.chain-progress.in { background: rgba(4,5,16,.72); backdrop-filter: blur(4px); }
.chain-progress .cp-box { width: min(440px, 100%); padding: 26px 26px 22px; border-radius: 22px; text-align: left; transform: translateY(16px) scale(.97); opacity: 0; transition: transform .3s, opacity .3s;
  background: linear-gradient(180deg, #14123a, #0a0b24); border: 1px solid rgba(217,179,90,.35); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(111,76,177,.25); }
.chain-progress.in .cp-box { transform: none; opacity: 1; }
.cp-kicker { font-size: .7rem; font-weight: 900; letter-spacing: .28em; text-transform: uppercase; color: #e9cf8a; margin-bottom: 18px; text-align: center; }
.cp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cp-steps li { display: flex; gap: 14px; align-items: center; opacity: .45; transition: opacity .3s; }
.cp-steps li.active, .cp-steps li.done { opacity: 1; }
.cp-ico { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; color: #cfcbe0;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.cp-ico .cp-spin { position: absolute; inset: -3px; border-radius: 50%; border: 3px solid transparent; border-top-color: #f3dc8f; border-right-color: rgba(243,220,143,.4); opacity: 0; }
.cp-steps li.active .cp-ico { color: #f3dc8f; border-color: rgba(217,179,90,.5); }
.cp-steps li.active .cp-spin { opacity: 1; animation: cp-spin .9s linear infinite; }
.cp-ico .cp-ok { display: none; }
.cp-steps li.done .cp-ico { background: rgba(95,224,90,.15); border-color: rgba(95,224,90,.6); color: #5fe05a; }
.cp-steps li.done .cp-ico > .bi:first-child { display: none; }
.cp-steps li.done .cp-ok { display: block; }
.cp-txt b { display: block; color: #fff; font-size: .98rem; }
.cp-txt small { color: #a9a4c4; font-size: .78rem; }
.cp-msg { margin-top: 18px; min-height: 1.3em; text-align: center; font-size: .86rem; color: #f3dc8f; }
.chain-progress.failed .cp-msg { color: #ff8a8a; }
.cp-tx { display: block; margin-top: 8px; text-align: center; font-size: .78rem; color: #b9a6ff; text-decoration: none; }
.cp-tx:hover { color: #fff; }
.cp-close { display: block; margin: 14px auto 0; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cp-steps li.active .cp-spin { animation-duration: 2.4s; } }
.chain-progress .cp-count { margin-top: 10px; padding: 8px 12px; border-radius: 12px; text-align: center; font-size: .8rem; color: #ffd27a; background: rgba(242,181,46,.1); border: 1px solid rgba(242,181,46,.35); }
.chain-progress .cp-count b { font-size: 1rem; color: #fff; font-variant-numeric: tabular-nums; }
/* a pack paid but not opened yet */
.paid-banner { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2500; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(12,12,34,.95); border: 1px solid rgba(217,179,90,.55); box-shadow: 0 16px 40px rgba(0,0,0,.55); color: #e8e4f5; font-size: .88rem; }
.paid-banner > i { color: #f3dc8f; font-size: 1.3rem; }
.paid-banner b { color: #fff; }

/* ===== on-chain purchase progress: epic version (metal frame, floating pack, light rays, energy timeline) ===== */
.chain-progress.in { background: radial-gradient(ellipse at 50% 40%, rgba(40, 24, 80, .7), rgba(4, 5, 16, .9) 70%); backdrop-filter: blur(6px); }
.chain-progress { --p: .17; }
.chain-progress .cp-box { position: relative; overflow: hidden; width: min(470px, 100%); padding: 0 30px 24px; border-radius: 26px; text-align: left;
  background: linear-gradient(180deg, #17123f 0%, #0c0b26 55%, #080918 100%) padding-box,
    conic-gradient(from 210deg, #6b5320, #fff4c2 8%, #b3862c 18%, #3a2c10 30%, #e9bf55 45%, #6b5320 58%, #fff4c2 70%, #b3862c 82%, #3a2c10 92%, #6b5320) border-box;
  border: 2px solid transparent; box-shadow: 0 40px 100px rgba(0, 0, 0, .7), 0 0 80px rgba(233, 191, 85, .18), 0 0 140px rgba(111, 76, 177, .3); }
.cp-aura { position: absolute; inset: 0; pointer-events: none; }
.cp-rays { position: absolute; left: 50%; top: 92px; width: 760px; height: 760px; margin: -380px 0 0 -380px; opacity: .55;
  background: repeating-conic-gradient(rgba(233, 191, 85, .16) 0 4deg, transparent 4deg 16deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 62%); mask: radial-gradient(circle, #000 0, transparent 62%); animation: cp-rot 28s linear infinite; }
.cp-aura b { position: absolute; bottom: -8px; left: var(--x); width: 3px; height: 3px; border-radius: 50%; background: #f3dc8f; box-shadow: 0 0 8px #e9bf55;
  opacity: 0; animation: cp-dust var(--t) linear var(--d) infinite; }
.cp-hero { position: relative; height: 190px; display: grid; place-items: center; margin: 0 -30px 4px; }
.cp-halo { position: absolute; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 233, 160, .55), rgba(233, 191, 85, .18) 45%, transparent 70%);
  animation: cp-pulse 2.2s ease-in-out infinite; }
.cp-hero img { position: relative; height: 150px; margin-top: 22px; transform: rotate(-6deg); filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .7)) drop-shadow(0 0 22px rgba(233, 191, 85, .45));
  animation: cp-float 3.2s ease-in-out infinite; }
.chain-progress[data-step="reveal"] .cp-hero img { animation: cp-float 3.2s ease-in-out infinite, cp-shake .45s ease-in-out infinite; }
.chain-progress[data-step="reveal"] .cp-halo { animation-duration: .9s; }
.chain-progress .cp-kicker { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 4px; font-size: .68rem; letter-spacing: .32em; color: #e9cf8a; }
.cp-kicker span { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, #e9bf55); }
.cp-kicker span:last-child { transform: scaleX(-1); }
.cp-title { position: relative; margin: 0 0 16px; text-align: center; font-size: 1.7rem; font-weight: 900; color: #fff; letter-spacing: -.01em; text-shadow: 0 4px 20px rgba(0, 0, 0, .6); }
.cp-title em { font-style: normal; background: linear-gradient(180deg, #fff4c2, #e9bf55 60%, #b3862c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cp-bar { position: relative; height: 6px; border-radius: 6px; margin: 0 0 22px; background: rgba(255, 255, 255, .07); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.cp-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: inherit; transition: width .8s cubic-bezier(.2, .9, .3, 1);
  background: linear-gradient(90deg, #b3862c, #e9bf55, #fff4c2, #e9bf55, #b3862c); background-size: 200% 100%; animation: cp-shimmer 1.6s linear infinite; box-shadow: 0 0 12px rgba(233, 191, 85, .7); }
.chain-progress .cp-steps { position: relative; gap: 18px; }
.chain-progress .cp-steps::before { content: ""; position: absolute; left: 22px; top: 22px; bottom: 22px; width: 2px; background: rgba(255, 255, 255, .08); }
.chain-progress .cp-steps li { position: relative; opacity: .38; }
.chain-progress .cp-steps li.active { opacity: 1; }
.chain-progress .cp-steps li.done { opacity: .9; }
.chain-progress .cp-ico { width: 46px; height: 46px; font-size: 1.15rem; color: #cfcbe0; background: radial-gradient(circle at 35% 30%, #2b2560, #120f30); border: 1px solid rgba(255, 255, 255, .14); z-index: 1; }
.chain-progress .cp-steps li.active .cp-ico { color: #1d1405; border-color: transparent;
  background: radial-gradient(circle at 35% 28%, #fff9df, #f3dc8f 35%, #e9bf55 60%, #8a6a24); box-shadow: 0 0 0 4px rgba(233, 191, 85, .18), 0 0 26px rgba(233, 191, 85, .65); animation: cp-glow 1.4s ease-in-out infinite; }
.chain-progress .cp-ico .cp-spin { inset: -6px; border-width: 2px; border-top-color: #fff4c2; border-right-color: rgba(255, 244, 194, .25); }
.chain-progress .cp-steps li.done .cp-ico { color: #1d1405; border-color: transparent; background: radial-gradient(circle at 35% 28%, #d9ffd4, #7fe07a 45%, #3c9c38); box-shadow: 0 0 14px rgba(95, 224, 90, .45); }
.chain-progress .cp-txt b { font-size: 1.02rem; font-weight: 800; }
.chain-progress .cp-steps li.active .cp-txt b { background: linear-gradient(180deg, #fff, #f3dc8f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chain-progress .cp-txt small { font-size: .8rem; color: #b3aed0; }
.chain-progress .cp-msg { position: relative; margin-top: 20px; font-size: .9rem; font-weight: 600; letter-spacing: .02em; color: #f3dc8f; text-shadow: 0 0 14px rgba(233, 191, 85, .45); }
.chain-progress .cp-tx { position: relative; }
/* finished: flash and golden burst */
.chain-progress.ready .cp-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 22%, rgba(255, 246, 210, .9), transparent 60%); animation: cp-flash 1s ease-out forwards; }
.chain-progress.ready .cp-hero img { animation: cp-burst .9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.chain-progress.ready .cp-halo { animation: cp-pulse .5s ease-in-out infinite; transform: scale(1.4); }
/* failed: red frame, everything calms down */
.chain-progress.failed .cp-box { background: linear-gradient(180deg, #2a1028, #0c0b26 60%) padding-box, linear-gradient(180deg, #ff6b7d, #6b1f2a) border-box; }
.chain-progress.failed .cp-hero img, .chain-progress.failed .cp-halo, .chain-progress.failed .cp-rays, .chain-progress.failed .cp-bar i { animation: none; filter: grayscale(.8) brightness(.6); }
@keyframes cp-rot { to { transform: rotate(360deg); } }
@keyframes cp-dust { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-560px); opacity: 0; } }
@keyframes cp-pulse { 0%, 100% { transform: scale(.92); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes cp-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes cp-shake { 0%, 100% { rotate: 0deg; } 25% { rotate: -2.5deg; } 75% { rotate: 2.5deg; } }
@keyframes cp-shimmer { to { background-position: -200% 0; } }
@keyframes cp-glow { 0%, 100% { box-shadow: 0 0 0 4px rgba(233, 191, 85, .18), 0 0 20px rgba(233, 191, 85, .5); } 50% { box-shadow: 0 0 0 7px rgba(233, 191, 85, .1), 0 0 36px rgba(233, 191, 85, .85); } }
@keyframes cp-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cp-burst { 0% { transform: rotate(-6deg) scale(1); } 60% { transform: rotate(0deg) scale(1.22); filter: brightness(1.6) drop-shadow(0 0 40px #fff4c2); } 100% { transform: rotate(0deg) scale(1.15); filter: brightness(1.3) drop-shadow(0 0 30px #e9bf55); } }
@media (max-width: 480px) { .cp-hero { height: 140px; } .cp-hero img { height: 120px; } .cp-title { font-size: 1.4rem; } .chain-progress .cp-box { padding: 0 20px 20px; } }
@media (prefers-reduced-motion: reduce) { .cp-rays, .cp-aura b, .cp-halo, .cp-hero img, .cp-bar i, .chain-progress .cp-steps li.active .cp-ico { animation: none !important; } }

/* ===== the purchase as a summoning ritual: rune circle, pentagram, five candles, levitating pack ===== */
.chain-progress.ritual { --rc: #ff3b5c; --rg: #e9bf55; }
.chain-progress.ritual.in { background: radial-gradient(ellipse at 50% 38%, rgba(90, 10, 30, .55), rgba(8, 2, 10, .93) 65%); backdrop-filter: blur(6px); }
.ritual .cp-box { position: relative; overflow: hidden; width: min(480px, 100%); padding: 22px 28px 22px; border-radius: 26px; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #2a0d22 0%, #12081a 55%, #07050c 100%) padding-box,
    conic-gradient(from 200deg, #4a0f1c, #ff6b7d 10%, #6b1424 22%, #e9bf55 40%, #4a0f1c 55%, #ff6b7d 70%, #6b1424 82%, #e9bf55 92%, #4a0f1c) border-box;
  border: 2px solid transparent; box-shadow: 0 40px 110px rgba(0, 0, 0, .8), 0 0 90px rgba(255, 59, 92, .22); }
/* embers rising from the circle */
.rt-smoke { position: absolute; inset: 0; pointer-events: none; }
.rt-smoke b { position: absolute; bottom: -6px; left: var(--x); width: 3px; height: 3px; border-radius: 50%; background: #ffb38a; box-shadow: 0 0 8px #ff3b5c, 0 0 2px #fff;
  opacity: 0; animation: rt-ember var(--t) linear var(--d) infinite; }
/* the circle */
.rt-circle { position: relative; width: min(300px, 74vw); aspect-ratio: 1; margin: 0 auto 6px; }
.rt-circle::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 59, 92, .0), rgba(255, 59, 92, .0)); transition: background 1s; }
.rt-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rt-ring, .rt-star { fill: none; stroke: var(--rc); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px var(--rc)) drop-shadow(0 0 10px rgba(255, 59, 92, .6));
  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 2.2s cubic-bezier(.6, .1, .3, 1), stroke .8s; }
.rt-r1 { stroke-width: 2.4; } .rt-r2 { stroke-width: 1.2; opacity: .8; } .rt-r3 { stroke-width: 1.4; opacity: .7; }
.rt-star { stroke-width: 2; transition-duration: 2.8s; }
.rt-runes { transform-origin: 150px 150px; animation: rt-spin 40s linear infinite; }
.rt-runes text { font-size: 15px; letter-spacing: 3.2px; fill: var(--rc); opacity: 0; transition: opacity 1.5s; filter: drop-shadow(0 0 4px var(--rc)); }
.rt-candle { position: absolute; width: 14px; height: 22px; margin: -18px 0 0 -7px; border-radius: 3px 3px 2px 2px; background: linear-gradient(180deg, #e8dcc4, #9c8f78); box-shadow: 0 4px 8px rgba(0, 0, 0, .6); }
.rt-candle i { position: absolute; left: 50%; bottom: 100%; width: 10px; height: 16px; margin-left: -5px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 70%, #fff6c8, #ffb03b 45%, #ff3b1f 75%, transparent 80%); opacity: 0; transform: scale(.3); transform-origin: 50% 100%;
  transition: opacity .4s calc(var(--i) * .25s), transform .4s calc(var(--i) * .25s); filter: drop-shadow(0 0 8px #ffb03b); }
.rt-pack { position: absolute; left: 50%; top: 50%; height: 40%; transform: translate(-50%, -50%) rotate(-4deg); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .8)) brightness(.55) saturate(.6);
  transition: filter 1s; animation: rt-levitate 3.4s ease-in-out infinite; }
/* phase I: the offering, the outer circle is traced */
.ritual[data-step="wallet"] .rt-r1, .ritual[data-step="chain"] .rt-r1, .ritual[data-step="reveal"] .rt-r1, .ritual.ready .rt-r1 { stroke-dashoffset: 0; }
.ritual[data-step="wallet"] .rt-runes text { opacity: .35; }
/* phase II: the binding, the star is drawn and the candles light up */
.ritual[data-step="chain"] .rt-r2, .ritual[data-step="chain"] .rt-star, .ritual[data-step="reveal"] .rt-r2, .ritual[data-step="reveal"] .rt-star,
.ritual.ready .rt-r2, .ritual.ready .rt-star { stroke-dashoffset: 0; }
.ritual[data-step="chain"] .rt-runes text { opacity: .7; }
.ritual[data-step="chain"] .rt-candle i, .ritual[data-step="reveal"] .rt-candle i, .ritual.ready .rt-candle i { opacity: 1; transform: scale(1); animation: rt-flicker .18s ease-in-out infinite alternate; }
.ritual[data-step="chain"] .rt-pack { filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .8)) brightness(.8); }
/* phase III: the summoning, everything burns and spins, the pack trembles in the light */
.ritual[data-step="reveal"] .rt-r3, .ritual.ready .rt-r3 { stroke-dashoffset: 0; }
.ritual[data-step="reveal"] .rt-runes text, .ritual.ready .rt-runes text { opacity: 1; }
.ritual[data-step="reveal"] .rt-runes { animation-duration: 9s; }
.ritual[data-step="reveal"] .rt-svg { animation: rt-pulse 1.1s ease-in-out infinite; }
.ritual[data-step="reveal"] .rt-circle::before { background: radial-gradient(circle, rgba(255, 90, 110, .45), rgba(255, 59, 92, .08) 55%, transparent 70%); animation: rt-pulse 1.1s ease-in-out infinite; }
.ritual[data-step="reveal"] .rt-pack { filter: drop-shadow(0 0 26px rgba(255, 90, 110, .9)) brightness(1.1); animation: rt-levitate 3.4s ease-in-out infinite, rt-tremble .35s ease-in-out infinite; }
.ritual[data-step="reveal"] .rt-smoke b { animation-duration: calc(var(--t) * .55); }
/* done: the circle turns gold and the pack bursts with light */
.ritual.ready { --rc: var(--rg); }
.ritual.ready .rt-pack { filter: brightness(1.5) drop-shadow(0 0 40px #fff4c2); animation: rt-rise 1.1s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.ritual.ready .cp-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 32%, rgba(255, 246, 210, .95), transparent 60%); animation: cp-flash 1.1s ease-out forwards; }
/* broken circle */
.ritual.failed { --rc: #6b6b80; }
.ritual.failed .rt-runes, .ritual.failed .rt-svg, .ritual.failed .rt-pack, .ritual.failed .rt-smoke b { animation: none !important; }
.ritual.failed .rt-candle i { opacity: 0 !important; }
.ritual.failed .rt-pack { filter: grayscale(1) brightness(.4); }
/* texts */
.ritual .cp-kicker { color: #ff9aa9; margin: 4px 0 2px; }
.ritual .cp-kicker span { background: linear-gradient(90deg, transparent, #ff6b7d); }
.rt-phase { position: relative; min-height: 116px; }
.rt-num { display: block; font-size: .7rem; font-weight: 900; letter-spacing: .34em; text-transform: uppercase; color: #e9bf55; }
.ritual .cp-title { margin: 4px 0 6px; font-family: "Cinzel", Georgia, "Times New Roman", serif; font-size: 1.85rem; font-weight: 700; letter-spacing: .04em; color: #fff;
  text-shadow: 0 0 18px rgba(255, 59, 92, .55), 0 3px 12px rgba(0, 0, 0, .8); }
.ritual .cp-title em { font-style: normal; color: #f3dc8f; }
.rt-text { margin: 0 auto; max-width: 360px; color: #dccfd8; font-size: .95rem; line-height: 1.5; font-style: italic; }
.rt-pips { display: flex !important; justify-content: center; gap: 10px; margin: 14px 0 0 !important; }
.rt-pips::before { display: none !important; }
.rt-pips li { display: flex; align-items: center; gap: 7px; opacity: .4 !important; }
.rt-pips li.active, .rt-pips li.done { opacity: 1 !important; }
.rt-pips .cp-ico { width: 28px !important; height: 28px !important; font-size: .68rem !important; font-weight: 900; font-family: Georgia, serif; color: #ff9aa9 !important;
  background: rgba(255, 59, 92, .08) !important; border: 1px solid rgba(255, 59, 92, .45) !important; box-shadow: none !important; animation: none !important; }
.rt-pips li.active .cp-ico { color: #fff !important; background: radial-gradient(circle, #ff6b7d, #8a1428) !important; border-color: #ff9aa9 !important; box-shadow: 0 0 14px rgba(255, 59, 92, .8) !important; }
.rt-pips li.done .cp-ico { color: #1d1405 !important; background: radial-gradient(circle at 35% 30%, #fff4c2, #e9bf55 60%, #8a6a24) !important; border-color: transparent !important; }
.rt-pips .cp-txt b { font-size: .78rem !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #e6d9e0 !important; background: none !important; -webkit-text-fill-color: currentColor; }
.ritual .cp-msg { margin-top: 12px; color: #ffb3bf; text-shadow: 0 0 12px rgba(255, 59, 92, .5); font-size: .85rem; }
.ritual .cp-count { color: #ffd27a; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
@keyframes rt-pulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; filter: brightness(1.35); } }
@keyframes rt-levitate { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes rt-tremble { 0%, 100% { rotate: 0deg; } 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
@keyframes rt-rise { 0% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 100% { transform: translate(-50%, -62%) rotate(0deg) scale(1.35); } }
@keyframes rt-flicker { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.08, .94) rotate(3deg); } }
@keyframes rt-ember { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(18px, -620px); opacity: 0; } }
@media (max-width: 480px) { .ritual .cp-box { padding: 18px 18px; } .ritual .cp-title { font-size: 1.5rem; } .rt-pips .cp-txt { display: none; } }
@media (prefers-reduced-motion: reduce) { .rt-runes, .rt-svg, .rt-pack, .rt-smoke b, .rt-candle i, .rt-circle::before { animation: none !important; } .rt-ring, .rt-star { transition-duration: .01s; } }

/* ===== the summoning, full screen like a film: black bars, slow camera push, subtitles ===== */
.chain-progress.cinema { padding: 0; }
.chain-progress.cinema.in { background: #050208; backdrop-filter: none; }
.cinema .cp-box { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; padding: 12vh 20px 13vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #3a0c22 0%, #160614 45%, #050208 80%) !important; box-shadow: none; transform: none !important; opacity: 0; transition: opacity .9s; }
.cinema.in .cp-box { opacity: 1; }
/* black film bars that slide in */
.rt-bars i { position: absolute; left: 0; right: 0; height: 11vh; background: #000; z-index: 5; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1); box-shadow: 0 0 40px #000; }
.rt-bars i:first-child { top: 0; transform: translateY(-100%); }
.rt-bars i:last-child { bottom: 0; transform: translateY(100%); }
.cinema.in .rt-bars i { transform: none; }
.rt-timer { position: absolute; z-index: 6; right: 22px; top: calc(11vh - 30px); font: 600 .75rem/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: rgba(255, 180, 190, .55); }
.rt-timer::before { content: "● REC  "; color: #ff3b5c; animation: rt-rec 1.2s steps(2) infinite; }
/* fog drifting across the screen */
.cinema .rt-smoke::before, .cinema .rt-smoke::after { content: ""; position: absolute; inset: -20%; opacity: .5; pointer-events: none;
  background: radial-gradient(ellipse 40% 25% at 30% 60%, rgba(255, 80, 110, .12), transparent 70%), radial-gradient(ellipse 35% 22% at 70% 45%, rgba(150, 70, 255, .12), transparent 70%);
  animation: rt-fog 18s ease-in-out infinite alternate; }
.cinema .rt-smoke::after { animation-duration: 26s; animation-direction: alternate-reverse; transform: scaleX(-1); }
/* the circle: big, and the camera slowly pushes in, phase after phase */
.cinema .rt-circle { width: min(52vh, 86vw); margin: 0 auto 2vh; transform: scale(.94); transition: transform 6s cubic-bezier(.3, 0, .2, 1); }
.cinema[data-step="chain"] .rt-circle { transform: scale(1.02); }
.cinema[data-step="reveal"] .rt-circle { transform: scale(1.1); }
.cinema.ready .rt-circle { transform: scale(1.25); transition-duration: 1.4s; }
.cinema[data-step="reveal"] .cp-box { animation: rt-shake .5s ease-in-out infinite; }
.cinema .rt-pack { height: 42%; }
/* titles like a film card */
.cinema .cp-kicker { position: relative; z-index: 2; margin-top: 0; }
.cinema .rt-phase { position: relative; z-index: 2; min-height: 0; }
.cinema .rt-num { letter-spacing: .5em; }
.cinema .cp-title { font-size: clamp(2rem, 5vh, 3.2rem); letter-spacing: .08em; text-transform: uppercase; margin: 2px 0 4px;
  animation: rt-title 1.2s ease-out both; }
.cinema .rt-text { font-size: .92rem; opacity: .75; max-width: 480px; }
.cinema .rt-pips { position: relative; z-index: 2; margin-top: 1.6vh !important; }
/* subtitles, in the lower black bar */
.rt-narr { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; height: 11vh; display: grid; place-items: center; padding: 0 20px; pointer-events: none; }
.rt-narr span { max-width: 820px; text-align: center; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: clamp(1rem, 2.4vh, 1.35rem); color: #f3e6c8;
  text-shadow: 0 2px 10px #000; opacity: 0; transform: translateY(6px); transition: opacity .45s, transform .45s; }
.rt-narr span.on { opacity: 1; transform: none; }
.cinema .cp-msg { position: relative; z-index: 2; margin-top: 1vh; }
.cinema .cp-count, .cinema .cp-tx, .cinema .cp-close { position: relative; z-index: 6; }
.cinema .cp-tx { margin-top: 4px; }
/* the end: white flash, the circle burns gold */
.cinema.ready .cp-box::after { z-index: 4; }
@keyframes rt-rec { 50% { opacity: 0; } }
@keyframes rt-fog { from { transform: translate(-6%, 2%) scale(1); } to { transform: translate(6%, -3%) scale(1.15); } }
@keyframes rt-shake { 0%, 100% { translate: 0 0; } 25% { translate: .8px -.6px; } 50% { translate: -.7px .7px; } 75% { translate: .6px .5px; } }
@keyframes rt-title { from { opacity: 0; letter-spacing: .4em; filter: blur(6px); } to { opacity: 1; letter-spacing: .08em; filter: none; } }
@media (max-width: 575px) { .rt-bars i, .rt-narr { height: 9vh; } .cinema .cp-box { padding: 10vh 14px 11vh; } .rt-timer { top: calc(9vh - 24px); } }
@media (prefers-reduced-motion: reduce) { .cinema .rt-circle, .cinema .cp-box, .cinema .cp-title, .cinema .rt-smoke::before, .cinema .rt-smoke::after { animation: none !important; transition: none !important; } }
.cinema .rt-text { margin-bottom: 10px; }
.cinema .rt-pips { margin-top: 2.2vh !important; }
.ritual.failed .rt-pips { display: none !important; } /* broken circle: the title alone, no steps under it */
.ritual.failed .cp-title { margin-bottom: 10px; }
.v-keep { width: 100%; margin: 8px 0 0; text-align: center; font-size: .78rem; color: #cfcbe0; opacity: .85; } .v-keep i { color: #e9bf55; margin-right: 4px; }
