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

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(45deg, #ff6b6b, #ffc3c3);
  font-family: "Arial", sans-serif;
  padding: 20px;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.envelope {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 200px;
  background-color: #f8f8f8;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
}

.flap {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100px;
  background-color: #e6e6e6;
  clip-path: polygon(0 0, 50% 50%, 100% 0);
  transform-origin: top;
  transition: transform 0.4s ease;
  z-index: 2;
}

.pocket {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  background-color: #d9d9d9;
  border-radius: 0 0 5px 5px;
}

.letter {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 90%;
  height: 180px;
  background-color: #fff;
  transition: transform 0.6s ease;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
}

.letter-content {
  text-align: left;
  height: 100%;
  overflow-y: auto;
  padding-right: 10px;
}

/* Estilização da barra de rolagem */
.letter-content::-webkit-scrollbar {
  width: 8px;
}

.letter-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.letter-content::-webkit-scrollbar-thumb {
  background: #ff4b4b;
  border-radius: 4px;
}

h1 {
  color: #ff4b4b;
  margin-bottom: 15px;
  font-size: clamp(1.2em, 4vw, 1.5em);
}

.text-content {
  font-size: clamp(0.8em, 3vw, 0.9em);
  line-height: 1.5;
  margin-bottom: 15px;
  color: #666;
}

.signature {
  font-style: italic;
  margin-top: 20px;
  color: #888;
  font-size: clamp(0.8em, 3vw, 0.9em);
}

.name {
  font-weight: bold;
  color: #ff4b4b;
  font-size: clamp(0.9em, 3vw, 1em);
}

.instructions {
  margin-top: 20px;
  color: white;
  font-size: clamp(0.8em, 3vw, 0.9em);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Classes para animação */
.envelope.opened .flap {
  transform: rotateX(180deg);
}

.envelope.opened .letter {
  transform: translateX(-50%) translateY(-100px);
  opacity: 1;
  z-index: 3;
}

.envelope:hover {
  transform: scale(1.02);
}

/* Media Queries */
@media screen and (max-width: 480px) {
  .envelope {
    height: 180px;
  }

  .flap {
    height: 90px;
  }

  .pocket {
    height: 90px;
  }

  .letter {
    height: 160px;
  }
}

@media screen and (max-width: 360px) {
  .envelope {
    height: 160px;
  }

  .flap {
    height: 80px;
  }

  .pocket {
    height: 80px;
  }

  .letter {
    height: 140px;
    padding: 15px;
  }
}

/* Animação dos corações */
@keyframes floatHeart {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

.heart {
  position: fixed;
  font-size: clamp(1em, 3vw, 1.5em);
  user-select: none;
  pointer-events: none;
  animation: floatHeart 5s linear forwards;
}