/* ==========================================
   Design System & Reset
   ========================================== */
:root {
  --bg-dark: #0f0c1b;
  --bg-light: #201a30;
  --primary-glow: rgba(255, 107, 107, 0.4);
  --secondary-glow: rgba(255, 230, 109, 0.3);
  --text-main: #f8f9fa;
  --text-muted: #cdcbde;
  --accent-rose: #ff758c;
  --accent-gold: #ffd0a6;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-sans: "Inter", sans-serif;
  --font-display: "Outfit", sans-serif;
  --font-handwritten: "Playfair Display", serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: grid;
  place-items: center;
}

body.passcode-active {
  overflow: hidden;
}

/* ==========================================
   Spinning Dashed Ring & Glow Animations
   ========================================== */
@keyframes spinDashedRing {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinDashedRingReverse {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 25px rgba(255, 117, 140, 0.6), 0 0 50px rgba(255, 117, 140, 0.3);
  }
  50% {
    box-shadow: 0 0 45px rgba(255, 117, 140, 0.95), 0 0 75px rgba(255, 208, 166, 0.65);
  }
}

/* ==========================================
   Background & Confetti Particles
   ========================================== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 117, 140, 0.08) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 208, 166, 0.08) 0%,
      transparent 40%
    );
  z-index: 0;
}

/* ==========================================
   Screen Management & Transitions
   ========================================== */
.screen {
  grid-column: 1;
  grid-row: 1;
  display: none;
  opacity: 0;
  width: 100%;
  max-width: 1200px;
  padding: 20px;
  z-index: 10;
  justify-content: center;
  align-items: center;
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
  display: flex;
  opacity: 1;
  animation: screenEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Glassmorphism Card style */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
}

/* ==========================================
   1. Passcode Screen Styles
   ========================================== */
.passcode-card {
  animation: float 6s ease-in-out infinite;
}

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

.avatar-container {
  width: 130px;
  height: 130px;
  margin: 0 auto 25px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  box-shadow:
    0 0 30px rgba(255, 117, 140, 0.6),
    0 0 50px rgba(255, 117, 140, 0.3);
  border: 3px solid transparent;
  background-image: linear-gradient(
    135deg,
    var(--accent-rose),
    var(--accent-gold)
  );
  background-origin: border-box;
  background-clip: content-box, border-box;
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s;
  animation: pulseGlow 3s ease-in-out infinite;
}

.avatar-container::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 3.5px dashed #ffea75;
  border-top-color: #ffe066;
  border-right-color: #ffd700;
  border-bottom-color: #ffea75;
  border-left-color: #fff176;
  animation: spinDashedRing 16s linear infinite;
  pointer-events: none;
  box-shadow: 0 0 22px rgba(255, 234, 117, 0.85), inset 0 0 10px rgba(255, 234, 117, 0.4);
}

.avatar-container:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 45px rgba(255, 117, 140, 0.8);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Magic Flying Fairy styling */
.magic-fairy {
  position: fixed;
  width: 55px;
  height: 55px;
  top: 15%;
  left: 15%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.fairy-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  overflow: visible;
}

/* Wings Fluttering */
.left-wing {
  transform-origin: 40px 48px;
  animation: svgFlutterLeft 0.12s linear infinite alternate;
}

.right-wing {
  transform-origin: 60px 48px;
  animation: svgFlutterRight 0.12s linear infinite alternate;
}

@keyframes svgFlutterLeft {
  0% {
    transform: scaleX(0.3) rotate(8deg);
  }
  100% {
    transform: scaleX(1) rotate(-8deg);
  }
}

@keyframes svgFlutterRight {
  0% {
    transform: scaleX(0.3) rotate(-8deg);
  }
  100% {
    transform: scaleX(1) rotate(8deg);
  }
}

/* Star Body gentle pulse scale */
.fairy-star-body {
  transform-origin: 50px 50px;
  animation: bodyPulse 1s ease-in-out infinite alternate;
}

@keyframes bodyPulse {
  0% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1.04);
  }
}

/* Dialog bubble */
.fairy-dialog {
  position: absolute;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(15, 12, 27, 0.95);
  border: 1px solid var(--accent-gold);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(255, 208, 166, 0.2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    visibility 0s 0.3s;
  z-index: 1100;
}

.fairy-dialog::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(15, 12, 27, 0.95) transparent transparent transparent;
}

/* State: Caught */
.magic-fairy.caught {
  animation: catchSpin 0.5s ease-out forwards;
}

.magic-fairy.caught .fairy-dialog {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
  transition:
    all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    visibility 0s 0s;
}

@keyframes catchSpin {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.15) rotate(360deg);
  }
}

.passcode-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #ecd6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.passcode-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 30px;
}

/* PIN Dot Display */
.pin-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.pin-display {
  display: flex;
  gap: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 24px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-rose);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 0 rgba(255, 117, 140, 0);
}

.pin-dot.active {
  background: var(--accent-rose);
  box-shadow:
    0 0 10px var(--accent-rose),
    0 0 20px var(--accent-rose);
  transform: scale(1.15);
}

.pin-dot.error {
  border-color: #ff5e7e;
  background: #ff5e7e;
  box-shadow: 0 0 10px #ff5e7e;
  animation: dotError 0.15s ease 3 alternate;
}

@keyframes dotError {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(3px);
  }
}

/* Success Card Glow and Success Dots */
.passcode-card.success {
  border-color: #10b981; /* beautiful green glow border */
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.45);
  transform: scale(1.04);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot.success {
  border-color: #10b981 !important;
  background: #10b981 !important;
  box-shadow:
    0 0 15px #10b981,
    0 0 30px #10b981 !important;
  transform: scale(1.25);
}

/* Numpad Styling */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  grid-gap: 15px;
  justify-content: center;
  margin: 0 auto;
  max-width: 250px;
}

.num-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  user-select: none;
}

.num-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-rose);
  box-shadow: 0 0 15px rgba(255, 117, 140, 0.2);
  transform: scale(1.08);
}

