* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  height: 100vh;
  background: linear-gradient(135deg, #ffdde1, #ee9ca7);
  overflow: hidden;
}

/* Floating hearts background */
.hearts::before {
  content: "❤️ ❤️ ❤️ ❤️ ❤️";
  position: absolute;
  width: 100%;
  text-align: center;
  animation: float 10s linear infinite;
  opacity: 0.2;
  font-size: 2rem;
}

@keyframes float {
  0% {
    transform: translateY(100vh);
  }
  100% {
    transform: translateY(-100vh);
  }
}

/* Envelope */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.envelope {
  width: 280px;
  height: 180px;
  background: #fff;
  position: relative;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.flap {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background: #ff6f91;
  clip-path: polygon(0 0, 100% 0, 50% 50%);
  transform-origin: top;
  transition: transform 1s ease;
}

.letter {
  position: absolute;
  top: 100%;
  width: 100%;
  background: #fff;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: all 1s ease;
}

.letter h1 {
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  color: #e63946;
}

.letter p {
  margin: 15px 0;
  font-size: 0.95rem;
}

.letter button {
  background: #e63946;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  cursor: pointer;
}

/* Open State */
.envelope.open .flap {
  transform: rotateX(180deg);
}

.envelope.open .letter {
  top: 0;
  opacity: 1;
}

/* Story Section */
.story {
  position: fixed;
  inset: 0;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.story img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 20px;
  animation: fade 1s;
}

.caption {
  color: white;
  margin-top: 10px;
  font-size: 1rem;
}

.progress {
  position: absolute;
  top: 10px;
  width: 90%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: white;
}

.controls {
  position: absolute;
  bottom: 20px;
}

.controls button {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  font-size: 1.5rem;
  margin: 0 20px;
  padding: 10px 15px;
  border-radius: 50%;
}

.hidden {
  display: none;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Restart Button */
.restart {
  margin-top: 15px;
  background: #ff6f91;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 25px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 111, 145, 0.5);
  animation: fade 1s ease;
}

.restart:hover {
  transform: scale(1.05);
}

.hidden {
  display: none;
}
