/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== ANIMATED GRADIENT BACKGROUND ===== */
body {
  font-family: "Nunito", sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden; /* Allow vertical scrolling by default, but hide horizontal */
  background: linear-gradient(
    -45deg,
    #ff9a9e,
    #fad0c4,
    #fbc2eb,
    #a18cd1,
    #ff9a9e
  );
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

/* Specific style for the 'Yes' page to allow full scrolling */
body.yes-page {
  overflow-y: auto;
  padding: 50px 0;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== FLOATING EMOJI STORM (CSS SPAWNED) ===== */
.emoji-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.emoji-float {
  position: absolute;
  bottom: -60px;
  animation: emojiRise linear infinite;
  opacity: 0;
  font-size: 1.6rem;
  filter: blur(0.5px);
  will-change: transform, opacity;
}

@keyframes emojiRise {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-110vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

/* ===== FLOATING HEARTS BACKGROUND (original enhanced) ===== */
.hearts-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* ===== SPARKLE CURSOR CANVAS ===== */
#sparkle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* ===== CONTAINER (no box, open layout) ===== */
.container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 45px 35px;
  max-width: 520px;
  width: 90vw;
  animation: cardFloat 4s ease-in-out infinite;
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* No border pseudo-element needed */

@keyframes borderGlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== ENVELOPE ANIMATION ===== */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeInOverlay 0.5s ease;
}

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

.envelope {
  font-size: 8rem;
  animation: envelopeBounce 0.8s ease infinite alternate;
  cursor: pointer;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.envelope:hover {
  transform: scale(1.15) rotate(5deg);
}

@keyframes envelopeBounce {
  from {
    transform: translateY(0) rotate(-3deg);
  }
  to {
    transform: translateY(-20px) rotate(3deg);
  }
}

.envelope-text {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 16px;
  animation: textPulse 1.5s ease infinite;
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.envelope-open {
  animation: envelopeOpen 0.8s ease forwards;
}

@keyframes envelopeOpen {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.5) rotate(10deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(3) rotate(0deg);
    opacity: 0;
  }
}

.overlay-exit {
  animation: fadeOutOverlay 0.5s ease forwards;
}

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

/* ===== TITLE WITH TYPING EFFECT ===== */
h1 {
  font-size: 2.2rem;
  color: #d63384;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow:
    2px 2px 0px rgba(214, 51, 132, 0.2),
    0 0 20px rgba(214, 51, 132, 0.15);
  min-height: 3rem;
}

.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #d63384;
  margin-left: 2px;
  animation: cursorBlink 0.7s step-end infinite;
  vertical-align: text-bottom;
}

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

/* ===== COUNTDOWN TIMER ===== */
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.countdown-item {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 8px 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-width: 60px;
}

.countdown-number {
  font-size: 1.6rem;
  font-weight: 900;
  color: #d63384;
  display: block;
  line-height: 1;
}

.countdown-label {
  font-size: 0.65rem;
  color: #e91e8c;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.countdown-message {
  font-size: 0.85rem;
  color: #d63384;
  font-weight: 700;
  margin-bottom: 18px;
  animation: textPulse 2s ease infinite;
}

/* ===== GIF CONTAINER ===== */
.gif-container {
  margin: 18px auto;
  display: flex;
  justify-content: center;
  position: relative;
}

#cat-gif {
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(214, 51, 132, 0.3));
  transition:
    opacity 0.3s ease,
    transform 0.4s ease;
  border-radius: 20px;
  animation: gifPulse 3s ease-in-out infinite;
}

@keyframes gifPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* ===== BUTTONS ===== */
.buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-top: 25px;
  flex-wrap: wrap;
}

#yes-btn {
  background: linear-gradient(135deg, #ff6b9d, #ff1493, #c44dff);
  background-size: 200% 200%;
  animation: yesGlow 2s ease infinite;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.6rem;
  font-weight: 900;
  font-family: "Nunito", sans-serif;
  padding: 18px 50px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  box-shadow:
    0 6px 25px rgba(255, 20, 147, 0.45),
    0 0 40px rgba(255, 107, 157, 0.2);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

#yes-btn::after {
  content: "💕";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  animation: heartBeat 1s ease infinite;
}

@keyframes yesGlow {
  0% {
    background-position: 0% 50%;
    box-shadow:
      0 6px 25px rgba(255, 20, 147, 0.45),
      0 0 40px rgba(255, 107, 157, 0.2);
  }
  50% {
    background-position: 100% 50%;
    box-shadow:
      0 6px 35px rgba(196, 77, 255, 0.55),
      0 0 60px rgba(255, 107, 157, 0.35);
  }
  100% {
    background-position: 0% 50%;
    box-shadow:
      0 6px 25px rgba(255, 20, 147, 0.45),
      0 0 40px rgba(255, 107, 157, 0.2);
  }
}