.num-btn:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, var(--accent-rose), #ff7eb3);
  box-shadow: 0 0 15px rgba(255, 117, 140, 0.4);
  border-color: transparent;
}

.num-btn.action-btn {
  font-size: 1.2rem;
  font-weight: 600;
}

.num-btn.clear-btn {
  color: #ff758c;
  background: rgba(255, 117, 140, 0.05);
}

.num-btn.clear-btn:hover {
  background: rgba(255, 117, 140, 0.15);
}

.num-btn.delete-btn {
  color: #ffd0a6;
  background: rgba(255, 208, 166, 0.05);
}

.num-btn.delete-btn:hover {
  background: rgba(255, 208, 166, 0.15);
}

.glow-btn {
  background: linear-gradient(135deg, var(--accent-rose) 0%, #ff7eb3 100%);
  border: none;
  border-radius: 12px;
  color: white;
  padding: 15px 25px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(255, 117, 140, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glow-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: 0.5s;
}

.glow-btn:hover::before {
  left: 100%;
}

.glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255, 117, 140, 0.5);
}

.glow-btn:active {
  transform: translateY(0);
}

/* Unwrap Your Gift Button on Transition Screen */
.unwrap-btn {
  background: linear-gradient(135deg, var(--accent-rose) 0%, #ff7eb3 50%, var(--accent-gold) 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 10px 30px rgba(255, 117, 140, 0.45), 0 0 20px rgba(255, 208, 166, 0.35) !important;
  color: #ffffff !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  cursor: pointer;
  z-index: 20;
}

.unwrap-btn:hover {
  transform: translateY(-3px) scale(1.06) !important;
  box-shadow: 0 14px 35px rgba(255, 117, 140, 0.65), 0 0 30px rgba(255, 208, 166, 0.55) !important;
}

.error-msg {
  color: #ff5e7e;
  font-size: 0.85rem;
  margin-top: 15px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
  font-weight: 500;
}

.error-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* Shake Animation on Error */
.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0) translateY(0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0) translateY(0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0) translateY(0);
  }
  40%,
  60% {
    transform: translate3d(4px, 0, 0) translateY(0);
  }
}

/* ==========================================
   2. Loading Screen Styles
   ========================================== */
.loading-card {
  max-width: 400px;
}

.heart-loader {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}

.floating-headphones {
  font-size: 4.2rem; /* A little smaller */
  background: linear-gradient(135deg, var(--accent-rose) 0%, #ff7eb3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(255, 117, 140, 0.7)); /* Glowing effect! */
  animation: headphonePulse 1.8s infinite ease-in-out;
}

@keyframes headphonePulse {
  0%,
  100% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 12px rgba(255, 117, 140, 0.6));
  }
  50% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 22px rgba(255, 117, 140, 0.95));
  }
}

