* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #dfe8f6;
}

button {
    font-family: inherit;
}

.packs-screen {
    width: 100vw;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.packs-scene {
    position: relative;
    width: min(100vw, calc(100svh * 16 / 9));
    height: min(100svh, calc(100vw * 9 / 16));
    overflow: hidden;
    isolation: isolate;
}

.packs-bg,
.packs-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.packs-bg img {
  object-fit: fill;
}

/* BOTÓN VOLVER */
.back-button {
    position: absolute;
    top: 5.2%;
    left: 4.2%;
    z-index: 10;

    min-width: 110px;
    height: 40px;
    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;

    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 7px;

    color: #fff;
    background: rgba(20, 73, 160, 0.88);

    font-size: clamp(11px, 1.2vw, 15px);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;

    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.28);
}

.back-button span {
    font-size: 22px;
    line-height: 0.8;
    margin-top: -1px;
}

.back-button:hover {
    background: rgba(34, 95, 190, 0.95);
}

/* TÍTULO */
.packs-title {
    position: absolute;
    top: 8.4%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;

    color: #fff;
    font-size: clamp(28px, 3.3vw, 44px);
    font-weight: 900;
    line-height: 1;

    text-align: center;
    letter-spacing: -0.8px;
    text-shadow: 0 3px 9px rgba(0, 0, 0, 0.38);
    white-space: nowrap;
}

/* CONTADOR */
.packs-counter {
    position: absolute;
    top: 16.8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;

    width: clamp(240px, 30vw, 360px);
    height: clamp(42px, 5vw, 58px);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.1vw, 16px);

    border: 3px solid rgba(255, 255, 255, 0.9);
    border-left-color: rgba(0, 126, 76, 0.85);
    border-radius: 999px;

    background: rgba(20, 77, 165, 0.86);
    color: #fff;

    font-size: clamp(14px, 1.45vw, 18px);
    font-weight: 900;

    box-shadow:
        0 0 15px rgba(36, 149, 255, 0.35),
        inset 0 0 12px rgba(255, 255, 255, 0.08);
}

.packs-counter img {
    width: clamp(22px, 2.4vw, 34px);
    height: auto;
    display: block;
    object-fit: contain;
    transform: rotate(-6deg);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

/* CARRUSEL */
.packs-carousel {
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    z-index: 4;

    width: 90%;
    height: 44%;

    display: flex;
    align-items: center;

    overflow: hidden;
}

.packs-track {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    gap: clamp(34px, 4vw, 74px);

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    padding: 0 37%;

    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;

    scrollbar-width: none;
}

.packs-track::-webkit-scrollbar {
    display: none;
}

.packs-track.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.pack-card {
    flex: 0 0 auto;
    width: clamp(118px, 14vw, 205px);
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    scroll-snap-align: center;

    transform: scale(0.72);
    opacity: 0.72;

    transition:
        transform 0.22s ease,
        opacity 0.22s ease,
        filter 0.22s ease;
}

.pack-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    pointer-events: none;

    filter: drop-shadow(0 14px 13px rgba(0, 0, 0, 0.32));
}

.pack-card.is-near {
    transform: scale(0.92);
    opacity: 0.95;
}

.pack-card.is-active {
    transform: scale(1.28);
    opacity: 1;
    z-index: 2;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.5)) drop-shadow(0 0 8px rgba(192, 192, 192, 0.4)) drop-shadow(0 14px 13px rgba(0, 0, 0, 0.32));
}

.pack-card.is-opened img {
    filter: grayscale(1) brightness(0.8);
    opacity: 0.7;
}

/* BOTÓN ABRIR SOBRE */
.open-pack-button {
    position: absolute;
    left: 50%;
    bottom: 9.8%;
    transform: translateX(-50%);
    z-index: 8;

    min-width: clamp(190px, 19vw, 250px);
    height: clamp(44px, 5vw, 60px);
    padding: 0 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 999px;

    color: #fff;
    background:
        radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.42), transparent 35%),
        linear-gradient(180deg, rgba(70, 169, 255, 0.96), rgba(27, 82, 195, 0.96));

    font-size: clamp(18px, 2vw, 25px);
    font-weight: 900;
    cursor: pointer;

    box-shadow:
        0 0 13px rgba(87, 200, 255, 0.95),
        inset 0 0 12px rgba(255, 255, 255, 0.28),
        0 8px 18px rgba(0, 0, 0, 0.28);

    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.open-pack-button:hover {
    filter: brightness(1.08);
}

