/*
 * packs.css: /packs (reference/spec/packs.md) and the opening overlay (reference/spec/pack-opening.md),
 * built to traded's measurements with the PRODUCT.md Decisions. Small secondary text uses white at 55 to 60
 * percent (traded uses 35 to 40) so it passes WCAG AA over the pack aura.
 */

/* ───────────── page root, aura (3.1) ───────────── */
.page-packs .site-footer { position: relative; z-index: 10; }
.packs-main { background: transparent; }
.packs-root { position: relative; isolation: isolate; overflow-x: clip; min-height: calc(100dvh - var(--header-h)); }

.packs-aura {
  --aura-primary: #2a9e65; --aura-secondary: #8bc4a5; --aura-atmosphere: #01331d;
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: 0.68;
  background: var(--aura-atmosphere);
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--aura-primary) 9%, transparent), transparent 38%),
    radial-gradient(circle at 50% 82%, color-mix(in srgb, var(--aura-secondary) 7%, transparent), transparent 46%),
    var(--aura-atmosphere);
}
.packs-aura::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(at 50% 58%, rgba(0, 0, 0, 0) 0 20%, rgba(0, 0, 0, 0.58) 72%, rgba(0, 0, 0, 0.9) 100%);
}
.packs-aura[hidden] { display: none; }
.aura-flame {
  position: absolute; left: 50%; bottom: -34vh; width: min(48vw, 680px); height: min(78vh, 840px);
  border-radius: 52% 48% 46% 54% / 72% 68% 32% 28%;
  background: linear-gradient(to top, var(--aura-primary), color-mix(in srgb, var(--aura-secondary) 68%, transparent) 48%, transparent 82%);
  filter: blur(64px); mix-blend-mode: screen; opacity: 0.12; transform-origin: 50% 100%;
  animation: packs-aura-breathe 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}