.floating-gift {
  font-size: 3rem;
  color: var(--accent-gold);
  animation: giftWobble 1.2s infinite ease-in-out;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

@keyframes giftWobble {
  0%,
  100% {
    transform: scale(0.9) rotate(-4deg);
  }
  50% {
    transform: scale(1.08) rotate(4deg);
  }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.deadline-track {
  position: relative;
  width: 100%;
  height: 20px;
  background: #ffffff; /* pure white track */
  border: none;
  border-radius: 10px;
  margin: 60px 0 35px;
  overflow: visible; /* Let chasers float above the track */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
}

.deadline-track .progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px; /* Always rounded on both ends to avoid weird square corner at 100% */
  background: #ff0844; /* solid red fill matching Reaper */
  box-shadow: 0 0 15px rgba(255, 8, 68, 0.5);
  transition: width 0.03s linear;
}

/* Reaper Chaser */
.reaper-chaser {
  position: absolute;
  bottom: 10px; /* Sits directly on top of the 20px track */
  left: 0%;
  transform: translateX(-90%); /* Lead edge of red fill */
  width: 60px;
  height: 50px;
  pointer-events: none;
  transition: left 0.03s linear;
  z-index: 5;
}

.reaper-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Programmer Target */
.programmer-target {
  position: absolute;
  bottom: 10px; /* Sits directly on top of the 20px track */
  right: 0px;
  width: 60px;
  height: 50px;
  pointer-events: none;
  z-index: 4;
}

.programmer-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Scythe swinging animation */
.scythe-hand {
  animation: swingScythe 0.6s infinite alternate ease-in-out;
  transform-origin: 46px 45px;
}

@keyframes swingScythe {
  0% {
    transform: rotate(-12deg);
  }
  100% {
    transform: rotate(18deg);
  }
}

/* Animate programmer typing hands (tuned to pivot on new shoulder coordinate 52px, 28px) */
.typing-hands {
  animation: typingHands 0.1s infinite alternate ease-in-out;
  transform-origin: 52px 28px;
}

@keyframes typingHands {
  0% {
    transform: rotate(-10deg) translateY(0);
  }
  100% {
    transform: rotate(10deg) translateY(-2px) translateX(1px);
  }
}

/* Panic shake when caught */
.programmer-target.panic {
  animation: panicShake 0.12s infinite;
}

@keyframes panicShake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-2deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(2deg);
  }
  30% {
    transform: translate(0px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(2deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-2deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(2px, 1px) rotate(-2deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(2deg);
  }
  90% {
    transform: translate(2px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-2deg);
  }
}

.progress-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.loading-status {
  font-weight: 500;
  color: var(--accent-rose);
}

.loading-percentage {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 1rem;
}

/* Decorative Greeting Card Transition Screen Styles */
#screen-transition {
  background: #fbf5e8 !important; /* soft warm cream birthday background */
  z-index: 95;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none !important;
  padding: 0 !important;
  margin: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.decorations-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Stagger items base animations */
.decor-item {
  opacity: 0;
  transition:
    opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Bunting flags */
.decor-bunting {
  position: absolute;
  top: -1%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-40px);
}
.decor-bunting.visible {
  opacity: 1;
  transform: translateY(0);
}
.bunting-img {
  width: 100%;
  height: auto;
}

/* Centered Text Group */
.decor-text-group {
  text-align: center;
  padding: 20px;
  max-width: 600px;
  z-index: 5;
  margin-top: -70px;
  position: relative;
}

.decor-title {
  font-family: "Outfit", sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: #5b4d82; /* purple/indigo */
  margin: 0 0 20px 0;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(91, 77, 130, 0.15) !important;
  transform: scale(0.9);
}
.decor-title.visible {
  opacity: 1;
  transform: scale(1);
}

/* Transition Screen Profile Box */
.decor-profile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0 28px 0;
  transform: scale(0.85);
}
.decor-profile-box.visible {
  opacity: 1;
  transform: scale(1);
}
.decor-avatar-wrapper {
  position: relative;
  width: 115px;
  height: 115px;
  margin-bottom: 24px;
  border-radius: 50%;
  animation: pulseGlow 3s ease-in-out infinite;
}
.decor-avatar-wrapper::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 3.5px dashed #ffea75;
  border-top-color: #ffe066;
  border-right-color: #ffd700;
  border-bottom-color: #ffea75;
  border-left-color: #fff176;
  animation: spinDashedRing 16s linear infinite;
  pointer-events: none;
  box-shadow: 0 0 22px rgba(255, 234, 117, 0.85), inset 0 0 10px rgba(255, 234, 117, 0.4);
}
.decor-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow:
    0 10px 25px rgba(91, 77, 130, 0.3),
    0 0 20px rgba(255, 117, 140, 0.5);
  transition: transform 0.4s ease;
}
.decor-avatar-img:hover {
  transform: scale(1.08) rotate(3deg);
}
.decor-person-name {
  font-family: "Outfit", sans-serif;
  text-align: center;
  margin-bottom: 12px;
}
.decor-person-name .name-line1 {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ff758c;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.decor-person-name .name-line2 {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: #5b4d82;
  letter-spacing: 0.3px;
}
.decor-person-dob {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ff758c;
  background: rgba(255, 255, 255, 0.88);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 117, 140, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.decor-message {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  color: #a48168; /* warm peach brown */
  line-height: 1.6;
  font-weight: 500;
  margin: 0;
  transform: translateY(20px);
}
.decor-message.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Corner Decorations (Bottom-Left and Bottom-Right) */
.decor-corner-left,
.decor-cake-left {
  position: absolute;
  width: 25%;
  bottom: -7%;
  left: -3%;
  z-index: 10;
  pointer-events: none;
  transform: translate(-30px, 30px);
}

.corner-img-left {
  width: 100%; /* Adjust this */
  height: auto;
  display: block;
}

.corner-img-right {
  width: 100%; /* Adjust this */
  height: auto;
  display: block;
}

.decor-corner-right,
.decor-cake-right {
  width: 25%;
  position: absolute;
  bottom: -7%;
  right: -3%;
  z-index: 10;
  pointer-events: none;
  transform: translate(30px, 30px);
}
.decor-corner-left.visible,
.decor-cake-left.visible {
  opacity: 1;
  transform: translate(0, 0);
}
.decor-corner-right.visible,
.decor-cake-right.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Shrunk state for left and right corner decorations (scaled down by 80%) */
.decor-corner-left.shrunk,
.decor-cake-left.shrunk {
  transform: scale(0.8) translate(-10px, 10px) !important;
  transform-origin: bottom left !important;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.decor-corner-right.shrunk,
.decor-cake-right.shrunk {
  transform: scale(0.8) translate(10px, 10px) !important;
  transform-origin: bottom right !important;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Popper Cones Left & Right */
.decor-popper {
  position: absolute;
  z-index: 8;
}
.decor-popper-left {
  top: 36%;
  left: 35px;
  transform: translate(-40px, -20px) rotate(15deg);
}
.decor-popper-right {
  top: 40%;
  right: 30px;
  transform: translate(40px, -20px) rotate(-15deg);
}
.decor-popper.visible {
  opacity: 1;
  transform: translate(0, 0) rotate(0);
}

/* Portrait Memory Frame Carousels (Left & Right) */
.decor-frame {
  position: absolute;
  top: 22%;
  width: 270px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 14px 16px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 45px rgba(91, 77, 130, 0.2), 0 0 25px rgba(255, 117, 140, 0.25);
  z-index: 12;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.decor-frame-left {
  left: 14%;
  transform: translateY(30px) rotate(-4deg);
}

.decor-frame-right {
  right: 14%;
  transform: translateY(30px) rotate(4deg);
}

.decor-frame-left.visible {
  opacity: 1;
  transform: translateY(0) rotate(-4deg);
}

.decor-frame-right.visible {
  opacity: 1;
  transform: translateY(0) rotate(4deg);
}

.decor-frame:hover {
  transform: scale(1.05) rotate(0deg) !important;
  box-shadow: 0 25px 55px rgba(91, 77, 130, 0.3), 0 0 35px rgba(255, 117, 140, 0.45);
  z-index: 25;
}

/* Portrait Aspect Ratio Viewport */
.frame-slides-viewport {
  position: relative;
  width: 100%;
  height: 310px;
  overflow: hidden;
  border-radius: 14px;
  background: #0f0c1b;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.frame-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.frame-slide.active {
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto;
  z-index: 5;
}

.frame-slide.exit-to-left {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 2;
}

.frame-slide.exit-to-right {
  opacity: 0;
  transform: translateX(100%);
  z-index: 2;
}

.frame-img {
  width: 100%;
  height: 255px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.frame-caption {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #5b4d82;
  text-align: center;
  padding: 8px 6px;
  background: #ffffff;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
}

/* Navigation Controls Under Carousel (Theme Matched) */
.frame-controls-under {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  width: 100%;
  pointer-events: auto;
}

.frame-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-rose) 0%, #ff7eb3 100%);
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 117, 140, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.frame-btn:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 117, 140, 0.65);
  background: linear-gradient(135deg, #ff4e50 0%, var(--accent-rose) 100%);
}

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

.frame-dots-indicator {
  font-size: 0.85rem;
  color: var(--accent-rose);
  filter: drop-shadow(0 2px 4px rgba(255, 117, 140, 0.4));
  animation: heartPulse 1.8s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Bottom Center Gifts */
.decor-gifts {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 30px);
  z-index: 9;
}
.decor-gifts.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Floating Stars */
.decor-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  transform: scale(0.9);
}
.decor-stars.visible {
  opacity: 1;
  transform: scale(1);
}

/* Gift Selection Screen Styles */
#screen-gifts {
  background: #000000 !important; /* pure flat black background */
  z-index: 100;
  overflow: hidden;
  position: fixed; /* full screen fixed viewport */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none !important; /* override screen default */
  padding: 0 !important; /* override screen default */
  margin: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.gift-card {
  background: transparent !important; /* transparent to merge with screen background */
  border: none !important; /* remove border card styling */
  box-shadow: none !important; /* remove drop shadow */
  backdrop-filter: none !important; /* remove glassmorphism blur */
  -webkit-backdrop-filter: none !important;
  max-width: 650px;
  width: 90%;
  padding: 0; /* remove card padding */
  text-align: center;
}

.gift-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gift-subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.gift-boxes-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 35px;
}

.gift-box-wrapper {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.gift-box-wrapper:hover {
  transform: translateY(-8px);
}

.gift-box-body {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 12px;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Three distinct pastel box wrapper styles */
.gift-box-wrapper[data-box="1"] .gift-box-body {
  background: linear-gradient(135deg, #ff758c 0%, #ff4e50 100%);
  box-shadow: 0 10px 20px rgba(255, 117, 140, 0.35);
}
.gift-box-wrapper[data-box="2"] .gift-box-body {
  background: linear-gradient(135deg, #ffd0a6 0%, #ffb347 100%);
  box-shadow: 0 10px 20px rgba(255, 208, 166, 0.35);
}
.gift-box-wrapper[data-box="3"] .gift-box-body {
  background: linear-gradient(135deg, #b862ff 0%, #8b5cf6 100%);
  box-shadow: 0 10px 20px rgba(184, 98, 255, 0.35);
}

.gift-box-lid {
  position: absolute;
  top: -12px;
  left: -5px;
  width: 100px;
  height: 20px;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-box-wrapper[data-box="1"] .gift-box-lid {
  background: #ff9ebb;
}
.gift-box-wrapper[data-box="2"] .gift-box-lid {
  background: #ffe2c4;
}
.gift-box-wrapper[data-box="3"] .gift-box-lid {
  background: #d7a2ff;
}

.gift-box-ribbon {
  position: absolute;
  top: 0;
  left: 41px;
  width: 8px;
  height: 90px;
  background: #ffd0a6;
}
.gift-box-wrapper[data-box="2"] .gift-box-ribbon {
  background: #ff758c;
}
.gift-box-wrapper[data-box="3"] .gift-box-ribbon {
  background: #ffd0a6;
}

.gift-box-ribbon::before {
  content: "";
  position: absolute;
  top: 41px;
  left: -41px;
  width: 90px;
  height: 8px;
  background: inherit;
}

.gift-box-label {
  margin-top: 15px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Lid opening animations */
.gift-box-wrapper.opened .gift-box-lid {
  transform: translateY(-90px) rotate(-40deg) scale(0.8);
  opacity: 0;
}

.gift-box-wrapper.opened .gift-box-body {
  transform: scale(0.92);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Messages styling */
.gift-message {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(255, 208, 166, 0.4);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

#gift-message-2 {
  color: var(--accent-rose);
  font-size: 1.15rem;
  font-weight: 500;
}

/* ==========================================
   3. Main Birthday Screen Styles
   ========================================== */
#screen-main {
  max-width: 900px;
  flex-direction: column;
}

.main-content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.main-header {
  text-align: center;
  max-width: 600px;
}

/* Birthday Person Profile Section on Main Screen */
.birthday-avatar-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 32px;
  position: relative;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(
    135deg,
    var(--accent-rose),
    var(--accent-gold),
    #b862ff
  );
  box-shadow:
    0 0 35px rgba(255, 117, 140, 0.6),
    0 0 60px rgba(255, 117, 140, 0.35);
  animation:
    avatarFloat 4s ease-in-out infinite,
    pulseGlow 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.birthday-avatar-container::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  border: 3.5px dashed #ffea75;
  border-top-color: #ffe066;
  border-right-color: #ffd700;
  border-bottom-color: #ffea75;
  border-left-color: #fff176;
  animation: spinDashedRing 16s linear infinite;
  pointer-events: none;
  box-shadow:
    0 0 24px rgba(255, 234, 117, 0.9),
    inset 0 0 14px rgba(255, 234, 117, 0.45);
}

.birthday-avatar-container:hover {
  transform: scale(1.06) rotate(2deg);
}

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

.birthday-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.95);
}

.birthday-avatar-sparkle {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 1.3rem;
  background: rgba(15, 12, 27, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.birthday-person-name {
  font-family: var(--font-display);
  text-align: center;
  margin-bottom: 22px;
}

.birthday-person-name .name-line1 {
  display: block;
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffd0a6 0%, #ff758c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255, 117, 140, 0.4));
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.birthday-person-name .name-line2 {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.birthday-person-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 25px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 26px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.5px;
}

.birthday-person-date i {
  color: var(--accent-rose);
}

.main-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffd0a6 0%, #ff758c 50%, #b862ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.15));
}

.main-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Central Reveal Area */
.reveal-area {
  margin: 20px 0;
  display: grid;
  place-items: center;
  min-height: 150px;
}

/* 3D Gift Box Animation */
.gift-box-wrapper {
  perspective: 800px;
}

.gift-box {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #ff4e50 0%, #f9d423 100%);
  position: relative;
  border-radius: 12px;
  box-shadow:
    0 15px 30px rgba(255, 78, 80, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transform-style: preserve-3d;
  animation:
    boxFloat 3s ease-in-out infinite,
    boxGlow 2s ease-in-out infinite alternate;
  transition:
    transform 0.5s,
    opacity 0.5s ease-out;
}

.gift-box:hover {
  transform: scale(1.1) rotateY(15deg);
}

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

@keyframes boxGlow {
  0% {
    box-shadow: 0 15px 30px rgba(255, 78, 80, 0.4);
  }
  100% {
    box-shadow: 0 15px 45px rgba(255, 78, 80, 0.7);
  }
}

.gift-lid {
  position: absolute;
  width: 130px;
  height: 25px;
  background: #ff3c41;
  top: -10px;
  left: -5px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.gift-ribbon-vertical {
  position: absolute;
  width: 20px;
  height: 120px;
  background: #ffffff;
  left: 50px;
  z-index: 1;
}

.gift-ribbon-horizontal {
  position: absolute;
  width: 120px;
  height: 20px;
  background: #ffffff;
  top: 50px;
  z-index: 1;
}

.gift-body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  z-index: 3;
}

.gift-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #791b1d;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  animation: pulseLabel 1.5s infinite;
}

@keyframes pulseLabel {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Explosion state */
.gift-box.exploded {
  animation: boxExplode 0.6s ease-out forwards;
}

@keyframes boxExplode {
  0% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.3) rotate(45deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }
}

/* ==========================================
   3D Rotating Carousel
   ========================================== */
.carousel-container {
  display: none;
  opacity: 0;
  width: 100%;
  perspective: 1200px;
  text-align: center;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  margin-top: -20px;
}

.carousel-container.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 208, 166, 0.3);
}

.carousel-viewport {
  width: 100%;
  height: 350px;
  display: grid;
  place-items: center;
  overflow: visible;
  position: relative;
}

.carousel-track {
  width: 250px;
  height: 300px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-card {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition:
    filter 0.5s ease,
    opacity 0.5s ease,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.carousel-card.active {
  border-color: var(--accent-rose);
  box-shadow: 0 10px 40px rgba(255, 117, 140, 0.4);
}

.carousel-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.5s ease;
}

.carousel-card:hover .carousel-img {
  transform: scale(1.03);
}

.card-caption {
  margin-top: 15px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Carousel Buttons */
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  box-shadow: 0 5px 15px rgba(255, 117, 140, 0.4);
  transform: scale(1.05);
}

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

/* ==========================================
   4. Letter Trigger Button & Letter Panel
   ========================================== */
.letter-trigger-container {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  margin-top: 20px;
  z-index: 20;
}

.letter-trigger-container.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.letter-btn {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  box-shadow: 0 8px 25px rgba(161, 140, 209, 0.3);
}

.letter-btn:hover {
  box-shadow: 0 12px 30px rgba(161, 140, 209, 0.5);
}

/* Letter Modal */
.letter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 12, 27, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 20px;
}

.letter-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.letter-card {
  max-width: 600px;
  padding: 30px 20px;
  transform: scale(0.9) translateY(30px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-modal.show .letter-card {
  transform: scale(1) translateY(0);
}

.close-letter-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: background 0.3s;
  z-index: 100;
}

.close-letter-btn:hover {
  background: var(--accent-rose);
}

.letter-paper {
  background: #fffdf6;
  color: #2e2629;
  border-radius: 12px;
  padding: 35px 25px;
  text-align: left;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.05),
    0 5px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow-y: auto;
  max-height: 70vh;
}

.letter-header {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
}

.letter-header::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 15px auto 0;
}

.letter-stamp {
  font-size: 2rem;
  color: var(--accent-rose);
  filter: drop-shadow(0 2px 5px rgba(255, 117, 140, 0.3));
}

.letter-body {
  font-family: var(--font-handwritten);
  font-size: 1.15rem;
  line-height: 1.7;
}

.letter-greeting {
  font-weight: 600;
  margin-bottom: 15px;
}

.letter-body p {
  margin-bottom: 15px;
  opacity: 0.9;
}

.letter-closing {
  margin-top: 25px;
  line-height: 1.4;
}

.closing-signature {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg-dark);
}

/* ==========================================
   5. Floating Balloons Animation
   ========================================== */
.balloons-container {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.balloon {
  position: absolute;
  bottom: -150px;
  width: 60px;
  height: 75px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  box-shadow:
    inset -5px -5px 15px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(0, 0, 0, 0.1);
  animation: floatUp 15s linear infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid inherit; /* Will match balloon color programmatically */
}

.balloon-string {
  position: absolute;
  bottom: -55px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 50px;
  background: rgba(255, 255, 255, 0.3);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-110vh) translateX(var(--wind, 50px))
      rotate(var(--angle, 15deg));
    opacity: 0;
  }
}

/* ==========================================
   6. Image Modal (Lightbox) Styles
   ========================================== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(10, 8, 20, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: zoom 0.3s;
}

@keyframes zoom {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 40px;
  right: 45px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--accent-rose);
  text-decoration: none;
  cursor: pointer;
}

.modal-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 15px 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
  .main-title {
    font-size: 2.5rem;
  }

  .carousel-viewport {
    height: 300px;
  }

  .carousel-track {
    width: 200px;
    height: 250px;
  }

  .carousel-img {
    height: 170px;
  }

  .letter-card {
    padding: 20px 10px;
  }

  .letter-paper {
    padding: 25px 15px;
  }
}

/* Proceed Button styling & fade-in animation */
.proceed-btn {
  animation: fadeInProceed 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  justify-content: center;
}

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

/* ==========================================
   Mute Button
   ========================================== */
.mute-btn {
  position: fixed;
  top: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(15, 12, 27, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 999999 !important;
  pointer-events: auto !important;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65), 0 0 15px rgba(255, 208, 166, 0.3);
}

.mute-btn i {
  font-size: 1.5rem; /* Big speaker icon */
}

.mute-btn:hover {
  background: rgba(255, 117, 140, 0.85);
  border-color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(255, 117, 140, 0.65);
}

/* Early Close Toast Warning Banner */
.early-close-toast {
  position: fixed;
  top: 35px;
  left: 50%;
  transform: translate(-50%, -30px) scale(0.9);
  background: rgba(25, 20, 45, 0.95);
  border: 1.5px solid var(--accent-gold);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 209, 102, 0.5);
  z-index: 1000000 !important;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  backdrop-filter: blur(10px);
}

.early-close-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Light theme color shifting for mute button */
body.light-theme .mute-btn {
  border-color: rgba(15, 12, 27, 0.25);
  color: #0f0c1b;
}

body.light-theme .mute-btn:hover {
  background: rgba(15, 12, 27, 0.08);
  border-color: rgba(15, 12, 27, 0.5);
}

/* ==========================================
   Golden Birthday Fairies Styling
   ========================================== */
.birthday-fairy {
  position: fixed;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 1005; /* Float on top of elements, below mute button */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.birthday-fairy .fairy-svg {
  width: 100%;
  height: 100%;
}

/* Dialogue bubbles for birthday fairies */
.birthday-fairy-dialog {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffe683;
  padding: 6px 12px;
  border-radius: 12px;
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5b4d82;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
  z-index: 2;
}

.birthday-fairy-dialog.show {
  transform: translateX(-50%) scale(1);
}

.birthday-fairy-dialog span {
  display: block;
}

.birthday-fairy-dialog::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
  z-index: 1;
}

/* ==========================================
   Transition Next Button Styling
   ========================================== */
#transition-next-btn {
  margin: 25px auto 0 auto;
  padding: 11px 26px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  background: #ebd8af; /* cream gold background */
  border: 1px solid rgba(91, 77, 130, 0.22);
  border-radius: 25px;
  color: #5b4d82;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(91, 77, 130, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition:
    all 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.8s ease;
  z-index: 10;
  position: relative;
}

#transition-next-btn:hover {
  background: #e3cd9f;
  border-color: rgba(91, 77, 130, 0.38);
  color: #ff758c;
}

