/* ===================================================
   DESIGN SYSTEM — Happy Birthday Card App
   Luxury Romantic Aesthetics | Mobile-First Responsive
   =================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Color Palette - Deep velvet wine, cosmic violet, rose gold */
  --clr-bg-base: #0a0312;
  --clr-bg-gradient-1: #160728;
  --clr-bg-gradient-2: #240a36;
  --clr-bg-gradient-3: #0c0217;

  --clr-primary: #ff4d94;
  --clr-primary-light: #ff7ebb;
  --clr-primary-deep: #c2185b;
  --clr-secondary: #a855f7;
  --clr-secondary-light: #d8b4fe;

  --clr-gold: #f9d976;
  --clr-gold-light: #fef08a;
  --clr-gold-glow: rgba(249, 217, 118, 0.4);

  /* Glassmorphism & Borders */
  --clr-card-bg: rgba(25, 10, 40, 0.58);
  --clr-card-border: rgba(255, 255, 255, 0.16);
  --clr-card-border-highlight: rgba(255, 126, 187, 0.35);
  --clr-card-glow: rgba(255, 77, 148, 0.22);

  /* Typography */
  --clr-text-main: #fff5fa;
  --clr-text-muted: rgba(255, 240, 248, 0.72);
  --clr-text-dim: rgba(255, 240, 248, 0.45);

  --ff-title: "Cinzel", serif;
  --ff-script: "Dancing Script", cursive;
  --ff-heading: "Playfair Display", Georgia, serif;
  --ff-body: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Responsive Typography Scales */
  --fs-xs: clamp(0.72rem, 1.8vw, 0.8rem);
  --fs-sm: clamp(0.85rem, 2.2vw, 0.95rem);
  --fs-base: clamp(1rem, 2.6vw, 1.12rem);
  --fs-md: clamp(1.15rem, 3.2vw, 1.35rem);
  --fs-lg: clamp(1.4rem, 4.5vw, 1.75rem);
  --fs-xl: clamp(1.85rem, 6vw, 2.5rem);
  --fs-hero: clamp(2.3rem, 8vw, 3.4rem);

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card:
    0 16px 48px -8px rgba(0, 0, 0, 0.65), 0 0 45px var(--clr-card-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
  --shadow-btn:
    0 8px 24px rgba(255, 77, 148, 0.45), 0 0 16px rgba(168, 85, 247, 0.35);

  /* Easing curves */
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--clr-bg-base);
}

body {
  font-family: var(--ff-body);
  color: var(--clr-text-main);
  background: radial-gradient(
    circle at 50% 20%,
    #290d40 0%,
    #150626 50%,
    #07010e 100%
  );
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Ambient Glowing Orbs Background ---------- */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: pulse-glow 10s ease-in-out infinite alternate;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #ff2e93, transparent 70%);
  top: -60px;
  left: -60px;
}

.glow-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #9333ea, transparent 70%);
  bottom: -60px;
  right: -60px;
  animation-delay: -4s;
}

.glow-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #f59e0b, transparent 70%);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
  animation-delay: -7s;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.9) translate(0, 0);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.15) translate(20px, 15px);
    opacity: 0.55;
  }
  100% {
    transform: scale(0.95) translate(-15px, -20px);
    opacity: 0.35;
  }
}