.aura-flame-left { animation-delay: -5.2s; transform: translate(-92%) rotate(-13deg) scale(0.8); }
.aura-flame-center { animation-duration: 9.8s; transform: translate(-50%) scale(0.7, 1.08); }
.aura-flame-right { animation-duration: 10.8s; animation-delay: -2.7s; transform: translate(-8%) rotate(13deg) scale(0.76); }
/* ambient dust: three box-shadow star layers drawn by js/pages/packs.js (no second WebGL canvas) */
.aura-dust { position: absolute; inset: 0; z-index: 1; opacity: 0.46; }
.aura-dust > i {
  position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%;
  will-change: transform; animation: var(--dust-anim, none);
}
@keyframes packs-aura-breathe { 0% { opacity: 0.075; translate: 0 7%; scale: 0.92 1; } to { opacity: 0.16; translate: 0 -3%; scale: 1.04 1.08; } }
@keyframes dust-rise { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-1 * var(--dust-h, 100vh)), 0); } }
@keyframes dust-drift { from { transform: translate3d(-10px, 8px, 0); } to { transform: translate3d(12px, -18px, 0); } }
@keyframes dust-twinkle { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.packs-content { position: relative; z-index: 10; }

/* ───────────── recent pulls ticker (3.2) ───────────── */
.pulls { border-block: 1px solid var(--fg-10); background: rgba(255, 255, 255, 0.02); }
.pulls-mask {
  position: relative; min-height: 78px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.pulls-track { display: flex; width: max-content; gap: 10px; padding: 10px; }
.pulls-track[data-animated="true"] { animation: pulls-pan var(--pulls-duration, 30s) ease-in-out infinite alternate; will-change: transform; }
@keyframes pulls-pan { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--pulls-travel, 0px))); } }
.pull {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 218px; height: 58px; padding: 6px;
  border: 1px solid var(--fg-10); border-radius: 8px; background: rgba(0, 0, 0, 0.3);
}
.pull-thumb { flex-shrink: 0; height: 56px; aspect-ratio: 1 / 1.68; overflow: hidden; border-radius: 2px; background: var(--fg-6); }
.pull-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.pull-text { display: flex; flex: 1; flex-direction: column; justify-content: center; align-self: stretch; min-width: 0; padding-right: 4px; }
.pull-title { font-size: 11px; line-height: 13.75px; color: var(--fg-80); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; font-size: 10px; line-height: 12.5px; white-space: nowrap; }
.pull-rarity { flex-shrink: 0; font-weight: 500; }
.pull-value { min-width: 0; color: var(--fg-70); overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pull-user { display: flex; align-items: center; min-width: 0; margin-top: 2px; font-size: 9px; line-height: 13.5px; color: rgba(255, 255, 255, 0.6); }
.pull-user > a, .pull-user > span {
  display: flex; align-items: center; min-width: 24px; min-height: 24px; margin-block: -5.25px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-fast) var(--ease);
}
.pull-user > a:hover { color: var(--accent-bright); text-decoration: underline; }
.pull-sk { display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 218px; height: 58px; padding: 6px; border: 1px solid var(--fg-10); border-radius: 8px; background: rgba(0, 0, 0, 0.25); animation: pulse 2s var(--ease-pulse) infinite; }
.pull-sk-thumb { width: 34px; height: 56px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.pull-sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-right: 8px; }
.pull-sk-lines > span { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.pull-sk-lines > span:first-child { width: 80%; height: 10px; background: rgba(255, 255, 255, 0.08); }
.pull-sk-lines > span:nth-child(2) { width: 60%; }
.pull-sk-lines > span:nth-child(3) { width: 40%; background: rgba(255, 255, 255, 0.05); }
.pulls-empty {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; min-height: 78px; padding: 0 16px;
  font-size: 11px; line-height: 16px; color: rgba(255, 255, 255, 0.6); text-align: center;
}
.pulls-retry { display: inline-flex; align-items: center; min-height: 24px; padding: 0 4px; color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }

/* ───────────── content container, list, selector (2, 3.3, 3.4) ───────────── */
.packs-wrap { position: relative; display: flex; flex-direction: column; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 16px 16px 96px; }
@media (min-width: 1024px) { .packs-wrap { flex-direction: row; } }
.packs-col { flex: 1; min-width: 0; }

.packs-aside { display: none; }
@media (min-width: 1024px) {
  .packs-aside { display: block; position: sticky; top: 16px; flex-shrink: 0; width: 240px; height: fit-content; }
}
.packs-nav { display: flex; flex-direction: column; gap: 20px; }
.pack-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px; }
.pack-cat-head > img { width: 24px; height: 24px; object-fit: contain; }
.pack-cat-head > span { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.025em; color: rgba(255, 255, 255, 0.9); }
.pack-rows { display: flex; flex-direction: column; gap: 6px; }
.pack-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 8px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pack-row:hover { border-color: var(--fg-20); background: var(--fg-3); }
.pack-row[aria-current="true"] { border-color: var(--fg-25); background: var(--card); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.pack-row-thumb { flex-shrink: 0; width: 32px; height: 56px; overflow: hidden; background: rgba(0, 0, 0, 0.4); }
.pack-row-thumb > img { width: 100%; height: 100%; object-fit: fill; }
.pack-row-text { display: block; min-width: 0; }
.pack-row-name { display: block; font-size: 14px; line-height: 17.5px; color: var(--fg-85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-row-price { display: block; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.packs-select-wrap { width: 60%; max-width: 240px; min-width: 0; }
@media (min-width: 1024px) { .packs-select-wrap { display: none; } }
.packs-select {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 42px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--card);
  transition: border-color var(--dur-fast) var(--ease);
}
.packs-select:hover { border-color: var(--fg-25); }
.packs-select-label { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.packs-select-label .dim, .packs-opt .dim { color: rgba(255, 255, 255, 0.6); }
.packs-select > svg { width: 16px; height: 16px; flex-shrink: 0; color: rgba(255, 255, 255, 0.6); transition: transform var(--dur-fast) var(--ease); }
.packs-select[aria-expanded="true"] > svg { transform: rotate(180deg); }
/* The menu opens in the flow (it pushes the stage down) so it never covers page content. */
.packs-menu {
  margin-top: 8px; max-height: 60vh; overflow-y: auto; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-surface); background: var(--card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); animation: fade-in-plain 150ms ease-out;
}
.packs-menu-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px; font-size: 10px; line-height: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.6); }
.packs-menu-head > img { width: 16px; height: 16px; object-fit: contain; }
.packs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 8px 10px; text-align: left;
  border-radius: var(--radius-lg); font-size: 14px; line-height: 20px; color: var(--muted);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.packs-opt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.packs-opt > svg { width: 16px; height: 16px; flex-shrink: 0; }
.packs-opt:hover { background: var(--fg-5); color: var(--fg); }
.packs-opt[aria-selected="true"] { background: rgba(255, 255, 255, 0.08); color: var(--fg); }

/* ───────────── recovery prompt and error banner ───────────── */
.recovery { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: rgba(20, 20, 20, 0.9); padding: 12px 16px; }
.recovery-head { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 600; }
.recovery-head > svg { width: 16px; height: 16px; color: var(--accent-bright); flex-shrink: 0; }
.recovery-sub { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); }
.recovery-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.recovery-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.recovery-thumb { width: 20px; height: 35px; flex-shrink: 0; object-fit: contain; }
.recovery-text { flex: 1 1 160px; min-width: 0; }
.recovery-name { display: block; font-size: 13px; line-height: 18px; font-weight: 500; overflow-wrap: anywhere; }
.recovery-when { display: block; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.recovery-when.is-late { color: #fca5a5; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.open-error {
  margin: 12px auto 0; max-width: 576px; padding: 12px 16px; text-align: center;
  border: 1px solid rgba(248, 113, 113, 0.2); border-radius: var(--radius-xl); background: rgba(69, 10, 10, 0.55);
  font-size: 14px; line-height: 20px; color: #fecaca; overflow-wrap: anywhere;
}
@media (min-width: 768px) { .open-error { margin-inline: 0; } }

/* ───────────── hero, stage (3.5, 3.6) ───────────── */
.hero { display: grid; align-items: center; gap: 16px; padding: 8px 0; }
@media (min-width: 768px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.stage-col { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }
.stage-glow {
  position: absolute; left: 50%; top: 50%; z-index: -1; width: 340px; height: 340px; border-radius: 50%;
  transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.045); filter: blur(70px); pointer-events: none;
}
.stage { position: relative; width: 100%; height: 350px; }
@media (min-width: 640px) { .stage { height: 380px; } }
.stage-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  opacity: 0.5; filter: blur(22px) brightness(0.5) saturate(0.75);
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
}
.stage-flames {
  position: absolute; left: 50%; top: 50%; z-index: 0; width: min(92%, 430px); height: min(96%, 390px);
  transform: translate(-50%, -48%); filter: blur(26px); opacity: 0.33; pointer-events: none;
}
.stage-flames > span {
  position: absolute; left: 50%; bottom: 4%; width: 46%; height: 72%;
  border-radius: 48% 52% 42% 58% / 72% 70% 30% 28%; transform-origin: 50% 100%;
  background: linear-gradient(to top, var(--aura-primary), color-mix(in srgb, var(--aura-secondary) 62%, transparent) 58%, transparent 90%);
  animation: pack-scene-aura 5.8s ease-in-out infinite alternate;
}
.stage-flames > span:nth-child(1) { animation-delay: -3.4s; transform: translate(-108%) rotate(-12deg) scale(0.72); }
.stage-flames > span:nth-child(2) { animation-duration: 7.2s; transform: translate(-50%) scale(0.82, 1.12); }
.stage-flames > span:nth-child(3) { animation-duration: 6.6s; animation-delay: -1.8s; transform: translate(8%) rotate(12deg) scale(0.7); }
@keyframes pack-scene-aura { 0% { opacity: 0.42; translate: 0 6%; scale: 0.92 1; } to { opacity: 0.78; translate: 0 -3%; scale: 1.05 1.08; } }
.stage-canvas { position: absolute; inset: 0; z-index: 5; }
.stage-canvas > canvas { display: block; width: 100% !important; height: 100% !important; touch-action: pan-y; }
.stage-spin { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; pointer-events: none; }
.stage-spin > span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-bright); animation: spin 1s linear infinite; }
.stage-flat {
  position: absolute; left: 50%; top: 50%; z-index: 5; height: 80%; width: auto; aspect-ratio: 4 / 7; object-fit: contain;
  transform: translate(-50%, -50%); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
  animation: stage-float 5.7s ease-in-out infinite alternate;
}
@keyframes stage-float { from { transform: translate(-50%, -49%) rotate(-1.5deg); } to { transform: translate(-50%, -51%) rotate(1.5deg); } }

