/* =========================================================
   شاشة العرض — تصميم «لوحة توقيت سباق»
   لوحة ثابتة 1920×1080 تتكبّر/تتصغّر لتملأ أي شاشة
   ========================================================= */
:root {
  --bg: #FBFAF6; --ink: #16140F; --mut: #8A8274; --line: #E6E0D4; --row: #F0EBE1;
  --gold: #B8842A; --fill: #E3AF4D; --track: #ECE6DA; --bad: #B4432F;
}
:root[data-mode="dark"] {
  --bg: #0E0D0B; --ink: #FEFEFE; --mut: #8A8274; --line: #2A2722; --row: #1F1D19;
  --gold: #E3AF4D; --fill: #E3AF4D; --track: #26231E; --bad: #E2725B;
}
/* ثيم الزمرّد: أخضر جيل صلاحي + ذهبي */
:root[data-mode="green"] {
  --bg: #F3F8F5; --ink: #0F2A1E; --mut: #5E7A6C; --line: #D3E5DA; --row: #E4EFE8;
  --gold: #B8861F; --fill: #D9A92E; --track: #DCEBE2; --bad: #B4432F;
  --band: linear-gradient(90deg, #22A06B, #17784F); --band-ink: #FFFFFF; --chk-a: #FFFFFF; --chk-b: #17784F;
  --sep: rgba(255, 255, 255, .35);
  --alert: linear-gradient(90deg, #22A06B, #146B46); --alert-ink: #FFFFFF;
  --num: #17784F;
}
:root[data-mode="green"]:not(.acc) .lead .big { background: linear-gradient(180deg, #E3B43E, #C08F1E); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-mode="green"] .st b { color: var(--num); }
:root[data-mode="green"] .alert small { background: #E3AF4D; color: #0F2A1E; border-color: #E3AF4D; }
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--ink); transition: background .4s, color .4s; }
body.idle { cursor: none; }

.stage {
  position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0;
  direction: rtl; overflow: hidden; font-family: Qomra, 'Segoe UI', Tahoma, sans-serif;
}
body.f-plex .stage { font-family: Plex, 'Segoe UI', Tahoma, sans-serif; }
.n { font-weight: 900; white-space: nowrap; }
body.f-plex .n { font-family: Shoulders, Plex, sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; }
body.f-plex .n i, body.f-plex .n span { font-family: Plex, sans-serif; }

/* ---------- الهيدر ---------- */
.top { position: absolute; inset: 0 0 auto 0; height: 150px; display: flex; align-items: center; gap: 28px; padding: 0 64px; border-bottom: 2px solid var(--line); }
.top img { height: 108px; width: auto; }
.top h1 { font-size: 58px; margin: 0; line-height: 1; font-weight: 900; }
.top .sub { display: block; font-size: 26px; color: var(--mut); font-weight: 500; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 900px; }
.top .sub b { color: var(--gold); font-weight: 700; }
.live { margin-right: auto; display: flex; align-items: center; gap: 10px; font-size: 24px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.live::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--fill); animation: blink 1.6s infinite; }
.live.warn { color: var(--mut); } .live.warn::before { background: var(--mut); animation: none; }
.live.off { color: var(--bad); } .live.off::before { background: var(--bad); animation: none; }
@keyframes blink { 50% { opacity: .25; } }
.clock { text-align: left; font-size: 92px; line-height: .95; margin-right: 40px; }
.clock i { display: block; font-style: normal; font-size: 24px; font-weight: 500; color: var(--mut); }

/* ---------- القائمة ---------- */
.body { position: absolute; top: 150px; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: 1180px 1fr; }
.list { position: relative; border-left: 2px solid var(--line); }
.cols, .row { display: grid; grid-template-columns: 120px 1fr 240px 250px; align-items: center; padding: 0 40px 0 48px; }
.cols { position: relative; height: 84px; background: var(--band, #E3AF4D); color: var(--band-ink, #16140F); font-size: 34px; font-weight: 900; }
.cols::before { content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 28px; background: conic-gradient(var(--chk-a, #16140F) 25%, var(--chk-b, #E3AF4D) 0 50%, var(--chk-a, #16140F) 0 75%, var(--chk-b, #E3AF4D) 0) 0 0/14px 14px; }
.cols span { line-height: 48px; white-space: nowrap; }
.cols span:first-child { padding-right: 14px; }
.cols span + span { border-right: 3px solid var(--sep, rgba(22, 20, 15, .28)); padding-right: 22px; }
.cols span:nth-child(3) { text-align: center; padding-right: 0; }
.cols span:nth-child(4) { text-align: left; }
.rows { position: absolute; top: 84px; bottom: 0; left: 0; right: 0; overflow: hidden; }
.track.roll { animation: roll var(--dur, 60s) linear infinite; }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .track.roll { animation: none; } }
.row { height: 88px; border-bottom: 1px solid var(--row); }
.pos { font-size: 54px; color: var(--mut); }
.row.t .pos { color: var(--gold); }
.nm { font-size: 42px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate { text-align: center; font-size: 44px; }
.rate em { font-style: normal; font-size: 28px; color: var(--mut); }
.rate .bar { height: 6px; background: var(--track); margin: 4px 40px 0; border-radius: 3px; }
.rate .bar i { display: block; height: 100%; background: var(--fill); border-radius: 3px; transition: width .6s; }
.days { text-align: left; font-size: 70px; line-height: 1; }
.row.t .days { color: var(--gold); }
.row.hit { animation: hit 3.2s ease; }
:root[data-mode="green"] .row.hit { animation-name: hitG; }
@keyframes hitG { 0%, 40% { background: rgba(34, 160, 107, .22); } 100% { background: transparent; } }
@keyframes hit { 0%, 40% { background: color-mix(in srgb, #E3AF4D 32%, transparent); } 100% { background: transparent; } }
.empty { display: grid; place-items: center; height: 100%; font-size: 40px; color: var(--mut); text-align: center; padding: 40px; }

/* ---------- الجانب ---------- */
.side { display: grid; grid-template-rows: auto 1fr; padding: 48px 56px; }
.lead small { font-size: 28px; color: var(--gold); font-weight: 700; }
.lead b { display: block; font-size: 68px; line-height: 1.2; margin-top: 6px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .big { font-size: 290px; line-height: .9; color: var(--gold); display: flex; align-items: baseline; gap: 20px; margin-top: 6px; }
.lead .big span { font-size: 40px; color: var(--mut); font-weight: 500; }
.lead.none b { font-size: 52px; color: var(--mut); }
.stats { display: grid; grid-template-columns: 1fr 1fr; align-self: end; border-top: 2px solid var(--line); }
.st { padding: 24px 0 10px; border-bottom: 1px solid var(--line); }
.st:nth-child(odd) { padding-left: 30px; border-left: 1px solid var(--line); }
.st:nth-child(even) { padding-right: 30px; }
.st b { display: block; font-size: 104px; line-height: 1; }
.st b small { font-size: 54px; color: var(--mut); }
.st span { font-size: 28px; color: var(--mut); font-weight: 500; }

/* ---------- إشعار البصمة ---------- */
.alert { position: absolute; top: 0; left: 0; right: 0; height: 150px; background: var(--alert, #E3AF4D); color: var(--alert-ink, #16140F); display: flex; align-items: center; gap: 36px; padding: 0 64px; transform: translateY(-100%); transition: transform .5s cubic-bezier(.2, .8, .2, 1); z-index: 5; }
.alert.on { transform: none; }
.alert small { font-size: 30px; font-weight: 900; border: 3px solid currentColor; padding: 2px 18px; white-space: nowrap; }
.alert b { font-size: 70px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert .c { font-size: 32px; font-weight: 500; white-space: nowrap; }
.alert .n { margin-right: auto; font-size: 110px; line-height: 1; }
.alert .n i { font-style: normal; font-size: 32px; font-weight: 700; margin-right: 10px; }

/* ---------- أشياء صغيرة ---------- */
.hint { position: absolute; left: 24px; bottom: 20px; font-size: 22px; color: var(--mut); background: var(--bg); border: 1px solid var(--line); padding: 6px 16px; border-radius: 999px; transition: opacity .6s; z-index: 6; }
.hint.gone { opacity: 0; pointer-events: none; }
.demo { position: absolute; left: 24px; top: 166px; font-size: 20px; font-weight: 700; color: #16140F; background: #E3AF4D; z-index: 4; padding: 2px 14px; border-radius: 6px; z-index: 4; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; color: var(--mut); }

/* ---------- حماية نقاط الحروف (ي، ج، ب...) من القص ----------
   العناصر اللي فيها overflow:hidden (لقص الأسماء الطويلة بـ «…») بتقص النقاط تحت السطر،
   فمنعطيها ارتفاع سطر أكبر ومسافة تحت بدون ما يتغيّر مكان النص */
.lead b { line-height: 1.45; padding-bottom: .12em; margin-bottom: -.12em; }
.nm, .alert b, .top .sub { line-height: 1.5; padding-block: .1em; }
.top h1 { line-height: 1.25; }
