/* ============================================
   Valentine's Day Interactive Web App
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&family=Dancing+Script:wght@700&display=swap');

:root {
  --sky-top: #1a0a2e;
  --sky-mid: #3d1d6b;
  --sky-bottom: #c2185b;
  --soil-dark: #3e2723;
  --soil-mid: #5d4037;
  --soil-light: #6d4c41;
  --stem-color: #4caf50;
  --stem-dark: #388e3c;
  --leaf-color: #66bb6a;
  --leaf-dark: #43a047;
  --petal-pink: #f06292;
  --petal-deep: #ec407a;
  --petal-light: #f8bbd0;
  --bean-color: #66bb6a;
  --bean-dark: #388e3c;
  --heart-red: #e53935;
  --gold: #ffd54f;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Quicksand', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

/* ============================================
   Background Sky
   ============================================ */
.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
      var(--sky-top) 0%,
      var(--sky-mid) 40%,
      #7b1fa2 65%,
      var(--sky-bottom) 100%);
  z-index: 0;
}

/* Stars */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  z-index: 1;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--dur) ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ============================================
   Ground / Soil
   ============================================ */
.ground {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 22%;
  z-index: 10;
  pointer-events: none;
}

.ground-top {
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--soil-mid);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.ground-body {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
  height: calc(100% - 8px);
  background: linear-gradient(180deg,
      var(--soil-mid) 0%,
      var(--soil-dark) 40%,
      #2d1b11 100%);
}

/* Soil texture dots */
.ground-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, var(--soil-light) 1px, transparent 1px),
    radial-gradient(circle, var(--soil-light) 0.5px, transparent 0.5px);
  background-size: 20px 20px, 13px 13px;
  background-position: 0 0, 10px 10px;
  opacity: 0.2;
}

/* ============================================
   Green Bean (Initial State)
   ============================================ */
.bean-container {
  position: fixed;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  cursor: pointer;
  pointer-events: auto;
}

.bean {
  width: 44px;
  height: 22px;
  background: radial-gradient(ellipse at 40% 40%, var(--bean-color), var(--bean-dark));
  border-radius: 50%;
  position: relative;
  animation: beanPulse 1.8s ease-in-out infinite;
  box-shadow:
    0 0 20px rgba(102, 187, 106, 0.5),
    0 0 40px rgba(102, 187, 106, 0.2);
  transition: transform 0.3s, opacity 0.5s;
}

.bean::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 12px;
  width: 20px;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

/* Tap hint */
.bean-hint {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  animation: hintFade 2s ease-in-out infinite;
  letter-spacing: 0.5px;
}

@keyframes beanPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(102, 187, 106, 0.5), 0 0 40px rgba(102, 187, 106, 0.2);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(102, 187, 106, 0.7), 0 0 60px rgba(102, 187, 106, 0.3);
  }
}

@keyframes hintFade {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

.bean-container.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
  transition: all 0.6s ease-in;
}

/* ============================================
   Plant - Stem (SVG curved)
   ============================================ */
.plant-container {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
}

.stem-wrapper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 0;
  transition: height 3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stem-svg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 100%;
  z-index: 1;
}

/* Growing state */
.plant-container.growing .stem-wrapper {
  height: 320px;
}

.plant-container.grown .stem-wrapper {
  height: 320px;
  transition: none;
}

/* ============================================
   Plant - SVG Leaves (organic shapes)
   ============================================ */
.leaf-svg {
  position: absolute;
  width: 50px;
  height: 25px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
  z-index: 2;
}

.leaf-svg-left {
  right: 8px;
  transform: rotate(-10deg) scale(0.3);
  transform-origin: right center;
}

.leaf-svg-right {
  left: 8px;
  transform: rotate(10deg) scale(0.3);
  transform-origin: left center;
}

/* 3 pairs at different heights */
.leaf-pair-1 {
  top: 80%;
  transition-delay: 1.0s;
}

.leaf-pair-1r {
  top: 78%;
  transition-delay: 1.2s;
}

