/* box-reveal.js: the mystery dumpling steamer gets the bag's stage. No words: the steamer is the button. */
html body dialog#modal[open]:has(.open-dumpling){background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
html body dialog#modal[open]:has(.open-dumpling)::before,html body dialog#modal[open]:has(.open-dumpling)::after{display:none!important}
html body #modal:has(.open-dumpling)::backdrop{background:radial-gradient(circle at 50% 42%,#4a3a7a55 0,#2a1d4ab8 55%,#1c1433e0 100%)!important;backdrop-filter:blur(6px)}
html body #modal:has(.open-dumpling) .modal-top h2,html body #modal:has(.open-dumpling) #lift-dumpling{visibility:hidden!important}
html body #modal:has(.open-dumpling) #lift-dumpling{height:0!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important}
html body #modal .open-dumpling{position:relative;background:none!important;border:0!important;box-shadow:none!important;cursor:pointer}

/* rays behind the steamer: faint while it's sealed, full once it opens */
.open-dumpling .bx-rays{position:absolute;left:50%;top:46%;width:145%;aspect-ratio:1;translate:-50% -50%;z-index:0;pointer-events:none;border-radius:50%;
 background:repeating-conic-gradient(from 0deg,#fff6c8b0 0 9deg,#fff6c800 9deg 22deg);-webkit-mask:radial-gradient(circle,#000 8%,transparent 55%);mask:radial-gradient(circle,#000 8%,transparent 55%);
 opacity:calc(.22*var(--bx-k,1));scale:calc(.7 + .12*var(--bx-k,1));transition:opacity .3s,scale .3s;animation:bx-spin 28s linear infinite}
.open-dumpling:is(.store-box-opening,.store-box-opened) .bx-rays{opacity:.4;scale:1}
.open-dumpling[data-bx-tier=uncommon] .bx-rays{background:repeating-conic-gradient(from 0deg,#d8ffeab0 0 9deg,#d8ffea00 9deg 22deg)}
.open-dumpling[data-bx-tier=rare] .bx-rays{background:repeating-conic-gradient(from 0deg,#e6d4ffc0 0 9deg,#e6d4ff00 9deg 22deg)}
.open-dumpling[data-bx-tier=ultra] .bx-rays{background:repeating-conic-gradient(from 0deg,#ffb3d1c0 0 6deg,#ffe58ac0 6deg 12deg,#b8f0d4c0 12deg 18deg,#c4d8ffc0 18deg 24deg,#0000 24deg 34deg)}
.open-dumpling .store-dumpling-box{z-index:1}
@keyframes bx-spin{to{rotate:360deg}}

/* the sealed steamer breathes, so it reads as "tap me" */
.open-dumpling:not(.store-box-opening):not(.store-box-opened):not(:disabled) .store-dumpling-box{animation:bx-breathe 1.8s ease-in-out infinite}
@keyframes bx-breathe{50%{scale:1.03 .98}}

.bx-confetti{position:absolute;z-index:10;width:10px;height:14px;margin:-7px 0 0 -5px;border-radius:2px;pointer-events:none}

/* hop home: the dumpling flies down onto its shelf spot */
.bx-flyer{position:fixed;z-index:70;pointer-events:none}
.bx-flyer>*{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:1!important;transform:none!important;margin:0!important}
#sq-dock .sq-tile{position:relative}
.bx-stamp{position:absolute;top:-8px;right:-8px;z-index:5;padding:2px 8px;border:2px solid #fff;border-radius:99px;background:linear-gradient(90deg,#ff8fbf,#ffc76a);color:#fff;font:900 12px/1.3 inherit;box-shadow:0 2px #e7a2b9;rotate:10deg;pointer-events:none;animation:bx-stamp 2.6s cubic-bezier(.3,1.6,.5,1) both}
.bx-stamp.bx-twice{background:linear-gradient(90deg,#6fd6a8,#5fb8e8);box-shadow:0 2px #4a9c8a}
@keyframes bx-stamp{0%{scale:0}12%{scale:1.15}20%{scale:1}85%{scale:1;opacity:1}100%{scale:.6;opacity:0}}

@media(prefers-reduced-motion:reduce){.bx-rays,.bx-confetti{display:none!important}.open-dumpling .store-dumpling-box{animation:none!important}}

/* The small badge needs crisp type, without the white title's inherited shadow. */
html body #modal:has(.open-dumpling) .dumpling-result .rarity{
 display:inline-flex;align-items:center;justify-content:center;gap:6px;
 padding:5px 12px;margin-top:8px;font-size:14px;font-weight:600;line-height:1.25;
 letter-spacing:.02em;text-shadow:none;white-space:nowrap;
}

/* This reveal has one action: tap the basket, then meet the new friend. */
html body #modal:has(.open-dumpling) .modal-top [data-action="close"],
html body #modal:has(.open-dumpling) > .sq-reveal-skip{display:none!important}

/* A readable keepsake label; the face and name lead the celebration. */
html body #modal:has(.open-dumpling) .modal-top{display:none!important}
html body #modal:has(.open-dumpling.store-box-opened){padding-top:34px!important}
html body #modal:has(.open-dumpling.store-box-opened) .store-dumpling-box{
 width:min(100%,280px,calc((100dvh - 260px)*1.059))!important;
}
html body #modal .store-box-opened .store-box-toy{left:5%;top:-23%;width:90%;height:90%}
.open-dumpling.store-box-opened .bx-rays{animation-play-state:paused}
html body #modal:has(.open-dumpling) .box-result-ready{
 display:flex;flex-direction:column;align-items:stretch;gap:12px;width:100%;height:auto!important;
}
html body #modal .dumpling-nameplate{
 position:relative;z-index:2;box-sizing:border-box;max-width:100%;padding:14px 18px 12px;
 --sq-title:#503665;--sq-text:#503665;--sq-chip-ink:#234f48;--sq-card-shadow:transparent;
 background:#fff8e9;border:3px solid #fffdf6;border-radius:26px;
 box-shadow:0 5px 0 #dac4b4,0 9px 24px #34203b24;text-align:center;
}
html body #modal:has(.open-dumpling) .dumpling-nameplate h2.dumpling-result{
 margin:0!important;color:#503665!important;text-shadow:none!important;
 font-size:clamp(24px,6vw,32px)!important;line-height:1.12!important;text-wrap:balance;overflow-wrap:anywhere;
}
html body #modal:has(.open-dumpling) .dumpling-nameplate p.dumpling-result{
 margin:6px 0 0!important;color:#503665!important;text-shadow:none!important;
}
html body #modal:has(.open-dumpling) .dumpling-nameplate .rarity{margin-top:0;padding:4px 10px;font-size:13px}
html body #modal:has(.open-dumpling) #squeeze-dumpling{
 --sq-go:linear-gradient(#b5efdf,#86d8c5);--sq-go-ink:#234f48;--sq-go-shadow:#58aa9c;
 align-self:center;width:min(100%,300px);min-height:54px;margin:2px 0 5px!important;padding:10px 24px;
 border:3px solid #f2fff9;border-radius:24px;background:linear-gradient(#b5efdf,#86d8c5);
 color:#234f48;font-size:25px;line-height:1.1;box-shadow:0 5px 0 #58aa9c,0 8px 18px #21332d22;
}
html body #modal:has(.open-dumpling) #squeeze-dumpling:active{translate:0 3px;box-shadow:0 2px 0 #58aa9c}
@media(max-height:500px) and (min-width:600px){
 html body dialog#modal[open]:has(.open-dumpling.store-box-opened){
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;
  width:min(680px,calc(100vw - 32px))!important;padding:30px 20px 16px!important;gap:18px!important;
 }
 html body #modal:has(.open-dumpling.store-box-opened) .store-dumpling-box{width:min(100%,240px,calc((100dvh - 100px)*.9))!important}
 html body #modal .dumpling-nameplate{padding:12px}
 html body #modal:has(.open-dumpling) .dumpling-nameplate h2.dumpling-result{font-size:26px!important}
}
