/* ───────── Reset & Base ───────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blush: #f8b4c8;
  --pink: #ff7eb3;
  --peach: #ffcba4;
  --lavender: #c3aed6;
  --beige: #fff5e4;
  --warm-white: #fff9f0;
  --deep-rose: #e75480;
  --soft-shadow: rgba(231, 84, 128, 0.25);
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--warm-white);
  color: #5a3e4b;
  overflow-x: hidden;
  min-height: 100vh;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ───────── Floating Hearts Background ───────── */
.bg-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-hearts span {
  position: absolute;
  display: block;
  font-size: 1.4rem;
  opacity: 0;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(100vh) rotate(0deg) scale(0.6); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) rotate(360deg) scale(1); opacity: 0; }
}

/* ───────── Scene ───────── */
.scene {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scene.compressed {
  transform: scale(0.96);
}

/* ───────── Title ───────── */
.title {
  font-family: 'Patrick Hand', cursive;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--deep-rose);
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeDown 1s 0.3s ease-out forwards;
}
.subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: #b07a8a;
  text-align: center;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeDown 1s 0.6s ease-out forwards;
}

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

/* ───────── Character Container ───────── */
.character-wrap {
  position: relative;
  width: 260px;
  height: 300px;
  margin-bottom: 2rem;
  animation: gentleFloat 4s ease-in-out infinite;
}

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

/* ───────── Body (heart-shaped blob) ───────── */
.body {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 110px;
  background: var(--pink);
  border-radius: 60px 60px 10px 10px;
  box-shadow: 0 8px 30px var(--soft-shadow);
  transition: background 0.6s, box-shadow 0.6s;
}
.body::before, .body::after {
  content: '';
  position: absolute;
  width: 68px;
  height: 68px;
  background: var(--pink);
  border-radius: 50%;
  top: -28px;
  transition: background 0.6s;
}
.body::before { left: 6px; }
.body::after  { right: 6px; }

/* face */
.face {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.eyes {
  display: flex;
  gap: 20px;
}
.eye {
  width: 10px;
  height: 10px;
  background: #5a3e4b;
  border-radius: 50%;
  transition: all 0.4s;
}
.eye.happy {
  height: 4px;
  border-radius: 4px 4px 0 0;
  margin-top: 3px;
}
.mouth {
  width: 18px;
  height: 9px;
  border: 3px solid #5a3e4b;
  border-top: none;
  border-radius: 0 0 18px 18px;
  transition: all 0.4s;
}
.mouth.big {
  width: 24px;
  height: 12px;
  border-width: 3px;
}
.blush {
  position: absolute;
  top: 46%;
  width: 18px;
  height: 10px;
  background: rgba(255, 130, 150, 0.5);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.6s;
}
.blush.left  { left: 12px; }
.blush.right { right: 12px; }
.blush.visible { opacity: 1; }

/* ───────── Arms ───────── */
.arm {
  position: absolute;
  top: 46%;
  width: 80px;
  height: 28px;
  background: var(--pink);
  border-radius: 30px;
  z-index: 1;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}
.arm.left {
  right: 56%;
  transform: rotate(-20deg);
}
.arm.right {
  left: 56%;
  transform: rotate(20deg);
}

/* Hand (circle at end of arm) */
.arm::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  background: var(--pink);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: background 0.6s;
}
.arm.left::after  { left: -6px; }
.arm.right::after { right: -6px; }

/* Arms hugging state */
.arm.left.hug {
  transform: rotate(40deg) translateX(-30px);
  width: 110px;
}
.arm.right.hug {
  transform: rotate(-40deg) translateX(30px);
  width: 110px;
}

/* Arms tight hug state */
.arm.left.tight {
  transform: rotate(60deg) translateX(-40px);
  width: 130px;
}
.arm.right.tight {
  transform: rotate(-60deg) translateX(40px);
  width: 130px;
}

