/* ==========================================================================
   الدوريات v2 — الجدول · الترتيب · الوسائل · النشر اليومي · الإشعارات
   يمتد من leagues.css (نفس التوكنز) ويضيف مكوّنات v2 فقط.
   كل لون يمرّ عبر متغيّر — لا قيمة صريحة في القواعد — ليعمل الوضعان معًا.
   ========================================================================== */

/* ========== توكنز عامة خارج .league-page (الجرس يظهر في كل الصفحات) ========== */

:root {
    --lgx-card: #14181f;
    --lgx-card-2: #1b212b;
    --lgx-line: rgba(255, 255, 255, .08);
    --lgx-line-strong: rgba(148, 163, 184, .24);
    --lgx-text: #f4f7fb;
    --lgx-text-2: #b9c4d2;
    --lgx-muted: #7d8a99;
    --lgx-primary: #00d4aa;
    --lgx-blue: #0099ff;
    --lgx-gold: #f5a623;
    --lgx-danger: #ff4d6d;
    --lgx-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

body.light-mode {
    --lgx-card: #ffffff;
    --lgx-card-2: #f4f6f9;
    --lgx-line: rgba(15, 23, 42, .09);
    --lgx-line-strong: rgba(15, 23, 42, .16);
    --lgx-text: #16202e;
    --lgx-text-2: #3f4c5c;
    --lgx-muted: #6b7787;
    --lgx-shadow: 0 20px 50px rgba(15, 23, 42, .14);
}

/* ========================================================================
   1 · أقسام الصفحة
   ======================================================================== */

.lg-section {
    margin-bottom: 42px;
}

.lg-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lg-section-head h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--lg-text);
    display: flex;
    align-items: center;
    gap: 9px;
}

.lg-section-head h2 i {
    color: var(--lg-primary);
    font-size: .95em;
}

.lg-count {
    font-size: .76rem;
    font-weight: 700;
    color: var(--lg-muted);
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    padding: 4px 12px;
}

.lg-count.alert {
    color: #fff;
    background: var(--lg-danger);
    border-color: transparent;
}

.lg-section-link {
    margin-inline-start: auto;
    font-size: .82rem;
    font-weight: 700;
    color: var(--lg-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lg-section-link:hover {
    color: var(--lg-emerald);
}

.lg-section-foot {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.lg-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--lg-text-2);
    text-decoration: none;
    margin-bottom: 18px;
    transition: color .18s ease;
}

.lg-back:hover {
    color: var(--lg-primary);
}

/* ========================================================================
   2 · شريط الفلاتر
   ======================================================================== */

.lg-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 16px;
}

.lg-filter-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 420px;
    min-width: 0;
}

.lg-filter-search i {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lg-muted);
    font-size: .85rem;
    pointer-events: none;
}

.lg-filter-search input {
    width: 100%;
    height: 44px;
    padding-inline: 40px 14px;
    border-radius: 12px;
    border: 1px solid var(--lg-line-strong);
    background: var(--lg-card-soft);
    color: var(--lg-text);
    font-size: .88rem;
    font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.lg-filter-search input::placeholder {
    color: var(--lg-muted);
}

.lg-filter-search input:focus {
    outline: none;
    border-color: var(--lg-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, .16);
}

.lg-filter-group {
    display: flex;
    flex: 2 1 440px;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.lg-filter-group .lg-select {
    flex: 1 1 130px;
    min-width: 0;
}

.lg-select {
    height: 44px;
    padding-inline: 14px 34px;
    border-radius: 12px;
    border: 1px solid var(--lg-line-strong);
    background: var(--lg-card-soft);
    color: var(--lg-text);
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: left 14px center, left 9px center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color .18s ease;
}

.lg-select:focus {
    outline: none;
    border-color: var(--lg-primary);
}

.lg-select option {
    background: var(--lg-card);
    color: var(--lg-text);
}

.lg-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--lg-danger);
    text-decoration: none;
    padding: 0 8px;
}

/* ========================================================================
   3 · الجدول
   ======================================================================== */

.lg-table-wrap {
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 18px;
    overflow: hidden;
    padding: 0 0px 16px;
}

.lg-table-wrap.standings {
    overflow-x: auto;
}

/* Scroll عمودي داخل الجدول فقط — لا يمدّد صفحة الموقع بأكملها (T-06).
   زر «عرض المزيد» وشريط الفلاتر يبقيان خارج هذا الـ scroll دائمًا. */
.lg-table-scroll {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--lg-line-strong) transparent;
}

.lg-table-scroll::-webkit-scrollbar { width: 7px; }
.lg-table-scroll::-webkit-scrollbar-track { background: transparent; }

.lg-table-scroll::-webkit-scrollbar-thumb {
    background: var(--lg-line-strong);
    border-radius: 999px;
}

.lg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    background: var(--lg-section);
}

.lg-table thead th {
    text-align: start;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--lg-muted);
    background: var(--lg-card-soft);
    padding: 13px 14px;
    border-bottom: 1px solid var(--lg-line-strong);
    white-space: nowrap;
}

/* رأس الجدول يبقى ثابتًا أثناء الـ scroll العمودي الداخلي (.lg-table-scroll) —
   خلفية معتمة (لا --lg-card-soft الشفّافة) حتى لا تظهر الصفوف من تحته. */
.lg-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--lg-card);
}

.lg-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--lg-line);
    color: var(--lg-text-2);
    vertical-align: middle;
}

.lg-table tbody tr:last-child td {
    border-bottom: none;
}

.lg-table tbody tr {
    transition: background .16s ease;
}

.lg-table tbody tr:hover {
    background: var(--lg-card-soft);
}

.lg-table .col-rank {
    width: 62px;
    text-align: center;
}

.lg-table .col-num {
    width: 92px;
    text-align: center;
}

.lg-table .col-actions {
    width: 168px;
}

/* --- ترتيب الدوري --- */

.lg-rank-badge {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 800;
    color: var(--lg-text-2);
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
}

.lg-rank-badge.top {
    color: #0b1220;
    background: linear-gradient(135deg, var(--lg-gold), #ffd479);
    border-color: transparent;
}

/* --- خلية الدوري --- */

.lg-cell-league {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.lg-cell-thumb {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    overflow: hidden;
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    display: grid;
    place-items: center;
}

.lg-cell-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lg-cell-name {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lg-cell-name b {
    font-size: .9rem;
    font-weight: 700;
    color: var(--lg-text);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
}

.lg-cell-name small {
    font-size: .74rem;
    color: var(--lg-muted);
}

.lg-official-mark {
    color: var(--lg-gold);
    font-size: .72em;
}

/* --- اسم الدوري كرابط (الاسم نفسه هو رابط التفاصيل، مع سهم صغير يوضّح إمكانية النقر) --- */

.lg-cell-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.lg-cell-link-text {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 25%, transparent);
    text-underline-offset: 3px;
    min-width: 0;
    overflow-wrap: break-word;
}

.lg-cell-link-arrow {
    font-size: .68em;
    flex: none;
    color: var(--lg-primary);
    opacity: .75;
    transition: transform .15s ease, opacity .15s ease;
}

.lg-cell-link:hover,
.lg-cell-link:focus-visible {
    color: var(--lg-primary);
}

.lg-cell-link:hover .lg-cell-link-text,
.lg-cell-link:focus-visible .lg-cell-link-text {
    text-decoration-color: currentColor;
}

.lg-cell-link:hover .lg-cell-link-arrow,
.lg-cell-link:focus-visible .lg-cell-link-arrow {
    opacity: 1;
    transform: translateX(-2px);
}

/* شارة globe/lock انتقلت من عمود «النوع» المحذوف إلى قبل اسم الدوري مباشرة */
.lg-visibility-mark {
    font-size: .78em;
    flex: none;
}

.lg-visibility-mark.public { color: #0099ff; }
.lg-visibility-mark.private { color: var(--lg-gold); }

/* --- عناصر داخل الخلايا --- */

.lg-num {
    font-weight: 800;
    font-size: .92rem;
    color: var(--lg-text);
    font-variant-numeric: tabular-nums;
}

.lg-num.ok { color: #12c79c; }
.lg-num.bad { color: var(--lg-danger); }
.lg-num.muted { color: var(--lg-muted); font-weight: 600; }
.lg-num.played { color: var(--lg-text-2); }

.lg-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.lg-type.public {
    color: #0099ff;
    background: rgba(0, 153, 255, .12);
}

.lg-type.private {
    color: var(--lg-gold);
    background: rgba(245, 166, 35, .14);
}

.lg-chip {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--lg-text-2);
    /* background: var(--lg-card-soft);
    border: 1px solid var(--lg-line); */
    border-radius: 8px;
    padding: 4px;
    white-space: nowrap;
}

.lg-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* الشارة داخل عمود الإجراءات تُصغَّر حتى لا تكسر ارتفاع الصف */
.lg-actions .lg-badge {
    white-space: nowrap;
    font-size: .72rem;
    padding: 5px 9px;
}

.lg-btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: .8rem;
}

.lg-btn-icon {
    width: 38px;
    padding: 0;
    justify-content: center;
}

.lg-btn-sm.lg-btn-icon {
    width: 34px;
}

/* --- عرض المزيد --- */

.lg-more {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

.lg-more-count {
    font-size: .74rem;
    font-weight: 600;
    color: var(--lg-muted);
    margin-inline-start: 4px;
}

/* --- الجدول على الشاشات الصغيرة: يبقى جدولًا بلا Scroll أفقي (T-06) ---
   القرار: لا تكديس بطاقي. الصف يبقى صفًّا، والخطوط تصغر،
   والكلمات تُستبدل بأيقونات معبّرة. بعد تقليل عدد الأعمدة لم يعد هناك
   حاجة لتمرير أفقي — الأعمدة الوسطى تلتف (wrap) بدل أن تفرض عرضًا زائدًا. */

/* تنسيق شريط التمرير — يبقى مشتركًا (يخدم .lg-table-wrap.standings الذي
   ما زال يُمرَّر أفقيًا؛ لا تأثير له هنا بعد إزالة overflow-x). */
.lg-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--lg-line-strong) transparent;
}

.lg-table-wrap::-webkit-scrollbar { height: 7px; }
.lg-table-wrap::-webkit-scrollbar-track { background: transparent; }

.lg-table-wrap::-webkit-scrollbar-thumb {
    background: var(--lg-line-strong);
    border-radius: 999px;
}

/* بلا حدود عندما يكون الجدول داخل لوحة أصلًا */
.lg-table-wrap.compact {
    background: transparent;
    border: 0;
    border-radius: 0;
}

.lg-table .col-name { min-width: 190px; }
.lg-table .col-mid { white-space: nowrap; }

@media (max-width: 425px) {
    .lg-table .col-name { max-width: 155px; min-width: 0; }
    .lg-player-meta { font-size: 9px;}
}

/* شارة «سؤال جديد» بجوار اسم الدوري */
.lg-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-style: normal;
    font-size: .68rem;
    font-weight: 800;
    color: var(--lg-primary);
    background: rgba(0, 212, 170, .12);
    border-radius: 7px;
    padding: 2px 7px;
    white-space: nowrap;
}

