/* ===== GLOBAL ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #FFF8E7;
  font-family: 'Playfair Display', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: #D4AF37;
  color: #1B2A33;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none;
}

.visible {
  display: flex;
}

/* ===== TRANSITIONS ===== */
.fade-out {
  opacity: 0;
  transition: opacity 1s ease;
}

.fade-in {
  opacity: 1;
  transition: opacity 1s ease;
}

.slide-up {
  transform: translateY(0);
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.slide-up-initial {
  transform: translateY(30px);
  opacity: 0;
}

/* ===== PASSCODE SCREEN ===== */
#passcode-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #020810 0%, #071526 30%, #0a1e3d 50%, #0d2847 65%, #0a3040 80%, #0D5C63 100%);
  overflow: hidden;
}

/* Stars layer */
#passcode-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 50px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 180px 40px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 320px 120px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 500px 60px, #fff, transparent),
    radial-gradient(1px 1px at 650px 160px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 100px 250px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 250px 300px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 420px 220px, #fff, transparent),
    radial-gradient(1px 1px at 580px 280px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 750px 100px, #fff, transparent),
    radial-gradient(1px 1px at 850px 200px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 950px 50px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 1100px 140px, #fff, transparent),
    radial-gradient(1px 1px at 1250px 80px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 1400px 200px, #fff, transparent),
    radial-gradient(1px 1px at 70px 400px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 200px 500px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 350px 450px, #fff, transparent),
    radial-gradient(1px 1px at 550px 380px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 700px 420px, #fff, transparent),
    radial-gradient(1px 1px at 900px 350px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 1050px 480px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 1200px 400px, #fff, transparent),
    radial-gradient(1px 1px at 1350px 320px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 130px 550px, #fff, transparent),
    radial-gradient(1px 1px at 300px 600px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 480px 520px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 620px 580px, #fff, transparent),
    radial-gradient(1px 1px at 800px 550px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 1000px 600px, #F4E4A6, transparent),
    radial-gradient(1px 1px at 1150px 540px, #fff, transparent);
  animation: stars-twinkle 4s ease-in-out infinite alternate;
}

/* Second star layer for depth */
#passcode-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 120px 130px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 380px 70px, rgba(244,228,166,0.5), transparent),
    radial-gradient(1.5px 1.5px at 600px 200px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 800px 300px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 1000px 120px, rgba(244,228,166,0.6), transparent),
    radial-gradient(1px 1px at 160px 350px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 450px 400px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 700px 480px, rgba(244,228,166,0.5), transparent),
    radial-gradient(1px 1px at 950px 420px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 1200px 300px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 280px 550px, rgba(244,228,166,0.6), transparent),
    radial-gradient(1px 1px at 530px 600px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 850px 570px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 1100px 520px, rgba(244,228,166,0.5), transparent);
  animation: stars-twinkle 5s ease-in-out 1s infinite alternate;
}

@keyframes stars-twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Moon */
.passcode-moon {
  position: absolute;
  top: 8%;
  right: 18%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #FFF8E7, #F4E4A6, #D4AF37);
  box-shadow:
    0 0 40px rgba(255, 248, 231, 0.6),
    0 0 80px rgba(244, 228, 166, 0.3),
    0 0 160px rgba(212, 175, 55, 0.15);
  z-index: 0;
  animation: moon-glow 5s ease-in-out infinite alternate;
}

@keyframes moon-glow {
  0% { box-shadow: 0 0 40px rgba(255,248,231,0.5), 0 0 80px rgba(244,228,166,0.25), 0 0 160px rgba(212,175,55,0.1); }
  100% { box-shadow: 0 0 60px rgba(255,248,231,0.7), 0 0 120px rgba(244,228,166,0.4), 0 0 200px rgba(212,175,55,0.2); }
}

/* Water */
.passcode-water {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35%;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg,
    rgba(4, 20, 40, 0.6) 0%,
    rgba(6, 30, 55, 0.85) 30%,
    rgba(4, 22, 45, 0.95) 70%,
    #031020 100%
  );
}

/* Moonlight shimmer on water */
.water-shimmer {
  position: absolute;
  top: 0;
  right: 18%;
  transform: translateX(50%);
  width: 100px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(244, 228, 166, 0.3) 0%,
    rgba(244, 228, 166, 0.1) 30%,
    rgba(244, 228, 166, 0.03) 60%,
    transparent 100%
  );
  filter: blur(18px);
  animation: shimmer-pulse 3s ease-in-out infinite;
}

@keyframes shimmer-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(50%) scaleX(1); }
  50% { opacity: 1; transform: translateX(50%) scaleX(1.4); }
}

/* SVG waves */
.wave {
  position: absolute;
  left: 0;
  width: 200%;
  height: 60px;
  top: -30px;
}

.wave path {
  fill: rgba(6, 30, 55, 0.5);
}

.wave-1 {
  animation: wave-drift 7s linear infinite;
  opacity: 0.6;
}

.wave-1 path {
  fill: rgba(4, 22, 45, 0.5);
}

.wave-2 {
  animation: wave-drift 11s linear infinite reverse;
  opacity: 0.4;
  top: -15px;
}

.wave-2 path {
  fill: rgba(8, 40, 65, 0.4);
}

.wave-3 {
  animation: wave-drift 9s linear infinite;
  opacity: 0.3;
  top: -5px;
}

.wave-3 path {
  fill: rgba(13, 50, 75, 0.35);
}

@keyframes wave-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

#passcode-screen > * {
  position: relative;
  z-index: 1;
}

.passcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -8vh;
}

.passcode-title {
  font-family: 'Amiri', serif;
  font-size: 2.5rem;
  color: #D4AF37;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
  margin-bottom: 2rem;
  text-align: center;
}

.crescent {
  display: block;
  font-size: 3rem;
  color: #D4AF37;
  margin-bottom: 1rem;
  text-align: center;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

#passcode-input {
  width: 300px;
  padding: 15px 25px;
  border: 2px solid #D4AF37;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFF8E7;
  font-size: 1.1rem;
  font-family: 'Playfair Display', serif;
  text-align: center;
  outline: none;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#passcode-input::placeholder {
  color: rgba(255, 248, 231, 0.5);
}

#passcode-input:focus {
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), 0 0 40px rgba(212, 175, 55, 0.15);
  border-color: #F4E4A6;
}

#passcode-btn {
  background: #D4AF37;
  color: #1B2A33;
  padding: 12px 40px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-family: 'Playfair Display', serif;
  cursor: pointer;
  border: none;
  margin-top: 1rem;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

#passcode-btn:hover {
  background: #F4E4A6;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

#passcode-btn:active {
  transform: scale(0.98);
}

