/* rb-optlg-layout.css – صفحة الدخول: ٤ تخطيطات (html[data-lgl]) + ٤ خلفيات للفن (html[data-lgbg]). JS في rb-optlg-layout.js
   بدون توهج ولا إضاءة، والحركة كلها بطيئة وهادية. */

/* ======================= الفن: الأساس ======================= */
.lg-art { isolation: isolate; }
.la { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.la[hidden] { display: none; }
.la-line, .la-hud { display: none; }
#lgArt::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: none; }

/* ======================= الخلفيات ======================= */

/* ١ · شبكة المخطط (نفس الرئيسية) + ملصقات ثابتة */
.la-1 { background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 64px 64px; background-position: center -1px; }
.la-1 .fr { position: absolute; inset: 64px 12%; border: 1px dashed rgba(203, 242, 116, .22); border-radius: 2px; }
.la-1 .mk { position: absolute; width: 9px; height: 9px; background: var(--lime); }
.la-1 .cell { position: absolute; width: 64px; height: 64px; background: rgba(163, 118, 251, .1); border: 1px solid rgba(163, 118, 251, .25); }
.la-1 .cell.l { background: rgba(203, 242, 116, .08); border-color: rgba(203, 242, 116, .22); }
.la-1 .tagx { position: absolute; font: 600 11px var(--f-num); color: rgba(203, 242, 116, .55); direction: ltr; letter-spacing: 1px; white-space: nowrap; }
.la-1 .stk { position: absolute; height: auto; overflow: visible; }

/* ٢ · جدار التصاميم: أعمدة مايلة من لقطات حقيقية تمشي بهدوء عكس بعض */
.la-2 .tilt { position: absolute; inset: -40% -30%; display: flex; justify-content: center; gap: 22px; transform: rotate(-12deg); opacity: .78; }
.la-2 .wcol { flex: 0 0 clamp(190px, 17vw, 270px); }
.la-2 .run, .la-3 .run { display: flex; flex-direction: column; animation: laUp var(--dur, 90s) linear infinite; will-change: transform; }
.la-2 .run { gap: 22px; --g: 11px; }
.la-2 .rev .run { animation-direction: reverse; }
.la-2 .wcol:nth-child(2) { margin-top: -120px; } .la-2 .wcol:nth-child(4) { margin-top: -60px; }
@keyframes laUp { to { transform: translateY(calc(-50% - var(--g, 6px))); } }
.la-2 .tile { margin: 0; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line-2); overflow: hidden; }
.la-2 .tile.lb { padding: 14px; background: #121119; }
.la-2 .tile img { display: block; width: 100%; height: auto; }
.la-2 .tile.cv img { aspect-ratio: 16 / 9; object-fit: cover; }
.la-2 .fade, .la-3 .fade { position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(#0C0B11, transparent 20%, transparent 80%, #0C0B11), linear-gradient(90deg, #0C0B11, transparent 16%, transparent 84%, #0C0B11); }

/* ٣ · فيد البث: أعمدة أحداث مثل Activity Feed تطلع لفوق ببطء */
.la-3 .cols { position: absolute; inset: 0 6%; display: grid; grid-template-columns: repeat(3, minmax(0, 290px)); justify-content: center; gap: 16px; }
.la-3 .fcol:nth-child(n+4) { display: none; }
html[data-lgl="2"] .la-3 .cols, html[data-lgl="4"] .la-3 .cols { grid-template-columns: repeat(5, minmax(0, 290px)); }
html[data-lgl="2"] .la-3 .fcol, html[data-lgl="4"] .la-3 .fcol { display: block; }
.la-3 .fcol:nth-child(4) { margin-top: -110px; } .la-3 .fcol:nth-child(5) { margin-top: -50px; }
.la-3 .run { gap: 12px; --g: 6px; }
.la-3 .fcol:nth-child(2) { margin-top: -70px; } .la-3 .fcol:nth-child(3) { margin-top: -30px; }
.la-3 .fcol { opacity: .82; }

/* بطاقة حدث (مشتركة) */
.la-ev { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px 10px 12px; border-radius: 16px; background: #111018; border: 1px solid var(--line); border-inline-start: 2px solid var(--c); color: #8d8c99; font-size: 13px; }
.la-ev .av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--f-num); color: #0B0B0F; background: var(--c); }
.la-ev .av.hrt { font-size: 15px; }
.la-ev p { flex: 1; min-width: 0; margin: 0; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.la-ev b { color: #e6e5ee; font: 600 13px var(--f-num); }
.la-ev em { font-style: normal; font-weight: 600; color: var(--c); white-space: nowrap; }
.la-ev time { flex: none; font-size: 11px; color: var(--dim); }

/* ٤ · معاينة البث: مشهد غامق + بار لايف الحقيقي + توب في الزاوية + أحداث وأليرت يطلعون بهدوء */
.la-4 .scene { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px), linear-gradient(160deg, #16141F, #0B0A10 62%); }
.la-4 .bl { position: absolute; top: 100px; left: 50%; width: min(88%, 720px); height: auto; translate: -50% 0; }
.la-4 .lbc { position: absolute; margin: 0; left: 5%; bottom: 6%; width: min(30%, 240px); padding: 10px; border-radius: 18px; background: rgba(14, 13, 19, .82); border: 1px solid var(--line-2); }
.la-4 .lbc img { display: block; width: 100%; height: auto; }
.la-4 .alr { position: absolute; margin: 0; left: 50%; top: 50%; width: min(48%, 440px); translate: -50% -50%; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); opacity: 0; scale: .97; transition: opacity var(--t-3) var(--ease), scale var(--t-3) var(--ease); }
.la-4 .alr.show { opacity: 1; scale: 1; }
.la-4 .alr img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.la-4 .evs { position: absolute; right: 5%; bottom: 6%; width: min(40%, 290px); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.la-4 .la-ev { opacity: 0; translate: 0 10px; transition: opacity var(--t-3) var(--ease), translate var(--t-3) var(--ease); background: rgba(17, 16, 24, .9); }
.la-4 .la-ev.on { opacity: 1; translate: 0 0; }
.la-4 .la-ev.out { opacity: 0; translate: 0 -10px; }

/* يوقف لما الصفحة مخفية، وما يتحرك لمن طالب حركة أقل */
.la-paused #lgArt .run { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .la-2 .run, .la-3 .run { animation: none; }
    .la-4 .alr, .la-4 .la-ev { transition: none; }
}

/* ======================= التخطيطات ======================= */

/* ٢ · بطاقة بالنص: بطاقة وحدة عائمة فوق فن على كامل الشاشة */
html[data-lgl="2"] .lg { display: grid; grid-template-columns: 1fr; place-items: center; padding: 100px 16px 48px; }
html[data-lgl="2"] .lg-art { position: absolute; inset: 0; border: 0; }
html[data-lgl="2"] #lgArt::after { background: rgba(10, 10, 13, .42); }
html[data-lgl="2"] .lg-card { max-width: 460px; margin: 0; padding: 40px 36px 30px; gap: 12px; background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--lime); border-radius: 32px; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9); }
html[data-lgl="2"] .lg-card h1 { font-size: clamp(34px, 3.2vw, 46px); }

/* ٣ · فن عريض: الفن ٦٢٪ وعليه كلام كبير، والبطاقة عمود نحيف يمين */
html[data-lgl="3"] .lg { grid-template-columns: minmax(360px, 38%) 1fr; }
html[data-lgl="3"] .lg-card { max-width: none; margin: 0; padding-inline: clamp(24px, 3.4vw, 52px); background: var(--panel); }
html[data-lgl="3"] .lg-card h1 { font-size: clamp(34px, 3.2vw, 48px); }
html[data-lgl="3"] .lg-art { border-inline-start: 1px solid var(--line-2); }
html[data-lgl="3"] #lgArt::after { background: linear-gradient(to top, rgba(10, 10, 13, .94), rgba(10, 10, 13, .55) 38%, transparent 66%); }
html[data-lgl="3"] .la-line { display: flex; flex-direction: column; position: absolute; z-index: 2; right: clamp(28px, 5vw, 72px); left: clamp(28px, 5vw, 72px); bottom: clamp(40px, 7vh, 80px); font: 700 clamp(44px, 4.8vw, 84px)/1.12 var(--f-title); color: #fff; }
html[data-lgl="3"] .la-line span { white-space: nowrap; }
/* مع معاينة البث: الكلام ياخذ تحت، فالتوب يطلع فوق يمين والأحداث تختفي */
html[data-lgl="3"] .la-4 .evs { display: none; }
html[data-lgl="3"] .la-4 .lbc { left: auto; right: 5%; bottom: auto; top: calc(120px + 14%); width: min(24%, 210px); }
html[data-lgl="3"] .la-4 .alr { left: 38%; top: 46%; width: min(44%, 400px); }

/* ٤ · شاشة البث: الفن داخل إطار شاشة بث، والبطاقة طالعة فيه مثل أليرت */
html[data-lgl="4"] .lg { display: block; padding: 84px 24px 24px; }
html[data-lgl="4"] .lg-art { height: calc(100vh - 108px); min-height: 600px; border: 1px solid var(--line-2); border-radius: 28px; }
html[data-lgl="4"] .la-hud { display: flex; gap: 8px; position: absolute; z-index: 3; top: 18px; right: 18px; direction: ltr; }
.la-hud span { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(11, 11, 15, .82); border: 1px solid var(--line-2); font: 700 12px var(--f-num); color: #eee; letter-spacing: .5px; }
.la-hud .la-rec i { width: 8px; height: 8px; border-radius: 50%; background: #FF3B5C; }
.la-hud svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
html[data-lgl="4"] .lg-card { position: absolute; z-index: 4; right: 56px; bottom: 56px; width: 410px; max-width: calc(100% - 112px); margin: 0; padding: 28px 28px 24px; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--pur); border-radius: 24px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9); }
html[data-lgl="4"] .lg-logo { width: 48px; height: 48px; margin-bottom: 0; }
html[data-lgl="4"] .lg-card h1 { font-size: clamp(30px, 2.6vw, 40px); }
html[data-lgl="4"] .lg-sub { margin-bottom: 8px; }
/* في شاشة البث البطاقة تاخذ زاوية الأحداث، فالأحداث تنقل يسار */
html[data-lgl="4"] .la-4 .evs { right: auto; left: 4%; bottom: auto; top: 150px; max-height: calc(48% - 150px); overflow: hidden; }
html[data-lgl="4"] .la-4 .lbc { bottom: 5%; }
html[data-lgl="4"] .la-4 .alr { left: 42%; }

/* ======================= الجوال ======================= */
@media (max-width: 900px) {
    .la-1 .fr { inset: 64px 6% 28px; }
    .la-1 .tagx, .la-1 .cell, .la-1 .mk { display: none; }
    .la-1 .stk { scale: .72; }
    .la-2 .tilt { inset: -60% -60%; gap: 14px; } .la-2 .run { gap: 14px; --g: 7px; }
    .la-2 .wcol { flex-basis: 150px; }
    html .la-3 .cols, html[data-lgl] .la-3 .cols { inset: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    html[data-lgl] .la-3 .fcol:nth-child(n+3) { display: none; }
    .la-ev { min-height: 50px; padding: 8px 10px; gap: 8px; font-size: 12px; } .la-ev b { font-size: 12px; } .la-ev .av { width: 28px; height: 28px; } .la-ev time { display: none; } .la-ev em { display: block; line-height: 1.3; }
    .la-4 .bl { top: 84px; width: 92%; }
    .la-4 .alr { width: 52%; top: 50%; }
    html[data-lgl] .la-4 .lbc { display: none; }
    .la-4 .evs { width: auto; right: 18%; left: 18%; bottom: 14px; }
    .la-4 .evs .la-ev:nth-last-child(n+2) { display: none; }

    html[data-lgl="2"] .lg { padding: 96px 16px 32px; }
    html[data-lgl="2"] .lg-card { padding: 32px 20px 24px; border-radius: 28px; }

    html[data-lgl="3"] .lg { grid-template-columns: 1fr; }
    html[data-lgl="3"] .lg-art { min-height: 340px; border-inline-start: 0; }
    html[data-lgl="3"] .lg-card { background: none; }
    html[data-lgl="3"] .la-4 .alr { left: 50%; top: 42%; width: 46%; }
    html[data-lgl="3"] .la-line { font-size: clamp(30px, 8.4vw, 44px); right: 20px; left: 20px; bottom: 24px; }

    html[data-lgl="4"] .lg { padding: 76px 12px 24px; }
    html[data-lgl="4"] .lg-art { height: 340px; min-height: 0; border-radius: 22px; }
    html[data-lgl="4"] .la-hud { top: 12px; right: 12px; }
    html[data-lgl="4"] .lg-card { position: relative; right: auto; bottom: auto; width: auto; max-width: none; margin: -48px 10px 0; padding: 26px 18px 22px; }
    html[data-lgl="4"] .la-4 .evs { display: none; }
    html[data-lgl="4"] .la-4 .alr { left: 50%; top: 64%; width: 50%; }
    html[data-lgl="4"] .la-4 .bl { top: 60px; }
    html[data-lgl="4"] .la-4 .lbc { display: none; }
}

/* 5 · شعار 3D الأسود يعبّي جهة اليسار */
.la-5 { position: absolute; inset: 0; background: #0a0a0c; }
.la-5 img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 40%; }

/* شعار 3D بحجمه الطبيعي: عرض الجهة اليسار على قد الصورة (1050×1620) فيبان كامل بدون قص ولا سواد */
@media (min-width: 901px) {
    html[data-lgl="1"][data-lgbg="5"] .lg { grid-template-columns: 1fr min(calc(100vh * 1050 / 1620), 52vw); }
}