@keyframes heartBeat {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-50%) scale(1.3);
  }
}

#yes-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow:
    0 10px 40px rgba(255, 20, 147, 0.6),
    0 0 60px rgba(196, 77, 255, 0.3);
}

#yes-btn:active {
  transform: scale(0.96);
}

#no-btn {
  background: linear-gradient(135deg, #888, #666);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

#no-btn:hover {
  background: linear-gradient(135deg, #777, #555);
}

@keyframes noShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px) rotate(-2deg);
  }
  75% {
    transform: translateX(5px) rotate(2deg);
  }
}

/* ===== TEASE TOAST ===== */
#tease-toast {
  margin-top: 14px;
  font-size: 1rem;
  color: #d63384;
  font-weight: 700;
  font-style: italic;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  min-height: 1.5rem;
}

#tease-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SCREEN SHAKE ===== */
.screen-shake {
  animation: screenShake 0.4s ease;
}

@keyframes screenShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-8px, -4px);
  }
  20% {
    transform: translate(8px, 4px);
  }
  30% {
    transform: translate(-6px, 2px);
  }
  40% {
    transform: translate(6px, -2px);
  }
  50% {
    transform: translate(-4px, 4px);
  }
  60% {
    transform: translate(4px, -4px);
  }
  70% {
    transform: translate(-2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  90% {
    transform: translate(-1px, 1px);
  }
}

/* ===== EMOJI EXPLOSION ===== */
.emoji-explode {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  z-index: 500;
  animation: emojiExplode 1.5s ease forwards;
}

@keyframes emojiExplode {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0) rotate(720deg);
    opacity: 0;
  }
}

/* ===== MUSIC TOGGLE ===== */
#music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(214, 51, 132, 0.2);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  z-index: 100;
}

#music-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(214, 51, 132, 0.35);
}

/* ===== CUTE BEAR COMPANION ===== */
.bear-companion {
  position: fixed;
  bottom: 20px;
  left: 20px;
  font-size: 3rem;
  z-index: 50;
  animation: bearWave 2s ease-in-out infinite;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease;
}

.bear-companion:hover {
  transform: scale(1.3) rotate(10deg);
}

@keyframes bearWave {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

.bear-speech {
  position: fixed;
  bottom: 75px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 16px 16px 16px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d63384;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 51;
  max-width: 200px;
}

.bear-speech.show {
  opacity: 1;
  transform: scale(1);
}

/* ===== YES PAGE ===== */
.yes-container {
  animation: celebrateFloat 3s ease-in-out infinite;
}

@keyframes celebrateFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(1deg);
  }
  75% {
    transform: translateY(-5px) rotate(-1deg);
  }
}

.yes-container h1.yes-title {
  font-size: 2.6rem;
  background: linear-gradient(135deg, #ff6b9d, #c44dff, #ff1493);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation:
    gradientText 3s ease infinite,
    bounceTitle 0.6s ease infinite alternate;
}

@keyframes gradientText {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes bounceTitle {
  from {
    transform: translateY(0) rotate(-1deg);
  }
  to {
    transform: translateY(-12px) rotate(1deg);
  }
}

.yes-message {
  font-size: 1.3rem;
  color: #e91e8c;
  font-weight: 700;
  margin-top: 20px;
  animation: fadeInUp 1s ease 0.5s both;
}

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

.yes-container #cat-gif {
  width: 250px;
  height: 250px;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  animation: polaroidFloat 3s ease-in-out infinite;
}

@keyframes polaroidFloat {
  0%,
  100% {
    transform: rotate(-2deg) scale(1);
  }
  50% {
    transform: rotate(2deg) scale(1.03);
  }
}

/* ===== LOVE MESSAGES (Yes Page) ===== */
.love-messages {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.love-msg {
  font-size: 1rem;
  color: #c44dff;
  font-weight: 700;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(4px);
}

.love-msg.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== HEART RAIN CANVAS ===== */
#heart-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
    width: 92vw;
  }

  h1 {
    font-size: 1.6rem;
  }

  .yes-container h1.yes-title {
    font-size: 1.8rem;
  }

  #cat-gif {
    width: 150px;
    height: 150px;
  }

  .yes-container #cat-gif {
    width: 200px;
    height: 200px;
  }

  #yes-btn {
    font-size: 1.3rem;
    padding: 14px 36px;
  }

  .countdown-item {
    padding: 6px 10px;
    min-width: 50px;
  }

  .countdown-number {
    font-size: 1.2rem;
  }

  .bear-companion {
    font-size: 2rem;
    bottom: 12px;
    left: 12px;
  }

  .bear-speech {
    bottom: 55px;
    left: 12px;
    font-size: 0.7rem;
  }

  .envelope {
    font-size: 5rem;
  }
}
