/*
 * دوري الأسبوع (inc/leaderboard.php) — بيتحمّل في كل الصفحات لأن أجزاءه في أماكن كتير:
 * المنيو · /leaderboard/ · كارت لوحة الطالب · سكشن الرئيسية · سطر صفحة الكورس · رسالة النقط.
 *
 * التصميم المتفق عليه (٢٧/١٠): المنافسة بالأخضر (--ls-green-*) بدل الأزرق، والكلام أبيض ورمادي.
 * كاس ومنصة بسلالم، ومسطح: من غير تدرجات ولا توهج ولا حركة.
 */

/* ─── المنيو ───────────────────────────────────────────────── */
.learnsimply-header-menu-league { gap: 6px; }
.learnsimply-header-menu-league .lslg-cup { flex-shrink: 0; }
.learnsimply-header-menu-league-rank { display: none; }

/* المنيو على الديسكتوب كان ضيق (الهيدر 1200px ثابت). «مساعدة» اتشالت منه (٢٧/١٠) وبقت زرار عائم،
   فبقى فيه مكان لـ«الدوري» بالكلمة، ومسافات 10px بدل 16 للأمان. */
@media (min-width: 1201px) {
	.learnsimply-header-navigation-menu { gap: 10px; }
	.learnsimply-header-menu-league { padding: 8px 10px; }
}

