/* Sobres: pantalla de sobres, arte del sobre y animación de apertura. */

/* ---------- Sobre (js/ui/pack-art.js) ----------
   Todo mide en cqw del propio sobre: vale igual en la estantería que en el
   escenario de la apertura. Colores: --pk-a acento de la región, --pk-b fondo
   de la región, --pk-c / --pk-d tipos del Pokémon de portada. */

.pack {
  --zz: 4.6cqw;               /* ancho de un diente de los cierres */
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 35%;
  position: relative;
  width: var(--pk-w, 180px);
  aspect-ratio: 100 / 172;
  container-type: inline-size;
  flex: none;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
.pack.is-float { animation: pk-float 4.8s ease-in-out infinite; animation-delay: var(--float-delay, 0s); }
@keyframes pk-float {
  0%, 100% { translate: 0 0; rotate: -0.6deg; }
  50% { translate: 0 -2.4cqw; rotate: 0.8deg; }
}
.pack-tilt {
  position: absolute;
  inset: 0;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.pack.is-tilting .pack-tilt { transition-duration: 0.08s; }

/* Sombra en el suelo */
.pack-floor {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -7cqw;
  height: 9cqw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(2, 6, 20, 0.55), transparent);
}

/* Cuerpo: dientes abajo; arriba queda recto bajo la tira (al abrir, roto). */
.pack-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 9cqw;
  bottom: 0;
  overflow: hidden;
  border-radius: 1.6cqw 1.6cqw 0 0;
  background: var(--pk-b);
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--zz) / 2 + 1px) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom / var(--zz) calc(var(--zz) / 2) repeat-x;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--zz) / 2 + 1px) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom / var(--zz) calc(var(--zz) / 2) repeat-x;
}
.pack.is-open .pack-body {
  clip-path: polygon(0 3cqw, 6% 1.2cqw, 13% 3.4cqw, 21% 0.6cqw, 30% 2.8cqw, 38% 1cqw, 47% 3.2cqw, 55% 0.8cqw, 64% 2.6cqw,
    72% 0.4cqw, 81% 3cqw, 89% 1.2cqw, 100% 2.4cqw, 100% 100%, 0 100%);
}
.pack-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 47%, transparent 45%, rgba(4, 9, 26, 0.55) 100%),
    radial-gradient(70% 45% at 50% 47%, color-mix(in srgb, var(--pk-c) 70%, #fff) 0%, transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--pk-c) 85%, #fff) 0%, var(--pk-c) 30%, color-mix(in srgb, var(--pk-d) 55%, var(--pk-b)) 68%, var(--pk-b) 100%);
}
/* Rayos que salen de detrás del Pokémon */
.pack-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 190cqw;
  height: 190cqw;
  margin: -95cqw 0 0 -95cqw;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.2) 0deg 7deg, rgba(255, 255, 255, 0) 7deg 20deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.6) 45%, transparent 80%);
  mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.6) 45%, transparent 80%);
  animation: spin 40s linear infinite;
  mix-blend-mode: overlay;
}
/* Trama de puntos de cómic hacia los bordes */
.pack-dots {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.32) 34%, transparent 38%) 0 0 / 4.2cqw 4.2cqw;
  -webkit-mask: radial-gradient(75% 55% at 50% 47%, transparent 45%, #000 100%);
  mask: radial-gradient(75% 55% at 50% 47%, transparent 45%, #000 100%);
  opacity: 0.55;
}
.pack-glow {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 82cqw;
  height: 82cqw;
  margin: -41cqw 0 0 -41cqw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--pk-c) 55%, #fff) 30%, color-mix(in srgb, var(--pk-c) 40%, transparent) 62%, rgba(255, 255, 255, 0) 100%);
  opacity: 0.6;
}
.pack-mon {
  position: absolute;
  left: 0;
  right: 0;
  top: 22%;
  height: 52%;
  display: grid;
  place-items: center;
}
/* Contorno oscuro fino, sombra y halo claro: se separa de cualquier fondo. */
.pack-sprite {
  filter: drop-shadow(0 0 0.5cqw rgba(4, 9, 26, 0.7)) drop-shadow(0 1.2cqw 0 rgba(4, 9, 26, 0.4)) drop-shadow(0 0 3cqw rgba(255, 255, 255, 0.45));
}
.pack-spark {
  position: absolute;
  width: 4.5cqw;
  height: 4.5cqw;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 1.5cqw #fff);
  animation: pk-twinkle 2.6s ease-in-out infinite;
  opacity: 0;
}
@keyframes pk-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  40% { opacity: 1; transform: scale(1) rotate(45deg); }
  60% { opacity: 0.8; transform: scale(0.8) rotate(60deg); }
}

