/* TeleLive — Rules page (readable bilingual document) */
.tl-rules-surface {
    --tl-r-max: 920px;
    --tl-r-accent: #5280ff;
    --tl-r-fa: "Vazirmatn", "Dana", Tahoma, sans-serif;
    --tl-r-en: "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 70vh;
    padding: 0 0 4rem;
    background:
        radial-gradient(ellipse 80% 45% at 50% -8%, rgba(30, 86, 245, 0.14), transparent 60%),
        var(--bg);
}

.tl-rules-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem clamp(14px, 3vw, 24px) 0;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 960px) {
    .tl-rules-wrap { grid-template-columns: 1fr; gap: 1.15rem; }
}

.tl-rules-sidebar { position: sticky; top: 80px; }
@media (max-width: 960px) { .tl-rules-sidebar { position: static; } }

.tl-rules-toc {
    position: relative;
    isolation: isolate;
    border-radius: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.16);
    background: rgba(22, 22, 26, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tl-rules-toc::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    pointer-events: none;
}

.tl-rules-toc h4 {
    margin: 0 0 12px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tl-rules-toc a {
    display: block;
    padding: 9px 11px;
    margin-bottom: 4px;
    border-radius: 11px;
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.tl-rules-toc a:hover,
.tl-rules-toc a:focus-visible {
    border-color: rgba(82, 128, 255, 0.4);
    background: rgba(30, 86, 245, 0.12);
    outline: none;
    transform: translateX(-2px);
}
html[dir="ltr"] .tl-rules-toc a:hover { transform: translateX(2px); }

.tl-rules-toc a .toc-fa {
    display: block;
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
    font-weight: 700;
}

.tl-rules-toc a .toc-en {
    display: block;
    margin-top: 2px;
    font-family: var(--tl-r-en);
    font-size: 0.74rem;
    color: var(--text-muted);
    direction: ltr;
}

.tl-rules-main { min-width: 0; max-width: var(--tl-r-max); }

.tl-rules-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 24px;
    padding: clamp(1.35rem, 3vw, 1.85rem);
    margin-bottom: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.16);
    background: rgba(22, 22, 26, 0.22);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.tl-rules-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    pointer-events: none;
}
.tl-rules-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(90% 70% at 8% 0%, rgba(30, 86, 245, 0.2), transparent 55%);
}

.tl-rules-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.1rem;
}

.tl-rules-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(30, 86, 245, 0.12);
    color: #93c5fd;
}

.tl-rules-hero-title-fa {
    margin: 0 0 8px;
    font-family: var(--tl-r-fa);
    font-size: clamp(1.4rem, 3.5vw, 1.85rem);
    font-weight: 900;
    line-height: 1.45;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-hero-title-en {
    margin: 0 0 14px;
    font-family: var(--tl-r-en);
    font-size: clamp(1rem, 2.4vw, 1.18rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-muted);
}

.tl-rules-hero-lead-fa {
    margin: 0 0 10px;
    font-family: var(--tl-r-fa);
    font-size: 1rem;
    line-height: 1.85;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-hero-lead-en {
    margin: 0;
    font-family: var(--tl-r-en);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-rules-section {
    margin-bottom: 1.75rem;
    scroll-margin-top: 88px;
}

.tl-rules-section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 1rem;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(82, 128, 255, 0.25);
}

.tl-rules-section-num {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(30, 86, 245, 0.14);
    color: var(--tl-r-accent);
    font-family: var(--tl-r-en);
    font-size: 0.85rem;
    font-weight: 800;
}

.tl-rules-section-titles { flex: 1; min-width: 0; }

.tl-rules-section-titles h2 {
    margin: 0;
    font-family: var(--tl-r-fa);
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.55;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-section-titles .sub-en {
    display: block;
    margin-top: 4px;
    font-family: var(--tl-r-en);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    direction: ltr;
    text-align: left;
}

.tl-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tl-rules-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    position: relative;
    isolation: isolate;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(22, 22, 26, 0.22);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.tl-rules-item:hover {
    border-color: rgba(82, 128, 255, 0.28);
    transform: translateY(-1px);
}

.tl-rules-item-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(30, 86, 245, 0.14);
    color: var(--tl-r-accent);
    font-size: 0.95rem;
}

.tl-rules-item-body { flex: 1; min-width: 0; }

.tl-rules-item-body h3 {
    margin: 0 0 8px;
    font-family: var(--tl-r-fa);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.65;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-item-body .txt-fa {
    margin: 0 0 12px;
    font-family: var(--tl-r-fa);
    font-size: 0.94rem;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-item-body .txt-en {
    margin: 0;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-family: var(--tl-r-en);
    font-size: 0.86rem;
    line-height: 1.75;
    direction: ltr;
    text-align: left;
    color: var(--text-muted);
}

.tl-rules-item-body .txt-en strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.tl-rules-prose {
    margin: 0 0 14px;
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--text-muted);
}
.tl-rules-prose.lang-fa {
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
    line-height: 1.9;
}
.tl-rules-prose.en {
    font-family: var(--tl-r-en);
    direction: ltr;
    text-align: left;
    margin-bottom: 8px;
}

.tl-rules-table-wrap {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: auto;
    margin-bottom: 16px;
    background: rgba(22, 22, 26, 0.28);
    -webkit-overflow-scrolling: touch;
}

.tl-rules-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tl-rules-table th,
.tl-rules-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    vertical-align: top;
    line-height: 1.6;
}

.tl-rules-table thead th {
    background: rgba(30, 86, 245, 0.1);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: start;
}

.tl-rules-table tbody tr:last-child td { border-bottom: none; }
.tl-rules-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.tl-rules-table .col-en { font-family: var(--tl-r-en); direction: ltr; }
.tl-rules-table .col-fa {
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
}

.tl-rules-alert {
    border-radius: 14px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    padding: 16px 18px;
}
.tl-rules-alert p {
    margin: 0 0 10px;
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--text);
}
.tl-rules-alert p:last-child { margin-bottom: 0; }
.tl-rules-alert .lang-fa { font-family: var(--tl-r-fa); direction: rtl; text-align: right; line-height: 1.9; }
.tl-rules-alert .en { font-family: var(--tl-r-en); direction: ltr; text-align: left; color: var(--text-muted); font-size: 0.88rem; }

.tl-rules-footer-note {
    margin-top: 2rem;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(22, 22, 26, 0.28);
}
.tl-rules-footer-note p {
    margin: 0 0 12px;
    font-size: 0.94rem;
    line-height: 1.8;
    color: var(--text);
}
.tl-rules-footer-note p:last-child { margin-bottom: 0; }
.tl-rules-footer-note .lang-fa { font-family: var(--tl-r-fa); direction: rtl; text-align: right; }
.tl-rules-footer-note .en {
    font-family: var(--tl-r-en);
    direction: ltr;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .tl-rules-toc,
[data-theme="light"] .tl-rules-hero,
[data-theme="light"] .tl-rules-item,
[data-theme="light"] .tl-rules-table-wrap,
[data-theme="light"] .tl-rules-footer-note {
    background: rgba(252, 252, 253, 0.86);
    border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .tl-rules-toc a { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .tl-rules-hero-lead-en,
[data-theme="light"] .tl-rules-item-body .txt-en,
[data-theme="light"] .tl-rules-footer-note .en {
    border-top-color: rgba(0, 0, 0, 0.08);
}
