/* packopen.css — the card-opening reveal (js/packopen.js), shared by booster
   packs (terminal #packs) and the machine (gacha.html). A foil pack floats and
   tears, the cards rise into a stack, each back glows its tier once the chain
   has answered, a tap turns it with light to match its tier, and the haul
   ends in a grid. The sparks are a canvas (js/scene/reveal-fx.js); the rays,
   flash, foil and every move are here, so the reveal is whole without it.
   Under prefers-reduced-motion nothing moves: cards turn face-up in place. */
:root {
  --tier-common: #9aa7b4;
  --tier-uncommon: #39d98a;
  --tier-rare: #5ec8f2;
  --tier-epic: #c9a6ff;
  --tier-legendary: #ffd34d;
  --po-back: #0c100c;
  --po-face: #161b17;
  --po-ink: #e8f0e9;
  --po-dim: #a0aa95;
  --po-lime: var(--lime, #b8ff38);
  --po-veil: rgba(3, 5, 3, .9);
}
@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

html.po-lock, html.po-lock body { overflow: hidden; }
.po-veil [hidden], .po-veil[hidden] { display: none !important; }

.po-veil {
  position: fixed; inset: 0; z-index: 9000;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(30, 44, 26, .55), transparent 70%),
    var(--po-veil);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 14px; padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  color: var(--po-ink);
  animation: po-veil-in .25s ease-out both;
}
@keyframes po-veil-in { from { opacity: 0; } }
/* the room darkens for a big turn */
.po-veil::before {
  content: ""; position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
.po-veil.po-dim::before { opacity: .35; }
.po-veil.po-dark::before { opacity: .72; transition-duration: 1.2s; }
/* centred while it fits, scrolled from the top when it does not */
.po-top { margin-top: auto; }
.po-bar { margin-bottom: auto; }

.po-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1; }
.po-top, .po-stage, .po-tally, .po-bar { position: relative; z-index: 2; }
.po-top { text-align: center; display: grid; gap: 6px; justify-items: center; }
.po-title { font: 700 20px/1.2 var(--sg, system-ui); margin: 0; letter-spacing: .01em; }
.po-sub { font: 13px/1.45 var(--mono, monospace); color: var(--po-dim); margin: 0; max-width: 52ch; min-height: 1.45em; }

.po-sound {
  position: fixed; top: 12px; right: 12px; z-index: 4;
  min-height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--po-dim); font: 12px var(--mono, monospace);
}
.po-sound:hover { color: var(--po-ink); border-color: rgba(255, 255, 255, .3); }
.po-sound[aria-pressed="false"] { opacity: .7; text-decoration: line-through; }
.po-sound:focus-visible { outline: 2px solid var(--po-ink); outline-offset: 2px; }

.po-stage {
  --cw: clamp(150px, min(68vw, calc((100vh - 300px) / 1.4)), 288px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}
.po-stage.po-shake { animation: po-shake .55s cubic-bezier(.36, .07, .19, .97); }
.po-stage.po-shake[data-shake="4"] { animation-duration: .8s; }
@keyframes po-shake {
  10%, 90% { transform: translate(-1px, 1px); }
  20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-5px, 3px); }
  40%, 60% { transform: translate(5px, -3px); }
}

