/* ═══════════════════════════════════════════════════════════
   LITASO · SOBRES — cartas.css
═══════════════════════════════════════════════════════════ */
:root {
  --bg: #0d0d0d;
  --card: rgba(255,255,255,.04);
  --card-h: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.1);
  --line-2: rgba(255,255,255,.24);
  --text-2: rgba(255,255,255,.72);
  --text-3: rgba(255,255,255,.5);
  --twitch: #9146ff;
  --season: #ff4646;
  --r1: #a3a3a3; --r2: #5fb4ff; --r3: #c36bff; --r4: #ffcf40; --r5: #ff4646; --r6: #2ef2c8;
  --gutter: clamp(16px, 4vw, 32px);
}
/* las variables del brillo (--mx, --my, --tx, --o) y los tipos de brillo están en brillos.css */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: #fff;
  font-family: 'Space Grotesk', system-ui, sans-serif; line-height: 1.5;
  min-height: 100vh; overflow-x: hidden;
}
body.lock { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.4rem; border-radius: 8px; border: 1px solid var(--line-2);
  font-size: .9rem; font-weight: 600; letter-spacing: .03em; text-decoration: none; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .2s, opacity .2s;
}
.btn:hover:not(:disabled) { border-color: #fff; transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.light { background: #fff; color: #111; border-color: #fff; }
.btn.light:hover:not(:disabled) { background: #e8e8e8; }
.btn.twitch { background: var(--twitch); border-color: var(--twitch); color: #fff; font-size: 1rem; padding: 1rem 1.7rem; }
.btn.twitch:hover { background: #7c2df5; }
.btn.fire { background: linear-gradient(135deg, #ff4646, #ff9a3c); border-color: transparent; color: #fff; box-shadow: 0 10px 30px rgba(255,90,60,.35); }
.btn.small { padding: .5rem .9rem; font-size: .78rem; border-radius: 6px; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.kicker { font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--text-3); }
.title { font-family: 'Bebas Neue', sans-serif; font-weight: 400; letter-spacing: .04em; line-height: .95; }

/* ─── Barra superior ─── */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem var(--gutter);
  background: rgba(13,13,13,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-back { font-size: .8rem; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.top-back:hover { color: #fff; }
.top-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; letter-spacing: .08em; line-height: 1; margin-right: auto; }
.top-logo b { font-weight: 400; color: var(--season); }
.chip { display: flex; align-items: center; gap: .6rem; }
.chip img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: cover; }
.chip-name { font-size: .85rem; font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brasas {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem; border-radius: 999px;
  background: rgba(255,120,60,.12); border: 1px solid rgba(255,120,60,.35);
  font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.brasas.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.18); background: rgba(255,120,60,.35); } }
.top .btn.small { padding: .4rem .7rem; }
@media (max-width: 560px) {
  .chip-name, .top-back span { display: none; }
  .top-logo { font-size: 1.35rem; }
  .top { gap: .55rem; } .chip { gap: .4rem; } .brasas { padding: .3rem .55rem; }
}

main { max-width: 1120px; margin: 0 auto; padding: 1.6rem var(--gutter) 5rem; }
.loading { display: flex; justify-content: center; padding: 30vh 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   CARTA
═══════════════════════════════════════════════════════════ */
.tc {
  --w: 200px;
  --mx: 50%; --my: 50%; --tx: .5; --rx: 0deg; --ry: 0deg; --o: 0;
  --rc: var(--r1);
  position: relative; width: var(--w); aspect-ratio: 5 / 7;
  perspective: 1100px; flex-shrink: 0;
  container-type: inline-size;
  -webkit-tap-highlight-color: transparent;
}
.tc.r2 { --rc: var(--r2); } .tc.r3 { --rc: var(--r3); } .tc.r4 { --rc: var(--r4); } .tc.r5 { --rc: var(--r5); } .tc.r6 { --rc: var(--r6); }
.tc-in {
  position: absolute; inset: 0;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.tc.tilting .tc-in { transition: transform .08s linear; }
.tc-face, .tc-back {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 4.8% / 3.4%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 18px 40px rgba(0,0,0,.55);
  background: #151515;
}
.tc-back { transform: rotateY(180deg); }
.tc-face > img, .tc-back > img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.tc.r4 .tc-face, .tc.r5 .tc-face, .tc.r6 .tc-face { box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 18px 40px rgba(0,0,0,.55), 0 0 22px color-mix(in srgb, var(--rc) 45%, transparent); }

/* brillo holográfico (.tc-holo): épicas y legendarias; raras solo si tienen máscara. Tipos en brillos.css */
.tc-glare {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255,255,255,.7) 0%, rgba(255,255,255,.12) 30%, rgba(0,0,0,.35) 95%);
  mix-blend-mode: overlay; opacity: calc(var(--o) * .9);
}
/* rara: un reflejo que pasa */
.tc.r3 .tc-glare::before {
  content: ''; position: absolute; inset: -20%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  transform: translateX(calc((var(--mx) - 50%) * 1.4));
  mix-blend-mode: soft-light;
}
/* las especiales se mueven solas un poco cuando nadie las toca */
.tc.idle.r4 .tc-in, .tc.idle.r5 .tc-in, .tc.idle.r6 .tc-in { animation: wobble 6s ease-in-out infinite; }
.tc.idle.tilting .tc-in { animation: none; }
.tc.idle.r4:not(.tilting), .tc.idle.r5:not(.tilting), .tc.idle.r6:not(.tilting) { animation: idleshine 6s ease-in-out infinite; }
/* las lenticulares (también las raras): enseñan el cambio solas, con una pausa en cada dibujo (idlelenti está en brillos.css) */
.tc.idle.fx-lenticular:not(.tilting) { animation: idlelenti 7s ease-in-out infinite; }
@keyframes idleshine { 0%, 100% { --mx: 30%; --my: 35%; --tx: .3; --o: .5; } 50% { --mx: 70%; --my: 65%; --tx: .7; --o: .5; } }
@keyframes wobble {
  0%, 100% { transform: rotateX(4deg) rotateY(-6deg); }
  50% { transform: rotateX(-4deg) rotateY(6deg); }
}

/* plantilla (cuando la carta aún no tiene diseño) */
.tpl {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: 4cqw; gap: 2.5cqw;
  background:
    radial-gradient(120% 70% at 50% 35%, color-mix(in srgb, var(--rc) 35%, #1a1a1a) 0%, #121212 70%);
  border: 2.2cqw solid var(--rc);
  border-radius: inherit;
}
.tpl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; }
.tpl-name { font-family: 'Bebas Neue', sans-serif; font-size: 10.5cqw; line-height: .95; letter-spacing: .02em; }
.tpl-rar { font-size: 6cqw; color: var(--rc); white-space: nowrap; }
.tpl-art {
  position: relative; flex: 1; border-radius: 3cqw; overflow: hidden;
  background:
    repeating-radial-gradient(circle at 50% 70%, transparent 0 4cqw, rgba(255,255,255,.04) 4cqw 4.6cqw),
    linear-gradient(160deg, color-mix(in srgb, var(--rc) 55%, #000) 0%, #0b0b0b 100%);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: flex-end; justify-content: center;
}
.tpl-art img { width: 72%; border-radius: 50%; margin-bottom: 8%; background: #fff; filter: grayscale(1) contrast(1.1); box-shadow: 0 0 0 1.4cqw rgba(255,255,255,.12), 0 0 18cqw color-mix(in srgb, var(--rc) 70%, transparent); }
.tpl-num { position: absolute; top: 3cqw; left: 4cqw; font-family: 'Bebas Neue'; font-size: 16cqw; color: rgba(255,255,255,.12); }
.tpl-flavor { font-size: 4.4cqw; line-height: 1.35; color: rgba(255,255,255,.75); min-height: 2.7em; font-style: italic; }
.tpl-foot { display: flex; justify-content: space-between; font-size: 3.8cqw; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.tpl-foot b { color: var(--rc); font-weight: 600; }

/* reverso */
.tpl-back {
  position: absolute; inset: 0; border-radius: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 6cqw, transparent 6cqw 12cqw),
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--season) 45%, #111) 0%, #0c0c0c 70%);
  border: 2.4cqw solid #f2f2f2;
}
.tpl-back img { width: 46%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2cqw rgba(255,255,255,.12); }
.tpl-back span { font-family: 'Bebas Neue'; font-size: 15cqw; letter-spacing: .12em; line-height: 1; }

/* carta que no tienes */
.tc.locked .tc-face { background: #121212; box-shadow: 0 0 0 1px var(--line) inset; }
.locked-in {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqw;
  border: 1.5px dashed rgba(255,255,255,.14); border-radius: inherit; color: rgba(255,255,255,.25);
}
.locked-in b { font-family: 'Bebas Neue'; font-weight: 400; font-size: 22cqw; line-height: 1; }
.locked-in span { font-size: 7cqw; color: color-mix(in srgb, var(--rc) 55%, transparent); }

.badge-qty {
  position: absolute; right: -6px; top: -6px; z-index: 5;
  min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 999px;
  background: #fff; color: #111; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.badge-new {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%); z-index: 6;
  padding: .2rem .55rem; border-radius: 4px; background: var(--season); color: #fff;
  font-size: .62rem; font-weight: 700; letter-spacing: .16em; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255,70,70,.5);
}

/* el sobre (en 3D) está en sobre3d.css */

/* ═══════════════════════════════════════════════════════════
   PANTALLAS: entrar / no sub
═══════════════════════════════════════════════════════════ */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; align-items: center; min-height: calc(100vh - 160px); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 1rem; } }
.hero h1 { font-size: clamp(3.2rem, 9vw, 6rem); margin: .6rem 0 1rem; }
.hero h1 em { font-style: normal; color: var(--season); }
.hero p.lead { color: var(--text-2); font-size: 1.05rem; max-width: 46ch; margin-bottom: 1.4rem; }
.rules { list-style: none; display: grid; gap: .6rem; margin-bottom: 1.8rem; }
.rules li { display: flex; gap: .8rem; align-items: center; font-size: .92rem; color: var(--text-2); }
.rules li span { width: 34px; height: 34px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rules b { color: #fff; }
.fine { font-size: .78rem; color: var(--text-3); margin-top: .9rem; }
.err { color: #ff7a7a; font-size: .88rem; margin-top: 1rem; }
.fan { position: relative; height: min(520px, 70vw); display: flex; align-items: center; justify-content: center; }
.fan .tc { position: absolute; --w: min(230px, 40vw); }
.fan .tc:nth-child(1) { transform: translateX(-62%) rotate(-12deg) translateY(6%); }
.fan .tc:nth-child(2) { transform: translateY(-4%); z-index: 2; }
.fan .tc:nth-child(3) { transform: translateX(62%) rotate(12deg) translateY(6%); }
.nosub { max-width: 560px; margin: 12vh auto 0; text-align: center; }
.nosub img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem; background: #fff; }
.nosub h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); margin-bottom: .8rem; }
.nosub p { color: var(--text-2); margin-bottom: 1.6rem; }
.nosub .row { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   PANTALLA DE JUEGO
═══════════════════════════════════════════════════════════ */
.season {
  position: relative; overflow: hidden;
  padding: 1.6rem 1.6rem; border-radius: 16px; margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--season) 30%, transparent) 0%, transparent 60%), var(--card);
}
.season h1 { font-size: clamp(2.4rem, 7vw, 3.8rem); }
.season p { color: var(--text-2); }
.season .progress { margin-top: 1rem; max-width: 420px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--season), #ffb13c); transition: width .8s; }
.bar-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-3); margin-top: .35rem; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem; margin-bottom: 1.2rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.box { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 1.4rem; }
.box h2 { font-family: 'Bebas Neue'; font-weight: 400; font-size: 1.9rem; letter-spacing: .04em; line-height: 1; margin-bottom: .3rem; }
.box .sub { font-size: .85rem; color: var(--text-3); margin-bottom: 1.1rem; }

/* racha */
.streak { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.5fr); gap: .45rem; margin-bottom: 1.2rem; }
.sd { min-width: 0; }
.sd {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.02);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  font-size: .64rem; color: var(--text-3); letter-spacing: .08em;
}
.sd b { font-family: 'Bebas Neue'; font-weight: 400; font-size: 1.4rem; color: rgba(255,255,255,.35); line-height: 1; }
.sd:last-child { aspect-ratio: auto; border-style: dashed; border-color: rgba(255,177,60,.5); }
.sd:last-child b { font-size: 1.7rem; color: #ffb13c; }
.sd.done { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }
.sd.done b { color: #fff; }
.sd.today { position: relative; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.sd.today::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 7px rgba(255,255,255,.05); opacity: 0; animation: pulseday 1.6s infinite; }
.sd:last-child.done, .sd:last-child.today { background: linear-gradient(135deg, rgba(255,70,70,.35), rgba(255,177,60,.35)); border-style: solid; border-color: #ffb13c; }
@keyframes pulseday { 50% { opacity: 1; } }
.daily-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.daily-foot .btn { flex: 1 1 auto; }
.daily-note { font-size: .82rem; color: var(--text-3); }
.countdown { font-family: 'Bebas Neue'; font-size: 1.6rem; letter-spacing: .05em; }

/* tienda */
.shop { display: flex; gap: 1.2rem; align-items: center; }
.shop .pk { --w: 104px; }
.shop-info { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.price { font-family: 'Bebas Neue'; font-size: 2.2rem; line-height: 1; }
.linkish { font-size: .8rem; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.odds { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: .8rem; }
.odds td { padding: .35rem 0; border-top: 1px solid var(--line); }
.odds td:last-child, .odds td:nth-child(2) { text-align: right; color: var(--text-2); }

/* sobres sin abrir */
.shelf { display: flex; gap: 1.4rem; overflow-x: auto; padding: 1.6rem .6rem 1.8rem; scrollbar-width: thin; }
.shelf .pk { --w: 128px; cursor: pointer; transition: transform .3s; }
.shelf .pk:hover { transform: translateY(-8px) rotate(-2deg); }
.empty { color: var(--text-3); font-size: .9rem; padding: 1rem 0; }

/* álbum */
.album-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip-f { padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line); font-size: .78rem; color: var(--text-2); }
.chip-f[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
.tabs-s { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem 1rem; }
@media (max-width: 560px) { .album { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem .6rem; } }
.album .slot { position: relative; display: flex; justify-content: center; }
.album .tc { --w: 100%; cursor: pointer; }
.album .tc:hover .tc-in { transform: translateY(-4px); }
.album .tc.locked { cursor: default; }

/* ═══════════════════════════════════════════════════════════
   MODAL DE CARTA
═══════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; gap: 2.5rem; padding: 1.2rem; flex-wrap: wrap; overflow-y: auto;
}
.modal .tc { --w: min(360px, 78vw, calc((100vh - 260px) * 5 / 7)); touch-action: none; }
.m-info { max-width: 320px; display: flex; flex-direction: column; gap: .7rem; }
.m-info h2 { font-family: 'Bebas Neue'; font-weight: 400; font-size: 2.6rem; line-height: 1; }
.m-rar { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
/* los símbolos de rareza no se pasan a mayúsculas (π no debe salir como Π) */
.tpl-foot b, .m-rar .sim { text-transform: none; }
.m-flavor { color: var(--text-2); font-style: italic; }
.m-credits { color: var(--text-3); font-size: .9rem; letter-spacing: .03em; }
.m-meta { font-size: .85rem; color: var(--text-3); }
.m-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.m-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 1.1rem; }
@media (max-width: 700px) { .modal { gap: 1.2rem; align-content: center; } .m-info { text-align: center; align-items: center; } .m-actions { justify-content: center; } }

/* ═══════════════════════════════════════════════════════════
   APERTURA DE SOBRES
═══════════════════════════════════════════════════════════ */
.opener {
  --ray: rgba(255,255,255,.08);
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #1b1b1b 0%, #050505 70%);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.op-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.op-rays {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, var(--ray) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%); mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: rays 40s linear infinite; opacity: .6; transition: opacity .6s;
}
@keyframes rays { to { transform: rotate(360deg); } }
.opener.charge .op-rays { animation-duration: 6s; opacity: 1; }
.op-dim { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .5s; pointer-events: none; z-index: 1; }
.opener.dark .op-dim { opacity: .55; }
.op-flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff 0%, color-mix(in srgb, var(--fc, #fff) 80%, transparent) 40%, transparent 75%); opacity: 0; pointer-events: none; z-index: 20; }
.op-flash.go { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .95; } 100% { opacity: 0; } }
.op-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 3; transition: transform 1s cubic-bezier(.3,0,.2,1); }
/* la cámara se acerca mientras se carga una carta especial, y al revelarla da un golpe y tiembla */
.opener.zoom .op-stage { transform: scale(1.1); }
.op-stage.impacto { animation: impacto .7s ease-out; --sk: 1; }
@keyframes impacto {
  0%   { transform: scale(calc(1 + .1 * var(--sk))); }
  14%  { transform: scale(calc(1 + .05 * var(--sk))) translate(calc(-7px * var(--sk)), calc(3px * var(--sk))) rotate(calc(-1deg * var(--sk))); }
  28%  { transform: scale(calc(1 + .02 * var(--sk))) translate(calc(6px * var(--sk)), calc(-3px * var(--sk))) rotate(calc(1deg * var(--sk))); }
  46%  { transform: translate(calc(-4px * var(--sk)), calc(2px * var(--sk))); }
  66%  { transform: translate(calc(2px * var(--sk)), calc(-1px * var(--sk))); }
  100% { transform: none; }
}
/* pantalla teñida en los latidos */
.op-vig { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 38%, color-mix(in srgb, var(--vc, #f00) 70%, transparent) 100%); }
.op-vig.go { animation: vig .68s ease-out; }
@keyframes vig { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
/* título gigante de la rareza */
.op-title { position: absolute; left: 0; right: 0; top: max(56px, 8vh); z-index: 31; text-align: center; pointer-events: none; opacity: 0;
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(3rem, 15vw, 8rem); line-height: .9; letter-spacing: .04em; color: #fff;
  -webkit-text-stroke: 3px var(--tc, #fff); paint-order: stroke fill;
  text-shadow: 0 0 14px var(--tc, #fff), 0 0 42px var(--tc, #fff), 0 0 90px var(--tc, #fff), 0 6px 0 rgba(0,0,0,.55); }
.op-title.go { animation: slam 2.3s cubic-bezier(.2,1.3,.3,1) forwards; }
@keyframes slam {
  0%   { opacity: 0; transform: scale(2.8) rotate(-8deg); filter: blur(8px); }
  11%  { opacity: 1; transform: scale(.9) rotate(-4deg); filter: none; }
  19%  { transform: scale(1.06) rotate(-4deg); }
  27%  { transform: scale(1) rotate(-4deg); }
  78%  { opacity: 1; transform: scale(1.03) rotate(-4deg); }
  100% { opacity: 0; transform: scale(1.12) rotate(-4deg) translateY(-14px); }
}
/* matemática: fallo de imagen mientras se carga */
.opener.glitch { animation: glitch 1.1s steps(1) infinite; }
@keyframes glitch {
  0%, 100% { filter: none; } 8% { filter: hue-rotate(90deg) saturate(2); } 12% { filter: invert(1); } 16% { filter: none; }
  44% { filter: hue-rotate(-140deg) contrast(1.6); } 48% { filter: none; } 72% { filter: invert(1) hue-rotate(180deg); } 75% { filter: none; }
}
.opener.glitch .op-stage { animation: jit .14s steps(2) infinite; }
@keyframes jit { 50% { transform: scale(1.1) translate(6px, -3px) skewX(5deg); } }
.op-top { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.op-count { font-family: 'Bebas Neue'; font-size: 1.5rem; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.op-hint {
  position: absolute; left: 0; right: 0; bottom: max(28px, 5vh); z-index: 30; text-align: center;
  font-size: .9rem; color: rgba(255,255,255,.75); letter-spacing: .05em; pointer-events: none;
  animation: hintb 2s ease-in-out infinite;
}
@keyframes hintb { 50% { opacity: .45; } }
.op-rar { position: absolute; left: 0; right: 0; bottom: max(70px, 10vh); text-align: center; z-index: 30; font-family: 'Bebas Neue'; font-size: 2rem; letter-spacing: .14em; opacity: 0; transition: opacity .3s; text-shadow: 0 0 24px currentColor; }
.op-rar.show { opacity: 1; }
.op-cred { display: block; margin-top: .3rem; font-family: 'Space Grotesk', sans-serif; font-size: .82rem; letter-spacing: .06em; color: rgba(255,255,255,.78); text-shadow: 0 1px 6px #000; }

/* sobre en la escena */
.op-pack { position: relative; --w: min(300px, 62vw, calc((100vh - 200px) * 10 / 17)); width: var(--w); aspect-ratio: 10 / 17; animation: drop .9s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes drop { from { transform: translateY(-120vh) rotate(-14deg) scale(.7); } to { transform: none; } }
.op-pack .float { position: absolute; inset: 0; animation: floaty 3.4s ease-in-out .9s infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-12px) rotate(1.2deg); } }
.op-pack .half { position: absolute; inset: 0; }
.op-pack .half .pk { --w: 100%; position: absolute; inset: 0; }
.op-pack .h-top { z-index: 2; }
.op-pack .pk { perspective: 1500px; }
/* en la escena el sobre entra girando y luego se mece (las dos mitades a la vez) */
.op-pack .pk-3d { animation: pk-entra 1.05s cubic-bezier(.15,.85,.3,1) both, pk-mece 7s ease-in-out 1.05s infinite; }
@keyframes pk-entra { from { transform: rotateY(-562deg) rotateX(18deg); } to { transform: rotateY(-22deg) rotateX(4deg); } }
.op-pack.torn .h-top .pk-3d { animation: pk-tumba .8s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes pk-tumba { from { transform: rotateY(-8deg); } to { transform: rotateY(-70deg) rotateX(60deg); } }
.op-pack .pk-giro > .cutline { transform: translateZ(calc(var(--g) / 2 + 1px)); }
.op-pack.torn .h-top { animation: flyoff .8s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes flyoff { to { transform: translate(45%, -160%) rotate(32deg); opacity: 0; } }
.op-pack.torn .h-body { animation: jolt .35s; }
@keyframes jolt { 25% { transform: translateY(6px) rotate(1deg); } 60% { transform: translateY(-3px) rotate(-1deg); } }
.op-pack.away .h-body { transition: transform .7s cubic-bezier(.5,0,.8,.4), opacity .7s; transform: translateY(120vh) rotate(6deg); opacity: 0; }
.cutline { position: absolute; left: 3%; right: 3%; top: 13%; height: 2px; z-index: 4; border-top: 2px dashed rgba(255,255,255,.55); }
.cutline i {
  position: absolute; top: -3px; left: 0; height: 4px; width: 100%; transform-origin: left; transform: scaleX(var(--cut, 0));
  background: #fff; border-radius: 4px; box-shadow: 0 0 12px #fff, 0 0 30px var(--season), 0 0 60px var(--season);
}
.op-pack.torn .cutline { opacity: 0; transition: opacity .2s; }
.op-shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translate(-6px, 2px) rotate(-1deg); } 40% { transform: translate(6px, -2px) rotate(1deg); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(3px, -1px); } }

/* cartas en la escena: el montón sale por arriba del sobre */
.op-pack { z-index: 2; }
.op-pack.torn, .op-pack.away { pointer-events: none; }
.op-stack-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1; pointer-events: none; }
.op-stack-wrap .op-stack { pointer-events: auto; }
.op-stack { position: relative; --w: min(330px, 74vw, calc((100vh - 230px) * 5 / 7)); width: var(--w); aspect-ratio: 5 / 7; transition: transform .55s cubic-bezier(.2,.9,.3,1.1); }
.op-stack.emerge { transform: translateY(12%) scale(.8); transition: transform .65s cubic-bezier(.3,1.2,.5,1); }
.op-stack.emerge.up { transform: translateY(-46%) scale(.8); }
/* giro lento de las especiales */
.op-card.spin1 .tc-in { animation: spin1 var(--spin, 1.3s) cubic-bezier(.45,0,.25,1) both; }
.op-card.spin2 .tc-in { animation: spin2 var(--spin, 2.7s) cubic-bezier(.5,0,.2,1) both; }
@keyframes spin1 {
  0%   { transform: rotateY(180deg) scale(1); }
  45%  { transform: rotateY(450deg) scale(1.16) translateY(-4%); }
  100% { transform: rotateY(720deg) scale(1); }
}
@keyframes spin2 {
  0%   { transform: rotateY(180deg) scale(1); }
  25%  { transform: rotateY(480deg) scale(1.16) translateY(-4%); }
  65%  { transform: rotateY(900deg) scale(1.26) translateY(-7%); }
  100% { transform: rotateY(1080deg) scale(1); }
}
.op-card.spin1 .tc, .op-card.spin2 .tc { filter: drop-shadow(0 0 22px var(--rc)) drop-shadow(0 0 60px var(--rc)); }
.op-ring {
  position: absolute; left: 50%; top: 50%; z-index: 4; pointer-events: none;
  width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin; border-radius: 50%;
  border: 3px solid var(--rc); box-shadow: 0 0 30px var(--rc), inset 0 0 30px var(--rc);
  animation: ring 1.1s cubic-bezier(.1,.6,.3,1) forwards;
}
@keyframes ring { from { transform: scale(.15); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.op-card.glow .tc-face { box-shadow: 0 0 0 2px var(--rc) inset, 0 0 30px var(--rc), 0 0 80px color-mix(in srgb, var(--rc) 60%, transparent); transition: box-shadow .4s; }
.op-card { position: absolute; inset: 0; transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .4s; will-change: transform; }
.op-card .tc { --w: 100%; position: absolute; inset: 0; }
.op-card.rise { transform: translateY(40vh) scale(.6); opacity: 0; }
.op-card.flying { transition: transform .5s cubic-bezier(.4,0,.9,.6), opacity .5s; }
.op-card.dragging { transition: none; }
.op-card .tc-in { transition: transform .7s cubic-bezier(.3,1.3,.5,1); }
.op-card.facedown .tc-in { transform: rotateY(180deg); }
.op-card.charging .tc { animation: charge .35s ease-in-out infinite; }
.op-card.charging .tc-back { box-shadow: 0 0 0 3px var(--rc) inset, 0 0 30px var(--rc), 0 0 90px var(--rc), 0 0 160px color-mix(in srgb, var(--rc) 50%, transparent); }
/* boca abajo en el montón: sin color, para no chivar la rareza hasta que le toca */
.op-card.facedown:not(.charging) .tc-back { box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 18px 40px rgba(0,0,0,.55); }
@keyframes charge { 25% { transform: translate(-3px, 1px) rotate(-.8deg); } 75% { transform: translate(3px, -1px) rotate(.8deg); } }
.op-card.heart .tc { animation: heart .5s ease-in-out infinite; }
@keyframes heart { 30% { transform: scale(1.06); } 60% { transform: scale(.98); } }
.op-card.pop .tc { animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
.op-card .badge-new { top: -14px; font-size: .7rem; }

/* resumen */
.op-sum { position: absolute; inset: 0; z-index: 25; overflow-y: auto; padding: 70px var(--gutter) 40px; display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.op-sum h2 { font-family: 'Bebas Neue'; font-weight: 400; font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1; text-align: center; }
.op-sum p { color: var(--text-2); text-align: center; }
.sum-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.1rem; max-width: 980px; }
.sum-grid .slot { position: relative; animation: sumin .5s backwards; }
.sum-grid .tc { --w: clamp(96px, 17vw, 150px); cursor: pointer; }
@keyframes sumin { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.sum-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 500; transform: translateX(-50%) translateY(90px); opacity: 0;
  padding: .8rem 1.3rem; border-radius: 10px; background: #1f1f1f; border: 1px solid var(--line-2);
  font-size: .9rem; font-weight: 500; transition: transform .3s, opacity .3s; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { transform: translateX(-50%); opacity: 1; }
#toast.bad { border-color: #ff7a7a; color: #ffb3b3; }

@media (prefers-reduced-motion: reduce) {
  .op-rays, .pk-glint, .tc.idle .tc-in, .op-pack .float, .op-pack .pk-3d, .opener.glitch, .opener.glitch .op-stage, .op-stage.impacto { animation: none !important; }
  .op-title.go { animation: slam 2.3s linear forwards; }
}

/* aviso de música: el navegador no deja sonar nada hasta que se toca la página */
.musica-aviso {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(16,16,16,.88); color: #fff; font: inherit; font-size: .82rem; white-space: nowrap; cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.musica-aviso[hidden] { display: none; }
.musica-aviso::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--season) 55%, transparent); animation: musicaAviso 2.4s ease-out infinite; }
@keyframes musicaAviso { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.08, 1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .musica-aviso::after, .sd.today::after { animation: none; } }

/* panel de sonido: volumen de la música y de los efectos */
.audio { position: relative; }
.audio-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; width: min(250px, calc(100vw - 32px));
  display: grid; gap: .45rem; padding: .9rem 1rem 1rem; border-radius: 12px;
  background: #161616; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 40px rgba(0,0,0,.55);
}
.audio-panel[hidden] { display: none; }
.audio-panel .kicker { margin: 0 0 .15rem; }
.audio-panel .vol { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; font-weight: 600; }
.audio-panel .vol output { font-size: .75rem; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.audio-panel input[type=range] { width: 100%; margin: 0 0 .5rem; accent-color: var(--season); cursor: pointer; }
.audio-panel #silencioBtn { justify-self: stretch; }
.audio-panel #silencioBtn[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
@media (max-width: 520px) { .audio-panel { position: fixed; top: 58px; right: 16px; } }

/* ═══════════════════════════════════════════════════════════
   VENTANA DE CONFIRMAR (comprar, vender, usar cupón)
═══════════════════════════════════════════════════════════ */
.dlg-fondo {
  position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(0,0,0,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease;
}
.dlg-fondo.abierto { opacity: 1; }
.dlg-fondo.cerrando { opacity: 0; transition-duration: .18s; }
.dlg {
  position: relative; width: min(370px, 100%); display: grid; justify-items: center; gap: .75rem; text-align: center;
  padding: 1.5rem 1.4rem 1.25rem; border-radius: 18px;
  background: linear-gradient(180deg, #1c1c1c 0%, #121212 100%); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(18px) scale(.94); opacity: 0;
  transition: transform .32s cubic-bezier(.2,1.25,.35,1), opacity .2s ease;
}
.dlg-fondo.abierto .dlg { transform: none; opacity: 1; }
.dlg-fondo.cerrando .dlg { transform: translateY(10px) scale(.97); opacity: 0; transition: transform .18s ease-in, opacity .16s ease-in; }
.dlg::before {    /* resplandor del color de la temporada detrás del sobre */
  content: ''; position: absolute; left: 50%; top: 0; width: 70%; height: 140px; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--season) 40%, transparent), transparent); pointer-events: none; border-radius: 50%;
}
.dlg.peligro::before { background: radial-gradient(closest-side, rgba(255,80,80,.35), transparent); }
.dlg > * { position: relative; }
.dlg-vis { margin: -.2rem 0 .1rem; }
.dlg-vis .pk { --w: 104px; filter: drop-shadow(0 14px 22px rgba(0,0,0,.55)); }
.dlg-fondo.abierto .dlg-vis .pk { animation: dlgsobre .6s cubic-bezier(.2,1.35,.35,1) .04s backwards; }
@keyframes dlgsobre { from { transform: translateY(26px) rotate(-8deg) scale(.82); opacity: 0; } }
.dlg h2 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 2.1rem; line-height: 1; letter-spacing: .03em; }
.dlg p { color: var(--text-2); font-size: .93rem; line-height: 1.45; max-width: 30ch; }
.dlg-precio { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: .1rem .45rem;
  font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; line-height: 1; }
.dlg-precio span { font-size: .78em; }
.dlg-precio small { flex-basis: 100%; font-family: 'Space Grotesk', sans-serif; font-size: .78rem; color: var(--text-3); letter-spacing: .02em; }
.dlg-precio.cupon { font-size: 2rem; color: #c9b8ff; }
.dlg-acc { display: flex; gap: .6rem; width: 100%; margin-top: .35rem; }
.dlg-acc .btn { flex: 1; }
.btn.peligro { background: #e8433f; border-color: #e8433f; color: #fff; }
.btn.peligro:hover:not(:disabled) { background: #ff5a55; }

/* cupón sobre (en la tienda) */
.cupon {
  display: flex; align-items: center; gap: .9rem; margin-top: 1.1rem; padding: .85rem 1rem; border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--twitch) 65%, transparent);
  background: linear-gradient(110deg, color-mix(in srgb, var(--twitch) 16%, transparent), transparent 70%);
}
.cupon[hidden] { display: none; }
.cupon-tique { font-size: 1.8rem; line-height: 1; transform: rotate(-12deg); }
.cupon-info { flex: 1; display: grid; gap: .1rem; font-size: .82rem; color: var(--text-2); min-width: 0; }
.cupon-info b { font-size: .95rem; color: #fff; letter-spacing: .02em; }
.cupon-n { color: var(--text-3); font-weight: 600; }
.cupon.lleno { border-style: solid; }
.cupon.lleno .cupon-n { color: #c9b8ff; }
.cupon.lleno #cuponBtn { background: var(--twitch); border-color: var(--twitch); color: #fff; }
.cupon.nuevo { animation: cuponnuevo 1.1s cubic-bezier(.2,1.2,.35,1); }
@keyframes cuponnuevo { 0% { transform: scale(.96); box-shadow: 0 0 0 0 color-mix(in srgb, var(--twitch) 70%, transparent); }
  40% { transform: scale(1.03); } 100% { transform: none; box-shadow: 0 0 0 14px transparent; } }
@media (max-width: 420px) { .cupon { flex-wrap: wrap; } }

@media (prefers-reduced-motion: reduce) {
  .dlg-fondo, .dlg { transition: none; }
  .dlg-fondo.abierto .dlg-vis .pk, .cupon.nuevo { animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   TRADEOS
═══════════════════════════════════════════════════════════ */
.tr-cab { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tr-cab h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.tr-cab .btn { margin-left: auto; }
.tr-badge { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 999px;
  background: var(--season); color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: 0; }
.tr-badge[hidden] { display: none; }
.tr-hoy { font-size: .78rem; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; font-variant-numeric: tabular-nums; }
.tr-hoy.lleno { color: #ffb3b3; border-color: rgba(255,122,122,.5); }
.tr-box > .sub { margin-top: .4rem; }
.tr-tit { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 1rem 0 .55rem; }
.tr-item { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; gap: .8rem; background: rgba(255,255,255,.02); margin-bottom: .7rem; }
.tr-item.recibida { border-color: color-mix(in srgb, var(--season) 45%, var(--line)); background: color-mix(in srgb, var(--season) 6%, transparent); }
.tr-quien { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.tr-quien img { width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; }
.tr-quien small { margin-left: auto; color: var(--text-3); font-size: .75rem; }
.tr-trato { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tr-lado { display: grid; gap: .35rem; }
.tr-flecha { font-size: 1.4rem; color: var(--text-3); }
.tr-cartas { display: flex; gap: .45rem; flex-wrap: wrap; }
.tr-mini { position: relative; }
.tr-mini .tc { --w: 66px; cursor: pointer; }
.tr-mini .badge-qty { right: -6px; top: -6px; }
.tr-acc { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.tr-hist { margin-top: .8rem; font-size: .85rem; color: var(--text-2); }
.tr-hist summary { cursor: pointer; color: var(--text-3); font-size: .8rem; letter-spacing: .05em; }
.tr-hist ul { list-style: none; display: grid; gap: .35rem; margin-top: .6rem; }
.tr-hist .e-aceptado { color: #7dffb0; } .tr-hist .e-rechazado { color: #ffb3b3; } .tr-hist .e-cancelado, .tr-hist .e-caducado { color: var(--text-3); }

/* ventana de proponer */
.trp { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(0,0,0,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.trp.abierto { opacity: 1; }
.trp-caja { position: relative; width: min(760px, 100%); min-width: 0; max-height: min(860px, calc(100dvh - 2 * var(--gutter))); display: flex; flex-direction: column;
  border-radius: 18px; background: linear-gradient(180deg, #1c1c1c, #121212); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.65);
  transform: translateY(16px) scale(.97); transition: transform .3s cubic-bezier(.2,1.2,.35,1); overflow: hidden; }
.trp.abierto .trp-caja { transform: none; }
.trp-cab { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem .4rem; }
.trp-cab h2 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 2rem; line-height: 1; }
.trp-cab .m-close { position: static; }
.trp-paso1, .trp-paso2 { padding: .4rem 1.2rem 1rem; display: grid; gap: .6rem; min-height: 0; }
.trp-paso2 { flex: 1; grid-template-rows: auto auto auto 1fr; overflow: hidden; }
.trp-paso1[hidden], .trp-paso2[hidden] { display: none; }
#trpBuscar { width: 100%; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--line-2); background: #0f0f0f; color: #fff; font: inherit; font-size: 1rem; }
#trpBuscar:focus { outline: 2px solid #fff; outline-offset: 2px; }
.trp-sug { display: grid; gap: .35rem; }
.trp-jug { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--line); text-align: left; font: inherit; color: #fff; background: rgba(255,255,255,.03); cursor: pointer; }
.trp-jug:hover, .trp-jug:focus-visible { border-color: #fff; }
.trp-jug img, .trp-con img { width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; }
.trp-jug small { margin-left: auto; color: var(--text-3); }
.trp-nota { font-size: .8rem; color: var(--text-3); }
.trp-con { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.trp-tabs { display: flex; gap: .4rem; }
.trp-tabs button { flex: 1; padding: .6rem; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; }
.trp-tabs button[aria-selected="true"] { background: #fff; color: #111; border-color: #fff; }
.trp-tabs b { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; margin-left: .3rem; border-radius: 999px; background: var(--season); color: #fff; font-size: .75rem; }
.trp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); min-width: 0; gap: .8rem; overflow-y: auto; padding: .5rem .2rem .8rem; align-content: start; }
.trp-carta { position: relative; display: grid; justify-items: center; min-width: 0; }
.trp-carta .tc { --w: min(100%, 120px); cursor: pointer; transition: transform .15s, filter .15s; }
.trp-carta.elegida .tc { transform: translateY(-4px); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--season) 80%, transparent)); }
.trp-tiene { position: absolute; left: 4px; bottom: 4px; font-size: .7rem; font-weight: 700; padding: .05rem .35rem; border-radius: 5px; background: rgba(0,0,0,.7); color: #fff; }
.trp-elegidas { position: absolute; right: -4px; top: -6px; min-width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 999px; background: var(--season); color: #fff; font-weight: 700; font-size: .8rem; box-shadow: 0 0 0 2px #121212; }
.trp-menos { position: absolute; left: -4px; top: -6px; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0; background: #fff; color: #111; font-weight: 800; cursor: pointer; box-shadow: 0 0 0 2px #121212; }
.trp-pie { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); background: rgba(0,0,0,.25); }
.trp-pie span { flex: 1; font-size: .88rem; color: var(--text-2); }
@media (max-width: 520px) { .trp { padding: 0; place-items: stretch; } .trp-caja { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .trp-cab, .trp-paso1, .trp-paso2, .trp-pie { padding-left: 14px; padding-right: 14px; } .trp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .trp-carta .tc { --w: 100%; } .tr-mini .tc { --w: 56px; } }
@media (prefers-reduced-motion: reduce) { .trp, .trp-caja { transition: none; } }

/* ═══════════════════════════════════════════════════════════
   ABRIR VARIOS DE GOLPE
═══════════════════════════════════════════════════════════ */
.shelf-cab { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.shelf-cab .btn { margin-left: auto; }
.shelf.nuevo .pk:last-child { animation: pk-nuevo .9s cubic-bezier(.2,1.3,.35,1); }
@keyframes pk-nuevo { from { transform: translateY(-40px) scale(.7); opacity: 0; } }

/* los sobres caen en abanico */
.op-many { position: relative; width: min(96vw, 980px); height: min(62vh, 460px);
  --paso: min(86px, calc(min(96vw, 980px) / (var(--n) + 1.4))); --pw: min(150px, max(calc(var(--paso) * 1.55), 24vw)); }
.om-pack { position: absolute; left: 50%; top: 50%; width: var(--pw); margin-left: calc(var(--pw) / -2); margin-top: calc(var(--pw) * -.85);
  transform: translateX(calc(var(--k) * var(--paso))) translateY(calc(var(--ky) * 9px)) rotate(calc(var(--k) * 3.5deg)); }
.om-pack .pk { --w: 100%; perspective: 900px; }
.om-cae { animation: om-cae .75s cubic-bezier(.2,1.25,.4,1) both; }
@keyframes om-cae { from { transform: translateY(-110vh) rotate(-24deg); } }
.om-pack.abierto .om-cae { animation: om-rasga .62s cubic-bezier(.5,0,.8,.5) forwards; }
@keyframes om-rasga { 0% { transform: none; } 22% { transform: translateY(10px) scale(1.05); } 100% { transform: translateY(-80vh) rotate(calc(var(--k) * 14deg)) scale(.5); opacity: 0; } }

/* resumen con muchas cartas (varios sobres): más pequeñas */
.sum-grid.muchas { gap: .8rem .6rem; }
.sum-grid.muchas .tc { --w: clamp(62px, 13vw, 112px); }
.sum-grid.muchas .badge-new { font-size: .58rem; top: -10px; }

/* cupones: precios de las tres recompensas y botón de usar varios */
.cupon-precios { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 .1rem; }
.cupon-precios span { padding: .12rem .45rem; border-radius: 6px; background: rgba(145,70,255,.16); border: 1px solid rgba(145,70,255,.35); font-size: .74rem; color: #ddd0ff; white-space: nowrap; }
.cupon-precios b { color: #fff; font-size: .74rem; }
.cupon-btns { display: flex; flex-direction: column; gap: .4rem; }
.cupon.lleno #cuponVarios { background: linear-gradient(135deg, #ff4646, #ff9a3c); border-color: transparent; color: #fff; }
@media (max-width: 420px) { .cupon-btns { width: 100%; flex-direction: row; } .cupon-btns .btn { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .om-cae, .shelf.nuevo .pk:last-child { animation: none !important; } }

/* botón «Pasar normales» (abrir varios de golpe): debajo de la carta, a mano del pulgar en el móvil */
.op-auto { position: absolute; left: 0; right: 0; z-index: 30;
  top: calc(50% + min(330px, 74vw, calc((100vh - 230px) * 5 / 7)) * .7 + 42px);   /* justo debajo del montón de cartas (mismo tamaño que .op-stack) */
  display: flex; justify-content: center; pointer-events: none; }
.op-auto .btn { pointer-events: auto; min-width: 12rem; justify-content: center; background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.op-auto .btn[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
.op-auto .btn[hidden] { display: none; }

/* resumen con muchas cartas: repetidas juntas (×N) y cuántas de cada rareza */
.sum-grid .badge-x { position: absolute; right: -6px; bottom: -8px; z-index: 3; padding: .12rem .45rem; border-radius: 6px; background: #fff; color: #111;
  font: 700 .8rem 'Space Grotesk', sans-serif; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.sum-rarezas { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; font-size: .9rem; }
.sum-rarezas:empty { display: none; }
.sum-rarezas b { color: #fff; }
/* abanico de muchos sobres: cartel con cuántos son */
.om-total { position: absolute; left: 50%; bottom: -1.2rem; transform: translateX(-50%); z-index: 200; padding: .2rem .9rem; border-radius: 10px;
  font: 400 2.4rem/1 'Bebas Neue', sans-serif; color: #fff; background: linear-gradient(135deg, #ff4646, #ffb13c); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
