/* ===== «لَبَّيكِ يا بسملة» — شاشة العرض، مبنية على هوية ملصق الحملة =====
   مقاس التصميم 1920×1080 ويُحجَّم آلياً ليملأ أي شاشة. */
@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/Cairo-var.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-display: swap;
}

/* خط العنوان — Rakkas، مستضاف محلياً */
@font-face {
  font-family: 'Rakkas';
  src: url('/assets/fonts/Rakkas-arabic.woff2') format('woff2');
  font-weight: 400; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Rakkas';
  src: url('/assets/fonts/Rakkas-latin.woff2') format('woff2');
  font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --cream:      #fdf7f2;
  --cream-2:    #f9ece4;
  --navy:       #1c3a5e;
  --navy-2:     #14293f;
  --rose:       #d63a78;
  --rose-deep:  #ab2159;
  --pink-soft:  #fbd9e5;
  --pink-brush: #f9c6da;
  --ink:        #2c3e52;
  --muted:      #6d829a;

  /* ألوان العملات كما وردت في الملصق */
  --jod-bg: #dceaf8; --jod-line: #9cc6ea; --jod-ink: #1a4e80;
  --usd-bg: #def0e5; --usd-line: #9ed3b3; --usd-ink: #1a6b42;
  --ils-bg: #ebe1f7; --ils-line: #bfa5e0; --ils-ink: #533089;
}

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

html, body {
  width: 100%; height: 100%;
  background: #eadfd7;
  overflow: hidden;
  font-family: 'Cairo', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#fit { position: fixed; inset: 0; display: grid; place-items: center; }

.stage {
  width: 1920px; height: 1080px;
  position: relative; overflow: hidden;
  transform-origin: center center;
  display: flex; flex-direction: column;
  padding: 34px 70px 0;
  background:
    radial-gradient(760px 520px at 88% 6%,  rgba(251, 217, 229, 0.55), transparent 65%),
    radial-gradient(680px 520px at 8%  92%, rgba(214, 233, 248, 0.55), transparent 62%),
    radial-gradient(520px 420px at 50% 40%, rgba(255, 255, 255, 0.75), transparent 70%),
    linear-gradient(162deg, var(--cream) 0%, #fdf3ec 46%, var(--cream-2) 100%);
}

/* زخارف نباتية وفراشات — خفيفة كي لا تزاحم النص */
.deco { position: absolute; pointer-events: none; z-index: 1; }
.deco-tr { top: 92px; right: -44px; width: 320px; opacity: .85; }
.deco-bl { bottom: 132px; left: -40px; width: 310px; opacity: .8; }
.deco-tl { top: 168px; left: 42px;  width: 116px; opacity: .55; }
.butterfly { animation: flutter 6s ease-in-out infinite; transform-origin: center; }
@keyframes flutter {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-10px, -14px) rotate(-6deg); }
}

/* ---------- شريط الشعارات ---------- */
.logos {
  position: relative; z-index: 4; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 54px;
  height: 118px;
}
.logo-item img { height: 112px; width: auto; max-width: 330px; object-fit: contain; }
.logo-item .logo-fallback {
  font-size: 25px; font-weight: 700; color: var(--navy);
  padding: 11px 26px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(28, 58, 94, 0.18);
  white-space: nowrap;
}
.logo-sep {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink-brush); box-shadow: 0 0 0 5px rgba(249, 198, 218, 0.35);
}

/* ---------- البطل: الصورة + العنوان ---------- */
.hero {
  position: relative; z-index: 4; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 60px;
  height: 352px; padding: 6px 4px;
}

.portrait { position: relative; flex: 0 0 auto; width: 340px; height: 340px; }
.portrait .frame {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  border: 12px solid #fff;
  box-shadow: 0 16px 42px rgba(28, 58, 94, 0.18), 0 0 0 5px var(--pink-soft);
  background: var(--cream-2);
  display: grid; place-items: center;
}
.portrait .frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait .frame .ph { font-size: 104px; font-weight: 800; color: var(--pink-brush); }

/* قلب «بسملة تحتاجنا» كما في الملصق */
.portrait .heart {
  position: absolute; bottom: 4px; left: -14px; z-index: 3;
  width: 140px; height: 127px;
  display: grid; place-items: center; text-align: center;
  color: #fff; font-size: 23px; font-weight: 800; line-height: 1.2;
  background: var(--rose);
  clip-path: path('M70,127 C70,127 0,81 0,39.4 C0,15.3 17.5,0 37.2,0 C52.5,0 63.4,8.8 70,19.7 C76.6,8.8 87.5,0 102.8,0 C122.5,0 140,15.3 140,39.4 C140,81 70,127 70,127 Z');
  filter: drop-shadow(0 8px 18px rgba(171, 33, 89, 0.34));
  padding-bottom: 32px;
  animation: beat 2.6s ease-in-out infinite;
}
@keyframes beat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.07); } 28% { transform: scale(1); } }

