/* Shared lifecycle; visual treatment based on the supplied effects. */
dialog.hs-effect {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; overflow: hidden; isolation: isolate;
  color: #43382c; background: radial-gradient(ellipse at center, #fff6baee, #fff0e5e8);
}
dialog.hs-effect[open] { display: grid; place-items: center; animation: hs-effect-life var(--duration) linear both; }
.hs-effect::backdrop { background: #26372b88; backdrop-filter: blur(5px); }
dialog.hs-effect--contract { background: radial-gradient(ellipse at center, #9b571c99, #210f22eb 75%); }
dialog.hs-effect--claim { background: radial-gradient(ellipse at center, #fffbdcf5, #ffefdae8); }
dialog.hs-effect--next { background: radial-gradient(ellipse at center, #fff8daf5, #ffe9e2e8); }
.hs-effect-stage { position: relative; display: grid; place-items: center; width: min(96vw, 840px); aspect-ratio: 1; }
.hs-effect-stage img {
  position: relative; z-index: 2; display: block; width: 100%; max-height: 82vh; max-height: 82dvh; object-fit: contain;
  filter: drop-shadow(0 5px 0 #ffffffb0) drop-shadow(0 22px 30px #63330944);
  animation: hs-effect-art var(--duration) both; transform-origin: 50% 60%;
}
.hs-effect-stage img[hidden] { display: none; }
.hs-effect--contract img { filter: drop-shadow(0 0 28px #ffca4a77) drop-shadow(0 24px 36px #0008); }
.hs-effect--next img { animation-name: hs-effect-next; }
.hs-effect-glow { position: absolute; width: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fffde6 5%, #ffdc6588 35%, #ff963322 55%, transparent 70%); animation: hs-effect-glow 1500ms ease-in-out infinite alternate; }
.hs-effect-rays { position: absolute; width: 140vmax; height: 140vmax; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #ffb52955 0deg 6deg, transparent 6deg 18deg); mask-image: radial-gradient(circle, transparent 6%, #000 23%, transparent 67%); animation: hs-effect-rays var(--duration) ease-out both; }
.hs-effect--contract .hs-effect-rays { background: repeating-conic-gradient(from 0deg, #ffe085aa 0deg 3deg, transparent 3deg 15deg); }
.hs-effect-ring { position: absolute; width: 32%; aspect-ratio: 1; border: 5px solid #ffb520; border-radius: 50%; box-shadow: 0 0 20px #ffc93d77; animation: hs-effect-ring 1400ms cubic-bezier(.12,.7,.2,1) 180ms both; }
.hs-effect--contract .hs-effect-ring { border-color: #fff2ba; }
.hs-effect-ring.ring-second { animation-delay: 480ms; border-color: #ff7995; }
.hs-effect-ring.ring-third { animation-delay: 780ms; border-color: #f8d45e; }
.hs-effect-message { position: relative; z-index: 2; font-size: clamp(24px, 5vw, 44px); font-weight: 700; text-align: center; padding: 24px; background: #fffef2; border-radius: 24px; }
.hs-effect-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); min-height: 44px; padding: 10px 18px; border: 1px solid #43382c30; border-radius: 24px; background: #fff; color: #43382c; font: inherit; cursor: pointer; z-index: 4; }
.hs-effect-close:focus-visible { outline: 3px solid #24785d; outline-offset: 4px; }
.hs-effect-particle { position: absolute; z-index: 3; left: 50%; top: 50%; width: 11px; height: 23px; border-radius: 3px; background: var(--color); opacity: 0; animation: hs-effect-burst 2600ms cubic-bezier(.12,.66,.24,1) var(--delay) both; }
.hs-effect-particle:nth-child(3n) { width: 17px; height: 17px; clip-path: polygon(50% 0,61% 37%,100% 50%,61% 63%,50% 100%,39% 63%,0 50%,39% 37%); }
.hs-effect-particle:nth-child(5n) { border-radius: 50%; width: 10px; height: 10px; }
.hs-effect--next .hs-effect-particle { width: 12px; height: 12px; }
@keyframes hs-effect-life { 0% { opacity: 0; } 5%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hs-effect-art { 0% { opacity: 0; transform: translateY(18vh) scale(.15) rotate(-13deg); } 11% { opacity: 1; transform: translateY(-2vh) scale(1.1) rotate(3deg); } 17% { transform: translateY(1vh) scale(.95) rotate(-1.5deg); } 25%, 38% { transform: none; } 50% { transform: translateY(-1.2vh) scale(1.035) rotate(-1deg); } 64%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8vh) scale(.9) rotate(3deg); } }
@keyframes hs-effect-next { 0% { opacity: 0; transform: translateY(12vh) scale(.2) rotate(-10deg); } 14% { opacity: 1; transform: translateY(-1vh) scale(1.08) rotate(3deg); } 22% { transform: scale(.97) rotate(-1deg); } 32%, 48% { transform: none; } 65% { transform: translateY(-10px) rotate(1deg); } 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-24px); } }
@keyframes hs-effect-glow { from { opacity: .65; transform: scale(.85); } to { opacity: 1; transform: scale(1.12); } }
@keyframes hs-effect-rays { 0% { opacity: 0; transform: scale(.25) rotate(-25deg); } 18% { opacity: 1; } 80% { opacity: .7; } 100% { opacity: 0; transform: scale(1.1) rotate(40deg); } }
@keyframes hs-effect-ring { 0% { opacity: 0; transform: scale(.2); } 18% { opacity: .9; } 100% { opacity: 0; transform: scale(3.7); } }
@keyframes hs-effect-burst { 0% { opacity: 0; transform: scale(.2); } 12%, 65% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 18vh)) rotate(var(--turn)); } }
@media (prefers-reduced-motion: reduce) {
  dialog.hs-effect[open], .hs-effect-stage img { animation: none; }
  .hs-effect-particle, .hs-effect-rays, .hs-effect-ring, .hs-effect-glow { display: none; }
}