/* ==========================================
   Split Layout & Gift Integration Styles
   ========================================== */
.decor-text-group {
  transition: transform 1.5s cubic-bezier(0.25, 1, 0.3, 1) !important;
}

/* Scale down and slide the card elements upwards (smaller scale, top position a little lower) */
.decor-text-group.split-top {
  transform: translate3d(0, -10vh, 0) scale(0.68);
}

/* Center gifts card container under the greeting card */
#gifts-split-container {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, 30px);
  opacity: 0;
  display: none;
  width: 90%;
  max-width: 540px;
  z-index: 20;
  transition:
    opacity 1.5s ease,
    transform 1.5s cubic-bezier(0.25, 1, 0.3, 1);
}

#gifts-split-container.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* SURROUNDING DECORATIONS (CONE & BALLOONS) */
.cloud-decor {
  position: absolute;
  pointer-events: none;
  z-index: 10;
}
.decor-cone-left {
  left: -85px;
  bottom: -15px;
  width: 80px;
  height: 96px;
  transform: rotate(-15deg);
  animation: floatCone 4s ease-in-out infinite alternate;
}
.decor-balloons-right {
  right: -90px;
  bottom: -10px;
  width: 90px;
  height: 130px;
  animation: floatBalloons 5s ease-in-out infinite alternate;
}

