:root {
  --pink: #ff8fb8;
  --pink-deep: #e2557f;
  --rose: #ffd6e5;
  --lavender: #e7d9ff;
  --cream: #fff7fb;
  --text: #5a2a44;
  --shadow: 0 10px 30px rgba(226, 85, 127, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Quicksand', sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #ffe3ef 0%, #f3e6ff 50%, #ffeef4 100%);
  background-size: 300% 300%;
  animation: bgShift 18s ease infinite;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

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

/* ---------- Floating treats ---------- */
#floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floater {
  position: absolute;
  bottom: -60px;
  animation: floatUp linear forwards;
  opacity: 0.85;
  user-select: none;
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  50%  { transform: translateY(-55vh) translateX(30px) rotate(180deg); }
  90%  { opacity: 0.85; }
  100% { transform: translateY(-115vh) translateX(-20px) rotate(360deg); opacity: 0; }
}

.rain {
  position: fixed;
  top: -60px;
  pointer-events: none;
  z-index: 50;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(115vh) rotate(540deg); }
}

.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  font-size: 16px;
  animation: sparkleFade 0.9s ease-out forwards;
}

@keyframes sparkleFade {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(0.3); opacity: 0; }
}

.burst {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  font-size: 26px;
  animation: burst 1.1s ease-out forwards;
}

@keyframes burst {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; }

.hint {
  margin-top: 22px;
  font-weight: 600;
  opacity: 0;
  animation: fadeDown 1s ease 2.2s forwards;
}

.hello {
  font-size: 1.4rem;
  font-weight: 600;
  opacity: 0;
  animation: fadeDown 1s ease 0.3s forwards;
}

.name {
  font-family: 'Pacifico', cursive;
  font-size: clamp(3.5rem, 13vw, 8rem);
  background: linear-gradient(90deg, #e2557f, #b35fe0, #ff8fb8, #e2557f);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s linear infinite, pop 1.2s cubic-bezier(.2, 1.6, .4, 1) 0.6s both;
  line-height: 1.3;
  filter: drop-shadow(0 6px 14px rgba(226, 85, 127, 0.25));
}

@keyframes shine { to { background-position: 300% center; } }

@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.subtitle {
  max-width: 520px;
  font-size: 1.15rem;
  margin: 10px 0 30px;
  opacity: 0;
  animation: fadeDown 1s ease 1.2s forwards;
}

/* ---------- CSS flowers ---------- */
.garden {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.flower {
  position: relative;
  width: 70px;
  height: 140px;
  transform-origin: bottom center;
  animation: sway 4s ease-in-out infinite;
}

.flower.f2 { width: 90px; height: 170px; animation-delay: -1s; }
.flower.f3 { animation-delay: -2s; }

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* stem */
.flower b {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 0;
  background: #6cc07a;
  border-radius: 3px;
  transform: translateX(-50%);
  animation: grow 1.2s ease forwards;
}
.flower.f1 b { --h: 80px; }
.flower.f2 b { --h: 100px; }
.flower.f3 b { --h: 80px; }

@keyframes grow { to { height: var(--h); } }

/* petals */
.flower span {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 26px;
  height: 26px;
  margin: -13px;
  border-radius: 50% 50% 50% 0;
  background: var(--pink);
  transform: rotate(calc(var(--i) * 60deg)) translateY(-18px) scale(0);
  animation: bloom 0.8s cubic-bezier(.2, 1.6, .4, 1) forwards;
  animation-delay: calc(1s + var(--i) * 0.08s);
}
.flower.f2 span { width: 34px; height: 34px; margin: -17px; top: 36px; background: #c79bff; }
.flower.f3 span { background: #ffb36b; }

.flower span:nth-child(1) { --i: 0; }
.flower span:nth-child(2) { --i: 1; }
.flower span:nth-child(3) { --i: 2; }
.flower span:nth-child(4) { --i: 3; }
.flower span:nth-child(5) { --i: 4; }
.flower span:nth-child(6) { --i: 5; }

@keyframes bloom {
  to { transform: rotate(calc(var(--i) * 60deg)) translateY(-18px) scale(1); }
}

/* center */
.flower i {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 22px;
  height: 22px;
  margin: -11px;
  background: #ffe066;
  border-radius: 50%;
  z-index: 2;
  transform: scale(0);
  animation: popIn 0.5s ease 1.6s forwards;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.08);
}
.flower.f2 i { top: 36px; width: 28px; height: 28px; margin: -14px; }

@keyframes popIn { to { transform: scale(1); } }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px rgba(226, 85, 127, 0.3); }
.btn:active { transform: scale(0.96); }
.btn.big { font-size: 1.15rem; padding: 18px 34px; }

.hero .btn { opacity: 0; animation: fadeDown 1s ease 1.6s forwards, wiggle 3s ease-in-out 3s infinite; }

@keyframes wiggle {
  0%, 90%, 100% { rotate: 0deg; }
  93% { rotate: -4deg; }
  96% { rotate: 4deg; }
}

/* ---------- Pages ---------- */
.deck {
  position: relative;
  z-index: 1;
  height: 100%;
}

.page {
  position: absolute;
  inset: 0;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(80px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.3, 1.2, .5, 1), visibility 0s linear 0.6s;
}
.page.left { transform: translateX(-80px) scale(0.96); }
.page.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.3, 1.2, .5, 1), visibility 0s;
}