#error-msg {
  color: #E8A0BF;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
  text-align: center;
}

/* Corner ornaments */
.corner-ornament {
  position: absolute;
  color: #D4AF37;
  font-size: 2rem;
  opacity: 0.3;
  z-index: 1;
}

.corner-ornament.top-left {
  top: 20px;
  left: 20px;
}

.corner-ornament.top-right {
  top: 20px;
  right: 20px;
  transform: rotate(90deg);
}

.corner-ornament.bottom-left {
  bottom: 20px;
  left: 20px;
  transform: rotate(270deg);
}

.corner-ornament.bottom-right {
  bottom: 20px;
  right: 20px;
  transform: rotate(180deg);
}

/* Lanterns */
.lantern {
  position: absolute;
  color: #D4AF37;
  pointer-events: none;
  z-index: 0;
}

.lantern-1 {
  top: 8%;
  left: 10%;
  font-size: 2.5rem;
  opacity: 0.25;
  animation: lantern-sway 4s ease-in-out infinite;
}

.lantern-2 {
  top: 15%;
  right: 8%;
  font-size: 2rem;
  opacity: 0.2;
  animation: lantern-sway 5s ease-in-out infinite 1s;
}

.lantern-3 {
  bottom: 20%;
  left: 5%;
  font-size: 1.8rem;
  opacity: 0.3;
  animation: lantern-sway 4.5s ease-in-out infinite 0.5s;
}

.lantern-4 {
  bottom: 12%;
  right: 12%;
  font-size: 2.2rem;
  opacity: 0.35;
  animation: lantern-sway 5.5s ease-in-out infinite 1.5s;
}

