body {
  margin: 0;
  background: black;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* CONTENEDOR */
.container {
  text-align: center;
  position: relative;
}

/* SOBRE */
.envelope {
  width: 280px;
  height: 180px;
  background: #f28c8c;
  position: relative;
  margin: auto;
  border-radius: 8px;
  overflow: hidden;
}

/* TAPA */
.flap {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #ff3b3b;
  clip-path: polygon(0 0, 50% 50%, 100% 0);
  transform-origin: top;
  transition: transform 0.8s ease;
  z-index: 2;
}

/* CARTA */
.letter {
  position: absolute;
  width: 90%;
  height: 120px;
  background: #f5c2c2;
  top: 60px;
  left: 4px;
  border-radius: 5px;
  padding: 10px;
  opacity: 0;
  transform: translateY(80px) scale(0.8);
  transition: all 0.8s ease;
  z-index: 1;
}

/* ABIERTO */
.envelope.open .flap {
  transform: rotateX(180deg);
}

.letter p {
    font-size: 19px;
    font-weight: bolder;
}

.envelope.open .letter {
  opacity: 1;
  transform: translateY(-40px) scale(1);
}

/* BOTÓN */
button {
  margin-top: 20px;
  padding: 10px 25px;
  border: 2px solid red;
  background: transparent;
  color: red;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
}

/* CORAZONES */
.hearts {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  top: 0;
  z-index: 2;
}

.heart {
  position: absolute;
  color: red;
  font-size: 40px;
  animation: floatUp 3s linear infinite;
}

/* ANIMACIÓN */
@keyframes floatUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-200px);
    opacity: 0;
  }
}

/* RESPONSIVE */
@media (max-width: 500px) {
  .envelope {
    width: 220px;
    height: 150px;
  }

  .letter {
    height: 100px;
    font-size: 14px;
  }
}


/* ESCENAS */
.scene {
  position: fixed;
  width: 100%;
  height: 100%;
  background: black;
  top: 0;
  left: 0;
  display: none;
  justify-content: center;
  align-items: center;
}

.scene.active {
  display: flex;
}

/* TRANSICIÓN */
.fade-out {
  animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

/* GALERÍA */
.gallery {
  text-align: center;
  color: white;
}

.gallery img {
  max-width: 80%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(255,255,255,0.3);
  animation: fadeIn 1.5s;
}

.gallery p {
  margin-top: 20px;
  font-size: 22px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  animation: fadeIn 2s;
}

/* FADE */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* CORAZONES PRO */
.heart {
  position: absolute;
  font-size: 40px;
  animation: floatUp 4s linear infinite;
  opacity: 0.8;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-600px) scale(1.5);
    opacity: 0;
  }
}