* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Comic Sans MS', cursive;
  background: linear-gradient(to bottom, #ffe6f0, #ffd6f5);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 90%;
  max-width: 400px;
  position: relative;
  text-align: center;
}

/* ENVELOPE */
.envelope {
  position: relative;
  width: 100%;
  height: 250px;
  background-color: #ff66b2;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 2;
  transition: transform 1s ease;
}

.topo-envelope {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: #e60073;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transition: transform 1s ease;
  transform-origin: top;
  z-index: 3;
}

.selo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffb6d9, #ff69b4);
  color: white;
  font-weight: bold;
  padding: 15px 20px;
  border-radius: 50%;
  box-shadow: 0 0 12px #fff0f5;
  cursor: pointer;
  z-index: 4;
  font-size: 16px;
  transition: transform 0.3s ease;
}

.selo:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.base-envelope {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 50%;
  width: 100%;
  background-color: #ff66b2;
}

/* CARTÃO */
.cartao {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #fff0f5;
  padding: 25px 20px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  z-index: 1;
  transition: top 1s ease;
  opacity: 0;
}

.cartao h2 {
  color: #d63384;
  margin-bottom: 10px;
  font-size: 20px;
}

.cartao p {
  font-size: 14px;
  color: #800040;
  margin: 6px 0;
}

.cartao .footer {
  margin-top: 15px;
  font-style: italic;
  color: #ff1493;
}

/* ANIMAÇÃO DE ABERTURA */
.container.aberto .topo-envelope {
  transform: rotateX(180deg);
}

.container.aberto .envelope {
  transform: translateY(-80px);
}

.container.aberto .cartao {
  top: 180px;
  opacity: 1;
}

/* RESPONSIVIDADE */
@media (max-width: 500px) {
  .cartao p {
    font-size: 13px;
  }

  .cartao h2 {
    font-size: 18px;
  }

  .selo {
    font-size: 14px;
    padding: 12px 18px;
  }
}
