/* ==========================================================================
   THE MEMORY GIFT — CHAPTERS & SCENES
   Horizontally centered layout system with elegant romantic aesthetics
   ========================================================================== */

/* --------------------------------------------------------------------------
   00. SCENE: THE LOCKED GIFT — HERO SECTION
   -------------------------------------------------------------------------- */
#scene-locked-gift {
  width: min(100% - 32px, var(--max-text));
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Gift Stage — Exact Visual Center */
.gift-stage-wrapper {
  perspective: 1200px;
  margin: 0 auto 36px auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Heart-shaped / circular light aura behind gift */
.gift-stage-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(185, 106, 130, 0.22) 0%, rgba(217, 183, 129, 0.08) 45%, transparent 70%);
  border-radius: 50%;
  animation: heartAuraPulse 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes heartAuraPulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
}

/* Soft golden glow beneath gift box */
.gift-stage-wrapper::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 24px;
  background: radial-gradient(ellipse, rgba(217, 183, 129, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.gift-box-composition {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  animation: giftFloat 5s ease-in-out infinite;
}

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

.gift-box-composition:hover {
  animation-play-state: paused;
  transform: rotateY(6deg) rotateX(3deg) translateY(-4px);
}
.gift-box-composition:hover .lock-body {
  box-shadow: 0 0 20px rgba(217, 183, 129, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

/* Gift Box Geometry */
.gift-box {
  position: relative;
  width: 160px;
  height: 160px;
  background: linear-gradient(145deg, #702C3C 0%, #3B1420 80%, #2B101B 100%);
  border-radius: 20px;
  box-shadow: 
    0 25px 60px rgba(10, 3, 6, 0.8),
    inset 0 1px 2px rgba(255, 243, 240, 0.2),
    inset 0 -3px 8px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(217, 183, 129, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ribbons — Champagne Gold */
.gift-ribbon-v {
  position: absolute;
  width: 26px;
  height: 100%;
  background: linear-gradient(90deg, #A8835A 0%, #F5D7A6 50%, #8C683E 100%);
  box-shadow: 0 0 14px rgba(217, 183, 129, 0.3);
}

.gift-ribbon-h {
  position: absolute;
  width: 100%;
  height: 26px;
  background: linear-gradient(180deg, #A8835A 0%, #F5D7A6 50%, #8C683E 100%);
  box-shadow: 0 0 14px rgba(217, 183, 129, 0.3);
}

/* The Lock Emblem */
.lock-emblem {
  position: relative;
  z-index: 5;
  width: 68px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  cursor: pointer;
}

.lock-shackle {
  width: 42px;
  height: 36px;
  border: 5px solid #F5D7A6;
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  transform-origin: right bottom;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lock-body {
  width: 60px;
  height: 44px;
  background: linear-gradient(145deg, #F5D7A6 0%, #A8835A 100%);
  border-radius: 10px;
  border: 1px solid #FFE6BE;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.lock-keyhole {
  width: 8px;
  height: 15px;
  background: #240E16;
  border-radius: 4px 4px 2px 2px;
  position: relative;
}
.lock-keyhole::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  background: #240E16;
  border-radius: 50%;
}

/* Unlocking State */
.gift-box-composition.unlocked {
  animation: none;
}
.gift-box-composition.unlocked .lock-shackle {
  transform: translateY(-12px) rotate(-35deg);
}
.gift-box-composition.unlocked .gift-box {
  transform: scale(1.06);
  box-shadow: 0 0 60px rgba(217, 183, 129, 0.45), 0 25px 70px rgba(10, 3, 6, 0.9);
  border-color: var(--c-champagne-gold);
}

/* Headlines */
.locked-gift-headline {
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--c-warm-ivory);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  line-height: 1.3;
  text-align: center;
}

.locked-gift-subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--c-dusty-pink);
  margin-bottom: 8px;
  font-style: italic;
  opacity: 0.9;
  line-height: 1.6;
  text-align: center;
}

.locked-gift-sub {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--c-soft-blush);
  margin-bottom: 34px;
  line-height: 1.8;
  direction: rtl;
  text-align: center;
}

#unlock-gift-btn {
  font-size: 1.05rem;
  padding: 16px 42px;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   01. SCENE: VERIFICATION FLOW — CENTERED
   -------------------------------------------------------------------------- */
#scene-verification {
  width: min(100% - 32px, 680px);
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.verify-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.verify-stage.active {
  display: flex;
  animation: fadeInStage 0.4s ease forwards;
}

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

/* Clean Card Wrapper */
.verify-card-wrapper {
  background: rgba(23, 8, 15, 0.65);
  border: 1px solid rgba(217, 183, 129, 0.16);
  border-radius: 24px;
  padding: 44px 34px;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.verify-card-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-champagne-gold), var(--c-romantic-rose), transparent);
  opacity: 0.6;
}

.verify-step-badge {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--c-champagne-gold);
  padding: 5px 16px;
  background: rgba(217, 183, 129, 0.08);
  border: 1px solid rgba(217, 183, 129, 0.2);
  border-radius: 20px;
  margin-bottom: 20px;
  display: inline-block;
  direction: rtl;
}

.verify-question-title {
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--c-warm-ivory);
  margin-bottom: 8px;
  line-height: 1.45;
  text-align: center;
}

.verify-question-sub {
  font-size: 1.08rem;
  font-weight: 300;
  color: var(--c-soft-blush);
  margin-bottom: 28px;
  text-align: center;
  direction: rtl;
}

.verify-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-inline: auto;
}

.cinema-input-wrapper {
  position: relative;
  width: 100%;
}

.cinema-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(14, 5, 8, 0.7);
  border: 1px solid rgba(217, 183, 129, 0.2);
  border-radius: 14px;
  color: var(--c-warm-ivory);
  font-family: var(--font-somar);
  font-size: 1.15rem;
  text-align: center;
  transition: var(--t-smooth);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  direction: ltr;
}