/* ---------- Northern Lights (Aurora) Canvas Behind Cards ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ===================================================
   SPLASH SCREEN
   =================================================== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    #240a3b 0%,
    #110320 65%,
    #07010c 100%
  );
  cursor: pointer;
  padding: var(--space-md);
  user-select: none;
  transition:
    opacity 0.85s var(--ease-smooth),
    transform 0.85s var(--ease-smooth);
}

.splash.fade-out {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  max-width: 380px;
  width: 100%;
}

.splash-badge {
  font-family: var(--ff-title);
  font-size: var(--fs-xs);
  letter-spacing: 0.25em;
  color: var(--clr-gold);
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  padding: 6px 16px;
  background: rgba(249, 217, 118, 0.1);
  border: 1px solid rgba(249, 217, 118, 0.3);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
}

.splash-heart-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-xs) 0 var(--space-md);
}

.splash-heart {
  font-size: 5.5rem;
  line-height: 1;
  animation: pulse-heart 1.3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  filter: drop-shadow(0 0 25px rgba(255, 77, 148, 0.8));
  position: relative;
  z-index: 2;
}

.splash-glow-ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 77, 148, 0.5) 0%,
    transparent 70%
  );
  animation: breathe 2.5s ease-in-out infinite;
  z-index: 1;
}

.splash-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 126, 187, 0.5);
  animation: ripple-expand 2.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}

.splash-ripple.ring-1 {
  animation-delay: 0s;
}

.splash-ripple.ring-2 {
  animation-delay: 1.1s;
}

.splash-title {
  font-family: var(--ff-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-top: var(--space-xs);
  background: linear-gradient(
    135deg,
    #ffffff 15%,
    var(--clr-primary-light) 65%,
    var(--clr-gold) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-subtitle {
  font-family: var(--ff-script);
  font-size: var(--fs-md);
  color: var(--clr-text-muted);
  margin-top: var(--space-xs);
  letter-spacing: 0.05em;
}

.splash-tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-xl);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-gold-light);
  background: rgba(255, 255, 255, 0.07);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: bounce-gentle 1.8s ease-in-out infinite;
}

.finger-tap {
  font-size: 1.1rem;
}

/* ===================================================
   MAIN APPLICATION
   =================================================== */
.app {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px
    max(20px, env(safe-area-inset-bottom)) 16px;
  /* transition: opacity 0.1s var(--ease-smooth); */
}

.app.hidden {
  opacity: 0;
  pointer-events: none;
}

.app.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  flex-shrink: 0;
  padding-top: 4px;
}

.sparkle-tag {
  font-family: var(--ff-title);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  color: var(--clr-gold);
  text-shadow: 0 0 10px var(--clr-gold-glow);
}

.progress-pill {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--clr-text-dim);
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Card Stage & Carousel Track ---------- */
.card-stage {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0; /* Prevents overflow inside flex container */
  margin: 10px 0;
  perspective: 1200px;
}

.card-track {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 520px;
}

/* ---------- Modern Glass Card ---------- */
.card {
  position: absolute;
  inset: 0;
  background: var(--clr-card-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1.5px solid var(--clr-card-border);
  border-top-color: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;

  /* Card Transition Physics */
  transition:
    transform 0.65s var(--ease-spring),
    opacity 0.55s ease,
    filter 0.55s ease;
  will-change: transform, opacity;
  transform: translateX(115%) rotateY(-18deg) scale(0.85);
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
}

/* Active card in view */
.card.active {
  transform: translateX(0) rotateY(0deg) scale(1);
  opacity: 1;
  filter: blur(0px);
  pointer-events: auto;
  z-index: 5;
}

/* Card exited to the left */
.card.prev {
  transform: translateX(-115%) rotateY(18deg) scale(0.85);
  opacity: 0;
  filter: blur(4px);
  z-index: 1;
}

/* Subtle corner light gleam */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.09) 0%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
}

/* Decorative Card Inner Elements */
.card-header-elem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-emoji-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-emoji-bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 77, 148, 0.25) 0%,
    transparent 70%
  );
  filter: blur(5px);
  animation: breathe 3s ease-in-out infinite;
}

.card-emoji {
  font-size: clamp(2.6rem, 10vw, 3.4rem);
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 12px rgba(255, 77, 148, 0.5));
  animation: float-gentle 4s ease-in-out infinite;
}

.card-title-decor {
  font-family: var(--ff-title);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--clr-gold);
  text-transform: uppercase;
}

.card-ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 80%;
  max-width: 140px;
  opacity: 0.7;
}

.card-ornament::before,
.card-ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-gold), transparent);
}

.ornament-diamond {
  font-size: 0.55rem;
  color: var(--clr-gold);
}

/* Message Content Area */
.card-body-elem {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  width: 100%;
}