.lantern-5 {
  top: 40%;
  left: 3%;
  font-size: 1.5rem;
  opacity: 0.2;
  animation: lantern-sway 6s ease-in-out infinite 2s;
}

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

/* ===== HELLO SCREEN ===== */
#hello-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFF8E7;
  box-shadow: inset 0 0 80px rgba(212, 175, 55, 0.1);
  overflow: hidden;
}

.hello-text {
  font-family: 'Amiri', serif;
  font-size: 4rem;
  color: #0D5C63;
  letter-spacing: 2px;
  text-align: center;
  animation: hello-fade-in 2s ease forwards;
  opacity: 0;
}

@keyframes hello-fade-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hello-text span {
  color: #D4AF37;
  font-style: italic;
}

/* Decorative stars */
.decorative-star {
  position: absolute;
  color: #D4AF37;
  pointer-events: none;
  animation: twinkle 2s ease-in-out infinite;
}

.decorative-star:nth-child(1) {
  top: 15%;
  left: 20%;
  font-size: 1rem;
  animation-delay: 0s;
}

.decorative-star:nth-child(2) {
  top: 25%;
  right: 18%;
  font-size: 0.7rem;
  animation-delay: 0.5s;
}

.decorative-star:nth-child(3) {
  bottom: 30%;
  left: 15%;
  font-size: 0.8rem;
  animation-delay: 1s;
}

.decorative-star:nth-child(4) {
  top: 10%;
  right: 30%;
  font-size: 1.2rem;
  animation-delay: 1.5s;
}

.decorative-star:nth-child(5) {
  bottom: 20%;
  right: 22%;
  font-size: 0.6rem;
  animation-delay: 0.3s;
}

.decorative-star:nth-child(6) {
  top: 40%;
  left: 8%;
  font-size: 0.9rem;
  animation-delay: 0.8s;
}

.decorative-star:nth-child(7) {
  bottom: 15%;
  left: 35%;
  font-size: 1.1rem;
  animation-delay: 1.2s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

#next-arrow {
  margin-top: 3rem;
  font-size: 1.5rem;
  font-family: 'Playfair Display', serif;
  color: #D4AF37;
  cursor: pointer;
  border: none;
  background: none;
  opacity: 0;
  animation: arrow-fade-in 1s ease 2.5s forwards, bounce 1.5s ease-in-out 3.5s infinite;
  transition: color 0.3s ease;
}

#next-arrow:hover {
  color: #F4E4A6;
}

@keyframes arrow-fade-in {
  to { opacity: 1; }
}

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

/* ===== STORY SECTION ===== */
#story-1, #story-2, #story-3, #story-4, #story-5, #story-6, #story-7 {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #FDF5E6;
}

.ornament-border-top,
.ornament-border-bottom {
  width: 100%;
  height: 60px;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'%3E%3Cpath d='M0 60 Q30 0 60 60 Q90 0 120 60' fill='none' stroke='%23D4AF37' stroke-width='1.5'/%3E%3Cpath d='M15 60 Q30 20 45 60' fill='none' stroke='%23D4AF37' stroke-width='0.8'/%3E%3Cpath d='M75 60 Q90 20 105 60' fill='none' stroke='%23D4AF37' stroke-width='0.8'/%3E%3Ccircle cx='60' cy='35' r='4' fill='none' stroke='%23D4AF37' stroke-width='0.8'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 120px 60px;
  flex-shrink: 0;
}

.ornament-border-bottom {
  transform: rotate(180deg);
}

.story-content {
  text-align: center;
}

.story-text {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  color: #1B2A33;
  text-align: center;
  max-width: 700px;
  margin: 2rem auto;
  line-height: 1.8;
  opacity: 0;
}

/* Animations only play when parent section has .animate-in */
.animate-in .story-text {
  animation: story-fade-in 1.5s ease forwards;
}

.animate-in .story-text-delayed {
  animation: story-fade-in 1.5s ease 1.5s both;
}

.animate-in .story-text-extra-delayed {
  animation: story-fade-in 1.5s ease 3s both;
}

.animate-in .story-text-extra-delayed-2 {
  animation: story-fade-in 1.5s ease 4.5s both;
}