.cards-icon {
    position: relative;
    width: 24px;
    height: 28px;
    display: inline-block;
}

.cards-icon::before,
.cards-icon::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 3px;
    background: rgba(45, 125, 230, 0.55);
}

.cards-icon::before {
    left: 2px;
    top: 3px;
    transform: rotate(-18deg);
}

.cards-icon::after {
    left: 8px;
    top: 0;
    transform: rotate(16deg);
}

/* PANTALLAS MEDIAS */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: landscape) {
    .packs-title {
        top: 8%;
        font-size: clamp(28px, 3.4vw, 38px);
    }

    .packs-counter {
        top: 16.4%;
    }

    .packs-carousel {
        top: 28%;
        width: 92%;
        height: 43%;
    }

    .packs-track {
        gap: clamp(28px, 3.8vw, 58px);
        padding: 0 36%;
    }

    .pack-card {
        width: clamp(105px, 14vw, 170px);
    }

    .pack-card.is-active {
        transform: scale(1.25);
    }
}

/* PANTALLAS BAJITAS */
@media (max-height: 620px) and (orientation: landscape) {
    .back-button {
        top: 4.6%;
    }

    .packs-title {
        top: 8%;
        font-size: clamp(24px, 3vw, 34px);
    }

    .packs-counter {
        top: 16%;
        height: 42px;
    }

    .packs-carousel {
        top: 28%;
        height: 42%;
    }

    .pack-card {
        width: clamp(92px, 13vw, 155px);
    }

    .pack-card.is-active {
        transform: scale(1.22);
    }

    .open-pack-button {
        bottom: 8.5%;
        height: 44px;
        font-size: clamp(16px, 1.7vw, 21px);
    }
}

/* CELULAR VERTICAL */
@media (max-width: 768px) and (orientation: portrait) {
    .packs-scene {
        width: min(100vw, calc(100svh * 9 / 16));
        height: min(100svh, calc(100vw * 16 / 9));
    }

    .packs-bg img {
        object-fit: cover;
    }

    .back-button {
        top: 2.5%;
        left: 5%;
        height: 32px;
        min-width: 90px;
        font-size: clamp(10px, 3vw, 13px);
        padding: 0 10px;
    }

    .packs-title {
        top: 8%;
        font-size: clamp(30px, 9vw, 44px);
    }

    .packs-counter {
        top: 15%;
        width: 82%;
        height: 48px;
        font-size: clamp(14px, 4vw, 18px);
    }

    .packs-carousel {
        top: 27%;
        width: 100%;
        height: 43%;
    }

    .packs-track {
        gap: 24px;
        padding: 0 33%;
    }

    .pack-card {
        width: clamp(120px, 38vw, 190px);
        transform: scale(0.75);
    }

    .pack-card.is-near {
        transform: scale(0.92);
    }

    .pack-card.is-active {
        transform: scale(1.18);
    }

    .open-pack-button {
        bottom: 13%;
        min-width: 215px;
        height: 54px;
        font-size: 21px;
    }
}

/* MODAL ABRIR SOBRE */
.pack-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 8, 28, 0.62);
  backdrop-filter: blur(1px);
}

.pack-modal-overlay.is-open {
  display: flex;
}

.pack-modal {
  position: relative;
  width: 68%;
  height: 80%;
  overflow: hidden;

  border: 2px solid rgba(82, 139, 230, 0.95);
  border-radius: 22px;

  box-shadow:
    0 18px 35px rgba(0, 0, 0, 0.45),
    inset 0 0 20px rgba(255, 255, 255, 0.08);

  animation: packModalIn 0.22s ease-out;
}

.pack-modal-bg,
.pack-modal-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.pack-modal-bg img {
  object-fit: fill;
}

.pack-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0, 70, 170, 0.08), rgba(0, 8, 35, 0.18)),
    rgba(0, 18, 70, 0.08);
  pointer-events: none;
}

