.portal-box-dialog{--glow:#ffd26f;width:min(720px,94vw);max-height:92vh; max-height:92dvh;box-sizing:border-box;overflow:auto;border:1px solid #c89d4855;border-radius:24px;background:radial-gradient(ellipse at 50% 42%,#332614,#100f19 65%);color:#fff;text-align:center;padding:28px 20px;box-shadow:0 0 90px #000a}
.portal-box-dialog::backdrop{background:#080813dd;backdrop-filter:blur(8px)}
.portal-box-dialog[data-grade=Ascended]{--glow:#cb9bff;background:radial-gradient(ellipse at 50% 42%,#352049,#100f19 65%)}
.portal-box-dialog h2{font-size:24px;letter-spacing:.05em;margin:8px}.portal-box-status{min-height:3em;line-height:1.5;color:#eee;margin:12px auto;max-width:32em}
.portal-box-stage{height:340px;position:relative;isolation:isolate;overflow:hidden}.portal-box-stage[hidden]{display:none}
.portal-box-light{position:absolute;left:50%;top:50%;width:40px;height:40px;border-radius:50%;transform:translate(-50%,-50%);background:var(--glow);box-shadow:0 0 55px 15px var(--glow);opacity:.4}
.portal-box-card{background:#191a2a;border:1px solid #ffffff25;border-radius:14px;padding:12px;box-sizing:border-box;display:flex;align-items:center;flex-direction:column;gap:10px;min-width:0;overflow-wrap:anywhere}
.portal-box-card img{width:100%;height:160px;object-fit:contain}.portal-box-card strong{font-size:15px}.portal-box-card.is-preview{position:absolute;left:calc(50% - 32px);top:calc(50% - 42px);width:64px;height:84px;padding:4px;opacity:0;box-shadow:0 0 18px #0008}.portal-box-card.is-preview img{height:100%}
.is-opening .is-preview{animation:portal-box-orbit 2.7s var(--delay) both}.is-opening .portal-box-light{animation:portal-box-flash 3.3s both}
.portal-box-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;max-width:620px;margin:auto}.portal-box-results:empty{display:none}
.is-revealed .portal-box-results{animation:portal-box-reveal .6s both}.is-granted .portal-box-card{border-color:var(--glow);box-shadow:0 0 22px var(--glow)}
@supports (color: color-mix(in srgb, red, blue)) {
.is-granted .portal-box-card{border-color:var(--glow);box-shadow:0 0 22px color-mix(in srgb,var(--glow) 20%,transparent)}
}
.portal-box-confirm{border:0;border-radius:10px;padding:12px 42px;margin-top:24px;font-weight:700;color:#17111f;background:var(--glow);cursor:pointer}.portal-box-confirm[hidden]{display:none}
@keyframes portal-box-orbit{0%{opacity:0;transform:scale(.25)}20%,52%{opacity:1;transform:translate(var(--x),var(--y)) rotate(var(--rot)) scale(1)}88%,100%{opacity:0;transform:translate(0,0) scale(.12)}}
@keyframes portal-box-flash{0%,40%{opacity:.3;transform:translate(-50%,-50%) scale(.8)}80%{opacity:1;transform:translate(-50%,-50%) scale(2.7)}92%{opacity:1;transform:translate(-50%,-50%) scale(8)}100%{opacity:0;transform:translate(-50%,-50%) scale(10)}}
@keyframes portal-box-reveal{from{opacity:0;transform:translateY(30px) scale(.85)}to{opacity:1;transform:none}}
@media(max-width:480px){.portal-box-dialog{padding:18px 12px}.portal-box-results{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-box-card img{height:125px}.portal-box-stage{height:330px}}
@media(prefers-reduced-motion:reduce){.is-opening .is-preview{animation:none;opacity:.6;transform:translate(var(--x),var(--y))}.is-opening .portal-box-light{animation:none}.is-revealed .portal-box-results{animation:none}}

/* License bundles arrive as one set: both cards share the same reveal frame. */
.portal-box-dialog[data-grade=CustomGameLicense]{--glow:#7effc4;border-color:#7effc466;background:radial-gradient(ellipse at 50% 42%,#143747,#070b18 70%)}
.portal-box-dialog[data-grade=CustomGameLicense] .portal-box-results{grid-template-columns:repeat(2,minmax(0,1fr))}
.portal-box-dialog[data-grade=CustomGameLicense].is-opening .is-preview{animation:portal-license-pair 2.3s both;border-color:var(--glow)}
.portal-box-dialog[data-grade=CustomGameLicense].is-opening .portal-box-light{animation:portal-box-flash 2.3s both}
.portal-box-dialog[data-grade=CustomGameLicense].is-revealed .portal-box-card{animation:portal-license-arrive .65s both}
@keyframes portal-license-pair{0%{opacity:0;transform:translate(var(--x),60px) scale(.4)}25%,65%{opacity:1;transform:translate(var(--x),0) scale(1.2)}100%{opacity:0;transform:translate(var(--x),-25px) scale(1.5)}}
@keyframes portal-license-arrive{from{opacity:0;transform:translateY(22px) scale(.85)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.portal-box-dialog[data-grade=CustomGameLicense].is-opening .is-preview{animation:none;opacity:.7;transform:translate(var(--x),0)}.portal-box-dialog[data-grade=CustomGameLicense].is-opening .portal-box-light,.portal-box-dialog[data-grade=CustomGameLicense].is-revealed .portal-box-card{animation:none}}
.portal-box-confirm{font-family:inherit}
.portal-box-kind{font-size:13px;line-height:1.4;font-weight:600;color:#ffe3a0;background:#ffffff0d;border:1px solid #ffffff20;border-radius:6px;padding:3px 9px}
.portal-reward-dialog .portal-box-results{grid-template-columns:minmax(0,280px);justify-content:center}
.portal-reward-dialog .portal-box-results[hidden]{display:none}
.portal-reward-dialog.is-opening .portal-box-light{animation-duration:1.1s}
.portal-reward-dialog .portal-box-card{padding:24px;background:linear-gradient(145deg,#4a3519,#191522 70%)}
.portal-reward-dialog .portal-box-card strong{font-size:22px;color:#ffe3a0}
.portal-reward-symbol{display:grid;place-items:center;height:160px;font-size:80px;color:var(--glow);text-shadow:0 0 30px var(--glow)}