.animate-in .scene-image {
  animation: scene-pop-in 1s ease 0.5s both;
}

.animate-in .typewriter-wrapper {
  animation: story-fade-in 1s ease 4.5s both;
}

.animate-in .heartbeat-wrapper .heartbeat-btn {
  animation: story-fade-in 1s ease 5s both;
}

.animate-in .heartbeat-wrapper .heartbeat-text {
  animation: story-fade-in 1s ease 5.5s both;
}

/* (delayed/extra-delayed animations handled by .animate-in above) */

/* Typewriter quote */
.typewriter-wrapper {
  margin: 2.5rem auto 0;
  max-width: 600px;
  min-height: 3rem;
  text-align: center;
}

.typewriter-text {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: #D4AF37;
  font-style: italic;
  line-height: 1.8;
  border-right: 2px solid #D4AF37;
  display: inline;
  padding-right: 4px;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { border-color: #D4AF37; }
  50% { border-color: transparent; }
}

/* Interactive heartbeat */
.heartbeat-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
  gap: 0.5rem;
  position: relative;
}

.heartbeat-text {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  color: #D4AF37;
  opacity: 0;
  letter-spacing: 2px;
  text-transform: lowercase;
}

.heartbeat-btn {
  font-size: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
  opacity: 0;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(220, 50, 80, 0.3));
}

.heartbeat-btn:hover {
  transform: scale(1.1);
}

.heartbeat-btn.beat {
  animation: heartbeat 0.6s ease;
}

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

.heartbeat-ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(220, 50, 80, 0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%) scale(0);
  pointer-events: none;
  z-index: 1;
}

.heartbeat-ripple.pulse {
  animation: ripple-out 0.8s ease-out;
}

@keyframes ripple-out {
  0% { transform: translate(-50%, -30%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -30%) scale(4); opacity: 0; }
}

@keyframes scene-pop-in {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes story-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.story-text em {
  color: #D4AF37;
  font-style: normal;
  font-weight: bold;
}

.scene-image {
  margin: 2rem auto;
  text-align: center;
  opacity: 0;
  position: relative;
  display: inline-block;
}

.scene-image img {
  max-width: 350px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.2));
  animation: gentle-float 4s ease-in-out infinite;
}

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

/* Sparkles around the image */
.scene-image::before {
  content: '✨';
  position: absolute;
  top: 5%;
  right: 5%;
  font-size: 0.9rem;
  opacity: 0.5;
  animation: sparkle-orbit 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparkle-orbit {
  0%, 100% { opacity: 0.3; transform: scale(0.8) translateY(0); }
  50% { opacity: 1; transform: scale(1.3) translateY(-6px); }
}

/* ===== HEART FIREWORK OVERLAY ===== */
.firework-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
  background: transparent;
  overflow: hidden;
}

.firework-overlay.active {
  display: block;
}

/* The big center heart that expands */
.firework-center-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 6rem;
  animation: center-heart-expand 1.2s ease-out forwards;
  z-index: 2;
}

@keyframes center-heart-expand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(3); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(2.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(15); opacity: 0; }
}

/* Individual firework particles */
.firework-particle {
  position: absolute;
  font-size: 1.5rem;
  pointer-events: none;
  animation: firework-shoot var(--duration) ease-out forwards;
  opacity: 0;
}

@keyframes firework-shoot {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    transform: translate(
      calc(-50% + var(--tx)),
      calc(-50% + var(--ty))
    ) scale(0.3);
    opacity: 0;
  }
}

/* Screen flash */
.firework-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, transparent 70%);
  animation: flash-fade 0.8s ease-out forwards;
}

@keyframes flash-fade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== FLOATING HEARTS ===== */
.hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.heart {
  position: absolute;
  color: #E8A0BF;
  opacity: 0.35;
  bottom: -10%;
  animation: float-up linear infinite;
}