.section {
  max-width: 900px;
  max-height: 100%;
  overflow-y: auto;
  padding: 32px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 32px;
  box-shadow: var(--shadow);
  width: 100%;
  scrollbar-width: none;
}
.section::-webkit-scrollbar { display: none; }

.section h2 {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--pink-deep);
  margin-bottom: 8px;
}

.lead { margin-bottom: 26px; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  height: min(200px, 26vh);
  perspective: 900px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(.3, 1.4, .5, 1);
  transform-style: preserve-3d;
}

.card.open .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  gap: 10px;
}

.card-front {
  background: linear-gradient(145deg, var(--rose), var(--lavender));
  font-weight: 700;
}
.card:hover .gift { animation: shake 0.5s ease; }

.gift { font-size: 64px; display: inline-block; }

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

.card-back {
  background: #fff;
  transform: rotateY(180deg);
  font-size: 0.95rem;
  font-weight: 600;
}

.big-emoji { font-size: 56px; }
.card.open .big-emoji { animation: bounce 1.2s ease infinite; }

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

/* ---------- Compliment note ---------- */
.note {
  max-width: 560px;
  margin: 20px auto 26px;
  padding: 34px 28px;
  background: #fffdf5;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: rotate(-1.5deg);
  background-image: repeating-linear-gradient(transparent 0 31px, #f4d6e1 31px 32px);
}

#compliment {
  font-size: 1.35rem;
  font-weight: 700;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#compliment.swap { opacity: 0; transform: translateY(10px); }

/* ---------- Hug ---------- */
.hug-wrap { margin: 10px 0 24px; }

.hug-bear {
  font-size: 110px;
  display: inline-block;
  animation: breatheBear 3s ease-in-out infinite;
}

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

.hug-bear.hugging { animation: squeeze 0.9s ease; }

@keyframes squeeze {
  0% { transform: scale(1); }
  30% { transform: scale(1.35, 0.85); }
  60% { transform: scale(0.9, 1.15); }
  100% { transform: scale(1); }
}

.hug-count { margin-top: 16px; font-weight: 600; }

/* ---------- Final question ---------- */
.final { max-width: 620px; }

.final-emoji {
  font-size: 90px;
  display: inline-block;
  animation: bounce 1.6s ease infinite;
}

.question-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 10px 0 28px;
  line-height: 1.5;
}

.answers {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  min-height: 70px;
}

.btn.yes {
  background: linear-gradient(135deg, #6fd08c, #2fae62);
  transform: scale(var(--grow, 1));
  transition: transform 0.3s cubic-bezier(.3, 1.6, .5, 1);
}
.btn.yes:hover { transform: scale(calc(var(--grow, 1) * 1.06)); }

.no-slot { display: inline-block; width: 140px; height: 58px; }

.btn.no {
  position: absolute;
  z-index: 5;
  background: linear-gradient(135deg, #b9a8c9, #8e7ba3);
  transition: left 0.25s ease, top 0.25s ease, transform 0.2s ease;
  white-space: nowrap;
}
.btn.no:hover { transform: none; }
.btn.no[hidden] { display: none; }

.answer-yes { animation: pop 0.8s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 56px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--pink-deep);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, opacity 0.3s ease;
}
.nav-btn:hover { transform: scale(1.1); }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
#nextBtn.pulse { animation: navPulse 1.6s ease infinite; }

@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 143, 184, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(255, 143, 184, 0); }
}

.dots { display: flex; gap: 10px; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: none;
  background: rgba(226, 85, 127, 0.3);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.dot.active { width: 32px; background: var(--pink-deep); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translate(-50%, -120px);
  background: #fff;
  color: var(--text);
  padding: 14px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 700;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1);
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .garden { gap: 14px; }
  .flower { transform: scale(0.8); }
  .section { padding: 22px 14px; }
  .lead { margin-bottom: 14px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { height: min(170px, 19vh); }
  .card-front, .card-back { padding: 8px; gap: 4px; }
  .card-back { font-size: 0.72rem; }
  .gift { font-size: 40px; }
  .big-emoji { font-size: 30px; }
  .hug-bear { font-size: 90px; }
  .final-emoji { font-size: 70px; }
  .question-text { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