.cinema-input::placeholder {
  color: rgba(216, 185, 188, 0.4);
}

.cinema-input:focus {
  outline: none;
  border-color: var(--c-champagne-gold);
  box-shadow: 0 0 20px rgba(217, 183, 129, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.35);
  background: rgba(26, 10, 15, 0.85);
}

.verify-error-msg {
  color: #E57373;
  font-size: 0.92rem;
  margin-top: 4px;
  min-height: 22px;
  opacity: 0;
  transform: translateY(-4px);
  transition: var(--t-smooth);
  direction: rtl;
  text-align: center;
}
.verify-error-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stage 3: Automatic Message Reveal */
.dots-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 36px auto;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--c-romantic-rose);
  animation: pulseDot 1.4s infinite ease-in-out both;
}

.pulse-dot:nth-child(1) { animation-delay: -0.32s; }
.pulse-dot:nth-child(2) { animation-delay: -0.16s; }
.pulse-dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulseDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.3); opacity: 1; background-color: var(--c-champagne-gold); }
}

/* Revealed Quote Box */
.revealed-quote-box {
  display: none;
  background: rgba(14, 5, 8, 0.75);
  border: 1px solid rgba(217, 183, 129, 0.18);
  border-radius: 18px;
  padding: 34px 28px;
  margin: 24px auto 30px auto;
  max-width: 540px;
  box-shadow: 0 20px 45px rgba(10, 3, 6, 0.55);
  position: relative;
  text-align: right;
  direction: rtl;
  line-height: 2.1;
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--c-warm-ivory);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.revealed-quote-box.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.revealed-quote-box p {
  margin-bottom: 14px;
}
.revealed-quote-box p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   CHAPTER HEADERS & COMMON STYLES — CENTERED
   -------------------------------------------------------------------------- */
.chapter-header {
  text-align: center;
  max-width: var(--max-text);
  margin: 0 auto 45px auto;
  width: 100%;
}

.chapter-number-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--c-champagne-gold);
  padding: 5px 18px;
  background: rgba(217, 183, 129, 0.08);
  border: 1px solid rgba(217, 183, 129, 0.2);
  border-radius: 30px;
  margin-bottom: 16px;
  direction: ltr;
}

