@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-deep: #0c0716;
  --bg-deep-2: #160d26;
  --panel: rgba(32, 18, 50, 0.78);
  --panel-2: rgba(22, 12, 36, 0.88);
  --panel-border: rgba(227, 168, 87, 0.32);
  --gold: #E3A857;
  --gold-soft: #F7DBA7;
  --gold-glow: rgba(227, 168, 87, 0.35);
  --rose: #D9788F;
  --cream: #FAF6EF;
  --lavender: #D8CCE8;
  --muted: #A393BD;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-deep);
  color: var(--cream);
  font-family: 'Cairo', sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Aref Ruqaa', serif;
}

/* ==========================================================================
   SLIDES CONTAINER (Full viewport snap scroll)
   ========================================================================== */
#slides {
  height: 100svh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  position: relative;
}

.slide {
  height: 100svh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(1.2rem + env(safe-area-inset-top, 0px)) 1.2rem calc(3.2rem + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   AMBIENT BACKGROUNDS
   ========================================================================== */
.ambient-bg {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.22) saturate(1.4);
  transform: scale(1.15);
  transition: background-image 0.8s ease-in-out;
  z-index: 0;
  pointer-events: none;
}

.ambient-bg-none {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(227, 168, 87, 0.12) 0%, rgba(20, 10, 32, 0.98) 75%), var(--bg-deep);
  z-index: 0;
  pointer-events: none;
}

.ambient-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(12, 7, 22, 0.2) 0%, rgba(12, 7, 22, 0.88) 100%);
  z-index: 1;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: min(75vw, 600px);
  height: min(75vw, 600px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 168, 87, 0.25) 0%, rgba(217, 120, 143, 0.12) 40%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
  animation: pulseOrb 8s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulseOrb {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ==========================================================================
   COVER SLIDE
   ========================================================================== */
.slide-cover {
  flex-direction: column;
  text-align: center;
}

.cover-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 620px;
  padding: 2.4rem 2rem;
  background: linear-gradient(150deg, rgba(38, 20, 58, 0.85) 0%, rgba(20, 10, 34, 0.92) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(227, 168, 87, 0.15);
  animation: floatCard 6s ease-in-out infinite alternate;
}

.sparkle-tag {
  font-size: 0.95rem;
  color: var(--gold-soft);
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
  padding: 0.35rem 1.2rem;
  background: rgba(227, 168, 87, 0.15);
  border: 1px solid rgba(227, 168, 87, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.cover-title {
  font-size: clamp(2.6rem, 7.5vw, 4.4rem);
  line-height: 1.25;
  margin: 0 0 1.4rem;
  color: var(--gold-soft);
  text-shadow: 0 0 40px rgba(227, 168, 87, 0.45);
}

.cover-intro {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  line-height: 2.1;
  color: var(--cream);
  max-width: 44ch;
  margin: 0 0 2.4rem;
  white-space: pre-wrap;
}

.enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--gold) 0%, #E68875 50%, var(--rose) 100%);
  color: #170A24;
  border: none;
  padding: 1rem 2.6rem;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 35px rgba(227, 168, 87, 0.45), 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.enter-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 18px 50px rgba(227, 168, 87, 0.6);
}

.enter-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-icon {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
}

.enter-btn:hover .btn-icon {
  transform: scale(1.25) rotate(10deg);
}

/* ==========================================================================
   FLOATING MEMORY BOXES (بوكسات طايرة بتعرض الصورة كاملة)
   ========================================================================== */
.slide-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.slide-meta {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding: 0 0.5rem;
  z-index: 10;
}

.slide-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-soft);
  background: rgba(32, 18, 50, 0.85);
  border: 1px solid var(--panel-border);
  padding: 0.28rem 0.95rem;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.event-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #170A24;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  padding: 0.3rem 1.05rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(227, 168, 87, 0.35);
}

/* Floating Layout Grid */
.floating-container {
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  align-items: center;
  z-index: 10;
}

/* Base Floating Box Style */
.floating-box {
  background: linear-gradient(150deg, rgba(38, 20, 58, 0.88) 0%, rgba(20, 10, 34, 0.94) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9), 0 0 35px rgba(227, 168, 87, 0.12);
  padding: 1.25rem;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Floating animation effects */
.floating-photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: floatPhoto 5.5s ease-in-out infinite alternate;
}

.floating-info-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
  padding: 1.6rem 1.4rem;
  animation: floatInfo 6.5s ease-in-out infinite alternate;
}