/* ───────────── info panel (3.7) ───────────── */
.panel { min-width: 0; container: panel / inline-size; }
.panel-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 1px var(--fg-10); font-size: 12px; line-height: 16px; font-weight: 500;
}
.panel-chip > img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.panel-title { margin-top: 8px; font-size: 30px; line-height: 30px; font-weight: 600; letter-spacing: -0.75px; overflow-wrap: anywhere; }
.panel-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.panel-chain > svg { width: 14px; height: 14px; flex-shrink: 0; }
.panel-contract {
  display: flex; align-items: center; min-height: 24px; margin-block: -4px; font-weight: 500; color: var(--fg-80);
  text-decoration: underline; text-decoration-color: var(--fg-30); text-underline-offset: 2px; font-variant-numeric: tabular-nums;
}
.panel-contract:hover { color: var(--fg); }
.odds { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.odds-row { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 12px; line-height: 16px; }
.odds-label { width: 112px; flex-shrink: 0; min-width: 0; }
.odds-name { font-weight: 500; }
.odds-range { font-size: 10px; line-height: 13.33px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odds-track { flex: 1; min-width: 0; height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--fg-10); }
.odds-fill { display: block; height: 100%; border-radius: var(--radius-pill); transition: width 300ms var(--ease); }
.odds-pct { width: 40px; flex-shrink: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg-70); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; row-gap: 12px; }
@container panel (min-width: 460px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 16px; } }
.stat { min-width: 0; }
.stat-value {
  display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 18px; line-height: 28px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.stat-value.is-accent { color: var(--accent-bright); }
.stat-value > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stat-unit { flex-shrink: 0; font-size: 12px; font-weight: 500; opacity: 0.8; }
.stat-value > img { width: 18px; height: 18px; flex-shrink: 0; border-radius: 22%; object-fit: cover; }
.stat-sub { font-size: 11px; line-height: 16px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 1px; font-size: 10px; line-height: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verified { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.6); }
.verified > svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); }
.verified-label { font-weight: 500; color: rgba(255, 255, 255, 0.75); }
.verified-info {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -4px -5px;
  border-radius: 50%; color: rgba(255, 255, 255, 0.5); transition: color var(--dur-fast) var(--ease);
}
.verified-info:hover, .verified-info[aria-expanded="true"] { color: rgba(255, 255, 255, 0.85); }
.verified-info > svg { width: 14px; height: 14px; }
/* traded's tooltip box, opened in the flow under the row so it never covers the button below */
.verified-pop {
  margin-top: 10px; max-width: 256px; padding: 12px; border: 1px solid var(--fg-10); border-radius: var(--radius-lg);
  background: var(--tooltip-bg); box-shadow: var(--shadow-xl); font-size: 11px; line-height: 17.875px; color: rgba(255, 255, 255, 0.72);
  overflow-wrap: anywhere; animation: fade-in-plain 150ms ease-out;
}
.panel-note { margin-top: 10px; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.6); overflow-wrap: anywhere; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 28px; }
@media (min-width: 768px) { .cta-row { justify-content: flex-start; } }
.open-btn .open-price { opacity: 0.6; font-variant-numeric: tabular-nums; }
.open-btn[aria-busy="true"] { cursor: wait; }
.open-btn > .spinner { width: 16px; height: 16px; flex-shrink: 0; }
.cta-reason { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; margin-top: 10px; font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.cta-reason > svg { width: 14px; height: 14px; flex-shrink: 0; }
@media (min-width: 768px) { .cta-reason { justify-content: flex-start; text-align: left; } }
.cta-reason .btn-link { font-size: 12px; line-height: 16px; }

/* ───────────── Top Grails (3.8) and its modal (3.9) ───────────── */
.grails-wrap { margin-top: 24px; }
.grails { padding: 32px 0; }
.grails-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; min-width: 0; }
.grails-title { min-width: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.6px; }
.grails-all {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 34px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-control); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.grails-all:hover { border-color: var(--fg-25); color: var(--fg); }
.grails-all:disabled { opacity: 0.4; pointer-events: none; }
.grails-all > svg { width: 14px; height: 14px; }
.grails-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grails-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grails-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grail-sk { aspect-ratio: 1 / 1.68; border-radius: var(--radius-lg); background: var(--fg-5); animation: pulse 2s var(--ease-pulse) infinite; }
.grail { display: block; min-width: 0; text-align: left; transition: transform 200ms var(--ease); animation: grail-in 0.4s ease both; }
@keyframes grail-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.grail-card {
  position: relative; display: block; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--bg); transition: border-color var(--dur-fast) var(--ease); container-type: inline-size;
}
.grail-media { display: block; width: 100%; aspect-ratio: 1 / 1.68; overflow: hidden; background: var(--secondary); }
.grail-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease); }
.grail-meta { display: block; padding: 6px 8px; }
.grail-title { display: block; font-size: 11px; line-height: 13.75px; color: var(--fg-75, rgba(255, 255, 255, 0.75)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grail-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; margin-top: 2px; }
.grail-value { min-width: 0; font-size: 12px; line-height: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grail-rarity { flex-shrink: 0; font-size: 10px; line-height: 15px; font-weight: 500; }
@container (max-width: 139.98px) { .grail-row { flex-wrap: wrap; row-gap: 0; } }
.grail-usd { display: none; font-size: 10px; line-height: 14px; color: rgba(255, 255, 255, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
@container (min-width: 150px) { .grail-usd { display: block; } }
@media (hover: hover) {
  .grail:hover { transform: translateY(-4px); }
  .grail:hover .grail-card { border-color: var(--fg-25); }
  .grail:hover .grail-media > img { transform: scale(1.05); }
}
.grails-modal { z-index: 80; padding: 12px; }
@media (min-width: 640px) { .grails-modal { padding: 32px; } }
.grails-modal .modal-overlay { background: rgba(0, 0, 0, 0.75); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.grails-modal .grails-dialog {
  display: flex; flex-direction: column; width: 100%; max-width: 1024px; max-height: 88vh; overflow: hidden;
  border-radius: var(--radius-surface); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}
.grails-dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
@media (min-width: 640px) { .grails-dhead { padding: 16px 24px; } }
.grails-dtitle { font-size: 18px; line-height: 18px; font-weight: 600; letter-spacing: -0.45px; }
.grails-dsub { margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.grails-close {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-control); color: var(--muted);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.grails-close:hover { background: var(--fg-5); color: var(--fg); }
.grails-close > svg { width: 16px; height: 16px; }
.grails-dbody { min-height: 0; overflow-y: auto; padding: 16px; }
@media (min-width: 640px) { .grails-dbody { padding: 24px; } }
.grails-dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grails-dgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .grails-dgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grails-dgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.grail-plain { display: block; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .aura-flame, .stage-flames > span, .pulls-track, .aura-dust > i, .stage-flat, .grail { animation: none !important; }
  .grail:hover { transform: none; }
}

/* ───────────── opening overlay (pack-opening.md 3.9 to 3.12) ───────────── */
html.po-lock { overflow: hidden; }
.po-root {
  --pack-primary: #2a9e65; --pack-secondary: #8bc4a5; --pack-atmosphere: #01331d;
  --result-primary: #64748b; --result-secondary: #94a3b8;
  position: fixed; inset: 0; z-index: 100; isolation: isolate; overflow: hidden; color: var(--fg);
  background: radial-gradient(circle at 50% 52%, var(--pack-atmosphere) 0%, #030303 48%, #000 100%);
}
.po-root:focus { outline: none; }
.po-atmo {
  position: fixed; inset: 0; pointer-events: none; opacity: 0.42;
  background: radial-gradient(circle at 50% 54%, color-mix(in srgb, var(--pack-primary) 13%, transparent), transparent 34%),
    radial-gradient(circle at 50% 54%, color-mix(in srgb, var(--pack-secondary) 8%, transparent), transparent 56%);
}
.po-flames { position: fixed; inset: 0; overflow: hidden; pointer-events: none; opacity: 0.68; }
.po-flames > span {
  position: absolute; left: 50%; bottom: -36vh; width: min(46vw, 620px); height: min(88vh, 880px);
  border-radius: 48% 52% 44% 56% / 76% 72% 28% 24%; transform-origin: 50% 100%;
  background: linear-gradient(to top, var(--pack-primary), color-mix(in srgb, var(--pack-secondary) 58%, transparent) 54%, transparent 86%);
  filter: blur(72px); mix-blend-mode: screen; opacity: 0.12; animation: po-flame 5.6s ease-in-out infinite alternate;
}
.po-flames > span:nth-child(1) { animation-delay: -3.8s; transform: translate(-96%) rotate(-12deg) scale(0.78); }
.po-flames > span:nth-child(2) { animation-duration: 7.4s; transform: translate(-50%) scale(0.68, 1.12); }
.po-flames > span:nth-child(3) { animation-duration: 6.8s; animation-delay: -2.1s; transform: translate(-4%) rotate(12deg) scale(0.74); }
@keyframes po-flame { 0% { opacity: 0.075; translate: 0 8%; scale: 0.92 1; } to { opacity: 0.17; translate: 0 -3%; scale: 1.04 1.08; } }
/* dust motes and result particles are box-shadow layers (one element per drift group, drawn by js/pack-open.js) */
.po-dust, .po-sparks { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.po-dust > i, .po-sparks > i { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border-radius: 999px; will-change: transform, opacity; }
.po-dust > i { opacity: 0.46; animation: po-drift var(--d, 6s) ease-in-out var(--dl, 0s) infinite alternate; }
@keyframes po-drift { to { opacity: 1; transform: translate(16px, -30px); } }
.po-sparks > i { opacity: 0.1; animation: po-spark var(--d, 6s) ease-in-out var(--dl, 0s) infinite; }
@keyframes po-spark { 0%, 100% { opacity: 0.1; transform: translateY(16px); } 48% { opacity: 1; transform: translate3d(var(--dx, 0px), -28px, 0); } }

.po-pills { position: fixed; top: 16px; right: 16px; z-index: 101; display: flex; align-items: center; gap: 8px; animation: fade-in 0.45s ease both; }
@media (min-width: 640px) { .po-pills { top: 24px; right: 24px; } }
.po-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--fg-15); background: rgba(0, 0, 0, 0.55); color: rgba(255, 255, 255, 0.78);
  font-size: 14px; line-height: 20px; font-weight: 500; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.po-pill > svg { width: 16px; height: 16px; flex-shrink: 0; }
.po-pill:hover { border-color: var(--fg-25); background: var(--fg-10); color: #fff; }
.po-close { border-color: var(--fg-20); background: rgba(38, 38, 38, 0.75); color: rgba(255, 255, 255, 0.86); }
.po-close:hover { background: rgba(64, 64, 64, 0.85); color: #fff; }
.po-points {
  position: fixed; left: 16px; top: 16px; z-index: 102; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 150px);
  padding: 6px 12px 6px 8px; border-radius: var(--radius-pill); border: 1px solid rgba(254, 230, 133, 0.25); background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  font-size: 12px; line-height: 16px; font-weight: 600; color: #fef3c6; animation: fade-in 0.45s ease both;
}
@media (min-width: 640px) { .po-points { left: 24px; top: 24px; } }
.po-points > img { width: 24px; height: 24px; flex-shrink: 0; border-radius: 22%; object-fit: cover; }
.po-points > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* opening: pack, rings, tear, preparing */
.po-stage { position: fixed; inset: 0; display: grid; place-items: center; padding: 0 16px; }
.po-blackout { position: fixed; inset: 0; z-index: 20; background: #000; opacity: 0; pointer-events: none; }
.po-pack { position: relative; }
.po-ring {
  position: absolute; left: 50%; top: 50%; z-index: -1; width: min(68vw, 520px); aspect-ratio: 1; border-radius: 999px; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--pack-primary) 42%, transparent); box-shadow: 0 0 42px color-mix(in srgb, var(--pack-primary) 9%, transparent);
  opacity: 0; transform: translate(-50%, -50%) scale(0.42); animation: po-arrival 1.55s cubic-bezier(0.16, 0.75, 0.2, 1) 0.2s both;
}
.po-ring-2 { border-color: color-mix(in srgb, var(--pack-secondary) 32%, transparent); animation-delay: 0.48s; }
@keyframes po-arrival { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); } 28% { opacity: 0.75; } to { opacity: 0; transform: translate(-50%, -50%) scale(1.15); } }
.po-tap {
  position: relative; display: block; width: 340px; max-width: 86vw; aspect-ratio: 250 / 340; border-radius: 24px;
  cursor: pointer; user-select: none; -webkit-user-select: none; outline: none;
  transition: filter 0.18s, transform 0.14s cubic-bezier(0.23, 1, 0.32, 1);
}
.po-tap:disabled { cursor: default; }
.po-tap:active:not(:disabled) { transform: scale(0.985); }
.po-tap:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 6px color-mix(in srgb, var(--pack-primary) 32%, transparent); }
.po-wrap { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 0.2s; }
.po-wrap.is-ready { opacity: 1; }
.po-canvas { position: absolute; inset: 0; display: block; }
.po-canvas > canvas { display: block; width: 100% !important; height: 100% !important; }
.po-flat {
  position: absolute; left: 50%; top: 50%; height: 89.4%; width: auto; aspect-ratio: 4 / 7; object-fit: contain;
  transform: translate(-50%, -50%); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)); animation: po-bob 2.86s ease-in-out infinite alternate;
}
@keyframes po-bob { from { translate: 0 -5px; } to { translate: 0 5px; } }
.po-rip {
  position: absolute; left: 18%; right: 18%; top: 11%; z-index: 10; height: 2px; border-radius: 999px; pointer-events: none;
  background: rgba(255, 255, 255, 0.96); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.72), 0 0 8px rgba(255, 255, 255, 0.45);
  opacity: 0; clip-path: inset(0 100% 0 0);
}
.po-spark {
  position: absolute; top: 10.3%; left: 18%; z-index: 10; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: #fff; filter: blur(4px); opacity: 0; transform: scale(0.55); pointer-events: none;
}
.po-caption {
  position: absolute; left: 0; right: 0; bottom: -40px; text-align: center; pointer-events: none;
  font-size: 10px; line-height: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.32em; color: rgba(255, 255, 255, 0.62);
}
.po-preparing { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 0 24px; pointer-events: none; }
.po-prep-inner { display: flex; flex-direction: column; align-items: center; max-width: 384px; text-align: center; pointer-events: auto; animation: po-prep-in 0.18s cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes po-prep-in { from { opacity: 0; transform: translateY(5px) scale(0.97); } to { opacity: 1; transform: none; } }
.po-bars { display: flex; align-items: center; gap: 7px; height: 42px; }
.po-bars > span {
  width: 5px; height: 28px; border-radius: 999px; background: var(--pack-primary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--pack-primary) 40%, transparent);
  animation: po-pulse 0.72s cubic-bezier(0.77, 0, 0.175, 1) infinite alternate;
}
.po-bars > span:nth-child(2) { background: color-mix(in srgb, var(--pack-primary) 55%, var(--pack-secondary)); animation-delay: -240ms; }
.po-bars > span:nth-child(3) { background: var(--pack-secondary); animation-delay: -480ms; }
@keyframes po-pulse { from { opacity: 0.25; transform: scaleY(0.45); } to { opacity: 1; transform: scaleY(1); } }
.po-prep-title { margin-top: 20px; font-size: 11px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.8); }
.po-prep-sub { margin-top: 8px; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.64); overflow-wrap: anywhere; }
.po-prep-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }
.po-prep-link > svg { width: 12px; height: 12px; }
.po-prep-error {
  margin-top: 20px; max-width: 384px; padding: 12px 16px; border-radius: var(--radius-xl);
  border: 1px solid rgba(248, 113, 113, 0.25); background: rgba(69, 10, 10, 0.75); font-size: 12px; line-height: 16px; color: #fee2e2; overflow-wrap: anywhere;
}
.po-prep-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

