:root {
  --primary: #fff;
  --bg-color: #ffdde1;
  --bg-envelope-color: #fce4ec;
  --envelope-tab: #f8bbd0;
  --envelope-cover: #f48fb1;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --txt-color: #882e4c;
  --heart-color: #ff3366;
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: grid;
  place-items: center;
}

.envelope-wrapper {
  background: var(--bg-envelope-color);
  box-shadow: 0 0 40px var(--shadow-color);
  position: relative;
  top: 100px;
}

.envelope {
  position: relative;
  width: 300px;
  height: 230px;
}

.envelope::before {
  content: "";
  position: absolute;
  top: 0;
  z-index: 2;
  border-top: 130px solid var(--envelope-tab);
  border-right: 150px solid transparent;
  border-left: 150px solid transparent;
  transform-origin: top;
  transition: all 0.5s ease-in-out 0.7s;
}

.envelope::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 0px;
  height: 0px;
  border-top: 130px solid transparent;
  border-right: 150px solid var(--envelope-cover);
  border-bottom: 100px solid var(--envelope-cover);
  border-left: 150px solid var(--envelope-cover);
}

.letter {
  position: absolute;
  right: 10%;
  bottom: 0;
  width: 70%;
  height: 80%;
  background: var(--primary);
  text-align: center;
  transition: all 1s ease-in-out;
  box-shadow: 0 0 5px var(--shadow-color);
  padding: 20px 15px;
  font-family: 'Dancing Script', cursive;
  font-size: 14px;
  color: var(--txt-color);
}

.text strong {
  font-size: 18px;
  font-family: 'Pacifico', cursive;
}

.heart {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--heart-color);
  z-index: 4;
  transform: translate(-50%, -20%) rotate(45deg);
  transition: transform 0.5s ease-in-out 1s;
  box-shadow: 0 1px 6px var(--shadow-color);
  cursor: pointer;
}

.heart:before, 
.heart:after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--heart-color);
  border-radius: 50%;
}

.heart:before {
  top: -10px;
}

.heart:after {
  right: 10px;
}

/* Envelope Opening */
.flap .envelope::before {
  transform: rotateX(270deg);
  z-index: 0;
}

.flap .letter {
  bottom: 300px;
  transform: scale(1.3);
  transition-delay: 1s;
}

.flap .heart {
  transform: rotate(90deg);
  transition-delay: 0.4s;
}

/* Floating Hearts */
.hearts {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-heart {
  position: absolute;
  bottom: -20px;
  width: 15px;
  height: 15px;
  background: var(--heart-color);
  transform: rotate(45deg);
  opacity: 0.8;
  animation: floatUp 5s linear infinite;
}

.floating-heart:before, 
.floating-heart:after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: var(--heart-color);
  border-radius: 50%;
}

.floating-heart:before {
  top: -8px;
}

.floating-heart:after {
  right: 8px;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(45deg);
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(45deg);
    opacity: 0;
  }
}
#music-btn {
  position: fixed;
  bottom:  40px;
  background: var(--heart-color);
  color: white;
  border: none;
  width: 80px;
  height: 50px;
  border-radius: 15%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: transform 0.2s ease-in-out;
}

#music-btn:hover {
  transform: scale(1.1);
}