/* Cute, Animated Motherly Pink Blossom Design System (Mobile-First) */
:root {
  --primary-color: #ec4899;
  --primary-hover: #db2777;
  --primary-light: #fdf2f8;
  --primary-glow: rgba(236, 72, 153, 0.36);

  --secondary-color: #be185d;
  --secondary-light: #fce7f3;

  --accent-pink: #f472b6;
  --accent-blush: #fbcfe8;
  --accent-gold: #fbbf24;

  --bg-gradient: radial-gradient(circle at 50% 12%, #fff7fb 0%, #ffe4f1 52%, #fbcfe8 100%);

  --card-bg: rgba(255, 252, 254, 0.92);
  --card-border: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 20px 45px -10px rgba(219, 39, 119, 0.22), 0 10px 20px -5px rgba(80, 15, 45, 0.05);

  --text-main: #3b1026;
  --text-muted: #7d4a65;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100dvh;
  width: 100%;
  font-family: var(--font-family);
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* App Container */
.app-wrapper {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: clamp(0.75rem, 3.2vw, 2.2rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.25rem));
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* Background floating pink blossom, heart & sparkle canvas */
#petal-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Glassmorphic Card */
.app-card {
  width: 100%;
  max-width: 490px;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: clamp(1.45rem, 5vw, 2.4rem);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: cardEntrance 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
  0% { opacity: 0; transform: translateY(22px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cute Bouncy Step Transitions */
.step-pane {
  display: none;
}

.step-pane.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: paneBounceIn 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes paneBounceIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Staggered Child Animations inside active step for mobile delight */
.step-pane.active .card-badge {
  animation: popDown 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.step-pane.active .avatar-container {
  animation: popScale 0.55s 0.08s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.step-pane.active h1.card-title,
.step-pane.active h2.card-title {
  animation: fadeSlideUp 0.45s 0.14s ease-out both;
}

.step-pane.active p.card-desc,
.step-pane.active .letter-box {
  animation: fadeSlideUp 0.45s 0.2s ease-out both;
}

.step-pane.active .btn-group {
  animation: fadeSlideUp 0.45s 0.28s ease-out both;
}

.step-pane.active .compliment-chip:nth-child(1) { animation: chipSlide 0.45s 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .compliment-chip:nth-child(2) { animation: chipSlide 0.45s 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .compliment-chip:nth-child(3) { animation: chipSlide 0.45s 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

.step-pane.active .gallery-item:nth-child(1) { animation: popScale 0.45s 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .gallery-item:nth-child(2) { animation: popScale 0.45s 0.20s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .gallery-item:nth-child(3) { animation: popScale 0.45s 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .gallery-item:nth-child(4) { animation: popScale 0.45s 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

.step-pane.active .candle-card:nth-child(1) { animation: popScale 0.45s 0.16s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .candle-card:nth-child(2) { animation: popScale 0.45s 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.step-pane.active .candle-card:nth-child(3) { animation: popScale 0.45s 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

@keyframes popDown {
  0% { opacity: 0; transform: translateY(-10px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popScale {
  0% { opacity: 0; transform: scale(0.86); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes chipSlide {
  0% { opacity: 0; transform: translateX(-14px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* Media / Illustrations */
.avatar-container {
  position: relative;
  width: min(210px, 54vw);
  height: min(210px, 54vw);
  margin: 0 auto 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.embrace-container {
  width: min(215px, 56vw);
  height: min(250px, 65vw);
  margin: 0 auto 1.15rem;
}

.cake-mini-container {
  width: min(160px, 42vw);
  height: min(160px, 42vw);
  margin: 0 auto 0.95rem;
}

.bouquet-container {
  width: min(255px, 68vw);
  height: min(255px, 68vw);
  margin: 0 auto 1.3rem;
}

.portrait-frame,
.embrace-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px -8px rgba(219, 39, 119, 0.28);
  position: relative;
  z-index: 2;
  animation: gentleSway 4.2s ease-in-out infinite;
}

@keyframes gentleSway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(0.7deg); }
}

.realistic-bouquet-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.bouquet-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  border: 3.5px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px -8px rgba(219, 39, 119, 0.34);
  animation: float-bouquet-pink 3.8s ease-in-out infinite;
  will-change: transform, box-shadow;
}

@keyframes float-bouquet-pink {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 16px 36px -8px rgba(219, 39, 119, 0.32);
  }
  50% {
    transform: translateY(-8px) scale(1.025);
    box-shadow: 0 24px 48px -6px rgba(236, 72, 153, 0.45);
  }
}

.sparkle-star {
  position: absolute;
  pointer-events: none;
  font-size: 1.35rem;
  z-index: 10;
  animation: sparkle-pulse 1.9s ease-in-out infinite alternate;
}

.sparkle-star.s1 {
  top: -8px;
  right: -8px;
  animation-delay: 0.15s;
}

.sparkle-star.s2 {
  bottom: 8px;
  left: -8px;
  font-size: 1.2rem;
  animation-delay: 0.75s;
}

.sparkle-star.s3 {
  top: 40%;
  right: -12px;
  font-size: 1.25rem;
  animation-delay: 1.3s;
}

@keyframes sparkle-pulse {
  0% { transform: scale(0.82) rotate(-12deg); opacity: 0.75; }
  100% { transform: scale(1.28) rotate(14deg); opacity: 1; filter: drop-shadow(0 0 8px rgba(244, 114, 182, 0.85)); }
}

.avatar-halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.38) 0%, transparent 70%);
  animation: pulse-halo 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-halo {
  0%, 100% { transform: scale(0.94); opacity: 0.65; }
  50% { transform: scale(1.1); opacity: 1; }
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 12px 24px rgba(219, 39, 119, 0.16));
  animation: cuteBob 3.2s ease-in-out infinite;
}

.avatar-img.portrait-frame {
  object-fit: cover;
}

.chibi-stage-container {
  position: relative;
}

.chibi-sticker {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  border: 3.5px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px -8px rgba(219, 39, 119, 0.28);
  position: relative;
  z-index: 2;
  will-change: transform;
}

.chibi-hop {
  animation: chibiHop 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes chibiHop {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-7px) rotate(-1.2deg) scale(1.02); }
  50% { transform: translateY(0) rotate(0.6deg) scale(1); }
  75% { transform: translateY(-5px) rotate(1.2deg) scale(1.015); }
}

.chibi-heartbeat {
  animation: chibiHeartbeat 2.6s ease-in-out infinite;
}

@keyframes chibiHeartbeat {
  0%, 100% { transform: scale(1) translateY(0); }
  30% { transform: scale(1.035) translateY(-5px); }
  55% { transform: scale(0.995) translateY(-2px); }
  75% { transform: scale(1.025) translateY(-4px); }
}

@keyframes cuteBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.02); }
}

/* Typography */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  background: var(--primary-light);
  color: var(--secondary-color);
  border: 1px solid rgba(236, 72, 153, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1);
}

h1.card-title, h2.card-title {
  font-size: clamp(1.42rem, 5vw, 2.02rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

p.card-desc {
  font-size: clamp(0.93rem, 3.1vw, 1.03rem);
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.45rem;
  max-width: 400px;
}

/* Heartfelt Letter Card */
.letter-box {
  width: 100%;
  padding: 1.05rem 1.2rem;
  margin-bottom: 1.4rem;
  background: linear-gradient(145deg, rgba(255, 245, 250, 0.96), rgba(255, 250, 253, 0.96));
  border: 1.5px solid rgba(236, 72, 153, 0.24);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 6px 18px rgba(219, 39, 119, 0.08);
}

.letter-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 3.2vw, 1.06rem);
  line-height: 1.65;
  color: #6b1442;
}

/* Button & Action Styles with Mobile Shimmer & Cute Pulse */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.btn-warm {
  position: relative;
  overflow: hidden;
  appearance: none;
  border: none;
  outline: none;
  min-height: 50px;
  width: 100%;
  padding: 0.8rem 1.3rem;
  font-family: inherit;
  font-size: clamp(0.92rem, 3.2vw, 1.03rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-warm:active {
  transform: scale(0.94) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 52%, #db2777 100%);
  color: #fff;
  box-shadow: 0 8px 24px -4px var(--primary-glow);
  animation: gentleBtnPulse 2.8s ease-in-out infinite;
}

/* Shimmer gleam sweeping across primary button */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.36) 50%, transparent 80%);
  animation: buttonShine 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes buttonShine {
  0%, 55% { left: -120%; }
  100% { left: 160%; }
}

@keyframes gentleBtnPulse {
  0%, 100% { box-shadow: 0 8px 22px -4px rgba(236, 72, 153, 0.36); }
  50% { box-shadow: 0 12px 28px -2px rgba(236, 72, 153, 0.56); }
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(236, 72, 153, 0.08);
  color: var(--secondary-color);
  border: 1px solid rgba(236, 72, 153, 0.22);
}

/* Appreciation / Reasons Cards */
.compliment-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.compliment-chip {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(236, 72, 153, 0.22);
  font-size: clamp(0.93rem, 3.2vw, 1.03rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--secondary-color);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compliment-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.18);
}

/* Loading Meter Screen */
.love-meter-box {
  width: 100%;
  margin: 1.2rem 0;
}

.meter-track {
  width: 100%;
  height: 14px;
  background: rgba(236, 72, 153, 0.14);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f9a8d4, #ec4899, #db2777);
  border-radius: var(--radius-pill);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 14px var(--primary-glow);
}

.meter-caption {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Interactive Birthday Candles Arena */
.candles-arena {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 1.35rem;
}

.candle-card {
  appearance: none;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 248, 252, 0.96) 0%, rgba(252, 231, 243, 0.9) 100%);
  border: 1.5px solid rgba(236, 72, 153, 0.28);
  border-radius: 18px;
  padding: 0.85rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.12);
  touch-action: manipulation;
  user-select: none;
}

.candle-card:hover:not(.blown),
.candle-card:active:not(.blown) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.25);
  border-color: rgba(236, 72, 153, 0.55);
}

.candle-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.candle-flame {
  font-size: 1.35rem;
  animation: flicker 0.75s ease-in-out infinite alternate;
  transform-origin: bottom center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes flicker {
  0% { transform: scale(0.92) rotate(-5deg); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.75)); }
  100% { transform: scale(1.12) rotate(5deg); filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.95)); }
}

.candle-body {
  font-size: 1.75rem;
  margin-top: -2px;
}

.candle-label {
  font-size: clamp(0.7rem, 2.5vw, 0.8rem);
  font-weight: 700;
  color: var(--secondary-color);
  line-height: 1.25;
  text-align: center;
}

.candle-card.blown {
  background: linear-gradient(180deg, #fff9fc 0%, #fce7f3 100%);
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.2);
  cursor: default;
  animation: candlePop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes candlePop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.candle-card.blown .candle-flame {
  opacity: 0;
  transform: scale(0.2) translateY(-10px);
}

.candle-card.blown .candle-label {
  color: #9d174d;
}

/* Responsive Photo & Video Memory Gallery Grid */
.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.35rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px -4px rgba(219, 39, 119, 0.2);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  background: var(--primary-light);
}

.gallery-item:hover,
.gallery-item:active {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 26px -4px rgba(236, 72, 153, 0.34);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.video-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(219, 39, 119, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.94);
  color: #fff;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  animation: pulse-halo 2.4s ease-in-out infinite;
}

.gallery-caption-pill {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(59, 16, 38, 0.66);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Mobile-Friendly Fullscreen Lightbox (Photo & Video) */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(38, 10, 26, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.gallery-lightbox.open {
  display: flex;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  background: rgba(236, 72, 153, 0.6);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2010;
}

.lightbox-content {
  max-width: min(92vw, 520px);
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: popScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 74dvh;
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  background: #1d0713;
}

.lightbox-caption {
  color: #fce7f3;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

/* Tactile Tap Heart-Sparkle Floating Particles on Mobile */
.tap-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 1500;
  font-size: 1.1rem;
  animation: tapFloatUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tapFloatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(var(--tx, -50%), var(--ty, -65px)) scale(1.25) rotate(var(--rot, 18deg)); }
}

/* Footer / Watermark - Responsive & Non-Overlapping */
.app-watermark {
  width: 100%;
  max-width: min(92vw, 440px);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: clamp(0.75rem, 2.7vw, 0.85rem);
  color: #9d174d;
  opacity: 0.88;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  text-align: center;
  z-index: 10;
  user-select: none;
}

.watermark-separator {
  opacity: 0.6;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .app-wrapper {
    padding: 0.65rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
    padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1.25rem));
  }

  .app-card {
    padding: 1.35rem 1rem;
    border-radius: 22px;
  }

  .avatar-container {
    width: min(145px, 42vw);
    height: min(145px, 42vw);
    margin-bottom: 0.85rem;
  }

  .embrace-container {
    width: min(160px, 44vw);
    height: min(182px, 50vw);
    margin-bottom: 0.75rem;
  }

  .cake-mini-container {
    width: min(125px, 35vw);
    height: min(125px, 35vw);
    margin-bottom: 0.7rem;
  }

  .bouquet-container {
    width: min(210px, 60vw);
    height: min(210px, 60vw);
    margin-bottom: 0.85rem;
  }

  h1.card-title, h2.card-title {
    font-size: clamp(1.32rem, 4.8vw, 1.7rem);
    margin-bottom: 0.5rem;
  }

  p.card-desc {
    font-size: clamp(0.88rem, 3vw, 0.98rem);
    margin-bottom: 1.15rem;
    line-height: 1.45;
  }

  .letter-box {
    padding: 0.9rem 1rem;
    margin-bottom: 1.15rem;
  }

  .letter-text {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .compliment-box {
    gap: 0.6rem;
    margin-bottom: 1.15rem;
  }

  .compliment-chip {
    padding: 0.75rem 1rem;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
    line-height: 1.35;
  }

  .candles-arena {
    gap: 0.45rem;
    margin-bottom: 1.1rem;
  }

  .candle-card {
    padding: 0.7rem 0.3rem;
    border-radius: 14px;
  }

  .btn-warm {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .btn-group {
    width: 100%;
    gap: 0.7rem;
  }

  .app-watermark {
    margin-top: 1rem;
    font-size: 0.76rem;
    gap: 3px 6px;
    line-height: 1.4;
  }
}

/* Extra-narrow phone screens (e.g. 320px-375px) */
@media (max-width: 380px) {
  .card-badge {
    font-size: 0.74rem;
    padding: 5px 12px;
    margin-bottom: 0.75rem;
  }

  .candle-body {
    font-size: 1.5rem;
  }

  .candle-flame {
    font-size: 1.2rem;
  }

  .candle-label {
    font-size: 0.68rem;
  }
}

/* Short viewport height optimization (e.g. iPhone SE or landscape phones) */
@media (max-height: 700px) {
  .app-wrapper {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
  }

  .app-card {
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
  }

  .avatar-container {
    width: min(120px, 32vw);
    height: min(120px, 32vw);
    margin-bottom: 0.65rem;
  }

  .embrace-container {
    width: min(135px, 36vw);
    height: min(155px, 42vw);
    margin-bottom: 0.65rem;
  }

  .bouquet-container {
    width: min(175px, 48vw);
    height: min(175px, 48vw);
    margin-bottom: 0.75rem;
  }
}
