/* ═══════════════════════════════════════════════════════
   مسابقة البيئة المستدامة — تصميم احترافي
   كلية الآداب، جامعة تكريت
═══════════════════════════════════════════════════════ */

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

/* ── المتغيرات ──────────────────────────── */
:root {
  /* الألوان الرئيسية */
  --c-forest:   #0d3d26;
  --c-green:    #166639;
  --c-mid:      #1f8a4c;
  --c-accent:   #28b463;
  --c-mint:     #a8e6c3;
  --c-lime:     #d4f5a0;

  /* الخلفيات */
  --bg-page:    #f0f4f2;
  --bg-card:    #ffffff;
  --bg-sub:     #f7faf8;
  --bg-dim:     #eef4f0;

  /* النصوص */
  --tx-dark:    #0d2118;
  --tx-body:    #1e3a2b;
  --tx-muted:   #4d7260;
  --tx-hint:    #7fa893;

  /* الحدود */
  --bd-light:   #d6e9dd;
  --bd-mid:     #b8d6c4;

  /* الذهبي للجوائز */
  --gold:       #b8860b;
  --gold-bg:    #fdf6e0;
  --gold-bd:    #f0d070;

  /* الخطر والتحذير */
  --danger-bg:  #fff1f1;
  --danger-bd:  #f5b8b8;
  --danger-tx:  #9b2020;
  --warn-bg:    #fffbeb;
  --warn-bd:    #f0d878;
  --warn-tx:    #8a6200;

  /* الأبعاد */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  16px;
  --r-lg:  22px;
  --r-xl:  30px;
  --r-2xl: 40px;

  /* الظلال */
  --sh-xs:  0 1px 4px rgba(13,61,38,.08);
  --sh-sm:  0 2px 10px rgba(13,61,38,.10);
  --sh-md:  0 6px 24px rgba(13,61,38,.12);
  --sh-lg:  0 16px 48px rgba(13,61,38,.14);
}

/* ── الأساسيات ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--tx-body);
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(40,180,99,.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(22,102,57,.07) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23166639' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Backdrop — لا يؤثر في التخطيط */
.page-backdrop { display: none; }

/* ── هيكل الصفحة ────────────────────────── */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── الشريط العلوي ──────────────────────── */
.topbar {
  width: 100%;
  background: var(--c-forest);
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 200;
  border-radius: 0;
  margin-top: 0;
  padding: 0;
}

.topbar > * { /* داخل topbar */
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
}

/* العلامة التجارية */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.07);
  padding: 6px;
  flex-shrink: 0;
}
.brand-copy { min-width: 0; }
.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(168,230,195,.12);
  border: 1px solid rgba(168,230,195,.22);
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-mint);
  margin-bottom: 4px;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-subtitle {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-top: 1px;
}

/* التنقل */
.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav a {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
}
.topnav a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.12);
}

/* ── محتوى الصفحة ───────────────────────── */
.page-content {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
  margin-top: 32px;
  margin-bottom: 48px;
  flex: 1;
}

/* ── بطاقات عامة ────────────────────────── */
.hero-card,
.panel,
.quiz-shell,
.question-panel,
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  position: relative;
  overflow: hidden;
}

/* شريط أخضر علوي للبطاقات */
.hero-card::after,
.panel::after,
.result-card.main::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-forest), var(--c-accent));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

/* ── الصفحة الرئيسية — Hero ─────────────── */
.hero-home {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0;
  padding: 0;
  min-height: 520px;
}

/* القسم البصري */
.hero-visual {
  background:
    linear-gradient(145deg, var(--c-forest) 0%, var(--c-green) 55%, #1e7a3e 100%);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px;
  overflow: hidden;
  min-height: 460px;
}
.hero-visual::before {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.1);
  top: -80px;
  right: -80px;
}
.hero-visual::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,230,195,.12), transparent 70%);
  bottom: -40px;
  left: 20px;
}

.hero-rings span { display: none; }

.hero-emblem-card {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  text-align: center;
  backdrop-filter: blur(8px);
  width: min(100%, 320px);
}
.hero-logo {
  width: 110px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.3));
}
.hero-emblem-text span {
  display: block;
  font-size: .88rem;
  color: rgba(255,255,255,.65);
}
.hero-emblem-text strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin: 6px 0;
}
.hero-emblem-text small {
  display: block;
  font-size: .82rem;
  color: var(--c-mint);
  font-weight: 500;
}