.card-message {
  font-family: var(--ff-heading);
  font-size: var(--fs-md);
  font-weight: 400;
  font-style: italic;
  line-height: 1.8;
  color: var(--clr-text-main);
  max-width: 32ch;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.card-message em {
  font-family: var(--ff-script);
  font-style: normal;
  font-size: 1.35em;
  color: var(--clr-primary-light);
  font-weight: 700;
  text-shadow: 0 0 16px rgba(255, 77, 148, 0.6);
  display: inline-block;
  padding: 0 2px;
}

/* Card bottom flourish */
.card-footer-elem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--clr-text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ===================================================
   CALENDAR CARD (Card 2 - October with 12th Heart)
   =================================================== */
.card.calendar-card {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  justify-content: space-between;
}

.calendar-card-body {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 0;
  margin: 4px 0;
}

.calendar-wrapper {
  width: 100%;
  max-width: 295px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 10px 12px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
              inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cal-month-title {
  font-family: var(--ff-title);
  font-size: 0.88rem;
  letter-spacing: 0.28em;
  font-weight: 700;
  color: var(--clr-gold);
  text-shadow: 0 0 12px var(--clr-gold-glow);
}

.cal-sparkle {
  font-size: 0.78rem;
  color: var(--clr-gold);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 2px;
  text-align: center;
  align-items: center;
}

.cal-col-header {
  font-family: var(--ff-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--clr-primary-light);
  padding-bottom: 4px;
  text-transform: uppercase;
  opacity: 0.85;
}

.cal-day {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.cal-day.cal-empty {
  visibility: hidden;
  pointer-events: none;
}

.cal-day-num {
  font-family: var(--ff-body);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--clr-text-muted);
}

/* Day 12 - Special Birthday Heart Highlight */
.cal-day.cal-highlight {
  background: radial-gradient(circle, rgba(255, 77, 148, 0.35) 0%, rgba(168, 85, 247, 0.2) 75%);
  border: 1px solid rgba(255, 126, 187, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 77, 148, 0.7),
              inset 0 0 8px rgba(255, 77, 148, 0.4);
  transform: scale(1.12);
  z-index: 2;
}

.cal-heart {
  font-size: 0.98rem;
  line-height: 1;
  display: inline-block;
  animation: heart-beat-cal 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  filter: drop-shadow(0 0 6px rgba(255, 77, 148, 0.95));
  position: relative;
  z-index: 2;
}

.cal-heart-glow {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 148, 0.6) 0%, transparent 70%);
  animation: breathe 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes heart-beat-cal {
  0% { transform: scale(1); }
  14% { transform: scale(1.28); }
  28% { transform: scale(1); }
  42% { transform: scale(1.18); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

.calendar-caption {
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-style: italic;
  line-height: 1.5;
  color: var(--clr-text-main);
  text-align: center;
  max-width: 28ch;
  margin-top: 2px;
}

.calendar-caption em {
  font-family: var(--ff-script);
  font-style: normal;
  font-size: 1.28em;
  color: var(--clr-primary-light);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255, 77, 148, 0.6);
}

/* ===================================================
   PHOTO CARD (Final Card)
   =================================================== */
.card.photo-card {
  padding: var(--space-md);
}

.card.photo-card .card-message {
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: 8px;
  max-width: none;
}

.photo-grid-container {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.photo-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-smooth);
}

.photo-item:hover img {
  transform: scale(1.08);
}

/* Fallback placeholder when no photo uploaded yet */
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  color: var(--clr-text-muted);
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 77, 148, 0.12),
    rgba(168, 85, 247, 0.15)
  );
}

.photo-placeholder-icon {
  font-size: 1.7rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.photo-placeholder-text {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--clr-gold-light);
  font-weight: 500;
}

.final-wish-banner {
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 77, 148, 0.25),
    rgba(168, 85, 247, 0.25)
  );
  border: 1px solid rgba(255, 126, 187, 0.4);
  border-radius: var(--radius-pill);
  font-family: var(--ff-title);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--clr-gold);
  text-transform: uppercase;
}

/* Single Featured Photo Card (2nd to last) */
.single-photo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 2px 0;
}

.single-photo-frame {
  width: 100%;
  max-width: 320px;
  flex: 1;
  min-height: 220px;
  max-height: 310px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 5, 25, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5),
              0 0 25px rgba(255, 77, 148, 0.25),
              inset 0 0 15px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.single-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-md) - 4px);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
  transition: transform 0.5s var(--ease-smooth);
}

.single-photo-frame:hover img {
  transform: scale(1.03);
}