.headline { flex: 0 1 auto; min-width: 0; }
h1.title {
  position: relative; display: inline-block;
  font-family: 'Rakkas', 'Cairo', system-ui, sans-serif;
  font-size: 146px; font-weight: 400; line-height: 1.02;
  color: var(--rose-deep); letter-spacing: 0;
  padding: 0 34px 6px;
}
/* لطخة الفرشاة الوردية خلف العنوان */
h1.title::before {
  content: ''; position: absolute; z-index: -1;
  inset: 24px -16px 14px -24px;
  background: var(--pink-brush);
  border-radius: 58% 42% 63% 37% / 46% 58% 42% 54%;
  transform: rotate(-1.1deg);
  opacity: .85;
}
.subtitle {
  font-size: 44px; font-weight: 600; color: var(--navy); margin-top: 16px;
  display: flex; align-items: center; gap: 16px;
}
.subtitle::after {
  content: ''; flex: 0 0 auto; width: 140px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--pink-brush));
}

/* ---------- عنوان المجاميع ---------- */
.totals-label {
  position: relative; z-index: 4; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-bottom: 16px;
}
.totals-label span {
  padding: 10px 40px; border-radius: 999px;
  background: var(--navy); color: #fff;
  font-size: 28px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 8px 22px rgba(28, 58, 94, 0.22);
}
.totals-label i {
  flex: 1 1 auto; height: 3px; border-radius: 999px; max-width: 340px;
  background: linear-gradient(90deg, transparent, rgba(28,58,94,.22));
}
.totals-label i:last-child { background: linear-gradient(90deg, rgba(28,58,94,.22), transparent); }

/* ---------- بطاقات العملات ---------- */
.cards {
  position: relative; z-index: 4; flex: 1 1 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  align-content: start;
}

.card {
  position: relative; overflow: hidden;
  border-radius: 30px; padding: 24px 32px 22px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--c-bg);
  border: 3px solid var(--c-line);
  box-shadow: 0 14px 34px rgba(28, 58, 94, 0.10);
  transition: box-shadow .35s ease, transform .35s ease;
}
.card[data-currency="JOD"] { --c-bg: var(--jod-bg); --c-line: var(--jod-line); --c-ink: var(--jod-ink); }
.card[data-currency="USD"] { --c-bg: var(--usd-bg); --c-line: var(--usd-line); --c-ink: var(--usd-ink); }
.card[data-currency="ILS"] { --c-bg: var(--ils-bg); --c-line: var(--ils-line); --c-ink: var(--ils-ink); }

.card::after {
  content: ''; position: absolute; left: -50px; bottom: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.card.flash { animation: flash 1.7s ease-out; }
@keyframes flash {
  0%   { transform: translateY(-6px); box-shadow: 0 0 0 0 rgba(214, 58, 120, .40), 0 14px 34px rgba(28,58,94,.10); }
  100% { transform: none;             box-shadow: 0 0 0 30px rgba(214, 58, 120, 0), 0 14px 34px rgba(28,58,94,.10); }
}

.card .cur-name {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  font-size: 30px; font-weight: 800; color: var(--c-ink);
}
.card .cur-name .sym {
  display: grid; place-items: center; min-width: 50px; height: 50px; padding: 0 12px;
  border-radius: 14px; background: #fff; color: var(--c-ink);
  border: 2px solid var(--c-line);
  font-size: 27px; font-weight: 900;
}
.card .value {
  position: relative; z-index: 2;
  font-size: 106px; font-weight: 900; line-height: 1.04; margin-top: 6px;
  color: var(--navy); letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
  direction: ltr; text-align: right;
}
.card .meta {
  position: relative; z-index: 2;
  margin-top: 6px; font-size: 24px; font-weight: 600; color: var(--muted);
}
.bar {
  position: relative; z-index: 2;
  margin-top: 14px; height: 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); overflow: hidden;
  border: 1px solid var(--c-line);
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), #ff8ab5);
  transition: width .9s cubic-bezier(.22,.9,.3,1);
}