.pack-modal-close {
  position: absolute;
  top: 4.5%;
  right: 3.5%;
  z-index: 5;

  width: clamp(34px, 3.6vw, 46px);
  height: clamp(34px, 3.6vw, 46px);

  display: flex;
  align-items: center;
  justify-content: center;

  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;

  color: #fff;
  background: rgba(25, 79, 165, 0.95);

  font-size: clamp(18px, 2vw, 25px);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}

.pack-modal-close:hover {
  background: rgba(37, 101, 205, 0.98);
}

.pack-modal-content {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.pack-modal-content h2 {
  margin-top: 6.5%;

  color: #fff;
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 900;
  line-height: 1;

  text-align: center;
  text-shadow:
    0 3px 8px rgba(0, 0, 0, 0.45),
    0 0 6px rgba(63, 139, 255, 0.65);
}

.pack-modal-content p {
  margin-top: 1.3%;

  color: #fff;
  font-size: clamp(13px, 1.45vw, 19px);
  font-weight: 900;
  text-align: center;

  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
}

.pack-modal-envelope {
  position: absolute;
  left: 50%;
  top: 50%;

  width: clamp(180px, 20vw, 270px);
  height: auto;

  transform: translate(-50%, -35%) rotate(-7deg);
  object-fit: contain;

  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42));
  user-select: none;
  pointer-events: none;
}

.pack-modal-overlay.is-open .pack-modal-envelope {
  animation: packEnvelopeFloat 1.8s ease-in-out infinite;
}

@keyframes packModalIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes packEnvelopeFloat {
  0% {
    transform: translate(-50%, -35%) rotate(-7deg) scale(1) skewY(0deg);
    opacity: 1;
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1) contrast(1);
  }

  5% {
    transform: translate(-50%, -35%) rotate(-8deg) scale(1.01) skewY(-1deg);
  }

  10% {
    transform: translate(-50%, -36%) rotate(-6deg) scale(1.02) skewY(1deg);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1.05) contrast(1.05);
  }

  15% {
    transform: translate(-50%, -34%) rotate(2deg) scale(1.05) skewY(-2deg);
  }

  20% {
    transform: translate(-48%, -30%) rotate(8deg) scale(1.08) skewY(2deg);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1.12) contrast(1.1);
  }

  25% {
    transform: translate(-52%, -26%) rotate(15deg) scale(1.12) skewY(-3deg);
  }

  30% {
    transform: translate(-45%, -22%) rotate(22deg) scale(1.15) skewY(3deg);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1.2) contrast(1.15);
  }

  35% {
    transform: translate(-55%, -20%) rotate(28deg) scale(1.18) skewY(-2deg);
  }

  40% {
    transform: translate(-50%, -18%) rotate(32deg) scale(1.2) skewY(2deg);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1.25) contrast(1.2);
  }

  45% {
    transform: translate(-48%, -24%) rotate(25deg) scale(1.16) skewY(-1deg);
  }

  50% {
    transform: translate(-50%, -30%) rotate(18deg) scale(1.12) skewY(1deg);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1.15) contrast(1.1);
  }

  55% {
    transform: translate(-52%, -28%) rotate(10deg) scale(1.08) skewY(-0.5deg);
  }

  60% {
    transform: translate(-49%, -26%) rotate(4deg) scale(1.05) skewY(0.5deg);
  }

  65% {
    transform: translate(-50%, -30%) rotate(-1deg) scale(1.03);
  }

  70% {
    transform: translate(-51%, -32%) rotate(-4deg) scale(1.02);
  }

  75% {
    transform: translate(-50%, -33%) rotate(-5deg) scale(1.01);
  }

  80% {
    transform: translate(-49%, -34%) rotate(-6deg) scale(1.005);
  }

  85% {
    transform: translate(-50%, -34.5%) rotate(-6.5deg) scale(1.003);
  }

  90% {
    transform: translate(-50%, -35%) rotate(-7deg) scale(1.001);
  }

  100% {
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    opacity: 1;
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.42)) brightness(1) contrast(1);
  }
}