.leaf-pair-2 {
  top: 55%;
  transition-delay: 1.6s;
}

.leaf-pair-2r {
  top: 53%;
  transition-delay: 1.8s;
}

.leaf-pair-3 {
  top: 30%;
  transition-delay: 2.1s;
}

.leaf-pair-3r {
  top: 28%;
  transition-delay: 2.3s;
}

.plant-container.growing .leaf-svg,
.plant-container.grown .leaf-svg {
  opacity: 1;
}

.plant-container.growing .leaf-svg-left,
.plant-container.grown .leaf-svg-left {
  transform: rotate(-15deg) scale(1);
}

.plant-container.growing .leaf-svg-right,
.plant-container.grown .leaf-svg-right {
  transform: rotate(15deg) scale(1);
}

/* Gentle sway for grown leaves */
.plant-container.grown .leaf-svg {
  animation: leafSway 4s ease-in-out infinite;
}

.plant-container.grown .leaf-svg:nth-child(odd) {
  animation-delay: -1s;
}

@keyframes leafSway {

  0%,
  100% {
    transform: rotate(-15deg) scale(1);
  }

  50% {
    transform: rotate(-10deg) scale(1.02);
  }
}

.plant-container.grown .leaf-svg-right {
  animation-name: leafSwayRight;
}

@keyframes leafSwayRight {

  0%,
  100% {
    transform: rotate(15deg) scale(1);
  }

  50% {
    transform: rotate(10deg) scale(1.02);
  }
}

/* ============================================
   Blossom (Closed) — bigger, 7 petals
   ============================================ */
.blossom-container {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  opacity: 0;
  transition: opacity 0.8s ease 2.6s;
  pointer-events: none;
  cursor: pointer;
  z-index: 10;
}

.plant-container.growing .blossom-container,
.plant-container.grown .blossom-container {
  opacity: 1;
}

.plant-container.grown .blossom-container {
  transition-delay: 0s;
  pointer-events: auto;
}

/* Blossom tap hint */
.blossom-hint {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  animation: hintFade 2s ease-in-out infinite;
  animation-play-state: paused;
}

.blossom-container.ready .blossom-hint {
  opacity: 1;
  animation-play-state: running;
}

.blossom-container.open .blossom-hint {
  opacity: 0 !important;
  animation: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Closed bud petals */
.bud {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: budSway 3s ease-in-out infinite;
}

@keyframes budSway {

  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(2deg);
  }
}

.bud-petal {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.08);
}

.bud-petal-1 {
  width: 34px;
  height: 55px;
  background: linear-gradient(180deg, var(--petal-deep), var(--petal-pink));
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) rotate(-18deg);
  z-index: 3;
}

.bud-petal-2 {
  width: 34px;
  height: 55px;
  background: linear-gradient(180deg, var(--petal-pink), var(--petal-light));
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) rotate(18deg);
  z-index: 2;
}

.bud-petal-3 {
  width: 30px;
  height: 50px;
  background: linear-gradient(180deg, var(--petal-deep), #d81b60);
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) rotate(0deg);
  z-index: 5;
}

.bud-petal-4 {
  width: 28px;
  height: 48px;
  background: linear-gradient(180deg, var(--petal-light), var(--petal-pink));
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) rotate(-10deg);
  z-index: 1;
}

.bud-petal-5 {
  width: 28px;
  height: 48px;
  background: linear-gradient(180deg, var(--petal-light), var(--petal-pink));
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) rotate(10deg);
  z-index: 1;
}

.bud-petal-6 {
  width: 24px;
  height: 44px;
  background: linear-gradient(180deg, #f48fb1, var(--petal-deep));
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) rotate(-25deg);
  z-index: 0;
}

.bud-petal-7 {
  width: 24px;
  height: 44px;
  background: linear-gradient(180deg, #f48fb1, var(--petal-deep));
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) rotate(25deg);
  z-index: 0;
}

/* Blossom center disc (hidden until open) */
.bud-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff9c4, #ffd54f);
  z-index: 6;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.5);
}