.lg-live-tag .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lg-primary);
    animation: lgPulse 1.5s ease-in-out infinite;
}

@keyframes lgPulse {
    50% { opacity: .35; transform: scale(.75); }
}

.lg-table tbody tr.is-live .lg-cell-name b { color: var(--lg-text); }

.lg-num.accent { color: var(--lg-primary); }

.lg-date {
    font-size: .8rem;
    color: var(--lg-text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.th-ico { display: none; }

.lg-table .col-actions i.fas.fa-ellipsis.th-ico {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--lg-emerald), #05d4b7);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
    margin: auto;
}
@media (min-width: 641px) {
    .lg-table .col-actions i.fas.fa-ellipsis.th-ico {
        display: none;
    }
}

@media (max-width: 980px) {
    .lg-table { font-size: .82rem; }
    .lg-table thead th { padding: 11px 10px; font-size: .68rem; }
    .lg-table tbody td { padding: 11px 10px; }
    .lg-cell-name b { font-size: .84rem; }
    .lg-cell-name small { font-size: .7rem; }
    .lg-chip, .lg-type { font-size: .72rem; padding: 3px 8px; }
}

@media (max-width: 640px) {
    /* الكلمات تُستبدل بأيقونات معبّرة */
    .th-ico { display: inline-block; }
    .th-txt { display: none; }

    .lg-table thead th { padding: 10px 8px; }
    .lg-table tbody td { padding: 10px 8px; }

    .lg-type .txt,
    .lg-actions .lg-btn .txt,
    .lg-actions .lg-badge .txt { display: none; }

    .lg-type { padding: 5px 7px; }
    .lg-actions .lg-badge { padding: 6px 8px; font-size: .74rem; }

    .lg-actions .lg-btn-sm {
        width: 28px;
        height: 28px;
        font-size: 12px;
        min-height: 0;
        padding: 0;
        justify-content: center;
    }

    .lg-live-tag .txt { display: none; }
    .lg-live-tag { padding: 3px 5px; }

    /* بلا Scroll أفقي حتى 375px — إصلاح حقيقي (كانت المحاولة الأولى غير فعّالة،
       لأن table-layout الافتراضي (auto) يسمح للجدول بأن يتمدد أعرض من حاويته،
       و.lg-table-wrap { overflow: hidden } كان حينها يقصّ عمود الإجراءات
       بصمت بدل عرضه أو تمريره — بالضبط ما ظهر في اختبار المستخدم الفعلي).
       الحل: table-layout: fixed + عرض صريح لكل عمود ثابت، وعمود الدوري
       (بلا عرض محدد) يمتص الباقي دائمًا. أي نص لا يتسع يلتف على سطرين
       بدل أن يُقصّ أو يدفع الجدول خارج حاويته. */
    .lg-leagues-table {
        table-layout: fixed;
        width: 100%;
    }

    .lg-leagues-table .col-rank { width: 38px; }
    .lg-leagues-table .col-num { width: 38px; }
    .lg-leagues-table .col-mid { width: 62px; }
    .lg-leagues-table .col-actions { width: 60px; }
    .lg-leagues-table .col-name { width: auto; min-width: 0; }

    /* .lg-chip/.lg-date كان لهما white-space: nowrap خاص بهما يتجاوز
       .col-mid { white-space: normal } — التفافهما هنا صريح الآن.
       overflow-wrap (لا word-break) يفضّل الالتفاف عند المسافات أولًا،
       ولا يكسر وسط الكلمة إلا كملاذ أخير — أنضف لكلمة عربية قصيرة. */
    .lg-chip,
    .lg-date,
    .lg-type {
        white-space: normal;
        overflow-wrap: break-word;
        font-size: .68rem;
        line-height: 1.3;
        padding: 2px 5px;
    }

    .lg-cell-name b,
    .lg-cell-name small { overflow-wrap: break-word; }

    /* عمود الإجراءات ضيق على الجوال — لو زرّان معًا (العب + الترتيب)
       يلتفّان لسطرين بدل أن يضغطا أو يفيضا خارج عرض العمود الثابت. */
    .lg-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================================================
   4 · بطاقات «دوريات أشارك بها»
   ======================================================================== */

.lg-mine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 14px;
}

.lg-mine-card {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 16px;
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 18px;
    transition: transform .2s ease, border-color .2s ease;
}

.lg-mine-card:hover {
    transform: translateY(-3px);
    border-color: var(--lg-line-strong);
}

.lg-mine-card.is-live {
    border-color: rgba(0, 212, 170, .45);
    box-shadow: 0 0 0 1px rgba(0, 212, 170, .12);
}

.lg-mine-card header {
    display: flex;
    align-items: center;
    gap: 11px;
    position: relative;
}

.lg-mine-card header b {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--lg-text);
    line-height: 1.35;
}

.lg-mine-card header small {
    font-size: .74rem;
    color: var(--lg-muted);
}

.lg-live-dot {
    position: absolute;
    inset-inline-end: 0;
    top: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--lg-primary);
    box-shadow: 0 0 0 0 rgba(0, 212, 170, .6);
    animation: lgPulse 1.8s infinite;
}

@keyframes lgPulse {
    70% { box-shadow: 0 0 0 9px rgba(0, 212, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0); }
}

.lg-mine-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--lg-line);
}

.lg-mine-stats {
    display: flex;
    gap: 16px;
}

.lg-mine-stats span {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lg-mine-stats small {
    font-size: .68rem;
    color: var(--lg-muted);
}

.lg-mine-stats b {
    font-size: 1rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-mine-stats b.accent {
    color: var(--lg-primary);
}

/* ========================================================================
   5 · النوافذ المنبثقة
   ======================================================================== */

body.lg-modal-open {
    overflow: hidden;
}

.lg-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    place-items: center;
    padding: 18px;
}

.lg-modal[hidden] {
    display: none;
}

/* SweetAlert2 defaults to z-index 1060 — below .lg-modal's 1080 — so every confirmation
   raised from inside a league modal rendered *behind* it: visible but impossible to click.
   That silently broke the question modal's close guard (R-23), which asks for confirmation
   before abandoning an unanswered question and so trapped the participant instead.
   A confirmation is always the topmost interrupt, so it must outrank any modal. */
.swal2-container {
    z-index: 1090;
}

.lg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 14, .72);
    backdrop-filter: blur(3px);
    animation: lgFade .2s ease;
}

body.light-mode .lg-modal-backdrop {
    background: rgba(15, 23, 42, .48);
}

@keyframes lgFade {
    from { opacity: 0; }
}

.lg-modal-box {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    background: var(--lgx-card);
    border: 1px solid var(--lgx-line);
    border-radius: 22px;
    box-shadow: var(--lgx-shadow);
    padding: 20px;
    color: var(--lgx-text);
    animation: lgRise .26s cubic-bezier(.2, .9, .3, 1);
}

@keyframes lgRise {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
}

.lg-modal-x {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: var(--lgx-card-2);
    color: var(--lgx-text-2);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
    z-index: 2;
}

.lg-modal-x:hover {
    background: var(--lgx-danger);
    color: #fff;
}

.lg-modal-cover {
    position: relative;
    aspect-ratio: 16 / 8;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--lgx-card-2);
}

.lg-modal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lg-modal-cover .lg-type {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 10px;
    backdrop-filter: blur(6px);
}

.lg-modal-icon {
    width: 58px;
    height: 58px;
    margin: 4px auto 14px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 1.3rem;
    color: var(--lgx-gold);
    background: rgba(245, 166, 35, .14);
}

.lg-modal-title {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--lgx-text);
    text-align: center;
}

.lg-modal-desc {
    margin: 0 0 14px;
    font-size: .84rem;
    line-height: 1.8;
    color: var(--lgx-muted);
    text-align: center;
}

.lg-modal-facts {
    list-style: none;
    margin: 0 0 50px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 12px;
    background: var(--lgx-card-2);
    border-radius: 14px;
}

.lg-modal-facts li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    color: var(--lgx-text-2);
}

.lg-modal-facts i {
    color: var(--lgx-primary);
    font-size: .82em;
    width: 15px;
    text-align: center;
}

.lg-modal-facts b {
    color: var(--lgx-text);
    font-weight: 800;
}

.lg-modal-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: .79rem;
    line-height: 1.75;
    margin-bottom: 12px;
    color: var(--lgx-text-2);
    background: rgba(0, 153, 255, .1);
}
.lg-modal-note#joinToolsNote {
    display: none;
}

.lg-modal-note i {
    color: var(--lgx-blue);
    margin-top: 3px;
}

.lg-modal-note.success {
    background: rgba(0, 212, 170, .1);
}

.lg-modal-note.success i {
    color: var(--lgx-primary);
}

