/* ============================================
   Romantic Love Website - Styles
   Made With Love For Meera 🌻❤️
   ============================================ */

/* ---------- Viewport fix for mobile browsers ---------- */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --pink-light: #ffe4ec;
  --pink-rose: #ff85a2;
  --pink-deep: #ff4f81;
  --rose-red: #e8365d;
  --soft-red: #ff6b6b;
  --white: #ffffff;
  --white-alpha-20: rgba(255, 255, 255, 0.2);
  --white-alpha-40: rgba(255, 255, 255, 0.4);
  --white-alpha-60: rgba(255, 255, 255, 0.6);
  --white-alpha-80: rgba(255, 255, 255, 0.8);
  --pink-alpha-10: rgba(255, 133, 162, 0.1);
  --pink-alpha-20: rgba(255, 133, 162, 0.2);
  --pink-alpha-30: rgba(255, 133, 162, 0.3);
  --text-dark: #5a2d3e;
  --text-medium: #7a4158;
  --text-light: #9e6b80;
  --gradient-main: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 30%, #f48fb1 60%, #f06292 100%);
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,228,236,0.4));
  --gradient-button: linear-gradient(135deg, #ff85a2, #ff4f81);
  --gradient-button-hover: linear-gradient(135deg, #ff4f81, #e8365d);
  --shadow-soft: 0 8px 32px rgba(232, 54, 93, 0.15);
  --shadow-medium: 0 12px 40px rgba(232, 54, 93, 0.2);
  --shadow-glow: 0 0 30px rgba(255, 79, 129, 0.3);
  --font-primary: 'Poppins', sans-serif;
  --font-cursive: 'Dancing Script', cursive;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
  scroll-behavior: smooth;
  overflow: hidden;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  background: var(--gradient-main);
  color: var(--text-dark);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safe area for notched phones */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--pink-light);
}
::-webkit-scrollbar-thumb {
  background: var(--pink-rose);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pink-deep);
}

/* ---------- Loading Screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--gradient-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-heart {
  font-size: 4rem;
  animation: heartbeat 1s ease-in-out infinite;
}

.loading-text {
  font-family: var(--font-cursive);
  font-size: 1.5rem;
  color: var(--rose-red);
  margin-top: 1.5rem;
  animation: fadeInUp 1s ease forwards;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
  60% { transform: scale(1); }
}

/* ---------- Background Floating Hearts ---------- */
.floating-hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.15;
  animation: floatHeart linear infinite;
}

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

/* ---------- Floating Sunflowers ---------- */
.floating-sunflower {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.12;
  animation: floatSunflower linear infinite;
}

@keyframes floatSunflower {
  0% {
    transform: translateY(110vh) rotate(0deg);
    opacity: 0;
  }
  15% { opacity: 0.15; }
  85% { opacity: 0.12; }
  100% {
    transform: translateY(-10vh) rotate(180deg);
    opacity: 0;
  }
}

/* ---------- Rose Petals ---------- */
.rose-petal {
  position: absolute;
  width: 12px;
  height: 16px;
  background: radial-gradient(ellipse, #ff85a2, #ff4f81);
  border-radius: 50% 0 50% 50%;
  opacity: 0;
  animation: fallPetal linear infinite;
  pointer-events: none;
}

@keyframes fallPetal {
  0% {
    transform: translateY(-5vh) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  50% { transform: translateY(50vh) rotate(180deg) translateX(40px); }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(110vh) rotate(360deg) translateX(-20px);
    opacity: 0;
  }
}

/* ---------- Page Container ---------- */
.page-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
  /* Allow vertical scrolling when content overflows on mobile */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.page-container.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* ---------- Glassmorphism Card ---------- */
.glass-card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--white-alpha-40);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  /* Prevent card from exceeding viewport on mobile */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Flex shrink so it doesn't push out of view */
  flex-shrink: 0;
  margin: auto;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--white-alpha-20) 0%, transparent 70%);
  pointer-events: none;
}