/* Bud glow when ready to tap */
.blossom-container.ready .bud {
  animation: budSway 3s ease-in-out infinite, budGlow 1.5s ease-in-out infinite;
}

@keyframes budGlow {

  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(240, 98, 146, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 25px rgba(240, 98, 146, 0.8));
  }
}

/* ============================================
   Blossom (Open) — petals spread wide
   ============================================ */
.blossom-container.open .bud {
  animation: none;
}

.blossom-container.open .bud-center {
  transform: translate(-50%, -50%) scale(1);
}

.blossom-container.open .bud-petal-1 {
  transform: translateX(-140%) rotate(-75deg) scale(1.15);
  bottom: -8px;
}

.blossom-container.open .bud-petal-2 {
  transform: translateX(40%) rotate(75deg) scale(1.15);
  bottom: -8px;
}

.blossom-container.open .bud-petal-3 {
  transform: translateX(-50%) rotate(0deg) translateY(-28px) scale(1.15);
}

.blossom-container.open .bud-petal-4 {
  transform: translateX(-170%) rotate(-50deg) scale(1);
  bottom: 3px;
}

.blossom-container.open .bud-petal-5 {
  transform: translateX(70%) rotate(50deg) scale(1);
  bottom: 3px;
}

.blossom-container.open .bud-petal-6 {
  transform: translateX(-200%) rotate(-90deg) scale(0.95);
  bottom: 0;
}

.blossom-container.open .bud-petal-7 {
  transform: translateX(100%) rotate(90deg) scale(0.95);
  bottom: 0;
}

/* ============================================
   Penguin Center (inside blossom)
   ============================================ */
.penguin-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100px;
  height: 100px;
  z-index: 10;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.penguin-center img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.blossom-container.open .penguin-center {
  transform: translate(-50%, -65%) scale(1);
}

/* ============================================
   Question Overlay
   ============================================ */
.question-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 10, 46, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.question-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.question-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  width: 85%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardAppear {
  0% {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.question-card h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 32px;
  color: white;
  margin-bottom: 8px;
  line-height: 1.3;
}

.question-card p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
}

.question-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-yes {
  background: linear-gradient(135deg, #e53935, #ff6f61);
  color: white;
  box-shadow: 0 4px 20px rgba(229, 57, 53, 0.4);
}

.btn-yes:hover,
.btn-yes:active {
  transform: scale(1.08);
  box-shadow: 0 6px 30px rgba(229, 57, 53, 0.6);
}

.btn-no {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.btn-no:hover {
  transform: scale(0.9);
  opacity: 0.7;
}

/* ============================================
   Final Message
   ============================================ */
.final-message {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease 1.2s;
  width: 90%;
}

.final-message.visible {
  opacity: 1;
}

.final-message h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 38px;
  color: white;
  text-shadow: 0 2px 20px rgba(229, 57, 53, 0.5);
  margin-bottom: 8px;
  animation: textFloat 3s ease-in-out infinite;
}

.final-message p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

@keyframes textFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* ============================================
   Sparkle Particles (during growth)
   ============================================ */
.sparkle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 25;
  animation: sparkleFly 1s ease-out forwards;
}

@keyframes sparkleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* ============================================
   Hearts Canvas (confetti)
   ============================================ */
#heartsCanvas {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-height: 600px) {

  .plant-container.growing .stem-wrapper,
  .plant-container.grown .stem-wrapper {
    height: 200px;
  }

  .question-card h2 {
    font-size: 26px;
  }

  .final-message h1 {
    font-size: 30px;
  }
}

@media (min-width: 768px) {
  .question-card {
    max-width: 400px;
    padding: 48px 40px;
  }

  .question-card h2 {
    font-size: 38px;
  }
}

/* ============================================
   Moon
   ============================================ */
.moon {
  position: fixed;
  top: 8%;
  right: 12%;
  width: 70px;
  height: 70px;
  z-index: 2;
  pointer-events: none;
}