.lg-modal-hint {
    margin: 12px 0 0;
    font-size: .75rem;
    color: var(--lgx-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lg-code-input::placeholder {
    color: var(--bs-border-color-translucent);
}

.lg-code-input {
    text-align: center;
    letter-spacing: .5em;
    font-size: 1.25rem !important;
    font-weight: 800;
    padding-inline-end: 0 !important;
    direction: ltr;
    margin-bottom: 12px;
}

/* ========================================================================
   6 · الحقول والنماذج
   ======================================================================== */

.lg-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.lg-field > span:first-child {
    font-size: .8rem;
    font-weight: 700;
    color: var(--lg-text-2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lg-field > span:first-child em {
    color: var(--lg-danger);
    font-style: normal;
}

.lg-field > span:first-child small {
    font-weight: 500;
    color: var(--lg-muted);
}

.lg-field-error {
    font-size: .76rem;
    color: var(--lg-danger) !important;
    font-weight: 600;
    display: block;
    margin-bottom: 16px;
}

.lg-field-hint {
    font-size: .78rem;
    color: var(--lg-muted);
    display: block;
    margin-top: 6px;
    line-height: 1.4;
}

.lg-form-errors:not(:empty) {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 77, 109, .1);
    color: var(--lg-danger);
    font-size: .82rem;
    margin-bottom: 14px;
}

.lg-form-errors ul {
    margin: 0;
    padding-inline-start: 18px;
}

.lg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.lg-form-grid .span-2 {
    grid-column: 1 / -1;
}

.lg-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

/* --- بطاقات الاختيار (نوع الدوري) --- */

.lg-radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.lg-radio-card {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.lg-radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lg-radio-card .body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 13px 10px;
    text-align: center;
    border-radius: 14px;
    border: 1.5px solid var(--lg-line-strong);
    background: var(--lg-card-soft);
    transition: border-color .18s ease, background .18s ease;
}

.lg-radio-card .body i {
    font-size: 1.05rem;
    color: var(--lg-muted);
    margin-bottom: 2px;
    transition: color .18s ease;
}

.lg-radio-card .body b {
    font-size: .88rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-radio-card .body small {
    font-size: .7rem;
    color: var(--lg-muted);
}

.lg-radio-card input:checked + .body {
    border-color: var(--lg-primary);
    background: rgba(0, 212, 170, .09);
}

.lg-radio-card input:checked + .body i {
    color: var(--lg-primary);
}

.lg-radio-card input:focus-visible + .body {
    box-shadow: 0 0 0 3px rgba(0, 212, 170, .2);
}

/* --- ملاحظة المدة --- */

.lg-duration-note {
    display: flex;
    gap: 11px;
    padding: 13px 14px;
    border-radius: 14px;
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    margin-bottom: 12px;
}

.lg-duration-note i {
    color: var(--lg-gold);
    margin-top: 3px;
}

.lg-duration-note b {
    display: block;
    font-size: .88rem;
    color: var(--lg-text);
    margin-bottom: 3px;
}

.lg-duration-note.is-over b {
    color: var(--lg-danger);
}

.lg-duration-note p {
    margin: 0;
    font-size: .78rem;
    line-height: 1.8;
    color: var(--lg-muted);
}

/* --- المفتاح (switch) --- */

.lg-switch-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 14px;
}

.lg-switch {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lg-switch-track {
    flex: none;
    width: 46px;
    height: 26px;
    margin-top: 2px;
    border-radius: 999px;
    background: var(--lg-line-strong);
    position: relative;
    transition: background .2s ease;
}

.lg-switch-thumb {
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s cubic-bezier(.2, .9, .3, 1);
}

.lg-switch:checked + .lg-switch-track {
    background: var(--lg-primary);
}

.lg-switch:checked + .lg-switch-track .lg-switch-thumb {
    transform: translateX(-20px);
}

.lg-switch:focus-visible + .lg-switch-track {
    box-shadow: 0 0 0 3px rgba(0, 212, 170, .25);
}

.lg-switch-text b {
    display: block;
    font-size: .88rem;
    font-weight: 700;
    color: var(--lg-text);
    margin-bottom: 2px;
}

.lg-switch-text small {
    font-size: .77rem;
    line-height: 1.75;
    color: var(--lg-muted);
}

.lg-check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .82rem;
    color: var(--lg-text-2);
    cursor: pointer;
    margin: 12px 0;
}

.lg-check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--lg-primary);
    cursor: pointer;
    appearance: auto;
}

/* ========================================================================
   7 · جدول الترتيب
   ======================================================================== */

.lg-standings-table thead th .th-text {
    margin-inline-start: 5px;
}

.lg-standings-table thead th i {
    font-size: .78em;
}

.lg-standings-table .col-tools {
    width: 116px;
    text-align: center;
    border-inline-start: 1px dashed var(--lg-line-strong);
}

.lg-standings-table .col-tools small {
    display: block;
    font-size: .62rem;
    font-weight: 600;
    color: var(--lg-muted);
    margin-top: 2px;
}

.lg-standings-table .col-num.strong {
    width: 100px;
}

.lg-standings-table tr.is-me {
    background: rgba(0, 212, 170, .07);
}

.lg-standings-table tr.is-me:hover {
    background: rgba(0, 212, 170, .1);
}

.lg-rank-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.lg-rank-cell b {
    font-size: .95rem;
    font-weight: 800;
    color: var(--lg-text);
    font-variant-numeric: tabular-nums;
}

.lg-rank-cell b.medal-1 { color: #f5a623; }
.lg-rank-cell b.medal-2 { color: #c8d0da; }
.lg-rank-cell b.medal-3 { color: #d68b52; }

body.light-mode .lg-rank-cell b.medal-2 { color: #6b7688; }

.move {
    font-size: .95rem;
    line-height: 1;
}

.move.up { color: #12c79c; }
.move.down { color: var(--lg-danger); }
.move.same { color: var(--lg-muted); font-size: .7rem; }
.move.new { color: var(--lg-blue); font-size: .72rem; }

.lg-cell-player {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.lg-avatar {
    display: none;
    flex: none;
    width: 34px;
    height: 34px;
    /* display: grid; */
    place-items: center;
    border-radius: 11px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--lg-text);
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
}

.lg-player-name {
    font-size: .87rem;
    font-weight: 600;
    color: var(--lg-text);
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.lg-player-name em {
    font-style: normal;
    font-size: .66rem;
    font-weight: 800;
    color: #0b1220;
    background: var(--lg-primary);
    border-radius: 6px;
    padding: 2px 6px;
}

.lg-points {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--lg-primary);
    font-variant-numeric: tabular-nums;
}

.lg-tool-marks {
    display: inline-flex;
    gap: 5px;
    justify-content: center;
}

.tool-mark {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: .72rem;
}

.tool-mark.cut {
    color: var(--lg-blue);
    background: rgba(0, 153, 255, .13);
}

.tool-mark.boost {
    color: var(--lg-gold);
    background: rgba(245, 166, 35, .15);
}

/* --- صفّي المثبَّت --- */

.lg-sticky-me {
    position: sticky;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--lg-card);
    border: 1.5px solid var(--lg-primary);
    box-shadow: var(--lg-shadow);
}

.lg-sticky-label {
    font-size: .72rem;
    font-weight: 800;
    color: var(--lg-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lg-sticky-me .lg-points {
    margin-inline-start: auto;
}

/* --- مفتاح النقاط --- */

.lg-points-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px dashed var(--lg-line);
    font-size: .76rem;
    color: var(--lg-text-2);
}

.lg-points-legend b {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-inline-end: 5px;
    border-radius: 7px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--lg-primary);
    background: rgba(0, 212, 170, .12);
}

.lg-points-legend .sep {
    flex: 1;
}

.lg-points-legend .muted {
    color: var(--lg-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.standing-detail {
    font-size: .74rem;
    color: var(--lg-muted);
    margin-inline-start: auto;
    margin-inline-end: 10px;
    white-space: nowrap;
}

.standing-rank .move {
    margin-inline-end: 3px;
}

@media (max-width: 860px) {
    .lg-standings-table .col-tools {
        border-inline-start: 0;
    }

    .lg-standings-table tbody td[data-label="الإجمالي"] {
        border-top: 1px dashed var(--lg-line);
        padding-top: 10px;
        margin-top: 4px;
    }

    .standing-detail {
        display: none;
    }
}

/* ========================================================================
   8 · شاشة اللعب
   ======================================================================== */

/* صف مركزك · لعب · نقاطك في شاشة «أنهيت سؤال اليوم» — 3 كروت ثابتة جنبًا إلى جنب،
   لا تلتفّ أبدًا لسطر جديد على أي مقاس شاشة؛ الاستجابة بتصغير الحشو والخط عند @media أدناه. */
.lg-round-done-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 14px 0;
}

.lg-round-done-stats span {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 9px 6px;
    border-radius: 14px;
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
}

.lg-round-done-stats small {
    font-size: .66rem;
    color: var(--lg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lg-round-done-stats b {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lg-text);
    white-space: nowrap;
}

.lg-round-done-stats b.accent {
    color: var(--lg-primary);
}

@media (max-width: 380px) {
    .lg-round-done-stats span { padding: 7px 3px; }
    .lg-round-done-stats small { font-size: .58rem; }
    .lg-round-done-stats b { font-size: .9rem; }
}

/* --- حالة الانتظار --- */

.lg-waiting {
    text-align: center;
    padding: 34px 20px;
}

.lg-waiting.compact {
    padding: 20px 14px;
}

.lg-waiting-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    font-size: 1.4rem;
    color: var(--lg-gold);
    background: rgba(245, 166, 35, .13);
}

.lg-waiting-icon.done {
    color: var(--lg-primary);
    background: rgba(0, 212, 170, .12);
}

.lg-waiting h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-waiting p {
    margin: 0 auto;
    max-width: 46ch;
    font-size: .85rem;
    line-height: 1.9;
    color: var(--lg-muted);
}

.lg-waiting-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-top: 18px;
}

/* دايمًا جنب بعض في صف واحد — يضيقان بدل ما يلتفّان لسطر جديد */
.lg-waiting-actions .lg-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 380px) {
    .lg-waiting-actions .lg-btn {
        padding-inline: 10px;
        font-size: .8rem;
        gap: 6px;
    }
}

/* --- شريط تقدّم الـ bulk --- */

.lg-bulk-bar {
    padding: 13px 15px;
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 15px;
    margin-bottom: 12px;
}

.lg-bulk-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.lg-bulk-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--lg-blue);
    background: rgba(0, 153, 255, .12);
    border-radius: 8px;
    padding: 4px 10px;
}

.lg-bulk-info b {
    font-size: .84rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-bulk-track {
    height: 7px;
    border-radius: 999px;
    background: var(--lg-card-soft);
    overflow: hidden;
}

.lg-bulk-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lg-primary), var(--lg-blue));
    transition: width .45s cubic-bezier(.2, .9, .3, 1);
}