.chapter-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-warm-ivory);
  letter-spacing: 1px;
  margin-bottom: 12px;
  line-height: 1.25;
  text-align: center;
  direction: ltr;
}

.chapter-subtitle-en {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--c-dusty-pink);
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.6;
  text-align: center;
  direction: ltr;
}

.chapter-subtitle-ar {
  font-size: 1.22rem;
  font-weight: 300;
  color: var(--c-warm-ivory);
  opacity: 0.9;
  direction: rtl;
  text-align: center;
  line-height: 1.8;
}

.chapter-footer {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 20px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   02. CHAPTER 01: THE BEGINNING (CHILDHOOD MEMORIES) — CENTERED GALLERY
   -------------------------------------------------------------------------- */
#scene-chapter-1 {
  width: min(100% - 32px, 1100px);
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.editorial-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  width: 100%;
  max-width: var(--max-media);
  margin: 10px auto 0 auto;
}

.editorial-card {
  position: relative;
  background: rgba(35, 14, 21, 0.45);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(10, 4, 7, 0.5);
  border: 1px solid rgba(217, 183, 129, 0.1);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  height: 400px;
}

.editorial-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 20px 45px rgba(10, 3, 6, 0.7), 0 0 25px rgba(185, 106, 130, 0.2);
  border-color: rgba(217, 183, 129, 0.3);
}

.editorial-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-card:hover img {
  transform: scale(1.05);
}

.editorial-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px 20px 16px 20px;
  background: linear-gradient(to top, rgba(14, 5, 8, 0.94) 0%, transparent 100%);
  color: var(--c-warm-ivory);
  font-size: 0.93rem;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  direction: rtl;
  text-align: right;
}

.span-large-portrait,
.span-medium-landscape,
.span-wide-editorial,
.span-small-portrait {
  grid-column: span 1;
  height: 400px;
}

@media (max-width: 768px) {
  .editorial-gallery {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 480px;
  }
  .editorial-card,
  .span-large-portrait,
  .span-medium-landscape,
  .span-wide-editorial,
  .span-small-portrait {
    height: 300px;
  }
}

/* --------------------------------------------------------------------------
   03. CHAPTER 02: LITTLE THINGS THAT MATTER (SHARED MEMORIES) — CENTERED
   -------------------------------------------------------------------------- */
#scene-chapter-2 {
  width: min(100% - 32px, 1100px);
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.floating-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: var(--max-media);
  margin: 15px auto 0 auto;
  justify-content: center;
}

.floating-memory-card {
  position: relative;
  background: rgba(23, 8, 15, 0.55);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(217, 183, 129, 0.1);
  box-shadow: 0 12px 35px rgba(10, 4, 7, 0.5);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

.floating-memory-card:nth-child(odd) {
  transform: rotate(-1deg);
}
.floating-memory-card:nth-child(even) {
  transform: rotate(1deg);
}

.floating-memory-card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  border-color: rgba(217, 183, 129, 0.35);
  box-shadow: 0 20px 45px rgba(10, 3, 6, 0.65), 0 0 25px rgba(185, 106, 130, 0.15);
}

.card-img-wrap {
  width: 100%;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-charcoal);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.floating-memory-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

.card-caption-text {
  padding: 14px 6px 6px 6px;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--c-soft-blush);
  line-height: 1.65;
  direction: rtl;
  text-align: center;
  unicode-bidi: plaintext;
}

/* --------------------------------------------------------------------------
   04. CHAPTER 03: MOVING MEMORIES (PERSONAL VIDEOS) — CENTERED CINEMA
   -------------------------------------------------------------------------- */
#scene-chapter-3 {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.video-theater-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 820px;
  margin: 10px auto 0 auto;
}