.single-photo-caption {
  font-family: var(--ff-heading);
  font-size: var(--fs-sm);
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--clr-gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  padding: 2px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}

/* ===================================================
   FOOTER & CONTROLS
   =================================================== */
.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.swipe-hint {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-text-dim);
  animation: pulse-opacity 2.4s ease-in-out infinite;
}

/* Pagination Dots */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  cursor: pointer;
  transition: all 0.35s var(--ease-spring);
  padding: 0;
}

.dot.active {
  width: 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--clr-primary-light), var(--clr-gold));
  box-shadow: 0 0 12px var(--clr-primary);
}

/* Action Buttons */
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.nav-btn {
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s var(--ease-spring);
  user-select: none;
}

.next-btn {
  background: linear-gradient(
    135deg,
    var(--clr-primary) 0%,
    #db2777 50%,
    var(--clr-secondary) 100%
  );
  color: #ffffff;
  box-shadow: var(--shadow-btn);
  flex: 1;
  max-width: 200px;
  position: relative;
  overflow: hidden;
}

.next-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.next-btn:hover::before,
.next-btn:active::before {
  opacity: 1;
}

.next-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(255, 77, 148, 0.6);
}

.next-btn:active {
  transform: translateY(1px) scale(0.98);
}

.next-arrow {
  transition: transform 0.25s var(--ease-spring);
}

.next-btn:hover .next-arrow {
  transform: translateX(4px);
}

.prev-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--clr-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 12px 18px;
}

.prev-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.hidden-btn {
  display: none !important;
}

/* ===================================================
   FLOATING MUTE BUTTON
   =================================================== */
.mute-btn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 120;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 8, 32, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.3s var(--ease-spring);
}

.mute-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 77, 148, 0.25);
  border-color: rgba(255, 126, 187, 0.5);
}

.mute-btn:active {
  transform: scale(0.95);
}

.mute-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===================================================
   KEYFRAME ANIMATIONS
   =================================================== */
@keyframes pulse-heart {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.18);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.12);
  }
  70% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes ripple-expand {
  0% {
    width: 60px;
    height: 60px;
    opacity: 0.8;
  }
  100% {
    width: 240px;
    height: 240px;
    opacity: 0;
  }
}

@keyframes float-gentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

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

@keyframes pulse-opacity {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.85;
  }
}

/* ===================================================
   DESKTOP & TABLET ADAPTATION
   =================================================== */
@media (min-width: 600px) {
  .card-stage {
    max-height: 580px;
  }

  .card-track {
    max-height: 560px;
    max-width: 420px;
  }

  .card {
    padding: var(--space-xl);
  }

  .card-message {
    font-size: var(--fs-md);
  }
}

@media (min-width: 1024px) {
  .app {
    max-width: 520px;
  }

  .card-track {
    max-width: 440px;
  }
}

/* ===================================================
   LAVENDER TRANSPARENT FLYING BUTTERFLIES
   =================================================== */
.butterflies-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30; /* Floats above cards */
  overflow: visible;
}

.butterfly {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  transform-style: preserve-3d;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.6))
    drop-shadow(0 0 20px rgba(233, 213, 255, 0.4));
  pointer-events: none;
  will-change: transform, opacity;
}

.butterfly-1 {
  width: 58px;
  height: 42px;
}

.butterfly-2 {
  width: 50px;
  height: 36px;
}

/* Translucent slim body & antennas */
.butterfly-body {
  position: relative;
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, #e9d5ff 0%, #c084fc 60%, #7e22ce 100%);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.9);
  z-index: 3;
}

.butterfly-body .antenna {
  position: absolute;
  top: -5px;
  width: 7px;
  height: 8px;
  border-top: 1.5px solid #f3e8ff;
  border-radius: 50% 50% 0 0;
}

.antenna-left {
  left: -5px;
  border-left: 1.5px solid #f3e8ff;
  transform: rotate(-25deg);
}

.antenna-right {
  right: -5px;
  border-right: 1.5px solid #f3e8ff;
  transform: rotate(25deg);
}