@keyframes floatCone {
  0% {
    transform: translateY(0) rotate(-15deg);
  }
  100% {
    transform: translateY(-8px) rotate(-12deg);
  }
}
@keyframes floatBalloons {
  0% {
    transform: translateY(0) rotate(0);
  }
  100% {
    transform: translateY(-10px) rotate(3deg);
  }
}

/* Balloons styling inside decor */
.balloon-group {
  position: relative;
  width: 100%;
  height: 100%;
}
.mini-balloon {
  position: absolute;
  width: 28px;
  height: 35px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  border: 2.5px solid #332211;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.08);
}
.mini-balloon.b1 {
  background: #ff758c;
  left: 8px;
  top: 10px;
  transform: rotate(-15deg);
}
.mini-balloon.b2 {
  background: #ffb830;
  left: 36px;
  top: 0;
  transform: rotate(5deg);
}
.mini-balloon.b3 {
  background: #54a0ff;
  left: 24px;
  top: 32px;
  transform: rotate(15deg);
}
.balloon-string {
  position: absolute;
  bottom: 0;
  left: 40px;
  width: 2px;
  height: 65px;
  background: #332211;
  transform-origin: top center;
}

/* CLOUD CARD & TITLE STYLING */
.cloud-card {
  background: #ffffff !important;
  border: 3.5px dashed #fbc59e !important; /* dashed orange border */
  border-radius: 55px !important;
  box-shadow: 0 20px 45px rgba(220, 180, 140, 0.16) !important;
  padding: 35px 40px !important;
  position: relative;
}