.cinema-video-card {
  position: relative;
  background: rgba(23, 8, 15, 0.65);
  border-radius: 20px;
  border: 1px solid rgba(217, 183, 129, 0.12);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(10, 3, 6, 0.7);
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cinema-video-card.portrait-card {
  width: min(100%, calc(75vh * (9 / 16)));
  max-width: 440px;
  margin: 0 auto;
}

.video-frame-container {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-frame-container.portrait {
  aspect-ratio: 9 / 16;
  max-height: 75vh;
  width: 100%;
  margin: 0 auto;
}

.cinema-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Native & Custom Fullscreen Behavior */
.video-frame-container:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-frame-container:fullscreen .cinema-video-player {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.video-frame-container:fullscreen .video-custom-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2147483647;
}

/* Poster with Play Button */
.video-poster-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.4s ease;
  z-index: 5;
}

.video-poster-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.big-play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(112, 44, 60, 0.85);
  border: 2px solid var(--c-champagne-gold);
  color: var(--c-warm-ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(185, 106, 130, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
  animation: playBtnPulse 3s infinite ease-in-out;
}

@keyframes playBtnPulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(185, 106, 130, 0.35);
  }
  50% {
    box-shadow: 0 0 45px rgba(217, 183, 129, 0.55), 0 0 15px rgba(185, 106, 130, 0.4);
  }
}

.video-poster-overlay:hover .big-play-btn {
  transform: scale(1.1);
  background: var(--c-burgundy);
  box-shadow: 0 0 45px rgba(217, 183, 129, 0.45);
}

.big-play-btn svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  transform: translateX(2px);
}

/* Custom Minimal Controls */
.video-custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(to top, rgba(14, 5, 8, 0.95) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  direction: ltr;
}

.video-frame-container:hover .video-custom-controls,
.video-frame-container.playing .video-custom-controls {
  opacity: 1;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--c-warm-ivory);
  cursor: pointer;
  opacity: 0.85;
  transition: var(--t-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn:hover {
  opacity: 1;
  color: var(--c-champagne-gold);
}
.ctrl-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.ctrl-progress-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.ctrl-progress-filled {
  height: 100%;
  width: 0%;
  background: var(--c-champagne-gold);
  border-radius: 4px;
  position: relative;
}

.ctrl-time {
  font-size: 0.75rem;
  color: var(--c-soft-blush);
  min-width: 75px;
  text-align: center;
}

.video-info-box {
  padding: 18px 22px;
  text-align: center;
}

.video-info-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-warm-ivory);
  margin-bottom: 6px;
}

.video-info-caption {
  font-size: 0.98rem;
  font-weight: 300;
  color: var(--c-soft-blush);
  line-height: 1.65;
  direction: rtl;
  text-align: center;
}

/* --------------------------------------------------------------------------
   05. CHAPTER 04: THE FINAL LETTER — CINEMATIC LOVE LETTER
   -------------------------------------------------------------------------- */
#scene-chapter-4 {
  width: 100%;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Movie Credits Floating Side Columns */
.credits-side-stream {
  position: absolute;
  top: 0;
  height: 100%;
  width: 200px;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.credits-side-stream.left {
  left: 20px;
}

.credits-side-stream.right {
  right: 20px;
}

.credits-photo-track {
  display: flex;
  flex-direction: column;
  gap: 35px;
  animation: floatCreditsUp 35s linear infinite;
}

@keyframes floatCreditsUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.credits-photo-item {
  width: 180px;
  height: 230px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(217, 183, 129, 0.1);
  opacity: 0.3;
  transition: opacity 0.5s ease;
}

.credits-photo-item:hover {
  opacity: 0.75;
}

.credits-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.credits-photo-item:nth-child(odd) {
  transform: rotate(-2.5deg);
}
.credits-photo-item:nth-child(even) {
  transform: rotate(2.5deg);
}

/* Center Stage Letter */
.letter-stage-center {
  position: relative;
  z-index: 10;
  width: min(100% - 32px, 720px);
  margin-inline: auto;
  padding: 46px 36px;
  text-align: center;
  background: rgba(23, 8, 15, 0.75);
  border: 1px solid rgba(217, 183, 129, 0.16);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

.letter-stage-center::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-champagne-gold), var(--c-romantic-rose), transparent);
  opacity: 0.5;
}

