/* Pacote universal e abertura. Nada aqui depende de obra ou personagem. */

/* ---------- Pacote ---------- */
.pack { --pk: var(--skin-pk, #dfb267); position: relative; display: block; width: var(--pack-w, 198px); aspect-ratio: 2 / 3; }
.pack-glow {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 34px 60px -10px #000d, 0 0 48px color-mix(in srgb, var(--pk) 24%, transparent);
  transition: box-shadow .6s, opacity .4s;
}
.pack-half { position: absolute; inset: 0; display: block; }/* A face e sua luz usam exatamente o mesmo encaixe e acompanham cada metade. */
.pack-illustration, .pack-foil-mask { position: absolute; inset: 0; pointer-events: none; }
.pack-illustration { background: var(--pack-art) center / contain no-repeat; }
.pack-foil-mask { display: none; }
@supports (mask-image: url("")) or (-webkit-mask-image: url("")) {
  .pack-foil-mask {
    display: block;
    -webkit-mask: var(--pack-art) center / contain no-repeat;
    mask: var(--pack-art) center / contain no-repeat;
  }
}
.pack-l { clip-path: inset(-4% calc(50% - .4px) -4% -4%); }
.pack-r { clip-path: inset(-4% -4% -4% calc(50% - .4px)); }
.pack-face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  color: var(--pk);
  border: 1px solid color-mix(in srgb, var(--pk) 68%, #262e32);
  background:
    repeating-linear-gradient(135deg, transparent 0 7px, #ffffff05 7px 8px),
    radial-gradient(circle at 50% 44%, var(--skin-a, #28363a) 0%, var(--skin-b, #131a1d) 55%, var(--skin-c, #0c1114) 100%);
  box-shadow: inset 0 0 0 1px #ffffff14, inset 0 0 42px #000a;
  transition: color .6s, border-color .6s;
}
.pack-face svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; fill: none; stroke-width: 1; }
.pack-star { filter: drop-shadow(0 0 8px currentColor); }
.pack-face::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .7s; pointer-events: none; }
.pack-sheen {
  position: absolute;
  inset: -20% -80%;
  background: linear-gradient(112deg, transparent 44%, #ffffff0f 47%, #fff0d052 50%, #ffffff0f 53%, transparent 56%);
  transform: translateX(-42%);
  pointer-events: none;
}
.pack-seam {
  position: absolute;
  left: 50%;
  top: 3%;
  bottom: 3%;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(transparent, var(--pk) 20%, #fff 50%, var(--pk) 80%, transparent);
  box-shadow: 0 0 14px var(--pk);
  opacity: 0;
  transform: scaleY(0);
}

/* Antes do clique: flutuação, pulso de luz, brilho varrendo e partículas. Tudo neutro. */
.pack.idle { animation: pack-float 5.2s ease-in-out infinite; }
.pack.idle .pack-sheen { animation: pack-sheen 4.6s cubic-bezier(.5, 0, .3, 1) infinite; }
.pack.idle .pack-glow { animation: pack-pulse 3.4s ease-in-out infinite; }
.pack.idle .pack-star { animation: pack-star 3.4s ease-in-out infinite; }
@keyframes pack-float { 0%, 100% { transform: translateY(5px) rotate(-3.2deg); } 50% { transform: translateY(-9px) rotate(-1.2deg); } }
@keyframes pack-sheen { 0%, 30% { transform: translateX(-42%); } 70%, 100% { transform: translateX(42%); } }
@keyframes pack-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes pack-star { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }

.pack-button { position: relative; z-index: 1; display: grid; place-items: center; padding: 34px 60px; border-radius: 24px; transition: transform .3s var(--ease); }
.pack-button:hover { transform: scale(1.035); }
.pack-button:active { transform: scale(.98); }
.pack-button[aria-disabled="true"] .pack { filter: saturate(.3) brightness(.7); animation-play-state: paused; }
.pack-button[aria-disabled="true"] .pack *, .pack-button[aria-disabled="true"] .pack-motes i, .pack-button[aria-disabled="true"] .pack-aura { animation-play-state: paused; }
.pack-aura {
  position: absolute;
  inset: 4% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, #dfb2673d, #dfb2670f 55%, transparent);
  animation: aura-breathe 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aura-breathe { 0%, 100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
.pack-motes { position: absolute; inset: 0; pointer-events: none; }
.pack-motes i {
  position: absolute;
  left: var(--x);
  bottom: 12%;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #f4d392;
  box-shadow: 0 0 8px #f4d392;
  opacity: 0;
  animation: mote-rise var(--t) linear var(--d) infinite;
}
@keyframes mote-rise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: .8; } 80% { opacity: .35; } 100% { opacity: 0; transform: translateY(-230px) translateX(14px) scale(1); } }

/* ---------- Palco da abertura ---------- */
.opening {
  --tier: #dfb267;
  --pack-w: clamp(128px, min(44vw, 30dvh), 236px);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #11191c 0%, #070a0c 100%);
  isolation: isolate;
}
.opening::backdrop { background: #06080a; }
.opening[open] { display: block; animation: op-in .32s ease-out; }
@keyframes op-in { from { opacity: 0; } }
.opening::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 75% 65% at 50% 50%, color-mix(in srgb, var(--tier) 26%, transparent), transparent 72%);
  opacity: 0;
  transition: opacity .85s;
  pointer-events: none;
}
.opening:is([data-phase="signature"], [data-phase="burst"])::before { opacity: 1; }
.opening[data-phase="results"]::before { opacity: .68; }
.opening[data-tier="prism"] { --spectrum: linear-gradient(100deg, #ffd98a, #fff6e0 42%, #cdb8ff 76%, #a987ff); }
.opening[data-tier="prism"]::before { background: radial-gradient(ellipse 44% 56% at 50% 44%, #ffdc962e, transparent 70%), radial-gradient(ellipse 70% 46% at 50% 58%, #9b78ff2b, transparent 72%); }
/* Clarão cinemático no rompimento e transição para as cartas. */
.op-flash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--tier) 42%, #ffffff40) 0%, color-mix(in srgb, var(--tier) 22%, transparent) 38%, transparent 74%);
}
.opening[data-tier="prism"] .op-flash {
  background: radial-gradient(ellipse 16% 80% at 50% 48%, #fff4dc4d 0%, transparent 70%), radial-gradient(circle at 50% 50%, #ffe2a833 0%, #9b78ff24 36%, transparent 70%);
}
.opening[data-phase="burst"] .op-flash { animation: op-burst-flash .65s cubic-bezier(.18, .9, .3, 1) forwards; }
.opening[data-phase="results"]:not(.skipped) .op-flash { animation: op-reveal-flash .85s ease-out forwards; }
@keyframes op-burst-flash { 0% { opacity: 0; transform: scale(.86); } 16% { opacity: .62; transform: scale(1.04); } 100% { opacity: .16; transform: scale(1.16); } }
@keyframes op-reveal-flash { 0% { opacity: .3; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }
/* Cenário da viagem: fica atrás de tudo e ganha profundidade teatral quando as cartas aparecem. */
.op-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity .75s, filter .75s; }
.opening[data-phase="results"] .op-scene { opacity: .26; filter: saturate(.65) brightness(.85); }
.op-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
/* Camada de efeitos atrás do pacote (vem antes de .op-stage no DOM, com o mesmo z-index). */
.op-fx-back { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.op-top { position: absolute; inset: 0 0 auto 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left)); }
.op-mode { font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); }
.op-skip { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--soft); font-size: 13px; font-weight: 600; background: #12181bcc; transition: background .18s, border-color .18s; }
.op-skip:hover { background: #1d262b; border-color: var(--brass-line); color: var(--text); }
.op-stage { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.op-slot { width: var(--pack-w); aspect-ratio: 2 / 3; perspective: 900px; }
.op-pack { width: 100%; transition: transform .42s var(--ease), opacity .3s; will-change: transform; }
.op-signal {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + var(--pack-w) * .75 + 34px);
  z-index: 3;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(15px, 2.4vw, 20px);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--tier);
  text-shadow: 0 1px 3px #000c, 0 0 22px color-mix(in srgb, var(--tier) 60%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s, transform .5s var(--ease);
  pointer-events: none;
  padding: 0 16px;
}
.opening:is([data-phase="signature"], [data-phase="burst"]) .op-signal { opacity: 1; transform: none; }
.opening[data-phase="burst"] .op-signal { opacity: 0; transition-duration: .3s; }
.opening[data-tier="prism"] .op-signal { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }

/* Fases do pacote */
.opening[data-phase="signature"] .op-slot { animation: op-tremble-strong .3s linear infinite; }
@keyframes op-tremble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(.8px, -.6px) rotate(.25deg); } 50% { transform: translate(-.7px, .8px) rotate(-.2deg); } 75% { transform: translate(.5px, .6px) rotate(.15deg); } }
@keyframes op-tremble-strong { 0%, 100% { transform: scale(1.04) translate(0, 0) rotate(0); } 20% { transform: scale(1.04) translate(1.6px, -1.2px) rotate(.5deg); } 40% { transform: scale(1.05) translate(-1.5px, 1.4px) rotate(-.45deg); } 60% { transform: scale(1.05) translate(1.2px, 1.3px) rotate(.35deg); } 80% { transform: scale(1.04) translate(-1.3px, -1px) rotate(-.3deg); } }
.opening:is([data-phase="flight"], [data-phase="signature"], [data-phase="burst"]) .pack-sheen { animation: pack-sheen 1.1s cubic-bezier(.5, 0, .3, 1) infinite; }
.opening:is([data-phase="signature"], [data-phase="burst"]) .pack { --pk: var(--tier); }
/* Pacotes de tipo mantêm a própria cor na face; a raridade aparece no brilho em volta. */
.opening:not([data-skin="classico"]) .pack-face { color: var(--skin-pk); border-color: color-mix(in srgb, var(--skin-pk) 68%, #262e32); }
.opening:is([data-phase="signature"], [data-phase="burst"]) .pack-glow { box-shadow: 0 34px 60px -10px #000c, 0 0 70px color-mix(in srgb, var(--pk) 55%, transparent), 0 0 18px color-mix(in srgb, var(--pk) 60%, transparent); }
.opening[data-phase="signature"] .pack-seam { opacity: .95; transform: scaleY(1); transition: transform .9s cubic-bezier(.6, 0, .3, 1) .35s, opacity .4s .35s; }
.opening[data-phase="burst"] .pack-seam { opacity: 0; transform: scale(14, 1.1); transition: transform .5s ease-out, opacity .5s ease-out; }
.opening[data-phase="burst"] .pack-l { transform: translateX(-62%) rotate(-13deg); opacity: 0; transition: transform .52s cubic-bezier(.3, 0, .7, .4), opacity .42s ease-in .1s; }
.opening[data-phase="burst"] .pack-r { transform: translateX(62%) rotate(13deg); opacity: 0; transition: transform .52s cubic-bezier(.3, 0, .7, .4), opacity .42s ease-in .1s; }
.opening[data-phase="burst"] .pack-glow { opacity: 0; }
.opening[data-phase="results"] .op-stage { display: none; }

/* Como o pacote se parte, conforme o final (data-cut). O padrão 'v' é ao meio, acima. */
.opening[data-cut="diag"] .pack-l { clip-path: polygon(-4% -4%, 104% -4%, -4% 104%); }
.opening[data-cut="diag"] .pack-r { clip-path: polygon(104% -4%, 104% 104%, -4% 104%); }
.opening[data-cut="diag"] .pack-seam { transform: rotate(33.7deg) scaleY(0); }
.opening[data-cut="diag"][data-phase="signature"] .pack-seam { transform: rotate(33.7deg) scaleY(1.2); }
.opening[data-cut="diag"][data-phase="burst"] .pack-seam { transform: rotate(33.7deg) scale(14, 1.3); }
.opening[data-cut="diag"][data-phase="burst"] .pack-l { transform: translate(-36%, -24%) rotate(-9deg); }
.opening[data-cut="diag"][data-phase="burst"] .pack-r { transform: translate(36%, 24%) rotate(9deg); }
.opening[data-cut="h"] .pack-l { clip-path: inset(-4% -4% calc(50% - .4px) -4%); }
.opening[data-cut="h"] .pack-r { clip-path: inset(calc(50% - .4px) -4% -4% -4%); }
.opening[data-cut="h"] .pack-seam { transform: rotate(90deg) scaleY(0); }
.opening[data-cut="h"][data-phase="signature"] .pack-seam { transform: rotate(90deg) scaleY(.68); }
.opening[data-cut="h"][data-phase="burst"] .pack-seam { transform: rotate(90deg) scale(14, .8); }
.opening[data-cut="h"][data-phase="burst"] .pack-l { transform: translateY(-58%); }
.opening[data-cut="h"][data-phase="burst"] .pack-r { transform: translateY(58%); }
.opening[data-cut="blast"][data-phase="burst"] .pack-l { transform: translate(-105%, -34%) rotate(-42deg) scale(1.1); }
.opening[data-cut="blast"][data-phase="burst"] .pack-r { transform: translate(105%, -22%) rotate(48deg) scale(1.1); }

/* Rubi: o pacote ganha facetas vermelhas luminosas. */
.opening[data-tier="ruby"] .pack-face::after { background: linear-gradient(118deg, transparent 18%, #ffb6c430 18.500%, transparent 34%, transparent 52%, #ffb6c426 52.500%, transparent 70%), linear-gradient(62deg, transparent 30%, #ff6e8b22 30.500%, transparent 48%, transparent 66%, #ffd9e01f 66.500%, transparent 80%); }
.opening[data-tier="ruby"]:is([data-phase="signature"], [data-phase="burst"]) .pack-face::after { opacity: 1; }
.opening[data-tier="ruby"] .pack-seam { clip-path: polygon(50% 0, 100% 14%, 20% 30%, 100% 47%, 0 63%, 80% 80%, 50% 100%, 20% 80%, 100% 63%, 0 47%, 80% 30%, 0 14%); width: 8px; margin-left: -4px; }
/* Prisma: o pacote reflete o espectro. */
.opening[data-tier="prism"] .pack-face::after { background: linear-gradient(118deg, transparent 16%, #ffe2a855 34%, #ffffff66 48%, #b89cff55 64%, transparent 84%); mix-blend-mode: screen; }
.opening[data-tier="prism"]:is([data-phase="signature"], [data-phase="burst"]) .pack-face::after { opacity: .42; }
.opening[data-tier="prism"]:is([data-phase="signature"], [data-phase="burst"]) .pack-face { border-color: #f1dcff; color: #fff; }
.opening[data-tier="prism"] .pack-seam { background: linear-gradient(transparent, #b89cff, #ffe2a8, #fff, #ffe2a8, #b89cff, transparent); box-shadow: 0 0 16px #d6a8ff; }

/* ---------- Resultado ---------- */
.op-results { --gap: clamp(10px, 2.4vw, 34px); --cw: max(76px, min(252px, calc((100vw - 32px - 2 * var(--gap)) / 3), calc((100dvh - 332px) * .6667))); position: absolute; inset: 0; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(min-content, 1fr) auto; justify-items: center; gap: 12px; padding: max(62px, calc(env(safe-area-inset-top) + 54px)) 16px max(22px, env(safe-area-inset-bottom)); overflow: hidden auto; }
.op-results::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 64% 24% at 50% 60%, color-mix(in srgb, var(--tier) 16%, transparent), transparent 72%),
    radial-gradient(circle at 50% 42%, transparent 42%, #04060880 100%);
}
.opening[data-tier="prism"] .op-results::before {
  background:
    radial-gradient(ellipse 50% 24% at 50% 60%, #ffd9901c, transparent 74%),
    radial-gradient(ellipse 70% 30% at 50% 64%, #9b78ff1c, transparent 76%),
    radial-gradient(circle at 50% 42%, transparent 42%, #04060885 100%);
}
.op-head, .op-cards, .op-foot { position: relative; z-index: 1; }
.op-head { text-align: center; animation: res-fade .48s ease-out both; }
.op-kicker { font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--tier); text-shadow: 0 0 18px color-mix(in srgb, var(--tier) 45%, transparent); }
.opening[data-tier="prism"] .op-kicker { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; text-shadow: none; }
.op-title { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.2vw, 33px); margin-top: 6px; outline: 0; text-shadow: 0 4px 20px #000b; }
.op-cards { display: flex; align-items: flex-start; align-self: center; justify-content: center; gap: var(--gap); perspective: 1200px; width: 100%; min-width: 0; padding: 6px 0; }
.res { width: var(--cw); flex: 0 1 var(--cw); min-width: 0; text-align: center; }
.res.is-hero:not(.res-t0) { z-index: 2; }
.res-inspect { display: block; width: 100%; color: inherit; border: 0; padding: 0; background: none; text-align: inherit; }
.res-inspect:disabled { cursor: default; }
.res-inspect:focus-visible { outline: 3px solid var(--rarity); outline-offset: 7px; border-radius: 6px; }
.res-art { position: relative; aspect-ratio: 2 / 3; transform-style: preserve-3d; animation: res-in .66s cubic-bezier(.18, .92, .24, 1) both; animation-delay: calc(var(--i) * .15s + .05s); }
/* Camadas dentro de .res-art: aura e raios atrás, carta em foco, reflexo mascarado e cintilações nas bordas. */
.res-art > .card-visual { position: relative; z-index: 2; transition: transform .36s var(--ease), filter .36s var(--ease); }
.res-art:hover > .card-visual, .res-art:hover > .res-sheen, .res-art:hover > .res-glare { --hscale: 1.035; }
.res-art:hover > .card-visual { filter: drop-shadow(0 24px 34px #000d) drop-shadow(0 0 26px color-mix(in srgb, var(--rarity) 42%, transparent)); }
.res-art.tilting > .card-visual, .res-art.tilting > .res-sheen, .res-art.tilting > .res-glare { transition: transform .07s linear; }
.res-art > .card-visual, .res-sheen, .res-glare { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--hscale, 1)); }
/* Brilho por raridade: aura pulsante, raios suaves em camadas, onda de impacto e cintilações. */
.res { --aura: .26; --rays: 0; --spin: 26s; }
.res-t1 { --aura: .44; }
.res-t2 { --aura: .62; --rays: .46; --spin: 24s; }
.res-t3 { --aura: .78; --rays: .64; --spin: 18s; }
.res-t4 { --aura: .92; --rays: .82; --spin: 14s; }
.res-t5 { --aura: .98; --rays: .95; --spin: 10s; }
.res-art::before { content: ''; position: absolute; inset: -4% -6%; z-index: 0; background: var(--rarity); filter: blur(32px); opacity: var(--aura); border-radius: 34%; animation: aura-pulse 2.6s ease-in-out calc(var(--i) * .3s) infinite alternate; pointer-events: none; }
.res-t3 .res-art::before { inset: -6% -8%; }
.res-t4 .res-art::before { inset: -8% -10%; filter: blur(36px); }
.res-t5 .res-art::before { inset: -11% -13%; filter: blur(38px); background: radial-gradient(closest-side, #fff3d6, #ffd98a 42%, #a583ff 84%); animation: aura-pulse 2.4s ease-in-out infinite alternate; }
@keyframes aura-pulse { from { opacity: calc(var(--aura) * .55); scale: .93; } to { opacity: var(--aura); scale: 1.09; } }
@keyframes aura-turn { to { rotate: 1turn; } }
.res-rays {
  position: absolute; inset: -38% -56%; z-index: 0; border-radius: 50%; opacity: 0; pointer-events: none;
  background: var(--rarity);
  -webkit-mask:
    radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 45%, transparent 76%),
    repeating-conic-gradient(from -4deg, transparent 0deg, rgba(0, 0, 0, .75) 2.2deg, #000 4deg, rgba(0, 0, 0, .75) 5.8deg, transparent 8deg, transparent 14.5deg);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .55) 45%, transparent 76%),
    repeating-conic-gradient(from -4deg, transparent 0deg, rgba(0, 0, 0, .75) 2.2deg, #000 4deg, rgba(0, 0, 0, .75) 5.8deg, transparent 8deg, transparent 14.5deg);
  mask-composite: intersect;
  filter: blur(2.5px);
  animation: rays-in .85s ease-out calc(var(--i) * .15s + .28s) forwards, rays-spin var(--spin) linear infinite;
}
.res-t0 .res-rays, .res-t1 .res-rays { display: none; }
.res-t5 .res-rays { background: radial-gradient(closest-side, #fff4dc 0%, #ffd98a 34%, #b594ff 70%); }
@keyframes rays-in { from { opacity: 0; scale: .48; } to { opacity: var(--rays); scale: 1; } }
@keyframes rays-spin { to { rotate: 1turn; } }
/* Onda radial de aterrissagem (substitui a moldura retangular sem brigar com cartas recortadas). */
.res-ring {
  position: absolute; inset: 68% -42% -12%; z-index: 1; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rarity) 24%, transparent) 30%, color-mix(in srgb, var(--rarity) 70%, #ffffffb0) 64%, transparent 74%);
  animation: ring-out .75s cubic-bezier(.16, .88, .3, 1) calc(var(--i) * .15s + .3s) both;
}
.res-t0 .res-ring { opacity: .45; }
.res-t5 .res-ring { background: radial-gradient(closest-side, #ffffff20 26%, #ffe2a8a6 56%, #b594ffb8 67%, transparent 77%); }
@keyframes ring-out { 0% { opacity: .92; transform: scale(.42); } 100% { opacity: 0; transform: scale(1.3); } }
/* Órbitas com profundidade: um canvas atrás da carta e outro na frente (desenhados em gacha.js). */
.res-orb { position: absolute; left: -34%; top: -22%; width: 168%; height: 144%; pointer-events: none; }
.res-orb-b { z-index: 1; }
.res-orb-f { z-index: 4; }
.res-t3, .res-t4, .res-t5 { animation: res-float 4.2s ease-in-out calc(var(--i) * .38s + 1.05s) infinite; }
@keyframes res-float { 50% { transform: translateY(-7px); } }
.res-art img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 24px #000b); }
.res-sheen, .res-glare {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  -webkit-mask: var(--mask) center / 100% 100% no-repeat;
  mask: var(--mask) center / 100% 100% no-repeat;
}
.res-sheen { opacity: 0; background: linear-gradient(112deg, transparent 39%, #ffffff8c 50%, transparent 61%) no-repeat; background-size: 300% 100%; background-position: 130% 0; }
.res-t1 .res-sheen, .res-t2 .res-sheen { animation: res-sheen 1.1s ease-out calc(var(--i) * .15s + .52s) 1 both; }
.res-t3 .res-sheen { animation: res-sheen 3.5s ease-in-out calc(var(--i) * .15s + .52s) infinite both; }
.res-t4 .res-sheen { background-image: linear-gradient(112deg, transparent 38%, #ff8aa478 46%, #ffffffb0 50%, #ff8aa478 54%, transparent 62%); animation: res-sheen 2.8s ease-in-out calc(var(--i) * .15s + .52s) infinite both; }
.res-t5 .res-sheen { background-image: linear-gradient(112deg, transparent 35%, #ffe2a888 43%, #ffffffc0 50%, #b594ff88 57%, transparent 65%); animation: res-sheen 2.5s ease-in-out calc(var(--i) * .15s + .52s) infinite both; }
@keyframes res-sheen { 0% { opacity: 1; background-position: 130% 0; } 45%, 100% { opacity: 1; background-position: -30% 0; } }
.res-glare {
  opacity: 0; mix-blend-mode: screen; transition: opacity .25s ease-out;
  background: radial-gradient(circle 140px at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--rarity) 30%, #ffffff5c), transparent 72%);
}
.res-art.tilting .res-glare { opacity: .78; }
@keyframes res-in { 0% { opacity: 0; transform: translateY(50px) scale(.62) rotateY(72deg); } 65% { opacity: 1; transform: translateY(-4px) scale(1.03) rotateY(-3deg); } 100% { opacity: 1; transform: none; } }
/* SSR e UR: a carta desce da luz, estourada de brilho, e assenta. */
.res-t4 .res-art, .res-t5 .res-art { animation-name: res-in-hi; animation-duration: .82s; }
@keyframes res-in-hi { 0% { opacity: 0; transform: translateY(-30px) scale(1.4); filter: brightness(3.4) saturate(.3) blur(5px); } 36% { opacity: 1; filter: brightness(2.1) saturate(.6) blur(0); } 62% { transform: translateY(3px) scale(.985); filter: brightness(1.15); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes res-fade { from { opacity: 0; transform: translateY(8px); } }
.res figcaption { margin-top: 10px; animation: res-fade .4s ease-out both; animation-delay: calc(var(--i) * .14s + .28s); }
.res figcaption strong { display: block; font-size: clamp(12px, 1.6vw, 15px); font-weight: 700; line-height: 1.25; margin-top: 6px; color: var(--text); text-shadow: 0 2px 8px #000a; }
.res figcaption small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.res figcaption small b { color: var(--rarity); font-weight: 700; }
.res-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.res-badge.new { background: linear-gradient(180deg, #f4d392, #d4a152); color: var(--ink); box-shadow: 0 0 18px #dfb26770; }
.res-badge.dupe { border: 1px solid var(--line-strong); color: var(--soft); background: #131b1ecc; font-weight: 600; }
.res-badge.sample { border: 1px dashed #ffffff40; color: var(--muted); font-weight: 600; }
.op-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; animation: res-fade .45s ease-out .54s both; }
.op-summary { font-size: 13px; color: var(--soft); text-align: center; }
.op-extra:empty { display: none; }
.op-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.opening.skipped .res-art, .opening.skipped .res figcaption, .opening.skipped .op-foot, .opening.skipped .op-head { animation-duration: .25s; animation-delay: 0s; }
.opening.skipped .res-art { animation-name: res-fade; }
.opening.skipped .res-rays { animation-delay: .1s, 0s; }
.opening.skipped .res-ring { animation-delay: .08s; }

@media (max-width: 560px) {
  .op-results { --cw: max(76px, min(calc((100vw - 20px - 2 * var(--gap)) / 3), calc((100dvh - 350px) * .6667))); padding-left: 10px; padding-right: 10px; }
  .op-mode { font-size: 10px; letter-spacing: 1.2px; }
  .res figcaption small { font-size: 10px; }
  .res-badge { font-size: 10px; padding: 2px 7px; }
  .op-actions { width: 100%; }
  .op-actions > * { flex: 1 1 40%; padding: 0 10px; }
  .op-actions > .primary { flex-basis: 100%; order: -1; }
}
/* Paisagem baixa: cartas à esquerda, texto e ações à direita. */
@media (max-height: 540px) and (orientation: landscape) {
  .opening { --pack-w: clamp(96px, 34dvh, 170px); }
  .op-signal { top: auto; bottom: 14px; font-size: 14px; }
  .op-results { --cw: max(76px, min(19vw, calc((100dvh - 112px) * .6667))); grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: 26px; padding: 52px max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left)); }
  .op-cards { grid-column: 1; grid-row: 1 / 3; width: auto; --gap: 12px; }
  .op-head { grid-column: 2; grid-row: 1; text-align: left; align-self: end; justify-self: start; }
  .op-foot { grid-column: 2; grid-row: 2; align-items: flex-start; align-self: start; }
  .op-summary { text-align: left; }
  .op-actions { justify-content: flex-start; }
  .op-title { font-size: 22px; }
  .res figcaption small { display: none; }
}
.reduce-motion .op-pack, .reduce-motion .pack.idle { transform: none !important; }
.reduce-motion .op-flash, .reduce-motion .res-sheen, .reduce-motion .res-glare, .reduce-motion .res-ring, .reduce-motion .res-orb { display: none; }
.reduce-motion .res-rays { opacity: calc(var(--rays) * .7); }
.reduce-motion .res-art:hover > .card-visual { transform: none !important; filter: drop-shadow(0 18px 24px #000b); }
.reduce-motion .pack-motes { display: none; }
.reduce-motion .opening:is([data-phase="signature"], [data-phase="burst"]) .pack-seam { opacity: .9; transform: none; }
/* Revelação de uma carta só: ela ganha mais espaço. */
.res:only-child { width: max(120px, min(340px, 72vw, calc((100dvh - 300px) * .6667))); flex-basis: auto; }
/* Animação rápida: parte direto da costura/rompimento e preserva toda a aparição animada das cartas. */
.opening.is-fast[data-phase="signature"] .pack-seam { transition: transform .52s cubic-bezier(.6, 0, .3, 1) .04s, opacity .22s .04s; }
.opening.is-fast[data-phase="burst"] .pack-l,
.opening.is-fast[data-phase="burst"] .pack-r { transition: transform .42s cubic-bezier(.3, 0, .7, .4), opacity .34s ease-in .06s; }
.opening.is-fast .res-art { animation-duration: .54s; animation-delay: calc(var(--i) * .1s + .02s); }
.opening.is-fast .res-t4 .res-art,
.opening.is-fast .res-t5 .res-art { animation-duration: .66s; }
.opening.is-fast .res-rays { animation-delay: calc(var(--i) * .1s + .16s), 0s; }
.opening.is-fast .res-ring { animation-delay: calc(var(--i) * .1s + .18s); }
.opening.is-fast .res figcaption { animation-duration: .34s; animation-delay: calc(var(--i) * .09s + .16s); }
.opening.is-fast .op-head { animation-duration: .34s; }
.opening.is-fast .op-foot { animation-duration: .36s; animation-delay: .28s; }