.dotted-divider {
  border-top: 4px dotted #ff758c;
  width: 150px;
  margin: 12px auto 18px auto;
  opacity: 0.7;
}

/* Title colors */
.title-brown {
  color: #8d6e63;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
}
.title-pink {
  color: #ff5252;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
}
.gift-title-icon {
  color: #ffb74d;
  margin-left: 8px;
  font-size: 1.6rem;
}

.gift-subtitle {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: #5b4d82;
  font-weight: 500;
  margin-bottom: 25px;
}

/* CARTOON GIFT BOX DESIGN SYSTEM */
.gift-boxes-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 20px;
  margin: 30px 0 20px 0;
}

.gift-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  width: 168px; /* 120% larger width */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Custom PNG Gift Box Images & Smooth Open Transition */
.gift-box-img-container {
  position: relative;
  width: 144px; /* 120% larger width */
  height: 144px; /* 120% larger height */
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-box-wrapper:hover .gift-box-img-container {
  transform: translateY(-8px) scale(1.08);
  filter: drop-shadow(0 12px 25px rgba(255, 117, 140, 0.6));
}

.gift-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), filter 0.7s ease;
  filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.3));
}

.gift-img-base {
  position: absolute;
  bottom: -20px; /* Moved higher back to previous position */
  left: 50%;
  transform: translateX(-50%);
  width: 116%; /* Kept size */
  height: auto;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gift-img-close {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  transition: opacity 0.55s cubic-bezier(0.25, 1, 0.5, 1), transform 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

.gift-img-open {
  opacity: 0;
  transform: scale(0.88);
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.65s cubic-bezier(0.25, 1, 0.5, 1), transform 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.65s ease;
}

/* Opened state transition */
.gift-box-wrapper.opened .gift-img-close {
  opacity: 0 !important;
  transform: scale(1.08) translateY(-4px) !important;
}

.gift-box-wrapper.opened .gift-img-open {
  opacity: 1 !important;
  transform: scale(1.04) translateY(-2px) !important;
  filter: drop-shadow(0 12px 28px rgba(255, 234, 117, 0.7)) drop-shadow(0 0 25px rgba(255, 117, 140, 0.5)) !important;
}

.gift-box-wrapper.opened .gift-box-img-container {
  animation: smoothGiftPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes smoothGiftPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}

.gift-box-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 22px;
  z-index: 5;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Soft Pedestal under the box */
.gift-box-pedestal {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 105px;
  height: 25px;
  border-radius: 50%;
  border: 2px dashed rgba(220, 180, 140, 0.3);
  z-index: 1;
  transition: all 0.4s ease;
}
.pink-pedestal {
  background: radial-gradient(
    circle,
    rgba(255, 117, 140, 0.22) 0%,
    transparent 75%
  );
  border-color: rgba(255, 117, 140, 0.25);
}
.yellow-pedestal {
  background: radial-gradient(
    circle,
    rgba(255, 184, 48, 0.22) 0%,
    transparent 75%
  );
  border-color: rgba(255, 184, 48, 0.25);
}
.purple-pedestal {
  background: radial-gradient(
    circle,
    rgba(155, 89, 182, 0.22) 0%,
    transparent 75%
  );
  border-color: rgba(155, 89, 182, 0.25);
}

/* Cartoon Styled Gift Boxes */
.gift-box-body-css {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 100px;
  height: 78px;
  border-radius: 0 0 16px 16px;
  border: 4px solid #332211; /* bold black border */
  box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.07);
  overflow: hidden;
  z-index: 4;
}

.gift-box-lid-css {
  position: absolute;
  top: 26px;
  left: 4px;
  width: 112px;
  height: 24px;
  border-radius: 8px;
  border: 4px solid #332211;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.07);
  z-index: 10;
  transition: transform 0.4s ease;
}

/* Ribbons on box body & lid */
.body-ribbon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 100%;
  background: #ffffff;
  border-left: 4px solid #332211;
  border-right: 4px solid #332211;
}