/* --- وسائل المساعدة: أيقونات بلا عنوان، صفّ بسيط أعلى السؤال يمينًا — لا سكشن/صندوق مستقل --- */

/* Row that pairs the "وسائل المساعدة" label with the tool buttons — sits between the
   question list and the bulk nav, its natural neighbour, instead of floating unlabeled
   above the questions. */
.lg-tools-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 4px;
}

/* The result screen hides the tools row outright (R-32 revision) — without this override
   the flex display above wins over the UA default and it stays on screen under roundDone. */
.lg-tools-row[hidden] {
    display: none;
}

.lg-tools-label {
    color: var(--lg-muted);
    font-size: .8rem;
    font-weight: 700;
}

.lg-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    transition: opacity .3s ease;
}

.lg-tool {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--lg-line-strong);
    background: var(--lg-card);
    color: var(--lg-text);
    font-family: inherit;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.lg-tool > i:first-child,
.lg-tool > .lg-tool-x2 {
    font-size: .9rem;
}

.lg-tool-x2 {
    font-weight: 900;
}

.lg-tool.cut > i:first-child { color: var(--lg-blue); }
.lg-tool.boost > .lg-tool-x2 { color: var(--lg-gold); }

.lg-tool:hover:not(:disabled) {
    transform: translateY(-2px);
}

.lg-tool.cut:hover:not(:disabled) { border-color: var(--lg-blue); }
.lg-tool.boost:hover:not(:disabled) { border-color: var(--lg-gold); }

.lg-tool:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.lg-tool.is-used {
    opacity: .6;
    border-style: dashed;
}

.lg-tool-used {
    position: absolute;
    inset-block-end: -3px;
    inset-inline-end: -3px;
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--lg-primary);
    color: #08110d;
    font-size: .55rem;
}

/* --- بطاقات الأسئلة --- */

.lg-questions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* The result screen hides this outright via the hidden attribute (R-32 revision) — without
   this override the flex display above wins over the UA default and the cards stay on
   screen underneath roundDone. */
.lg-questions[hidden] {
    display: none;
}

.lg-q-card {
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color .22s ease, opacity .22s ease;
}

.lg-q-card.is-active {
    border-color: rgba(0, 212, 170, .4);
    box-shadow: 0 0 0 1px rgba(0, 212, 170, .1);
}

.lg-q-card.is-doubled {
    border-color: rgba(245, 166, 35, .45);
}

/* In a bulk, a card collapses to just its header once it is answered AND no longer the
   one on screen — reviewing a past question via the stepper still shows its body. The
   just-answered card stays fully visible (question + choices + result) for its full
   is-active moment, right up until advanceToNextQuestion swaps .is-active over; collapsing
   it the instant is-done lands would leave an empty-looking card on screen for that
   entire 1s transition, which read as a bug. */
.lg-play[data-total]:not([data-total="1"]) .lg-q-card:not(.is-active) .lg-q-body {
    display: none;
}

.lg-q-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--lg-line);
    border-radius: 24px;
}

.lg-q-card.is-done .lg-q-head,
.lg-q-card:not(.is-active):not(.is-done) .lg-q-head {
    border-bottom: 0;
}

.lg-q-index {
    font-size: .78rem;
    font-weight: 800;
    color: var(--lg-text-2);
}

.lg-q-result {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 9px;
}

.lg-q-result.ok {
    color: #12c79c;
    background: rgba(18, 199, 156, .13);
}

.lg-q-result.bad {
    color: var(--lg-danger);
    background: rgba(255, 77, 109, .12);
}

/* Timed out — neutral, not red: nothing was answered wrongly (R-27). */
.lg-q-result.missed {
    color: var(--lg-muted);
    background: var(--lg-card-soft);
}

.lg-q-result em {
    font-style: normal;
    font-size: .68rem;
    opacity: .85;
}

.lg-q-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 700;
    color: var(--lg-gold);
    background: rgba(245, 166, 35, .13);
    border-radius: 9px;
    padding: 4px 10px;
}

.lg-q-body {
    padding: 16px;
}

.league-choice.removed {
    opacity: .22;
    text-decoration: line-through;
    pointer-events: none;
    filter: grayscale(1);
}

.league-choice.is-picking {
    transform: scale(.985);
    opacity: .8;
}

/* --- خلاصة اليوم --- */

.lg-round-done {
    display: none;
    text-align: center;
    padding: 26px 20px;
    margin-top: 14px;
    background: var(--lg-card);
    border: 1px solid rgba(0, 212, 170, .3);
    border-radius: 18px;
}

.lg-round-done.show {
    display: block;
    animation: lgRise .4s cubic-bezier(.2, .9, .3, 1);
}

.lg-round-done-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 1.5rem;
    color: var(--lg-primary);
    background: rgba(0, 212, 170, .13);
}

.lg-round-done h3 {
    margin: 0 0 7px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-round-done p {
    margin: 0;
    font-size: .85rem;
    line-height: 1.9;
    color: var(--lg-muted);
}

.lg-round-done p b {
    color: var(--lg-primary);
    font-size: 1.05rem;
}

.lg-countdown-label {
    display: block;
    font-size: .74rem;
    color: var(--lg-muted);
    margin-bottom: 8px;
}

.lg-countdown-units {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.league-countdown {
    margin-top: 16px;
}

/* ========================================================================
   9 · شاشة الإدارة — مؤلّف السؤال
   ======================================================================== */

.lg-mode-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 13px;
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    margin-bottom: 12px;
}

.lg-mode-switch button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lg-muted);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.lg-mode-switch button.is-on {
    background: var(--lg-card);
    color: var(--lg-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.lg-composer-hint {
    margin: 0 0 14px;
    font-size: .79rem;
    line-height: 1.85;
    color: var(--lg-muted);
}

.lg-composer-hint b {
    color: var(--lg-gold);
}

.lg-question-blocks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.lg-q-block {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--lg-line);
    background: var(--lg-card-soft);
    transition: border-color .2s ease;
}

.lg-q-block.is-ready {
    border-color: rgba(0, 212, 170, .38);
}

.lg-q-block header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.lg-q-block-title {
    font-size: .82rem;
    font-weight: 800;
    color: var(--lg-text-2);
}

.lg-q-remove {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.lg-q-remove:hover {
    background: rgba(255, 77, 109, .12);
    color: var(--lg-danger);
}

.lg-q-text {
    margin-bottom: 10px;
    resize: vertical;
}

.lg-q-image {
    margin-bottom: 10px;
}

.lg-q-image-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px dashed var(--lg-line-strong);
    color: var(--lg-muted);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease;
}

.lg-q-image-upload:hover {
    border-color: var(--lg-primary);
    color: var(--lg-primary);
}

.lg-q-image-upload.is-uploading {
    opacity: .6;
    pointer-events: none;
}

.lg-q-image-preview {
    position: relative;
    display: inline-block;
}

.lg-q-image-preview img {
    max-width: 160px;
    max-height: 110px;
    border-radius: 10px;
    border: 1px solid var(--lg-line);
    object-fit: cover;
    display: block;
}

.lg-q-image-remove {
    position: absolute;
    top: -8px;
    inset-inline-end: -8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--lg-danger);
    color: #fff;
    cursor: pointer;
}