/* ---------- الموجة الكحلية وشريط المتبرّعين ---------- */
.wave-wrap {
  position: relative; z-index: 4; flex: 0 0 auto;
  margin: 8px -70px 0; height: 130px;
}
.wave-wrap svg { display: block; width: 100%; height: 46px; }
/* حين يُخفى شريط المتبرّعين تبقى الموجة الكحلية شريطاً سفلياً نظيفاً */
.wave-wrap.no-ticker { height: 92px; }
.wave-fill { height: 46px; margin-top: -1px; background: var(--navy); }
.stage.dark .wave-fill { background: #091726; }

.ticker {
  height: 84px; margin-top: -1px;
  background: var(--navy);
  display: flex; align-items: center; padding: 0 34px; overflow: hidden;
}
.ticker .tag {
  flex: 0 0 auto; margin-left: 26px; padding: 8px 26px; border-radius: 999px;
  background: var(--rose); color: #fff; font-size: 26px; font-weight: 800;
}
.ticker .track { flex: 1 1 auto; overflow: hidden; }
.ticker .move {
  display: inline-flex; align-items: center; gap: 46px; white-space: nowrap;
  font-size: 31px; font-weight: 600; color: #fff;
  animation: marquee 36s linear infinite;
}
.ticker .move .item .amt { color: var(--pink-soft); font-weight: 800; direction: ltr; display: inline-block; }
.ticker .move .sep { color: rgba(255, 255, 255, 0.4); }
@keyframes marquee { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- نسخة داكنة: ?theme=dark — أفضل لجدار LED خلف المصوَّرين ---------- */
.stage.dark {
  background:
    radial-gradient(820px 560px at 86% 8%,  rgba(214, 58, 120, 0.22), transparent 64%),
    radial-gradient(700px 540px at 10% 92%, rgba(60, 120, 190, 0.22), transparent 62%),
    linear-gradient(158deg, #0d1e33 0%, #14304c 52%, #1a3c5e 100%);
  --ink: #eef5fb; --muted: rgba(238,245,251,.62); --navy: #f3f8fc;
  --jod-bg: rgba(156,198,234,.16); --jod-ink: #a9d2f5;
  --usd-bg: rgba(158,211,179,.16); --usd-ink: #a4e3be;
  --ils-bg: rgba(191,165,224,.16); --ils-ink: #cdb2ee;
}
.stage.dark .deco { opacity: .30; }
.stage.dark .logo-item .logo-fallback { background: rgba(255,255,255,.10); color: #eef5fb; border-color: rgba(255,255,255,.22); }
/* الشعارات مرسومة لخلفية فاتحة — نضع خلفها بطاقة بيضاء كي تُقرأ على الداكن */
.stage.dark .logo-item img {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px; padding: 9px 16px; height: 104px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.stage.dark h1.title::before { opacity: .38; background: var(--rose); }
.stage.dark .totals-label span { background: var(--rose); }
.stage.dark .card { box-shadow: 0 14px 34px rgba(0,0,0,.30); }
.stage.dark .card::after { background: rgba(255,255,255,.05); }
.stage.dark .card .cur-name .sym { background: rgba(255,255,255,.10); }
.stage.dark .card .value { color: #fff; }
.stage.dark .bar { background: rgba(255,255,255,.12); }
.stage.dark .subtitle { color: #eef5fb; }
.stage.dark h1.title { color: #fff; }
.stage.dark .wave-wrap svg path { fill: #091726; }
.stage.dark .ticker { background: #091726; }

/* حالة انقطاع الاتصال */
#offline {
  position: absolute; z-index: 9; top: 16px; left: 22px;
  padding: 8px 18px; border-radius: 999px; font-size: 19px; font-weight: 700;
  background: rgba(200, 40, 40, .92); color: #fff; display: none;
}
#offline.on { display: block; }

/* ---------- اقتحام «تبرّع جديد» فوق منطقة العنوان — المجاميع تبقى ظاهرة ---------- */
.hero { position: relative; }
.takeover {
  position: absolute; inset: 6px -10px 0; z-index: 8;
  display: flex; align-items: center; justify-content: center; gap: 54px;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  box-shadow: 0 22px 60px rgba(171, 33, 89, 0.34);
  opacity: 0; transform: translateY(26px) scale(.97);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.9,.25,1);
  pointer-events: none; overflow: hidden;
}
.takeover.on { opacity: 1; transform: none; }
.takeover::before {
  content: ''; position: absolute; right: -90px; top: -110px;
  width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
.takeover::after {
  content: ''; position: absolute; left: -70px; bottom: -130px;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.takeover .tk-avatar {
  position: relative; z-index: 2; flex: 0 0 auto;
  width: 210px; height: 210px; border-radius: 50%; overflow: hidden;
  border: 9px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}
.takeover .tk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.takeover .tk-body { position: relative; z-index: 2; min-width: 0; }
.takeover .tk-head {
  display: inline-flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.24); color: #fff;
  padding: 9px 30px; border-radius: 999px;
  font-size: 30px; font-weight: 800; margin-bottom: 14px;
}
.takeover .tk-head .hrt { animation: beat 1.3s ease-in-out infinite; }
.takeover .tk-name {
  font-size: 74px; font-weight: 900; color: #fff; line-height: 1.12;
  max-width: 1000px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.takeover .tk-amount {
  font-size: 62px; font-weight: 900; color: #ffe2ec; margin-top: 6px;
  direction: ltr; text-align: right; font-variant-numeric: tabular-nums;
}
.takeover .tk-thanks { font-size: 30px; font-weight: 700; color: rgba(255,255,255,.92); margin-top: 12px; }
