/* ═══════════════════════════════════════════════════════════
   SOBRE EN 3D — lo usan la página de cartas y la fuente de OBS (/obs/)
   Es una caja fina: cara delantera (el diseño de la temporada), dorso, dos lados con grosor y una luz
   que se mueve con el ratón. Todo con transform (lo mueve la tarjeta gráfica).
   --w: ancho del sobre · --g: grosor · --pc: color de la temporada
═══════════════════════════════════════════════════════════ */
.pk {
  --w: 170px; --pc: var(--season, #ff4646); --g: 8cqw;
  position: relative; width: var(--w); aspect-ratio: 10 / 17; flex-shrink: 0;
  container-type: inline-size; perspective: 800px;
}
.pk-3d, .pk-giro { position: absolute; inset: 0; transform-style: preserve-3d; }
/* se mece solo, cada sobre a su ritmo (--d) */
.pk-3d { animation: pk-mece 7s ease-in-out var(--d, 0s) infinite; }
@keyframes pk-mece { 0%, 100% { transform: rotateY(-22deg) rotateX(4deg); } 50% { transform: rotateY(22deg) rotateX(-3deg); } }
.pk.quieto .pk-3d { animation: none; transform: rotateY(-14deg) rotateX(3deg); }
.pk-giro { transition: transform .6s cubic-bezier(.2,.8,.3,1); }

.pk-cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pk-frente { transform: translateZ(calc(var(--g) / 2)); }
.pk-dorso { transform: rotateY(180deg) translateZ(calc(var(--g) / 2)); }
/* los lados: el plástico doblado, con el color de la temporada */
.pk-lado {
  position: absolute; top: .8%; bottom: .8%; left: 50%; width: var(--g); margin-left: calc(var(--g) / -2);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(90deg, #070707, var(--pc) 48%, #070707);   /* para navegadores antiguos (OBS) */
  background:
    linear-gradient(180deg, rgba(255,255,255,.22) 0 2.4%, transparent 2.4% 97.6%, rgba(255,255,255,.22) 97.6%),
    linear-gradient(90deg, #070707, color-mix(in srgb, var(--pc) 62%, #1c1c1c) 48%, color-mix(in srgb, var(--pc) 30%, #0d0d0d) 60%, #070707);
}
.pk-izq { transform: rotateY(-90deg) translateZ(50cqw); }
.pk-der { transform: rotateY(90deg) translateZ(50cqw); }
/* sombra en el suelo */
.pk:not([class*="trozo-"])::before {
  content: ''; position: absolute; left: 8%; right: 8%; bottom: -7%; height: 9%;
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); pointer-events: none;
}

/* la cara (delante y detrás): plástico con los bordes dentados de arriba y abajo */
.pk-art {
  position: absolute; inset: 0; overflow: hidden; border-radius: 3cqw;
  background: radial-gradient(100% 60% at 50% 40%, var(--pc) 0%, #0b0b0b 80%);   /* para navegadores antiguos (OBS) */
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.12) 45%, transparent 60%),
    radial-gradient(100% 60% at 50% 40%, color-mix(in srgb, var(--pc) 60%, #111) 0%, #0b0b0b 80%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset;
  -webkit-mask: linear-gradient(#000 0 0);
  clip-path: polygon(0 1.5%, 4% 0, 8% 1.5%, 12% 0, 16% 1.5%, 20% 0, 24% 1.5%, 28% 0, 32% 1.5%, 36% 0, 40% 1.5%, 44% 0, 48% 1.5%, 52% 0, 56% 1.5%, 60% 0, 64% 1.5%, 68% 0, 72% 1.5%, 76% 0, 80% 1.5%, 84% 0, 88% 1.5%, 92% 0, 96% 1.5%, 100% 0,
    100% 98.5%, 96% 100%, 92% 98.5%, 88% 100%, 84% 98.5%, 80% 100%, 76% 98.5%, 72% 100%, 68% 98.5%, 64% 100%, 60% 98.5%, 56% 100%, 52% 98.5%, 48% 100%, 44% 98.5%, 40% 100%, 36% 98.5%, 32% 100%, 28% 98.5%, 24% 100%, 20% 98.5%, 16% 100%, 12% 98.5%, 8% 100%, 4% 98.5%, 0 100%);
}
.pk-art > img.full { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-tpl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 14cqw 8cqw 10cqw; gap: 5cqw; }
.pk-tpl .pk-brand { font-family: 'Bebas Neue'; font-size: 19cqw; letter-spacing: .1em; line-height: .9; }
.pk-tpl .pk-season { font-size: 5.4cqw; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.75); text-align: center; }
.pk-tpl img { width: 62%; border-radius: 50%; background: #fff; margin-top: auto; box-shadow: 0 0 0 2.5cqw rgba(255,255,255,.12), 0 0 30cqw color-mix(in srgb, var(--pc) 80%, transparent); }
.pk-tpl .pk-count { margin-top: auto; font-family: 'Bebas Neue'; font-size: 11cqw; letter-spacing: .08em; }
.pk-stripe { position: absolute; left: 0; right: 0; top: 11.5%; height: 1.4cqw; background: rgba(255,255,255,.35); }
/* luz: el centro abombado brilla y los bordes se oscurecen (la luz sigue al ratón con --lx / --ly) */
.pk-luz {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 38% at var(--lx, 34%) var(--ly, 30%), rgba(255,255,255,.26), rgba(255,255,255,0) 72%),
    linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0) 13%, rgba(0,0,0,0) 87%, rgba(0,0,0,.45)),
    linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,0) 9%, rgba(0,0,0,0) 91%, rgba(0,0,0,.35));
}
.pk-glint {      /* la capa mide 3 veces el sobre y se desliza (solo transform: no hay que repintar nada) */
  position: absolute; top: 0; bottom: 0; left: 0; width: 300%; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, rgba(255,255,255,0) 60%);
  mix-blend-mode: overlay; transform: translateX(-100%);
  animation: glint 3.2s ease-in-out infinite;
}
@keyframes glint { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(40%); } }

