@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@400;600;700&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --coral: #ff6b6b;
  --hot-red: #ee5a24;
  --pink: #ff9ff3;
  --soft-pink: #f8a5c2;
  --white: #fff;
  --plum: #2d1b2e;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--plum);
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 30%, #ff9ff3 60%, #f8a5c2 100%);
  position: relative;
}

/* ── Floating Heart Particles ── */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  bottom: -60px;
  opacity: 0;
  animation: floatUp linear infinite;
  color: var(--coral);
  filter: blur(0.5px);
}

.heart-particle::before {
  content: '\2764';
  display: block;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  10% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(-110vh) translateX(var(--sway, 40px)) rotate(var(--spin, 360deg));
  }
}

/* ── Main Page Layout ── */
.main-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.question {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.5rem, 7vw, 5rem);
  color: var(--hot-red);
  text-shadow: 2px 2px 8px rgba(238, 90, 36, 0.25);
  margin-bottom: 0.5rem;
  animation: fadeInDown 1s ease-out;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--plum);
  opacity: 0.7;
  margin-bottom: 3rem;
  animation: fadeInDown 1s ease-out 0.3s both;
}

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

/* ── Buttons ── */
.buttons-area {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  animation: fadeInDown 1s ease-out 0.6s both;
}

.btn {
  border: none;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, font-size 0.3s ease;
  white-space: nowrap;
}

.btn-yes {
  background: linear-gradient(135deg, var(--hot-red), var(--coral));
  color: var(--white);
  font-size: 1.3rem;
  padding: 1rem 2.5rem;
  box-shadow: 0 6px 25px rgba(238, 90, 36, 0.4);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              padding 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              font-size 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-yes:hover {
  box-shadow: 0 8px 35px rgba(238, 90, 36, 0.6);
  filter: brightness(1.1);
}

.btn-yes .name-text {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-yes .name-text.switching {
  opacity: 0;
  transform: scale(0.8);
}

.btn-yes.pulse {
  animation: yesPulse 0.4s ease;
}

@keyframes yesPulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
  100% { filter: brightness(1); }
}

.btn-no {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: var(--white);
  font-size: 1rem;
  padding: 0.8rem 2rem;
  position: fixed;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-no.dodging {
  animation: dodge 0.3s ease;
}

@keyframes dodge {
  0% { transform: scale(1); }
  30% { transform: scale(0.8) rotate(-8deg); }
  60% { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ── Thunderbolt Effects ── */
.thunderbolt {
  position: fixed;
  pointer-events: none;
  z-index: 20;
  width: 4px;
  opacity: 0;
  animation: boltFlash 0.5s ease-out forwards;
}

.thunderbolt svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.thunderbolt svg path {
  fill: none;
  stroke: #ffe066;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px #ffe066) drop-shadow(0 0 20px #ffaa00);
}

@keyframes boltFlash {
  0% {
    opacity: 1;
  }
  20% {
    opacity: 1;
  }
  40% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  70% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
  }
}

/* Screen flash overlay on thunderbolt */
.thunder-flash {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 15;
  animation: screenFlash 0.3s ease-out forwards;
}

@keyframes screenFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Glow ring on the Yes button during thunderbolt */
.btn-yes.thunder-glow {
  box-shadow: 0 0 20px 8px rgba(255, 224, 102, 0.6),
              0 0 60px 15px rgba(255, 170, 0, 0.3),
              0 6px 25px rgba(238, 90, 36, 0.4);
}

/* ── Yes Page ── */
.yes-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.yes-container .celebration-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  color: var(--hot-red);
  text-shadow: 2px 2px 10px rgba(238, 90, 36, 0.3);
  margin-bottom: 1rem;
  animation: fadeInDown 1s ease-out;
}

.yes-container .celebration-msg {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--plum);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fadeInDown 1s ease-out 0.3s both;
}

/* Merging hearts animation */
.hearts-merge {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 1rem auto 2rem;
  animation: fadeInDown 1s ease-out 0.6s both;
}

.merge-heart {
  position: absolute;
  font-size: 5rem;
  animation: mergeIn 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 15px rgba(238, 90, 36, 0.5));
}

.merge-heart:nth-child(1) {
  left: 10%;
  top: 50%;
  transform: translateY(-50%);
  color: var(--coral);
  animation-name: mergeLeft;
}

.merge-heart:nth-child(2) {
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hot-red);
  animation-name: mergeRight;
}

@keyframes mergeLeft {
  0% { transform: translateY(-50%) translateX(-20px) scale(1); }
  100% { transform: translateY(-50%) translateX(25px) scale(1.1); }
}

@keyframes mergeRight {
  0% { transform: translateY(-50%) translateX(20px) scale(1); }
  100% { transform: translateY(-50%) translateX(-25px) scale(1.1); }
}

/* Sparkles */
.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
  opacity: 0;
  animation: sparkleAnim 2s ease-in-out infinite;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
}

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

.back-link {
  color: var(--plum);
  opacity: 0.5;
  font-size: 0.9rem;
  text-decoration: none;
  margin-top: 2rem;
  transition: opacity 0.3s;
  animation: fadeInDown 1s ease-out 0.9s both;
}

.back-link:hover {
  opacity: 1;
}

/* ── Rain Hearts (Yes Page) ── */
.rain-heart {
  position: fixed;
  top: -60px;
  opacity: 0;
  animation: rainDown linear infinite;
  pointer-events: none;
  z-index: 0;
}

.rain-heart::before {
  content: '\2764';
  display: block;
  color: var(--coral);
}

@keyframes rainDown {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(var(--spin, 180deg));
  }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .buttons-area {
    flex-direction: column;
    gap: 1.5rem;
  }

  .btn-yes {
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
  }

  .btn-no {
    font-size: 0.9rem;
    padding: 0.7rem 1.5rem;
  }
}