/* MODAL EN PANTALLAS BAJITAS */
@media (max-height: 620px) and (orientation: landscape) {
  .pack-modal {
    width: 68%;
    height: 78%;
  }

  .pack-modal-content h2 {
    margin-top: 5.5%;
    font-size: clamp(24px, 3vw, 38px);
  }

  .pack-modal-content p {
    font-size: clamp(12px, 1.3vw, 16px);
  }

  .pack-modal-envelope {
    width: clamp(150px, 18vw, 240px);
    transform: translate(-50%, -32%) rotate(-7deg);
  }
}

/* MODAL MÓVIL */
@media (max-width: 768px) {
  .pack-modal {
    width: 86%;
    height: 70%;
    border-radius: 18px;
  }

  .pack-modal-bg img {
    object-fit: cover;
  }

  .pack-modal-close {
    top: 3.5%;
    right: 4%;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .pack-modal-content h2 {
    margin-top: 18%;
    font-size: clamp(28px, 8vw, 42px);
  }

  .pack-modal-content p {
    width: 82%;
    margin-top: 10px;
    font-size: clamp(14px, 4vw, 18px);
  }

  .pack-modal-envelope {
    top: 55%;
    width: clamp(170px, 50vw, 260px);
    transform: translate(-50%, -35%) rotate(-7deg);
  }
}

/* ANIMACIÓN MEJORADA DE APERTURA DE SOBRE
   Pega este bloque completo al final o usa este CSS completo.
   Requiere en JS las clases:
   is-clickable, is-rip-show, is-rip-out, is-hidden,
   is-opened-result, is-visible, opened-show, show-card.
*/

.pack-modal-envelope {
  cursor: pointer;
  pointer-events: auto;
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease,
    transform 0.45s ease,
    filter 0.45s ease;
}

.pack-modal-envelope.is-clickable:hover {
  filter:
    drop-shadow(0 0 18px rgba(255, 220, 90, 1))
    drop-shadow(0 18px 20px rgba(0, 0, 0, 0.45));
}

/* Esta regla gana sobre el float inicial del sobre */
.pack-modal-overlay.is-open .pack-modal-envelope.is-rip-show {
  animation: ripShowElegant 1.25s ease-in-out forwards !important;
}

/* Esta regla gana sobre el float inicial del sobre */
.pack-modal-overlay.is-open .pack-modal-envelope.is-rip-out {
  animation: ripOutElegant 0.75s ease-in forwards !important;
}

.pack-modal-envelope.is-hidden,
.pack-modal-overlay.is-open .pack-modal-envelope.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: none !important;
}

@keyframes ripShowElegant {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) rotate(-10deg) scale(0.78);
    filter:
      drop-shadow(0 0 0 rgba(255, 220, 90, 0))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.4));
  }

  35% {
    opacity: 1;
    transform: translate(-50%, -38%) rotate(-5deg) scale(1.08);
    filter:
      drop-shadow(0 0 28px rgba(255, 226, 98, 1))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.48));
  }

  65% {
    transform: translate(-50%, -35%) rotate(4deg) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    filter:
      drop-shadow(0 0 18px rgba(255, 226, 98, 0.75))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.45));
  }
}

@keyframes ripOutElegant {
  0% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
  }

  45% {
    opacity: 1;
    transform: translate(-50%, -42%) rotate(8deg) scale(1.08);
    filter:
      drop-shadow(0 0 34px rgba(255, 226, 98, 1))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.48));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -55%) rotate(-16deg) scale(0.55);
    filter:
      drop-shadow(0 0 40px rgba(255, 226, 98, 0))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0));
  }
}

/* RESULTADO DEL SOBRE ABIERTO */
.pack-open-result {
  position: absolute;
  inset: 0;
  z-index: 4;

  display: none;
  align-items: center;
  justify-content: center;

  pointer-events: none;
}

.pack-open-result.is-visible {
  display: flex;
}

/* Imagen abierto.png */
.opened-pack-img {
  position: absolute;
  left: 50%;
  bottom: 1.5%;

  width: clamp(180px, 21vw, 305px);
  height: auto;

  object-fit: contain;
  opacity: 0;

  transform: translateX(-50%) translateY(80px) scale(0.65);
  filter:
    drop-shadow(0 0 22px rgba(255, 218, 70, 0.75))
    drop-shadow(0 18px 20px rgba(0, 0, 0, 0.48));

  z-index: 2;
  animation: none !important;
}

