/* منصة القدرات الكمية — التنسيق العام */
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("../fonts/almarai-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Almarai"; font-weight: 700; font-display: swap; src: url("../fonts/almarai-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("../fonts/almarai-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-22FF; }
@font-face { font-family: "Almarai"; font-weight: 700; font-display: swap; src: url("../fonts/almarai-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-22FF; }

:root {
    --brand: #1559c9; --brand-600: #1f6fd0; --brand-400: #2f86ff; --brand-50: #eef4ff; --brand-100: #dbe7ff;
    --ink: #172033; --muted: #687387; --line: #e3e8f0; --canvas: #f4f7fc; --card: #fff;
    --good: #12805c; --good-50: #e9f8f1; --bad: #c8333f; --bad-50: #fdeef0; --warn: #b26b00; --warn-50: #fff6e5;
    --gold: #f5b400; --radius: 2px; --shadow: 0 1px 2px rgba(20, 40, 80, .06), 0 6px 20px rgba(20, 40, 80, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.75 "Almarai", Tahoma, Arial, sans-serif; color: var(--ink); background: var(--canvas); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .4em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 2px; font-size: .85em; word-break: break-all; }
small { font-size: .82em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ─── الشريط العلوي ─── */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--brand-400), var(--brand)); color: #fff; font: 700 22px/1 "DejaVu Sans", Arial, sans-serif; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text small { color: var(--muted); font-weight: 400; font-size: .74rem; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav a { padding: 7px 12px; border-radius: 2px; color: var(--muted); font-weight: 700; font-size: .92rem; }
.nav a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.nav a.on { background: var(--brand-50); color: var(--brand); }
.nav .nav-out { color: var(--bad); }
.nav .nav-install { display: none; }
.points-pill { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 2px; background: #fff8e1; border: 1px solid #f7e2a1; color: #7a5600; }
.points-pill:hover { text-decoration: none; }
.points-pill small { font-size: .75rem; }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 2px; width: 40px; height: 38px; font-size: 18px; cursor: pointer; }

.main { max-width: 1120px; margin: 0 auto; padding: 22px 18px 120px; }
.auth-main { min-height: 100vh; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ─── أزرار ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 2px; border: 1px solid transparent;
    background: var(--brand); color: #fff; font: 700 .95rem/1.4 inherit; font-family: inherit; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { padding: 12px 24px; font-size: 1.02rem; border-radius: 2px; }
.btn-sm { padding: 5px 12px; font-size: .85rem; border-radius: 2px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--brand-100); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-success { background: var(--good); }
.btn-warn { background: #e58a00; }
.btn-danger { background: var(--bad); }
.btn-wa { background: #1fa855; }
.btn-google { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 11px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn-google svg { width: 20px; height: 20px; }
.btn-google:hover { background: #f8fafc; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-size: .82rem; cursor: pointer; padding: 0; }
.link-btn:disabled { color: var(--muted); cursor: default; }
.link { font-weight: 700; font-size: .9rem; }

/* ─── تنبيهات ─── */
.flash { padding: 11px 14px; border-radius: 2px; margin: 0 0 14px; font-size: .93rem; border: 1px solid; }
.flash-success { background: var(--good-50); border-color: #bfe6d3; color: #0d5e44; }
.flash-error { background: var(--bad-50); border-color: #f3c6cc; color: #8f1d29; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: 2px;
    background: linear-gradient(90deg, #fff8e1, #fff); border: 1px solid #f7e2a1; animation: pop .35s ease-out; }
.notice > div { flex: 1; display: flex; flex-direction: column; }
.notice span { color: var(--muted); font-size: .9rem; }
.notice-welcome { background: linear-gradient(90deg, var(--brand-50), #fff); border-color: var(--brand-100); }
.notice form { margin: 0; }
.notice-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ─── بطاقات ─── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 720px; margin-inline: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h1, .card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.grid-2.tight { gap: 12px; }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
    padding: 22px 24px; border-radius: 2px; color: #fff; background: linear-gradient(120deg, #1559c9, #2f86ff 70%, #57a0ff); box-shadow: 0 10px 30px rgba(21, 89, 201, .18); }
.welcome h1 { margin: 0 0 4px; }
.welcome p { margin: 0; opacity: .95; }
.welcome a:not(.btn) { color: #fff; text-decoration: underline; }
.welcome .muted { color: rgba(255,255,255,.82); }
.welcome .btn:not(.btn-warn) { background: #fff; color: var(--brand); }
.welcome form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.stat span { grid-row: span 2; font-size: 26px; }
.stat b { font-size: 1.3rem; line-height: 1.2; }
.stat small { color: var(--muted); }
.progress-line { height: 8px; border-radius: 2px; background: #e4eaf3; overflow: hidden; margin: 0 0 18px; }
.progress-line div { height: 100%; background: linear-gradient(90deg, var(--good), #2fbf86); border-radius: 2px; }

/* ─── المستويات ─── */
.levels { display: flex; flex-direction: column; gap: 10px; }
.level { border: 1px solid var(--line); border-radius: 2px; background: #fff; overflow: hidden; }
.level summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.level summary::-webkit-details-marker { display: none; }
.level-no { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #eef2f7; color: var(--muted); flex: none; }
.level-title { flex: 1; font-weight: 700; display: flex; flex-direction: column; line-height: 1.4; }
.level-title small { color: var(--muted); font-weight: 400; }
.level-bar { width: 110px; height: 7px; border-radius: 2px; background: #edf1f6; overflow: hidden; flex: none; }
.level-bar i { display: block; height: 100%; background: var(--good); border-radius: 2px; }
.level-done .level-no { background: var(--good); color: #fff; }
.level-current { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }
.level-current .level-no { background: var(--brand); color: #fff; }
.level-locked { opacity: .6; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 14px 14px; }
.stage { border-radius: 2px; border: 1px dashed var(--line); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 104px; justify-content: center; }
.stage form { margin: 0; }
.stage-day { font-weight: 700; font-size: .92rem; }
.stage-score { font-size: .82rem; color: var(--muted); }
.stage-done { background: var(--good-50); border: 1px solid #c4ead8; }
.stage-done .stage-score { color: var(--good); font-weight: 700; font-size: 1rem; }
.stage-open { background: var(--brand-50); border: 2px solid var(--brand-400); }
.stage-open .stage-score { color: #8a6400; font-weight: 700; }
.stage-lock { opacity: .55; }

/* ─── قوائم ─── */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #f0f3f7; }
.list li:last-child { border-bottom: 0; }
.list li > span:first-child { display: flex; flex-direction: column; }
.score { font-weight: 700; padding: 2px 10px; border-radius: 2px; font-size: .88rem; }
.score.good { background: var(--good-50); color: var(--good); }
.score.bad { background: var(--bad-50); color: var(--bad); }
.plus { color: var(--good); font-weight: 700; } .minus { color: var(--bad); font-weight: 700; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 2px; background: #eef2f7; color: var(--muted); font-size: .76rem; font-weight: 700; font-style: normal; }
.tag-good { background: var(--good-50); color: var(--good); }
.tag-bad { background: var(--bad-50); color: var(--bad); }

.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row.big input { font-size: 1rem; padding: 12px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-card { background: linear-gradient(160deg, #fff, #fff8e6); }
.invite-hero { text-align: center; padding: 30px 24px; background: linear-gradient(160deg, #fff, var(--brand-50)); }
.invite-hero .copy-row, .invite-hero .share-row { max-width: 560px; margin-inline: auto; justify-content: center; }

/* ─── نماذج ─── */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .92rem; }
.form label small { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d4dbe6; border-radius: 2px; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
input:disabled { background: #f3f5f9; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.form .check, .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
.inline-form { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: end; gap: 10px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions-row form { margin: 0; }
.opt-edit { display: flex; align-items: center; gap: 8px; }
.opt-edit input[type=radio] { width: 20px; height: 20px; accent-color: var(--good); flex: none; }

/* ─── صفحات الدخول ─── */
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 28px; box-shadow: 0 20px 50px rgba(20, 40, 80, .08); }
.auth-card h1 { text-align: center; margin-bottom: 16px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: var(--ink); margin-bottom: 18px; }
.auth-brand:hover { text-decoration: none; }
.auth-alt { text-align: center; margin: 14px 0 0; font-size: .92rem; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.invited { background: #fff8e1; border: 1px solid #f7e2a1; border-radius: 2px; padding: 10px 14px; }

/* ─── الصفحة الرئيسية ─── */
.landing .auth-main { justify-content: flex-start; }
.hero { max-width: 1080px; width: 100%; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 40px 10px 30px; }
.eyebrow { display: inline-block; background: var(--brand-50); color: var(--brand); padding: 4px 12px; border-radius: 2px; font-weight: 700; font-size: .85rem; margin-bottom: 14px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 14px; }
.lead { font-size: 1.08rem; color: #44506a; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.ladder { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rung { width: var(--w); display: flex; justify-content: space-between; padding: 7px 14px; border-radius: 2px; color: #fff; font-size: .85rem;
    background: linear-gradient(90deg, var(--brand), var(--brand-400)); box-shadow: 0 4px 12px rgba(21, 89, 201, .14); }
.rung:nth-child(n+6) { background: linear-gradient(90deg, #2f86ff, #6aaeff); }
.features { max-width: 1080px; width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 10px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 18px; }
.feature span { font-size: 28px; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ─── المرحلة ─── */
.quiz-page .main { max-width: 820px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.quiz-title { display: flex; flex-direction: column; }
.quiz-title small { color: var(--muted); }
.timer { position: relative; width: 78px; height: 78px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 3.2; }
.t-bg { stroke: #e3e9f2; }
.t-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 1rem/1 "Almarai", monospace; direction: ltr; }
.timer.warn .t-fg { stroke: #e58a00; } .timer.warn span { color: #b26b00; }
.timer.danger .t-fg { stroke: var(--bad); } .timer.danger span { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.quiz-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.quiz-nav button { width: 36px; height: 36px; border-radius: 2px; border: 1px solid var(--line); background: #fff; font: 700 .85rem inherit; font-family: inherit; cursor: pointer; color: var(--muted); }
.quiz-nav button.ans { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.quiz-nav button.flg { box-shadow: inset 0 -3px 0 #e58a00; }
.quiz-nav button.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 22px; box-shadow: var(--shadow); min-height: 320px; }
.q-card header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: .88rem; margin-bottom: 10px; }
.flag { border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--muted); }
.flag.on { background: #fff3df; border-color: #f3c47b; color: #9a5d00; }
.q-stem { font-size: 1.12rem; font-weight: 700; white-space: pre-line; line-height: 2; unicode-bidi: plaintext; margin-bottom: 16px; }
.q-options { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 2px; background: #fff;
    font: inherit; font-size: 1.02rem; cursor: pointer; transition: border-color .12s, background .12s; color: var(--ink); }
.opt:hover { border-color: var(--brand-100); background: #fafcff; }
.opt.on { border-color: var(--brand); background: var(--brand-50); }
.opt-l { width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: .9rem; }
.opt.on .opt-l { background: var(--brand); color: #fff; }
.opt-t { unicode-bidi: plaintext; }
.q-saved { min-height: 1.6em; margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.quiz-actions { display: flex; justify-content: space-between; margin-top: 14px; }
.quiz-submit { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); }
.submitting .q-card { opacity: .6; pointer-events: none; }

.modal { border: 0; border-radius: 2px; padding: 22px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 30px 70px rgba(0,0,0,.25); font-family: inherit; color: var(--ink); }
.modal::backdrop { background: rgba(15, 25, 45, .45); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.steps { padding-inline-start: 20px; line-height: 2.1; }

/* ─── النتيجة ─── */
.result { display: flex; gap: 26px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.result-ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(var(--c, var(--good)) calc(var(--p) * 1%), #e8edf4 0); }
.result-ring b { font-size: 1.9rem; line-height: 1.1; }
.result-ring small { color: var(--muted); }
.is-fail .result-ring { --c: #e58a00; }
.points-won { display: inline-block; background: #fff8e1; border: 1px solid #f7e2a1; padding: 6px 14px; border-radius: 2px; font-weight: 700; color: #7a5600; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.result-actions form { margin: 0; }
.tabs { display: flex; gap: 4px; background: #eef2f7; padding: 3px; border-radius: 2px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 2px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--muted); font-weight: 700; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.review { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.review .rv-ok { display: none; }
.review.show-all .rv-ok { display: block; }
.rv { border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; border-inline-start: 4px solid var(--bad); }
.rv-ok { border-inline-start-color: var(--good); }
.rv header { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.rv-state { margin-inline-start: auto; }
.rv-bad .rv-state { color: var(--bad); } .rv-ok .rv-state { color: var(--good); }
.rv .q-stem { font-size: 1rem; margin-bottom: 8px; }
.rv-opts, .qb-opts { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rv-opts li, .qb-opts li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 2px; background: #f6f8fb; font-size: .93rem; unicode-bidi: plaintext; }
.rv-opts .opt-l, .qb-opts .opt-l { width: 24px; height: 24px; font-size: .78rem; }
.rv-opts li.correct, .qb-opts li.correct { background: var(--good-50); color: #0d5e44; font-weight: 700; }
.rv-opts li.correct .opt-l, .qb-opts li.correct .opt-l { background: var(--good); color: #fff; }
.rv-opts li.chosen { background: var(--bad-50); color: #8f1d29; text-decoration: line-through; }
.explain { background: #f5f9ff; border: 1px solid var(--brand-100); border-radius: 2px; padding: 10px 12px; font-size: .93rem; white-space: pre-line; unicode-bidi: plaintext; }

/* ─── لوحة الشرف ─── */
.board { list-style: none; padding: 0; margin: 0; }
.board li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 2px; }
.board li:nth-child(odd) { background: #f7f9fc; }
.board li.me { background: var(--brand-50); outline: 2px solid var(--brand-100); }
.board .pos { width: 34px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.board .nm { flex: 1; }
.board.compact li { padding: 7px 10px; }
.board-me { text-align: center; margin-top: 14px; color: var(--muted); }

/* ─── لوحة المعلمة ─── */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; font-size: .88rem; }
.bar { height: 12px; background: #edf1f6; border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-400)); border-radius: 2px; }
.bar.bad i { background: linear-gradient(90deg, #e58a00, #f3b04d); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; color: var(--muted); font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.table tr.off td { opacity: .5; }
.mini-bar { width: 80px; height: 6px; background: #edf1f6; border-radius: 2px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--good); }
.map { display: flex; flex-direction: column; gap: 5px; }
.map-row { display: flex; align-items: center; gap: 5px; }
.map-row span { width: 34px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.map-row i { width: 46px; height: 28px; border-radius: 2px; background: #eef2f7; font-style: normal; font-size: .75rem; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.map-row i.ok { background: var(--good); }
.map-row i.cur { background: #fff; outline: 2px dashed var(--brand-400); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 4px 12px; border-radius: 2px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .84rem; }
.chip:hover { text-decoration: none; border-color: var(--brand-100); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-off { opacity: .55; }
.chip b { font-weight: 400; opacity: .7; }
.qb { border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px; margin-bottom: 10px; }
.qb.off { background: #fafafa; opacity: .65; }
.qb header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.qb-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.qb-actions form { margin: 0; }
.qb .q-stem { font-size: 1rem; margin-bottom: 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 14px; }
.install-box { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }

/* ─── شريط التثبيت ─── */
.install-banner { position: fixed; z-index: 8400; bottom: 14px; right: 14px; left: 96px; max-width: 520px; margin-inline: auto; display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; box-shadow: 0 14px 40px rgba(20, 40, 80, .18); animation: pop .3s ease-out; }
.install-banner img { border-radius: 2px; }
.install-banner div { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.install-banner small { color: var(--muted); }
.install-x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }

/* ─── الجوال ─── */
@media (max-width: 860px) {
    .grid-2, .hero { grid-template-columns: 1fr; }
    .features { grid-template-columns: 1fr 1fr; }
    .hero-art { order: -1; }
    .rung { padding: 4px 12px; font-size: .78rem; }
    .nav-toggle { display: block; margin-inline-start: auto; }
    .nav { display: none; position: absolute; top: 100%; right: 0; left: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 12px; box-shadow: 0 10px 20px rgba(0,0,0,.06); }
    .nav.open { display: flex; }
    .nav a { padding: 11px 12px; }
    .nav .nav-install { display: block; }
    .points-pill { margin-inline-start: auto; }
    .points-pill + .nav-toggle { margin-inline-start: 0; }
    .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    body { font-size: 14.5px; }
    .main { padding: 14px 12px 110px; }
    .brand-text small { display: none; }
    .brand-text { font-size: .9rem; }
    .topbar-in { gap: 10px; padding: 8px 12px; }
    .welcome { padding: 18px; }
    .welcome h1 { font-size: 1.25rem; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 0 8px 10px; }
    .stage { min-height: 88px; padding: 8px 2px; }
    .stage-day { font-size: .78rem; }
    .stage .btn-sm { padding: 4px 8px; font-size: .78rem; }
    .stage .link-btn { font-size: .7rem; }
    .level-bar { width: 60px; }
    .features { grid-template-columns: 1fr; }
    .result { flex-direction: column; text-align: center; }
    .result-actions { justify-content: center; }
    .rv-opts, .qb-opts, .checks { grid-template-columns: 1fr; }
    .q-card { padding: 16px; }
    .q-stem { font-size: 1.04rem; }
    .timer { width: 66px; height: 66px; }
    .card { padding: 16px; }
    .map-row i { width: 100%; }
    .install-banner { left: 12px; right: 12px; bottom: 88px; }
}

/* ─── الأيقونات (SVG) ─── */
.ic { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; display: inline-block; }
.ic-title { width: 1.1em; height: 1.1em; color: var(--brand); vertical-align: -.15em; }
.welcome .ic-title { color: #fff; }
.ic-star { color: var(--gold); fill: var(--gold); }
img.brand-mark { display: block; object-fit: cover; }
.nav a { display: inline-flex; align-items: center; gap: 6px; }
.nav a .ic { width: 17px; height: 17px; opacity: .85; }
.nav-toggle { display: none; align-items: center; justify-content: center; }
.nav-toggle .ic { width: 20px; height: 20px; }
.points-pill .ic { width: 17px; height: 17px; }
.with-ic { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.btn .ic { width: 1.1em; height: 1.1em; }
.stat .stat-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 2px; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.stat .stat-ic .ic { width: 22px; height: 22px; }
.stat-ic.ic-gold { background: #fff6dc; color: #c58a00; }
.stat-ic.ic-green { background: var(--good-50); color: var(--good); }
.stat-ic.ic-pink { background: #fdecf3; color: #c2387a; }
.stat-ic.ic-orange { background: #fff1e3; color: #d9690b; }
.stat-ic.ic-purple { background: #f1ecff; color: #6a4bd6; }
.stat-ic.ic-blue { background: var(--brand-50); color: var(--brand); }
.feature .feature-ic { display: inline-flex; width: 46px; height: 46px; border-radius: 2px; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); margin-bottom: 6px; }
.feature .feature-ic .ic { width: 24px; height: 24px; }
.feature span:not(.feature-ic) { font-size: inherit; }
.notice-ic { width: 38px; height: 38px; border-radius: 2px; display: flex; align-items: center; justify-content: center; background: #fff; color: #c58a00; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.notice-welcome .notice-ic { color: var(--brand); }
.notice-x { display: flex; padding: 4px; border-radius: 2px; }
.notice-x:hover { background: rgba(0,0,0,.05); }
.level-no .ic { width: 18px; height: 18px; }
.stage-lock .ic { width: 20px; height: 20px; color: #9aa5b5; }
.stage-score .ic-star { width: 15px; height: 15px; }
.flag { display: inline-flex; align-items: center; gap: 5px; }
.flag .ic { width: 15px; height: 15px; }
.flag.on .ic { fill: #f3c47b; }
.q-saved .ic { width: 15px; height: 15px; }
.rv-state { display: inline-flex; align-items: center; gap: 4px; }
.rv-state .ic { width: 16px; height: 16px; }
.explain b { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); }
.points-won { display: inline-flex; align-items: center; gap: 6px; }
.invited .ic { color: #c2387a; }
.hero-ic { display: inline-flex; width: 64px; height: 64px; border-radius: 2px; align-items: center; justify-content: center; background: #fff; color: var(--brand); box-shadow: var(--shadow); margin-bottom: 10px; }
.hero-ic .ic { width: 30px; height: 30px; }
.board .pos { display: flex; justify-content: center; }
.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 50%; font-weight: 700; color: var(--muted); position: relative; }
.rank .ic { width: 30px; height: 30px; }
.rank b { position: absolute; bottom: 4px; font-size: .62rem; color: #fff; }
.rank-gold { color: #e0a200; } .rank-gold .ic circle { fill: #f5b400; }
.rank-silver { color: #8f9aab; } .rank-silver .ic circle { fill: #aab4c3; }
.rank-bronze { color: #b86a2e; } .rank-bronze .ic circle { fill: #cd7f3e; }
.install-box h3 { display: flex; align-items: center; gap: 6px; }
.install-x { display: flex; }
.modal h3 { display: flex; align-items: center; gap: 8px; }
.modal h3 .ic { color: var(--brand); }
.kbd { display: inline-flex; vertical-align: middle; padding: 2px 5px; border: 1px solid var(--line); border-radius: 2px; background: #f6f8fb; }
.offline-ic { color: var(--muted); margin: 0 0 6px; }
.auth-card h1 .ic { color: var(--good); }
.tc-tool .ic, #tc-close .ic, #tc-attach-clear .ic { width: 18px; height: 18px; vertical-align: middle; }
.tc-rd .ic { width: 14px; height: 14px; vertical-align: -3px; }
.tc-attach-icon .ic { width: 20px; height: 20px; }
@media (max-width: 860px) { .nav-toggle { display: flex; } }

/* ═══ الصفحة الرئيسية (الواجهة) ═══ */
body.landing { background: #eef3fc; overflow-x: hidden; }
.landing .auth-main { display: block; min-height: 100vh; padding: 56px 24px; position: relative; }
.lp-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(1200px 500px at 15% 105%, #d7e6fd 0 40%, transparent 41%),
        radial-gradient(900px 420px at 110% -10%, #dfe9fb 0 45%, transparent 46%),
        #eef3fc; }
.lp { position: relative; z-index: 1; max-width: 1230px; margin: 0 auto; background: #fbfcff; border-radius: 2px;
    box-shadow: 0 30px 80px rgba(21, 60, 140, .10), 0 2px 6px rgba(21, 60, 140, .05); overflow: hidden; }

.lp-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 48px; border-bottom: 1px solid #e7edf7; position: relative; }
.lp-brand { display: flex; align-items: center; gap: 14px; color: #12204a; }
.lp-brand:hover { text-decoration: none; }
.lp-logo { width: 54px; height: 54px; flex: none; }
.lp-brand span { display: flex; flex-direction: column; line-height: 1.25; }
.lp-brand b { font-size: 1.75rem; font-weight: 700; color: #12204a; }
.lp-brand small { font-size: 1.05rem; color: #5c6780; text-align: right; letter-spacing: .3px; }
.lp-login { display: inline-flex; align-items: center; gap: 10px; background: #1559c9; color: #fff; font-weight: 700; font-size: 1.05rem;
    padding: 13px 26px; border-radius: 2px; box-shadow: 0 8px 20px rgba(21, 89, 201, .22); }
.lp-login:hover { text-decoration: none; filter: brightness(1.08); }
.lp-login .ic { width: 22px; height: 22px; }
.lp-menu { display: none; background: none; border: 0; color: #12204a; padding: 6px; cursor: pointer; }
.lp-menu .ic { width: 28px; height: 28px; }
.lp-drawer { position: absolute; top: 100%; left: 14px; right: 14px; z-index: 5; background: #fff; border: 1px solid #e3e9f4; border-radius: 2px;
    box-shadow: 0 18px 40px rgba(20, 40, 90, .14); padding: 8px; display: flex; flex-direction: column; }
.lp-drawer[hidden] { display: none; }
.lp-drawer a { padding: 13px 14px; border-radius: 2px; color: #12204a; font-weight: 700; }
.lp-drawer a:hover { background: #eef4ff; text-decoration: none; }

.lp-hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 24px; padding: 64px 56px 40px; }
.lp-copy { display: flex; flex-direction: column; align-items: flex-start; }
.lp-eyebrow { display: inline-block; background: #e8f0fd; color: #1559c9; font-weight: 700; font-size: 1.2rem; padding: 10px 26px; border-radius: 2px; margin-bottom: 30px; }
.lp-hero h1 { white-space: nowrap; font-size: clamp(1.9rem, 3.2vw, 3.05rem); line-height: 1.45; color: #0f1b3d; font-weight: 700; margin: 0 0 22px; }
.lp-swash { position: relative; display: inline-block; }
.lp-swash svg { position: absolute; right: -4%; bottom: -.18em; width: 110%; height: .32em; }
.lp-lead { font-size: 1.55rem; color: #4f5b75; margin: 0 0 40px; }
.lp-invited { display: flex; align-items: center; gap: 8px; background: #fff8e1; border: 1px solid #f7e2a1; border-radius: 2px; padding: 10px 16px; margin: -18px 0 26px; }
.lp-invited .ic { color: #c2387a; }
.lp-actions { display: flex; gap: 20px; flex-wrap: wrap; }
.lp-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 230px; padding: 16px 34px; border-radius: 2px; font-weight: 700; font-size: 1.3rem; transition: filter .15s, background .15s; }
.lp-btn:hover { text-decoration: none; }
.lp-btn-primary { background: #1559c9; color: #fff; box-shadow: 0 12px 26px rgba(21, 89, 201, .25); }
.lp-btn-primary:hover { filter: brightness(1.08); }
.lp-btn-outline { background: #fff; color: #12204a; border: 2px solid #1559c9; }
.lp-btn-outline:hover { background: #f1f6ff; }
.lp-visual { display: flex; justify-content: center; }
.lp-art { width: 100%; max-width: 560px; height: auto; }
.lp-art text { font-family: "Almarai", Tahoma, sans-serif; }
.art-num { font-size: 30px; font-weight: 700; }
.art-lbl { font-size: 15px; font-weight: 700; }

.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px 40px 40px; padding: 28px 10px; background: #f0f5fd; border-radius: 2px; }
.lp-feature { text-align: center; padding: 6px 24px; display: flex; flex-direction: column; align-items: center; }
.lp-feature + .lp-feature { border-inline-start: 1px solid #d9e3f3; }
.lp-f-ic { color: #2b6fe3; margin-bottom: 8px; }
.lp-f-ic .ic { width: 50px; height: 50px; stroke-width: 1.8; }
.lp-feature h3 { font-size: 1.65rem; color: #0f1b3d; margin: 0 0 6px; }
.lp-feature p { color: #4f5b75; font-size: 1.12rem; margin: 0; }

@media (max-width: 1060px) {
    .lp-hero { padding: 48px 36px 30px; }
    .lp-btn { min-width: 0; font-size: 1.1rem; padding: 14px 26px; }
    .lp-lead { font-size: 1.3rem; }
}
@media (max-width: 820px) {
    .landing .auth-main { padding: 0; }
    .lp { border-radius: 2px; box-shadow: none; min-height: 100vh; background: #fff; }
    .lp-head { padding: 16px 20px; }
    .lp-brand { gap: 10px; }
    .lp-brand b { font-size: 1.2rem; }
    .lp-brand small { font-size: .78rem; }
    .lp-logo { width: 40px; height: 40px; }
    .lp-login { display: none; }
    .lp-menu { display: flex; }
    .lp-hero { grid-template-columns: 1fr; padding: 22px 20px 10px; gap: 8px; text-align: center; }
    .lp-copy { align-items: center; }
    .lp-eyebrow { font-size: .82rem; padding: 6px 16px; margin-bottom: 22px; }
    .lp-hero h1 { white-space: normal; font-size: 2rem; line-height: 1.4; max-width: 300px; margin-bottom: 16px; }
    .lp-lead { font-size: 1.1rem; max-width: 260px; margin-bottom: 10px; }
    .lp-invited { margin: 4px 0 6px; font-size: .9rem; }
    .lp-actions { order: 3; width: 100%; flex-direction: column; gap: 12px; }
    .lp-btn { width: 100%; font-size: 1.05rem; padding: 13px; border-radius: 2px; }
    .lp-copy { display: contents; }
    .lp-hero > .lp-copy > * { grid-column: 1; }
    .lp-visual { order: 2; margin: 0 auto; width: 100%; max-width: 340px; }
    .lp-eyebrow, .lp-hero h1, .lp-lead, .lp-invited { justify-self: center; }
    .lp-features { grid-template-columns: 1fr; gap: 10px; margin: 14px 20px 30px; padding: 0; background: none; }
    .lp-feature { flex-direction: row; justify-content: space-between; text-align: start; background: #f3f7fd; border-radius: 2px; padding: 12px 18px; }
    .lp-feature + .lp-feature { border: 0; }
    .lp-feature h3 { font-size: 1.08rem; margin: 0; order: 1; }
    .lp-feature p { display: none; }
    .lp-f-ic { order: 2; margin: 0; }
    .lp-f-ic .ic { width: 28px; height: 28px; }
}

/* ─── سياسة الخصوصية والتذييل ─── */
.is-guest .doc { max-width: 760px; margin: 0 auto; }
.doc h2 { margin-top: 1.4em; color: var(--brand); }
.doc ul { padding-inline-start: 22px; line-height: 2; }
.lp-foot { text-align: center; padding: 0 0 26px; font-size: .92rem; }
.lp-foot a { color: #5c6780; }
.small-note { font-size: .82rem; text-align: center; margin: 0; }
@media (max-width: 820px) { .lp-foot { padding-bottom: 22px; } }