.floating-info-box.no-photo {
  grid-column: 1 / -1;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

@keyframes floatPhoto {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(0.4deg); }
  100% { transform: translateY(3px) rotate(-0.3deg); }
}

@keyframes floatInfo {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-0.3deg); }
  100% { transform: translateY(4px) rotate(0.2deg); }
}

/* ==========================================================================
   PHOTO FRAME - DISPLAYS FULL PICTURE (بدون قص)
   ========================================================================== */
.photo-frame {
  position: relative;
  width: 100%;
  height: 48vh;
  max-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  overflow: hidden;
  padding: 8px;
  cursor: pointer;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8);
}

/* The actual photo is shown 100% full without being cut off */
.main-photo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  display: block;
}

.photo-frame:hover .main-photo {
  transform: scale(1.02);
}

.photo-frame.fading .main-photo {
  opacity: 0.25;
}

/* Photo Navigation Arrows */
.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(16, 8, 28, 0.85);
  border: 1px solid rgba(227, 168, 87, 0.45);
  color: var(--gold-soft);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s, color 0.2s;
  z-index: 4;
}

.photo-arrow:hover {
  background: var(--gold);
  color: #170A24;
  transform: translateY(-50%) scale(1.12);
}

.prev-btn { right: 12px; }
.next-btn { left: 12px; }

.photo-zoom-hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  background: rgba(16, 8, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.photo-frame:hover .photo-zoom-hint {
  opacity: 1;
}

/* Carousel Dots */
.photo-dots {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.photo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(246, 239, 228, 0.25);
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.photo-dot.active {
  background: var(--gold-soft);
  width: 20px;
  border-radius: 999px;
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Thumbnail Strip for multiple photos */
.photo-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.2rem 0;
  justify-content: center;
}

.photo-thumb-item {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
  transition: all 0.2s ease;
  background: #000;
}

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

.photo-thumb-item:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.photo-thumb-item.active {
  opacity: 1;
  border-color: var(--gold-soft);
  box-shadow: 0 0 12px var(--gold-glow);
  transform: scale(1.08);
}

/* ==========================================================================
   INFO BOX TYPOGRAPHY
   ========================================================================== */
.event-title {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.4;
  color: var(--gold-soft);
  margin: 0 0 1rem;
  text-shadow: 0 2px 20px rgba(227, 168, 87, 0.25);
}

.event-desc-box {
  max-height: 36vh;
  overflow-y: auto;
  padding-left: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 168, 87, 0.3) transparent;
}

.event-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 2.1;
  color: var(--cream);
  margin: 0;
  white-space: pre-wrap;
}

/* ==========================================================================
   SCROLL HINT & FOOTER
   ========================================================================== */
.scroll-hint {
  position: absolute;
  bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 1rem;
  background: rgba(32, 18, 50, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  animation: floatHint 2.2s ease-in-out infinite;
  transition: all 0.2s;
}

.scroll-hint:hover {
  background: rgba(227, 168, 87, 0.25);
  transform: translateX(-50%) translateY(-2px);
}

.arrow-icon {
  font-size: 1rem;
}

@keyframes floatHint {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}

.footer-slide {
  flex-direction: column;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.closing-glow-1 {
  position: absolute;
  top: 15%;
  left: 20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(235, 87, 142, 0.28) 0%, rgba(235, 87, 142, 0) 70%);
  filter: blur(50px);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseGlow 5s ease-in-out infinite alternate;
}

.closing-glow-2 {
  position: absolute;
  bottom: 15%;
  right: 20%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(227, 168, 87, 0.22) 0%, rgba(227, 168, 87, 0) 70%);
  filter: blur(55px);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite alternate-reverse;
}

.closing-card-wrap {
  position: relative;
  z-index: 10;
  max-width: 620px;
  width: 92%;
  margin: 0 auto;
  border-radius: 36px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(227, 168, 87, 0.6) 0%, rgba(235, 87, 142, 0.35) 50%, rgba(138, 77, 219, 0.5) 100%);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(227, 168, 87, 0.18);
  animation: floatCard 6s ease-in-out infinite alternate;
}

.closing-content {
  position: relative;
  z-index: 2;
  padding: 2.8rem 2rem;
  background: linear-gradient(160deg, rgba(28, 14, 44, 0.95) 0%, rgba(16, 7, 26, 0.98) 100%);
  border-radius: 34px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.closing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem;
  background: rgba(227, 168, 87, 0.12);
  border: 1px solid rgba(227, 168, 87, 0.35);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 15px rgba(227, 168, 87, 0.1);
}