.opened-pack-img.opened-show {
  animation: openedPackRevealElegant 1.15s cubic-bezier(0.2, 1.1, 0.25, 1) forwards !important;
}

@keyframes openedPackRevealElegant {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(90px) scale(0.6);
  }

  45% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.08);
  }

  70% {
    transform: translateX(-50%) translateY(4px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Contenedor de cartas resultado */
.modal-cards-result {
  position: absolute;
  left: 50%;
  top: 48%;

  width: min(76%, 760px);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.7vw, 24px);

  transform: translate(-50%, -50%);
  z-index: 5;
}

/* Cartas */
.modal-result-card {
  width: clamp(88px, 10.5vw, 155px);
  height: auto;
  object-fit: contain;

  opacity: 0;
  transform: translateY(140px) scale(0.35) rotate(0deg);

  user-select: none;
  pointer-events: none;
}

.modal-result-card.card-gold {
  filter:
    drop-shadow(0 0 12px rgba(255, 226, 98, 1))
    drop-shadow(0 0 26px rgba(255, 180, 30, 0.8))
    drop-shadow(0 14px 14px rgba(0, 0, 0, 0.45));
}

.modal-result-card.card-silver {
  filter:
    drop-shadow(0 0 12px rgba(240, 248, 255, 1))
    drop-shadow(0 0 26px rgba(170, 210, 240, 0.8))
    drop-shadow(0 14px 14px rgba(0, 0, 0, 0.45));
}

.modal-result-card.show-card {
  animation: cardRevealElegant 0.9s cubic-bezier(0.18, 1.35, 0.35, 1) forwards !important;
}

.modal-result-card:nth-child(1) {
  --card-rotate: -13deg;
  margin-top: 28px;
}

.modal-result-card:nth-child(2) {
  --card-rotate: -4deg;
  margin-top: -20px;
}

.modal-result-card:nth-child(3) {
  --card-rotate: 4deg;
  margin-top: -20px;
}

.modal-result-card:nth-child(4) {
  --card-rotate: 13deg;
  margin-top: 28px;
}

@keyframes cardRevealElegant {
  0% {
    opacity: 0;
    transform: translateY(140px) scale(0.35) rotate(0deg);
  }

  45% {
    opacity: 1;
    transform: translateY(18px) scale(1.12) rotate(var(--card-rotate));
  }

  70% {
    transform: translateY(-16px) scale(1.04) rotate(var(--card-rotate));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--card-rotate));
  }
}

/* Textos cuando ya abrió */
.pack-modal.is-opened-result .pack-modal-content h2 {
  font-size: clamp(40px, 5vw, 66px);
  margin-top: 7%;
}

.pack-modal.is-opened-result .pack-modal-content p {
  font-size: clamp(17px, 1.8vw, 26px);
  margin-top: 1.4%;
}

/* MODAL RESULTADO EN PANTALLAS BAJITAS */
@media (max-height: 620px) and (orientation: landscape) {
  .opened-pack-img {
    width: clamp(155px, 19vw, 255px);
    bottom: 0.5%;
  }

  .modal-cards-result {
    top: 49%;
    width: 76%;
    gap: clamp(8px, 1.4vw, 18px);
  }

  .modal-result-card {
    width: clamp(72px, 9.5vw, 125px);
  }

  .pack-modal.is-opened-result .pack-modal-content h2 {
    margin-top: 5.5%;
    font-size: clamp(28px, 4vw, 48px);
  }

  .pack-modal.is-opened-result .pack-modal-content p {
    font-size: clamp(14px, 1.6vw, 20px);
  }
}