/* reveal bridge */
.po-bridge { position: fixed; inset: 0; overflow: hidden; perspective: 1400px; background: #020202; --reveal-color: #d6d3d1; --reveal-color-2: #78716c; }
.po-effects { position: absolute; inset: 0; z-index: 0; pointer-events: none; --rarity-bloom: 0.2; }
.po-effects::before {
  content: ""; position: absolute; inset: -18%; opacity: 0; filter: blur(28px);
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--reveal-color) 58%, transparent), transparent 54%);
  animation: po-bloom 2.4s cubic-bezier(0.16, 0.75, 0.2, 1) both;
}
.po-effects.rarity-uncommon { --rarity-bloom: 0.28; }
.po-effects.rarity-rare { --rarity-bloom: 0.4; }
.po-effects.rarity-epic { --rarity-bloom: 0.54; }
.po-beam {
  position: absolute; top: 50%; left: 50%; width: 3px; height: min(95vh, 760px); background: var(--reveal-color);
  filter: blur(12px); opacity: 0; transform-origin: 50%; animation: po-beam 2.15s ease-out both;
}
.po-beam.b1 { transform: translate(-50%, -50%) rotate(0deg); }
.po-beam.b2 { transform: translate(-50%, -50%) rotate(58deg); animation-delay: 70ms; }
.po-beam.b3 { transform: translate(-50%, -50%) rotate(-58deg); animation-delay: 0.13s; }
.rarity-common .po-beam.b2, .rarity-common .po-beam.b3, .rarity-uncommon .po-beam.b3 { display: none; }
.rarity-rare .po-beam { width: 5px; filter: blur(15px); }
.rarity-epic .po-beam { width: 8px; filter: blur(18px); }
@keyframes po-bloom { 0% { opacity: 0; transform: scale(0.62); } 24% { opacity: var(--rarity-bloom); } to { opacity: 0; transform: scale(1.18); } }
@keyframes po-beam { 0% { opacity: 0; } 20% { opacity: 0.62; } to { opacity: 0; } }
.po-layout {
  position: relative; z-index: 10; display: grid; align-items: center; width: 100%; max-width: 1024px; min-height: 100dvh;
  margin: 0 auto; padding: 80px 40px; grid-template-columns: minmax(190px, 280px) minmax(300px, 1fr); column-gap: clamp(2.5rem, 7vw, 5rem);
}
.po-cardzone { display: flex; justify-content: flex-end; }
.po-shell { position: relative; width: 256px; opacity: 0; transform-style: preserve-3d; }
.po-shell.is-ready { animation: po-back-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.po-shell.is-flipping { animation: po-back-flip 0.38s cubic-bezier(0.55, 0.05, 0.8, 0.2) both; }
.po-back {
  position: relative; width: 100%; aspect-ratio: 3 / 5; overflow: hidden; border-radius: 16px; border: 1px solid var(--fg-20); background: #08090b;
  transform-style: preserve-3d; box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 45px color-mix(in srgb, var(--reveal-color) 13%, transparent);
  animation: po-back-float 3.2s ease-in-out 0.48s infinite;
}
.po-back[data-anim="common"] { animation: po-common-card 0.72s ease-out both; }
.po-back[data-anim="uncommon"] { animation: po-uncommon-card 0.72s cubic-bezier(0.16, 1, 0.3, 1) both; }
.po-back[data-anim="rare"] { animation: po-rare-card 0.72s cubic-bezier(0.16, 1, 0.3, 1) both; }
.po-back[data-anim="epic"] { animation: po-epic-card 0.72s cubic-bezier(0.16, 1, 0.3, 1) both; }
.po-back-face { position: relative; display: grid; place-items: center; height: 100%; overflow: hidden; background: #0d0f12; }
.po-back-face::before, .po-back-face::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 78%; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px; transform: translate(-50%, -50%);
}
.po-back-face::after { width: 50%; }
.po-back-logo { position: relative; width: 80px; height: 80px; object-fit: contain; opacity: 0.8; }
.po-back-caption {
  position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: 9px; line-height: 13.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.28em; color: rgba(255, 255, 255, 0.62);
}
.po-traits { width: 100%; max-width: 576px; margin: 0 auto; }
@media (min-width: 1024px) { .po-traits { margin: 0; } }
.po-trait {
  display: grid; grid-template-columns: minmax(80px, 0.58fr) minmax(160px, 1fr); align-items: center; min-height: 104px;
  opacity: 0.18; filter: blur(4px); transform: translateX(14px);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.po-trait:not(:last-child) { border-bottom: 1px solid var(--fg-10); }
.po-trait.is-visible { opacity: 1; filter: none; transform: none; }
.po-trait-label { font-size: 14px; line-height: 20px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.26em; color: rgba(255, 255, 255, 0.62); }
.po-trait-value { min-width: 0; text-align: right; font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.po-trait-ph { display: inline-block; width: 24px; height: 2px; vertical-align: middle; background: var(--fg-30); }
@media (max-width: 1023.98px) { .po-shell { width: 208px; } .po-trait { min-height: 88px; } }
@media (max-width: 767.98px) {
  .po-layout { grid-template-columns: minmax(0, 1fr); row-gap: 36px; padding: 104px 20px 64px; }
  .po-cardzone { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; opacity: 0.52; filter: brightness(0.58) saturate(0.78); }
  .po-cardzone::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0 30%, #020202 78%); }
  .po-shell { width: min(72vw, 300px); }
  .po-back-caption { display: none; }
  .po-traits { padding: 6.4px 18.4px; }
  .po-trait { grid-template-columns: minmax(72px, 0.44fr) minmax(170px, 1fr); min-height: 92px; }
  .po-trait:not(:last-child) { border-bottom: 0; }
}
@media (max-width: 639.98px) {
  .po-trait-label { font-size: 12px; line-height: 16px; }
  .po-trait-value { font-size: 36px; line-height: 40px; }
}
@keyframes po-back-enter { from { opacity: 0; filter: blur(12px); transform: translateY(48px) rotateY(-28deg) scale(0.78); } to { opacity: 1; filter: blur(0); transform: translateY(0) rotateY(0) scale(1); } }
@keyframes po-back-float { 0%, 100% { transform: translateY(0) rotateY(-2deg) rotateX(1deg); } 50% { transform: translateY(-10px) rotateY(2deg) rotateX(-1deg); } }
@keyframes po-back-flip { from { opacity: 1; filter: blur(0); transform: rotateY(0) scale(1); } to { opacity: 0; filter: blur(4px); transform: rotateY(-92deg) scale(1.08); } }
@keyframes po-common-card { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-4px) scale(1.01); } to { transform: translateY(0) scale(1); } }
@keyframes po-uncommon-card { 0% { transform: rotateY(0) translateY(0); } 38% { transform: rotateY(11deg) translateY(-8px); } 72% { transform: rotateY(-5deg) translateY(-4px); } to { transform: rotateY(0) translateY(0); } }
@keyframes po-rare-card { 0% { transform: translateY(0) scale(1); } 22% { transform: translateY(-18px) scale(1.055); } 42% { transform: translateY(-12px) scale(1.035); } to { transform: translateY(0) scale(1); } }
@keyframes po-epic-card { 0% { filter: brightness(1); transform: translateY(0) rotateY(0) scale(1); } 30% { filter: brightness(1.35); transform: translateY(-30px) rotateY(8deg) scale(1.09); } 58% { filter: brightness(1.18); transform: translateY(-24px) rotateY(-6deg) scale(1.075); } to { filter: brightness(1); transform: translateY(0) rotateY(0) scale(1); } }

/* result */
.po-scroll { position: absolute; left: 0; right: 0; top: 72px; bottom: 0; overflow-y: auto; overscroll-behavior: contain; }
.po-center { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 0 16px 48px; }
.po-result-bloom {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.68;
  background: radial-gradient(circle at 28% 48%, color-mix(in srgb, var(--result-primary) 22%, transparent), transparent 34%),
    radial-gradient(circle at 72% 46%, color-mix(in srgb, var(--result-secondary) 14%, transparent), transparent 38%);
  animation: po-breathe 6.8s ease-in-out infinite alternate;
}
@keyframes po-breathe { from { opacity: 0.48; transform: scale(0.94); } to { opacity: 0.78; transform: scale(1.08); } }
.po-result {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; max-width: 768px;
  padding: 0 4px; animation: fade-in 0.4s ease both;
}
@media (min-width: 768px) { .po-result { flex-direction: row; gap: 40px; padding: 0 20px; } }
.po-card-wrap { position: relative; z-index: 10; flex-shrink: 0; width: min(58vw, 14rem); }
@media (min-width: 640px) { .po-card-wrap { width: 224px; } }
@media (min-width: 768px) { .po-card-wrap { width: 240px; } }
.po-frame {
  position: relative; z-index: 10; padding: 2px; border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--result-primary) 74%, white 10%), color-mix(in srgb, var(--result-secondary) 58%, rgba(255, 255, 255, 0.22)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 18px color-mix(in srgb, var(--result-primary) 24%, transparent);
  filter: drop-shadow(0 0 46px color-mix(in srgb, var(--result-primary) 31%, transparent));
}
@property --po-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.po-frame::before {
  content: ""; position: absolute; inset: 0; padding: 2px; border-radius: inherit; opacity: 0.96; pointer-events: none;
  background: conic-gradient(from var(--po-angle), transparent 0deg 270deg, color-mix(in srgb, var(--result-primary) 82%, transparent) 294deg, #fff 312deg, var(--result-secondary) 326deg, transparent 348deg 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: po-orbit 6.4s linear infinite;
}
@keyframes po-orbit { to { --po-angle: 360deg; } }
.po-card-img { position: relative; aspect-ratio: 1 / 1.68; overflow: hidden; border-radius: 16px; background: var(--bg); }
.po-card-img > img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; animation: po-card-flip 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes po-card-flip { 0% { opacity: 0; transform: rotateY(90deg) scale(0.9); } 60% { opacity: 1; transform: rotateY(-8deg) scale(1.02); } to { transform: rotateY(0) scale(1); } }
.po-info { position: relative; z-index: 10; display: flex; flex: 1; flex-direction: column; align-items: center; width: 100%; min-width: 0; }
@media (min-width: 768px) { .po-info { align-items: flex-start; } }
.po-rarity { display: inline-flex; align-items: center; border: 1px solid currentColor; border-radius: var(--radius-pill); padding: 4px 14px; font-size: 12px; line-height: 16px; font-weight: 600; }
.po-rarity.is-below { display: none; margin-top: 12px; }
@media (min-width: 768px) { .po-rarity.is-top { display: none; } .po-rarity.is-below { display: inline-flex; } }
.po-eyebrow { display: none; font-size: 11px; line-height: 16.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.32em; color: rgba(255, 255, 255, 0.62); }
@media (min-width: 768px) { .po-eyebrow { display: block; } }
.po-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; margin-top: 8px; }
.po-title { min-width: 0; font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -0.025em; overflow-wrap: anywhere; text-align: left; }
@media (min-width: 640px) { .po-title { font-size: 24px; line-height: 30px; } }
.po-dl {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--fg-15); background: var(--fg-5); color: rgba(255, 255, 255, 0.72);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.po-dl:hover { background: var(--fg-10); color: #fff; }
.po-dl:disabled { opacity: 0.5; }
.po-dl > svg { width: 16px; height: 16px; }
.po-table { width: 100%; margin-top: 16px; border-block: 1px solid var(--fg-10); font-size: 14px; line-height: 20px; }
.po-table > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 8px 0; }
.po-table > div + div { border-top: 1px solid var(--fg-10); }
.po-table dt { flex-shrink: 0; color: rgba(255, 255, 255, 0.62); }
.po-table dd { min-width: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.po-table dd .dim { color: rgba(255, 255, 255, 0.62); font-weight: 400; }
.po-deadline { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin-top: 12px; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.72); text-align: left; font-variant-numeric: tabular-nums; }
.po-deadline > svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.po-deadline.is-late { color: #fca5a5; }
.po-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 16px; }
.po-primary {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 12px 16px;
  overflow: hidden; border-radius: 8px; color: #fff; font-size: 14px; line-height: 20px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--result-primary) 38%, rgba(255, 255, 255, 0.12));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)), color-mix(in srgb, var(--result-primary) 8%, #0b0b0b);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), 0 0 22px color-mix(in srgb, var(--result-primary) 10%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s, border-color 0.3s, opacity 0.3s;
}
.po-primary::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translate(-120%);
  background: linear-gradient(110deg, transparent 28%, color-mix(in srgb, var(--result-primary) 18%, transparent) 50%, transparent 72%);
  transition: transform 0.76s cubic-bezier(0.16, 1, 0.3, 1);
}
.po-primary > * { position: relative; z-index: 1; }
.po-primary > svg { width: 16px; height: 16px; flex-shrink: 0; color: rgba(255, 255, 255, 0.6); transition: transform 0.3s, color 0.3s; }
@media (hover: hover) {
  .po-primary:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); border-color: color-mix(in srgb, var(--result-primary) 58%, rgba(255, 255, 255, 0.18)); }
  .po-primary:hover:not(:disabled):not([aria-disabled="true"])::before { transform: translate(120%); }
  .po-primary:hover:not(:disabled):not([aria-disabled="true"]) > svg { transform: translateX(2px); color: #fff; }
}
.po-primary:active:not(:disabled) { transform: scale(0.985); }
.po-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.po-secondary {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 46px; padding: 8px 12px;
  border: 1px solid var(--fg-15); border-radius: 8px; background: rgba(255, 255, 255, 0.04);
  font-size: 14px; line-height: 18px; font-weight: 500; color: rgba(255, 255, 255, 0.82); text-align: center; text-wrap: balance;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.po-secondary > span { min-width: 0; overflow-wrap: anywhere; }
.po-secondary.is-full { width: 100%; }
@media (hover: hover) { .po-secondary:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--fg-25); background: rgba(255, 255, 255, 0.08); color: #fff; } }
.po-primary:disabled, .po-secondary:disabled { cursor: wait; opacity: 0.35; }
.po-primary[aria-disabled="true"], .po-secondary[aria-disabled="true"] { cursor: not-allowed; opacity: 0.45; }
.po-spin { width: 16px; height: 16px; flex-shrink: 0; animation: spin 1s linear infinite; }
.po-reason { font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.66); text-align: left; overflow-wrap: anywhere; }
.po-done {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid rgba(47, 191, 115, 0.3); background: rgba(47, 191, 115, 0.1); font-size: 14px; line-height: 20px; color: var(--accent-highlight); text-align: center;
}
.po-done > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-bright); }
.po-err { font-size: 12px; line-height: 16px; color: #fca5a5; text-align: center; overflow-wrap: anywhere; }
.po-verify { display: flex; justify-content: flex-end; }
.po-verify > a { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; font-size: 12px; line-height: 16px; color: var(--muted); }
.po-verify > a:hover { color: var(--fg); }
.po-verify > a > svg { width: 12px; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .po-flames > span, .po-ring, .po-prep-inner, .po-bars > span, .po-shell, .po-back, .po-trait, .po-effects::before, .po-beam,
  .po-result-bloom, .po-dust > i, .po-sparks > i, .po-frame::before, .po-flat, .po-card-img > img { animation: none !important; }
  .po-ring { display: none; }
  .po-shell { opacity: 1; }
}