.heart:nth-child(1) { left: 10%; font-size: 1.2rem; animation-duration: 6s; animation-delay: 0s; }
.heart:nth-child(2) { left: 25%; font-size: 0.9rem; animation-duration: 7s; animation-delay: 1s; }
.heart:nth-child(3) { left: 45%; font-size: 1.5rem; animation-duration: 5s; animation-delay: 2s; }
.heart:nth-child(4) { left: 65%; font-size: 0.8rem; animation-duration: 8s; animation-delay: 0.5s; }
.heart:nth-child(5) { left: 80%; font-size: 1.1rem; animation-duration: 6.5s; animation-delay: 3s; }
.heart:nth-child(6) { left: 15%; font-size: 1.3rem; animation-duration: 7.5s; animation-delay: 4s; }
.heart:nth-child(7) { left: 55%; font-size: 0.7rem; animation-duration: 5.5s; animation-delay: 1.5s; }
.heart:nth-child(8) { left: 90%; font-size: 1rem; animation-duration: 4.5s; animation-delay: 2.5s; }
.heart:nth-child(9) { left: 35%; font-size: 1.4rem; animation-duration: 6s; animation-delay: 3.5s; }
.heart:nth-child(10) { left: 70%; font-size: 0.6rem; animation-duration: 7s; animation-delay: 0.8s; }

@keyframes float-up {
  0% {
    bottom: -10%;
    opacity: 0.6;
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(15px) rotate(5deg);
  }
  50% {
    opacity: 0.4;
    transform: translateX(-10px) rotate(-3deg);
  }
  75% {
    transform: translateX(20px) rotate(4deg);
  }
  100% {
    bottom: 110%;
    opacity: 0;
    transform: translateX(-5px) rotate(0deg);
  }
}

/* ===== FINALE ===== */
#finale {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a1a2a 0%, #0D2B3E 40%, #0D5C63 100%);
  color: #FFF8E7;
  font-family: 'Amiri', serif;
  text-align: center;
  padding: 3rem 2rem;
  overflow: hidden;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.finale-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

/* Finale lines — staggered fade in */
.finale-line {
  opacity: 0;
  font-size: 2rem;
  line-height: 1.6;
  margin: 0.3rem 0;
}

.animate-in .finale-line-1 { animation: finale-reveal 1.5s ease 0.5s both; }
.animate-in .finale-line-2 { animation: finale-reveal 1.5s ease 2.5s both; }
.animate-in .finale-line-3 { animation: finale-reveal 2s ease 4.5s both; }
.animate-in .finale-line-4 { animation: finale-reveal 1.5s ease 10s both; }
.animate-in .finale-line-5 { animation: finale-reveal 2s ease 12s both; }
.animate-in .finale-line-6 { animation: finale-reveal 2s ease 14.5s both; }
.animate-in .finale-line-7 { animation: finale-reveal 1.5s ease 16s both; }

@keyframes finale-reveal {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.finale-gold {
  color: #D4AF37;
  font-size: 2.8rem;
  font-weight: 700;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.finale-name {
  font-size: 4rem;
  color: #D4AF37;
  font-weight: 700;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
  letter-spacing: 3px;
  margin: 0.5rem 0;
}

.finale-line-6 {
  font-size: 2.2rem;
  direction: rtl;
  color: #F4E4A6;
  margin-top: 1.5rem;
}

.finale-sub {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: rgba(255, 248, 231, 0.6);
  font-style: italic;
}

/* Finale image */
.finale-image {
  margin: 2rem auto;
  opacity: 0;
}

.animate-in .finale-image {
  animation: finale-image-reveal 2s ease 7s both;
}

@keyframes finale-image-reveal {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.finale-image img {
  max-width: 320px;
  width: 100%;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.2), 0 0 80px rgba(212, 175, 55, 0.1);
  animation: finale-glow 4s ease-in-out infinite;
}

@keyframes finale-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.2), 0 0 80px rgba(212, 175, 55, 0.1); }
  50% { box-shadow: 0 0 60px rgba(212, 175, 55, 0.4), 0 0 120px rgba(212, 175, 55, 0.15); }
}

.finale-declaration {
  margin-top: 1rem;
}

/* Love counter */
.love-counter {
  margin-top: 2.5rem;
  opacity: 0;
}

.animate-in .love-counter {
  animation: finale-reveal 1.5s ease 18s both;
}

.counter-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  color: rgba(255, 248, 231, 0.5);
  margin-bottom: 0.8rem;
}