/* MODAL RESULTADO MÓVIL */
@media (max-width: 768px) {
  .opened-pack-img {
    width: clamp(165px, 52vw, 265px);
    bottom: 6%;
  }

  .modal-cards-result {
    top: 48%;
    width: 94%;
    gap: 4px;
  }

  .modal-result-card {
    width: clamp(68px, 22vw, 105px);
  }

  .modal-result-card:nth-child(1) {
    --card-rotate: -10deg;
    margin-top: 20px;
  }

  .modal-result-card:nth-child(2) {
    --card-rotate: -3deg;
    margin-top: -10px;
  }

  .modal-result-card:nth-child(3) {
    --card-rotate: 3deg;
    margin-top: -10px;
  }

  .modal-result-card:nth-child(4) {
    --card-rotate: 10deg;
    margin-top: 20px;
  }

  .pack-modal.is-opened-result .pack-modal-content h2 {
    margin-top: 18%;
    font-size: clamp(34px, 10vw, 50px);
  }

  .pack-modal.is-opened-result .pack-modal-content p {
    font-size: clamp(16px, 4vw, 21px);
  }
}
/* ============================= */
/* AJUSTE RESPONSIVE RESULTADO MODAL */
/* ============================= */

/* Modal resultado general */
.pack-modal.is-opened-result .pack-modal-content {
  position: relative;
  overflow: hidden;
}

/* Título del resultado */
.pack-modal.is-opened-result .pack-modal-content h2 {
  position: relative;
  z-index: 10;
  margin-top: 6%;
  font-size: clamp(36px, 4.8vw, 64px);
}

.pack-modal.is-opened-result .pack-modal-content p {
  position: relative;
  z-index: 10;
  margin-top: 0.8%;
  font-size: clamp(16px, 1.7vw, 24px);
}

/* Contenedor de cartas en resultado */
.pack-modal.is-opened-result .modal-cards-result {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 78%;
  max-width: 760px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 22px);

  transform: translate(-50%, -50%);
  z-index: 8;
}

/* Cartas del resultado */
.pack-modal.is-opened-result .modal-result-card {
  width: clamp(88px, 10vw, 150px);
  max-width: 22%;
  height: auto;
  object-fit: contain;
}

/* Posición individual de cartas en web */
.pack-modal.is-opened-result .modal-result-card:nth-child(1) {
  --card-rotate: -12deg;
  margin-top: 28px;
}

.pack-modal.is-opened-result .modal-result-card:nth-child(2) {
  --card-rotate: -4deg;
  margin-top: -18px;
}

.pack-modal.is-opened-result .modal-result-card:nth-child(3) {
  --card-rotate: 4deg;
  margin-top: -18px;
}

.pack-modal.is-opened-result .modal-result-card:nth-child(4) {
  --card-rotate: 12deg;
  margin-top: 28px;
}

/* Sobre abierto debajo de las cartas */
.pack-modal.is-opened-result .opened-pack-img {
  position: absolute;
  left: 50%;
  bottom: 2%;

  width: clamp(180px, 22vw, 315px);
  max-width: 36%;

  transform: translateX(-50%);
  z-index: 4;
}

/* Pantallas web bajitas */
@media (max-height: 700px) and (orientation: landscape) {
  .pack-modal.is-opened-result .pack-modal-content h2 {
    margin-top: 4.5%;
    font-size: clamp(32px, 4.2vw, 54px);
  }

  .pack-modal.is-opened-result .pack-modal-content p {
    font-size: clamp(14px, 1.5vw, 20px);
  }

  .pack-modal.is-opened-result .modal-cards-result {
    top: 43%;
    width: 76%;
    gap: clamp(6px, 1vw, 16px);
  }

  .pack-modal.is-opened-result .modal-result-card {
    width: clamp(76px, 9vw, 128px);
  }

  .pack-modal.is-opened-result .opened-pack-img {
    width: clamp(150px, 19vw, 250px);
    bottom: 1%;
  }
}

/* ============================= */
/* MÓVIL */
/* ============================= */