/* ---------- Typography ---------- */
.title-cursive {
  font-family: var(--font-cursive);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--rose-red);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.title-large {
  font-family: var(--font-cursive);
  font-size: 3rem;
  font-weight: 700;
  color: var(--rose-red);
  line-height: 1.2;
}

.subtitle {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-medium);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.emoji-large {
  font-size: 5rem;
  display: block;
  margin-bottom: 1rem;
  animation: bounceIn 1s ease forwards;
}

.emoji-xl {
  font-size: 6rem;
  display: block;
  margin-bottom: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gradient-button);
  color: var(--white);
  border: none;
  padding: 0.9rem 2.5rem;
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-soft);
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
  /* Better touch targets for mobile (min 44px) */
  min-height: 48px;
  touch-action: manipulation;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-medium), var(--shadow-glow);
  background: var(--gradient-button-hover);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white-alpha-60);
  color: var(--rose-red);
  border: 2px solid var(--pink-rose);
  padding: 0.8rem 1.8rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 15px rgba(255, 133, 162, 0.15);
  /* Better touch targets */
  min-height: 48px;
  touch-action: manipulation;
}

.btn-secondary:hover {
  background: var(--gradient-button);
  color: var(--white);
  border-color: transparent;
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-medium);
}

/* Active state for touch devices (no hover) */
@media (hover: none) {
  .btn-primary:active {
    transform: scale(0.96);
    background: var(--gradient-button-hover);
  }
  .btn-secondary:active {
    background: var(--gradient-button);
    color: var(--white);
    border-color: transparent;
    transform: scale(0.96);
  }
}

/* ---------- Sound Toggle ---------- */
.sound-toggle {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 1rem));
  right: max(1rem, env(safe-area-inset-right, 1rem));
  z-index: 9999;
  background: var(--white-alpha-60);
  backdrop-filter: blur(10px);
  border: 1px solid var(--white-alpha-40);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  touch-action: manipulation;
}

.sound-toggle:hover {
  transform: scale(1.1);
  background: var(--white-alpha-80);
}

/* ---------- Page 1 - Welcome ---------- */
#page-welcome .sunflower-anim {
  font-size: 6rem;
  animation: sunflowerBounce 2s ease-in-out infinite;
}

@keyframes sunflowerBounce {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  25% { transform: rotate(5deg) scale(1.1); }
  50% { transform: rotate(-3deg) scale(1.05); }
  75% { transform: rotate(3deg) scale(1.08); }
}

.welcome-greeting {
  font-family: var(--font-cursive);
  font-size: 2.2rem;
  color: var(--rose-red);
  opacity: 0;
  animation: fadeInUp 1s ease 0.5s forwards;
}

.welcome-subtitle {
  font-size: 1.05rem;
  color: var(--text-medium);
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease 1s forwards;
}

#page-welcome .btn-primary {
  opacity: 0;
  animation: fadeInUp 1s ease 1.5s forwards;
}

/* ---------- Page 3 - Camera ---------- */
.camera-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 1rem auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
}

.camera-container video,
.camera-container canvas {
  width: 100%;
  display: block;
  border-radius: 20px;
  transform: scaleX(-1);
}

.camera-container canvas {
  display: none;
}

/* Heart-shaped selfie frame */
.heart-frame-container {
  display: none;
  position: relative;
  width: 260px;
  height: 260px;
  margin: 1rem auto;
}

.heart-frame-container.show {
  display: block;
  animation: bounceIn 0.8s ease forwards;
}

.heart-frame {
  width: 260px;
  height: 260px;
  position: relative;
  overflow: hidden;
  clip-path: path('M130,240 C130,240 20,180 20,100 C20,60 50,20 90,20 C110,20 125,30 130,50 C135,30 150,20 170,20 C210,20 240,60 240,100 C240,180 130,240 130,240 Z');
}

.heart-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.heart-frame-border {
  position: absolute;
  inset: -4px;
  clip-path: path('M130,240 C130,240 20,180 20,100 C20,60 50,20 90,20 C110,20 125,30 130,50 C135,30 150,20 170,20 C210,20 240,60 240,100 C240,180 130,240 130,240 Z');
  background: var(--gradient-button);
  z-index: -1;
  transform: scale(1.05);
}

