@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap");

body {
  margin: 0;
  padding: 0;
  font-family: "Quicksand", sans-serif;
  background: linear-gradient(135deg, #ffe5d9, #ffd6a5, #ffc6c7);
  color: #4a2c2a;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.section {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

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

button {
  background: linear-gradient(135deg, #ff9770, #ff6b6b);
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.memory {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 250, 245, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 25px;
  padding: 2rem;
  box-shadow: 0 4px 25px rgba(255, 138, 101, 0.25);
}

.memory.active {
  display: flex;
  animation: fadeIn 1s ease forwards;
}

.memory h2 {
  color: #b75144;
}

.caption {
  font-style: italic;
  color: #8a5a3d;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.heart {
  position: absolute;
  color: #ffb3a7;
  font-size: 20px;
  animation: float 6s linear infinite;
  bottom: 0;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

.popup-message {
  position: fixed;
  bottom: 12vh;
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 111, 97, 0.95);
  color: #fffdf5;
  font-size: 1.1em;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(255, 111, 97, 0.4);
  animation: fadeInOut 3s ease;
  z-index: 9999;
  pointer-events: none;
  will-change: transform, opacity;
  backdrop-filter: blur(8px);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  10%,
  90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
}

#hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.letter-section {
  display: none;
  flex-direction: column;
  text-align: left;
  background: rgba(255, 250, 245, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 25px;
  padding: 1rem;
  width: 80%;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 6px 25px rgba(255, 138, 101, 0.25);
  animation: fadeInLetter 1s ease forwards;
  color: #4a2c2a;
}

.letter-section h2 {
  color: #b75144;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.letter-section p {
  white-space: pre-line;
  line-height: 1.2;
  font-size: 1rem;
  font-weight: 500;
  color: #5a3a36;
}

#letter-text::after {
  content: "|";
  animation: blink 1s infinite;
  margin-left: 4px;
  color: #ff6b6b;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

#start-over-btn {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #ff9770, #ff6b6b);
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#start-over-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

@keyframes fadeInLetter {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