.letter-title-tag {
  font-size: 0.82rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-champagne-gold);
  margin-bottom: 25px;
  opacity: 0.7;
  direction: ltr;
}

.letter-body-arabic {
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 2.25;
  color: var(--c-warm-ivory);
  text-align: right;
  direction: rtl;
  margin-bottom: 40px;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.letter-body-arabic.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Signature */
.signature-block {
  margin-top: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.2s ease 0.6s, transform 1.2s ease 0.6s;
  direction: rtl;
  text-align: center;
}

.signature-block.revealed {
  opacity: 1;
  transform: translateY(0);
}

.signature-line-1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--c-champagne-gold);
  letter-spacing: 1px;
}

.signature-line-2 {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--c-dusty-pink);
  font-style: italic;
}

.ending-trigger-wrap {
  margin-top: 40px;
  opacity: 0;
  transition: opacity 0.8s ease 1.2s;
}
.ending-trigger-wrap.visible {
  opacity: 1;
}

@media (max-width: 900px) {
  .credits-side-stream {
    display: none;
  }
  .letter-stage-center {
    padding: 28px 18px;
  }
  .letter-body-arabic {
    font-size: 1.12rem;
    line-height: 2;
  }
}

/* --------------------------------------------------------------------------
   06. SCENE: THE END ("النهاية") — EMOTIONAL FINALE
   -------------------------------------------------------------------------- */
#scene-the-end {
  width: min(100% - 32px, var(--max-text));
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.the-end-text {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: var(--c-warm-ivory);
  letter-spacing: normal;
  line-height: 1.45;
  max-width: 720px;
  text-wrap: balance;
  margin: 0 auto;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1.5s ease, transform 1.5s ease;
  direction: rtl;
  text-align: center;
  text-shadow: 0 0 35px rgba(217, 183, 129, 0.4), 0 0 10px rgba(185, 106, 130, 0.25);
}

.the-end-text.revealed {
  opacity: 1;
  transform: scale(1);
}

.the-end-sub {
  font-size: 1.08rem;
  color: var(--c-dusty-pink);
  margin-top: 20px;
  opacity: 0;
  transition: opacity 1.2s ease 0.6s;
  direction: rtl;
  text-align: center;
}
.the-end-sub.revealed {
  opacity: 0.85;
}

.the-end-final-message {
  font-size: 1.15rem;
  color: var(--c-champagne-gold);
  margin-top: 18px;
  opacity: 0;
  transition: opacity 1.2s ease 1.2s;
  font-style: italic;
  text-align: center;
}
.the-end-final-message.revealed {
  opacity: 0.75;
}

/* Responsive Refinements */
@media (max-width: 768px) {
  .locked-gift-headline {
    font-size: 1.8rem;
  }
  .locked-gift-sub {
    font-size: 1rem;
  }
  .gift-box-composition {
    width: 180px;
    height: 180px;
  }
  .gift-box {
    width: 140px;
    height: 140px;
  }
  .chapter-title {
    font-size: 1.95rem;
  }
  .verify-question-title {
    font-size: 1.35rem;
  }
  .verify-card-wrapper {
    padding: 30px 18px;
  }
  .floating-cards-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 380px;
  }
  .cinema-video-card.portrait-card {
    width: 100%;
    max-width: min(390px, 92vw);
    margin: 0 auto;
  }
  .video-frame-container.portrait {
    max-height: 72vh;
  }
  .the-end-text {
    font-size: clamp(1.65rem, 6vw, 2.2rem);
    line-height: 1.5;
    padding-inline: 12px;
  }
}

@media (max-width: 390px) {
  .locked-gift-headline {
    font-size: 1.5rem;
  }
  .chapter-title {
    font-size: 1.65rem;
  }
  .gift-box-composition {
    width: 160px;
    height: 160px;
  }
  .gift-box {
    width: 125px;
    height: 125px;
  }
  .verify-question-title {
    font-size: 1.18rem;
  }
  .the-end-text {
    font-size: 1.6rem;
  }
}