.lid-ribbon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 100%;
  background: #ffffff;
  border-left: 4px solid #332211;
  border-right: 4px solid #332211;
}

/* Ribbon Bow Loop Knots */
.gift-box-bow {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 32px;
  z-index: 15;
  transition: transform 0.4s ease;
}

.bow-loop {
  position: absolute;
  width: 35px;
  height: 26px;
  border-radius: 50%;
  border: 4px solid #332211;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.08);
}
.bow-loop.left {
  left: 6px;
  transform: rotate(-25deg);
}
.bow-loop.right {
  right: 6px;
  transform: rotate(25deg);
}

.bow-knot {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 4px solid #332211;
  background: inherit;
}

/* Colors & Patterns styling */
/* Box 1 (Pink) */
.pink-body {
  background-color: #ff6b81;
}
.pink-lid {
  background-color: #ff6b81;
}
.pink-bow .bow-loop,
.pink-bow .bow-knot {
  background-color: #ff758c;
}
.polka-dots {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.4) 22%,
    transparent 22%
  );
  background-size: 15px 15px;
  background-position: 5px 5px;
}

/* Box 2 (Yellow) */
.yellow-body {
  background-color: #ffb830;
}
.yellow-lid {
  background-color: #ffb830;
}
.yellow-bow .bow-loop,
.yellow-bow .bow-knot {
  background-color: #ffc048;
}
.star-decor {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.7);
  width: 9px;
  height: 9px;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

/* Box 3 (Purple) */
.purple-body {
  background-color: #9b59b6;
}
.purple-lid {
  background-color: #9b59b6;
}
.purple-bow .bow-loop,
.purple-bow .bow-knot {
  background-color: #a569bd;
}
.stripes {
  background-image: linear-gradient(
    90deg,
    transparent 50%,
    rgba(255, 255, 255, 0.28) 50%
  );
  background-size: 20px 100%;
}

/* Hover Zoom effect */
.gift-box-wrapper:hover .gift-box-container {
  transform: translateY(-8px) scale(1.08);
}
.gift-box-wrapper:hover .gift-box-pedestal {
  transform: translateX(-50%) scale(1.15);
  opacity: 0.9;
}

/* Pill Labels matching exact gift box colors */
.gift-box-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 4px 18px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px dashed #ff758c;
  transition: all 0.3s ease;
}

.gift-box-wrapper[data-box="1"] .gift-box-label,
.label-1 {
  border-color: #ff5e7e;
  color: #ff5e7e;
  background: rgba(255, 240, 243, 0.95);
  box-shadow: 0 4px 12px rgba(255, 94, 126, 0.25);
}

.gift-box-wrapper[data-box="2"] .gift-box-label,
.label-2 {
  border-color: #f5a623;
  color: #f5a623;
  background: rgba(255, 250, 235, 0.95);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.25);
}

.gift-box-wrapper[data-box="3"] .gift-box-label,
.label-3 {
  border-color: #b862ff;
  color: #b862ff;
  background: rgba(250, 240, 255, 0.95);
  box-shadow: 0 4px 12px rgba(184, 98, 255, 0.25);
}