.moon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9e6, #fdd835 40%, #f9a825 100%);
  box-shadow:
    0 0 20px rgba(253, 216, 53, 0.4),
    0 0 60px rgba(253, 216, 53, 0.2),
    0 0 100px rgba(253, 216, 53, 0.1);
}

/* Moon craters */
.moon::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(249, 168, 37, 0.3);
  box-shadow:
    15px 8px 0 3px rgba(249, 168, 37, 0.2),
    -5px 18px 0 1px rgba(249, 168, 37, 0.25),
    20px 25px 0 2px rgba(249, 168, 37, 0.15);
}

.moon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 216, 53, 0.12) 0%, transparent 70%);
  animation: moonPulse 6s ease-in-out infinite;
}

@keyframes moonPulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
}

/* ============================================
   Fireflies
   ============================================ */
.fireflies {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd54f;
  box-shadow: 0 0 6px 2px rgba(255, 213, 79, 0.6), 0 0 14px 4px rgba(255, 213, 79, 0.2);
  animation: fireflyFloat var(--dur) ease-in-out infinite, fireflyGlow var(--glow-dur) ease-in-out infinite;
}

@keyframes fireflyFloat {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(var(--dx1), var(--dy1));
  }

  50% {
    transform: translate(var(--dx2), var(--dy2));
  }

  75% {
    transform: translate(var(--dx3), var(--dy3));
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes fireflyGlow {

  0%,
  100% {
    opacity: 0.2;
  }

  30% {
    opacity: 1;
  }

  60% {
    opacity: 0.4;
  }

  80% {
    opacity: 0.9;
  }
}

/* ============================================
   Shooting Star
   ============================================ */
.shooting-star {
  position: fixed;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8);
}

.shooting-star::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  width: 80px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
  border-radius: 1px;
}

@keyframes shootingStar {
  0% {
    transform: translate(0, 0) rotate(-35deg);
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    transform: translate(300px, 200px) rotate(-35deg);
    opacity: 0;
  }
}

/* ============================================
   Grass Silhouettes
   ============================================ */
.grass-container {
  position: fixed;
  bottom: 20%;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 11;
  pointer-events: none;
  overflow: visible;
}

.grass-blade {
  position: absolute;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to top, #33691e, #558b2f);
  border-radius: 2px 2px 0 0;
  transform-origin: bottom center;
  animation: grassSway var(--sway-dur) ease-in-out infinite;
  opacity: 0.7;
}

@keyframes grassSway {

  0%,
  100% {
    transform: rotate(var(--rot-start));
  }

  50% {
    transform: rotate(var(--rot-end));
  }
}

/* ============================================
   Penguin Bounce (after reveal)
   ============================================ */
.blossom-container.open .penguin-center {
  animation: penguinBounce 2s ease-in-out 1.4s infinite;
}

@keyframes penguinBounce {

  0%,
  100% {
    transform: translate(-50%, -65%) scale(1);
  }

  15% {
    transform: translate(-50%, -72%) scale(1.05, 0.95);
  }

  30% {
    transform: translate(-50%, -65%) scale(0.95, 1.05);
  }

  45% {
    transform: translate(-50%, -69%) scale(1.02, 0.98);
  }

  60% {
    transform: translate(-50%, -65%) scale(1);
  }
}

/* ============================================
   Typewriter & Final Message Enhancements
   ============================================ */
#typewriterText {
  display: inline;
}

#typewriterText::after {
  content: '|';
  animation: cursorBlink 0.7s step-end infinite;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
}

#typewriterText.done::after {
  display: none;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.final-sub {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.final-message.visible .final-sub {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Petal Scatter Particle
   ============================================ */
.petal-particle {
  position: fixed;
  width: 12px;
  height: 18px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
  z-index: 30;
  animation: petalFall var(--fall-dur) ease-out forwards;
  opacity: 0.85;
}

@keyframes petalFall {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.85;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    transform: translate(var(--px), var(--py)) rotate(var(--pr)) scale(0.3);
    opacity: 0;
  }
}