.counter-btn {
  font-size: 3.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
}

.counter-btn:hover {
  transform: scale(1.15);
}

.counter-btn:active {
  transform: scale(0.9);
}

.counter-btn.pulse {
  animation: counter-pulse 0.3s ease;
}

@keyframes counter-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.counter-display {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #D4AF37;
  margin-top: 0.5rem;
}

#counter-num {
  font-size: 2rem;
  font-weight: 700;
}

.counter-suffix {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 248, 231, 0.4);
  margin-top: 0.3rem;
}

/* Love Promises */
.love-promises {
  margin-top: 3rem;
  opacity: 0;
}

.animate-in .love-promises {
  animation: finale-reveal 1.5s ease 19s both;
}

.promises-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  color: rgba(255, 248, 231, 0.5);
  margin-bottom: 1.2rem;
}

.promises-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.promise-crescent {
  font-size: 2.2rem;
  background: none;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  color: #D4AF37;
  transition: all 0.3s ease;
  position: relative;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.2));
}

.promise-crescent:hover {
  transform: scale(1.15);
  border-color: #D4AF37;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
}

.promise-crescent:active {
  transform: scale(0.95);
}

.promise-crescent.revealed {
  background: rgba(212, 175, 55, 0.15);
  border-color: #D4AF37;
  color: #F4E4A6;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
  animation: crescent-glow 2s ease-in-out infinite;
}

@keyframes crescent-glow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4)); }
  50% { filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.7)); }
}

.promise-reveal {
  margin-top: 1.5rem;
  min-height: 3rem;
}

.promise-text {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: #F4E4A6;
  font-style: italic;
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto;
  opacity: 0;
}

.promise-text.show {
  animation: promise-fade 0.6s ease forwards;
}

@keyframes promise-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Finale footer — Quranic dua */
.finale-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  opacity: 0;
}

.animate-in .finale-footer {
  animation: finale-reveal 2s ease 20s both;
}

.finale-dua {
  font-size: 1.8rem;
  direction: rtl;
  color: #F4E4A6;
  line-height: 2;
  margin-bottom: 1rem;
}

.finale-dua-translation {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: rgba(255, 248, 231, 0.6);
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

.finale-quran {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  color: rgba(212, 175, 55, 0.5);
  margin-top: 0.5rem;
}

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 768px) {
  .passcode-title {
    font-size: 2rem;
  }

  .crescent {
    font-size: 2.5rem;
  }

  .hello-text {
    font-size: 2.5rem;
  }

  .story-text {
    font-size: 1.4rem;
    padding: 0 1rem;
  }

  #couple-animation svg {
    max-width: 250px;
  }

  #story-1, #story-2, #story-3, #story-4, #story-5, #story-6, #story-7 {
    padding: 2rem 1.5rem;
  }

  #finale {
    font-size: 1.6rem;
  }

  .corner-ornament {
    font-size: 1.5rem;
  }

  .ornament-border-top,
  .ornament-border-bottom {
    height: 40px;
    background-size: 80px 40px;
  }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 480px) {
  .passcode-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .crescent {
    font-size: 2rem;
  }

  #passcode-input {
    width: 250px;
    padding: 12px 20px;
    font-size: 1rem;
  }

  #passcode-btn {
    padding: 10px 30px;
    font-size: 1rem;
  }

  .hello-text {
    font-size: 2rem;
    letter-spacing: 1px;
  }

  .story-text {
    font-size: 1.2rem;
    line-height: 1.7;
    margin: 1.5rem auto;
  }

  #couple-animation svg {
    max-width: 200px;
  }

  #story-1, #story-2, #story-3, #story-4, #story-5, #story-6, #story-7 {
    padding: 1.5rem 1rem;
  }

  #finale {
    font-size: 1.3rem;
  }

  .corner-ornament {
    font-size: 1.2rem;
    opacity: 0.2;
  }

  .lantern {
    display: none;
  }

  .passcode-moon {
    width: 70px;
    height: 70px;
    top: 5%;
    right: 12%;
  }

  .ornament-border-top,
  .ornament-border-bottom {
    height: 30px;
    background-size: 60px 30px;
  }
}
