* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a1a, #333);
  font-family: Arial, sans-serif;
  touch-action: none;
}

.pack-container {
  width: 300px;
  height: 420px;
  position: relative;
  perspective: 1000px;
  margin: 20px;
  transition: opacity 0.5s ease-out;
}

.pack-container.open {
  opacity: 0;
  pointer-events: none;
}

.pack-image {
  width: 100%;
  height: 100%;
  background-image: url("/sobre.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.opening-flap {
  position: absolute;
  top: 0;
  left: 35px;
  width: 77%;
  height: 25%;
  background-image: url("/sobre.png");
  background-size: 100% 400%;
  background-position: top;
  transform-origin: top;
  transition: transform 0.6s ease-out;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  cursor: pointer;
  z-index: 2;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in;
}

.pack-container.open + .cards-grid {
  opacity: 1;
  pointer-events: auto;
}

.card {
  width: 140px;
  height: 196px;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card:nth-child(1) {
  background-image: url("/carta01.png");
}
.card:nth-child(2) {
  background-image: url("/carta02.png");
}
.card:nth-child(3) {
  background-image: url("/carta03.png");
}
.card:nth-child(4) {
  background-image: url("/carta04.png");
}

.card.enlarged {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.2);
  width: 280px;
  height: 392px;
  z-index: 100;
}

.close-button {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  background: #ff3333;
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 101;
}

.card.enlarged .close-button {
  display: flex;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: none;
  z-index: 99;
}

.overlay.active {
  display: block;
}

.cut-line {
  position: absolute;
  top: 25%;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #fff 20%,
    #ffd700 50%,
    #fff 80%,
    transparent
  );
  box-shadow: 0 0 10px #ffd700;
  opacity: 0;
  z-index: 3;
  transition: width 0.4s ease-out, opacity 0.3s;
}

.pack-container.cutting .cut-line {
  width: 100%;
  opacity: 1;
}

.reset-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.1em;
  transition: background 0.3s ease;
}

.reset-button:hover {
  background: #45a049;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.pack-container {
  animation: float 3s ease-in-out infinite;
}