/* Opened Box Lid Fly-off animations */
.gift-box-wrapper.opened .gift-box-lid-css {
  animation: lidFlyOff 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.gift-box-wrapper.opened .gift-box-bow {
  animation: bowFlyOff 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes lidFlyOff {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  30% {
    transform: translate(-10px, -45px) rotate(-18deg);
    opacity: 1;
  }
  100% {
    transform: translate(-40px, 120px) rotate(-45deg);
    opacity: 0;
  }
}

@keyframes bowFlyOff {
  0% {
    transform: translate(-50%, 0) rotate(0);
    opacity: 1;
  }
  30% {
    transform: translate(-60%, -65px) rotate(-25deg);
    opacity: 1;
  }
  100% {
    transform: translate(-90%, 100px) rotate(-60deg);
    opacity: 0;
  }
}

/* Popper & star removal fade out */
.decor-item.fade-out {
  opacity: 0 !important;
  transform: translateY(30px) scale(0.85) !important;
  pointer-events: none;
  transition:
    opacity 1.2s ease,
    transform 1.2s cubic-bezier(0.25, 1, 0.3, 1) !important;
}

/* Flying out goodbye fairies animation styling (slower exit) */
.birthday-fairy.fly-out {
  transform: translate3d(var(--fly-x), var(--fly-y), 0) scale(0.25) !important;
  opacity: 0 !important;
  transition:
    transform 3.8s cubic-bezier(0.25, 1, 0.3, 1),
    opacity 3.8s ease !important;
  pointer-events: none !important;
}

/* Responsive grid stacking for mobile viewports */
@media (max-width: 900px) {
  .decor-text-group.split-top {
    transform: translate3d(0, -13vh, 0) scale(0.6) !important;
  }

  #gifts-split-container {
    left: 50% !important;
    transform: translate(-50%, 30px) !important;
    bottom: 7% !important;
    top: auto !important;
    width: 95% !important;
    max-width: 440px !important;
  }

  #gifts-split-container.show {
    transform: translate(-50%, 0) !important;
  }

  /* Stack boxes vertically on mobile */
  .gift-boxes-container {
    flex-direction: column !important;
    gap: 15px !important;
    margin: 20px 0 10px 0 !important;
  }

  .gift-box-wrapper {
    transform: scale(0.85);
  }

  .gift-box-wrapper:hover .gift-box-container {
    transform: translateY(-4px) scale(1.04) !important;
  }

  /* Hide surrounding decor on mobile to avoid clutter */
  .cloud-decor {
    display: none !important;
  }

  .decor-frame {
    display: none !important;
  }
}

/* Giftbox Frame Shape Container on Transition Screen */
#gifts-split-container.giftbox-frame-container {
  position: absolute;
  bottom: 10%; /* 10% space from bottom of screen */
  top: auto !important;
  left: 50%;
  transform: translate(-50%, 40px);
  width: 705px; /* 110% larger width */
  min-height: 290px;
  max-width: 96vw;
  z-index: 18;
  opacity: 0;
  display: none;
  transition: opacity 1s ease, transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

#gifts-split-container.giftbox-frame-container.show {
  display: flex !important;
  opacity: 1 !important;
  transform: translate(-50%, 0) !important;
}

/* Shift gift box, base pedestal, and name label lower inside the frame */
#gifts-split-container .gift-box-wrapper {
  transform: translateY(90px);
}

.giftbox-frame-bg {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%; /* 110% width expansion */
  height: 110%; /* 110% height expansion */
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 0 24px rgba(255, 234, 117, 0.38)); /* Soft transparent yellow glow */
}

.giftbox-frame-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: none !important; /* No dark shadows or unwanted effects */
  box-shadow: none !important;
}

.giftbox-frame-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 30px 26px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.giftbox-fairy-message {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 117, 140, 0.35);
  padding: 8px 22px;
  border-radius: 25px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.3px;
}

/* ==========================================
   Polaroid Frame Carousel Styles (Wide Group Photo Support)
   ========================================== */
.decor-frame {
  position: absolute;
  top: 26%; /* Shifted higher up on screen */
  transform: translateY(-50%);
  background: #ffffff;
  padding: 14px 14px 16px 14px;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(255, 117, 140, 0.25);
  border: 3.5px solid rgba(255, 234, 117, 0.7);
  z-index: 12;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

/* Left Carousel Frame (120% scale: 300px width x 324px viewport height) */
.decor-frame-left {
  left: 14.5%;
  width: 300px;
}

.decor-frame-left .frame-slides-viewport {
  width: 100%;
  height: 324px;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

/* Right Carousel Frame (120% scale: 456px width x 234px viewport height for 2:1 ratio Group Photos) */
.decor-frame-right {
  right: 11.5%;
  width: 456px;
}

.decor-frame-right .frame-slides-viewport {
  width: 100%;
  height: 234px; /* 2:1 wide landscape aspect ratio */
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

.frame-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

.frame-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* Completely remove image name captions from carousel */
.frame-caption {
  display: none !important;
}

@media (max-width: 1400px) {
  .decor-frame {
    top: 26%;
  }
  .decor-frame-left {
    left: 14%;
    width: 220px;
  }
  .decor-frame-left .frame-slides-viewport {
    height: 240px;
  }

  .decor-frame-right {
    right: 12%;
    width: 320px;
  }
  .decor-frame-right .frame-slides-viewport {
    height: 165px;
  }
}

/* ==========================================
   Gift #1 Garden Modal Overlay
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 9, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.garden-modal-content {
  position: relative;
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  max-height: 880px;
  background: radial-gradient(circle at 50% 40%, #261c47 0%, #181332 50%, #0b091a 100%);
  border-radius: 28px;
  border: 1.5px solid rgba(255, 170, 165, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 117, 140, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.92);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.garden-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.8rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 117, 140, 0.8);
  transform: scale(1.1) rotate(90deg);
  border-color: #ffffff;
}