/* ───────── Glow Ring ───────── */
.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,126,179,0.25) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.8s, width 0.8s, height 0.8s;
  pointer-events: none;
}
.glow.active {
  opacity: 1;
  width: 320px;
  height: 320px;
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

/* ───────── Heartbeat ───────── */
.heartbeat {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.heartbeat.active {
  animation: heartbeatPulse 0.9s ease-in-out infinite;
}

@keyframes heartbeatPulse {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  15%  { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  45%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
}

/* ───────── CTA Button ───────── */
.cta-btn {
  display: inline-block;
  padding: 0.9rem 2.4rem;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--deep-rose));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--soft-shadow);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s;
  animation: fadeDown 1s 0.9s ease-out forwards;
  opacity: 0;
  position: relative;
  z-index: 5;
}
.cta-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 32px var(--soft-shadow);
}
.cta-btn:active {
  transform: scale(0.97);
}
.cta-btn.hidden {
  pointer-events: none;
  opacity: 0 !important;
  transform: scale(0.8);
  transition: opacity 0.5s, transform 0.5s;
}

/* ───────── Hold Prompt ───────── */
.hold-prompt {
  text-align: center;
  margin-top: 1.5rem;
  opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none;
  z-index: 5;
  position: relative;
}
.hold-prompt.visible {
  opacity: 1;
  pointer-events: auto;
}
.hold-prompt p {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.2rem;
  color: var(--deep-rose);
  margin-bottom: 0.6rem;
}

/* Hold circle indicator */
.hold-area {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
  cursor: pointer;
}
.hold-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--blush);
  transition: border-color 0.3s;
}
.hold-fill {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(var(--pink) var(--hold-pct, 0%), transparent 0%);
  transition: none;
}
.hold-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

/* ───────── Final Message ───────── */
.final-message {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s;
  background: radial-gradient(ellipse at center, rgba(255,245,228,0.97) 0%, rgba(248,180,200,0.95) 100%);
}
.final-message.visible {
  opacity: 1;
  pointer-events: auto;
}
.final-message h2 {
  font-family: 'Patrick Hand', cursive;
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  color: var(--deep-rose);
  margin-bottom: 0.5rem;
  animation: squishy 0.8s ease-out;
}
.final-message p {
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: #b07a8a;
}
.final-message .big-heart {
  font-size: clamp(4rem, 15vw, 8rem);
  margin-bottom: 1.5rem;
  line-height: 1;
  text-align: center;
  animation: bigHeartPulse 1.2s ease-in-out infinite;
}

@keyframes bigHeartPulse {
  0%   { transform: scale(1); opacity: 0.9; }
  15%  { transform: scale(1.25); opacity: 1; }
  30%  { transform: scale(1); opacity: 0.9; }
  45%  { transform: scale(1.15); opacity: 1; }
  60%  { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.9; }
}

@keyframes squishy {
  0%   { transform: scale(0.3) rotate(-5deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(2deg); }
  80%  { transform: scale(0.95) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Restart */
.restart-btn {
  margin-top: 2rem;
  padding: 0.7rem 2rem;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.15rem;
  color: var(--deep-rose);
  background: #fff;
  border: 2px solid var(--blush);
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}
.restart-btn:hover {
  background: var(--beige);
  transform: scale(1.06);
}

/* ───────── Sparkle bursts ───────── */
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  animation: sparklePop 0.7s ease-out forwards;
}

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

/* ───────── Responsive ───────── */
@media (max-width: 480px) {
  .character-wrap {
    width: 200px;
    height: 240px;
  }
  .body { width: 100px; height: 90px; }
  .body::before, .body::after { width: 56px; height: 56px; top: -24px; }
  .body::before { left: 4px; }
  .body::after  { right: 4px; }
  .arm { width: 65px; height: 24px; }
  .arm.left.hug  { width: 90px; }
  .arm.right.hug { width: 90px; }
  .arm.left.tight  { width: 110px; }
  .arm.right.tight { width: 110px; }
}
