body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("Public/assets/heart-bg.jpg");
  background-size: cover;
  background-position: center;
  font-family: "Pixelify Sans", sans-serif;
  overflow: hidden;
}

/* Envelope Screen */
#envelope-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 20px;
  gap: 15px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

#envelope {
  width: clamp(150px, 40vw, 250px);
  animation: pulse 1.5s infinite;
  cursor: pointer;
}

#letter-container {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  padding: 10px;
  z-index: 100;
}

.letter-window {
  width: 95vw;
  max-width: 600px;
  aspect-ratio: 5000 / 4563;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  background-image: url("Public/assets/window.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-sizing: border-box;
  position: relative;

  /* Align content inside the window's checkerboard area */
  padding-top: 25%; 
  padding-bottom: 15%;

  transform: scale(0.9);
  opacity: 0;
  transition:
    transform 0.6s ease,
    opacity 0.6s ease;
}

.letter-window.open {
  transform: scale(1);
  opacity: 1;
}

h1 {
  font-size: clamp(20px, 6vw, 36px);
  margin: 8px 0;
  line-height: 1.2;
}

p {
  font-size: clamp(16px, 4vw, 24px);
  margin: 8px 0;
}

/* Cat Responsive Size */
.cat {
  width: clamp(140px, 35vw, 240px);
  height: auto;
  margin: 10px 0;
  transition: width 0.4s ease;
  border-radius: 10px;
}

.letter-window.final .cat {
  width: clamp(100px, 25vw, 160px);
}

/* buttons Responsive */
.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 4vw, 30px);
  position: relative;
  width: 100%;
  margin-top: auto; /* Push to the bottom of the window frame */
  padding-bottom: 10px;
}

.btn {
  width: clamp(80px, 22vw, 120px);
  cursor: pointer;
  user-select: none;
}

.yes-btn,
.no-btn,
.maybe-btn {
  width: clamp(80px, 22vw, 120px);
  height: auto;
  display: inline-block;
}

.yes-btn {
  position: relative;
  z-index: 2;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.no-btn,
.maybe-btn {
  z-index: 1000;
  position: relative;
  transition:
    transform 0.15s ease,
    left 0.3s ease,
    top 0.3s ease;
  cursor: default;
}

.speech-bubble {
  position: absolute;
  background: white;
  border: 2px solid #ff4d6d;
  border-radius: 15px;
  padding: 10px;
  font-size: 16px;
  color: #4a4e69;
  z-index: 200;
  bottom: 70%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 150px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border-width: 10px;
  border-style: solid;
  border-color: white transparent transparent transparent;
  transform: translateX(-50%);
}

.final-text {
  font-size: clamp(16px, 3.5vw, 22px);
  line-height: 1.4;
  text-align: center;
  display: inline-block;
  padding: 10px 20px;
  background-color: rgba(255, 240, 240, 0.9);
  border-radius: 12px;
  margin-top: 10px;
  max-width: 90%;
}

/* Hide fallback text inside container since we are back to original */
#envelope-container p {
  font-size: clamp(16px, 4vw, 20px);
  color: #ff4d6d;
  margin: 0;
}

/* Floating Hearts */
.heart {
  position: absolute;
  color: #c9184a; /* Deeper, more romantic red */
  opacity: 0.8; /* Slightly more visible */
  pointer-events: none;
  z-index: 50;
  animation: floatUp var(--duration) linear forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(110vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) translateX(var(--drift)) scale(var(--scale));
    opacity: 0;
  }
}

/* Small heights (landscape phones) */
@media (max-height: 500px) {
  .letter-window {
    padding-top: 20%;
  }
  .cat {
    width: 100px;
  }
  h1 {
    font-size: 18px;
  }
}