.badge-sparkle {
  font-size: 0.85rem;
  animation: spinSlow 8s linear infinite;
}

.closing-icon-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.icon-pulse-rings {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 87, 142, 0.25) 0%, rgba(227, 168, 87, 0.15) 50%, transparent 75%);
  animation: pulseRings 2.5s ease-out infinite;
}

.closing-main-icon {
  font-size: 3.2rem;
  filter: drop-shadow(0 0 16px rgba(235, 87, 142, 0.6));
  animation: pulseHeart 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.floating-star {
  position: absolute;
  font-size: 1.1rem;
  pointer-events: none;
  animation: floatStar 3s ease-in-out infinite alternate;
}

.floating-star.s1 { top: -4px; right: 0; animation-delay: 0s; }
.floating-star.s2 { bottom: 2px; right: -8px; font-size: 1rem; animation-delay: 0.8s; }
.floating-star.s3 { top: 6px; left: -6px; font-size: 0.95rem; animation-delay: 1.5s; }

.closing-title {
  font-size: clamp(2rem, 5.5vw, 2.8rem);
  background: linear-gradient(135deg, #FFF6E0 20%, #E3A857 70%, #FFB6C1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
  line-height: 1.3;
  text-shadow: 0 0 30px rgba(227, 168, 87, 0.2);
}

.closing-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  max-width: 240px;
  margin: 0.8rem 0 1.2rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 168, 87, 0.5), transparent);
}

.divider-gem {
  font-size: 0.85rem;
  color: var(--gold-soft);
  filter: drop-shadow(0 0 6px rgba(227, 168, 87, 0.8));
}

.closing-message {
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  color: #E2D9F3;
  line-height: 1.9;
  max-width: 480px;
  margin-bottom: 2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.closing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.celebrate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(235, 87, 142, 0.2) 0%, rgba(138, 77, 219, 0.25) 100%);
  border: 1px solid rgba(235, 87, 142, 0.45);
  color: #FFE6F0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(235, 87, 142, 0.15);
}

.celebrate-btn:hover {
  background: linear-gradient(135deg, rgba(235, 87, 142, 0.35) 0%, rgba(138, 77, 219, 0.4) 100%);
  border-color: rgba(235, 87, 142, 0.75);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 25px rgba(235, 87, 142, 0.35);
}

.celebrate-btn:active {
  transform: translateY(0) scale(0.98);
}

.replay-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #E3A857 0%, #C8842E 100%);
  color: #12091A !important;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(227, 168, 87, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.replay-action-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(227, 168, 87, 0.5);
}

.replay-action-btn:active {
  transform: translateY(0) scale(0.98);
}

.replay-action-btn .replay-icon {
  font-size: 1.15rem;
  transition: transform 0.5s ease;
  display: inline-block;
}

.replay-action-btn:hover .replay-icon {
  transform: rotate(-360deg);
}

/* Floating Confetti Particle */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-size: 1.4rem;
  user-select: none;
  animation: burstParticle 1.4s ease-out forwards;
}

@keyframes pulseRings {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes floatStar {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-7px) rotate(15deg); }
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.2; }
  100% { transform: scale(1.2); opacity: 0.4; }
}

@keyframes burstParticle {
  0% {
    transform: translate(0, 0) scale(0.6) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx, 0px), var(--ty, -100px)) scale(1.2) rotate(var(--tr, 360deg));
    opacity: 0;
  }
}

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

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

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 14, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  background: var(--gold);
  color: #170A24;
  transform: scale(1.1);
}

/* ==========================================================================
   FRIENDS TREE SLIDE
   ========================================================================== */
.slide-tree {
  position: relative;
  overflow: hidden;
  justify-content: flex-start;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
}

.tree-slide-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem 1rem;
}

.tree-header {
  text-align: center;
  margin-bottom: 0.2rem;
  z-index: 5;
}

.tree-title {
  font-size: clamp(1.6rem, 3.8vw, 2.5rem);
  color: var(--gold-soft);
  margin: 0.4rem 0 0.2rem;
  text-shadow: 0 4px 18px rgba(227, 168, 87, 0.35);
}

.tree-subtitle {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--lavender);
  margin: 0;
  opacity: 0.9;
}

