/* ============================================
   عيد أضحى مبارك — تصميم ذهبي فاخر
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --gold-light: #fff8c4;
  --gold-1: #ffe066;
  --gold-2: #ffd700;
  --gold-3: #e6b800;
  --gold-deep: #b38600;
  --gold-glow: #ffea00;
  --cream: #fff5d6;
  --dark-1: #0a0604;
  --dark-2: #150f08;
  --dark-3: #221810;
  --dark-warm: #2e2014;
}

html,
body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: "Tajawal", "Segoe UI", sans-serif;
  color: var(--cream);
  background: #050302;
}

body {
  position: relative;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 30%,
      rgba(139, 105, 20, 0.25) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 100% 80% at 50% 70%,
      rgba(42, 31, 16, 0.6) 0%,
      transparent 70%
    ),
    radial-gradient(circle at center, var(--dark-3) 0%, var(--dark-1) 90%);
  animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.05);
  }
}

/* ============================================
   النجوم الخلفية
   ============================================ */
.stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8dc 50%, transparent),
    radial-gradient(1px 1px at 24% 42%, #ffd700 50%, transparent),
    radial-gradient(1.5px 1.5px at 38% 12%, #fff 50%, transparent),
    radial-gradient(1px 1px at 47% 78%, #ffd700 50%, transparent),
    radial-gradient(2px 2px at 58% 32%, #fff8dc 50%, transparent),
    radial-gradient(1px 1px at 65% 88%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 72% 22%, #ffd700 50%, transparent),
    radial-gradient(1px 1px at 82% 62%, #fff 50%, transparent),
    radial-gradient(2px 2px at 88% 8%, #fff8dc 50%, transparent),
    radial-gradient(1px 1px at 95% 48%, #ffd700 50%, transparent),
    radial-gradient(1px 1px at 5% 72%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 17% 92%, #ffd700 50%, transparent);
  background-size: 100% 100%;
  animation: twinkle 6s ease-in-out infinite;
}

.stars-2 {
  background-image:
    radial-gradient(1px 1px at 32% 55%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 51% 25%, #ffd700 50%, transparent),
    radial-gradient(1px 1px at 68% 47%, #fff8dc 50%, transparent),
    radial-gradient(2px 2px at 78% 78%, #ffd700 50%, transparent),
    radial-gradient(1px 1px at 92% 32%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 28% 68%, #fff8dc 50%, transparent),
    radial-gradient(1px 1px at 8% 38%, #ffd700 50%, transparent);
  animation: twinkle 9s ease-in-out infinite reverse;
  opacity: 0.7;
}

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

/* ============================================
   الجسيمات (Canvas)
   ============================================ */
#particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ============================================
   الفينييت
   ============================================ */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* ============================================
   الزخارف في الزوايا
   ============================================ */
.corner {
  position: fixed;
  width: 90px;
  height: 90px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
  opacity: 0;
  animation: cornerFade 2s 0.5s forwards;
}

@keyframes cornerFade {
  to {
    opacity: 0.85;
  }
}

.corner-tl {
  top: 12px;
  left: 12px;
}
.corner-tr {
  top: 12px;
  right: 12px;
  transform: scaleX(-1);
}
.corner-bl {
  bottom: 12px;
  left: 12px;
  transform: scaleY(-1);
}
.corner-br {
  bottom: 12px;
  right: 12px;
  transform: scale(-1, -1);
}

/* ============================================
   الحاوية الرئيسية
   ============================================ */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================
   الهلال
   ============================================ */
.crescent-wrap {
  width: clamp(90px, 18vw, 140px);
  height: clamp(90px, 18vw, 140px);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.3) rotate(-30deg);
  animation: crescentEnter 1.4s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.crescent {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6))
    drop-shadow(0 0 40px rgba(255, 215, 0, 0.3));
}

.moon-body {
  animation: moonPulse 4s ease-in-out infinite;
  transform-origin: center;
}

.moon-aura {
  animation: auraPulse 3s ease-in-out infinite;
  transform-origin: center;
}

.moon-stars {
  animation: starsTwinkle 2s ease-in-out infinite;
  transform-origin: center;
}

@keyframes crescentEnter {
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes moonPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

@keyframes auraPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes starsTwinkle {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   الزخارف العلوية والسفلية
   ============================================ */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 480px;
  margin: 0.8rem 0;
  opacity: 0;
  animation: ornamentFade 1.2s 1.5s forwards;
}

.orn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.orn-mid {
  font-size: 1.3rem;
  color: var(--gold-1);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
  animation: ornSpin 8s linear infinite;
  display: inline-block;
}

@keyframes ornamentFade {
  to {
    opacity: 1;
  }
}

@keyframes ornSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   العنوان الرئيسي
   ============================================ */
.title {
  font-family: "Aref Ruqaa", "Reem Kufi", serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1.3;
  margin: 1rem 0;
  letter-spacing: 0.02em;
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.5));
}

.title .word {
  display: inline-block;
  margin: 0 0.4rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(40px) scale(0.6);
  color: #ffe066;
  text-shadow:
    0 0 8px rgba(255, 224, 102, 0.9),
    0 0 20px rgba(255, 215, 0, 0.7),
    0 0 40px rgba(255, 215, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.6);
  animation:
    wordReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    wordShimmer 4s 2.5s ease-in-out infinite;
}

.title .word:nth-child(1) { animation-delay: 1.4s, 2.5s; }
.title .word:nth-child(2) { animation-delay: 1.75s, 2.5s; }
.title .word:nth-child(3) { animation-delay: 2.1s, 2.5s; }

@keyframes wordReveal {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.6);
    filter: blur(8px);
  }
  60% {
    opacity: 1;
    transform: translateY(-5px) scale(1.05);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes wordShimmer {
  0%,
  100% {
    color: #ffe066;
    text-shadow:
      0 0 8px rgba(255, 224, 102, 0.9),
      0 0 20px rgba(255, 215, 0, 0.7),
      0 0 40px rgba(255, 215, 0, 0.4),
      0 2px 4px rgba(0, 0, 0, 0.6);
  }
  50% {
    color: #fff8c4;
    text-shadow:
      0 0 12px rgba(255, 248, 196, 1),
      0 0 28px rgba(255, 234, 0, 0.9),
      0 0 50px rgba(255, 215, 0, 0.6),
      0 2px 4px rgba(0, 0, 0, 0.6);
  }
}

/* ============================================
   الفاصل
   ============================================ */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 60%;
  max-width: 320px;
  margin: 1rem 0;
  opacity: 0;
  animation: ornamentFade 1s 3.4s forwards;
}

.d-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold-1), transparent);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.d-diamond {
  font-size: 1.4rem;
  color: var(--gold-1);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
  animation: diamondPulse 2s ease-in-out infinite;
}

@keyframes diamondPulse {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }
}

/* ============================================
   التحية (يا فلان)
   ============================================ */
.greeting {
  font-family: "Aref Ruqaa", serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 1rem 0 0.5rem;
  color: #fff8c4;
  text-shadow:
    0 0 10px rgba(255, 248, 196, 0.9),
    0 0 25px rgba(255, 215, 0, 0.7),
    0 0 45px rgba(255, 215, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.7);
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
  opacity: 0;
  transform: scale(0.7);
  animation: greetingReveal 1.2s 3.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  letter-spacing: 0.02em;
  padding: 0 1rem;
  word-wrap: break-word;
}

@keyframes greetingReveal {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   الرسالة
   ============================================ */
.message {
  font-family: "Reem Kufi", "Tajawal", sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  color: #ffffff;
  margin: 1rem 0;
  opacity: 0;
  animation: ornamentFade 1.2s 4.2s forwards;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.01em;
  line-height: 1.7;
  padding: 0 1rem;
}

/* ============================================
   الدعاء
   ============================================ */
.dua {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1.2rem 0;
  font-family: "Tajawal", sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 2.9vw, 1.25rem);
  color: #fff5d6;
  opacity: 0;
  animation: ornamentFade 1.2s 4.8s forwards;
  line-height: 1.8;
  padding: 0 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.dua-sub {
  color: #ffe066;
  font-weight: 500;
  text-shadow:
    0 0 8px rgba(255, 215, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ============================================
   توقيع المُرسِل
   ============================================ */
.sender {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  position: relative;
  opacity: 0;
  animation: ornamentFade 1.5s 5.2s forwards;
}

.sender::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.sender-label {
  font-family: "Tajawal", sans-serif;
  font-size: clamp(0.85rem, 2.3vw, 1rem);
  color: #fff5d6;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.sender-name {
  font-family: "Aref Ruqaa", serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 3.6vw, 1.6rem);
  color: #ffe066;
  text-shadow:
    0 0 8px rgba(255, 224, 102, 0.9),
    0 0 18px rgba(255, 215, 0, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.7);
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
  letter-spacing: 0.03em;
}

/* ============================================
   التجاوب
   ============================================ */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem 1rem;
  }
  .corner {
    width: 60px;
    height: 60px;
  }
  .corner-tl,
  .corner-tr {
    top: 8px;
  }
  .corner-bl,
  .corner-br {
    bottom: 8px;
  }
  .corner-tl,
  .corner-bl {
    left: 8px;
  }
  .corner-tr,
  .corner-br {
    right: 8px;
  }
  .ornament {
    max-width: 280px;
    gap: 0.5rem;
  }
  .divider {
    width: 70%;
  }
}

@media (max-height: 600px) {
  .crescent-wrap {
    width: 70px;
    height: 70px;
    margin-bottom: 0.5rem;
  }
  .container {
    padding: 1rem;
  }
  .ornament {
    margin: 0.4rem 0;
  }
  .greeting {
    margin: 0.5rem 0;
  }
  .message {
    margin: 0.5rem 0;
  }
  .dua {
    margin: 0.6rem 0;
  }
}

/* ============================================
   زر الصوت
   ============================================ */
.audio-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-2);
  background: rgba(13, 8, 5, 0.7);
  color: var(--gold-1);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s;
  opacity: 0;
  animation: ornamentFade 1s 5s forwards;
}

.audio-toggle:hover {
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* ============================================
   شعاع ضوئي مارّ على العنوان
   ============================================ */
.title::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 215, 0, 0.15) 45%,
    rgba(255, 248, 220, 0.4) 50%,
    rgba(255, 215, 0, 0.15) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