/* قسم المحتوى */
.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 36px;
  position: relative;
  z-index: 1;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-dim);
  border: 1px solid var(--bd-mid);
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-green);
  margin-bottom: 16px;
  width: fit-content;
}
.hero-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
  display: block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.85); }
}

.hero-content h1,
.result-card h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 900;
  color: var(--c-forest);
  line-height: 1.25;
  margin: 0 0 12px;
}

.lead {
  font-size: .96rem;
  color: var(--tx-muted);
  line-height: 1.9;
  margin: 0 0 24px;
}
.lead strong {
  color: var(--c-green);
  font-weight: 700;
}

/* بطاقات الإحصاء */
.hero-grid,
.result-grid,
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--bg-dim);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  transition: box-shadow .2s, border-color .2s;
}
.stat-card:hover {
  box-shadow: var(--sh-sm);
  border-color: var(--bd-mid);
}
.stat-value,
.result-stat .number {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--c-forest);
  line-height: 1;
}
.stat-label,
.result-stat .label {
  font-size: .78rem;
  color: var(--tx-muted);
  line-height: 1.5;
}

/* ── الألواح العامة ──────────────────────── */
.panel {
  padding: 28px 32px;
  margin-top: 24px;
}
.panel.compact { padding: 24px 28px; }

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--c-forest);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--c-accent);
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
}

/* ── ملخص — لماذا المنصة ─────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.summary-card {
  background: var(--bg-sub);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 22px 18px;
  transition: box-shadow .2s, transform .2s;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.summary-card strong {
  display: block;
  font-size: .95rem;
  font-weight: 800;
  color: var(--c-forest);
  margin-bottom: 7px;
}
.summary-card p {
  font-size: .86rem;
  color: var(--tx-muted);
  line-height: 1.75;
  margin: 0;
}

/* ── شبكة آلية الفوز + نموذج الدخول ────── */
.home-grid,
.entry-section {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 22px;
  margin-top: 0;
}

.entry-panel { order: 1; }
.official-side-panel {
  order: 2;
  background: linear-gradient(160deg, #f3fbf6 0%, #edf5ef 100%);
  border-color: var(--bd-mid);
}

/* قائمة القواعد */
.official-list.featured-list {
  padding-right: 0;
  margin: 0;
  list-style: none;
}
.official-list.featured-list li {
  font-size: .88rem;
  color: var(--tx-muted);
  padding: 8px 0;
  border-bottom: 1px dashed var(--bd-light);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.7;
}
.official-list.featured-list li:last-child { border-bottom: none; padding-bottom: 0; }
.official-list.featured-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
  margin-top: 7px;
  flex-shrink: 0;
}
.official-list.featured-list li strong { color: var(--c-forest); font-weight: 700; }

/* بطاقات صغيرة */
.mini-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 20px;
}
.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 14px 10px;
  text-align: center;
}
.mini-card span {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--c-green);
}
.mini-card small {
  font-size: .74rem;
  color: var(--tx-hint);
}

/* ── نموذج الدخول ───────────────────────── */
.entry-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--tx-body);
}
.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--bd-light);
  border-radius: var(--r-sm);
  background: var(--bg-sub);
  color: var(--tx-dark);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-group input::placeholder { color: var(--tx-hint); }
.form-group input:focus {
  border-color: var(--c-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40,180,99,.1);
}

/* صندوق التنبيه */
.agreement-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: .83rem;
  color: var(--warn-tx);
  line-height: 1.7;
}
.agreement-box strong { font-weight: 800; color: #6b4c00; }

/* التنبيهات */
.alert {
  border-radius: var(--r-sm);
  padding: 12px 15px;
  font-size: .86rem;
  line-height: 1.7;
  border: 1px solid;
}
.alert-warning {
  background: var(--warn-bg);
  border-color: var(--warn-bd);
  color: var(--warn-tx);
}
.alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bd);
  color: var(--danger-tx);
}

/* ── الأزرار ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 24px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  gap: 8px;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-green), var(--c-mid));
  color: #fff;
  box-shadow: 0 4px 18px rgba(22,102,57,.3);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(22,102,57,.38); }

.btn-secondary {
  background: var(--bg-dim);
  border: 1.5px solid var(--bd-mid);
  color: var(--c-forest);
}
.btn-secondary:hover { background: var(--bg-card); }

.btn-lg { width: 100%; font-size: 1rem; min-height: 52px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ── ميزات سريعة ────────────────────────── */
.features-panel { margin-top: 24px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}
.info-block {
  background: var(--bg-sub);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 16px;
}
.info-block strong {
  display: block;
  font-size: .88rem;
  font-weight: 800;
  color: var(--c-forest);
  margin-bottom: 6px;
}
.info-block span {
  font-size: .82rem;
  color: var(--tx-muted);
  line-height: 1.7;
}