@media (max-width: 768px) {
  .pack-modal {
    width: 86%;
    height: 70%;
    max-height: 720px;
    border-radius: 18px;
  }

  .pack-modal.is-opened-result .pack-modal-content h2 {
    margin-top: 12%;
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1;
  }

  .pack-modal.is-opened-result .pack-modal-content p {
    margin-top: 8px;
    font-size: clamp(15px, 4vw, 20px);
  }

  .pack-modal.is-opened-result .modal-cards-result {
    top: 40%;
    width: 94%;
    max-width: none;
    gap: 2px;
  }

  .pack-modal.is-opened-result .modal-result-card {
    width: clamp(58px, 18vw, 86px);
    max-width: 24%;
  }

  .pack-modal.is-opened-result .modal-result-card:nth-child(1) {
    --card-rotate: -9deg;
    margin-top: 18px;
  }

  .pack-modal.is-opened-result .modal-result-card:nth-child(2) {
    --card-rotate: -3deg;
    margin-top: -8px;
  }

  .pack-modal.is-opened-result .modal-result-card:nth-child(3) {
    --card-rotate: 3deg;
    margin-top: -8px;
  }

  .pack-modal.is-opened-result .modal-result-card:nth-child(4) {
    --card-rotate: 9deg;
    margin-top: 18px;
  }

  .pack-modal.is-opened-result .opened-pack-img {
    bottom: 7%;
    width: clamp(150px, 58vw, 245px);
    max-width: 72%;
  }
}

/* Celulares muy angostos */
@media (max-width: 420px) {
  .pack-modal {
    width: 88%;
    height: 68%;
  }

  .pack-modal.is-opened-result .pack-modal-content h2 {
    margin-top: 13%;
    font-size: clamp(30px, 8.5vw, 40px);
  }

  .pack-modal.is-opened-result .pack-modal-content p {
    font-size: clamp(14px, 3.8vw, 18px);
  }

  .pack-modal.is-opened-result .modal-cards-result {
    top: 39%;
    width: 96%;
    gap: 0;
  }

  .pack-modal.is-opened-result .modal-result-card {
    width: clamp(54px, 17vw, 76px);
    max-width: 24%;
  }

  .pack-modal.is-opened-result .opened-pack-img {
    bottom: 8%;
    width: clamp(145px, 56vw, 220px);
  }
}

@media (min-width: 769px) {
  .pack-modal.is-opened-result .opened-pack-img {
    width: clamp(130px, 14vw, 200px);
    max-width: 23%;
    bottom: 2%;
  }
}

/* AJUSTE SOLO PARA PANTALLAS GRANDES / MAC */
@media (min-width: 1400px) and (min-height: 800px) {
  .pack-modal.is-opened-result .opened-pack-img {
    width: clamp(190px, 17vw, 275px);
    max-width: 30%;
    bottom: 2%;
  }
}

/* AJUSTE PARA PANTALLAS MUY GRANDES */
@media (min-width: 1700px) {
  .pack-modal.is-opened-result .opened-pack-img {
    width: clamp(220px, 18vw, 330px);
    max-width: 32%;
    bottom: 2%;
  }
}

/* TRANSICIÓN SUAVE DE SOBRE A RASGADURA */
.pack-modal-envelope.is-changing-to-rip {
  animation: envelopeBeforeRip 0.65s ease-in-out forwards;
}

@keyframes envelopeBeforeRip {
  0% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    filter:
      drop-shadow(0 0 10px rgba(255, 220, 90, 0.5))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.45));
  }

  45% {
    opacity: 1;
    transform: translate(-50%, -37%) rotate(-4deg) scale(1.06);
    filter:
      drop-shadow(0 0 30px rgba(255, 226, 98, 1))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.5));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -35%) rotate(-7deg) scale(0.92);
  }
}

/* Entrada más suave de rasgadura.png */
.pack-modal-envelope.is-rip-show {
  animation: ripShowElegantSlow 1.45s ease-in-out forwards;
}

@keyframes ripShowElegantSlow {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) rotate(-10deg) scale(0.72);
    filter:
      drop-shadow(0 0 0 rgba(255, 220, 90, 0))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
  }

  35% {
    opacity: 1;
    transform: translate(-50%, -39%) rotate(-5deg) scale(1.08);
    filter:
      drop-shadow(0 0 32px rgba(255, 226, 98, 1))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.48));
  }

  70% {
    opacity: 1;
    transform: translate(-50%, -36%) rotate(3deg) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    filter:
      drop-shadow(0 0 18px rgba(255, 226, 98, 0.75))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.45));
  }
}

/* =============================== */
/* EFECTO MÁS SUAVE SOBRE / CARTAS */
/* =============================== */