.camera-permission-msg {
  padding: 2rem 1rem;
  color: var(--text-medium);
  font-size: 0.95rem;
}

/* ---------- Compliment Slides ---------- */
.compliment-card {
  position: relative;
  padding: 2rem 1.5rem;
}

.compliment-quote {
  font-family: var(--font-cursive);
  font-size: 1.7rem;
  color: var(--rose-red);
  line-height: 1.5;
  position: relative;
  padding: 0 1rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compliment-quote::before {
  content: '"';
  font-size: 4rem;
  position: absolute;
  top: -0.5rem;
  left: -0.2rem;
  color: var(--pink-alpha-30);
  font-family: var(--font-cursive);
}

.compliment-quote::after {
  content: '"';
  font-size: 4rem;
  position: absolute;
  bottom: -1.5rem;
  right: -0.2rem;
  color: var(--pink-alpha-30);
  font-family: var(--font-cursive);
}

.compliment-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--pink-rose);
  background: var(--white-alpha-60);
  color: var(--rose-red);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
}

.nav-btn:hover {
  background: var(--gradient-button);
  color: var(--white);
  border-color: transparent;
  transform: scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.progress-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 180px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink-alpha-20);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.progress-dot.active {
  background: var(--pink-deep);
  width: 20px;
  border-radius: 4px;
}

.compliment-number {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

/* ---------- Grand Finale ---------- */
#page-finale .glass-card {
  max-width: 520px;
  overflow-y: auto;
}

.finale-thank-you {
  font-family: var(--font-cursive);
  font-size: 2.5rem;
  color: var(--rose-red);
  animation: fadeInUp 1s ease forwards;
}

.finale-smile {
  font-size: 1.5rem;
  color: var(--text-medium);
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease 1s forwards;
}

.finale-love {
  font-family: var(--font-cursive);
  font-size: 3rem;
  color: var(--pink-deep);
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease 2s forwards;
  text-shadow: 0 0 20px rgba(255, 79, 129, 0.3);
}

.finale-roses {
  font-size: 2rem;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease 2.5s forwards;
  letter-spacing: 0.5rem;
}

/* ---------- Love Meter ---------- */
.love-meter-section {
  margin-top: 2rem;
}

.love-meter-track {
  width: 100%;
  height: 18px;
  background: var(--white-alpha-40);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.love-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink-rose), var(--pink-deep), var(--rose-red));
  border-radius: 10px;
  transition: width 3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.love-meter-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.love-meter-label {
  font-family: var(--font-cursive);
  font-size: 1.3rem;
  color: var(--rose-red);
  margin-top: 0.5rem;
}

/* ---------- Memory Counter ---------- */
.memory-counter-section {
  margin-top: 1.5rem;
}

.memory-counter-text {
  font-size: 0.95rem;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.memory-counter-value {
  font-family: var(--font-cursive);
  font-size: 2rem;
  color: var(--pink-deep);
  font-weight: 700;
}

/* ---------- Floating Notes ---------- */
.floating-note {
  position: fixed;
  font-family: var(--font-cursive);
  font-size: 1rem;
  color: var(--pink-deep);
  background: var(--white-alpha-80);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--white-alpha-40);
  box-shadow: 0 4px 15px rgba(255, 79, 129, 0.1);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  animation: floatNote 6s ease-in-out forwards;
}

@keyframes floatNote {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(-40px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.9);
  }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--white-alpha-40);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-medium);
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  /* Don't overflow on small phones */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

/* ---------- End Screen ---------- */
.end-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--gradient-main);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.end-screen.show {
  display: flex;
  animation: fadeIn 1s ease forwards;
}

.end-title {
  font-family: var(--font-cursive);
  font-size: 3.5rem;
  color: var(--rose-red);
  animation: heartbeat 1.5s ease-in-out infinite;
}