/* Lavender transparent wings */
.butterfly-wing {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.wing-left {
  transform-origin: right center;
  animation: flap-left 0.18s ease-in-out infinite alternate;
}

.wing-right {
  transform-origin: left center;
  animation: flap-right 0.18s ease-in-out infinite alternate;
}

.wing-svg {
  width: 27px;
  height: 37px;
  display: block;
}

/* Ethereal translucent lavender colors */
.wing-fill-fore {
  fill: rgba(216, 180, 254, 0.52);
  stroke: rgba(243, 232, 255, 0.85);
  stroke-width: 0.85;
}

.wing-fill-hind {
  fill: rgba(192, 132, 252, 0.42);
  stroke: rgba(233, 213, 255, 0.75);
  stroke-width: 0.85;
}

.wing-vein {
  fill: none;
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 0.75;
  stroke-linecap: round;
}

/* Gentle wing breathing when resting */
.butterfly.resting .wing-left {
  animation: rest-flap-left 3.2s ease-in-out infinite alternate !important;
}

.butterfly.resting .wing-right {
  animation: rest-flap-right 3.2s ease-in-out infinite alternate !important;
}

/* Wing flap animations */
@keyframes flap-left {
  0% {
    transform: rotateY(0deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(68deg) rotateZ(-10deg);
  }
}

@keyframes flap-right {
  0% {
    transform: rotateY(0deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(-68deg) rotateZ(10deg);
  }
}

@keyframes rest-flap-left {
  0%,
  70% {
    transform: rotateY(18deg) rotateZ(-2deg);
  }
  85% {
    transform: rotateY(52deg) rotateZ(-8deg);
  }
  100% {
    transform: rotateY(22deg) rotateZ(-3deg);
  }
}

@keyframes rest-flap-right {
  0%,
  70% {
    transform: rotateY(-18deg) rotateZ(2deg);
  }
  85% {
    transform: rotateY(-52deg) rotateZ(8deg);
  }
  100% {
    transform: rotateY(-22deg) rotateZ(3deg);
  }
}

/* ===================================================
   PARTY POPPER & CELEBRATION EFFECTS (Card 1)
   =================================================== */
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 35; /* Above cards and butterflies */
  border-radius: var(--radius-lg);
}

/* Party popper corner badge on Card 1 */
.card-popper-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-title);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--clr-gold);
  background: rgba(249, 217, 118, 0.12);
  border: 1px solid rgba(249, 217, 118, 0.35);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  box-shadow: 0 0 14px var(--clr-gold-glow);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  user-select: none;
}

.card-popper-badge:hover {
  transform: scale(1.08);
  background: rgba(249, 217, 118, 0.22);
}

.popper-icon {
  font-size: 1.15rem;
  display: inline-block;
  animation: popper-shake 1.8s ease-in-out infinite;
}

@keyframes popper-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-18deg) scale(1.2); }
  30% { transform: rotate(18deg) scale(1.2); }
  45% { transform: rotate(-12deg) scale(1.1); }
  60% { transform: rotate(8deg) scale(1.05); }
  75% { transform: rotate(0deg) scale(1); }
}

/* Corner Party Poppers (Bottom-Left and Bottom-Right) */
.corner-poppers-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 36;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card.active .corner-poppers-wrap {
  opacity: 1;
}

.corner-popper {
  position: absolute;
  bottom: 12px;
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(249, 217, 118, 0.7));
  transform-origin: bottom center;
}

.popper-bl {
  left: 14px;
  transform: rotate(38deg);
}

.popper-br {
  right: 14px;
  transform: rotate(-38deg) scaleX(-1);
}

.popper-bl.firing {
  animation: blast-left 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popper-br.firing {
  animation: blast-right 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes blast-left {
  0% { transform: rotate(38deg) scale(1); }
  35% { transform: rotate(22deg) scale(1.4) translate(-4px, 4px); filter: brightness(1.5) drop-shadow(0 0 20px #f9d976); }
  100% { transform: rotate(38deg) scale(1); }
}

@keyframes blast-right {
  0% { transform: rotate(-38deg) scaleX(-1) scale(1); }
  35% { transform: rotate(-22deg) scaleX(-1) scale(1.4) translate(-4px, 4px); filter: brightness(1.5) drop-shadow(0 0 20px #f9d976); }
  100% { transform: rotate(-38deg) scaleX(-1) scale(1); }
}
