/* قوّي عقلك — نظام ألوان موحّد ونظيف
   هذا الملف يُحمّل أخيراً حتى يمنع تعارض القواعد القديمة. */
:root {
  --q-bg: #172b43;
  --q-bg-deep: #101d31;
  --q-surface: #203752;
  --q-surface-2: #294564;
  --q-card: #f3f6f4;
  --q-card-blue: #e7f0f4;
  --q-card-gold: #fff2d6;
  --q-card-lilac: #eeeafd;
  --q-card-mint: #e4f5ef;
  --q-ink: #17314e;
  --q-ink-soft: #52677b;
  --q-white: #fff;
  --q-soft-white: #eaf1f5;
  --q-gold: #e2b65f;
  --q-gold-deep: #a9782e;
  --q-coral: #ef725f;
  --q-coral-deep: #b94e43;
  --q-line: rgba(255,255,255,.16);
}

html, body { background: var(--q-bg) !important; color: var(--q-soft-white) !important; }
body { background: radial-gradient(circle at 50% 0%, #2a4965 0%, var(--q-bg) 42%, var(--q-bg-deep) 100%) fixed !important; }
.ambient-one { background: #7ca3bb !important; opacity: .08 !important; }
.ambient-two { background: var(--q-gold) !important; opacity: .05 !important; }

/* الهيدر */
.site-header { background: transparent !important; border-bottom: 1px solid var(--q-line) !important; }
.brand, .brand strong { color: var(--q-white) !important; }
.brand small { color: #cbd8e3 !important; }
.brand-logo { box-shadow: 5px 5px 0 rgba(226,182,95,.9) !important; }
.theme-toggle { background: rgba(255,255,255,.1) !important; color: var(--q-white) !important; border-color: var(--q-line) !important; }
.menu-toggle { background: #eef2f4 !important; border-color: rgba(23,49,78,.15) !important; }
.menu-toggle span { background: var(--q-ink) !important; }

/* القائمة الجانبية */
.menu-backdrop { background: rgba(5,12,23,.62) !important; }
.site-menu { background: #f4f6f4 !important; color: var(--q-ink) !important; border-left: 1px solid rgba(23,49,78,.12) !important; box-shadow: -20px 0 60px rgba(0,0,0,.28) !important; }
.site-menu-head { border-bottom-color: rgba(23,49,78,.13) !important; }
.site-menu-head .eyebrow, .menu-group > small { color: var(--q-gold-deep) !important; }
.site-menu-head strong { color: var(--q-ink) !important; line-height: 1.45 !important; }
.menu-close { background: #e8eef2 !important; color: var(--q-ink) !important; }
.site-menu-links { gap: 16px !important; }
.site-menu-links button, .site-menu-links a { color: var(--q-ink) !important; min-height: 54px !important; line-height: 1.55 !important; }
.site-menu-links button:hover, .site-menu-links a:hover { background: #e8eef2 !important; }
.site-menu-links span { color: var(--q-gold-deep) !important; }
.site-menu-foot { color: var(--q-ink-soft) !important; border-top-color: rgba(23,49,78,.13) !important; }

/* بداية الرئيسية */
.page-shell { padding-top: 34px !important; }
.hero-grid { display: block !important; padding: 18px 0 48px !important; }
.hero-copy { max-width: 760px !important; margin: 0 auto !important; padding: 0 !important; direction: rtl !important; text-align: center !important; }
.hero-badge { display: inline-flex !important; color: var(--q-gold) !important; background: rgba(16,29,49,.58) !important; border-color: rgba(226,182,95,.72) !important; line-height: 1.5 !important; }
.hero-copy h1 { margin: 28px auto 18px !important; max-width: 640px !important; color: var(--q-white) !important; font-size: clamp(34px, 8vw, 54px) !important; line-height: 1.5 !important; letter-spacing: 0 !important; }
.hero-copy h1 em { color: var(--q-gold) !important; background: none !important; -webkit-background-clip: initial !important; background-clip: initial !important; }
.hero-copy > p { max-width: 700px !important; margin: 0 auto 25px !important; color: #d6e1e9 !important; font-size: clamp(16px, 3vw, 20px) !important; line-height: 1.95 !important; }
.hero-art { display: none !important; }
.hero-actions { max-width: 620px !important; gap: 13px !important; margin: 0 auto 26px !important; }
.hero-action, .hero-action-daily, .hero-action-play, .hero-action-friends { min-height: 64px !important; background: linear-gradient(180deg, #f58b75, var(--q-coral)) !important; border-color: var(--q-coral-deep) !important; color: var(--q-white) !important; box-shadow: inset 0 -7px 0 rgba(126,35,37,.22), 0 7px 0 rgba(0,0,0,.2) !important; line-height: 1.45 !important; }
.hero-action small { color: #fff8f3 !important; line-height: 1.4 !important; }
.hero-proof { justify-content: center !important; align-items: stretch !important; gap: 12px !important; margin-top: 24px !important; }
.hero-proof span { min-width: 88px !important; padding: 11px 15px !important; border: 1px solid rgba(226,182,95,.32) !important; border-radius: 18px !important; background: rgba(16,29,49,.72) !important; color: var(--q-soft-white) !important; }
.hero-proof span b { display: block !important; color: var(--q-gold) !important; font-size: 26px !important; line-height: 1.15 !important; }
.hero-proof span small { display: block !important; color: #d7e2eb !important; font-size: 13px !important; margin-top: 4px !important; line-height: 1.45 !important; }

/* بطاقة التعريف */
.intro-card { background: linear-gradient(145deg, #263e5b, #1b2e49) !important; border: 1px solid rgba(226,182,95,.25) !important; box-shadow: 0 20px 55px rgba(0,0,0,.22) !important; }
.intro-card h2 { color: var(--q-white) !important; line-height: 1.45 !important; }
.intro-card p { color: #d6e1e9 !important; line-height: 1.95 !important; }
.intro-points span { background: rgba(255,255,255,.08) !important; border: 1px solid rgba(255,255,255,.14) !important; color: #f3f6f8 !important; line-height: 1.5 !important; }
.intro-points b { background: var(--q-gold) !important; color: var(--q-ink) !important; }

/* عناوين الأقسام */
.section-heading h2, .modes-section h2, .game-panel-heading h2 { color: var(--q-white) !important; line-height: 1.5 !important; }
.section-note, .audience-note, .game-local-note { color: #d2dee8 !important; }

/* بطاقات الأقسام ذات الخلفيات الفاتحة: نص داكن واضح */
.category-card { color: var(--q-ink) !important; }
.category-card h3 { color: var(--q-ink) !important; line-height: 1.45 !important; }
.category-card p { color: var(--q-ink-soft) !important; line-height: 1.6 !important; }
.category-card .card-footer, .category-card .card-arrow { color: var(--q-ink) !important; }
.more-content-button { background: var(--q-surface) !important; color: var(--q-white) !important; border-color: rgba(226,182,95,.34) !important; box-shadow: 0 5px 0 rgba(0,0,0,.16) !important; }
.more-content-button span { color: var(--q-gold) !important; }

/* الألعاب ذات الخلفيات الفاتحة: نص داكن واضح */
.mode-card { color: var(--q-ink) !important; border-color: rgba(23,49,78,.14) !important; }
.mode-card strong { color: var(--q-ink) !important; line-height: 1.45 !important; }
.mode-card small { color: var(--q-ink-soft) !important; line-height: 1.5 !important; }
.mode-card b, .mode-card .mode-icon { color: var(--q-ink) !important; }
.difficulty-picker { color: var(--q-white) !important; }
.difficulty-button { background: rgba(255,255,255,.1) !important; color: var(--q-white) !important; border-color: var(--q-line) !important; }
.difficulty-button.active { background: var(--q-coral) !important; border-color: var(--q-coral-deep) !important; color: var(--q-white) !important; }

/* البطاقات الداكنة والتذييل */
.game-panel, .account-box, .home-note { background: rgba(20,36,57,.82) !important; color: var(--q-white) !important; border-color: rgba(255,255,255,.13) !important; }
.game-panel p, .account-box p, .home-note p { color: #d5e1ea !important; line-height: 1.85 !important; }
.home-note strong { color: var(--q-gold) !important; }
.site-footer { color: #c1cfdb !important; border-top-color: rgba(255,255,255,.14) !important; }

/* الصفحات الداخلية: كل خيار يظهر وحده بدون خلطه مع الرئيسية */
.home-page-mode .hero-grid,
.home-page-mode .home-note,
.home-page-mode .home-intro-panel,
.home-page-mode .home-tab-panel:not(.page-active) { display: none !important; }
.home-page-mode .home-tab-panel.page-active { display: block !important; margin-top: 0 !important; }
.home-page-mode .section-heading { margin-top: 10px; }
.home-page-mode .page-active > .game-panel:first-child,
.home-page-mode .page-active > .section-heading:first-child { margin-top: 0 !important; }

/* الشاشات الداخلية والأسئلة */
.quiz-view, .mini-game-view { background: #e9f0f3 !important; color: var(--q-ink) !important; }
.quiz-card, .mini-card, .result-hero { background: #fff !important; color: var(--q-ink) !important; }
.quiz-card h2, .mini-card h2, .result-hero h1, #questionText, #miniQuestionText { color: var(--q-ink) !important; line-height: 1.55 !important; }
.choice, .soft-button, .outline-button { color: var(--q-ink) !important; }
.quiz-privacy { color: #d5e1ea !important; }

@media (max-width: 560px) {
  .hero-copy h1 { font-size: clamp(32px, 9vw, 46px) !important; line-height: 1.55 !important; }
  .hero-copy > p { font-size: 16px !important; line-height: 1.9 !important; }
  .hero-actions { max-width: 100% !important; }
  .hero-action { min-height: 60px !important; font-size: 19px !important; }
  .hero-proof { gap: 7px !important; }
  .hero-proof span { min-width: 0 !important; flex: 1 !important; padding: 10px 7px !important; }
  .hero-proof span b { font-size: 22px !important; }
  .hero-proof span small { font-size: 12px !important; }
  .site-menu { width: min(340px, 91vw) !important; }
}

/* لوحة الألوان النهائية حسب الصور المرجعية */
body { background: radial-gradient(circle at 50% 0%, #29435f 0%, #1b304b 44%, #101d31 100%) fixed !important; }
.site-menu { background: #f5f7f4 !important; color: #203a58 !important; }
.site-menu-head strong, .site-menu-links button, .site-menu-links a { color: #203a58 !important; }
.site-menu-head .eyebrow, .menu-group > small, .site-menu-links span { color: #9a7336 !important; }
.menu-close { background: #e9eef2 !important; color: #203a58 !important; }
.intro-card { background: #f5f0e4 !important; border-color: rgba(255,255,255,.8) !important; box-shadow: 0 20px 50px rgba(0,0,0,.18) !important; }
.intro-card h2 { color: #203a58 !important; }
.intro-card p { color: #66717a !important; }
.intro-points span { background: #fffaf1 !important; border-color: #e6ddcf !important; color: #304963 !important; }
.intro-points b { background: #dfb65d !important; color: #203a58 !important; }
.home-note { background: rgba(16,31,50,.55) !important; }
.home-note strong { color: #e0b565 !important; }
.home-note p, .site-footer { color: #d8e1e8 !important; }
.hero-action, .hero-action-daily, .hero-action-play, .hero-action-friends { background: linear-gradient(180deg, #f68d76 0%, #e96657 100%) !important; border-color: #b64b43 !important; color: #fff !important; }
.hero-proof span { background: #12243d !important; border-color: rgba(226,182,95,.5) !important; }
.hero-proof span b { color: #e7bb64 !important; }
.hero-proof span small { color: #e7edf2 !important; }
.intro-card { background: #f5f0e4 !important; }
.intro-card h2 { color: #203a58 !important; }
.intro-card p { color: #69737b !important; }
.intro-points span { background: #fffaf1 !important; color: #304963 !important; border-color: #e4dac9 !important; }
.intro-points b { background: #dfb65d !important; color: #203a58 !important; }
.home-note { background: #12243d !important; border-color: rgba(255,255,255,.1) !important; }
.intro-card { background: linear-gradient(145deg, #30235f 0%, #171a45 100%) !important; border-color: rgba(151,126,226,.62) !important; color: #fff !important; }
.intro-card h2 { color: #fff !important; }
.intro-card p { color: #c7c9e2 !important; }
.intro-points span { background: rgba(255,255,255,.08) !important; border-color: rgba(170,148,232,.3) !important; color: #f5f4fb !important; }
.intro-points b { background: #eab64e !important; color: #20204c !important; }

/* واجهة الألعاب المرجعية */
body { background: radial-gradient(circle at 50% 0%, #171a3a 0%, #10112b 55%, #0b0c1c 100%) fixed !important; }
.site-header { border-bottom-color: rgba(255,255,255,.08) !important; }
.hero-copy { max-width: 760px !important; }
.hero-badge { background: rgba(33,31,61,.82) !important; border-color: #aa8742 !important; color: #f0bc55 !important; }
.hero-copy h1 { color: #fff !important; font-size: clamp(38px, 9vw, 62px) !important; line-height: 1.4 !important; }
.hero-copy h1 em { color: #f2b44b !important; }
.hero-copy > p { color: #bfc2dc !important; }
.hero-action-daily { background: linear-gradient(180deg, #ff9b7d, #ed5f4d) !important; border-color: #a63c39 !important; }
.hero-action-play { background: linear-gradient(180deg, #84e1d0, #32b5a2) !important; border-color: #167a77 !important; }
.hero-action-friends { background: linear-gradient(180deg, #a77aff, #6323d0) !important; border-color: #3c138d !important; }
.hero-action { min-height: 70px !important; border-width: 3px !important; border-radius: 999px !important; font-size: 22px !important; box-shadow: inset 0 -8px 0 rgba(0,0,0,.2), 0 8px 0 rgba(0,0,0,.18) !important; }
.hero-proof { gap: clamp(20px, 7vw, 52px) !important; }
.hero-proof span { min-width: auto !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
.hero-proof span b { color: #f6bd4e !important; font-size: 32px !important; }
.hero-proof span small { color: #aaaecb !important; font-size: 14px !important; }
.intro-card { background: linear-gradient(145deg, #27204f, #151a43) !important; border-color: rgba(145,121,207,.55) !important; color: #fff !important; }
.intro-card h2 { color: #fff !important; }
.intro-card p { color: #bfc2dc !important; }
.intro-points span { background: rgba(255,255,255,.08) !important; border-color: rgba(255,255,255,.15) !important; color: #f4f3fb !important; }
.intro-points b { background: #f1b64a !important; }
.daily-feature-card { max-width: 760px; margin: 28px auto 0; padding: 34px 28px 30px; border: 1px solid rgba(140,123,218,.62); border-radius: 28px; background: radial-gradient(circle at 80% 22%, rgba(236,119,67,.3), transparent 28%), linear-gradient(145deg, #292153, #151a47 72%); box-shadow: 0 22px 55px rgba(0,0,0,.22); text-align: center; color: #fff; }
.daily-feature-icon { font-size: 66px; filter: drop-shadow(0 8px 18px rgba(255,143,44,.25)); }
.daily-feature-card h2 { margin: 6px 0 12px; color: #fff; font-size: clamp(30px, 7vw, 48px); line-height: 1.35; }
.daily-feature-card h2 em { color: #f3b74e; font-style: normal; }
.daily-feature-card p { max-width: 650px; margin: 0 auto 25px; color: #bfc2dc; font-size: 17px; line-height: 1.9; }
.daily-feature-actions { display: flex; align-items: center; justify-content: center; gap: 24px; }
.daily-start-button { min-width: 230px; min-height: 70px; border: 4px solid #b46a20; border-radius: 999px; background: linear-gradient(180deg,#ffda6f,#ef9026); color: #fff; font: inherit; font-size: 26px; font-weight: 800; box-shadow: inset 0 -8px 0 rgba(158,75,20,.28), 0 8px 0 rgba(0,0,0,.2); }
.daily-streak-box { min-width: 145px; padding: 13px 18px; border: 3px solid #a9883d; border-radius: 18px; color: #fff; background: rgba(255,255,255,.08); }
.daily-streak-box strong { display: block; color: #f4bb4e; font-size: 34px; }
.daily-streak-box small { color: #c9c9df; }
@media (max-width: 560px) { .daily-feature-card { padding: 28px 18px; } .daily-feature-actions { flex-direction: column; gap: 14px; } .daily-start-button { width: 100%; } }

/* قوّي عقلك — القائمة الجانبية الداكنة المتناسقة */
.site-menu {
  background: #111a31 !important;
  color: #f8f7f3 !important;
  border-left: 1px solid rgba(226,182,94,.24) !important;
  box-shadow: -22px 0 64px rgba(0,0,0,.42) !important;
}
.site-menu-head { border-bottom-color: rgba(255,255,255,.13) !important; }
.site-menu-head strong { color: #ffffff !important; line-height: 1.45 !important; }
.site-menu-head .eyebrow, .menu-group > small { color: #e2b65e !important; }
.menu-close { background: #1e2b47 !important; color: #ffffff !important; border: 1px solid rgba(255,255,255,.12) !important; }
.site-menu-links button, .site-menu-links a { color: #f5f7fb !important; min-height: 54px !important; line-height: 1.55 !important; }
.site-menu-links button:hover, .site-menu-links a:hover { background: #1e2b47 !important; }
.site-menu-links span { color: #e2b65e !important; }
.site-menu-foot { color: #b8c4d8 !important; border-top-color: rgba(255,255,255,.13) !important; }

/* شاشة البداية — كحلي غامق موحّد */
.launch-screen {
  background: radial-gradient(circle at 50% 38%, #142a4d 0%, #0b1c38 38%, #071328 70%, #040a17 100%) !important;
}
.launch-reference-video { background: #071328 !important; }
.launch-glow-one { background: #2f5d87 !important; opacity: .08 !important; }
.launch-glow-two { background: #d7ad4f !important; opacity: .06 !important; }
.launch-symbols { color: rgba(215,173,79,.11) !important; }

/* تدقيق الهوية — كل الأسطح كحلية غامقة */
:root {
  --q-deep-navy: #071328;
  --q-navy: #0b1a32;
  --q-navy-card: #111f3a;
  --q-navy-soft: #172946;
  --q-gold-clean: #e2b65e;
  --q-white-clean: #f6f8fb;
  --q-muted-clean: #c6d1df;
}
body {
  background: radial-gradient(circle at 50% 0%, #152b4a 0%, #0b1a32 42%, #050c1b 100%) fixed !important;
  color: var(--q-white-clean) !important;
}
.site-header, .site-footer, .home-page, .home-shell, .home-tab-panel,
.game-panel, .account-box, .home-note, .settings-panel, .achievements-panel,
.progress-only-panel, .game-overview, .result-stats, .quiz-topbar {
  background: var(--q-navy) !important;
  color: var(--q-white-clean) !important;
}
.hero-card, .intro-card, .daily-feature-card, .category-card, .mode-card,
.quiz-card, .mini-card, .result-hero, .quiz-privacy, .quiz-controls,
.quiz-tools, .quiz-progress-wrap, .settings-summary {
  background: var(--q-navy-card) !important;
  color: var(--q-white-clean) !important;
  border-color: rgba(226,182,94,.28) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.25) !important;
}
.hero-action, .hero-action-daily, .hero-action-play, .hero-action-friends,
.primary-button, .daily-start-button, .more-content-button {
  background: linear-gradient(180deg, #1a3154 0%, #0d1d36 100%) !important;
  border-color: var(--q-gold-clean) !important;
  color: var(--q-white-clean) !important;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.25), 0 6px 0 rgba(4,10,23,.75) !important;
}
.hero-action small, .hero-copy > p, .section-note, .audience-note,
.game-local-note, .intro-card p, .category-card p, .mode-card small,
.game-panel p, .account-box p, .home-note p, .daily-feature-card p,
.site-footer, .quiz-privacy, .settings-summary p {
  color: var(--q-muted-clean) !important;
}
.hero-copy h1, .intro-card h2, .section-heading h2, .modes-section h2,
.game-panel-heading h2, .category-card h3, .mode-card strong, .quiz-card h2,
.mini-card h2, .result-hero h1, #questionText, #miniQuestionText,
.settings-panel h2, .achievements-panel h2 {
  color: var(--q-white-clean) !important;
}
.hero-copy h1 em, .hero-proof span b, .home-note strong, .intro-points b,
.category-card .card-footer, .category-card .card-arrow, .mode-card b,
.mode-card .mode-icon, .more-content-button span, .settings-separator,
.menu-group > small, .site-menu-head .eyebrow, .site-menu-links span {
  color: var(--q-gold-clean) !important;
}
.hero-proof span, .intro-points span, .difficulty-button, .choice,
.soft-button, .outline-button, .settings-summary, .quiz-tools button {
  background: var(--q-navy-soft) !important;
  color: var(--q-white-clean) !important;
  border-color: rgba(226,182,94,.24) !important;
}
.hero-proof span small, .intro-points span, .difficulty-button, .choice,
.soft-button, .outline-button { color: var(--q-muted-clean) !important; }
.hero-proof span b, .intro-points b { color: var(--q-gold-clean) !important; }
.quiz-view, .mini-game-view { background: var(--q-deep-navy) !important; color: var(--q-white-clean) !important; }
.quiz-card, .mini-card, .result-hero { background: var(--q-navy-card) !important; }
.choice:hover, .soft-button:hover, .outline-button:hover,
.mode-card:hover, .category-card:hover { background: #1a3154 !important; }
.site-menu { background: #071328 !important; }
.menu-close, .site-menu-links button:hover, .site-menu-links a:hover { background: #172946 !important; }

/* إحصائيات الصفحة الرئيسية — حجم متوازن */
.hero-proof {
  width: min(100%, 680px) !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 22px auto 0 !important;
}
.hero-proof span {
  min-width: 0 !important;
  min-height: 86px !important;
  padding: 10px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 16px !important;
  background: #111f3a !important;
  border: 1px solid rgba(226,182,94,.2) !important;
}
.hero-proof span b {
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #e2b65e !important;
  font-size: clamp(22px, 5.6vw, 30px) !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}
.hero-proof span small {
  margin-top: 6px !important;
  color: #c6d1df !important;
  font-size: clamp(11px, 2.8vw, 14px) !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
}
@media (max-width: 420px) {
  .hero-proof { gap: 7px !important; }
  .hero-proof span { min-height: 78px !important; padding-inline: 3px !important; }
  .hero-proof span b { font-size: 21px !important; }
  .hero-proof span small { font-size: 11px !important; }
}

/* غرفة التحدي — كحلي غامق */
.challenge-box {
  background: #111f3a !important;
  color: #f6f8fb !important;
  border-color: rgba(226,182,94,.28) !important;
}
.challenge-box h3 { color: #f6f8fb !important; }
.challenge-box p { color: #c6d1df !important; }
.challenge-actions input {
  background: #172946 !important;
  color: #f6f8fb !important;
  border-color: rgba(226,182,94,.3) !important;
}
.challenge-actions input::placeholder { color: #aebdce !important; }
.challenge-room {
  background: #0b1a32 !important;
  color: #f6f8fb !important;
  border: 1px solid rgba(226,182,94,.2) !important;
}
.challenge-room code, .challenge-player b { color: #e2b65e !important; }
.challenge-player {
  background: #172946 !important;
  color: #f6f8fb !important;
  border-color: rgba(255,255,255,.1) !important;
}
.account-form input, .leader-row {
  background: #172946 !important;
  color: #f6f8fb !important;
  border-color: rgba(226,182,94,.24) !important;
}
.account-form input::placeholder { color: #aebdce !important; }
.home-back-button:not(.hidden) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin: 0 0 14px !important;
  padding: 9px 15px !important;
  border: 1px solid rgba(226,182,94,.45) !important;
  border-radius: 12px !important;
  background: #111f3a !important;
  color: #f6f8fb !important;
  box-shadow: 0 5px 14px rgba(0,0,0,.18) !important;
}
.home-back-button:not(.hidden)::first-letter { color: #e2b65e !important; }

/* الجولة والنتيجة — نفس الهوية الكحلية */
.quiz-topbar, .result-topbar { background: transparent !important; color: #f6f8fb !important; }
.quiz-category, .quiz-hud, .mini-score { color: #f6f8fb !important; }
.quiz-hud span, .mini-score {
  background: #111f3a !important;
  border: 1px solid rgba(226,182,94,.25) !important;
  color: #e2b65e !important;
}
.quiz-progress-wrap {
  background: #111f3a !important;
  border: 1px solid rgba(226,182,94,.2) !important;
  padding: 12px 14px !important;
  border-radius: 15px !important;
}
.progress-meta { color: #c6d1df !important; }
.progress-track { background: #1d3150 !important; }
.progress-fill { background: #e2b65e !important; }
.choice {
  background: #172946 !important;
  color: #f6f8fb !important;
  border-color: rgba(226,182,94,.22) !important;
}
.choice-letter { background: #243b60 !important; color: #e2b65e !important; }
.choice:hover:not(:disabled) { background: #1d385d !important; border-color: #e2b65e !important; }
.choice.correct {
  background: #17352f !important;
  color: #f6f8fb !important;
  border-color: #58b58a !important;
}
.choice.correct .choice-letter { background: #58b58a !important; color: #071328 !important; }
.choice.wrong {
  background: #3b2531 !important;
  color: #f6f8fb !important;
  border-color: #e17c78 !important;
}
.choice.wrong .choice-letter { background: #e17c78 !important; color: #071328 !important; }
.feedback, .feedback.wrong-feedback {
  background: #172946 !important;
  color: #dce6f0 !important;
  border-right-color: #58b58a !important;
}
.feedback.wrong-feedback { border-right-color: #e17c78 !important; }
.feedback strong { color: #e2b65e !important; }
.quiz-controls, .quiz-tools { background: transparent !important; }
.quiz-privacy { background: #0b1a32 !important; color: #b9c8d8 !important; }
.question-list { background: #111f3a !important; border-color: rgba(226,182,94,.2) !important; }
.result-stats > span {
  background: #172946 !important;
  border-color: rgba(226,182,94,.22) !important;
}
.result-stats b { color: #e2b65e !important; }
.result-stats small { color: #c6d1df !important; }
.timer-danger { background: #3b2531 !important; color: #f6f8fb !important; }

/* زر رجوع عام — يظهر في كل صفحة داخلية */
.global-back-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 40px !important;
  padding: 7px 13px !important;
  border: 1px solid rgba(226,182,94,.42) !important;
  border-radius: 12px !important;
  background: #111f3a !important;
  color: #f6f8fb !important;
  font: inherit !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.global-back-button:hover { background: #172946 !important; }
.global-back-button.hidden { display: none !important; }

/* منع تكرار زر الرجوع — نستخدم الزر العام فقط */
#homeBackBtn { display: none !important; }

/* زر الإعدادات بجانب زر القائمة */
.settings-toggle {
  width: 44px !important;
  height: 44px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid rgba(226,182,94,.28) !important;
  border-radius: 13px !important;
  background: #111f3a !important;
  color: #f6f8fb !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: transform .16s ease, background .16s ease !important;
}
.settings-toggle:hover { background: #172946 !important; }
.settings-toggle:active { transform: scale(.96) !important; }
@media (max-width:560px) { .settings-toggle { width: 40px !important; height: 40px !important; font-size: 20px !important; } }

/* زر ونافذة الشخصية */
.profile-toggle{width:44px!important;height:44px!important;display:inline-grid!important;place-items:center!important;padding:4px!important;border:1px solid rgba(226,182,94,.28)!important;border-radius:13px!important;background:#111f3a!important;cursor:pointer!important}.profile-toggle img{width:100%;height:100%;border-radius:10px;object-fit:cover}.profile-toggle:hover{background:#172946!important}
.profile-modal{position:fixed;inset:0;z-index:80;display:grid;place-items:center;padding:18px}.profile-modal.hidden{display:none!important}.profile-backdrop{position:absolute;inset:0;background:rgba(2,7,18,.82);backdrop-filter:blur(7px)}.profile-dialog{position:relative;z-index:1;width:min(100%,520px);max-height:min(90vh,760px);overflow:auto;padding:28px 22px 24px;border:2px solid #e2b65e;border-radius:28px;background:linear-gradient(145deg,#1a2d55,#111f3a);box-shadow:0 28px 80px rgba(0,0,0,.5);text-align:center}.profile-dialog h2{margin:0 0 8px;color:#f6f8fb!important;font-size:clamp(26px,6vw,38px)}.profile-dialog p{margin:0 auto 18px;color:#c6d1df!important;line-height:1.8}.profile-close{position:absolute;top:14px;inset-inline-start:14px;width:42px;height:42px;border:1px solid rgba(255,255,255,.12);border-radius:13px;background:#24365a;color:#fff;font-size:28px;line-height:1;cursor:pointer}.profile-name{width:100%;padding:14px 16px;border:1px solid rgba(226,182,94,.25);border-radius:15px;background:#172946;color:#fff;font:inherit;text-align:right;outline:none}.profile-name::placeholder{color:#9eafc4}.profile-avatar-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:20px 0}.profile-avatar-grid button{aspect-ratio:1;border:2px solid rgba(255,255,255,.12);border-radius:17px;background:#24365a;color:#fff;font-size:30px;cursor:pointer}.profile-avatar-grid button.active{border-color:#e2b65e;box-shadow:0 0 0 3px rgba(226,182,94,.18)}.profile-save{width:100%;min-height:58px!important;margin-top:4px;background:linear-gradient(180deg,#f7c75e,#e58b1e)!important;border-color:#b86b1d!important;color:#071328!important;font-size:20px!important}@media(max-width:560px){.profile-toggle{width:40px!important;height:40px!important}.profile-avatar-grid{gap:7px}.profile-avatar-grid button{font-size:24px}}
.profile-toggle span{display:grid;place-items:center;width:100%;height:100%;font-size:24px;line-height:1}

/* ضبط نهائي للجوال: هيدر مختصر ومسافات أهدأ */
@media (max-width: 590px){
  .site-header{width:calc(100% - 28px)!important;min-height:62px!important;padding:8px 10px!important;gap:10px!important;border-radius:0 0 14px 14px!important}
  .site-header .brand{gap:8px!important;min-width:0!important}
  .site-header .brand-logo{width:42px!important;height:42px!important;border-radius:12px!important}
  .site-header .brand strong{font-size:19px!important;line-height:1.2!important;white-space:nowrap!important}
  .site-header .brand small{font-size:10px!important;line-height:1.2!important;white-space:nowrap!important}
  .header-actions{gap:5px!important;flex-shrink:0!important}
  .header-actions .menu-toggle,.header-actions .settings-toggle,.header-actions .profile-toggle{width:39px!important;height:39px!important;border-radius:11px!important}
  .header-actions .menu-toggle span{width:18px!important}
  .header-actions .settings-toggle{font-size:18px!important}
  .header-actions .profile-toggle span{font-size:21px!important}
  .hero-grid{padding-top:22px!important;padding-bottom:28px!important}
  .hero-copy{text-align:center!important}
  .hero-badge{padding:7px 13px!important;font-size:13px!important;line-height:1.4!important}
  html[data-theme="dark"] .hero-copy h1,.hero-copy h1{font-size:clamp(31px,9.5vw,40px)!important;line-height:1.38!important;margin:20px auto 12px!important;letter-spacing:0!important}
  .hero-copy>p{font-size:15px!important;line-height:1.8!important;margin:0 auto 18px!important;max-width:330px!important}
  .hero-actions{gap:9px!important;margin-bottom:18px!important;max-width:100%!important}
  .hero-action{min-height:54px!important;border-width:2px!important;font-size:18px!important;box-shadow:inset 0 -5px 0 rgba(0,0,0,.18),0 5px 0 rgba(0,0,0,.18)!important}
  .hero-action small{font-size:11px!important}
  .hero-proof{gap:7px!important;margin-top:17px!important}
  .hero-proof span{min-width:0!important;flex:1!important;padding:9px 5px!important;border-radius:14px!important}
  .hero-proof span b{font-size:21px!important}
  .hero-proof span small{font-size:11px!important;white-space:nowrap!important}
}

/* زر اللعب كضيف */
.guest-play-button{min-height:48px;padding:9px 18px;border:1px solid rgba(226,182,94,.42);border-radius:15px;background:rgba(17,31,58,.82);color:#f6f8fb;font:inherit;font-size:16px;font-weight:800;cursor:pointer;box-shadow:0 5px 0 rgba(0,0,0,.16);transition:transform .16s ease,background .16s ease}.guest-play-button small{display:inline;margin-inline-start:7px;color:#c6d1df;font-size:12px;font-weight:500}.guest-play-button:hover{background:#172946}.guest-play-button:active{transform:scale(.97)}
@media(max-width:590px){.guest-play-button{min-height:42px;padding:7px 12px;font-size:14px;border-radius:13px}.guest-play-button small{display:block;margin:0;font-size:10px;line-height:1.3}}

/* تنظيف البداية: المحتوى العملي فقط */
.hero-grid{grid-template-columns:1fr!important;max-width:760px!important;margin-inline:auto!important}
.guest-play-button{justify-self:center!important;width:auto!important;min-width:190px!important}
@media(max-width:590px){.hero-grid{max-width:100%!important}.guest-play-button{min-width:170px!important}}

/* إيميل الدعم الظاهر للزوار */
.footer-email{display:inline-block;color:#e2b65e;text-decoration:none;font-size:13px;font-weight:700;direction:ltr;unicode-bidi:plaintext}.footer-email:hover{text-decoration:underline}
@media(max-width:590px){.footer-email{font-size:12px}}

/* شرح الألعاب داخل البطاقات */
.mode-card small{display:block;min-height:2.6em;line-height:1.55;font-size:clamp(11px,2.7vw,13px);color:#d7deed!important;white-space:normal}
.mode-card{min-height:150px}
@media(max-width:590px){.mode-card{min-height:142px;padding:14px 10px}.mode-card small{font-size:11px;line-height:1.45}}

/* معاينة إعلان غير مزعج — يظهر فقط مع ?ad-preview=1 */
.ad-preview-card{width:min(100% - 32px,760px);margin:24px auto 32px;padding:15px 18px;display:flex;align-items:center;gap:14px;border:1px solid rgba(232,190,84,.45);border-radius:18px;background:linear-gradient(135deg,#122441,#0b172d);color:#eef4ff;box-shadow:0 10px 28px rgba(0,0,0,.18);direction:rtl}
.ad-preview-card[hidden]{display:none}
.ad-preview-mark{flex:0 0 auto;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#e7bd54;color:#10213d;font-weight:800;font-size:18px}
.ad-preview-copy{flex:1;min-width:0}.ad-preview-copy small{display:block;color:#d9b75c;font-size:11px;margin-bottom:3px}.ad-preview-copy strong{display:block;font-size:15px;line-height:1.45}.ad-preview-copy span{display:block;color:#c4cfdf;font-size:12px;line-height:1.5;margin-top:2px}
.ad-preview-close{border:0;background:rgba(255,255,255,.08);color:#fff;width:30px;height:30px;border-radius:50%;font-size:18px;cursor:pointer}.ad-preview-close:active{transform:scale(.96)}
@media(max-width:590px){.ad-preview-card{margin:18px 16px 26px;width:auto;padding:13px 14px}.ad-preview-copy strong{font-size:14px}}

/* ترتيب نهاية الصفحة — بطاقة التعريف والتقدم والتذييل */
.intro-card{padding:30px 28px 28px!important;margin:24px auto!important;max-width:760px!important}
.intro-card h2{font-size:clamp(25px,5.8vw,40px)!important;line-height:1.42!important;margin:10px 0 16px!important}
.intro-card p{font-size:clamp(15px,3.6vw,18px)!important;line-height:1.9!important;margin:0 auto 20px!important;max-width:650px}
.intro-points{display:grid!important;gap:10px!important;margin:18px 0 22px!important}
.intro-points span{display:flex!important;align-items:center!important;gap:10px!important;padding:11px 14px!important;border-radius:14px!important;font-size:clamp(14px,3.4vw,17px)!important}
.intro-points b{flex:0 0 28px!important;width:28px!important;height:28px!important;display:grid!important;place-items:center!important;border-radius:50%!important}
.home-note{max-width:760px!important;margin:20px auto 26px!important;padding:18px 22px!important;display:flex!important;align-items:center!important;gap:12px!important;border-radius:20px!important;text-align:right!important}
.home-note .note-icon{flex:0 0 auto!important}
.home-note strong{font-size:clamp(15px,3.8vw,19px)!important;line-height:1.5!important}
.home-note p{font-size:clamp(13px,3.2vw,16px)!important;line-height:1.7!important;margin:3px 0 0!important}
.site-footer{width:100%!important;max-width:760px!important;margin:0 auto!important;padding:22px 20px 30px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px 28px!important;flex-wrap:wrap!important;text-align:center!important;line-height:1.7!important}
.site-footer span,.site-footer a{margin:0!important;line-height:1.7!important}
@media(max-width:590px){
 .intro-card{padding:24px 18px 22px!important;margin:18px auto!important;border-radius:20px!important}
 .intro-card h2{font-size:27px!important;line-height:1.5!important}
 .intro-card p{font-size:15px!important;line-height:1.95!important}
 .intro-points span{font-size:14px!important;padding:10px 12px!important}
 .home-note{margin:16px auto 22px!important;padding:16px 15px!important;border-radius:18px!important}
 .site-footer{padding:20px 16px 28px!important;flex-direction:column!important;gap:5px!important;font-size:13px!important}
 .footer-email{font-size:14px!important;order:-1}
}

/* تثبيت وضوح نهاية الصفحة بعد القواعد القديمة */
.intro-card,.home-note,.site-footer{opacity:1!important;visibility:visible!important}
.intro-card .eyebrow{color:#e7bd5d!important}
.intro-card h2{color:#ffffff!important;text-shadow:0 1px 2px rgba(0,0,0,.28)!important}
.intro-card p{color:#f0f5fb!important}
.intro-points span{color:#ffffff!important;background:#1b3554!important;border-color:rgba(231,189,93,.36)!important}
.intro-points b{color:#12243d!important;background:#f0bd59!important}
.intro-card .primary-button{color:#ffffff!important;background:#173454!important;border-color:#e7bd5d!important}
.home-note{background:#102947!important;border:1px solid rgba(231,189,93,.25)!important}
.home-note strong{color:#f0bd59!important}.home-note p{color:#f2f6fb!important}
.site-footer{background:#0e223b!important;color:#ffffff!important;border-top:1px solid rgba(231,189,93,.28)!important}
.site-footer span{color:#ffffff!important}.site-footer .footer-email{color:#f0bd59!important;text-decoration:underline!important}

/* تواصل معنا بجانب إيميل الدعم */
.footer-contact{display:flex;align-items:center;justify-content:center;gap:12px;direction:rtl;flex-wrap:wrap}
.footer-contact-link{display:inline-flex;align-items:center;gap:5px;padding:6px 12px;border:1px solid rgba(240,189,89,.5);border-radius:999px;background:rgba(240,189,89,.1);color:#fff!important;text-decoration:none!important;font-size:13px;font-weight:700;transition:background .16s ease,transform .16s ease}
.footer-contact-link::before{content:'✉';color:#f0bd59;font-size:14px}
.footer-contact-link:hover{background:rgba(240,189,89,.2);transform:translateY(-1px)}
.footer-contact .footer-email{margin:0!important}
@media(max-width:590px){.footer-contact{gap:8px}.footer-contact-link{font-size:12px;padding:5px 10px}.footer-contact .footer-email{font-size:13px!important}}

/* لوحة الصدارة الحقيقية */
.leaderboard-showcase{margin-top:26px;padding:24px 20px;border:1px solid rgba(231,189,93,.28);border-radius:24px;background:linear-gradient(145deg,#162e4d,#10243d);direction:rtl;text-align:right}
.leaderboard-showcase-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.leaderboard-showcase h2{margin:5px 0 0;color:#fff!important;font-size:clamp(24px,5vw,34px)!important}.leaderboard-showcase .eyebrow{color:#f0bd59!important}.leaderboard-note{margin:14px 0 18px;color:#e6edf7!important;font-size:14px;line-height:1.8}
.public-leaderboard{display:grid;gap:9px}.public-leader-row{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:10px;padding:12px 14px;border:1px solid rgba(255,255,255,.12);border-radius:15px;background:#1b3554;color:#fff}.public-leader-row.me{border-color:#f0bd59;box-shadow:0 0 0 1px rgba(240,189,89,.18)}.leader-rank{font-size:21px;text-align:center}.leader-player{display:flex;flex-direction:column;gap:2px}.leader-player strong{font-size:15px;color:#fff}.leader-player small{font-size:11px;color:#cad6e7}.public-leader-row>b{color:#f6c45f;font-size:14px;white-space:nowrap}.leaderboard-empty{padding:18px;text-align:center;color:#dce7f4;background:rgba(255,255,255,.06);border-radius:14px;line-height:1.7}
@media(max-width:590px){.leaderboard-showcase{margin-top:20px;padding:19px 14px;border-radius:20px}.leaderboard-showcase h2{font-size:24px!important}.leaderboard-note{font-size:13px;line-height:1.75}.public-leader-row{padding:11px 10px;grid-template-columns:34px 1fr auto}.public-leader-row>b{font-size:12px}.leader-player strong{font-size:14px}}