/* ── صفحة المسابقة ──────────────────────── */
.quiz-shell {
  padding: 26px 30px;
  border-radius: var(--r-xl);
}
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bd-light);
}
.muted-label {
  font-size: .78rem;
  color: var(--tx-hint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.participant-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--c-forest);
  margin-top: 3px;
}
.quiz-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.metric {
  background: var(--bg-dim);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 12px 18px;
  min-width: 150px;
  text-align: center;
}
.metric span {
  display: block;
  font-size: .75rem;
  color: var(--tx-hint);
  font-weight: 600;
  margin-bottom: 4px;
}
.metric strong {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--c-forest);
}
.metric-timer strong {
  color: var(--c-green);
  font-size: 1.3rem;
}

/* شريط التقدم */
.progress-track {
  height: 8px;
  background: var(--bg-dim);
  border-radius: 999px;
  overflow: hidden;
  margin: 22px 0 26px;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c-forest), var(--c-accent));
  transition: width .4s ease;
}

/* لوحة السؤال */
.question-panel {
  padding: 28px;
  background: var(--bg-sub);
  border-radius: var(--r-lg);
  border-color: var(--bd-light);
  box-shadow: var(--sh-xs);
}
.question-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg-dim);
  border: 1px solid var(--bd-mid);
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-green);
  margin-bottom: 14px;
}
.question-title {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--tx-dark);
  line-height: 1.7;
  margin: 0 0 22px;
}
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--bd-light);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s, transform .15s;
  min-height: 80px;
}
.option-card:hover {
  border-color: var(--c-mint);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.option-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.option-card:has(input:checked) {
  border-color: var(--c-accent);
  background: linear-gradient(135deg, #f0faf4, #e8f8ef);
  box-shadow: 0 0 0 3px rgba(40,180,99,.15);
}
.option-badge {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-xs);
  background: var(--bg-dim);
  border: 1px solid var(--bd-mid);
  display: grid;
  place-items: center;
  font-size: .88rem;
  font-weight: 900;
  color: var(--c-green);
}
.option-card:has(input:checked) .option-badge {
  background: var(--c-accent);
  border-color: var(--c-mid);
  color: #fff;
}
.option-text {
  font-size: .9rem;
  color: var(--tx-body);
  line-height: 1.7;
  padding-top: 7px;
}
.quiz-actions { margin-top: 22px; }

/* ── صفحة النتيجة ───────────────────────── */
.result-hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
}
.result-card { padding: 28px 32px; }
.result-card.main {
  background: linear-gradient(160deg, #f5fbf7, var(--bg-card));
}
.result-tag,
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e8f8ef;
  border: 1px solid var(--c-mint);
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-green);
  margin-bottom: 14px;
}
.result-stat {
  background: var(--bg-dim);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-align: center;
}
.result-stat:first-child .number { color: var(--gold); }
.result-card.side .info-block {
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--bg-sub);
}
.result-card.side .info-block:last-child { margin-bottom: 0; }
.result-card.side .info-block strong {
  font-size: .8rem;
  color: var(--tx-hint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.result-card.side .info-block span {
  font-size: .93rem;
  color: var(--tx-dark);
  font-weight: 600;
}

/* ── لوحة الصدارة ───────────────────────── */
.page-banner {
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.page-banner h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--c-forest);
  margin: 8px 0 8px;
}
.page-banner p {
  font-size: .88rem;
  color: var(--tx-muted);
  margin: 0;
}
.banner-badge {
  background: linear-gradient(135deg, var(--c-forest), var(--c-green));
  border-radius: var(--r-md);
  padding: 16px 22px;
  text-align: center;
  min-width: 130px;
  flex-shrink: 0;
  box-shadow: var(--sh-sm);
}
.banner-badge strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.banner-badge span {
  font-size: .78rem;
  color: var(--c-mint);
  margin-top: 4px;
  display: block;
}

/* جدول الصدارة */
.table-note {
  background: var(--bg-dim);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-sm);
  padding: 11px 15px;
  font-size: .84rem;
  color: var(--tx-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}
.table-note strong { color: var(--c-forest); font-weight: 700; }

.leaderboard-table-wrap {
  overflow: auto;
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
}
.leaderboard-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: .88rem;
}
.leaderboard-table th {
  background: var(--c-forest);
  color: #fff;
  font-weight: 700;
  padding: 13px 14px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: .8rem;
  letter-spacing: .02em;
}
.leaderboard-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--bd-light);
  color: var(--tx-body);
  vertical-align: middle;
}
.leaderboard-table tbody tr:hover td { background: var(--bg-dim); }
.leaderboard-table tbody tr:first-child td {
  background: var(--gold-bg);
  font-weight: 700;
}
.leaderboard-table tbody tr:first-child td strong { color: var(--gold); font-size: 1rem; }
.leaderboard-table tbody tr:nth-child(2) td { background: #f9f9f9; }
.leaderboard-table tbody tr:nth-child(3) td { background: #faf7f4; }

/* حالة الفراغ */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--tx-hint);
  font-size: .9rem;
}