.end-subtitle {
  font-family: var(--font-cursive);
  font-size: 1.5rem;
  color: var(--text-medium);
  margin-top: 1rem;
  animation: fadeInUp 1s ease 0.5s forwards;
  opacity: 0;
}

/* ---------- Confetti Canvas ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
}

/* ---------- Heart Cursor Trail ---------- */
.cursor-heart {
  position: fixed;
  pointer-events: none;
  z-index: 9996;
  font-size: 1rem;
  animation: cursorHeartFade 1s ease forwards;
}

@keyframes cursorHeartFade {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) translateY(-30px);
  }
}

/* ---------- Typewriter Cursor ---------- */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background: var(--rose-red);
  margin-left: 4px;
  animation: blink 0.7s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- Heart Burst ---------- */
.heart-burst {
  position: fixed;
  pointer-events: none;
  z-index: 100;
}

.burst-heart {
  position: absolute;
  font-size: 1.5rem;
  animation: burstAway 1s ease forwards;
}

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

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 79, 129, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 79, 129, 0.4);
  }
}

.animate-in {
  animation: slideInUp 0.8s ease forwards;
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ---------- Responsive ---------- */

/* ---- Small phones (max-height fix for short screens) ---- */
@media (max-height: 650px) {
  .glass-card {
    padding: 1.2rem 1rem;
    max-height: calc(100dvh - 1.5rem);
  }

  .emoji-large {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
  }

  .emoji-xl {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
  }

  .title-cursive {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-top: 0.4rem;
  }

  .btn-primary {
    margin-top: 0.8rem;
    padding: 0.7rem 1.8rem;
  }

  .btn-group {
    margin-top: 0.8rem;
  }

  .sunflower-anim {
    font-size: 4rem !important;
  }

  .welcome-greeting {
    font-size: 1.6rem;
  }

  .camera-container {
    max-width: 200px;
  }

  .heart-frame-container,
  .heart-frame {
    width: 160px;
    height: 160px;
  }

  .compliment-quote {
    font-size: 1.2rem;
    min-height: 60px;
  }

  .finale-thank-you { font-size: 1.5rem; }
  .finale-smile { font-size: 1.1rem; }
  .finale-love { font-size: 1.6rem; }
  .finale-roses { font-size: 1.3rem; }
  .love-meter-section { margin-top: 1rem; }
  .memory-counter-section { margin-top: 0.8rem; }
  .memory-counter-value { font-size: 1.5rem; }
}

/* ---- Standard phones (up to 480px wide) ---- */
@media (max-width: 480px) {
  .glass-card {
    padding: 1.8rem 1.3rem;
    border-radius: 20px;
    margin: 0 0.25rem;
    max-height: calc(100dvh - 2rem);
  }

  .title-cursive {
    font-size: 1.8rem;
  }

  .title-large {
    font-size: 2rem;
  }

  .emoji-large {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
  }

  .emoji-xl {
    font-size: 4rem;
    margin-bottom: 0.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .btn-primary {
    padding: 0.8rem 2rem;
    font-size: 0.95rem;
  }

  .btn-secondary {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
  }

  .btn-group {
    gap: 0.7rem;
  }

  .welcome-greeting {
    font-size: 1.8rem;
  }

  .welcome-subtitle {
    font-size: 0.95rem;
  }

  #page-welcome .sunflower-anim {
    font-size: 5rem;
  }

  .compliment-quote {
    font-size: 1.35rem;
    padding: 0 0.5rem;
    min-height: 80px;
  }

  .compliment-quote::before,
  .compliment-quote::after {
    font-size: 3rem;
  }

  .compliment-nav {
    gap: 1rem;
    margin-top: 1.2rem;
  }

  .compliment-number {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }

  .finale-thank-you {
    font-size: 1.8rem;
  }

  .finale-smile {
    font-size: 1.2rem;
  }

  .finale-love {
    font-size: 2rem;
  }

  .finale-roses {
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
  }

  .end-title {
    font-size: 2.2rem;
    padding: 0 1rem;
  }

  .end-subtitle {
    font-size: 1.2rem;
    padding: 0 1rem;
  }

  .love-meter-section {
    margin-top: 1.2rem;
  }

  .love-meter-track {
    height: 14px;
  }

  .love-meter-label {
    font-size: 1.1rem;
  }

  .memory-counter-section {
    margin-top: 1rem;
  }

  .memory-counter-value {
    font-size: 1.6rem;
  }

  .heart-frame-container,
  .heart-frame {
    width: 200px;
    height: 200px;
  }

  .heart-frame {
    clip-path: path('M100,185 C100,185 15,139 15,77 C15,46 38,15 69,15 C85,15 96,23 100,38 C104,23 115,15 131,15 C162,15 185,46 185,77 C185,139 100,185 100,185 Z');
  }

  .camera-container {
    max-width: 260px;
  }

  .modal-content {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .modal-content .title-cursive {
    font-size: 1.5rem;
  }

  .modal-content .emoji-xl {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
  }

  .floating-note {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .sound-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .loading-heart {
    font-size: 3rem;
  }

  .loading-text {
    font-size: 1.2rem;
  }
}

/* ---- Very small phones (320px-360px) ---- */
@media (max-width: 360px) {
  .glass-card {
    padding: 1.3rem 0.8rem;
    border-radius: 16px;
  }

  .title-cursive {
    font-size: 1.5rem;
  }

  .emoji-large {
    font-size: 3rem;
  }

  .compliment-quote {
    font-size: 1.15rem;
  }

  .btn-group {
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .welcome-greeting {
    font-size: 1.5rem;
  }

  .finale-thank-you {
    font-size: 1.5rem;
  }

  .finale-love {
    font-size: 1.7rem;
  }

  .progress-dots {
    max-width: 140px;
    gap: 4px;
  }

  .progress-dot {
    width: 6px;
    height: 6px;
  }

  .progress-dot.active {
    width: 16px;
  }
}

/* ---- Tablets and larger screens ---- */
@media (min-width: 768px) {
  .glass-card {
    padding: 3rem 2.5rem;
    max-height: none;
    overflow: visible;
  }

  .compliment-quote {
    font-size: 2rem;
  }

  .camera-container {
    max-width: 360px;
  }

  .page-container {
    overflow: visible;
  }
}

/* ---- Landscape phones ---- */
@media (max-height: 450px) and (orientation: landscape) {
  .glass-card {
    padding: 1rem 1.5rem;
    max-height: calc(100dvh - 1rem);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  .emoji-large,
  .emoji-xl {
    font-size: 2.5rem;
    margin-bottom: 0.2rem;
  }

  .title-cursive {
    font-size: 1.3rem;
  }

  .btn-primary {
    margin-top: 0.5rem;
    padding: 0.5rem 1.5rem;
    min-height: 40px;
  }

  .sunflower-anim {
    font-size: 3rem !important;
  }

  .welcome-greeting {
    font-size: 1.3rem;
  }
}

/* ---------- Parallax Heart BG for finale ---------- */
.parallax-hearts {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.parallax-heart {
  position: absolute;
  color: rgba(255, 79, 129, 0.08);
  font-size: 3rem;
  animation: parallaxFloat 8s ease-in-out infinite;
}

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

/* Handwritten effect for finale */
.handwritten-effect {
  font-family: var(--font-cursive);
  overflow: hidden;
  border-right: 3px solid var(--rose-red);
  white-space: nowrap;
  animation: typing 3s steps(30) forwards, blinkCaret 0.7s step-end infinite;
  max-width: 0;
  display: inline-block;
}

.handwritten-effect.animate {
  max-width: 100%;
}

@keyframes typing {
  from { max-width: 0; }
  to { max-width: 100%; }
}

@keyframes blinkCaret {
  50% { border-color: transparent; }
}

/* Heart particles for compliments */
.heart-particle {
  position: absolute;
  pointer-events: none;
  font-size: 0.8rem;
  opacity: 0;
  animation: particleRise 3s ease forwards;
}

@keyframes particleRise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.2) translateX(var(--drift));
  }
}