/* el dorso */
.pk-art.dorso {
  background: radial-gradient(95% 55% at 50% 42%, #2a2a2a 0%, #090909 88%);   /* para navegadores antiguos (OBS) */
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1.2cqw, transparent 1.2cqw 2.4cqw),
    radial-gradient(95% 55% at 50% 42%, color-mix(in srgb, var(--pc) 42%, #121212) 0%, #090909 88%);
}
.pk-costura { position: absolute; top: 0; bottom: 0; left: 50%; width: 6cqw; margin-left: -3cqw;
  background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(255,255,255,.1) 42%, rgba(255,255,255,.04) 58%, rgba(0,0,0,.45)); }
.pk-dorso-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16cqw 8cqw 12cqw; gap: 3cqw; color: #fff; }
.pk-d-logo { font-family: 'Bebas Neue'; font-size: 21cqw; letter-spacing: .08em; line-height: .9; text-shadow: 0 1cqw 4cqw rgba(0,0,0,.6); }
.pk-d-logo b { display: block; font-weight: 400; color: var(--pc); font-size: 15cqw; letter-spacing: .14em; }
.pk-d-temp { font-family: 'Space Grotesk', sans-serif; font-size: 4.6cqw; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.pk-d-n { margin-top: auto; font-family: 'Bebas Neue'; font-size: 10cqw; letter-spacing: .1em; color: var(--pc); }
.pk-d-barras { width: 46%; height: 10cqw; border-radius: 1cqw; background: #fff; padding: 1.4cqw 2cqw; display: block; }
.pk-d-barras i { display: block; height: 100%;
  background: repeating-linear-gradient(90deg, #111 0 .7cqw, transparent .7cqw 1.3cqw, #111 1.3cqw 1.6cqw, transparent 1.6cqw 2.6cqw, #111 2.6cqw 3.6cqw, transparent 3.6cqw 4.3cqw); }
.pk-d-web { font-family: 'Space Grotesk', sans-serif; font-size: 4.2cqw; letter-spacing: .08em; color: rgba(255,255,255,.55); }

/* el sobre partido en dos (al rasgarlo): la tira de arriba y el resto */
.pk.trozo-arriba .pk-cara, .pk.trozo-arriba .pk-lado { clip-path: inset(0 0 87% 0); }
.pk.trozo-cuerpo .pk-cara, .pk.trozo-cuerpo .pk-lado { clip-path: inset(13% 0 0 0); }

.pk-ribbon {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); z-index: 3;
  padding: .25rem .6rem; border-radius: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .15em;
  background: #fff; color: #111; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.pk-ribbon.racha { background: linear-gradient(135deg, #ff4646, #ffb13c); color: #fff; }
.pk-ribbon.regalo, .pk-ribbon.cupon { background: var(--twitch, #9146ff); color: #fff; }
.pk-ribbon.drop { background: linear-gradient(135deg, #2ef2c8, #5fb4ff); color: #04211b; }

@media (prefers-reduced-motion: reduce) {
  .pk-3d { animation: none; transform: rotateY(-14deg) rotateX(3deg); }
  .pk-glint { animation: none; }
}
