body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #ffe6f0, #fff);
  overflow-x: hidden;
  overflow-y: auto;
}
html {
  scroll-behavior: smooth;
}

h1 {
  font-size: 24px;
}

p {
  font-size: 14px;
}

@media (min-width: 600px) {
  h1 {
    font-size: 32px;
  }
  p {
    font-size: 16px;
  }
}
/* Pages */
.page {
  display: none;
  min-height: 100vh;
  padding: 20px 20px 60px;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.page.active {
  display: flex;
}

/* Buttons */
button {
  margin-top: 20px;
  padding: 12px 20px;
  border: none;
  background: #ff99cc;
  color: white;
  border-radius: 25px;
  font-size: 16px;
}

/* Flower */
.flower {
  width: 150px;
  margin: 20px 0;
  animation: float 3s infinite ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

#photo {
  width: 85%;
  max-width: 300px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(255, 105, 180, 0.3);
  transition: transform 0.4s ease;
}

#photo:hover {
  transform: scale(1.05);
}

/* Input */
input {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid pink;
  width: 70%;
  max-width: 200px;
}

/* Sorry output */
#sorryOutput {
  max-height: 150px;
  overflow-y: auto;
  margin-top: 15px;
  font-size: 14px;
}

/* Story */
#story {
  margin-top: 15px;
  white-space: pre-line;
  font-size: 14px;
}

/* Final text */
.final-text {
  font-size: 16px;
  line-height: 1.6;
}

.petals::before {
  content: "";
}

.petals::after {
  content: "🌸";
  position: absolute;
  font-size: 20px;
  animation: fall 10s linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-100px) translateX(0);
  }
  100% {
    transform: translateY(100vh) translateX(100px);
  }
}
.flowers span {
  position: absolute;
  font-size: 24px;
  animation: floatUp 8s infinite ease-in;
}

.flowers span:nth-child(1) { left: 10%; animation-delay: 0s; }
.flowers span:nth-child(2) { left: 30%; animation-delay: 2s; }
.flowers span:nth-child(3) { left: 60%; animation-delay: 4s; }
.flowers span:nth-child(4) { left: 80%; animation-delay: 6s; }

@keyframes floatUp {
  0% { bottom: -50px; opacity: 0; }
  50% { opacity: 1; }
  100% { bottom: 100vh; opacity: 0; }
}


.page {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.page.active {
  display: flex;
  opacity: 1;
}

.sorry-line {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flower Ending Container */
.flower-ending {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
  padding: 10px;
}


/* Each flower image */
.flower-ending img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.5);
  animation: popIn 0.5s ease forwards;
}

/* Animation when flower appears */
@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Text below flowers */
.flower-text {
  margin-top: 15px;
  font-size: 16px;
  color: #ff6699;
  animation: fadeIn 2s ease-in;
}

@keyframes bloom {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.2);
    opacity: 1;
  }
}

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

#falling-flowers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.fall-flower {
  position: absolute;
  top: -50px;
  width: 30px;
  height: 30px;
  opacity: 0.8;
  animation: fallDown linear forwards;
}

@keyframes fallDown {
  to {
    transform: translateY(110vh) rotate(360deg);
  }
}

.bouquet-flower {
  position: absolute;
  width: 55px;
  animation: popIn 0.5s ease forwards;
}

#flowerContainer {
  position: relative;
  height: 200px;
  margin-top: 30px;
  margin-bottom: 40px;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: pink;
  border-radius: 50%;
  opacity: 0;
  animation: sparkleAnim 1s ease-out forwards;
}

@keyframes sparkleAnim {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}