/* Banda de marca: logo de PokéMerge e insignia de generación */
.pack-brand {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4cqw 2cqw 18cqw;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pk-b) 65%, #000) 0%, color-mix(in srgb, var(--pk-b) 80%, transparent) 70%, transparent 100%);
}
.pack-brand::after {
  content: '';
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  bottom: 3.4cqw;
  height: 0.9cqw;
  border-radius: 1cqw;
  background: linear-gradient(90deg, transparent, var(--pk-a) 15%, #fff 50%, var(--pk-a) 85%, transparent);
  opacity: 0.85;
}
.pack-brand .logo { font-size: 13.2cqw; filter: drop-shadow(0 0.8cqw 0 rgba(4, 9, 26, 0.7)); }
.pack-brand .lt { animation: none; }
.pack-gen {
  position: absolute;
  left: 3cqw;
  top: 2.4cqw;
  width: 15cqw;
  height: 16.5cqw;
  filter: drop-shadow(0 0.8cqw 0 rgba(4, 9, 26, 0.6));
}
.pack-gen svg { display: block; width: 100%; height: 100%; font-family: var(--font); }

/* Banda del nombre, sobre el cierre de abajo */
.pack-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2cqw;
  padding: 7cqw 3cqw 3cqw;
  text-align: center;
  background: linear-gradient(0deg, color-mix(in srgb, var(--pk-b) 85%, #000) 0%, color-mix(in srgb, var(--pk-b) 75%, transparent) 62%, transparent 100%);
}
.pack-title {
  display: block;
  max-width: 100%;
  font-size: 10.5cqw;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 1.3cqw var(--edge-out);
  paint-order: stroke fill;
  text-shadow: 0 1.2cqw 0 rgba(4, 9, 26, 0.6);
}
.pack-count {
  display: inline-block;
  padding: 0.8cqw 4cqw 1.2cqw;
  border-radius: 99px;
  font-size: 6.4cqw;
  font-weight: 700;
  line-height: 1.1;
  color: #2a1a00;
  background: linear-gradient(180deg, #fff6c4, var(--pk-a));
  border: 0.9cqw solid var(--edge-out);
  box-shadow: inset 0 0.8cqw 0 rgba(255, 255, 255, 0.6);
}

/* Lámina holográfica y reflejo (siguen al puntero; solos, se pasean) */
.pack-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 22%, rgba(255, 90, 210, 0.55) 34%, rgba(90, 220, 255, 0.55) 44%,
      rgba(255, 250, 130, 0.55) 54%, rgba(120, 255, 170, 0.45) 62%, transparent 74%);
  background-size: 300% 300%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  opacity: 0.5;
}
.pack:not(.is-tilting) .pack-foil { animation: pk-foil 6.5s ease-in-out infinite; }
@keyframes pk-foil {
  0%, 100% { background-position: 0% 20%; }
  50% { background-position: 100% 80%; }
}
.pack-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0) 11%, rgba(255, 255, 255, 0.12) 22%, rgba(255, 255, 255, 0) 32%,
      rgba(255, 255, 255, 0) 80%, rgba(0, 0, 0, 0.42));
  mix-blend-mode: soft-light;
}
.pack:not(.is-tilting) .pack-glare { background-position: 0 0; }