/* ── the sealed pack ─────────────────────────────────────────────────────── */
.po-pack {
  --tear: 0;
  width: clamp(170px, min(60vw, calc((100vh - 260px) / 1.48)), 260px); aspect-ratio: 5 / 7.4; position: relative;
  border: 0; padding: 0; background: none; cursor: grab; color: var(--po-ink);
  perspective: 1000px; touch-action: none; -webkit-tap-highlight-color: transparent;
  animation: po-float 4.2s ease-in-out infinite;
}
.po-pack:active { cursor: grabbing; }
.po-pack:focus-visible { outline: 2px solid rgba(232, 240, 233, .45); outline-offset: 10px; border-radius: 12px; }
@keyframes po-float { 50% { transform: translateY(-8px); } }
.po-pack-in {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
  animation: po-sway 7s ease-in-out infinite;
}
.po-pack.po-touch .po-pack-in { animation: none; }
@keyframes po-sway { 25% { transform: rotateY(-7deg) rotateX(2deg); } 75% { transform: rotateY(7deg) rotateX(-2deg); } }
/* crimped top and bottom, like a real foil pack */
.po-pack-body {
  position: absolute; inset: 0; overflow: hidden; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background:
    radial-gradient(90% 60% at 50% 38%, rgba(184, 255, 56, .2), transparent 70%),
    linear-gradient(160deg, #2c3d1c 0%, #141d10 42%, #0b0f0a 75%, #1a2614 100%);
  box-shadow: inset 0 0 0 1px rgba(184, 255, 56, .35), inset 0 0 40px rgba(0, 0, 0, .6);
  -webkit-mask:
    linear-gradient(#000 0 0) center / 100% calc(100% - 16px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 8px repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x;
  mask:
    linear-gradient(#000 0 0) center / 100% calc(100% - 16px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 8px repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .65));
}
.po-pack-foil {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    linear-gradient(115deg, transparent 28%, rgba(184, 255, 56, .22) 42%, rgba(255, 255, 255, .38) 50%,
      rgba(94, 200, 242, .22) 58%, transparent 72%),
    repeating-linear-gradient(115deg, transparent 0 14px, rgba(255, 255, 255, .035) 14px 16px);
  background-size: 260% 260%, auto;
  background-position: var(--mx) var(--my), 0 0;
  animation: po-sheen 5s ease-in-out infinite alternate;
}
.po-pack.po-touch .po-pack-foil { animation: none; }
@keyframes po-sheen { from { --mx: 15%; --my: 20%; } to { --mx: 85%; --my: 80%; } }
.po-pack-mark { width: 38%; filter: drop-shadow(0 0 18px rgba(184, 255, 56, .45)); }
.po-pack-mark svg, .po-back-mark svg { display: block; width: 100%; height: auto; }
.po-mark-tile { fill: var(--po-lime); }
.po-mark-chev { fill: #0a0c0a; }
.po-pack-name { font: 700 clamp(18px, 5vw, 22px)/1 var(--sg, system-ui); letter-spacing: .02em; }
.po-pack-count { font: 12px var(--mono, monospace); color: var(--po-dim); text-transform: uppercase; letter-spacing: .12em; }
/* the strip that tears off, and the light under it */
.po-pack-top {
  position: absolute; left: 0; right: 0; top: 0; height: 15%; overflow: hidden; border-radius: 4px 4px 0 0;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 12px;
  background: linear-gradient(180deg, #3d5424, #1d2a14);
  box-shadow: inset 0 0 0 1px rgba(184, 255, 56, .4), 0 2px 0 rgba(0, 0, 0, .35);
  -webkit-mask:
    linear-gradient(#000 0 0) bottom / 100% calc(100% - 8px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 8px repeat-x;
  mask:
    linear-gradient(#000 0 0) bottom / 100% calc(100% - 8px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 8px repeat-x;
  transform-origin: 0% 50%;
  transform: translateX(calc(var(--tear) * 70%)) rotate(calc(var(--tear) * 14deg));
}
.po-pack-arrow { font: 600 11px var(--mono, monospace); color: rgba(232, 240, 233, .75); letter-spacing: .08em;
  animation: po-nudge 1.6s ease-in-out infinite; }
@keyframes po-nudge { 50% { transform: translateX(5px); } }
.po-pack-seam {
  position: absolute; left: 4%; right: 4%; top: 15%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff 20%, var(--po-lime) 50%, #fff 80%, transparent);
  box-shadow: 0 0 12px var(--po-lime), 0 0 30px var(--po-lime);
  opacity: calc(.15 + var(--tear) * .85);
}
.po-pack.po-tear { animation: none; pointer-events: none; }
.po-pack.po-tear .po-pack-in { animation: none; }
.po-pack.po-tear .po-pack-top { animation: po-strip .45s cubic-bezier(.5, 0, .75, 0) forwards; }
.po-pack.po-tear .po-pack-seam { animation: po-seam .5s ease-out forwards; }
.po-pack.po-tear .po-pack-body { animation: po-sink .5s .18s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes po-strip { to { transform: translate(140%, -60px) rotate(32deg); opacity: 0; } }
@keyframes po-seam { 40% { transform: scaleY(5); opacity: 1; } to { transform: scaleY(30); opacity: 0; } }
@keyframes po-sink { to { transform: translateY(70%) scale(.92); opacity: 0; } }

/* ── the machine (js/scene/machine.js), for a pull on the capsule machine page ── */
.po-machine { position: relative; width: min(94vw, 480px); height: clamp(300px, calc(100vh - 290px), 600px); }
.po-machine-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.po-veil:not([data-mode="machine"]) .po-machine { display: none; }
.po-veil[data-mode="machine"] .po-deck, .po-veil[data-mode="machine"] .po-callout,
.po-veil[data-mode="machine"] .po-front-acts { display: none; }
/* a card out of a capsule */
.po-slot.po-emerge { animation: po-emerge .75s cubic-bezier(.2, 1.25, .4, 1) both; }
@keyframes po-emerge { from { transform: translateY(26%) scale(.22); opacity: 0; filter: brightness(2.6); } 55% { opacity: 1; } }

/* ── the stack ───────────────────────────────────────────────────────────── */
.po-deck { position: relative; width: var(--cw); aspect-ratio: 5 / 7; }
.po-slot {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .45s ease, filter .45s ease;
}
.po-slot[data-pos="front"] { z-index: 5; }
.po-slot[data-pos="b1"] { z-index: 4; transform: translate(10px, -10px) rotate(2.5deg) scale(.95); filter: brightness(.7); }
.po-slot[data-pos="b2"] { z-index: 3; transform: translate(18px, -18px) rotate(5deg) scale(.9); filter: brightness(.5); }
.po-slot[data-pos="deep"] { z-index: 2; transform: translate(22px, -22px) rotate(6deg) scale(.88); opacity: 0; }
.po-slot[data-pos="gone"] { z-index: 6; transform: translate(-135%, 6%) rotate(-20deg); opacity: 0; pointer-events: none; }
.po-slot.po-rise { animation: po-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes po-rise { from { transform: translateY(55%) scale(.7); opacity: 0; } }
.po-deck .po-acts { display: none; }

.po-card {
  display: block; width: 100%; aspect-ratio: 5 / 7; position: relative;
  border: 0; padding: 0; background: none; cursor: pointer; color: inherit; font: inherit;
  perspective: 1100px; -webkit-tap-highlight-color: transparent;
}
.po-slot[data-pos="front"] .po-card { animation: po-hover 3.6s ease-in-out infinite; }
@keyframes po-hover { 50% { transform: translateY(-6px); } }
/* a card the chain has not answered for is waiting, not greyed out (money.css dims every disabled button) */
.po-veil .po-card:disabled { cursor: default; opacity: 1; }
.po-card:focus-visible { outline: 3px solid var(--po-ink); outline-offset: 4px; border-radius: 10px; }
.po-tilt {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s ease-out;
}
.po-card.po-touch .po-tilt { transition: transform .06s linear; }
.po-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.3, 1.35, .45, 1);
}
.po-card.po-up .po-inner { transform: rotateY(180deg); }
.po-back, .po-face {
  position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; overflow: hidden;
}

/* the back: the mark on a fine engraved field; once the chain has answered it glows the tier */
.po-back {
  align-items: center; justify-content: center;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(184, 255, 56, .06) 0 1px, transparent 1px 7px),
    radial-gradient(120% 80% at 50% 0%, #1f2a1d, var(--po-back) 70%);
  box-shadow: inset 0 0 0 1px #2e3a2f, inset 0 0 0 7px var(--po-back), inset 0 0 0 8px #2b352c, 0 18px 40px rgba(0, 0, 0, .55);
}
.po-back-mark { width: 34%; opacity: .9; filter: drop-shadow(0 0 14px rgba(184, 255, 56, .3)); position: relative; z-index: 1; }
.po-back-ring {
  position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(184, 255, 56, .16); box-shadow: 0 0 0 10px rgba(184, 255, 56, .03);
}
.po-card.po-wait .po-back::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%);
  animation: po-shine 1.4s linear infinite;
}
.po-card.po-wait .po-back-ring { animation: po-spin 3s linear infinite; border-style: dashed; }
@keyframes po-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.po-card[data-tier] .po-back {
  box-shadow: inset 0 0 0 2px var(--po-glow), inset 0 0 0 7px var(--po-back), inset 0 0 0 8px var(--po-glow),
    0 0 26px var(--po-glow), 0 18px 40px rgba(0, 0, 0, .55);
}
.po-card[data-tier] .po-back-ring { border-color: var(--po-glow); opacity: .5; }
.po-card[data-tier="rare"] .po-back::after,
.po-card[data-tier="epic"] .po-back::after,
.po-card[data-tier="legendary"] .po-back::after {
  content: ""; position: absolute; inset: -40%;
  background: conic-gradient(from 0deg, transparent 0 70%, var(--po-glow) 85%, transparent 100%);
  opacity: .35; animation: po-spin 2.6s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, #000 46%, transparent 48%);
  mask: radial-gradient(circle, transparent 38%, #000 40%, #000 46%, transparent 48%);
}
.po-card[data-tier="legendary"] .po-back { animation: po-pulse 1.1s ease-in-out infinite; }
@keyframes po-pulse {
  50% { box-shadow: inset 0 0 0 2px var(--po-glow), inset 0 0 0 7px var(--po-back), inset 0 0 0 8px var(--po-glow),
    0 0 54px var(--po-glow), 0 18px 40px rgba(0, 0, 0, .55); }
}
@keyframes po-spin { to { transform: rotate(360deg); } }

/* the charge before an epic or legendary turn */
.po-slot.po-charge .po-card { animation: po-tremble var(--charge, 700ms) ease-in both; }
.po-slot.po-charge .po-back { animation: po-surge var(--charge, 700ms) ease-in both; }
@keyframes po-tremble {
  0% { transform: none; }
  20% { transform: translate(1px, -1px) rotate(-.5deg); }
  40% { transform: translate(-2px, 1px) rotate(.8deg) scale(1.01); }
  60% { transform: translate(3px, -2px) rotate(-1.2deg) scale(1.03); }
  80% { transform: translate(-4px, 2px) rotate(1.6deg) scale(1.05); }
  90% { transform: translate(5px, -3px) rotate(-2deg) scale(1.07); }
  100% { transform: translate(0, -10px) scale(1.08); }
}
@keyframes po-surge {
  to { box-shadow: inset 0 0 0 3px #fff, inset 0 0 60px var(--po-glow), 0 0 90px var(--po-glow), 0 0 160px var(--po-glow); }
}

/* the face, with foil that follows the pointer */
.po-face {
  transform: rotateY(180deg); background: var(--po-face);
  box-shadow: inset 0 0 0 2px var(--po-glow, #2b332c), 0 0 30px color-mix(in srgb, var(--po-glow, #000) 45%, transparent),
    0 18px 40px rgba(0, 0, 0, .55);
}
.po-face img { width: 100%; flex: 1 1 auto; min-height: 0; object-fit: cover; display: block; background: #0e1210; }
.po-card[data-full] .po-face img { object-fit: contain; }
.po-face .po-noart {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; text-align: center;
  font: 700 22px/1.15 var(--sg, system-ui); padding: 12px; color: var(--po-glow, var(--po-ink));
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--po-glow, #000) 22%, transparent), transparent 70%);
}
.po-holo, .po-glare { position: absolute; inset: 0; pointer-events: none; border-radius: 10px; }
.po-holo {
  mix-blend-mode: color-dodge; opacity: calc(var(--holo, 0) * var(--holo-lift, 1));
  background:
    repeating-linear-gradient(110deg, #ff7773 0%, #ffed5f 7%, #a8ff5f 14%, #83fff7 21%, #7894ff 28%, #d875ff 35%, #ff7773 42%),
    repeating-linear-gradient(20deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 6px);
  background-size: 400% 400%, auto;
  background-position: var(--mx) var(--my), 0 0;
  filter: brightness(.75) contrast(1.3) saturate(1.3);
}
.po-glare {
  mix-blend-mode: overlay; opacity: .42;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .7) 0%,
    rgba(255, 255, 255, .12) 28%, rgba(0, 0, 0, .35) 90%);
}
.po-card.po-up:not(.po-touch) .po-face { animation: po-sheen 4.5s ease-in-out infinite alternate; }
.po-card[data-tier="uncommon"] { --holo: .07; }
.po-card[data-tier="rare"] { --holo: .14; }
.po-card[data-tier="epic"] { --holo: .2; }
.po-card[data-tier="legendary"] { --holo: .26; }
.po-card.po-touch { --holo-lift: 1.6; }
.po-cap {
  position: relative; z-index: 1; padding: 8px 10px 10px; display: grid; gap: 3px;
  background: linear-gradient(0deg, rgba(10, 13, 10, .96), rgba(10, 13, 10, .82));
  border-top: 1px solid color-mix(in srgb, var(--po-glow, #2b332c) 50%, transparent);
}
.po-cap b { font: 600 13px/1.2 var(--sg, system-ui); overflow-wrap: anywhere; }
/* a card's art is already a whole card face, name and all: keep only the tier */
.po-card[data-full] .po-cap b { display: none; }
.po-cap span { font: 11px/1.2 var(--mono, monospace); color: var(--po-glow, var(--po-dim)); text-transform: uppercase; letter-spacing: .06em; }
.po-veil [data-tier="common"] { --po-glow: var(--tier-common); }
.po-veil [data-tier="uncommon"] { --po-glow: var(--tier-uncommon); }
.po-veil [data-tier="rare"] { --po-glow: var(--tier-rare); }
.po-veil [data-tier="epic"] { --po-glow: var(--tier-epic); }
.po-veil [data-tier="legendary"] { --po-glow: var(--tier-legendary); }

/* a slot the chain never answered for, once the opening is over */
.po-slot.po-void .po-card { opacity: .35; }
.po-slot.po-void .po-back::after, .po-slot.po-void .po-back-ring { animation: none; }

/* ── what came out ───────────────────────────────────────────────────────── */
.po-callout { margin: 4px 0 0; min-height: 3.6em; text-align: center; display: grid; gap: 2px; justify-items: center; }
.po-callout.on { animation: po-callout .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes po-callout { from { transform: translateY(10px) scale(.92); opacity: 0; } }
.po-callout-tier {
  font: 800 13px/1 var(--sg, system-ui); text-transform: uppercase; letter-spacing: .28em;
  color: var(--po-glow, var(--po-dim)); text-shadow: 0 0 18px var(--po-glow, transparent);
}
.po-callout[data-tier="legendary"] .po-callout-tier, .po-callout[data-tier="epic"] .po-callout-tier { font-size: 17px; }
.po-callout[data-tier="legendary"] .po-callout-tier { animation: po-letters 1.2s ease-out both; }
@keyframes po-letters { from { letter-spacing: .9em; opacity: 0; } }
.po-callout b { font: 700 18px/1.25 var(--sg, system-ui); max-width: 30ch; overflow-wrap: anywhere; }
.po-callout small { font: 12px var(--mono, monospace); color: var(--po-dim); }
.po-hint { margin: 0; font: 12px var(--mono, monospace); color: var(--po-dim); min-height: 1.2em; text-align: center; }
.po-pips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 320px; }
.po-pips:empty { display: none; }
.po-pip { width: 8px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .14); transition: width .3s, background .3s; }
.po-pip.cur { width: 22px; background: rgba(255, 255, 255, .45); }
.po-pip[data-tier] { background: var(--po-glow); box-shadow: 0 0 8px var(--po-glow); }
.po-front-acts, .po-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.po-front-acts:empty, .po-acts:empty { display: none; }
.po-veil a.btn-quiet, .po-veil .po-acts a, .po-front-acts a {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .18); color: var(--po-ink); font: 600 12px var(--sg, system-ui); text-decoration: none;
}

/* light behind the card, a flash in front of it */
.po-raylayer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.po-rays {
  position: absolute; left: var(--cx, 50%); top: var(--cy, 45%); width: 170vmax; height: 170vmax;
  margin: -85vmax 0 0 -85vmax; opacity: 0; transition: opacity .6s ease;
  background: repeating-conic-gradient(from 0deg, var(--po-glow, #fff) 0deg 3.5deg, transparent 3.5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 8%, transparent 32%);
  mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 8%, transparent 32%);
  animation: po-spin 30s linear infinite; mix-blend-mode: screen;
}
.po-rays.on { opacity: .28; }
.po-rays.on[data-tier="epic"] { opacity: .4; }
.po-rays.on[data-tier="legendary"] { opacity: .6; animation-duration: 18s; }
.po-flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0;
  background: radial-gradient(circle at var(--cx, 50%) var(--cy, 45%), #fff 0%, var(--po-glow, #fff) 18%, transparent 62%);
}
.po-flash.on { animation: po-flash .6s ease-out; }
.po-flash.on[data-tier="legendary"] { animation: po-flash-big 1s ease-out; }
@keyframes po-flash { 12% { opacity: .55; } to { opacity: 0; } }
@keyframes po-flash-big { 8% { opacity: .95; } 30% { opacity: .5; } to { opacity: 0; } }

/* ── the haul ────────────────────────────────────────────────────────────── */
.po-veil[data-mode="grid"] .po-deck {
  width: min(100%, 900px); aspect-ratio: auto;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(140px, 180px)); justify-content: center;
}
.po-veil[data-mode="grid"] .po-slot { position: relative; inset: auto; transform: none; opacity: 1; filter: none; gap: 8px; }
.po-veil[data-mode="grid"] .po-slot.po-in { animation: po-pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes po-pop { from { transform: translateY(16px) scale(.85); opacity: 0; } }
.po-veil[data-mode="grid"] .po-deck .po-acts { display: flex; }
.po-veil[data-mode="grid"] .po-deck .po-acts:empty { display: none; }
.po-veil[data-mode="grid"] .po-callout, .po-veil[data-mode="grid"] .po-front-acts { display: none; }
.po-veil[data-mode="grid"] .po-slot.po-best .po-card { filter: drop-shadow(0 0 18px var(--po-glow)); }
.po-veil[data-mode="grid"] .po-slot.po-best::before {
  content: "best pull"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 2px 8px; border-radius: 99px; background: var(--po-glow); color: #0a0c0a;
  font: 700 10px/1.4 var(--mono, monospace); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
.po-tally { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font: 13px var(--mono, monospace); color: var(--po-dim); }
.po-tally span { color: var(--po-glow); }
.po-tally b { font-size: 15px; }

.po-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.po-btn {
  min-height: 44px; padding: 0 20px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .2); color: var(--po-ink);
  font: 700 14px var(--sg, system-ui);
}
.po-btn:hover { border-color: rgba(255, 255, 255, .4); }
.po-btn.primary { background: var(--po-lime); border-color: var(--po-lime); color: #0a0c0a; }
/* while cards are still face down, Next leads and Done steps back */
.po-veil[data-mode="stack"] .po-bar.po-more .po-close { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .2); color: var(--po-ink); }
.po-veil:focus { outline: none; }
.po-btn.primary:hover { filter: brightness(1.06); }
.po-btn:focus-visible { outline: 3px solid var(--po-ink); outline-offset: 2px; }

@media (max-width: 480px) {
  .po-veil { gap: 10px; padding-top: 52px; }
  .po-veil[data-mode="grid"] .po-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .po-veil[data-mode="grid"] .po-cap { padding: 5px 6px 6px; }
  .po-veil[data-mode="grid"] .po-cap b { font-size: 11px; }
  .po-veil[data-mode="grid"] .po-cap span { font-size: 9px; }
  .po-veil[data-mode="grid"] .po-noart { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .po-veil, .po-pack, .po-pack-in, .po-pack-foil, .po-pack-arrow, .po-slot.po-rise, .po-card, .po-face,
  .po-back, .po-back::after, .po-back-ring, .po-veil[data-mode="grid"] .po-slot.po-in, .po-callout.on,
  .po-callout-tier, .po-rays, .po-stage.po-shake, .po-slot.po-charge .po-card, .po-slot.po-emerge { animation: none !important; }
  .po-inner, .po-slot, .po-tilt, .po-pack-in { transition: none; }
  .po-rays, .po-flash { display: none; }
}