@media (max-width: 1200px) {
	.learnsimply-header-menu-league-rank {
		display: inline;
		margin-inline-start: auto;
		color: var(--ls-green-light, #3fd68c);
		font-size: var(--ls-text-sm, 14px);
		font-weight: var(--ls-weight-semibold, 600);
		white-space: nowrap;
	}
}

/* ─── مشترك ───────────────────────────────────────────────── */
.lslg-av {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--ls-surface-3, #232d45);
	color: var(--ls-text-2, #e2e6f0);
	font-weight: var(--ls-weight-semibold, 600);
	font-size: 15px;
	line-height: 1;
}
.lslg-av--me { background: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); }

.lslg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border: 1px solid var(--ls-green-strong, #138a51);
	border-radius: var(--ls-radius, 10px);
	background: var(--ls-green-strong, #138a51);
	color: var(--ls-text, #ffffff);
	font-family: var(--ls-font, "IBM Plex Sans Arabic", sans-serif);
	font-size: var(--ls-text-base, 16px);
	font-weight: var(--ls-weight-semibold, 600);
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.lslg-btn:hover { background: var(--ls-success, #18a963); border-color: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); }
.lslg-btn--ghost { background: transparent; border-color: var(--ls-border-strong, rgba(255, 255, 255, 0.14)); color: var(--ls-text-2, #e2e6f0); }
.lslg-btn--ghost:hover { background: var(--ls-surface-2, #1b2133); border-color: var(--ls-border-strong, rgba(255, 255, 255, 0.14)); color: var(--ls-text, #ffffff); }
.lslg-btn--xl { padding: 15px 28px; font-size: 17px; }
.lslg-btn:focus-visible, .lslg-link:focus-visible { outline: 2px solid var(--ls-green-light, #3fd68c); outline-offset: 3px; }

.lslg-bar { height: 8px; margin-top: 8px; background: var(--ls-surface-3, #232d45); border-radius: var(--ls-radius-full, 999px); overflow: hidden; }
.lslg-bar i { display: block; height: 100%; background: var(--ls-success, #18a963); border-radius: var(--ls-radius-full, 999px); }

/* ─── المنصة بالسلالم ─────────────────────────────────────── */
.lslg-stage {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: end;
	gap: 6px;
	padding-top: 12px;
	border-bottom: 2px solid var(--ls-border-strong, rgba(255, 255, 255, 0.14));
}
.lslg-place { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.lslg-who { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 12px; max-width: 100%; }
.lslg-who .lslg-av { width: 58px; height: 58px; font-size: 21px; border: 2px solid var(--ls-border-strong, rgba(255, 255, 255, 0.14)); }
.lslg-place--1 .lslg-who .lslg-av { width: 76px; height: 76px; font-size: 27px; border: 3px solid var(--ls-success, #18a963); background: var(--ls-surface-2, #1b2133); color: var(--ls-text, #ffffff); }
.lslg-place.is-me .lslg-who .lslg-av { background: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); }
.lslg-crown { margin-bottom: 2px; }
.lslg-who__name { margin-top: 6px; color: var(--ls-text, #ffffff); font-size: 15px; font-weight: var(--ls-weight-semibold, 600); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lslg-who__pts { color: var(--ls-text-muted, #999eb2); font-size: 13px; }
.lslg-place--1 .lslg-who__pts { color: var(--ls-green-light, #3fd68c); font-weight: var(--ls-weight-semibold, 600); }
.lslg-step {
	width: 100%;
	display: flex;
	justify-content: center;
	padding-top: 10px;
	border-top: 6px solid var(--ls-surface-3, #232d45);
	border-radius: 6px 6px 0 0;
	background: var(--ls-surface-2, #1b2133);
	color: var(--ls-text-2, #e2e6f0);
	font-size: 34px;
	font-weight: var(--ls-weight-bold, 700);
	line-height: 1;
}
.lslg-place--1 .lslg-step { height: 150px; background: var(--ls-green-strong, #138a51); border-top-color: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); font-size: 46px; }
.lslg-place--2 .lslg-step { height: 108px; }
.lslg-place--3 .lslg-step { height: 78px; background: var(--ls-surface, #141924); border-top-color: var(--ls-surface-2, #1b2133); }

/* ─── صفحة الدوري ─────────────────────────────────────────── */
.lslg-body { background: var(--ls-bg, #0a0f1a); }
.lslg-page { padding: 0 var(--ls-space-4, 16px) var(--ls-space-16, 64px); font-family: var(--ls-font, "IBM Plex Sans Arabic", sans-serif); color: var(--ls-text-2, #e2e6f0); }
.lslg { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.lslg-head { display: flex; align-items: center; gap: 16px; }
.lslg-head h1 { margin: 0; color: var(--ls-text, #ffffff); font-size: clamp(24px, 4vw, 30px); font-weight: var(--ls-weight-bold, 700); line-height: 1.25; }
.lslg-head__course { color: var(--ls-text-muted, #999eb2); font-weight: var(--ls-weight-medium, 500); }
.lslg-head p { margin: 4px 0 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); }
.lslg-head p b { color: var(--ls-text, #ffffff); font-weight: var(--ls-weight-semibold, 600); }

.lslg-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.lslg-seg { display: flex; padding: 4px; background: var(--ls-surface, #141924); border: 1px solid var(--ls-border, rgba(255, 255, 255, 0.08)); border-radius: var(--ls-radius-full, 999px); }
.lslg-seg a { padding: 7px 16px; border-radius: var(--ls-radius-full, 999px); color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); text-decoration: none; text-align: center; }
.lslg-seg a.is-on { background: var(--ls-surface-3, #232d45); color: var(--ls-text, #ffffff); }
.lslg-select { position: relative; }
.lslg-select summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 16px;
	background: var(--ls-surface, #141924);
	border: 1px solid var(--ls-border, rgba(255, 255, 255, 0.08));
	border-radius: var(--ls-radius-full, 999px);
	color: var(--ls-text-2, #e2e6f0);
	font-size: var(--ls-text-sm, 14px);
	list-style: none;
	cursor: pointer;
}
.lslg-select summary::-webkit-details-marker { display: none; }
.lslg-select summary svg { color: var(--ls-text-dim, #7a7f96); }
.lslg-select__menu {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline-start: 0;
	z-index: 20;
	min-width: 240px;
	padding: 6px;
	background: var(--ls-surface-2, #1b2133);
	border: 1px solid var(--ls-border-strong, rgba(255, 255, 255, 0.14));
	border-radius: var(--ls-radius-md, 16px);
	box-shadow: var(--ls-shadow, 0 4px 16px rgba(0, 0, 0, 0.28));
}
.lslg-select__menu a { display: block; padding: 9px 12px; border-radius: var(--ls-radius-sm, 8px); color: var(--ls-text-2, #e2e6f0); font-size: var(--ls-text-sm, 14px); text-decoration: none; }
.lslg-select__menu a:hover { background: var(--ls-surface-3, #232d45); }
.lslg-select__menu a.is-on { color: var(--ls-green-light, #3fd68c); font-weight: var(--ls-weight-semibold, 600); }

.lslg-empty { padding: var(--ls-space-8, 32px) var(--ls-space-5, 20px); text-align: center; background: var(--ls-surface, #141924); border: 1px dashed var(--ls-green-line, rgba(24, 169, 99, 0.38)); border-radius: var(--ls-radius-md, 16px); }
.lslg-empty b { color: var(--ls-text, #ffffff); font-size: var(--ls-text-lg, 18px); }
.lslg-empty p { margin: 6px 0 0; color: var(--ls-text-muted, #999eb2); }

.lslg-me { display: flex; align-items: center; gap: 18px; padding: 16px 18px; background: var(--ls-surface, #141924); border: 1px solid var(--ls-green-line, rgba(24, 169, 99, 0.38)); border-radius: var(--ls-radius-md, 16px); }
.lslg-me--muted { border-color: var(--ls-border, rgba(255, 255, 255, 0.08)); }
.lslg-me .lslg-av { width: 46px; height: 46px; font-size: 17px; }
.lslg-me form { margin: 0; }
.lslg-me__txt { flex: 1; min-width: 0; }
.lslg-me__txt b { color: var(--ls-text, #ffffff); font-size: 17px; font-weight: var(--ls-weight-bold, 700); }
.lslg-me__txt p { margin: 2px 0 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); line-height: 1.6; }
.lslg-me__txt strong { color: var(--ls-text, #ffffff); font-weight: var(--ls-weight-semibold, 600); }

.lslg-guest { display: flex; align-items: center; gap: 18px; padding: 18px; background: var(--ls-surface, #141924); border: 1px dashed var(--ls-green-line, rgba(24, 169, 99, 0.38)); border-radius: var(--ls-radius-md, 16px); }
.lslg-guest__empty { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--ls-border-strong, rgba(255, 255, 255, 0.14)); color: var(--ls-text-dim, #7a7f96); font-size: 20px; }
.lslg-guest__txt { flex: 1; }
.lslg-guest__txt b { color: var(--ls-text, #ffffff); font-size: 17px; }
.lslg-guest__txt p { margin: 2px 0 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); line-height: 1.6; }
.lslg-guest__btns { display: flex; gap: 8px; }

.lslg-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lslg-row { display: grid; grid-template-columns: 40px 38px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; background: var(--ls-surface, #141924); border-radius: var(--ls-radius, 10px); }
.lslg-row__r { color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-base, 16px); font-weight: var(--ls-weight-bold, 700); text-align: center; }
.lslg-row__n { min-width: 0; overflow: hidden; color: var(--ls-text, #ffffff); font-size: 15px; font-weight: var(--ls-weight-medium, 500); text-overflow: ellipsis; white-space: nowrap; }
.lslg-row__d { min-width: 30px; color: var(--ls-green-light, #3fd68c); font-size: var(--ls-text-xs, 12px); text-align: left; }
.lslg-row__p { min-width: 64px; color: var(--ls-text-2, #e2e6f0); font-size: 15px; font-weight: var(--ls-weight-semibold, 600); text-align: left; }
.lslg-row__p small { color: var(--ls-text-dim, #7a7f96); font-size: var(--ls-text-xs, 12px); font-weight: var(--ls-weight-normal, 400); }
.lslg-row.is-me { background: var(--ls-green-soft, rgba(24, 169, 99, 0.12)); outline: 1px solid var(--ls-green-line, rgba(24, 169, 99, 0.38)); }
.lslg-row.is-me .lslg-row__r { color: var(--ls-green-light, #3fd68c); }
.lslg-row.is-me .lslg-av { background: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); }
.lslg-dots { padding: 2px 0; color: var(--ls-text-dim, #7a7f96); font-size: 13px; letter-spacing: 6px; text-align: center; }

.lslg-how { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 14px; border-top: 1px solid var(--ls-border, rgba(255, 255, 255, 0.08)); color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); }
.lslg-chip { padding: 5px 12px; background: var(--ls-surface, #141924); border: 1px solid var(--ls-border, rgba(255, 255, 255, 0.08)); border-radius: var(--ls-radius-full, 999px); color: var(--ls-text-2, #e2e6f0); font-size: 13px; }
.lslg-chip b { color: var(--ls-green-light, #3fd68c); font-weight: var(--ls-weight-bold, 700); }
.lslg-privacy { color: var(--ls-text-dim, #7a7f96); font-size: 13px; line-height: 1.7; }
.lslg-inline-form { display: inline; margin: 0; }
.lslg-inline-form button { padding: 0; background: none; border: 0; color: var(--ls-text-2, #e2e6f0); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ─── كارت لوحة الطالب ────────────────────────────────────── */
.lslg-dash {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 var(--ls-space-6, 24px);
	padding: 16px 18px;
	background: var(--ls-surface, #141924);
	border: 1px solid var(--ls-green-line, rgba(24, 169, 99, 0.38));
	border-radius: var(--ls-radius-md, 16px);
	color: var(--ls-text-muted, #999eb2);
	font-family: var(--ls-font, "IBM Plex Sans Arabic", sans-serif);
	text-decoration: none;
}
.lslg-dash:hover { background: var(--ls-surface-2, #1b2133); }
.lslg-dash .lslg-cup { flex: none; }
.lslg-dash__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--ls-text-sm, 14px); }
.lslg-dash__txt b { color: var(--ls-text, #ffffff); font-size: var(--ls-text-lg, 18px); font-weight: var(--ls-weight-bold, 700); }
.lslg-dash__go { color: var(--ls-green-light, #3fd68c); font-size: var(--ls-text-sm, 14px); font-weight: var(--ls-weight-semibold, 600); white-space: nowrap; }

/* ─── سكشن الرئيسية ───────────────────────────────────────── */
.lslg-home__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: end; }
.lslg-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); font-weight: var(--ls-weight-semibold, 600); }
.lslg-home .lsh-h2 { margin-top: 8px; }
.lslg-home__sub { margin: 10px 0 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-base, 16px); line-height: 1.8; }
.lslg-home__sub b { color: var(--ls-text, #ffffff); font-weight: var(--ls-weight-semibold, 600); }
.lslg-home__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }
.lslg-link { color: var(--ls-text-2, #e2e6f0); font-size: 15px; font-weight: var(--ls-weight-semibold, 600); text-decoration: none; }
.lslg-link:hover { color: var(--ls-text, #ffffff); }

/* ─── سطر صفحة الكورس ─────────────────────────────────────── */
.lslg-strip {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
	padding: 12px 16px;
	background: var(--ls-surface, #141924);
	border: 1px solid var(--ls-border, rgba(255, 255, 255, 0.08));
	border-inline-start: 3px solid var(--ls-success, #18a963);
	border-radius: var(--ls-radius, 10px);
}
.lslg-strip > span { flex: 1; color: var(--ls-text-muted, #999eb2); font-size: 15px; line-height: 1.6; }
.lslg-strip b { color: var(--ls-text, #ffffff); font-weight: var(--ls-weight-semibold, 600); }
.lslg-strip a { color: var(--ls-green-light, #3fd68c); font-size: var(--ls-text-sm, 14px); font-weight: var(--ls-weight-semibold, 600); text-decoration: none; white-space: nowrap; }

/* ─── رسالة النقط ─────────────────────────────────────────── */
.lslg-toast {
	position: fixed;
	top: 88px;
	left: 50%;
	z-index: 100000;
	transform: translateX(-50%);
	width: min(460px, calc(100% - 24px));
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--ls-surface-2, #1b2133);
	border: 1px solid var(--ls-green-line, rgba(24, 169, 99, 0.38));
	border-radius: var(--ls-radius-md, 16px);
	box-shadow: var(--ls-shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.36));
	font-family: var(--ls-font, "IBM Plex Sans Arabic", sans-serif);
	direction: rtl;
}
.lslg-toast__tk { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ls-success, #18a963); color: var(--ls-text, #ffffff); }
.lslg-toast__txt { flex: 1; min-width: 0; color: var(--ls-text-muted, #999eb2); font-size: var(--ls-text-sm, 14px); line-height: 1.5; }
.lslg-toast__txt b { display: block; color: var(--ls-text, #ffffff); font-size: var(--ls-text-base, 16px); font-weight: var(--ls-weight-bold, 700); }
.lslg-toast__link { color: var(--ls-green-light, #3fd68c); font-size: 13px; font-weight: var(--ls-weight-semibold, 600); text-decoration: none; white-space: nowrap; }
.lslg-toast__x { padding: 0 4px; background: none; border: 0; color: var(--ls-text-dim, #7a7f96); font-size: 20px; line-height: 1; cursor: pointer; }

/* ─── الموبايل ───────────────────────────────────────────── */
@media (max-width: 900px) {
	.lslg-home__grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
	.lslg-head .lslg-cup { width: 48px; height: 48px; }
	.lslg-controls, .lslg-seg, .lslg-select { width: 100%; }
	.lslg-seg a { flex: 1; }
	.lslg-select__menu { inset-inline: 0; min-width: 0; }
	.lslg-who .lslg-av { width: 46px; height: 46px; font-size: 17px; }
	.lslg-place--1 .lslg-who .lslg-av { width: 60px; height: 60px; font-size: 22px; }
	.lslg-who__name { font-size: 13px; }
	.lslg-who__pts { font-size: 12px; }
	.lslg-place--1 .lslg-step { height: 120px; font-size: 38px; }
	.lslg-place--2 .lslg-step { height: 86px; font-size: 28px; }
	.lslg-place--3 .lslg-step { height: 62px; font-size: 28px; }
	.lslg-me, .lslg-guest { flex-wrap: wrap; padding: 14px; }
	.lslg-me .lslg-btn, .lslg-me form, .lslg-me form .lslg-btn { width: 100%; }
	.lslg-guest__btns { width: 100%; }
	.lslg-guest__btns .lslg-btn { flex: 1; }
	.lslg-row { grid-template-columns: 30px 34px 1fr auto; gap: 10px; padding: 9px 12px; }
	.lslg-row__d { display: none; }
	.lslg-row .lslg-av { width: 34px; height: 34px; font-size: 14px; }
	.lslg-dash { flex-wrap: wrap; }
	.lslg-dash__go { width: 100%; }
	.lslg-home__btns .lslg-btn { width: 100%; }
	.lslg-strip { flex-wrap: wrap; align-items: flex-start; }
	.lslg-strip > span { flex-basis: calc(100% - 40px); font-size: var(--ls-text-sm, 14px); }
	.lslg-strip a { margin-inline-start: 34px; }
	.lslg-toast { top: 76px; }
	.lslg-toast__link { display: none; }
}