/* Cierres: aluminio rizado con los dientes */
.pack-crimp {
  position: absolute;
  left: 0;
  right: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 0.9cqw, rgba(0, 0, 0, 0.16) 0.9cqw 1.8cqw),
    linear-gradient(180deg, color-mix(in srgb, var(--pk-a) 45%, #fff) 0%, var(--pk-a) 45%, color-mix(in srgb, var(--pk-a) 65%, #000) 100%);
}
.pack-crimp-b {
  bottom: 0;
  height: 8cqw;
  box-shadow: inset 0 0.7cqw 0 rgba(4, 9, 26, 0.55);
}

/* Tira de arriba: se arranca al abrir */
.pack-cap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 9.4cqw;
  transform-origin: 100% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--zz) / 2 + 1px) no-repeat,
    conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) top / var(--zz) calc(var(--zz) / 2) repeat-x;
  mask:
    linear-gradient(#000 0 0) bottom / 100% calc(100% - var(--zz) / 2 + 1px) no-repeat,
    conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) top / var(--zz) calc(var(--zz) / 2) repeat-x;
}
.pack-crimp-t { top: 0; bottom: 0; box-shadow: inset 0 -0.7cqw 0 rgba(4, 9, 26, 0.45); }
/* Línea de puntos por donde se rasga */
.pack-cut {
  position: absolute;
  left: 2cqw;
  right: 2cqw;
  bottom: 1.6cqw;
  height: 1.2cqw;
  background: radial-gradient(circle, rgba(4, 9, 26, 0.8) 45%, transparent 52%) 0 50% / 3cqw 100% repeat-x;
}
.pack.is-ready .pack-cut { animation: pk-cut 1.1s ease-in-out infinite; }
@keyframes pk-cut { 50% { filter: drop-shadow(0 0 1.4cqw #fff) brightness(3); } }
/* Luz que se escapa por el corte mientras se rasga */
.pack-leak {
  position: absolute;
  left: 0;
  right: 0;
  top: 5cqw;
  height: 8cqw;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 30%, #fff 48%, #fff 56%, transparent 70%),
    radial-gradient(60% 100% at 50% 52%, var(--leak, #fff), transparent 75%);
  filter: drop-shadow(0 0 2.5cqw var(--leak, #fff)) drop-shadow(0 -2cqw 3cqw var(--leak, #fff));
  clip-path: inset(0 100% 0 0);
}

/* ---------- Reverso de las cartas ---------- */

.cb {
  position: relative;
  display: block;
  width: var(--card-w, 100%);
  aspect-ratio: 63 / 88;
  container-type: inline-size;
  border-radius: 6% / 4.3%;      /* como las caras (css/cards.css) */
  padding: 4.2cqw;
  background:
    linear-gradient(145deg, #fff8cf 0%, #ffd23f 18%, #c98a12 38%, #ffe680 52%, #b37a0c 70%, #ffd23f 86%, #fff3b0 100%);
  box-shadow:
    0 0 0 0.9cqw var(--edge-out),
    inset 0 0 0 0.6cqw rgba(255, 255, 255, 0.45),
    0 2.4cqw 0 0.4cqw rgba(4, 9, 26, 0.45);
  overflow: hidden;
  isolation: isolate;
}
.cb-field {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 3.4cqw;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 46%, #3a6fe0 0%, #1c3d8c 45%, #0c1a45 100%);
  box-shadow: inset 0 0 0 0.8cqw var(--edge-out), inset 0 0 0 1.6cqw rgba(95, 184, 255, 0.55), inset 0 0 6cqw rgba(0, 0, 0, 0.6);
}
/* Celosía de rombos */
.cb-lattice {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(160, 200, 255, 0.16) 0 0.5cqw, transparent 0.5cqw 7cqw),
    repeating-linear-gradient(-45deg, rgba(160, 200, 255, 0.16) 0 0.5cqw, transparent 0.5cqw 7cqw);
  -webkit-mask: radial-gradient(70% 55% at 50% 46%, transparent 30%, #000 75%);
  mask: radial-gradient(70% 55% at 50% 46%, transparent 30%, #000 75%);
}
.cb-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 160cqw;
  height: 160cqw;
  margin: -80cqw 0 0 -80cqw;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 63, 0.16) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 70%);
  mask: radial-gradient(closest-side, #000 20%, transparent 70%);
}
.cb-glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 70cqw;
  height: 70cqw;
  margin: -35cqw 0 0 -35cqw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 160, 0.55), rgba(95, 184, 255, 0.25) 55%, transparent);
}
.cb-emblem {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 62cqw;
  height: 62cqw;
  margin: -31cqw 0 0 -31cqw;
  filter: drop-shadow(0 1.6cqw 0 rgba(4, 9, 26, 0.6)) drop-shadow(0 0 4cqw rgba(255, 210, 63, 0.45));
}
.cb-emblem svg { display: block; width: 100%; height: 100%; }
.cb-logo {
  position: absolute;
  left: 0;
  right: 0;
  top: 8cqw;
  display: flex;
  justify-content: center;
}
.cb-logo .logo { font-size: 13.5cqw; }
.cb-logo .lt { animation: none; }
/* Adorno de abajo: dos filetes con un rombo */
.cb-orn {
  position: absolute;
  left: 14cqw;
  right: 14cqw;
  bottom: 11cqw;
  height: 4cqw;
  background:
    linear-gradient(#ffd23f 0 0) left 50% / calc(50% - 4.5cqw) 0.8cqw no-repeat,
    linear-gradient(#ffd23f 0 0) right 50% / calc(50% - 4.5cqw) 0.8cqw no-repeat;
}
.cb-orn::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4cqw;
  height: 4cqw;
  margin: -2cqw 0 0 -2cqw;
  background: #fff3b0;
  border: 0.6cqw solid var(--edge-out);
  transform: rotate(45deg);
}
.cb-corner {
  position: absolute;
  z-index: 2;
  width: 4.2cqw;
  height: 4.2cqw;
  background: #ffd23f;
  border: 0.6cqw solid var(--edge-out);
  transform: rotate(45deg);
}
.cb-tl { left: 4.6cqw; top: 4.6cqw; }
.cb-tr { right: 4.6cqw; top: 4.6cqw; }
.cb-bl { left: 4.6cqw; bottom: 4.6cqw; }
.cb-br { right: 4.6cqw; bottom: 4.6cqw; }
.cb-shine {
  position: absolute;
  inset: -30%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.34) 50%, transparent 58%);
  animation: pk-sheen 5s ease-in-out infinite;
}
@keyframes pk-sheen {
  0%, 55% { transform: translateX(-70%); }
  85%, 100% { transform: translateX(70%); }
}

/* ---------- Pantalla de sobres ---------- */

/* Móvil: pestañas · sobres · comprar · probabilidades. Horizontal o ancho:
   los sobres a la izquierda y lo demás a la derecha. */
.pk {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'tabs' 'front' 'act' 'odds';
  gap: 14px;
  align-items: start;
}
.pk-tabs { grid-area: tabs; min-width: 0; }
.pk-front { grid-area: front; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pk-act { grid-area: act; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pk-odds { grid-area: odds; min-width: 0; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {
  .pk {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: 'front tabs' 'front act' 'front odds';
    grid-template-rows: auto auto 1fr;
    column-gap: 22px;
  }
  .pk:not(.has-tabs) { grid-template-areas: 'front act' 'front odds'; grid-template-rows: auto 1fr; }
  .pk-front { position: sticky; top: 0; }
}

/* Estantería en carrusel: el elegido delante y los otros dos asomando */
.pk-shelf-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0 14px;
}
.pk-shelf-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(420px, 110%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 210, 63, 0.28), rgba(95, 184, 255, 0.12) 55%, transparent);
  pointer-events: none;
}
.pk-shelf {
  --pk-w: min(190px, 46vw, calc((100dvh - 300px) / 1.72));
  position: relative;
  width: min(100%, calc(var(--pk-w) * 2.2));
  height: calc(var(--pk-w) * 1.72 + 22px);
}
.pk-slot {
  position: absolute;
  left: 50%;
  top: 4px;
  width: var(--pk-w);
  margin-left: calc(var(--pk-w) / -2);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1.05), filter 0.35s;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
.pk-slot[data-pos='c'] { z-index: 3; }
.pk-slot[data-pos='l'], .pk-slot[data-pos='r'] { z-index: 1; filter: brightness(0.62) saturate(0.85); }
.pk-slot[data-pos='l'] { transform: translateX(-60%) translateY(7%) scale(0.74) rotate(-9deg); }
.pk-slot[data-pos='r'] { transform: translateX(60%) translateY(7%) scale(0.74) rotate(9deg); }
@media (hover: hover) {
  .pk-slot[data-pos='l']:hover, .pk-slot[data-pos='r']:hover { filter: brightness(0.85); }
}
.pk-slot:focus-visible { outline: none; }
.pk-slot:focus-visible .pack-body { outline: 4px solid var(--gold); outline-offset: -4px; }
.pk-slot.is-away { visibility: hidden; }
/* Con la apertura encima (main inerte), la tienda de detrás se queda quieta. */
.screen-packs main[inert] *, .screen-packs main[inert] *::before, .screen-packs main[inert] *::after {
  animation-play-state: paused !important;
}
.pk-slot.is-hop { animation: pk-hop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes pk-hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -14px; } }
.pk-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  text-shadow: var(--outline-sm);
}
.pk-pick { flex-wrap: wrap; gap: 0 4px; }
.pk-pick b { color: #fff; }
.pk-pick-tip { opacity: 0.8; }

.pk-buy { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pk-buy .btn { width: 100%; padding-left: 10px; padding-right: 10px; }
.pk-buy .btn-label { display: flex; flex-direction: column; align-items: center; }
.btn.is-nudge { animation: pk-nudge 0.5s ease-out; }
@keyframes pk-nudge { 0%, 100% { scale: 1; } 40% { scale: 1.07; } }
.pk-need {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px rgba(91, 131, 214, 0.35);
  font-size: 14px;
  color: var(--muted);
}
.pk-need .ico { width: 20px; height: 20px; }
.pk-need[hidden] { display: none; }

/* Garantía: 6 casillas y la estrella del premio */
.pk-pity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(6, 14, 38, 0.45);
  box-shadow: inset 0 0 0 1px rgba(199, 125, 255, 0.35);
}
.pk-pity p { flex: 1; min-width: 0; color: var(--muted); }
.pk-pips { display: flex; align-items: center; gap: 4px; flex: none; }
.pk-pip {
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--edge-out);
}
.pk-pip.is-on { background: linear-gradient(180deg, #e2b5ff, #9b4fe0); box-shadow: 0 0 8px rgba(199, 125, 255, 0.7); }
.pk-pip-goal .ico { width: 22px; height: 22px; margin-left: 2px; }

/* Probabilidades: rareza × hueco */
.pk-odds-t { width: 100%; border-collapse: collapse; font-size: 15px; }
.pk-odds-t th, .pk-odds-t td { padding: 7px 4px; text-align: right; }
.pk-odds-t thead th { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 0; }
.pk-odds-t tbody th { text-align: left; font-weight: 400; }
.pk-odds-t tbody tr + tr > * { border-top: 1px solid rgba(91, 131, 214, 0.3); }
.pk-odds-t td { font-weight: 700; color: var(--gold); text-shadow: var(--outline-sm); white-space: nowrap; }
.pk-odds-t td.is-none { color: rgba(185, 203, 240, 0.45); }
.pk-lines { margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pk-odds-note { margin-top: 8px; }
.pool-list { --card-min: 64px; margin-top: 10px; }
.pool-list .card-sub { color: var(--gold); font-weight: 700; }
details.more > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '▸'; transition: transform 0.15s; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* Móvil en horizontal: los sobres llenan el alto de la izquierda */
@media (orientation: landscape) and (max-height: 520px) {
  .pk-shelf { --pk-w: min(190px, 24vw, calc((100dvh - 120px) / 1.72)); }
  .pk-shelf-wrap { padding: 0 0 6px; }
  .pk-pick { font-size: 12px; }
  .pk-buy .btn { min-height: 52px; }
  .pk-act { gap: 8px; }
  .pk { row-gap: 10px; }
}
/* Escritorio: la tienda centrada en el alto, las pestañas de región arriba a
   todo el ancho (caben las 9, sin cortes ni degradado) y sobres más grandes. */
@media (min-width: 900px) and (min-height: 521px) {
  .screen-packs .screen-body { display: flex; flex-direction: column; }
  .screen-packs .screen-body > .wrap { margin: auto; }
  .pk { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .pk.has-tabs { grid-template-areas: 'tabs tabs' 'front act' 'front odds'; grid-template-rows: auto auto 1fr; }
  .pk-tabs > .tabs {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
@media (min-width: 900px) and (min-height: 700px) {
  .pk-shelf { --pk-w: min(320px, 24vw, calc((100dvh - 240px) / 1.72)); }
}

/* ---------- Apertura ---------- */

@property --pko-cw { syntax: '<length>'; inherits: true; initial-value: 280px; }
@property --pko-pw { syntax: '<length>'; inherits: true; initial-value: 220px; }

.pko {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #fff;
}
.pko.is-out { animation: scr-fade-out 0.2s both; pointer-events: none; }
.pko-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 45% at 50% 42%, rgba(60, 100, 220, 0.4), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, #0a163a, #020510);
}
.pko-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  padding: max(8px, var(--safe-t)) max(14px, var(--safe-r)) 6px max(16px, var(--safe-l));
}
.pko-count { font-size: 19px; font-weight: 700; color: var(--gold); text-shadow: var(--outline); }
.pko-skip .ico { width: 18px; height: 18px; }
.pko-play {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  grid-template-areas: 'stage' 'info' 'row' 'hint';
  gap: 10px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(16px, var(--safe-r)) max(14px, var(--safe-b)) max(16px, var(--safe-l));
}
.pko-stage {
  grid-area: stage;
  position: relative;
  min-height: 0;
  container-type: size;
  cursor: pointer;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.pko-stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 210, 63, 0.5); border-radius: 16px; }
.pko-fx { position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: visible; }
.pko-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  aspect-ratio: 1;
  margin: -3px 0 0 -3px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
.pko-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; opacity: 0; mix-blend-mode: screen; }

/* Fase del sobre (llega, se rasga, se abre; clase is-pack): el escenario
   ocupa toda la zona, el sobre va en medio y la pista justo debajo (la pista
   pasa a estar dentro del escenario). El rótulo y los huecos vuelven con las
   cartas. */
.pko-play.is-pack .pko-info, .pko-play.is-pack .pko-row { display: none; }
.pko-play.is-pack .pko-stage { grid-area: 1 / 1 / -1 / -1; }
/* Ancho del sobre: el sobre y la pista lo calculan igual (en cq del escenario). */
.pko-pack, .pko-stage > .pko-hint { --pko-pw: min(340px, 74cqw, calc(78cqh / 1.72)); }
.pko-stage > .pko-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + var(--pko-pw) * 0.86 + 12px);
  z-index: 6;
  margin: 0;
  pointer-events: none;
}

/* El sobre en el escenario */
.pko-pack {
  --pk-w: var(--pko-pw);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  margin: calc(var(--pko-pw) * -0.86) 0 0 calc(var(--pko-pw) / -2);
}
.pko-pack .pack-floor { display: none; }
/* Línea de puntos más visible al abrir: puntos más grandes con canto claro. */
.pko-pack .pack-cut {
  left: 3cqw;
  right: 3cqw;
  bottom: 1.2cqw;
  height: 2cqw;
  background: radial-gradient(circle, #0b1838 36%, rgba(255, 255, 255, 0.9) 44%, rgba(255, 255, 255, 0.9) 50%, transparent 58%) 0 50% / 3.6cqw 100% repeat-x;
}
/* Guía de deslizar: un trazo fino de luz con punta de flecha que recorre la
   línea de puntos (el gesto, no un botón). */
.pko-swipe {
  position: absolute;
  z-index: 3;
  left: 3cqw;
  top: 6.4cqw;
  width: 20cqw;
  height: 1.6cqw;
  border-radius: 99px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  filter: drop-shadow(0 0 1.2cqw rgba(255, 255, 255, 0.9));
  opacity: 0;
}
.pko-swipe::after {
  content: '';
  position: absolute;
  right: -3cqw;
  top: 50%;
  width: 4.6cqw;
  height: 4.6cqw;
  margin-top: -2.3cqw;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%, 30% 50%);
}
.pack.is-ready .pko-swipe { animation: pko-swipe 1.7s ease-in-out infinite 0.3s; }
.pack.is-ready.is-tearing .pko-swipe { animation: none; opacity: 0; }
@keyframes pko-swipe {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  70% { transform: translateX(70cqw); opacity: 1; }
  85%, 100% { transform: translateX(70cqw); opacity: 0; }
}
.pko-pack.is-ready .pack-tilt { animation: pko-wiggle 2.4s ease-in-out infinite; }
@keyframes pko-wiggle { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -1.6deg; } 90% { rotate: 1.4deg; } 95% { rotate: -0.6deg; } }

