@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-500.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-arabic-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-500.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Plex Arabic'; src: url('../assets/fonts/plex-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF; }

:root {
  --page: #070a10;
  --glass: rgba(12, 18, 28, 0.62);
  --glass-2: rgba(12, 18, 28, 0.82);
  --line: rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.16);
  --ink: #f4f6f9;
  --ink-2: #b6bfcc;
  --muted: #7d8798;
  --gold: #c9a45c;
  --gold-bright: #e6c88a;
  --blue: #3987e5;
  --violet: #9085e9;
  --good: #2fb36a;
  --warn: #fab219;
  --W: 15360px;
  --H: 5450px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: var(--page); overflow: hidden; color: var(--ink); font-family: 'Plex Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif; }
button { font: inherit; color: inherit; }

/* المسرح — قماش ثابت 15360×5450 يُصغَّر بـ zoom (وليس transform) */
#stage { position: absolute; top: 0; left: 0; width: var(--W); height: var(--H); transform-origin: 0 0; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#gl .cesium-viewer, #gl .cesium-widget, #gl canvas { width: 100% !important; height: 100% !important; }
.cesium-viewer-bottom, .cesium-widget-credits { display: none !important; }
#credits { position: absolute; left: 120px; bottom: 132px; font-size: 20px; color: var(--muted); z-index: 5; pointer-events: none; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 62% 80% at 50% 48%, transparent 50%, rgba(3,5,9,0.72) 100%); }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* تسميات ثلاثية الأبعاد مُسقَطة */
.lbl { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none; will-change: transform, opacity; transition: opacity .3s; }
.lbl.lm { font-size: 42px; font-weight: 700; color: #dbe6f2; text-shadow: 0 2px 14px rgba(0,0,0,.95), 0 0 2px #000; padding-bottom: 14px; }
.lbl.lm::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 2px; height: 12px; background: rgba(219,230,242,.6); }
.lbl.cmd { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 16px; background: var(--glass-2); border: 2px solid var(--line-2); border-radius: 60px; padding: 12px 28px 12px 14px; font-size: 34px; font-weight: 700; color: var(--ink); backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(0,0,0,.5); transform: translate(-50%, calc(-100% - 26px)); }
.lbl.cmd::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 2px; height: 26px; background: var(--gold); opacity: .8; }
.lbl.cmd img { width: 56px; height: 56px; border-radius: 50%; background: #f4f6f9; object-fit: contain; padding: 4px; }
.lbl.cmd .sub { font-size: 24px; font-weight: 400; color: var(--ink-2); }
.lbl.cmd.hq { border-color: rgba(144,133,233,.6); box-shadow: 0 0 0 4px rgba(144,133,233,.18), 0 20px 60px rgba(0,0,0,.5); }
.lbl.cmd.dir { font-size: 28px; padding: 8px 20px 8px 10px; }
.lbl.cmd.dir img { width: 44px; height: 44px; }
.lbl.cmd.active { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(201,164,92,.25), 0 24px 70px rgba(0,0,0,.6); }
.lbl.cmd .pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--good); box-shadow: 0 0 18px var(--good); }
.lbl.cmd.alert .pulse { background: var(--warn); box-shadow: 0 0 18px var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* الترويسة */
#top { position: absolute; top: 0; right: 0; left: 0; height: 260px; display: flex; align-items: center; justify-content: space-between; padding: 0 120px; gap: 60px; background: linear-gradient(180deg, rgba(5,8,13,.92), rgba(5,8,13,0)); z-index: 5; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 40px; }
.emblem { width: 150px; height: 150px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.title { font-size: 76px; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); line-height: 1.1; }
.subtitle { font-size: 36px; font-weight: 400; color: var(--ink-2); margin-top: 10px; }
.status { display: flex; align-items: center; gap: 28px; }
.live { display: flex; align-items: center; gap: 16px; font-size: 34px; font-weight: 500; color: #9fe8c8; background: var(--glass); border: 2px solid var(--line-2); border-radius: 60px; padding: 16px 36px; backdrop-filter: blur(16px); }
.live i { width: 18px; height: 18px; border-radius: 50%; background: var(--good); box-shadow: 0 0 22px var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
#clock { font-size: 40px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.btn { background: rgba(201,164,92,.16); border: 2px solid rgba(201,164,92,.55); color: var(--gold-bright); border-radius: 60px; padding: 16px 40px; font-size: 32px; font-weight: 700; cursor: pointer; backdrop-filter: blur(16px); }
.btn.ghost { background: var(--glass); border-color: var(--line-2); color: var(--ink-2); }

/* الفصول */
.chapters { display: flex; gap: 14px; flex: 1; max-width: 5200px; }
.chap { flex: 1; background: var(--glass); border: 2px solid var(--line); border-radius: 26px; padding: 18px 28px; cursor: pointer; position: relative; overflow: hidden; backdrop-filter: blur(16px); min-width: 0; }
.chap .n { font-size: 24px; color: var(--muted); font-weight: 500; }
.chap .t { font-size: 30px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.chap .bar { position: absolute; right: 0; bottom: 0; height: 8px; width: 0%; background: var(--gold); }
.chap.done .bar { width: 100%; opacity: .45; }
.chap.active { border-color: var(--gold); }
.chap.active .t { color: var(--ink); }
.chap[data-tier="ops"].active { border-color: var(--blue); } .chap[data-tier="ops"] .bar { background: var(--blue); }
.chap[data-tier="tac"].active { border-color: var(--gold); }
.chap[data-tier="str"].active { border-color: var(--violet); } .chap[data-tier="str"] .bar { background: var(--violet); }

/* الأعمدة */
.rail { position: absolute; top: 330px; width: 2500px; display: flex; flex-direction: column; gap: 22px; z-index: 5; pointer-events: none; }
.rail > * { pointer-events: auto; }
.rail.right { right: 120px; }
.rail.left { left: 120px; }
.rail-head { display: flex; align-items: center; gap: 20px; font-size: 44px; font-weight: 700; color: var(--ink); padding: 0 12px; }
.rail-head.small { font-size: 34px; color: var(--ink-2); margin-top: 24px; }
.rail-head em { font-style: normal; font-size: 24px; font-weight: 500; color: var(--warn); border: 2px solid rgba(250,178,25,.5); border-radius: 30px; padding: 4px 18px; margin-right: auto; }
.dot { width: 20px; height: 20px; border-radius: 50%; }
.dot.gold { background: var(--gold); box-shadow: 0 0 20px var(--gold); }
.dot.violet { background: var(--violet); box-shadow: 0 0 20px var(--violet); }
.dot.blue { background: var(--blue); box-shadow: 0 0 20px var(--blue); }

/* منظومة الوكلاء */
.tier { background: var(--glass); border: 2px solid var(--line); border-radius: 34px; padding: 22px 28px; backdrop-filter: blur(20px); transition: border-color .4s, background .4s, opacity .4s; opacity: .62; }
.tier.active { opacity: 1; background: var(--glass-2); }
.tier[data-tier="ops"].active { border-color: var(--blue); }
.tier[data-tier="tac"].active { border-color: var(--gold); }
.tier[data-tier="str"].active { border-color: var(--violet); }
.tier-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.tier-head .nm { font-size: 38px; font-weight: 700; }
.tier-head .sb { font-size: 26px; color: var(--muted); }
.tier-head .ic { width: 30px; height: 30px; border-radius: 8px; margin-left: 4px; align-self: center; }
.tier[data-tier="ops"] .ic { background: var(--blue); border-radius: 50%; }
.tier[data-tier="tac"] .ic { background: var(--gold); transform: rotate(45deg); border-radius: 6px; }
.tier[data-tier="str"] .ic { background: var(--violet); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.agent { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding: 14px 16px; border-radius: 22px; border: 2px solid transparent; transition: background .3s, border-color .3s; }
.agent.on { background: rgba(255,255,255,.05); border-color: var(--line-2); }
.agent .nm { font-size: 32px; font-weight: 700; color: var(--ink); }
.agent .kpi { font-size: 30px; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; text-align: left; }
.agent .kpi small { display: block; font-size: 20px; color: var(--muted); font-weight: 400; }
.agent .role { grid-column: 1 / -1; font-size: 26px; color: var(--ink-2); line-height: 1.45; display: none; }
.agent.on .role { display: block; }
.agent .flow { grid-column: 1 / -1; display: none; gap: 10px; align-items: center; font-size: 22px; color: var(--muted); margin-top: 6px; }
.agent.on .flow { display: flex; }
.agent .flow span { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 20px; padding: 4px 16px; color: var(--ink-2); }
.agent .flow b { color: var(--gold); font-weight: 400; }

/* المؤشرات */
.kpi-card { background: var(--glass); border: 2px solid var(--line); border-radius: 30px; padding: 22px 30px; backdrop-filter: blur(20px); display: grid; grid-template-columns: auto 1fr; gap: 4px 28px; align-items: center; }
.kpi-card.alert { border-color: rgba(250,178,25,.55); }
.kpi-card .v { grid-row: 1 / 3; font-size: 92px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-card .v small { font-size: 30px; color: var(--gold-bright); font-weight: 500; margin-right: 8px; }
.kpi-card.alert .v small { color: var(--warn); }
.kpi-card .l { font-size: 30px; font-weight: 500; color: var(--ink-2); }
.kpi-card .n { font-size: 24px; color: var(--muted); }
.kpi-card .src { grid-column: 1 / -1; font-size: 21px; color: var(--muted); display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.kpi-card .src::before { content: 'المصدر'; color: var(--gold); border: 1px solid rgba(201,164,92,.5); border-radius: 20px; padding: 1px 12px; font-size: 19px; }
.ops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ops-card { background: var(--glass); border: 2px solid var(--line); border-radius: 26px; padding: 18px 26px; backdrop-filter: blur(20px); }
.ops-card .l { font-size: 26px; color: var(--ink-2); }
.ops-card .row { display: flex; align-items: baseline; gap: 18px; margin-top: 4px; }
.ops-card .v { font-size: 64px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ops-card .d { font-size: 28px; font-weight: 700; color: var(--good); }

/* بطاقة القيادة */
.card { position: absolute; left: 50%; bottom: 560px; transform: translateX(-50%); width: 3000px; background: var(--glass-2); border: 2px solid rgba(201,164,92,.5); border-radius: 40px; padding: 40px 52px; backdrop-filter: blur(28px); box-shadow: 0 40px 120px rgba(0,0,0,.6); z-index: 6; animation: up .45s ease both; }
.card.hidden { display: none; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
.card-head { display: flex; align-items: center; gap: 30px; }
.card-head img { width: 110px; height: 110px; border-radius: 50%; background: #f4f6f9; object-fit: contain; padding: 8px; }
.card-head .nm { font-size: 54px; font-weight: 700; }
.card-head .st { font-size: 28px; color: var(--ink-2); margin-top: 4px; }
.card-head .x { margin-right: auto; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--glass); font-size: 40px; cursor: pointer; }
.card-stats { display: flex; gap: 22px; margin-top: 30px; }
.card-stats div { flex: 1; background: rgba(255,255,255,.05); border: 2px solid var(--line); border-radius: 26px; padding: 18px 28px; }
.card-stats b { display: block; font-size: 60px; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.card-stats span { font-size: 26px; color: var(--ink-2); }
.card-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.card h4 { font-size: 30px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
.card li { list-style: none; font-size: 30px; color: var(--ink); padding: 8px 0; display: flex; gap: 16px; }
.card li::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); margin-top: 16px; flex: none; }
.card .ai { background: rgba(144,133,233,.12); border: 2px solid rgba(144,133,233,.45); border-radius: 26px; padding: 22px 28px; font-size: 30px; line-height: 1.5; color: #e2ddff; }
.card .ai b { display: block; font-size: 26px; color: var(--violet); font-weight: 700; margin-bottom: 6px; }

/* شرح الفصل */
.caption { position: absolute; left: 50%; bottom: 220px; transform: translateX(-50%); width: 4200px; text-align: center; z-index: 5; pointer-events: none; }
.cap-tier { display: inline-block; font-size: 28px; font-weight: 700; letter-spacing: 1px; border-radius: 40px; padding: 8px 30px; margin-bottom: 18px; border: 2px solid var(--line-2); color: var(--ink-2); background: var(--glass); backdrop-filter: blur(16px); }
.cap-tier[data-tier="ops"] { color: #9cc4f5; border-color: var(--blue); }
.cap-tier[data-tier="tac"] { color: var(--gold-bright); border-color: var(--gold); }
.cap-tier[data-tier="str"] { color: #cfc8ff; border-color: var(--violet); }
.cap-tier:empty { display: none; }
.cap-title { font-size: 84px; font-weight: 700; color: var(--ink); text-shadow: 0 4px 30px rgba(0,0,0,.9); line-height: 1.15; }
.cap-text { font-size: 40px; color: var(--ink-2); margin-top: 14px; line-height: 1.5; text-shadow: 0 2px 20px rgba(0,0,0,.95); text-wrap: balance; }
.caption.swap .cap-title, .caption.swap .cap-text { animation: fadeUp .7s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* الشريط */
#tickerWrap { position: absolute; right: 0; left: 0; bottom: 0; height: 120px; background: linear-gradient(0deg, rgba(5,8,13,.95), rgba(5,8,13,.6)); border-top: 2px solid var(--line); display: flex; align-items: center; overflow: hidden; z-index: 5; }
#ticker { display: flex; gap: 160px; width: max-content; animation: marquee 80s linear infinite; padding-right: 100px; }
#ticker span { font-size: 34px; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 18px; }
#ticker span::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); flex: none; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

#hint { position: absolute; bottom: 150px; right: 120px; font-size: 24px; color: var(--muted); z-index: 5; pointer-events: none; }

#loader { position: absolute; inset: 0; background: var(--page); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; font-size: 48px; color: var(--ink-2); z-index: 50; transition: opacity .8s; }
#loader.off { opacity: 0; pointer-events: none; }
.ring { width: 120px; height: 120px; border-radius: 50%; border: 6px solid var(--line-2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
