:root { color-scheme: light dark; }
.theme-toggle,.top-add-category { white-space:nowrap }
.theme-toggle { min-width:46px;font-size:1.15rem }
.site-legal-footer { max-width:1240px;margin:48px auto 0;padding:28px 24px;border-top:1px solid #dfcbb0;display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap }
.site-legal-footer nav { display:flex;gap:16px;flex-wrap:wrap }.site-legal-footer a { color:inherit;text-decoration:none;font-weight:700 }
.legal-page { max-width:900px;margin:48px auto;padding:32px }.legal-page h1 { margin-top:0 }.legal-page h2 { margin-top:28px;font-size:1.15rem }.legal-page p { line-height:1.9 }
.people-stats { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0 }.people-stat { padding:20px;border:1px solid #e1cdb2;border-radius:18px;background:var(--p);text-align:center }.people-stat b { display:block;font-size:2rem;color:var(--r) }
.people-table-wrap { overflow:auto;margin:16px 0 30px;border:1px solid #e1cdb2;border-radius:18px }.people-table { width:100%;border-collapse:collapse;min-width:700px }.people-table th,.people-table td { padding:13px;text-align:right;border-bottom:1px solid #eadbc7 }.online-dot { display:inline-block;width:10px;height:10px;border-radius:50%;background:#2aaf68;margin-inline-end:7px }
.my-games-shelf { max-width:1240px;margin:32px auto;padding:24px }.game-library { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px }.game-library.single-game { grid-template-columns:minmax(0,520px) }.library-card { padding:22px;border:1px solid #dfcbb0;border-radius:22px;background:var(--p);min-height:150px }.library-card .status { display:inline-block;margin-top:18px;padding:7px 12px;border-radius:999px;background:#eadbc7;color:#29241f }.library-card.available { border-color:var(--r) }
html[data-theme="dark"] { --c:#171411;--p:#24201c;--i:#fff7ec;--r:#e46b4d;--d:#f3e5d3;color-scheme:dark }
html[data-theme="dark"] body { background:#171411!important;color:#fff7ec!important }
html[data-theme="dark"] header,html[data-theme="dark"] .card,html[data-theme="dark"] .content,html[data-theme="dark"] .side,html[data-theme="dark"] .library-card,html[data-theme="dark"] .people-stat,html[data-theme="dark"] .legal-page,html[data-theme="dark"] .modalBox { background:#24201c!important;color:#fff7ec!important;border-color:#4a4037!important }
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select { background:#181512!important;color:#fff7ec!important;border-color:#5d4d41!important }
html[data-theme="dark"] .outline,html[data-theme="dark"] .tiny,html[data-theme="dark"] .side button { color:#fff7ec!important;border-color:#6b5849!important;background:#2b2520!important }
html[data-theme="dark"] .homeCatCard,html[data-theme="dark"] .homeCatCard img,html[data-theme="dark"] .homeCatPlaceholder { background:#352a20!important;color:#fff7ec!important }
html[data-theme="dark"] .site-legal-footer,html[data-theme="dark"] .people-table-wrap,html[data-theme="dark"] .people-table td,html[data-theme="dark"] .people-table th { border-color:#4a4037!important }
@media(max-width:760px) { .actions { gap:8px!important;flex-wrap:wrap }.top-add-category { order:3;width:100%;text-align:center }.people-stats,.game-library { grid-template-columns:1fr }.legal-page { margin:20px 12px;padding:22px }.site-legal-footer { margin-top:28px }.my-games-shelf { padding:16px } }

/* قراءة واضحة ومتناسقة في الوضع الليلي */
html[data-theme="dark"] .nav { border-color:#ffffff18!important }
html[data-theme="dark"] .memberLink { background:#c75238!important;border-color:#ef8a6f!important;color:#fff!important }
html[data-theme="dark"] .memberLink span { color:#fff!important;opacity:1!important;text-shadow:0 1px 2px #5c1e16 }
html[data-theme="dark"] .memberLink small { color:#fff2c7!important;opacity:1!important }
html[data-theme="dark"] .profilePage,html[data-theme="dark"] .profilePage h1,html[data-theme="dark"] .profilePage h2,html[data-theme="dark"] .profilePage b,html[data-theme="dark"] .profilePage strong { color:#fff7ec!important }
html[data-theme="dark"] .profileHero,html[data-theme="dark"] .completedGames { background:#29231e!important;border-color:#654b3c!important;color:#fff7ec!important }
html[data-theme="dark"] .gameHistory { border-color:#59463a!important;color:#fff7ec!important }
html[data-theme="dark"] .gameHistory small { color:#d9c9b9!important }
html[data-theme="dark"] .historyTeams span { background:#3d332b!important;color:#fff7ec!important }
html[data-theme="dark"] .empty { color:#d7c6b5!important }
html[data-theme="dark"] .hero p { color:#d8c5b4!important }

html[data-theme="dark"] .homeCategories,html[data-theme="dark"] .aboutSection,html[data-theme="dark"] .featureSection { background:#c75238!important;color:#fff!important;border-color:#e77c61!important }
html[data-theme="dark"] .homeCategories { box-shadow:0 22px 55px #0005!important }
html[data-theme="dark"] .homeCategoriesTitle,html[data-theme="dark"] .homeCategoriesTitle b,html[data-theme="dark"] .aboutSection h2,html[data-theme="dark"] .aboutSection p,html[data-theme="dark"] .featureSection h2 { color:#fff!important;text-shadow:0 2px 3px #77271955 }
html[data-theme="dark"] .aboutSection .badge { background:#29241f!important;color:#fff!important }
html[data-theme="dark"] .featureCard { background:#29241f!important;border-color:#7b3025!important;color:#fff!important;box-shadow:0 12px 28px #74251835 }
html[data-theme="dark"] .featureCard b { color:#ff977b!important }
html[data-theme="dark"] .featureCard span:not(.abilityIcon) { color:#fff7ec!important;opacity:1!important }
html[data-theme="dark"] .featureCard .abilityIcon { background:#f6d7ab!important;color:#29241f!important }

/* منع خطوط الرسم السوداء خلف الشريط المتحرك */
.homeCatViewport { background:#f1e2cc!important;isolation:isolate!important;contain:paint!important;transform:none!important }
.homeCatTrack,.homeCatBelt,.homeCatGroup,.homeCatCard { backface-visibility:visible!important;perspective:none!important }
.homeCatTrack { will-change:auto!important }
@keyframes takawiSeamlessCategories { from { transform:translateX(0) } to { transform:translateX(-50%) } }
@keyframes takawiMobileCategories { from { transform:translateY(0) } to { transform:translateY(-50%) } }
@media(max-width:600px) { html[data-theme="dark"] .homeCatViewport { background:#c75238!important } }

/* توزيع بصري أوضح للوضع العادي بدل المساحات الفارغة */
html:not([data-theme="dark"]) .aboutSection { position:relative;overflow:hidden;padding-top:52px!important;padding-bottom:52px!important;background:linear-gradient(135deg,#fffaf2 0%,#f5e5ce 52%,#fff8ed 100%)!important;border-top:1px solid #ead4b7;border-bottom:1px solid #ead4b7 }
html:not([data-theme="dark"]) .aboutSection::before,html:not([data-theme="dark"]) .aboutSection::after { content:"";position:absolute;width:220px;height:220px;border:42px solid #c7523810;border-radius:50%;pointer-events:none }
html:not([data-theme="dark"]) .aboutSection::before { right:-105px;top:-115px }html:not([data-theme="dark"]) .aboutSection::after { left:-120px;bottom:-135px }
html:not([data-theme="dark"]) .aboutSection h2 { position:relative;display:inline-block;margin-inline:auto;padding:0 22px }
html:not([data-theme="dark"]) .aboutSection h2::after { content:"";display:block;width:74px;height:5px;margin:13px auto 0;border-radius:10px;background:linear-gradient(90deg,#c75238,#eda05f) }
html:not([data-theme="dark"]) .aboutSection p { position:relative;max-width:760px;margin:10px auto 0;padding:18px 24px;border:1px solid #e3c7a6;border-radius:20px;background:#fffaf2cc;box-shadow:0 12px 32px #80522b12;color:#594b40!important }
html:not([data-theme="dark"]) .featureSection { position:relative;padding-top:54px!important;padding-bottom:62px!important;background:linear-gradient(180deg,#f7efe3 0%,#f1dfc7 100%)!important }
html:not([data-theme="dark"]) .featureSection::before { content:"";position:absolute;inset:0;background-image:radial-gradient(#c7523815 1.5px,transparent 1.5px);background-size:24px 24px;mask-image:linear-gradient(to bottom,transparent,#000 30%,#000 70%,transparent);pointer-events:none }
html:not([data-theme="dark"]) .featureSection h2,html:not([data-theme="dark"]) .featureCards { position:relative }
html:not([data-theme="dark"]) .featureSection h2 { color:#29241f!important }html:not([data-theme="dark"]) .featureSection h2::after { content:"";display:block;width:88px;height:5px;margin:14px auto 0;border-radius:10px;background:#c75238 }
html:not([data-theme="dark"]) .featureCard { background:#fffaf2!important;border:1px solid #dfc6a6!important;box-shadow:0 14px 30px #76502d16!important;transition:transform .2s ease,box-shadow .2s ease }
html:not([data-theme="dark"]) .featureCard:hover { transform:translateY(-5px);box-shadow:0 20px 38px #76502d24!important }
html:not([data-theme="dark"]) .homeCategories { background:linear-gradient(145deg,#fff8ec,#ead8bf)!important;border-color:#d8b991!important }
html:not([data-theme="dark"]) .homeCategoriesTitle,html:not([data-theme="dark"]) .homeCategoriesTitle b { color:#29241f!important }

/* زر الوضع الليلي يبقى ظاهرًا في الآيفون والجوال */
@media(max-width:520px) { .actions .theme-toggle { display:inline-grid!important;place-items:center!important;width:42px!important;min-width:42px!important;height:42px!important;padding:0!important;order:-2!important }.nav { min-height:78px!important;height:auto!important;padding:10px 14px!important }.actions { align-items:center!important }.memberLink { max-width:145px!important }.memberLink span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap } }

/* حركة مستمرة بدون توقف عند المؤشر وبدون آثار خطوط سوداء */
.homeCatTrack { animation:none!important;will-change:auto!important;backface-visibility:visible!important;transform-style:flat!important;filter:none!important }
.homeCatViewport:hover .homeCatTrack { animation-play-state:running!important }
.homeCatViewport,.homeCatBelt,.homeCatGroup { transform-style:flat!important;backface-visibility:visible!important }
.homeCatViewport { overflow:hidden!important;background:#f1e2cc!important }
.homeCatBelt { background:#f1e2cc!important }
html[data-theme="dark"] .homeCatViewport,html[data-theme="dark"] .homeCatBelt { background:#c75238!important }

/* نصوص وهوية الوضع العادي */
html:not([data-theme="dark"]) .my-games-shelf>h2,html:not([data-theme="dark"]) .library-card h3 { color:#c75238!important }
html:not([data-theme="dark"]) .library-card .status { color:#c75238!important;font-weight:800!important }
html:not([data-theme="dark"]) .aboutSection .badge { background:#eadbc8!important;color:#171411!important }
html:not([data-theme="dark"]) .aboutSection h2,html:not([data-theme="dark"]) .featureSection h2 { color:transparent!important;background:linear-gradient(125deg,#7f3027 0%,#c94d37 42%,#e36d49 72%,#f0a25e 100%);background-clip:text;-webkit-background-clip:text }
html:not([data-theme="dark"]) .aboutSection p { color:#b94632!important;font-weight:700!important }
html:not([data-theme="dark"]) .aboutSection h2::after,html:not([data-theme="dark"]) .featureSection h2::after { background:linear-gradient(125deg,#7f3027,#c94d37,#e36d49,#f0a25e)!important }

/* أقواس الهوية المتدرجة تظهر في الوضعين */
.aboutSection { position:relative!important;overflow:hidden!important }
.aboutSection::before,.aboutSection::after { content:""!important;position:absolute!important;width:230px!important;height:230px!important;border:38px solid transparent!important;border-radius:50%!important;background:linear-gradient(135deg,#7f3027,#c94d37,#e36d49,#f0a25e) border-box!important;mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;mask-composite:exclude!important;-webkit-mask:linear-gradient(#000 0 0) padding-box,linear-gradient(#000 0 0)!important;-webkit-mask-composite:xor!important;opacity:.2!important;pointer-events:none!important }
.aboutSection::before { right:-110px!important;top:-120px!important }.aboutSection::after { left:-120px!important;bottom:-140px!important }
html[data-theme="dark"] .aboutSection::before,html[data-theme="dark"] .aboutSection::after { opacity:.34!important }
html[data-theme="dark"] .aboutSection .badge { color:#171411!important;background:#f2d7b2!important }
html[data-theme="dark"] .aboutSection h2,html[data-theme="dark"] .featureSection h2 { color:#fff!important }

/* لوحة التحكم تبقى مقروءة بالكامل في الوضع الليلي */
.theme-toggle { display:inline-grid!important;place-items:center!important;flex:0 0 46px!important;background:#fff4df!important;color:#29241f!important;border:1px solid #d8b17b!important;position:relative;z-index:100!important }
html[data-theme="dark"] .theme-toggle { display:inline-grid!important;background:#f2b84b!important;color:#171411!important;border-color:#ffd984!important;box-shadow:0 0 0 3px #f2b84b22!important }
html[data-theme="dark"] .ownerLayout,html[data-theme="dark"] .dashboard,html[data-theme="dark"] .profilePage { color:#fff7ec!important }
html[data-theme="dark"] .adminForm,html[data-theme="dark"] .list,html[data-theme="dark"] .panel,html[data-theme="dark"] .stat,html[data-theme="dark"] fieldset { background:#29231e!important;color:#fff7ec!important;border-color:#5e4a3c!important }
html[data-theme="dark"] .item,html[data-theme="dark"] .row,html[data-theme="dark"] .checks { color:#fff7ec!important;border-color:#59463a!important }
html[data-theme="dark"] .content h1,html[data-theme="dark"] .content h2,html[data-theme="dark"] .content h3,html[data-theme="dark"] .content p,html[data-theme="dark"] .content label,html[data-theme="dark"] .content span,html[data-theme="dark"] .content small,html[data-theme="dark"] .dashboard h1,html[data-theme="dark"] .dashboard h2 { color:#fff7ec!important;opacity:1!important }
html[data-theme="dark"] .adminForm input,html[data-theme="dark"] .adminForm textarea,html[data-theme="dark"] .adminForm select,html[data-theme="dark"] .richEdit { background:#171411!important;color:#fff7ec!important;border-color:#715b49!important;caret-color:#ff9a7d!important }
html[data-theme="dark"] .adminForm input::placeholder,html[data-theme="dark"] .adminForm textarea::placeholder { color:#b8a797!important;opacity:1!important }
html[data-theme="dark"] .side button.on { background:#c75238!important;color:#fff!important;border-color:#ef896d!important }
html[data-theme="dark"] .tiny { background:#44372e!important;color:#ffb29d!important }
html[data-theme="dark"] .tiny.danger { background:#5d2926!important;color:#ffd1c8!important }
html[data-theme="dark"] .thumb,html[data-theme="dark"] .featureImagePreview,html[data-theme="dark"] .categoryEditPreview { background:#3a3029!important }
@media(max-width:520px) { .theme-toggle { display:inline-grid!important;visibility:visible!important;opacity:1!important } }