/* Luz que sale del sobre al abrirlo */
.pko-burst {
  position: absolute;
  z-index: 4;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, #fff 0%, #fff 12%, var(--glow) 30%, color-mix(in srgb, var(--glow) 35%, transparent) 55%, transparent 75%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow) 75%, #fff) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side, #000 35%, transparent 100%);
  mask: radial-gradient(closest-side, #000 35%, transparent 100%);
  mix-blend-mode: screen;
}
.pko-burst.is-rainbow {
  background:
    radial-gradient(closest-side, #fff 0%, #fff 12%, rgba(255, 255, 255, 0.4) 35%, transparent 70%),
    repeating-conic-gradient(from 0deg, #ff5f6d 0deg 5deg, transparent 5deg 10deg, #ffd23f 10deg 15deg, transparent 15deg 20deg,
      #5fe08a 20deg 25deg, transparent 25deg 30deg, #5fb8ff 30deg 35deg, transparent 35deg 40deg, #c77dff 40deg 45deg, transparent 45deg 50deg);
}

/* Rayos detrás de la carta (épica, inicial; suaves con la rara) */
.pko-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: 150cqmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--glow, #fff) 65%, transparent), transparent 45%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow, #fff) 55%, transparent) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(closest-side, #000 15%, transparent 70%);
  mask: radial-gradient(closest-side, #000 15%, transparent 70%);
  opacity: 0;
  transition: opacity 0.45s;
  animation: spin 22s linear infinite;
}
.pko-rays.is-on { opacity: 0.85; }
.pko-rays.is-on.is-soft { opacity: 0.4; }
.pko-ring {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px solid var(--glow);
  box-shadow: 0 0 22px var(--glow), inset 0 0 22px var(--glow);
}
.pko-ring.is-rainbow {
  border: 0;
  box-shadow: none;
  background: conic-gradient(#ff5f6d, #ffd23f, #5fe08a, #5fb8ff, #c77dff, #ff8ad1, #ff5f6d);
  -webkit-mask: radial-gradient(closest-side, transparent 84%, #000 87%, #000 97%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 84%, #000 87%, #000 97%, transparent 100%);
}

/* Cartas: reverso y cara, giro en 3D. --card-w en px (registrada arriba)
   para que la cara nueva de cards.css la herede ya resuelta. */
.pkc {
  --pko-cw: min(300px, 72cqw, calc(86cqh * 63 / 88));
  --card-w: var(--pko-cw);
  --i: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  aspect-ratio: 63 / 88;
  margin: calc(var(--card-w) * -44 / 63) 0 0 calc(var(--card-w) / -2);
  translate: calc(var(--i) * 5px) calc(var(--i) * 6px);
  transition: translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  perspective: 1400px;
}
.pkc.is-top { z-index: 40 !important; }
.pkc-in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.58s cubic-bezier(0.35, 0.6, 0.3, 1);
}
.pkc.is-flipped .pkc-in { transform: rotateY(180deg); }
.pkc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.pkc-front { transform: rotateY(180deg); }
.pkc-front > .card { width: 100%; height: 100%; }
/* En la apertura, el texto del ataque un poco más grande (la ficha y el
   resumen, como en cards.css). */
.pkc .card-kind { font-size: 3.7cqw; }
.pkc-back > .cb { width: 100%; }
/* Antes de girar una buena: el reverso brilla del color de su rareza y tiembla */
.pkc.is-charging { animation: pkc-tremble 0.1s linear infinite; }
.pkc.is-charging.r-epic, .pkc.is-charging.r-starter { animation-duration: 0.07s; }
.pkc-back::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 6% / 4.3%;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 26px 8px var(--glow), inset 0 0 30px 6px var(--glow);
}
.pkc.is-charging .pkc-back::after { animation: pkc-charge 1.05s ease-in forwards; }
@keyframes pkc-tremble {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -1.4deg; }
  75% { rotate: 1.4deg; }
}
@keyframes pkc-charge { from { opacity: 0.2; } to { opacity: 1; } }

/* Rótulos sobre la carta */
.pko-stamp {
  position: absolute;
  z-index: 5;
  right: -5%;
  top: 31%;
  padding: 0.25em 0.55em 0.35em;
  border-radius: 0.35em;
  font-size: calc(var(--card-w) * 0.085);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, #ff6f7c, #d8344c);
  border: 0.12em solid #fff;
  box-shadow: 0 0 0 0.08em var(--edge-out), 0 0.12em 0 0.08em rgba(4, 9, 26, 0.6);
  text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.pko-tag {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: -7%;
  font-size: calc(var(--card-w) * 0.13);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.pko-tag.is-shiny {
  color: transparent;
  background: linear-gradient(90deg, #ff5f6d, #ffd23f, #5fe08a, #5fb8ff, #c77dff, #ff8ad1);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0.05em 0 var(--edge-out)) drop-shadow(0 0 0.15em rgba(255, 255, 255, 0.8));
  -webkit-text-stroke: 0.02em rgba(255, 255, 255, 0.6);
}
.pko-plus {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: -6.5%;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.2em 0.6em 0.3em;
  border-radius: 99px;
  font-size: calc(var(--card-w) * 0.075);
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(180deg, #4a7fe6, #2b55b5);
  border: 0.12em solid var(--edge-out);
  text-shadow: var(--outline-sm);
  pointer-events: none;
}
.pko-plus.is-up { background: linear-gradient(180deg, #74eaa0, #2fb562); color: #08341a; text-shadow: none; }
.pko-plus .ico { width: 1.1em; height: 1.1em; }

/* Debajo: nombre, rareza y qué ha pasado con la carta */
.pko-info {
  grid-area: info;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.pko-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  text-shadow: var(--outline);
}
.pko-shiny {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 13px;
  color: #4a2a00;
  text-shadow: none;
  background: linear-gradient(90deg, #ffb3c7, #fff3a6, #b3ffd9, #b3e0ff);
  border: 2px solid var(--edge-out);
}
.pko-shiny .ico { width: 14px; height: 14px; }
.pko-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pko-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--muted);
  text-shadow: var(--outline-sm);
}
.pko-st.is-new { color: var(--gold); font-weight: 700; }
.pko-st.is-up { color: var(--green); font-weight: 700; }
.pko-st.is-starter { color: var(--gold); font-weight: 700; }
.pko-st.is-shiny { color: #ffb3dd; font-weight: 700; }
.pko-st .ico { width: 18px; height: 18px; }

/* Huecos de las 5 cartas reveladas */
.pko-row {
  --slot-w: min(62px, calc((100vw - 72px) / 5));
  grid-area: row;
  display: grid;
  grid-template-columns: repeat(5, var(--slot-w));
  justify-content: center;
  gap: 8px;
  transition: opacity 0.35s;
}
.pko-row.is-wait { opacity: 0; }
.pko-slot {
  --card-w: var(--slot-w);
  position: relative;
  width: var(--slot-w);
  aspect-ratio: 63 / 88;
  border-radius: 8px;
  border: 2px dashed rgba(185, 203, 240, 0.2);
  background: rgba(6, 14, 38, 0.35);
}
.pko-slot.is-full { border: 0; background: none; }
.pko-slot > .card { position: absolute; inset: 0; width: 100%; height: 100%; animation: pk-pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pko-hint {
  grid-area: hint;
  min-height: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  text-shadow: var(--outline-sm);
  animation: blink 1.6s ease-in-out infinite;
}

/* Móvil en horizontal: escenario a la izquierda, lo demás a la derecha. La
   cabecera (cuenta y Saltar) va arriba a la derecha, encima: así el escenario
   tiene todo el alto y la carta se lee. El sobre, hasta que salen las cartas,
   en medio de todo el ancho. */
@media (orientation: landscape) and (max-height: 520px) {
  .pko-head { min-height: 48px; padding-top: max(4px, var(--safe-t)); padding-bottom: 2px; }
  .pko:not(.is-summary) { grid-template-rows: minmax(0, 1fr); }
  .pko:not(.is-summary) .pko-head { position: absolute; top: 0; right: 0; justify-content: flex-end; }
  .pko-play {
    max-width: 1000px;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: 'stage .' 'stage info' 'stage row' 'stage hint';
    column-gap: 18px;
    row-gap: 10px;
    padding-top: max(6px, var(--safe-t));
    padding-bottom: max(8px, var(--safe-b));
  }
  .pko-hint { align-self: start; }
  .pko-row { --slot-w: min(62px, 8.5vw); }
  .pko-name { font-size: 20px; }
  .pkc { --pko-cw: min(300px, 72cqw, calc(90cqh * 63 / 88)); }
  /* La carta llega casi arriba: el rótulo shiny, un poco más pegado. */
  .pko-tag { top: -4.5%; font-size: calc(var(--card-w) * 0.115); }
}
@media (min-width: 900px) and (min-height: 700px) {
  .pkc { --pko-cw: min(320px, 72cqw, calc(86cqh * 63 / 88)); }
  .pko-row { --slot-w: 72px; gap: 12px; }
  .pko-name { font-size: 28px; }
}

/* ---------- Resumen ---------- */

/* Opaco: la tienda de detrás no se transparenta entre las cartas. */
.pko.is-summary .pko-bg { background: radial-gradient(120% 90% at 50% 30%, #102258, #020510); }
.pks {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4px max(16px, var(--safe-r)) 0 max(16px, var(--safe-l));
  animation: scr-fade 0.3s both;
}
.pks > * { width: 100%; max-width: 760px; }
/* Título y chips (en horizontal, en una sola línea) */
.pks-head {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pks-title {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 700;
  text-align: center;
  color: var(--gold);
  text-shadow: var(--outline);
  animation: pk-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.pks-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pks-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 3px 12px 4px 8px;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(6, 14, 38, 0.6);
  border: 2px solid var(--edge-in);
  box-shadow: 0 0 0 2px var(--edge-out);
  text-shadow: var(--outline-sm);
}
.pks-chip .ico { width: 20px; height: 20px; }
.pks-chip.is-new { border-color: var(--gold); }
.pks-chip.is-hot { border-color: #c77dff; }
.pks-chip.is-shiny { border-color: #ff8ad1; }
.pks-cards {
  --card-w: min(124px, calc((100vw - 64px) / 3));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 12px;
  padding: 6px 0;
}
.pks-cards.is-multi { --card-w: min(86px, calc((100vw - 64px) / 4)); gap: 12px 10px; }
.pks-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: var(--card-w);
  animation: pks-in 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.pks-item > .card { width: 100%; }
.pks-item.r-epic > .card, .pks-item.r-starter > .card { box-shadow: 0 0 0 2px var(--edge-out), 0 0 18px var(--glow); }
@keyframes pk-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pks-in { from { opacity: 0; transform: translateY(18px) scale(0.85); } to { opacity: 1; transform: none; } }
.pks-note {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-shadow: var(--outline-sm);
  white-space: nowrap;
}
.pks-note.is-new { color: var(--gold); }
.pks-note.is-up { color: var(--green); }
.pks-note .ico { width: 15px; height: 15px; }
.pks-tip { text-align: center; color: var(--muted); }
.pks-tip .ico { width: 16px; height: 16px; vertical-align: -3px; }
.pks-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 12px;
  margin-bottom: auto;
  padding: 16px 0 max(14px, var(--safe-b));
  background: linear-gradient(180deg, rgba(3, 8, 24, 0), rgba(3, 8, 24, 0.92) 30%);
}
.pks-actions .btn { flex: 1 1 0; min-height: 58px; padding-left: 10px; padding-right: 10px; font-size: 20px; }
.pks-actions .btn-label { white-space: nowrap; }
/* Móviles estrechos (360 px): que «Abrir otro» quepa entero. */
@media (max-width: 380px) {
  .pks-actions .btn { font-size: 17px; gap: 6px; }
  .pks-actions .btn > .ico { width: 22px; height: 22px; }
}
.shiny-new {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 138, 209, 0.3), rgba(255, 138, 209, 0.12));
  border: 2px solid rgba(255, 209, 240, 0.7);
  font-weight: 700;
  text-align: left;
}
.shiny-new > .ico { width: 22px; height: 22px; }
@media (min-width: 900px) {
  /* Las 5 cartas de un sobre, en una sola fila. */
  .pks > .pks-cards { max-width: 980px; }
  .pks-cards { --card-w: min(170px, calc((100vw - 120px) / 5), calc((100dvh - 330px) * 0.716)); gap: 18px 16px; }
  .pks-cards.is-multi { --card-w: 100px; }
}
/* Móviles bajos en vertical (360 × 640): un poco más justo, para que el
   resumen de un sobre quepa entero, consejos incluidos. */
@media (orientation: portrait) and (max-height: 700px) {
  .pks { gap: 10px; }
  .pks-title { font-size: 30px; }
  .pks-cards { padding: 2px 0; }
  .pks-actions { padding-top: 10px; }
  .pks-actions .btn { min-height: 52px; }
}
/* Móvil en horizontal: todo más compacto para que al menos una fila de cartas
   quepa entera sobre los botones sin desplazar. */
@media (orientation: landscape) and (max-height: 520px) {
  .pks { gap: 8px; }
  .pks-head { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
  .pks-title { font-size: 24px; }
  .pks-chips { gap: 6px; }
  .pks-chip { min-height: 28px; padding: 2px 10px 3px 6px; font-size: 13px; }
  .pks-chip .ico { width: 16px; height: 16px; }
  .shiny-new { padding: 3px 6px 3px 10px; font-size: 14px; }
  .shiny-new .btn { min-height: 34px; padding-top: 2px; padding-bottom: 2px; }
  .pks-cards { --card-w: min(110px, 15vw, calc((100dvh - 230px) * 0.716)); padding: 2px 0; }
  .pks-cards.is-multi { --card-w: min(70px, 9.5vw); }
  .pks-touch { display: none; }
  .pks-actions { padding-top: 8px; padding-bottom: max(8px, var(--safe-b)); }
  .pks-actions .btn { min-height: 44px; font-size: 18px; }
}

/* Menos movimiento: sin vaivenes ni barridos (lo grande ya lo quita el JS). */
@media (prefers-reduced-motion: reduce) {
  .pack.is-float, .pack-rays, .pko-rays, .pko-pack.is-ready .pack-tilt, .pkc.is-charging { animation: none !important; }
  .pko-swipe { display: none; }
}
