/* ========================================================
   أكاديمية النابغة الصغير - تنسيق المنصة الموحدة مع خلفية الكتان
   ======================================================== */

@property --neon-fill {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --primary-espresso: #241a11;
  --leather-brown: #3e2723;
  --accent-gold: #b37418;
  --accent-gold-light: #ffca28;
  --bg-cream: #faf6ee;
  --card-border: #d8caa7;
  --card-stitch: #cfbe9a;
  --text-main: #1f1610;
  --text-body: #3d2d1e;
  --text-muted: #6d5b4b;
  --shadow-real-card: 0 18px 36px rgba(45, 30, 16, 0.22), 0 6px 12px rgba(45, 30, 16, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  --shadow-hover-card: 0 28px 52px rgba(45, 30, 16, 0.32), 0 10px 20px rgba(45, 30, 16, 0.18);
  --radius-card: 22px;
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: #e5ded0;
  background-image: url('assets/bg.jpg');
  background-repeat: repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 50px;
}

/* ==================== الشريط العلوي الفخم ==================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #3d2314 0%, #2b170c 60%, #1f1008 100%);
  border-bottom: 4px solid #c99632;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* 1. شعار الأكاديمية (اليمين) */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2px;
  background: radial-gradient(circle, #ffe082 0%, #ffb300 70%, #ff8f00 100%);
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.brand-logo-wrap:hover {
  transform: scale(1.08) rotate(5deg);
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin: 0;
}
.brand-title span {
  color: #fbc02d;
  text-shadow: 0 0 12px rgba(251, 192, 45, 0.6);
}

/* 2. شارة وبطاقة التلميذ البطل (المنتصف) */
.user-pill {
  background: linear-gradient(135deg, #2b170c 0%, #1e1008 100%);
  border: 1.5px solid #d4af37;
  border-radius: 999px;
  padding: 5px 14px 5px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 3px rgba(255, 215, 0, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
}
.user-pill:hover {
  transform: translateY(-2px);
  border-color: #ffd54f;
  box-shadow: 0 6px 18px rgba(255, 179, 0, 0.35), inset 0 1px 4px rgba(255, 215, 0, 0.4);
}
.user-avatar-gold {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9c4 0%, #ffca28 50%, #f57f17 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(255, 202, 40, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-avatar-emoji {
  font-size: 1.6rem;
  line-height: 1;
}
.user-details {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 2px;
}
.user-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-role-prefix {
  font-size: 0.72rem;
  color: #ffd54f;
  font-weight: 700;
}
.user-name {
  color: #ffffff;
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.user-sub-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-wilaya-badge {
  color: #81c784;
  font-size: 0.74rem;
  font-weight: 800;
}
.user-stars-badge {
  background: rgba(255, 215, 0, 0.15);
  color: #ffe082;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.btn-card-trigger {
  background: linear-gradient(135deg, #f57f17 0%, #e65100 100%);
  color: #ffffff;
  border: 1.5px solid #fff8e1;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(230, 81, 0, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-card-trigger:hover {
  transform: scale(1.06);
  background: linear-gradient(135deg, #ff8f00 0%, #f57f17 100%);
  box-shadow: 0 3px 12px rgba(255, 143, 0, 0.6);
}
.btn-card-icon {
  font-size: 0.95rem;
}
.btn-card-text {
  letter-spacing: 0.2px;
}

/* 3. أزرار الإجراءات العلوية (اليسار) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.nav-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
}
.nav-btn:active {
  transform: translateY(1px);
}

/* زر لوحة التحدي (برتقالي ناري محمر) */
.btn-challenge {
  background: linear-gradient(180deg, #e65100 0%, #bf360c 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #7f2305, 0 6px 14px rgba(191, 54, 12, 0.35);
}
/* زر شهادات التقدير (أصفر ذهبي دافئ) */
.btn-cert {
  background: linear-gradient(180deg, #f57f17 0%, #e65100 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #9e3900, 0 6px 14px rgba(230, 81, 0, 0.35);
}
/* زر الملف التعليمي (أخضر زمردي بترولي) */
.btn-parents {
  background: linear-gradient(180deg, #00897b 0%, #004d40 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 #002e26, 0 6px 14px rgba(0, 77, 64, 0.35);
}
/* أزرار الأيقونات الدائرية كالصوت والإعدادات */
.btn-icon-round {
  background: linear-gradient(180deg, #4e342e, #3e2723);
  color: #ffffff;
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 3px 0 #21130e, 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ==================== الحاوية الرئيسية ومساحات الأمان ==================== */
.main-container {
  max-width: 1360px;
  width: 95%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
}

/* ==================== لوحة الترحيب المعلقة بالأحزمة الذهبية (Hero Board) ==================== */
.hero-board-wrapper {
  position: relative;
  width: 100%;
  margin-top: 32px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

/* حبال ومثبتات التعليق الواقعية (حبل مجدول يمر داخل ثقب ذهبي باللوح) */
.board-hanging-rope {
  position: absolute;
  top: -46px; /* يرتفع حتى يلامس الحافة الذهبية للهيدر تماماً */
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.rope-left {
  right: 155px; /* الموضع الدقيق للحبل الأيمن كما في الصورة المرجعية */
}
.rope-right {
  left: 155px; /* الموضع الدقيق للحبل الأيسر */
}

/* الحبل المجدول الطبيعي ثلاثي الأبعاد (Braided Hemp Rope) */
.hanging-rope-braid {
  width: 14px;
  height: 52px;
  background-color: #d6a76c;
  background-image: 
    radial-gradient(ellipse at 50% 30%, #fff3d1 25%, transparent 65%),
    repeating-linear-gradient(
      -45deg,
      #c48b4b 0px,
      #c48b4b 5px,
      #ecd5a6 6px,
      #ecd5a6 10px,
      #9c6224 11px,
      #9c6224 13px
    ),
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      transparent 6px,
      rgba(70, 36, 6, 0.45) 7px,
      rgba(70, 36, 6, 0.45) 12px
    );
  border-radius: 7px;
  border-left: 1.5px solid rgba(80, 42, 10, 0.7);
  border-right: 1.5px solid rgba(80, 42, 10, 0.7);
  box-shadow: 
    3px 4px 10px rgba(0, 0, 0, 0.5),
    inset 1px 0 3px rgba(255, 255, 255, 0.6),
    inset -1px 0 3px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 3;
}

/* الحلقة المعدنية الذهبية ثلاثية الأبعاد (3D Golden Grommet Eyelet) */
.grommet-eyelet {
  width: 32px;
  height: 32px;
  margin-top: -16px; /* تتداخل مع الحبل واللوحة تماماً كما في الصورة المرجعية */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffde7 0%, #ffd54f 35%, #d4af37 65%, #8d6e63 100%);
  border: 2px solid #5a3818;
  box-shadow: 
    0 5px 12px rgba(0, 0, 0, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* الثقب المجوف الذي يكشف لون السبورة الخضراء من خلف اللوحة تماماً */
.grommet-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  /* نفس لون خلفية سبورة القسم ليظهر الثقب واقعياً ونافذاً */
  background: radial-gradient(circle at center, #1b4332 0%, #0f2e21 70%, #081c14 100%);
  border: 1.5px solid #4a2810;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* بطاقة اللوح الأبيض العريضة ذات الحواف المنقطة */
.hero-showcase {
  background: #ffffff;
  border: 5px solid #fefae0;
  border-radius: 36px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 32px;
  padding: 26px 40px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

/* ==================== أنبوب النيون الأخضر الماسي (يمتلئ ضوءاً 360 درجة ثم ينطفئ 3 ثوانٍ) ==================== */
/* 0. قناة الأنبوب الزجاجي الخافت في الخلفية */
.hero-neon-tube-channel {
  position: absolute;
  inset: 11px;
  border-radius: 25px;
  border: 3.5px solid rgba(0, 255, 136, 0.12);
  background: rgba(0, 255, 136, 0.02);
  pointer-events: none;
  z-index: 1;
}

/* 1. الحاوية المشعة للأنبوب مع الهالة الضوئية النيون */
.hero-neon-liquid-wrapper {
  position: absolute;
  inset: 10px;
  border-radius: 26px;
  pointer-events: none;
  z-index: 1;
  animation: neon-glow-pulses 7.2s ease-in-out infinite;
  will-change: filter, transform, opacity;
}

/* 2. قناة الأنبوب المفرغة التي تمتلئ بالضوء الأخضر الماسي السائل */
.hero-neon-liquid-tube {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 4px; /* سماكة أنبوب النيون */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  overflow: hidden;

  /* التدرج اللوني الذي يملأ الأنبوب ابتداءً من اليمين (90deg = موضع الساعة 3) */
  background: conic-gradient(
    from 90deg,
    #00ff88 0deg,
    #00ff88 var(--neon-fill),
    #ffffff var(--neon-fill),
    transparent var(--neon-fill),
    transparent 360deg
  );

  animation: neon-fill-cycle 7.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: --neon-fill, opacity;
}

/* 
  دورة حركة الضوء الماسية (إجمالي الدورة: 7.2 ثانية):
  - من 0 إلى 2.0 ثانية (27.78%): يمتلئ الأنبوب تدريجياً بسائل النيون الأخضر الماسي 360 درجة انطلاقاً من اليمين.
  - عند 2.0 ثانية: يكتمل امتلاء الدورة 360° وتبدأ فوراً حركتا النبض:
    * النبضة الأولى (2.0s إلى 2.42s): وميض نبضي قوي مشع بالأخضر الماسي والأبيض.
    * النبضة الثانية (2.42s إلى 2.85s): نبضة قلب إضافية أكثر بهاءً وتوهجاً نيونياً أخاذاً.
  - من 2.85 إلى 4.10 ثانية (أكثر من ثانية كاملة إضافية): يستقر الضوء مشتعلاً بالكامل وثابتاً في أبهى حلّة ليتأمله الطفل.
  - عند 4.10 إلى 4.20 ثانية: ينطفئ الضوء بسلاسة.
  - من 4.20 إلى 7.20 ثانية (3 ثوانٍ كاملة بالضبط): يظل منطفئاً تماماً في سكون تام.
  - عند 7.20 ثانية: يعيد الامتلاء من جديد تلقائياً.
*/
@keyframes neon-fill-cycle {
  0% {
    --neon-fill: 0deg;
    opacity: 1;
  }
  27.78% { /* 2.0s: اكتمال امتلاء الأنبوب 360 درجة */
    --neon-fill: 360deg;
    opacity: 1;
  }
  56.94% { /* 4.10s: البقاء مشتعلاً بالكامل (نبضتان + ثانية إضافية كاملة) */
    --neon-fill: 360deg;
    opacity: 1;
  }
  58.33% { /* 4.20s: انطفاء الضوء بسلاسة */
    --neon-fill: 360deg;
    opacity: 0;
  }
  99.8% { /* 7.18s: يظل منطفئاً تماماً لمدة 3 ثوانٍ كاملة */
    --neon-fill: 0deg;
    opacity: 0;
  }
  100% {
    --neon-fill: 0deg;
    opacity: 1;
  }
}

/* حركة النبضتين المزدوجتين (Heartbeat Pulses) والتوهج النيوني المحيط */
@keyframes neon-glow-pulses {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 4px #00ff88) drop-shadow(0 0 12px rgba(0, 255, 136, 0.9)) drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
  }
  27.78% { /* 2.0s: اكتمال الامتلاء، انطلاق النبضة الأولى فوراً */
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 5px #00ff88) drop-shadow(0 0 14px rgba(0, 255, 136, 0.95)) drop-shadow(0 0 24px rgba(0, 255, 136, 0.6));
  }
  30.83% { /* 2.22s: قمة النبضة الأولى (توهج مشع خاطف) */
    opacity: 1;
    transform: scale(1.005);
    filter: drop-shadow(0 0 10px #00ff88) drop-shadow(0 0 24px #00ff88) drop-shadow(0 0 42px #a7f3d0) brightness(1.35);
  }
  33.61% { /* 2.42s: هدوء النبضة الأولى */
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 5px #00ff88) drop-shadow(0 0 14px rgba(0, 255, 136, 0.95)) drop-shadow(0 0 24px rgba(0, 255, 136, 0.6));
  }
  36.81% { /* 2.65s: قمة النبضة الثانية (نبضة أقوى وأكثر بريقاً) */
    opacity: 1;
    transform: scale(1.008);
    filter: drop-shadow(0 0 12px #00ff88) drop-shadow(0 0 30px #00ff88) drop-shadow(0 0 52px #ffffff) brightness(1.45);
  }
  39.58% { /* 2.85s: الاستقرار على التوهج الكامل المشع */
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 6px #00ff88) drop-shadow(0 0 16px rgba(0, 255, 136, 0.95)) drop-shadow(0 0 28px rgba(0, 255, 136, 0.65));
  }
  56.94% { /* 4.10s: استمرار التوهج الثابت (ثانية إضافية كاملة) */
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 6px #00ff88) drop-shadow(0 0 16px rgba(0, 255, 136, 0.95)) drop-shadow(0 0 28px rgba(0, 255, 136, 0.65));
  }
  58.33% { /* 4.20s: انطفاء النور تماماً */
    opacity: 0;
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  99.8% { /* 7.18s: انطفاء كامل لمدة 3 ثوانٍ */
    opacity: 0;
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 4px #00ff88) drop-shadow(0 0 12px rgba(0, 255, 136, 0.9)) drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
  }
}

/* 3. إطار النقاط والغرز المتقطعة فوق الأنبوب ليمر النيون ويملأ الأنبوب من خلفها */
.hero-stitched-border {
  position: absolute;
  inset: 11px;
  border-radius: 25px;
  border: 2.5px dashed #c5a059;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.08);
}

/* محتوى البطاقة (النصوص والحبوب الإحصائية) */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  position: relative;
  z-index: 3;
}

.welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f5e9;
  color: #1b5e20;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1.5px solid #a5d6a7;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.1);
}

.hero-headline {
  font-size: 2.35rem;
  font-weight: 900;
  color: #1e1e1e;
  line-height: 1.35;
  margin-bottom: 12px;
}
.hero-headline span {
  color: #c62828;
  position: relative;
  display: inline-block;
  border-bottom: 4px solid #ffb300;
  padding-bottom: 2px;
}

.hero-lead {
  font-size: 1.02rem;
  color: #424242;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 660px;
}

/* الأزرار الإحصائية الثلاثة البيضاء المنحنية */
.hero-quick-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}
.qstat {
  background: #fffdf5;
  border: 1.5px solid #e0d5c1;
  border-radius: 20px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #3e2723;
  font-size: 0.92rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}
.qstat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}
.qnum {
  font-size: 1.25rem;
  font-weight: 900;
  color: #e65100;
}

/* قسم الصورة والملصقات حولها */
.hero-media {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
}
.hero-img {
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  border-radius: 24px;
  border: 3.5px solid #c99632;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.3s;
}
.hero-img:hover {
  transform: scale(1.02);
}
.hero-corner-sticker {
  position: absolute;
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  pointer-events: none;
}
.sticker-books {
  top: 14px;
  right: -10px;
}
.sticker-star {
  top: -10px;
  left: 20px;
}
.sticker-pencil {
  bottom: 10px;
  right: -6px;
}

/* ==================== شريط التسبيح ومواقيت الأذان المتحرك داخل الصورة ==================== */
.hero-adhan-ticker {
  position: absolute;
  top: 20px;
  left: 18px;
  right: 18px;
  height: 38px;
  background: rgba(14, 38, 22, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #d4af37;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 6;
  direction: ltr; /* الحركة تبدأ من اليسار لليمين كما طلب المستخدم */
  transition: all 0.4s ease;
}

.hero-adhan-ticker.adhan-active {
  background: linear-gradient(90deg, #1b5e20, #004d40, #b71c1c, #004d40, #1b5e20);
  background-size: 200% 200%;
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.75), 0 4px 18px rgba(0, 0, 0, 0.6);
  animation: adhan-glow 2s infinite alternate, adhan-shift 4s ease infinite;
}

@keyframes adhan-glow {
  from { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
  to { box-shadow: 0 0 30px rgba(255, 215, 0, 0.95); }
}

@keyframes adhan-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.ticker-wilaya-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-right: 1.5px solid rgba(212, 175, 55, 0.6);
  color: #fff;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: background 0.2s;
  z-index: 2;
}
.ticker-wilaya-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ticker-mosque-ico {
  font-size: 1.05rem;
}
.ticker-wilaya-name {
  color: #ffecb3;
  white-space: nowrap;
}

.ticker-marquee-track {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.ticker-marquee-content {
  display: flex;
  white-space: nowrap;
  align-items: center;
  width: max-content;
  flex-shrink: 0;
  /* حركة من اليسار لليمين دون توقف */
  animation: marquee-ltr 22s linear infinite;
  will-change: transform;
}

.ticker-item {
  color: #fffdf5;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0 16px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes marquee-ltr {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0%);
  }
}

/* صندوق تنبيه الأذان الفوري */
.ticker-adhan-alert {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.9rem;
  animation: adhan-text-pulse 1s infinite alternate;
}

@keyframes adhan-text-pulse {
  from { transform: scale(0.98); color: #fff; }
  to { transform: scale(1.02); color: #ffe082; }
}

.adhan-pulse-icon {
  font-size: 1.2rem;
  animation: pulse-glow 1s infinite alternate;
}
.challenge-showcase-card {
  background: linear-gradient(135deg, #ffffff 60%, #fffdf5 100%);
  border-radius: var(--radius-card);
  border: 4px solid #f59e0b;
  outline: 2.5px dashed #d97706;
  outline-offset: -12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 28px;
  padding: 22px 34px;
  overflow: hidden;
  position: relative;
  /* أصغر قليلاً من المستطيل المعلق بمقدار متوازن ومريح يميناً ويساراً */
  max-width: 1220px;
  width: 93%;
  margin: 0 auto;
  box-sizing: border-box;
}

.cs-thumb {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  border: 3px solid #f59e0b;
}

/* مسرح الستائر الفاخر للبطولة (Theater Stage) */
.theater-stage {
  perspective: 1000px;
  background: #1a0808;
}

/* ستائر المسرح المخملية الحمراء الفاخرة ذات الطيات الذهبية */
.theater-curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    #7f1d1d 0px,
    #991b1b 14px,
    #b91c1c 28px,
    #7f1d1d 42px,
    #450a0a 56px
  );
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 0, 0, 0.5);
  border-bottom: 4px solid #d97706;
}

.curtain-left {
  left: 0;
  transform-origin: left center;
  border-right: 3px solid #f59e0b;
  animation: curtain-left-cycle 7s ease-in-out infinite;
}

.curtain-right {
  right: 0;
  transform-origin: right center;
  border-left: 3px solid #f59e0b;
  animation: curtain-right-cycle 7s ease-in-out infinite;
}

/* الكورنيش العلوي للستارة (Valance) المزخرف */
.theater-valance {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  border-bottom: 2.5px solid #d97706;
  z-index: 12;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* أنيميشن فتح وإغلاق الستار المستمر */
@keyframes curtain-left-cycle {
  0%, 10% {
    transform: scaleX(1);
    filter: drop-shadow(4px 0 10px rgba(0,0,0,0.6));
  }
  28%, 74% {
    transform: scaleX(0.04);
    filter: drop-shadow(2px 0 6px rgba(0,0,0,0.8));
  }
  88%, 100% {
    transform: scaleX(1);
    filter: drop-shadow(4px 0 10px rgba(0,0,0,0.6));
  }
}

@keyframes curtain-right-cycle {
  0%, 10% {
    transform: scaleX(1);
    filter: drop-shadow(-4px 0 10px rgba(0,0,0,0.6));
  }
  28%, 74% {
    transform: scaleX(0.04);
    filter: drop-shadow(-2px 0 6px rgba(0,0,0,0.8));
  }
  88%, 100% {
    transform: scaleX(1);
    filter: drop-shadow(-4px 0 10px rgba(0,0,0,0.6));
  }
}

.cs-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.cs-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(36, 26, 17, 0.9);
  color: #fbbf24;
  border: 1.5px solid #f59e0b;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 999px;
  z-index: 15;
}

.cs-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-tag {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid #fca5a5;
  align-self: flex-start;
}
.cs-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--primary-espresso);
  line-height: 1.25;
}
.cs-desc {
  font-size: 0.98rem;
  color: var(--text-body);
  line-height: 1.6;
}
.cs-action-row {
  margin-top: 6px;
}

/* زر حلبة التحدي مع النبض المزدوج المتناغم فور فتح الستار */
.btn-play-challenge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #d97706, #b45309);
  color: #ffffff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 12px 28px;
  border-radius: 16px;
  box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(217, 119, 6, 0.35);
  transition: transform 0.1s, filter 0.15s;
  animation: challenge-btn-double-pulse 7s ease-in-out infinite;
}
.btn-play-challenge:hover {
  filter: brightness(1.15);
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.03);
}
.btn-play-challenge:active {
  transform: translateY(2px);
}

/* نبض الزر مرتين متتاليتين عندما يكون الستار مفتوحاً ومكشوفاً للطفل */
@keyframes challenge-btn-double-pulse {
  0%, 34% {
    transform: scale(1);
    box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(217, 119, 6, 0.35);
  }
  39% {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 7px 0 #78350f, 0 14px 28px rgba(245, 158, 11, 0.6);
  }
  44% {
    transform: scale(1);
    box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(217, 119, 6, 0.35);
  }
  55% {
    transform: scale(1.09) translateY(-3px);
    box-shadow: 0 7px 0 #78350f, 0 16px 32px rgba(245, 158, 11, 0.7);
  }
  62% {
    transform: scale(1);
    box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(217, 119, 6, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 5px 0 #78350f, 0 8px 20px rgba(217, 119, 6, 0.35);
  }
}

@media (max-width: 860px) {
  .challenge-showcase-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cs-tag {
    align-self: center;
  }
}

/* ==================== شريط تصنيف المواد متوازن بنفس الحجم ==================== */
.section-title-bar {
  background: #ffffff;
  border-radius: 24px;
  border: 3.5px solid var(--card-border);
  outline: 2px dashed var(--card-stitch);
  outline-offset: -8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  /* متوازن ومحاذى تماماً بنفس حجم بطاقة المسابقة */
  max-width: 1220px;
  width: 93%;
  margin: 0 auto;
  box-sizing: border-box;
}

.section-heading {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary-espresso);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: none;
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 700;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #e0d5c1;
  background: #fdfaf3;
  color: #4a3826;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  transition: all 0.15s;
}

.pill:hover {
  background: #ffffff;
  border-color: var(--accent-gold);
  color: var(--primary-espresso);
  transform: translateY(-1px);
}

.pill.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #92400e;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

/* ==================== شبكة بطاقات المواد السبع الحقيقية ==================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
  /* متوازنة بنفس عرض بطاقة التحدي وشريط العنوان */
  max-width: 1220px;
  width: 93%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* بطاقة حقيقية بارزة فوق الخلفية */
.subject-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 3.5px solid var(--card-border);
  outline: 2px dashed var(--card-stitch);
  outline-offset: -8px;
  box-shadow: var(--shadow-real-card);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
}

/* حركة رفع البطاقة الحقيقية باللمس أو الماوس */
.subject-card:hover {
  transform: translateY(-10px) rotate(0.4deg);
  box-shadow: var(--shadow-hover-card);
}

/* شريط التثبيت الورقي في الأعلى كأنها بطاقة مثبتة باللاصق */
.card-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: rgba(248, 237, 216, 0.88);
  border: 1px dashed rgba(160, 130, 90, 0.5);
  box-shadow: 0 2px 6px rgba(45, 30, 15, 0.18);
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

/* شارة تصنيف المادة في أعلى البطاقة */
.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: 999px;
  z-index: 5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

/* إطار صورة الشخصية - تم تكبير الارتفاع وضبط الرأس ليظهر 100% بالكامل */
.card-thumb {
  position: relative;
  width: 100%;
  height: 250px;
  background: radial-gradient(circle at 50% 35%, #ffffff 40%, #f4ece0 100%);
  border-bottom: 2.5px solid #ded2be;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ضبط موضع الصورة من الأعلى تماماً حتى لا ينقطع رأس أي شخصية نهائياً */
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* الرأس يظهر كاملاً في أعلى الإطار */
  transition: transform 0.35s ease;
}

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

/* بطاقة اسم الشخصية المرافقة */
.card-mascot-pill {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(36, 26, 17, 0.85);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 4;
}

/* متن البطاقة ومحتواها */
.card-body {
  padding: 18px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-espresso);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 0.94rem;
  color: var(--text-body);
  font-weight: 600;
  line-height: 1.55;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.card-tags span {
  background: #fcf9f2;
  color: #4e3c2c;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid #e2d6c1;
}

/* تذييل البطاقة وزر الانطلاق الحقيقي ثلاثي الأبعاد */
.card-footer {
  padding: 14px 22px 20px;
  border-top: 1.5px solid #f2eadc;
  background: #fffefb;
}

.btn-play {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 12px 22px;
  border-radius: 16px;
  transition: transform 0.1s, filter 0.15s, box-shadow 0.15s;
}
.btn-play:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
}
.btn-play:active {
  transform: translateY(2px);
}
.arrow-ico {
  font-size: 1.3rem;
  transition: transform 0.2s;
}
.btn-play:hover .arrow-ico {
  transform: translateX(-6px);
}

/* ==================== تخصيص هوية ألوان المواد السبع ==================== */
/* 1. إسلامية */
.card-islamic .card-badge { background: #1b5e20; }
.card-islamic .card-title { border-bottom: 2.5px solid #a5d6a7; padding-bottom: 4px; }
.btn-play-islamic {
  background: linear-gradient(180deg, #2e7d32, #1b5e20);
  box-shadow: 0 5px 0 #0f3b14, 0 8px 16px rgba(46, 125, 50, 0.3);
}

/* 2. رياضيات */
.card-math .card-badge { background: #e65100; }
.card-math .card-title { border-bottom: 2.5px solid #ffcc80; padding-bottom: 4px; }
.btn-play-math {
  background: linear-gradient(180deg, #f57c00, #bf360c);
  box-shadow: 0 5px 0 #872607, 0 8px 16px rgba(230, 81, 0, 0.3);
}

/* 3. عربية */
.card-arabiya .card-badge { background: #00695c; }
.card-arabiya .card-title { border-bottom: 2.5px solid #80cbc4; padding-bottom: 4px; }
.btn-play-arabiya {
  background: linear-gradient(180deg, #00897b, #004d40);
  box-shadow: 0 5px 0 #002d25, 0 8px 16px rgba(0, 105, 92, 0.3);
}

/* 4. علوم */
.card-science .card-badge { background: #0277bd; }
.card-science .card-title { border-bottom: 2.5px solid #81d4fa; padding-bottom: 4px; }
.btn-play-science {
  background: linear-gradient(180deg, #0288d1, #01579b);
  box-shadow: 0 5px 0 #003661, 0 8px 16px rgba(2, 119, 189, 0.3);
}

/* 5. تاريخ وجغرافيا */
.card-history .card-badge { background: #b71c1c; }
.card-history .card-title { border-bottom: 2.5px solid #ef9a9a; padding-bottom: 4px; }
.btn-play-history {
  background: linear-gradient(180deg, #c62828, #880e4f);
  box-shadow: 0 5px 0 #5f0909, 0 8px 16px rgba(183, 28, 28, 0.3);
}

/* 6. فرنسية */
.card-french .card-badge { background: #6a1b9a; }
.card-french .card-title { border-bottom: 2.5px solid #ce93d8; padding-bottom: 4px; }
.btn-play-french {
  background: linear-gradient(180deg, #7b1fa2, #4a148c);
  box-shadow: 0 5px 0 #310860, 0 8px 16px rgba(106, 27, 154, 0.3);
}

/* 7. إنجليزية */
.card-english .card-badge { background: #d84315; }
.card-english .card-title { border-bottom: 2.5px solid #ffab91; padding-bottom: 4px; }
.btn-play-english {
  background: linear-gradient(180deg, #e64a19, #bf360c);
  box-shadow: 0 5px 0 #7c1a01, 0 8px 16px rgba(216, 67, 21, 0.3);
}

/* ==================== النوافذ المنبثقة (Modals) ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 600px;
  padding: 24px;
  background: #ffffff;
  border-radius: 24px;
  border: 4px solid var(--card-border);
  outline: 2px dashed var(--card-stitch);
  outline-offset: -8px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0d5c1;
}
.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-espresso);
}
.modal-close {
  background: #f1ede4;
  border: none;
  font-size: 1.2rem;
  font-weight: 900;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  color: #6d5b4b;
  transition: all 0.15s;
}
.modal-close:hover {
  background: #e2d7c5;
  color: #000;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.6;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-group label {
  font-weight: 800;
  color: var(--primary-espresso);
}
.input-group input {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  outline: none;
}
.input-group input:focus {
  border-color: #b37418;
  box-shadow: 0 0 0 3px rgba(179, 116, 24, 0.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.1s;
}
.btn-primary {
  background: linear-gradient(180deg, #3e2723, #241a11);
  box-shadow: 0 4px 0 #150f09;
  color: #fff;
}
.btn-secondary {
  background: linear-gradient(180deg, #ffb300, #ff8f00);
  box-shadow: 0 4px 0 #b36200;
  color: #000;
}

/* ==================== نافذة الشهادة الشرفية ==================== */
.cert-modal-box {
  width: 100%;
  max-width: 900px;
  max-height: 95vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cert-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 18px;
  border-radius: 16px;
}

.royal-certificate {
  background: #fffdf5;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  padding: 24px;
}
.cert-border-outer {
  border: 6px double #b37418;
  border-radius: 14px;
  padding: 12px;
  background: #fffef8;
}
.cert-border-inner {
  border: 2px solid #d4af37;
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at center, #ffffff 60%, #fffbf0 100%);
}

.cert-top-crest {
  margin-bottom: 12px;
}
.crest-emblem {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 4px;
}
.cert-top-crest h3 {
  font-size: 1.15rem;
  color: #1b5e20;
  font-weight: 900;
}
.cert-top-crest p {
  font-size: 0.9rem;
  color: #795548;
  font-weight: 700;
}

.cert-title {
  font-family: 'Amiri', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #b37418;
  margin: 10px 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}
.cert-intro {
  font-size: 1.15rem;
  color: #37474f;
  font-weight: 700;
}
.cert-child-name {
  font-family: 'Amiri', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #1a237e;
  margin: 10px 0;
  border-bottom: 2.5px solid #ffb300;
  display: inline-block;
  padding: 0 40px;
}
.cert-body-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #263238;
  max-width: 720px;
  margin: 12px auto;
  font-weight: 600;
}

.cert-stamps-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1.5px dashed #d7ccc8;
  flex-wrap: wrap;
  gap: 16px;
}
.stamp-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stamp-label {
  font-size: 0.85rem;
  color: #78909c;
  font-weight: 700;
}
.stamp-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #2e7d32;
}

.golden-seal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe082 0%, #ffb300 70%, #d4af37 100%);
  border: 3px double #ffffff;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4e342e;
  font-size: 0.72rem;
  font-weight: 900;
  transform: rotate(-8deg);
}

.cert-footer-motto {
  margin-top: 14px;
  font-size: 0.95rem;
  color: #8d6e63;
  font-weight: 800;
  font-style: italic;
}

/* ==================== أنماط فضاء الأولياء ==================== */
.curriculum-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.c-card {
  background: #fdfaf3;
  border: 1.5px solid #e0d5c1;
  border-radius: 14px;
  padding: 12px;
}
.c-card h5 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-espresso);
  margin-bottom: 4px;
}
.c-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.parents-tips {
  background: #f1f8e9;
  border: 1.5px solid #c5e1a5;
  border-radius: 14px;
  padding: 14px;
}
.parents-tips h4 {
  color: #1b5e20;
  font-weight: 900;
  margin-bottom: 8px;
}
.parents-tips ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #2e7d32;
}

/* ==================== أنيميشن ==================== */
@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255, 202, 40, 0.4)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(255, 202, 40, 0.8)); }
}
@keyframes float-sparkle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==================== إثراء بطاقات المواد السبع ==================== */
.card-curriculum-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f8e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 8px;
  width: fit-content;
}

.card-curriculum-units {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fcfbf8;
  border: 1.5px solid #ede4d3;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 2px;
}
.curr-unit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #f0e6d6;
  transition: transform 0.15s, background-color 0.15s;
}
.curr-unit-item:hover {
  background: #fffdf5;
  transform: translateX(-3px);
}
.curr-unit-item .unit-ico {
  font-size: 1.15rem;
  line-height: 1;
  width: 24px;
  text-align: center;
}
.curr-unit-item .unit-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.curr-unit-item .unit-info strong {
  font-size: 0.84rem;
  color: #3e2723;
  font-weight: 800;
}
.curr-unit-item .unit-info small {
  font-size: 0.73rem;
  color: #795548;
  font-weight: 600;
}

.card-progress-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffde7;
  border: 1.5px dashed #fbc02d;
  border-radius: 10px;
  padding: 6px 12px;
  margin-top: 4px;
}
.card-progress-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #795548;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-progress-val {
  font-size: 0.85rem;
  font-weight: 900;
  color: #b78103;
}

.card-footer-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.btn-curr-preview {
  background: #fdfaf3;
  border: 1.5px solid #dcd1be;
  border-radius: 14px;
  color: #5d4037;
  font-size: 0.95rem;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-curr-preview:hover {
  background: #fff8e7;
  border-color: #d4af37;
  color: #b78103;
  transform: translateY(-2px);
}

/* ==================== أنماط لوحة فحص وتوليد الأسئلة الأسبوعية ==================== */
.modal-audit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 5, 0.88);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.25s ease;
}
.modal-audit-overlay.hidden {
  display: none !important;
}

.modal-audit-card {
  background: #ffffff;
  border-radius: 24px;
  border: 4px solid var(--accent-gold);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-audit-header {
  background: linear-gradient(135deg, #1a237e, #0d47a1);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2.5px solid #c99632;
  color: #fff;
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.modal-audit-header h3 {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffca28;
  margin: 0;
}
.modal-badge-status {
  background: #2e7d32;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid #81c784;
}
.modal-badge-status.unapproved {
  background: #c62828;
  border-color: #ef9a9a;
}
.btn-close-modal {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  background: #c62828;
  transform: rotate(90deg);
}

.modal-toolbar {
  background: #fdfbf7;
  padding: 12px 24px;
  border-bottom: 1px solid #e0d5c1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.auditor-label {
  font-weight: 800;
  font-size: 0.85rem;
  color: #4e342e;
}
.audit-input {
  padding: 6px 12px;
  border: 1.5px solid #c99632;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  outline: none;
}
.audit-input:focus {
  border-color: #e65100;
  box-shadow: 0 0 0 2px rgba(230, 81, 0, 0.2);
}

.audit-tabs-row {
  display: flex;
  background: #efebe9;
  border-bottom: 2px solid #d7ccc8;
  padding: 4px 16px 0;
  gap: 8px;
}
.audit-tab {
  background: #d7ccc8;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 8px 18px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  color: #4e342e;
  cursor: pointer;
  transition: all 0.2s;
}
.audit-tab.active {
  background: #ffffff;
  color: #b71c1c;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
  border-top: 3px solid #b71c1c;
}

.audit-questions-list {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fbf9f5;
  max-height: 55vh;
}

.audit-q-card {
  background: #ffffff;
  border: 1.5px solid #d7ccc8;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.audit-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.audit-q-num {
  background: #ffecb3;
  color: #b78103;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
}
.audit-q-subject {
  font-weight: 800;
  font-size: 0.82rem;
  color: #2e7d32;
}
.audit-q-statement-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #b0bec5;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e1e1e;
  box-sizing: border-box;
}

.audit-options-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.audit-opt-box {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #cfd8dc;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fdfdfd;
}
.audit-opt-box.is-correct {
  border-color: #2e7d32;
  background: #e8f5e9;
}
.audit-radio {
  cursor: pointer;
}
.audit-opt-text {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  outline: none;
}
.audit-q-tip {
  font-size: 0.76rem;
  color: #78909c;
  margin: 0;
}

/* ==================== أنماط بطاقة تعريف التلميذ البطل ==================== */
.hero-id-card-modal {
  max-width: 530px !important;
  width: 94% !important;
  border-radius: 22px !important;
  border: 3px solid #d4af37 !important;
  outline: none !important; /* إزالة الخط المتقطع الذي كان يمر فوق الزر */
  box-shadow: 0 25px 60px rgba(0,0,0,0.7) !important;
  padding: 0 !important;
  overflow: visible !important;
  max-height: none !important;
}
.hero-id-header {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 2px solid #81c784 !important;
  border-radius: 19px 19px 0 0 !important;
  margin-bottom: 0 !important;
}
.hero-id-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-id-badge-icon {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 3px 6px;
  line-height: 1;
}
.hero-id-title-box h3 {
  color: #ffffff !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  margin: 0 !important;
}
.hero-id-sub {
  color: #c8e6c9 !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  margin: 2px 0 0 0 !important;
}
.hero-id-body {
  padding: 16px 20px 20px 20px !important;
  background: #ffffff !important;
  border-radius: 0 0 19px 19px !important;
  max-height: none !important;
  overflow: visible !important; /* إلغاء السكرول نهائياً */
  overflow-y: visible !important;
}

/* اختيار الشخصية الرمزية في صف مدمج واحد */
.form-section {
  margin-bottom: 12px;
}
.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: #2e7d32;
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.required-star {
  color: #d32f2f;
  font-weight: 900;
}
.avatar-selection-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.avatar-choice-btn {
  background: #f1f8e9;
  border: 1.5px solid #c5e1a5;
  border-radius: 10px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.avatar-choice-btn:hover {
  background: #dcedc8;
  border-color: #7cb342;
  transform: translateY(-2px);
}
.avatar-choice-btn.active {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid #2e7d32;
  box-shadow: 0 0 8px rgba(46, 125, 50, 0.35);
  transform: scale(1.04);
}
.avatar-chip-emoji {
  font-size: 1.45rem;
  line-height: 1;
}
.avatar-chip-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #33691e;
}

.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.hero-id-input, .hero-id-select {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  border: 1.5px solid #a5d6a7;
  border-radius: 10px;
  background: #ffffff;
  color: #1b5e20;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.hero-id-input:focus, .hero-id-select:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.hero-id-actions {
  margin-top: 16px;
  margin-bottom: 2px;
  text-align: center;
}
.btn-save-hero-card {
  width: 100%;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 900;
  border-radius: 12px;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}
.btn-save-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.55);
}

/* تعديلات ترويسة نافذة الشهادة */
.cert-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}
.cert-banner-badge {
  font-weight: 900;
  color: #8d4f00;
  font-size: 0.95rem;
}
.cert-banner-sub {
  font-size: 0.78rem;
  color: #6d4c41;
  font-weight: 700;
}
.cert-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-print-cert-action {
  background: linear-gradient(135deg, #f57f17 0%, #e65100 100%) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
}
.cert-child-origin {
  font-size: 1.05rem;
  color: #2e7d32;
  margin: 4px 0 10px 0;
  font-weight: 700;
}
.cert-child-origin b {
  color: #1b5e20;
  font-weight: 900;
}

/* ==================== أنماط الطباعة للشهادة الملكية ==================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #111111 !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* إخفاء كافة عناصر الصفحة تماماً */
  body > * {
    display: none !important;
    visibility: hidden !important;
  }

  /* إظهار وعزل نافذة الشهادة فقط */
  body > #modalCert {
    display: flex !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    border: none !important;
    inset: auto !important;
  }

  #modalCert * {
    visibility: visible !important;
  }

  .no-print,
  .cert-modal-header {
    display: none !important;
    visibility: hidden !important;
  }

  .cert-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
  }

  .royal-certificate {
    width: 100% !important;
    max-width: 960px !important;
    margin: 0 auto !important;
    background: #fffdf5 !important;
    border-radius: 16px !important;
    padding: 14px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-border-outer {
    border: 5px double #b37418 !important;
    background: #fffef8 !important;
    padding: 10px !important;
    border-radius: 12px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-border-inner {
    border: 2px solid #d4af37 !important;
    background: #ffffff !important;
    padding: 18px 24px !important;
    border-radius: 8px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-top-crest {
    margin-bottom: 8px !important;
  }

  .cert-top-crest h3 {
    font-size: 1.15rem !important;
    color: #1b5e20 !important;
  }

  .cert-top-crest p {
    font-size: 0.88rem !important;
    color: #795548 !important;
  }

  .cert-title {
    font-size: 2.35rem !important;
    margin: 6px 0 !important;
    color: #b37418 !important;
  }

  .cert-intro {
    font-size: 1.08rem !important;
    color: #37474f !important;
    margin: 4px 0 !important;
  }

  .cert-child-name {
    font-size: 2.7rem !important;
    color: #1a237e !important;
    padding: 4px 35px !important;
    margin: 6px auto !important;
    border-bottom: 2.5px solid #ffb300 !important;
  }

  .cert-child-origin {
    font-size: 1.05rem !important;
    color: #2e7d32 !important;
    margin: 4px 0 8px 0 !important;
  }

  .cert-body-text {
    font-size: 1.04rem !important;
    line-height: 1.68 !important;
    margin: 8px auto !important;
    max-width: 820px !important;
    color: #263238 !important;
  }

  .cert-stamps-row {
    margin-top: 14px !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  .golden-seal {
    width: 78px !important;
    height: 78px !important;
    background: radial-gradient(circle, #fff8e1 0%, #ffca28 60%, #b37418 100%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-footer-motto {
    font-size: 0.88rem !important;
    margin-top: 12px !important;
  }
}

/* التجاوب للشاشات الصغيرة */
@media (max-width: 860px) {
  .hero-showcase {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-quick-stats {
    justify-content: center;
  }
  .top-nav {
    justify-content: center;
  }
}

/* ==================== كروت مواقيت الصلاة في نافذة الولاية ==================== */
.prayer-times-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.prayer-time-card {
  background: #ffffff;
  border: 1.5px solid #c8e6c9;
  border-radius: 12px;
  padding: 10px 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.prayer-time-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.prayer-time-card.active-next {
  border: 2px solid #2e7d32;
  background: #e8f5e9;
  box-shadow: 0 0 10px rgba(46, 125, 50, 0.2);
}
.prayer-icon {
  font-size: 1.25rem;
}
.prayer-card-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #2e7d32;
}
.prayer-card-time {
  font-size: 0.95rem;
  font-weight: 900;
  color: #1b5e20;
  direction: ltr;
}

/* ==================== رقعة مخطوطة دعاء ما بعد الأذان التراثية الحقيقية ==================== */
.parchment-stage-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 14px;
  animation: parchment-fade-in 0.35s ease;
}

.parchment-stage-overlay.hidden {
  display: none !important;
}

@keyframes parchment-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* الرقعة الحقيقية المفتوحة المصممة كلياً بالصورة المرفقة ذات اللفائف الخشبية والورق القديم */
.parchment-real-scroll {
  position: relative;
  width: 580px;
  max-width: 95vw;
  height: 620px;
  max-height: 94vh;
  background-image: url('assets/parchment-open.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.8)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scroll-open-reveal 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  user-select: none;
}

@keyframes scroll-open-reveal {
  0% {
    opacity: 0;
    transform: scale(0.65) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ختم شمعي أحمر معتق للإغلاق على حافة اللفافة الخشبية */
.parchment-wax-seal-close {
  position: absolute;
  top: 18px;
  left: 32px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #b71c1c 0%, #7f0000 100%);
  border: 2px solid #ffd700;
  color: #fffdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transition: all 0.22s ease;
  z-index: 10;
}
.parchment-wax-seal-close:hover {
  transform: scale(1.12) rotate(90deg);
  background: radial-gradient(circle, #d32f2f 0%, #b71c1c 100%);
  box-shadow: 0 6px 16px rgba(183, 28, 28, 0.6);
}

/* المساحة الورقية الداخلية للمخطوطة الواقعة بين اللفافتين الخشبيتين والهوامش الممزقة */
.parchment-papyrus-content {
  position: absolute;
  top: 75px;
  bottom: 75px;
  left: 60px;
  right: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 6px 8px;
  box-sizing: border-box;
  overflow: hidden;
}

/* البسملة الشريفة */
.parchment-basmala {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #5d2e08;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* عنوان المخطوطة بخط إسلامي عريق */
.parchment-calligraphy-title {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  font-size: 1.65rem;
  font-weight: 900;
  color: #3b1702;
  margin: 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
}

.parchment-hadith-intro {
  font-family: 'Amiri', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #6b3509;
  margin-top: -2px;
}

/* متن الدعاء الشريف بالخط الإسلامي الكلاسيكي والتشكيل الكامل الفاخر */
.parchment-sacred-text {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.38rem;
  line-height: 1.95;
  font-weight: 900;
  color: #1f0b00;
  text-shadow: 0 1px 1px rgba(255, 245, 225, 0.85);
  letter-spacing: 0.4px;
  padding: 2px 4px;
}

.parchment-sacred-highlight {
  color: #8c4200;
  text-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

.parchment-sacred-divider {
  color: #8c4e12;
  font-size: 0.85rem;
  letter-spacing: 3px;
  opacity: 0.85;
}

/* فضل الحديث الشريف */
.parchment-hadith-virtue {
  font-family: 'Amiri', serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #1b5e20;
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.parchment-bukhari-tag {
  font-size: 0.82rem;
  color: #6d4c41;
  font-weight: 700;
}

/* أزرار المخطوطة التراثية كأختام شمعية وأشرطة بردي */
.parchment-vintage-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.parchment-stamp-btn {
  background: rgba(245, 222, 179, 0.4);
  border: 1.5px solid #8c4e12;
  border-radius: 999px;
  color: #4a2103;
  font-family: 'Amiri', 'Cairo', serif;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 5px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(90, 40, 5, 0.15);
  transition: all 0.2s ease;
}
.parchment-stamp-btn:hover {
  background: rgba(245, 222, 179, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(90, 40, 5, 0.25);
}

.parchment-stamp-btn.stamp-confirm {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  border-color: #1b5e20;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(27, 94, 32, 0.4);
}
.parchment-stamp-btn.stamp-confirm:hover {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(27, 94, 32, 0.5);
}

/* التجاوب للشاشات المتوسطة والصغيرة */
@media (max-width: 600px) {
  .parchment-real-scroll {
    width: 96vw;
    height: 98vw;
    max-height: 90vh;
  }
  .parchment-papyrus-content {
    top: 52px;
    bottom: 52px;
    left: 42px;
    right: 42px;
  }
  .parchment-calligraphy-title {
    font-size: 1.35rem;
  }
  .parchment-sacred-text {
    font-size: 1.15rem;
    line-height: 1.8;
  }
  .parchment-hadith-virtue {
    font-size: 0.95rem;
  }
}

/* ==================== رقعة كلمات الأذان المتزامنة المزخرفة ==================== */
.adhan-stage-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  padding: 14px;
  animation: parchment-fade-in 0.35s ease;
}

.adhan-stage-overlay.hidden {
  display: none !important;
}

.adhan-ornate-scroll {
  position: relative;
  width: 860px;
  max-width: 96vw;
  height: 430px;
  max-height: 88vh;
  background-image: url('assets/adhan-scroll.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 35px rgba(212, 175, 55, 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: adhan-scroll-reveal 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  user-select: none;
}

@keyframes adhan-scroll-reveal {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.adhan-scroll-inner {
  position: absolute;
  top: 48px;
  bottom: 48px;
  left: 95px;
  right: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.adhan-scroll-header {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1b5e20;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 22px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.adhan-header-icon {
  font-size: 1.25rem;
}

.adhan-phrase-display {
  font-family: 'Aref Ruqaa', 'Amiri', 'Traditional Arabic', serif;
  font-size: 3.15rem;
  font-weight: 900;
  color: #240e01;
  text-shadow: 0 2px 3px rgba(255, 248, 220, 0.95), 0 0 25px rgba(255, 215, 0, 0.35);
  letter-spacing: 0.8px;
  line-height: 1.35;
  margin: 2px 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.adhan-phrase-display.phrase-bounce {
  animation: phrase-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

@keyframes phrase-pop {
  0% { transform: scale(0.88); opacity: 0.5; color: #8c4200; }
  50% { transform: scale(1.06); color: #d84315; }
  100% { transform: scale(1); opacity: 1; color: #240e01; }
}

.adhan-child-guidance {
  font-family: 'Amiri', 'Cairo', serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #8c4200;
  background: rgba(255, 248, 225, 0.82);
  padding: 6px 26px;
  border-radius: 12px;
  border: 1.5px dashed #d4af37;
  box-shadow: 0 2px 8px rgba(140, 66, 0, 0.1);
  transition: all 0.3s;
}

.adhan-pulse-footer {
  font-size: 0.92rem;
  font-weight: 800;
  color: #6d4c41;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}
.adhan-equalizer-icon {
  font-size: 1.15rem;
  animation: speaker-pulse 1s infinite alternate;
}

@media (max-width: 600px) {
  .adhan-ornate-scroll {
    width: 98vw;
    height: calc(98vw / 2);
  }
  .adhan-scroll-inner {
    top: 12%;
    bottom: 12%;
    left: 11%;
    right: 11%;
  }
  .adhan-scroll-header {
    font-size: 0.82rem;
    padding: 2px 10px;
  }
  .adhan-phrase-display {
    font-size: 1.65rem;
  }
  .adhan-child-guidance {
    font-size: 0.95rem;
    padding: 3px 10px;
  }
  .adhan-pulse-footer {
    font-size: 0.72rem;
  }
}

/* ==================== تذييل المنصة الرسمي (NDZn Automation) ==================== */
.portal-main-footer {
  width: 100%;
  max-width: 1300px;
  margin: 35px auto 40px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.footer-inner-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 2px solid #e0d2b4;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(36, 26, 17, 0.08), 0 2px 6px rgba(36, 26, 17, 0.04);
  padding: 24px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-inner-card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 19px;
  border: 1.5px dashed rgba(197, 160, 89, 0.45);
  pointer-events: none;
}

.footer-top-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-brand-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #fff;
  padding: 8px 26px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-brand-icon {
  font-size: 1.25rem;
  color: #ffca28;
}

.footer-brand-name {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.footer-brand-desc {
  font-family: 'Cairo', 'Amiri', sans-serif;
  font-size: 0.95rem;
  color: #5c4328;
  margin: 4px 0 0 0;
  line-height: 1.5;
}

.footer-divider-vintage {
  color: #c5a059;
  font-size: 0.95rem;
  margin: 12px 0;
  letter-spacing: 2px;
  opacity: 0.8;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
}

.footer-copyright {
  font-family: 'Cairo', 'Amiri', sans-serif;
  font-size: 0.92rem;
  color: #3e2723;
  font-weight: 700;
}

.footer-copyright strong {
  color: #1b4332;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  font-weight: 800;
}

.footer-pills-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.f-pill {
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 14px;
  background: #fdfbf7;
  border: 1px solid #d8caa7;
  border-radius: 999px;
  color: #4a2810;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
  .footer-bottom-row {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
  .footer-pills-row {
    justify-content: center;
  }
}