/* Floating particles in tree slide */
.tree-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.tree-particles .particle {
  position: absolute;
  font-size: 1.1rem;
  opacity: 0.65;
  animation: floatParticle 9s ease-in-out infinite alternate;
}

.tree-particles .p1 { top: 15%; left: 12%; animation-duration: 8s; animation-delay: 0s; }
.tree-particles .p2 { top: 30%; right: 15%; animation-duration: 11s; animation-delay: 1.5s; }
.tree-particles .p3 { top: 60%; left: 8%; animation-duration: 9.5s; animation-delay: 3s; }
.tree-particles .p4 { top: 75%; right: 10%; animation-duration: 10s; animation-delay: 2s; }
.tree-particles .p5 { top: 25%; left: 45%; animation-duration: 7.5s; animation-delay: 4s; }
.tree-particles .p6 { top: 50%; right: 40%; animation-duration: 12s; animation-delay: 0.5s; }

@keyframes floatParticle {
  0% { transform: translateY(0) scale(0.9) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-30px) scale(1.15) rotate(15deg); opacity: 0.8; }
  100% { transform: translateY(-55px) scale(0.9) rotate(-10deg); opacity: 0.3; }
}

/* Tree Interactive Canvas Area */
.tree-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  flex: 1;
  min-height: 280px;
  max-height: calc(100svh - 210px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.tree-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  filter: drop-shadow(0 0 35px rgba(227, 168, 87, 0.25));
  pointer-events: none;
}

.tree-nodes-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

/* Individual Branch Node (Friend Button) */
.tree-branch-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s;
  animation: floatNode 5s ease-in-out infinite alternate;
}

.tree-branch-node:hover,
.tree-branch-node:focus-visible {
  transform: translate(-50%, -55%) scale(1.15);
  z-index: 25;
}

@keyframes floatNode {
  0% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-7px); }
  100% { transform: translate(-50%, -50%) translateY(3px); }
}

/* Pulse ring around avatar */
.node-pulse-ring {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 168, 87, 0.4) 0%, rgba(217, 120, 143, 0.2) 60%, transparent 80%);
  animation: nodePulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes nodePulse {
  0%, 100% { transform: translateX(-50%) scale(0.95); opacity: 0.5; }
  50% { transform: translateX(-50%) scale(1.35); opacity: 0.9; }
}

/* Avatar frame */
.node-avatar-frame {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--gold), var(--rose), var(--gold-soft));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(227, 168, 87, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s ease;
}

.tree-branch-node:hover .node-avatar-frame {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 25px var(--gold);
}

.node-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #190e29;
}

.node-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #381f4a 0%, #1c0e2a 100%);
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-leaf-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 0.95rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Node Label & Name */
.node-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 5px;
  padding: 3px 10px;
  background: rgba(22, 10, 36, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
  transition: background 0.3s, border-color 0.3s;
}

.tree-branch-node:hover .node-label {
  background: rgba(38, 18, 58, 0.95);
  border-color: var(--gold);
}

.node-name {
  font-size: 0.82rem;
  color: var(--cream);
  font-weight: 600;
}

.node-relation {
  font-size: 0.68rem;
  color: var(--gold-soft);
  margin-top: -1px;
}

/* Empty state for tree */
.tree-empty-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 440px;
  z-index: 10;
}

.empty-hint-card {
  text-align: center;
  padding: 1.8rem 1.4rem;
  background: rgba(30, 15, 46, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(15px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.empty-hint-icon {
  font-size: 2.2rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.empty-hint-card h3 {
  font-size: 1.35rem;
  color: var(--gold-soft);
  margin: 0 0 0.5rem;
}

.empty-hint-card p {
  font-size: 0.9rem;
  color: var(--lavender);
  margin: 0;
  line-height: 1.6;
}

/* ==========================================================================
   FRIEND SPOTLIGHT MODAL
   ========================================================================== */
.friend-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.friend-modal.active {
  opacity: 1;
  visibility: visible;
}

.friend-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.friend-modal-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 540px;
  max-height: 90svh;
  background: linear-gradient(155deg, rgba(38, 20, 58, 0.96) 0%, rgba(20, 10, 34, 0.98) 100%);
  border: 1.5px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.9), 0 0 40px rgba(227, 168, 87, 0.2);
  padding: 1.8rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.friend-modal.active .friend-modal-card {
  transform: scale(1) translateY(0);
}

.friend-modal-close {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cream);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
}

.friend-modal-close:hover {
  background: var(--gold);
  color: #1a0f28;
  transform: scale(1.1);
}

.friend-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-left: 2.8rem; /* space for close btn */
}

.friend-branch-tag {
  font-size: 0.85rem;
  color: var(--gold-soft);
  background: rgba(227, 168, 87, 0.15);
  border: 1px solid rgba(227, 168, 87, 0.35);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.friend-modal-counter {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* Friend Modal Body */
.friend-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}

.friend-modal-photo-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--gold), var(--rose), var(--gold-soft));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(227, 168, 87, 0.4);
  flex-shrink: 0;
}