/* ── صفحة عن المسابقة ───────────────────── */
.prose p {
  font-size: .92rem;
  color: var(--tx-muted);
  line-height: 1.9;
  margin: 0 0 14px;
}
.section-text {
  font-size: .9rem;
  color: var(--tx-muted);
  line-height: 1.9;
  margin-top: 0;
}

/* ── لوحة الإدارة ───────────────────────── */
.admin-login {
  max-width: 520px;
  margin-inline: auto;
}

/* ── التذييل ────────────────────────────── */
.footer {
  background: var(--c-forest);
  color: rgba(255,255,255,.6);
  width: 100%;
  margin-bottom: 0;
  padding: 20px 0;
  border-top: none;
  border-radius: 0;
}
.footer > * {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand img {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  padding: 5px;
}
.footer-brand strong {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}
.footer-brand span {
  display: block;
  font-size: .76rem;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}
.footer-meta { text-align: start; }
.footer-meta span {
  display: block;
  font-size: .77rem;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 1100px) {
  .hero-home { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { border-radius: var(--r-xl) var(--r-xl) 0 0; min-height: 300px; }
  .hero-content { padding: 32px 28px; }
}

@media (max-width: 860px) {
  .hero-home,
  .home-grid,
  .entry-section,
  .result-hero { grid-template-columns: 1fr !important; }
  .hero-grid,
  .result-grid,
  .summary-grid,
  .feature-grid { grid-template-columns: 1fr 1fr !important; }
  .topbar > *, .footer > * { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 0; }
  .topnav { justify-content: center; }
  .options-grid { grid-template-columns: 1fr !important; }
  .mini-cards { grid-template-columns: 1fr 1fr 1fr; }
  .page-banner { flex-direction: column; align-items: flex-start; }
  .quiz-topbar { flex-direction: column; align-items: flex-start; }
  .result-card.side { order: -1; }
}

@media (max-width: 600px) {
  .page-content { width: calc(100% - 24px); }
  .topbar > *, .footer > * { width: calc(100% - 24px); }
  .hero-grid,
  .result-grid,
  .summary-grid,
  .feature-grid { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .mini-cards { grid-template-columns: 1fr 1fr; }
  .panel, .quiz-shell, .result-card { padding: 20px; border-radius: var(--r-lg); }
  .hero-visual { padding: 28px; min-height: 240px; }
  .hero-content { padding: 22px; }
  .quiz-metrics { width: 100%; }
  .metric { min-width: 0; flex: 1; }
  .leaderboard-table-wrap { border-radius: var(--r-sm); }
}

/* ── إضافات لوحة الإدارة ───────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-toolbar-wrap {
  flex-wrap: wrap;
}
.inline-form {
  display: inline-flex;
  margin: 0;
}
.admin-search-form .form-row {
  align-items: end;
}
.admin-search-actions {
  max-width: 180px;
}
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: none;
  border-radius: var(--r-sm);
  background: #b42318;
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(180, 35, 24, .18);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(180, 35, 24, .22);
}
.table-link,
.btn-link {
  color: var(--c-forest);
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: .88rem;
}
.btn-link-danger {
  color: #b42318;
}
.admin-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.answers-list {
  display: grid;
  gap: 18px;
}
.answer-card {
  border: 1px solid var(--bd-light);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.94);
  padding: 20px;
  box-shadow: var(--sh-xs);
}
.answer-card.is-correct {
  border-color: rgba(22, 102, 57, .25);
}
.answer-card.is-wrong {
  border-color: rgba(180, 35, 24, .22);
}
.answer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.answer-question {
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--tx-body);
}
.answer-status {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}
.answer-status.ok {
  background: rgba(22, 102, 57, .10);
  color: var(--c-forest);
}
.answer-status.bad {
  background: rgba(180, 35, 24, .10);
  color: #b42318;
}
.answer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.answer-meta-item {
  background: var(--bg-dim);
  border: 1px solid var(--bd-light);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.answer-meta-item strong,
.answer-meta-item span {
  display: block;
}
.answer-meta-item strong {
  color: var(--tx-muted);
  font-size: .82rem;
  margin-bottom: 5px;
}
.answer-meta-item span {
  color: var(--tx-body);
  font-weight: 700;
}
.compact-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.static-option {
  cursor: default;
}
.option-correct {
  border-color: rgba(22, 102, 57, .28);
  box-shadow: inset 0 0 0 1px rgba(22, 102, 57, .12);
}
.option-selected {
  background: rgba(214, 166, 33, .10);
}
@media (max-width: 860px) {
  .answer-card-top {
    flex-direction: column;
  }
  .answer-meta-grid,
  .compact-options {
    grid-template-columns: 1fr;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-form {
    display: flex;
  }
}


/* ── وضع التطبيق للهاتف / PWA ───────────────────── */
html, body {
  overscroll-behavior-y: none;
}
body {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}
.install-app-btn {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 250;
  border: none;
  border-radius: 18px;
  min-height: 52px;
  background: linear-gradient(135deg, var(--c-forest), var(--c-accent));
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 18px 40px rgba(13,61,38,.22);
}
.mobile-app-nav {
  display: none;
}
@media (max-width: 860px) {
  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .topbar {
    position: sticky;
    top: 0;
    padding-top: env(safe-area-inset-top);
  }
  .topbar > * {
    width: min(100%, calc(100% - 24px));
    padding: 10px 0;
  }
  .brand-logo {
    width: 46px;
    height: 46px;
  }
  .brand-title {
    font-size: 1rem;
    white-space: normal;
    line-height: 1.4;
  }
  .brand-subtitle,
  .topnav {
    display: none;
  }
  .page-content {
    width: min(100%, calc(100% - 20px));
    margin-top: 18px;
    margin-bottom: 22px;
  }
  .hero-card,
  .panel,
  .quiz-shell,
  .question-panel,
  .result-card {
    border-radius: 24px;
  }
  .hero-home {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-visual {
    min-height: 240px;
    border-radius: 24px 24px 0 0;
    padding: 22px;
  }
  .hero-content {
    padding: 22px 18px 24px;
  }
  .hero-content h1 {
    font-size: 1.9rem;
    line-height: 1.35;
  }
  .lead {
    font-size: .98rem;
  }
  .hero-grid,
  .summary-grid,
  .home-grid,
  .feature-grid,
  .form-row,
  .quiz-topbar,
  .quiz-metrics,
  .options-grid,
  .footer {
    grid-template-columns: 1fr !important;
    flex-direction: column;
  }
  .entry-panel,
  .official-side-panel,
  .question-panel,
  .answer-card,
  .result-card,
  .panel.compact {
    padding: 18px;
  }
  .option-card {
    min-height: 76px;
    padding: 14px 14px 14px 12px;
  }
  .option-badge {
    width: 38px;
    height: 38px;
    font-size: .98rem;
  }
  .btn,
  .btn-lg,
  button,
  input,
  select,
  textarea {
    min-height: 50px;
    font-size: 16px;
  }
  .mobile-app-nav {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 240;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(13,61,38,.10);
    box-shadow: 0 -8px 30px rgba(13,61,38,.08);
  }
  .mobile-app-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    text-align: center;
    border-radius: 14px;
    color: var(--tx-body);
    font-weight: 800;
    font-size: .86rem;
    background: #f4f8f5;
    border: 1px solid rgba(13,61,38,.07);
  }
  .footer {
    padding-bottom: 8px;
  }
}
@media (display-mode: standalone) {
  body {
    background-image:
      radial-gradient(circle at 15% 20%, rgba(40,180,99,.06) 0%, transparent 45%),
      radial-gradient(circle at 85% 80%, rgba(22,102,57,.07) 0%, transparent 45%);
  }
  .topbar {
    padding-top: env(safe-area-inset-top);
  }
}