.lg-choice-hint {
    margin: 0 0 9px;
    font-size: .72rem;
    color: var(--lg-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lg-choices-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lg-choice-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.lg-correct-pick {
    flex: none;
    width: 40px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1.5px solid var(--lg-line-strong);
    background: transparent;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.lg-correct-pick .key {
    font-size: .85rem;
    font-weight: 800;
    color: var(--lg-muted);
    transition: color .16s ease;
}

.lg-correct-pick:hover {
    border-color: var(--lg-primary);
}

.lg-choice-row.is-correct .lg-correct-pick {
    border-color: var(--lg-primary);
    background: color-mix(in srgb, var(--lg-primary) 16%, transparent);
}

.lg-choice-row.is-correct .lg-correct-pick .key {
    color: #06251f;
}

.lg-choice-row input {
    flex: 1;
    min-width: 0;
}

.lg-choice-row.is-correct input {
    border-color: rgba(0, 212, 170, .4);
}

/* الأربع خانات إلزامية بالكامل - تُعلَّم الفارغة منها بصريًا بدل السماح بنشر السؤال بخيارات ناقصة بصمت */
.lg-choice-row.is-empty input {
    border-color: var(--lg-danger);
}

.lg-publish-warn {
    margin-top: 4px;
}

/* --- طلبات الانضمام --- */

.lg-requests {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.lg-request {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 14px;
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    transition: opacity .25s ease;
}

.lg-request.is-decided {
    opacity: .55;
}

.lg-request-info {
    flex: 1;
    min-width: 0;
}

.lg-request-info b {
    display: block;
    font-size: .87rem;
    font-weight: 700;
    color: var(--lg-text);
}

.lg-request-info small {
    font-size: .73rem;
    color: var(--lg-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lg-request-actions {
    display: flex;
    gap: 6px;
    flex: none;
}

.lg-inline-hint {
    margin: 12px 0 0;
    font-size: .76rem;
    color: var(--lg-muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

/* --- سجل الأيام --- */

.lg-history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lg-history-round {
    border-radius: 14px;
    border: 1px solid var(--lg-line);
    background: var(--lg-card-soft);
    overflow: hidden;
}

.lg-history-round.is-open {
    border-color: rgba(0, 212, 170, .35);
}

.lg-history-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
}

.lg-history-num {
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 800;
    color: var(--lg-text-2);
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
}

.lg-history-round.is-open .lg-history-num {
    color: #06251f;
    background: var(--lg-primary);
    border-color: transparent;
}

.lg-history-info {
    flex: 1;
    min-width: 0;
}

.lg-history-info b {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--lg-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lg-history-info small {
    font-size: .73rem;
    color: var(--lg-muted);
}

.lg-open-tag {
    font-style: normal;
    font-size: .68rem;
    font-weight: 800;
    color: var(--lg-primary);
    background: rgba(0, 212, 170, .13);
    border-radius: 6px;
    padding: 2px 7px;
    margin-inline-start: 5px;
}

.lg-history-arrow {
    flex: none;
    color: var(--lg-muted);
    font-size: .78rem;
    transition: transform .22s ease;
}

.lg-history-round.is-expanded .lg-history-arrow {
    transform: rotate(180deg);
}

.lg-history-body {
    padding: 0 13px 13px;
    border-top: 1px dashed var(--lg-line);
}

.lg-history-q {
    padding-top: 12px;
}

.lg-history-q b {
    display: block;
    font-size: .85rem;
    color: var(--lg-text);
    margin-bottom: 8px;
    line-height: 1.7;
}

.lg-history-q-image {
    max-width: 160px;
    max-height: 110px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    margin-bottom: 8px;
}

.lg-history-q ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.lg-history-q li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .79rem;
    color: var(--lg-muted);
    padding: 7px 10px;
    border-radius: 9px;
    background: var(--lg-card);
}

.lg-history-q li i {
    font-size: .68rem;
    opacity: .5;
}

.lg-history-q li.is-correct {
    color: #12c79c;
    background: rgba(18, 199, 156, .1);
}

.lg-history-q li.is-correct i {
    opacity: 1;
}

.lg-locked-tag {
    margin: 12px 0 0;
    font-size: .73rem;
    color: var(--lg-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================================================
   10 · مركز الإشعارات (خارج .league-page)
   ======================================================================== */

.lg-bell-wrap {
    position: relative;
}

.lg-bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--lgx-text-2);
    font-size: 1rem;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.lg-bell:hover,
.lg-bell-wrap.is-open .lg-bell {
    background: var(--lgx-card-2);
    color: var(--lgx-primary);
}

.lg-bell-count {
    position: absolute;
    top: 4px;
    inset-inline-end: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 800;
    color: #fff;
    background: var(--lgx-danger);
}

/* اللوحة تعيش على مستوى <body> لا داخل الـ navbar:
   الـ navbar يُنشئ containing block فيكسر position:fixed،
   وكانت اللوحة تخرج من حافة الشاشة على الجوال. */

.lg-bell-panel {
    position: fixed;
    inset-block-start: 76px;
    inset-inline-end: 50%;
    transform: translateX(-50%);
    width: min(460px, calc(100vw - 24px));
    background: var(--lgx-card);
    border: 1px solid var(--lgx-line);
    border-radius: 18px;
    box-shadow: var(--lgx-shadow);
    overflow: hidden;
    /* أعلى من .site-menu-drawer (z-index: 1100) — الجرس أصبح داخل الـ drawer،
       ولوحته يجب أن تظهر فوقه لا خلفه عند فتحها من هناك. */
    z-index: 1150;
    animation: lgRise .22s cubic-bezier(.2, .9, .3, 1);
}

.lg-bell-panel[hidden] { display: none; }

.lg-bell-veil,
.lg-cup-veil {
    position: fixed;
    inset: 0;
    z-index: 1145;
    background: rgba(4, 8, 14, .6);
}

.lg-bell-veil[hidden],
.lg-cup-veil[hidden] { display: none; }

.lg-bell-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

.lg-bell-x {
    display: none;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: var(--lgx-card-2);
    color: var(--lgx-text-2);
    cursor: pointer;
}

/* على الجوال: لوح سفلي بعرض الشاشة مع تعتيم */
@media (max-width: 720px) {
    .lg-bell-panel {
        inset-block-start: auto;
        inset-block-end: 0;
        transform: translateX(0);
        inset-inline: 0;
        width: auto;
        max-height: 82vh;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        animation: lgSheetUp .26s cubic-bezier(.2, .9, .3, 1);
    }

    .lg-bell-veil,
    .lg-cup-veil {
        background: rgba(4, 8, 14, .6);
        backdrop-filter: blur(2px);
    }

    body.light-mode .lg-bell-veil,
    body.light-mode .lg-cup-veil { background: rgba(15, 23, 42, .42); }

    body.lg-bell-open,
    body.lg-cup-open { overflow: hidden; }

    .lg-bell-head { padding: 15px 16px; }
    .lg-bell-x { display: grid; }
    .lg-bell-readall .txt { display: none; }

    .lg-bell-scroll { max-height: calc(82vh - 62px); }
}

@keyframes lgSheetUp {
    from { opacity: 0; transform: translateY(100%); }
}

.lg-bell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--lgx-line);
}

.lg-bell-head b {
    font-size: .9rem;
    font-weight: 800;
    color: var(--lgx-text);
}

.lg-bell-readall {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--lgx-primary);
    font-family: inherit;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}

.lg-bell-scroll {
    max-height: min(60vh, 420px);
    overflow-y: auto;
}

/* Large screens: the popup was a fixed 380px at every viewport size — grow it here. */
@media (min-width: 1024px) {
    .lg-bell-panel {
        width: min(520px, calc(100vw - 48px));
    }

    .lg-bell-scroll {
        max-height: min(70vh, 600px);
    }
}

.lg-notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lg-notif {
    position: relative;
    display: flex;
    gap: 11px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--lgx-line);
    cursor: pointer;
    transition: background .16s ease;
}

.lg-notif:last-child {
    border-bottom: 0;
}

.lg-notif:hover {
    background: var(--lgx-card-2);
}

.lg-notif.is-read {
    opacity: .62;
}

.lg-notif-icon {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: .84rem;
}

.lg-notif-icon.primary { color: var(--lgx-primary); background: rgba(0, 212, 170, .13); }
.lg-notif-icon.warn { color: var(--lgx-gold); background: rgba(245, 166, 35, .14); }
.lg-notif-icon.blue { color: var(--lgx-blue); background: rgba(0, 153, 255, .13); }
.lg-notif-icon.danger { color: var(--lgx-danger); background: rgba(255, 77, 109, .13); }
.lg-notif-icon.gold { color: var(--lgx-gold); background: rgba(245, 166, 35, .14); }

.lg-notif-body {
    flex: 1;
    min-width: 0;
}

.lg-notif-body b {
    display: block;
    font-size: .84rem;
    font-weight: 700;
    color: var(--lgx-text);
    margin-bottom: 3px;
}

.lg-notif-body p {
    margin: 0 0 6px;
    font-size: .78rem;
    line-height: 1.75;
    color: var(--lgx-muted);
}

.lg-notif-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lg-notif-foot time {
    font-size: .7rem;
    color: var(--lgx-muted);
}

.lg-notif-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--lgx-primary);
    text-decoration: none;
}

.lg-notif-dot {
    position: absolute;
    inset-block-start: 16px;
    inset-inline-end: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lgx-primary);
}

.lg-notif-empty {
    padding: 34px 20px;
    text-align: center;
    color: var(--lgx-muted);
}

.lg-notif-empty i {
    font-size: 1.5rem;
    opacity: .5;
    margin-bottom: 9px;
    display: block;
}

.lg-notif-empty p {
    margin: 0;
    font-size: .82rem;
}

/* ========================================================================
   11 · حالات ومساعدات
   ======================================================================== */

.round-dot.no-question {
    background: transparent;
    border: 1.5px dashed var(--lg-line-strong);
    color: var(--lg-muted);
}

.league-empty.compact {
    padding: 30px 18px;
    border: 1px dashed var(--lg-line-strong);
    background: transparent;
}

.league-empty.compact i {
    font-size: 1.6rem;
}

.lg-panel-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lg-panel-head h2 i {
    color: var(--lg-primary);
    font-size: .9em;
}

.text-success { color: #12c79c; }
.text-danger { color: var(--lg-danger); }

/* ========================================================================
   12 · التجاوب
   ======================================================================== */

@media (max-width: 720px) {
    .lg-form-grid {
        grid-template-columns: 1fr;
    }

    .lg-modal-facts {
        grid-template-columns: 1fr;
    }

    .lg-history-q ul {
        grid-template-columns: 1fr;
    }

    /* شريط الفلاتر على الموبايل: البحث ياخد صفًا كاملًا لوحده (أهم حقل)، والفلاتر الثلاثة
       تلتف صفّين بمقاس 2×2 بدل صف مستقل لكل حقل - يبقى "مسح" في صفه الخاص تحتها كإجراء ثانوي
       منفصل بنفس شكله الأصلي (رابط نصّي رفيع)، لا صندوق بحجم القائمة. */
    .lg-filters {
        padding: 10px;
    }

    .lg-filter-search {
        flex: 1 1 100%;
        max-width: none;
    }

    .lg-filter-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        gap: 8px;
    }

    .lg-filter-group .lg-select {
        width: 100%;
        min-width: 0;
    }

    .lg-filter-clear {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .lg-mine-grid {
        grid-template-columns: 1fr;
    }

    .lg-request {
        flex-wrap: wrap;
    }

    .lg-request-actions {
        width: 100%;
    }

    .lg-request-actions .lg-btn {
        flex: 1;
        justify-content: center;
    }

    .lg-form-actions .lg-btn {
        flex: 1;
        justify-content: center;
    }
}

/* شاشات موبايل ضيّقة جدًا (520 فأقل) - نفس تخطيط الشبكة أعلاه، لكن بمقاسات أصغر (خط + ارتفاع
   الحقول + الفراغات) حتى تبقى مريحة ومقروءة بدل أن تكبر على حساب باقي الصفحة. */
@media (max-width: 520px) {
    .lg-filters {
        gap: 8px;
        padding: 8px;
    }

    .lg-filter-search input {
        height: 38px;
        font-size: .78rem;
        padding-inline: 34px 12px;
    }

    .lg-filter-search i {
        font-size: .78rem;
        inset-inline-start: 12px;
    }

    .lg-filter-group {
        gap: 6px;
    }

    .lg-select {
        height: 38px;
        font-size: .7rem;
        padding-inline: 10px 28px;
        background-position: left 12px center, left 7px center;
    }

    .lg-filter-clear {
        font-size: .72rem;
    }
}

@media (max-width: 460px) {
    .lg-radio-cards {
        grid-template-columns: 1fr;
    }

    .lg-mode-switch {
        width: 100%;
    }

    .lg-mode-switch button {
        flex: 1;
        justify-content: center;
    }

    .lg-points-legend .sep {
        display: none;
    }
}

/* الحركة تُحترم إعدادات النظام */
@media (prefers-reduced-motion: reduce) {
    .lg-modal-box,
    .lg-bell-panel,
    .lg-round-done.show,
    .lg-live-dot {
        animation: none;
    }

    .lg-mine-card:hover,
    .lg-tool:hover:not(:disabled) {
        transform: none;
    }
}

/* ========================================================================
   13 · بوابة الدوري الخاص (R-20)
   ======================================================================== */

.lg-gate {
    text-align: center;
    padding: 22px 20px 26px;
    background: var(--lg-card);
    border: 1px solid var(--lg-line);
    border-radius: 22px;
    box-shadow: var(--lg-shadow);
}

.lg-gate-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--lg-card-soft);
}