.pack-modal-envelope {
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

/* El sobre cerrado se prepara antes de cambiar a rasgadura */
.pack-modal-envelope.is-soft-before-rip {
  animation: softBeforeRip 1s ease-in-out forwards !important;
}

@keyframes softBeforeRip {
  0% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    filter:
      drop-shadow(0 0 10px rgba(255, 220, 90, 0.4))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
  }

  45% {
    opacity: 1;
    transform: translate(-50%, -37%) rotate(-5deg) scale(1.035);
    filter:
      drop-shadow(0 0 22px rgba(255, 226, 98, 0.9))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.45));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -35%) rotate(-7deg) scale(0.96);
    filter:
      drop-shadow(0 0 5px rgba(255, 226, 98, 0.2))
      drop-shadow(0 12px 14px rgba(0, 0, 0, 0.25));
  }
}

/* rasgadura.png aparece más delicada */
.pack-modal-envelope.is-soft-rip-show {
  animation: softRipShow 1.8s ease-in-out forwards !important;
}

@keyframes softRipShow {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) rotate(-8deg) scale(0.9);
    filter:
      drop-shadow(0 0 0 rgba(255, 226, 98, 0))
      drop-shadow(0 14px 15px rgba(0, 0, 0, 0.25));
  }

  30% {
    opacity: 1;
    transform: translate(-50%, -37%) rotate(-5deg) scale(1.03);
    filter:
      drop-shadow(0 0 24px rgba(255, 226, 98, 0.95))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.45));
  }

  65% {
    opacity: 1;
    transform: translate(-50%, -35.5%) rotate(-2deg) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
    filter:
      drop-shadow(0 0 15px rgba(255, 226, 98, 0.65))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
  }
}

/* rasgadura.png desaparece suave */
.pack-modal-envelope.is-soft-rip-out {
  animation: softRipOut 1s ease-in forwards !important;
}

@keyframes softRipOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -35%) rotate(-7deg) scale(1);
  }

  50% {
    opacity: 0.65;
    transform: translate(-50%, -41%) rotate(5deg) scale(1.03);
    filter:
      drop-shadow(0 0 28px rgba(255, 226, 98, 0.85))
      drop-shadow(0 18px 20px rgba(0, 0, 0, 0.35));
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -48%) rotate(-10deg) scale(0.82);
    filter:
      drop-shadow(0 0 0 rgba(255, 226, 98, 0))
      drop-shadow(0 10px 10px rgba(0, 0, 0, 0));
  }
}

/* abierto.png más suave */
.opened-pack-img.opened-show {
  animation: openedPackSoftReveal 1.35s cubic-bezier(0.18, 1, 0.32, 1) forwards !important;
}

@keyframes openedPackSoftReveal {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(55px) scale(0.82);
  }

  45% {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px) scale(1.03);
  }

  75% {
    transform: translateX(-50%) translateY(3px) scale(0.99);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* tarjetas más suaves */
.modal-result-card {
  opacity: 0;
  transform: translateY(85px) scale(0.78) rotate(0deg);
}

.modal-result-card.show-card {
  animation: cardRevealSoft 1.15s cubic-bezier(0.18, 1, 0.32, 1) forwards !important;
}

@keyframes cardRevealSoft {
  0% {
    opacity: 0;
    transform: translateY(90px) scale(0.78) rotate(0deg);
  }

  35% {
    opacity: 1;
    transform: translateY(22px) scale(0.96) rotate(calc(var(--card-rotate) / 2));
  }

  70% {
    opacity: 1;
    transform: translateY(-8px) scale(1.03) rotate(var(--card-rotate));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--card-rotate));
  }
}

.open-pack-button:disabled,
.open-pack-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.pack-modal-close.go-album {
  width: auto;
  min-width: 150px;
  height: 48px;
  padding: 0 20px;

  border-radius: 16px;

  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;

  background: linear-gradient(180deg, #3aa7ff 0%, #0056d6 100%);
  box-shadow:
    0 0 18px rgba(80, 170, 255, 0.65),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.pack-modal-close.go-album:hover {
  background: linear-gradient(180deg, #52b5ff 0%, #0068f5 100%);
}

@media (max-width: 600px) {
  .pack-modal-close.go-album {
    min-width: 130px;
    height: 42px;
    font-size: 15px;
    padding: 0 16px;
  }
}