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

body {
  background: linear-gradient(to right, #f857a6, #ff5858);
  font-family: 'Segoe UI', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.envelope {
  width: 250px;
  height: 150px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: all 0.5s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transform-style: preserve-3d;
  perspective: 1000px;
  z-index: 5;
}

.flap {
  width: 0;
  height: 0;
  border-left: 125px solid transparent;
  border-right: 125px solid transparent;
  border-bottom: 75px solid #ff4d6d;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 1s ease;
  transform-origin: top;
  z-index: 2;
}

.letter {
  width: 100%;
  height: 100%;
  background: #ffe6eb;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  position: absolute;
}

.letter p {
  font-size: 18px;
  font-weight: bold;
  color: #444;
}

.message {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  width: 90%;
  max-width: 600px;
  background: #fff;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  text-align: center;
  z-index: 10;
  transition: 1s ease;
}

.message h1 {
  color: #ff0055;
  margin-bottom: 15px;
  font-size: 22px;
}

.message p {
  color: #555;
  font-size: 16px;
  line-height: 1.6;
}

.hearts {
  margin-top: 20px;
  font-size: 22px;
}

@media screen and (max-width: 400px) {
  .envelope {
    width: 200px;
    height: 120px;
  }

  .flap {
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 60px solid #ff4d6d;
  }

  .letter p {
    font-size: 16px;
  }

  .message {
    padding: 20px;
  }

  .message h1 {
    font-size: 20px;
  }

  .message p {
    font-size: 15px;
  }
}