.lg-gate-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(3px) brightness(.55);
    transform: scale(1.06);
}

.lg-gate-lock {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #fff;
}

.lg-gate h1 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-gate-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lg-gate-facts {
    background: var(--lg-card-soft) !important;
    text-align: start;
    margin-bottom: 16px !important;
}

.lg-gate-facts li {
    color: var(--lg-text-2) !important;
}

.lg-gate-facts i {
    color: var(--lg-primary) !important;
}

.lg-gate-facts b {
    color: var(--lg-text) !important;
}

.lg-gate-desc {
    margin: 0 0 16px;
    font-size: .85rem;
    line-height: 1.9;
    color: var(--lg-muted);
}

.lg-gate-form {
    text-align: start;
}

.lg-gate-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 14px;
}

.lg-gate-state i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.lg-gate-state b {
    font-size: .92rem;
    font-weight: 800;
    color: var(--lg-text);
}

.lg-gate-state p {
    margin: 0;
    font-size: .8rem;
    line-height: 1.8;
    color: var(--lg-muted);
    max-width: 40ch;
}

.lg-gate-state.pending {
    background: rgba(245, 166, 35, .1);
}

.lg-gate-state.pending i {
    color: var(--lg-gold);
}

.lg-gate-state.rejected {
    background: rgba(255, 77, 109, .1);
}

.lg-gate-state.rejected i {
    color: var(--lg-danger);
}

/* ========================================================================
   14 · حالة الزر المعطّل — أوضح من opacity وحدها
   ======================================================================== */

.lg-btn-primary:disabled,
.lg-btn-primary.is-disabled,
.lg-btn-blue:disabled {
    opacity: 1;
    background: var(--lg-card-soft);
    color: var(--lg-muted);
    border: 1px solid var(--lg-line-strong);
    box-shadow: none;
    filter: none;
}

/* ========================================================================
   15 · جدول الترتيب على الجوال — صف مضغوط
   ------------------------------------------------------------------------
   ٤١ مشاركًا في جدول من سبعة أعمدة لا يتّسع لعرض الجوال، والتمرير الأفقي
   وحده يخفي عمود النقاط. فنطوي الأعمدة الأربعة الرقمية في سطر ميتا
   تحت اسم المشارك، ويبقى الترتيب + الاسم + الإجمالي ظاهرين بلا تمرير.
   ======================================================================== */

.lg-player-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lg-player-meta {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: var(--lg-muted);
    white-space: nowrap;
}

.lg-player-meta b {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.lg-player-meta b.ok { color: #12c79c; }
.lg-player-meta b.bad { color: var(--lg-danger); }
.lg-player-meta b.muted { color: var(--lg-text-2); }
.lg-player-meta b.played { color: var(--lg-text); }

.lg-player-meta > i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--lg-line-strong);
}

.lg-player-meta em {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: .62rem;
}

.lg-player-meta em.cut { color: var(--lg-blue); background: rgba(0, 153, 255, .13); }
.lg-player-meta em.boost { color: var(--lg-gold); background: rgba(245, 166, 35, .15); }

@media (max-width: 860px) {
    .lg-standings-table { min-width: 0; }

    .lg-standings-table td { padding: 10px 8px; }

    .lg-standings-table td.col-rank {
        width: 52px;
        padding: 10px 6px;
    }

    /* الترتيب الجديد: المركز(1) الاسم(2) لعب(3) صح(4) غلط(5) فائت(6) وسائل(7 إن ظهر) النقاط(دائمًا الأخير).
       عمود الوسائل شرطي فيتغيّر ترتيبه الرقمي، لذا يُستهدف بالكلاس لا بـ nth-child.
       تُطوى الأعمدة 3..6 والوسائل في سطر الميتا، ويبقى المركز والاسم والنقاط بلا تمرير. */
    .lg-standings-table td[data-label="لعب"],
    .lg-standings-table td[data-label="إجابة صح"],
    .lg-standings-table td[data-label="إجابة غلط"],
    .lg-standings-table td[data-label="فائت"],
    .lg-standings-table td[data-label="وسائل مساعدة"],
    .lg-standings-table thead th:nth-child(3),
    .lg-standings-table thead th:nth-child(4),
    .lg-standings-table thead th:nth-child(5),
    .lg-standings-table thead th:nth-child(6),
    .lg-standings-table thead th.col-tools {
        display: none;
    }

    .lg-standings-table td[data-label="النقاط"] {
        width: 66px;
        text-align: center;
        padding: 10px 6px;
    }

    .lg-player-meta { display: flex;}

    .lg-avatar {
        width: 30px;
        height: 30px;
        font-size: .68rem;
    }

    .lg-player-name { font-size: .82rem; }
}

/* ========================================================================
   16 · تصحيحات v2.1 — إيقاع الصفحات ورأس النافذة بلا صورة
   ======================================================================== */

/* --- رأس نافذة الانضمام: بلا غلاف صورة --- */

.lg-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-inline-end: 34px;
}

.lg-modal-badge {
    flex: none;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    font-size: 1.1rem;
    color: var(--lgx-primary);
    background: rgba(0, 212, 170, .13);
}

.lg-modal-headtext {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.lg-modal-headtext .lg-modal-title { margin: 0; }

.lg-modal-title.center,
.lg-modal-desc.center { text-align: center; }

/* --- إيقاع رأسي موحّد بين السكاشن --- */

.lg-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lg-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lg-form > .lg-form-errors:empty { display: none; }

/* اللوحات المتجاورة لا تتلاصق */
.league-page .lg-panel + .lg-panel,
.league-page .lg-panel + .league-note,
.league-page .league-note + .lg-panel,
.league-page .league-note + .league-note {
    margin-top: 20px;
}

.lg-stack > * { margin-top: 0 !important; }

/* تنفّس داخلي أوسع داخل اللوحة */
.league-page .lg-panel-head { padding: 17px 22px; }
.league-page .lg-panel-body { padding: 22px; }

/* جدول ملتصق بحواف اللوحة */
.lg-panel-body.flush { padding: 0; }
.lg-panel-body.flush .lg-table-wrap { border: 0; border-radius: 0; background: transparent; }
.lg-panel-body.flush .lg-table tbody tr:last-child td { border-bottom: 0; }
.lg-panel-body.flush > .lg-panel-foot-note { padding: 0 22px 18px; }
.lg-panel-body.flush > .league-empty { padding: 34px 22px; }

/* --- شاشة الإنشاء: مسافات الشبكة --- */

.lg-form-grid { gap: 16px 16px; }
.lg-form-grid .lg-field { margin-bottom: 0; }

.lg-duration-note { margin-top: 2px; }

.lg-form-actions {
    padding-top: 6px;
    padding-bottom: 8px;
}

@media (max-width: 640px) {
    .lg-form-grid { grid-template-columns: 1fr; }
    .lg-form-actions { flex-direction: column-reverse; }
    .lg-form-actions .lg-btn { width: 100%; justify-content: center; }
    .league-page .lg-panel-head { padding: 15px 16px; }
    .league-page .lg-panel-body { padding: 16px; }
    .lg-panel-body.flush { padding: 0; }
    .lg-panel-body.flush > .lg-panel-foot-note { padding: 0 16px 14px; }
}

/* --- شاشة الإدارة: فصل بصري بين مراحل النشر --- */

.lg-composer { display: flex; flex-direction: column; gap: 16px; }
.lg-composer > .lg-mode-switch { margin-bottom: 0; }
.lg-composer-hint { margin: 0; }
.lg-question-blocks { display: flex; flex-direction: column; gap: 14px; }
.lg-publish-warn { margin: 4px 0 0; }

.lg-requests { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.lg-inline-hint { margin: 14px 0 0; }
.lg-history { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }

/* --- أزرار أقسام الصفحة الرئيسية --- */

.lg-home-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 560px) {
    .lg-home-actions { justify-content: stretch; }
    .lg-home-actions .lg-btn { flex: 1; justify-content: center; }
}

/* ========================================================================
   17 · الجدول على الجوال (T-06)
   ------------------------------------------------------------------------
   كانت هذه الفقرة تُثبّت عمودَي الترتيب/الاسم أثناء تمرير أفقي، وتعرض
   ".lg-scroll-hint" ("مرّر الجدول أفقيًا"). بعد تقليل عدد الأعمدة لم يعد
   هناك تمرير أفقي إطلاقًا (انظر ".lg-table .col-mid" أعلاه)، فحُذف العنصر
   من _LeaguesTable.cshtml وحُذفت قواعد التثبيت الخاصة به هنا معه.
   ======================================================================== */

/* ========================================================================
   18 · القوائم المتدرّجة — «عرض المزيد» والفلترة الحيّة
   ======================================================================== */

/* [hidden] وحده لا يكفي: قواعد display الصريحة تتغلّب عليه */
[data-lg-list] > [hidden],
.lg-more[hidden],
.lg-table-wrap[hidden],
[data-lg-empty][hidden],
[data-f-clear][hidden] {
    display: none !important;
}

.lg-more.inline {
    padding: 12px 15px;
    border-top: 1px solid var(--lgx-line);
}

.lg-panel-body > .lg-more {
    padding-top: 14px;
}

.lg-panel-body.flush > [data-lg-scope] > .lg-more {
    padding: 14px 22px 18px;
}

.lg-panel-body.flush > [data-lg-scope] > [data-lg-empty] {
    padding: 30px 22px;
}

/* شريط الفلاتر داخل نطاق — نفس مظهر صفحة الدوريات */
[data-lg-scope] > .lg-filters {
    margin-bottom: 16px;
}

.lg-filter-clear[hidden] { display: none !important; }

@media (max-width: 640px) {
    .lg-panel-body.flush > [data-lg-scope] > .lg-more { padding: 12px 16px 16px; }
}

/* ========================================================================
   19 · ترويسة صفحة الدوري وبوابة الخاص — بلا صور
   ======================================================================== */

.league-detail-head {
    position: relative;
    border-radius: var(--lg-radius, 20px);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(0, 212, 170, .16), transparent 62%),
        var(--lg-card);
    border: 1px solid var(--lg-line);
    box-shadow: var(--lg-shadow);
    overflow: hidden;
}