.friend-modal-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1a0f28;
  cursor: pointer;
  display: block;
}

.friend-modal-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #3d2054 0%, #1e0e2d 100%);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--gold);
}

.friend-photo-zoom {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(22, 10, 36, 0.9);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.friend-photo-zoom:hover {
  transform: scale(1.15);
  background: var(--gold);
  color: #170A24;
}

.friend-modal-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.friend-modal-name {
  font-size: 1.8rem;
  color: var(--cream);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.friend-modal-relation {
  font-size: 0.9rem;
  color: var(--gold-soft);
  margin-top: 0.25rem;
  font-weight: 500;
}

.friend-modal-message-box {
  position: relative;
  width: 100%;
  margin-top: 1rem;
  padding: 1.2rem 1.4rem;
  background: rgba(22, 10, 36, 0.7);
  border: 1px solid rgba(227, 168, 87, 0.25);
  border-radius: 18px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.friend-modal-message-box .quote-icon {
  font-family: 'Aref Ruqaa', serif;
  font-size: 2.2rem;
  color: var(--gold);
  opacity: 0.35;
  position: absolute;
  line-height: 1;
}

.friend-modal-message-box .quote-icon.right {
  top: 6px;
  right: 12px;
}

.friend-modal-message-box .quote-icon.left {
  bottom: 2px;
  left: 12px;
}

.friend-modal-message {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--cream);
  margin: 0;
  white-space: pre-wrap;
  position: relative;
  z-index: 2;
}

/* Modal Navigation Footer */
.friend-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.friend-nav-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.friend-nav-btn:hover {
  background: rgba(227, 168, 87, 0.2);
  border-color: var(--gold);
  color: var(--gold-soft);
  transform: translateY(-2px);
}

.friend-nav-btn .nav-arrow {
  font-size: 1.2rem;
  line-height: 1;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .slide {
    padding: calc(0.8rem + env(safe-area-inset-top, 0px)) 0.9rem calc(2.8rem + env(safe-area-inset-bottom, 0px));
  }

  .floating-container {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .floating-box {
    padding: 1rem;
    border-radius: 20px;
  }

  .photo-frame {
    height: 38svh;
    max-height: 300px;
  }

  .main-photo {
    max-height: 100%;
  }

  .floating-info-box {
    text-align: center;
    padding: 1rem;
  }

  .event-title {
    font-size: 1.45rem;
    margin-bottom: 0.4rem;
  }

  .event-desc-box {
    max-height: 16svh;
  }

  .event-desc {
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .slide-meta {
    margin-bottom: 0.5rem;
  }

  /* Friends Tree Mobile */
  .slide-tree {
    padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
  }

  .tree-slide-content {
    padding: 0.2rem 0.6rem 0.8rem;
  }

  .tree-title {
    font-size: 1.45rem;
  }

  .tree-subtitle {
    font-size: 0.8rem;
  }

  .tree-container {
    max-height: calc(100svh - 180px);
    min-height: 240px;
  }

  .node-avatar-frame {
    width: 44px;
    height: 44px;
    padding: 2px;
  }

  .node-pulse-ring {
    width: 48px;
    height: 48px;
  }

  .node-avatar-fallback {
    font-size: 1rem;
  }

  .node-leaf-badge {
    font-size: 0.8rem;
  }

  .node-label {
    padding: 2px 7px;
    border-radius: 8px;
    margin-top: 3px;
  }

  .node-name {
    font-size: 0.72rem;
  }

  .node-relation {
    font-size: 0.6rem;
  }

  .friend-modal-card {
    padding: 1.4rem 1.1rem 1.1rem;
    border-radius: 22px;
  }

  .friend-modal-photo-wrap {
    width: 105px;
    height: 105px;
  }

  .friend-modal-name {
    font-size: 1.45rem;
  }

  .friend-modal-message {
    font-size: 0.95rem;
  }

  .friend-nav-btn {
    font-size: 0.82rem;
    padding: 0.55rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