.league-detail-head .overlay {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 24px;
    background: none;
}

.league-detail-head h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3.2vw, 1.95rem);
    font-weight: 800;
    color: var(--lg-text);
    line-height: 1.35;
}

.league-detail-head .league-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* بوابة الدوري الخاص: قفل بدل الغلاف */
.lg-gate-cover {
    position: relative;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    border-radius: 24px;
    background: rgba(245, 166, 35, .13);
    aspect-ratio: auto;
}

.lg-gate-cover .lg-gate-lock {
    position: static;
    display: grid;
    place-items: center;
    width: auto;
    height: auto;
    background: none;
    color: var(--lg-gold);
    font-size: 1.7rem;
}

@media (max-width: 640px) {
    .league-detail-head .overlay { padding: 20px 17px; }
}

/* ========================================================================
   20 · العلامة التجارية — الدوريات العامة فقط
   ------------------------------------------------------------------------
   ثلاثة مواضع: بجوار الاسم في الجدول · أسفل شاشة السؤال · لوحة الأدمن.
   ======================================================================== */

/* --- في جدول الدوريات: مربّع صغير بحواف دائرية قبل الاسم --- */

.lg-cell-name.has-logo {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
}

.lg-cell-name.has-logo .lg-owner-logo {
    grid-row: 1 / span 2;
}

.lg-owner-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    flex: none;
}

/* --- شريط اللوجوهات أسفل شاشة السؤال --- */

.lg-play-brands {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--lg-line);
}

.lg-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

/* المنصة يسارًا — الصفحة RTL فالترتيب يعكسه flex تلقائيًا،
   لذلك نثبّت الجهة صراحةً بدل الاعتماد على ترتيب الـ DOM */
.lg-brand.platform { order: 2; }
.lg-brand.owner,
.lg-brand.official-tag { order: 1; }

.lg-brand img {
    height: 44px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.lg-brand.owner img {
    height: 34px;
    width: 34px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid var(--lg-line);
}

.lg-brand.owner small {
    font-size: .76rem;
    font-weight: 700;
    color: var(--lg-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.lg-brand.official-tag {
    font-size: .76rem;
    font-weight: 800;
    color: var(--lg-gold);
    background: rgba(245, 166, 35, .13);
    border-radius: 9px;
    padding: 6px 11px;
}

/* لوجو المنصة له نسختان: فاتحة وداكنة */
/* logo.png شعار فاتح يصلح للخلفية الداكنة، و logo-dark.png عكسه */
.lg-brand.platform .light { display: block; }
.lg-brand.platform .dark { display: none; }

body.light-mode .lg-brand.platform .light { display: none; }
body.light-mode .lg-brand.platform .dark { display: block; }

/* --- حقل الرفع في شاشة الإنشاء --- */

.lg-optional {
    font-size: .72rem;
    font-weight: 600;
    color: var(--lg-muted);
    background: var(--lg-card-soft);
    border: 1px solid var(--lg-line);
    border-radius: 7px;
    padding: 2px 8px;
    margin-inline-start: 6px;
}

.lg-logo-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.lg-logo-preview {
    flex: none;
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--lg-card-soft);
    border: 1px dashed var(--lg-line-strong);
    overflow: hidden;
    color: var(--lg-muted);
    font-size: 1.4rem;
}

.lg-logo-preview.has-image {
    border-style: solid;
    border-color: var(--lg-primary);
}

.lg-logo-preview.has-image > i { display: none; }

.lg-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lg-logo-info {
    flex: 1;
    min-width: 0;
}

.lg-logo-info p {
    margin: 0 0 11px;
    font-size: .84rem;
    line-height: 1.8;
    color: var(--lg-text-2);
}

.lg-logo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 9px;
}

.lg-logo-actions label { cursor: pointer; }

.lg-logo-hint {
    display: block;
    font-size: .74rem;
    color: var(--lg-muted);
}

@media (max-width: 560px) {
    .lg-logo-row {
        flex-direction: column;
        align-items: stretch;
    }

    .lg-logo-preview {
        width: 100%;
        height: 130px;
    }

    .lg-play-brands {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px;
    }
}

.lg-cell-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    line-height: 1.6;
}

/* منتقي الأبناء وحده لا يطال الفواصل المطويّة (<i> داخل span.fold) */
.lg-cell-meta i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--lg-line-strong);
    flex: none;
}

.lg-cell-meta .fold > i { margin: 0; }

.lg-cell-meta .nowrap { white-space: nowrap; }

.lg-cell-meta b {
    font-weight: 800;
    color: var(--lg-text);
    font-variant-numeric: tabular-nums;
}

.lg-cell-meta b.accent { color: var(--lg-primary); }

.lg-cell-meta .fold { display: none; }

@media (max-width: 560px) {
    .lg-leagues-table .col-fold { display: none; }

    .lg-leagues-table .lg-cell-meta .fold {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .lg-leagues-table .lg-cell-name b {
        display: block;
        font-size: 12px;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .lg-leagues-table .lg-cell-meta { font-size: 11px; }

    /* عرض العمودين الجانبيّين مُثبَّت، والاسم يأخذ ما تبقّى.
       بدون التثبيت يبتلع عمودُ الاسم العرضَ كله وينهار عمود الإجراءات إلى 4px. */
    .lg-leagues-table .col-rank { width: 46px; min-width: 46px; }

    .lg-leagues-table .col-actions {
        width: 92px;
        min-width: 92px;
        white-space: nowrap;
    }

    .lg-leagues-table .col-actions .lg-btn { flex: none; }

    /* table-layout:fixed مفعّل من قاعدة 640px، فالعرض المُعلن يُحترم حرفيًا
       والاسم يأخذ ما تبقّى: 46 + 92 + auto = عرض الحاوية. */
    .lg-leagues-table .col-name { width: auto; min-width: 0; }

    /* «ينتهي في 2026/09/01» أطول عنصر ويدفع الفئة لسطر ثانٍ.
       التاريخ متاح في صفحة الدوري، فيُسقط هنا لصالح ارتفاع صفّ منتظم. */
    .lg-leagues-table.mode-discover .lg-cell-meta .meta-date { display: none; }

    .lg-leagues-table tbody td {
        padding: 11px 8px;
        vertical-align: middle;
    }

    .lg-leagues-table { min-width: 0; }
    .lg-table-wrap:has(.lg-leagues-table) ~ .lg-scroll-hint { display: none; }
}

/* ========================================================================
   13 · نافذة سؤال اليوم المنبثقة (R-23 · R-24)
   ======================================================================== */

/* محتوى _PlayBody.cshtml المُحمَّل هنا عبر AJAX يعتمد على متغيّرات --lg-* المعرَّفة
   أصلًا على .league-page في leagues.css. النافذة تُفتح من أي صفحة — قد لا تحمل
   .league-page كأصل — فنكرّر نفس القيم هنا محصورة بصندوق النافذة فقط. */
.lg-q-modal .lg-modal-box {
    --lg-bg: #080b12;
    --lg-card: #14181f;
    --lg-card-soft: rgba(255, 255, 255, .035);
    --lg-line: rgba(255, 255, 255, .07);
    --lg-line-strong: rgba(148, 163, 184, .22);
    --lg-text: #f4f7fb;
    --lg-text-2: #b9c4d2;
    --lg-muted: #7d8a99;
    --lg-primary: #00d4aa;
    --lg-emerald: #00cc99;
    --lg-blue: #0099ff;
    --lg-gold: #f5a623;
    --lg-danger: #ff4d6d;
    --lg-radius: 24px;
    --lg-shadow: 0 24px 60px rgba(0, 0, 0, .38);
}

body.light-mode .lg-q-modal .lg-modal-box {
    --lg-bg: #eef1f4;
    --lg-card: #ffffff;
    --lg-card-soft: rgba(15, 23, 42, .035);
    --lg-line: rgba(15, 23, 42, .09);
    --lg-line-strong: rgba(15, 23, 42, .14);
    --lg-text: #16202e;
    --lg-text-2: #3f4c5c;
    --lg-muted: #6b7787;
    --lg-shadow: 0 20px 50px rgba(15, 23, 42, .10);
}

/* حجم معتدل على الديسكتوب (R-24) — النافذة المنبثقة لا تمتد لصفحة كاملة */
.lg-q-modal .lg-modal-box {
    width: min(560px, 100%);
    max-height: calc(100vh - 36px);
    padding: 0;
    background: var(--lg-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lg-q-modal .lg-modal-x {
    background: var(--lg-card-soft);
    color: var(--lg-text-2);
}

.lg-q-modal-body {
    padding: 46px 18px 22px;
    overflow-y: auto;
    color: var(--lg-text);
}

.lg-q-modal-loading {
    display: grid;
    place-items: center;
    padding: 60px 0;
    font-size: 1.6rem;
    color: var(--lg-primary, var(--lgx-primary));
}

.lg-q-modal-error {
    margin: 0;
    padding: 18px;
    text-align: center;
    color: var(--lg-danger, var(--lgx-danger));
    font-size: .88rem;
}

/* داخل النافذة: العنوان والترويسة والأسئلة مضغوطة أكثر من الصفحة الكاملة (R-24) */
.lg-q-modal .league-question-text { font-size: clamp(1rem, 4.4vw, 1.2rem); line-height: 1.6; }
.lg-q-modal .lg-q-body { padding: 14px; }
.lg-q-modal .league-choices { gap: 9px; margin-top: 16px; }
.lg-q-modal .league-choice { padding: 12px 14px; font-size: .88rem; }

/* الجوال: لوح سفلي بعرض الشاشة بدل صندوق متمركز — أقرب لنمط تطبيقات الجوال (R-24) */
@media (max-width: 560px) {
    .lg-q-modal {
        padding: 0;
        align-items: flex-end;
    }

    .lg-q-modal .lg-modal-box {
        width: 100%;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
        animation: lgRiseUp .26s cubic-bezier(.2, .9, .3, 1);
    }

    .lg-q-modal .lg-q-modal-body {
        padding: 44px 14px 26px;
    }

    .lg-q-modal .league-question-text { font-size: 1rem; }
    .lg-q-modal .lg-round-done-stats span { padding: 7px 4px; }
}

@keyframes lgRiseUp {
    from { transform: translateY(28px); opacity: 0; }
}

/* ---------- مؤقت الإجابة لكل سؤال (R-27) ---------- */

.lg-q-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.lg-q-timer-track {
    flex: 1;
    height: 6px;
    border-radius: 100px;
    background: var(--lg-line-strong);
    overflow: hidden;
}

.lg-q-timer-fill {
    display: block;
    height: 100%;
    background: var(--lg-primary);
    transition: width 1s linear, background-color .25s ease;
}

.lg-q-timer.is-urgent .lg-q-timer-fill { background: var(--lg-danger); }

.lg-q-timer-value {
    flex: none;
    min-width: 26px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: .8rem;
    font-weight: 800;
    color: var(--lg-muted);
}

.lg-q-timer.is-urgent .lg-q-timer-value { color: var(--lg-danger); }

.lg-q-card.is-expired {
    border-color: rgba(255, 77, 109, .4);
    opacity: .85;
}

/* ========================================================================
   14 · v4 changes — question type · variants · timing chips · bulk stepper
   R-28 · R-29 · R-30 · R-31 · R-32
   Every color goes through a --lg-* variable, never a literal, so light and
   dark both work without duplicating rules.
   ======================================================================== */

/* ---------- Selection chips (R-30 · R-31) ----------
   Replaces the dropdown on the create screen: a hidden radio plus a visible
   pill, so the picked value survives a validation error with no JS at all. */

.lg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.lg-chip {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.lg-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.lg-chip > span,
.lg-chip.as-button > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--lg-line-strong);
    border-radius: 999px;
    background: var(--lg-card-soft);
    color: var(--lg-text-2);
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

/* as-button: the lifetime chips are plain buttons, not radios — they write
   into the number field, which stays the only value the form posts. */
.lg-chip.as-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
}

.lg-chip:hover > span {
    border-color: var(--lg-primary);
    color: var(--lg-text);
}

.lg-chip input:checked + span,
.lg-chip.as-button.is-on > span {
    border-color: var(--lg-primary);
    background: color-mix(in srgb, var(--lg-primary) 14%, transparent);
    color: var(--lg-primary);
}

.lg-chip input:focus-visible + span {
    outline: 2px solid var(--lg-primary);
    outline-offset: 2px;
}

/* ---------- Question lifetime in hours (R-31) ---------- */

.lg-hours-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.lg-hours-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.lg-hours-input input {
    width: 96px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.lg-hours-input small {
    color: var(--lg-muted);
    font-size: .82rem;
    font-weight: 700;
}

/* ---------- Question type switch inside the composer (R-28) ----------
   Smaller than .lg-mode-switch: it is secondary to the single/bulk choice. */

.lg-type-switch {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    background: var(--lg-card-soft);
}

.lg-type-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--lg-muted);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.lg-type-switch button i { font-size: .8em; }

.lg-type-switch button.is-on {
    background: var(--lg-card);
    color: var(--lg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* The two fixed true/false rows: text is not editable and the picker shows an
   icon instead of an Arabic letter. */
.lg-choice-row.is-fixed input {
    cursor: default;
    font-weight: 700;
}

.lg-choice-row.tf-true .lg-correct-pick .key { color: var(--lg-emerald); }
.lg-choice-row.tf-false .lg-correct-pick .key { color: var(--lg-danger); }

.lg-choice-row.is-correct.tf-false .lg-correct-pick {
    border-color: var(--lg-danger);
    background: color-mix(in srgb, var(--lg-danger) 16%, transparent);
}

.lg-choice-row.is-correct.tf-false .lg-correct-pick .key { color: var(--lg-danger); }

/* ---------- Variants of a single question (R-29) ---------- */

.lg-q-block.is-variant {
    border-style: dashed;
    background: var(--lg-card-soft);
}

.lg-q-block.is-variant .lg-q-block-title { color: var(--lg-blue); }

.lg-btn-note {
    margin-inline-start: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--lg-card-soft);
    color: var(--lg-muted);
    font-size: .7rem;
    font-weight: 700;
}

.lg-variants-note { margin-top: 4px; }

/* Question-type tag — used in the published-days log and the question header. */
.lg-q-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--lg-blue) 14%, transparent);
    color: var(--lg-blue);
    font-size: .68rem;
    font-style: normal;
    font-weight: 800;
}

/* ========================================================================
   Bulk stepper and navigation between its questions (R-32)
   ======================================================================== */

/* is-stepped shows the active question alone. Every other card stays in the
   DOM with its full state, so all the DOM contracts leagues.js relies on keep
   holding — this hides, it does not remove. */
.lg-play.is-stepped .lg-q-card:not(.is-active) { display: none; }

.lg-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lg-step {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.lg-step button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--lg-line-strong);
    border-radius: 50%;
    background: var(--lg-card-soft);
    color: var(--lg-muted);
    font-size: .78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.lg-step button:disabled { cursor: not-allowed; }

.lg-step.is-current button {
    border-color: var(--lg-primary);
    background: color-mix(in srgb, var(--lg-primary) 16%, transparent);
    color: var(--lg-primary);
}

.lg-step.is-correct button {
    border-color: var(--lg-emerald);
    background: color-mix(in srgb, var(--lg-emerald) 18%, transparent);
    color: var(--lg-emerald);
}

.lg-step.is-wrong button {
    border-color: var(--lg-danger);
    background: color-mix(in srgb, var(--lg-danger) 16%, transparent);
    color: var(--lg-danger);
}

/* Timed out (R-27): settled like an answered question, but neutral — it is not a wrong
   answer, it is an unanswered one, so it reads muted rather than red. */
.lg-step.is-missed button {
    border-color: var(--lg-line-strong);
    background: var(--lg-card-soft);
    color: var(--lg-muted);
}

.lg-step.is-locked button { opacity: .45; }

/* Ring around the dot the participant is standing on — separates "showing"
   from "current" when they step back to review an answered question. */
.lg-step.is-viewing button {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-primary) 26%, transparent);
}

/* ---------- Navigation footer ---------- */

.lg-q-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--lg-line);
}

/* showDayDone() hides this with the hidden attribute — without this override the flex
   display above wins over the UA default and the footer stays on screen under roundDone. */
.lg-q-nav[hidden] {
    display: none;
}

.lg-q-nav .lg-btn { flex: none; }

/* Single-question day: just the one "see result" button, so it reads as an outcome to
   walk toward rather than one side of a nav bar with nothing across from it. */
.lg-q-nav-single {
    justify-content: center;
}

.lg-q-nav .lg-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.lg-q-nav-state {
    flex: 1;
    text-align: center;
    color: var(--lg-muted);
    font-size: .76rem;
    font-weight: 700;
}

/* "next" turns into the result-reveal button once the last question of a bulk day settles
   (R-32 revision) — leagues.js swaps it onto .lg-btn-primary for that moment, the same
   call-to-action styling as every other "see result" button on this screen, and it takes
   the row's full width so it reads as the one thing left to do. */
.lg-q-nav [data-step-next].is-result {
    flex: 1;
    justify-content: center;
}

/* Tool blocked by question type (remove-two-answers on true/false) — R-28 */
.lg-tool.is-blocked {
    opacity: .35;
    text-decoration: line-through;
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
    .lg-step button {
        width: 28px;
        height: 28px;
        font-size: .72rem;
    }

    .lg-hours-row { gap: 10px; }
    .lg-hours-input input { width: 84px; }

    .lg-type-switch { width: 100%; }
    .lg-type-switch button { flex: 1; justify-content: center; }
}

/* True/false for the participant: two large side-by-side buttons with a light
   colour cue (R-28). */

.league-choices.tf {
    display: flex;
    gap: 12px;
}

.league-choices.tf .league-choice {
    gap: 4px;
    padding: 18px 12px;
    text-align: center;
    justify-content: center;
}

.league-choices.tf .league-choice .key {
    font-size: 1.05rem;
}

.league-choices.tf .league-choice .txt {
    font-size: 1rem;
    font-weight: 800;
}

.league-choices.tf .league-choice .mark { display: none; }

.league-choices.tf .league-choice.tf-true .key {
    background: color-mix(in srgb, var(--lg-emerald) 16%, transparent);
    color: var(--lg-emerald);
}

.league-choices.tf .league-choice.tf-false .key {
    background: color-mix(in srgb, var(--lg-danger) 14%, transparent);
    color: var(--lg-danger);
}

.league-choices.tf .league-choice.tf-true:hover:not(:disabled) { border-color: var(--lg-emerald); }
.league-choices.tf .league-choice.tf-false:hover:not(:disabled) { border-color: var(--lg-danger); }

/* Once answered, the existing correct/wrong/dimmed states own the colour — the
   icon key goes neutral so type and result never fight over the same button. */
.league-choices.tf .league-choice.correct .key,
.league-choices.tf .league-choice.wrong .key,
.league-choices.tf .league-choice.dimmed .key {
    background: transparent;
    color: inherit;
}

@media (max-width: 380px) {
    .league-choices.tf { grid-template-columns: 1fr; }
    .league-choices.tf .league-choice { min-height: 0; flex-direction: row; }
}
