:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #6b6f78;
  --line: #e6e2d9;
  --accent: #e8452c;
  --accent-ink: #ffffff;
  --up: #1a8f4c;
  --down: #c2362b;
  --gold: #b88a1b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --ink: #eef0f3;
    --muted: #9aa0ab;
    --line: #262a33;
    --accent: #ff6247;
    --up: #3ecf7c;
    --down: #ff6b5e;
    --gold: #e7b84a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a20; --ink: #eef0f3; --muted: #9aa0ab; --line: #262a33;
  --accent: #ff6247; --up: #3ecf7c; --down: #ff6b5e; --gold: #e7b84a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
a { color: inherit; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.logo { white-space: nowrap; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; text-decoration: none; }
.logo small { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .5px; direction: ltr; }
.logo-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 18px;
}
nav { display: flex; gap: 4px; }
nav a { white-space: nowrap; text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 10px; border-radius: 8px; }
nav a:hover { background: var(--bg); }

/* hero */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.3; margin: 4px 0 10px; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 700; font-size: 14px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 8px; max-width: 760px; }
.lead a { color: var(--ink); font-weight: 600; }
.crumbs { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.crumbs a { text-decoration: none; }
.sec { font-size: 20px; margin: 28px 0 12px; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.card h2 { font-size: 18px; margin: 0 0 10px; }
.two { display: grid; gap: 16px; grid-template-columns: 1fr; }
.two .card { margin-top: 0; }
.two { margin-top: 16px; }
@media (min-width: 820px) { .two { grid-template-columns: 1fr 1fr; } }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cc {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  transition: border-color .15s, transform .15s;
}
.cc:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.cc-h { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.flag { font-size: 22px; line-height: 1; }
.cc-l { font-size: 14px; display: flex; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cc-l em { font-style: normal; color: var(--muted); flex: none; font-size: 12px; padding-top: 2px; }

/* ranked list */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 30px 46px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.rk { font-weight: 700; font-size: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.row:nth-child(1) .rk { color: var(--gold); }
.ps { width: 46px; height: 69px; object-fit: cover; border-radius: 6px; background: var(--line); }
.ph { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: var(--muted); }
.tt { min-width: 0; }
.tt a { font-weight: 600; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.tt small { display: block; color: var(--muted); font-size: 12px; direction: ltr; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ex { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }
.wk { color: var(--muted); white-space: nowrap; }
.mv { font-weight: 700; font-size: 12px; white-space: nowrap; }
.mv.up { color: var(--up); }
.mv.down { color: var(--down); }
.mv.same { color: var(--muted); }
.mv.new { color: var(--accent-ink); background: var(--accent); padding: 0 6px; border-radius: 6px; }
.flags { font-size: 14px; letter-spacing: 1px; max-width: 90px; text-align: left; line-height: 1.5; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.chip:hover { border-color: var(--accent); }

/* ramadan */
.ramadan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.ramadan > div:first-child { flex: 1 1 320px; }
.ramadan p { margin: 0 0 12px; color: var(--muted); }
.countdown { text-align: center; min-width: 130px; padding: 14px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.countdown b { display: block; font-size: 44px; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 13px; color: var(--muted); }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 10px; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }

/* title page */
.title-hero { display: flex; gap: 20px; padding: 24px 0 4px; align-items: flex-start; }
.title-hero h1 { font-size: clamp(24px, 5.5vw, 36px); line-height: 1.3; margin: 4px 0 2px; }
.poster { width: 140px; height: auto; border-radius: 10px; flex: none; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
@media (min-width: 640px) { .poster { width: 180px; } }
@media (max-width: 480px) { .title-hero { flex-direction: column; } }
.orig { direction: ltr; text-align: right; color: var(--muted); margin: 0 0 8px; }
.h3 { font-size: 16px; margin: 14px 0 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.stats span { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 22px; color: var(--ink); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: right; padding: 8px 6px; border-top: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; border-top: 0; }
.tbl a { text-decoration: none; font-weight: 600; }
.card { overflow-x: auto; }

.plain { margin: 0; padding-right: 18px; }
.plain li { margin: 6px 0; }
.prose p { margin: 0 0 12px; }

/* footer */
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0 28px; font-size: 14px; }
.foot p { margin: 0 0 8px; }
.foot a { text-decoration: none; font-weight: 600; }

@media (max-width: 420px) {
  .logo small { display: none; }
  .logo { font-size: 18px; }
  nav a { font-size: 14px; padding: 6px 8px; }
}
.tbl td:first-child { white-space: nowrap; }

/* platforms */
.pf { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 6px; color: #fff; vertical-align: middle; white-space: nowrap; }
.pf-shahid { background: #00a19a; }
.pf-netflix { background: #e50914; }
.pf-osn { background: #6f3bd8; }
.pf-sec { margin-top: 34px; }
.pf-sec .sec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 0; }
.pf-sec .sec small { font-size: 13px; font-weight: 400; }
.card h3 { font-size: 16px; margin: 0 0 8px; }
.more { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.more a { color: var(--accent); text-decoration: none; }
.cc-l .pf { font-size: 10px; padding: 3px 5px; flex: none; }
.cc-l { align-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.watch { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-c { gap: 4px 6px; font-size: 13px; color: var(--muted); }
.foot-c a { font-weight: 400; }
.eyebrow .pf { margin-inline-start: 4px; }

/* nav scrolls sideways on small screens */
.top-in { gap: 10px; }
nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
nav::-webkit-scrollbar { display: none; }

/* list categories */
.ps.sq { width: 46px; height: 46px; border-radius: 10px; }
.row.tr .tt small, .tt small.rtl { direction: rtl; text-align: right; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tt small a { color: var(--muted); text-decoration: none; display: inline; font-weight: 400; }
.tt b { font-weight: 600; }
.cc-l em { min-width: 14px; }

/* football */
.matches { list-style: none; margin: 0; padding: 0; }
.match { padding: 10px 0; border-top: 1px solid var(--line); }
.match:first-child { border-top: 0; }
.mt { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.mt small { font-size: 11px; }
.mrow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.team { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; min-width: 0; }
.team.h { justify-content: flex-start; }
.team.a { justify-content: flex-end; flex-direction: row; }
.team img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.sc, .vs { font-weight: 700; font-variant-numeric: tabular-nums; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; direction: ltr; white-space: nowrap; }
.vs { font-weight: 600; color: var(--muted); }
.sc.live { color: var(--accent); border-color: var(--accent); }
.ms { display: block; font-size: 12px; margin-top: 4px; text-align: center; }
.ftbl td, .ftbl th { text-align: center; padding: 7px 4px; }
.ftbl td.tm, .ftbl th:nth-child(2) { text-align: right; }
.ftbl td.tm { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.ftbl td.tm img { width: 20px; height: 20px; object-fit: contain; }
.ftbl tr:nth-child(-n+4) td:first-child { color: var(--up); font-weight: 700; }

/* youtube + news rows */
.ps.wide { width: 80px; height: 45px; border-radius: 8px; object-fit: cover; }
.row.yt { grid-template-columns: 30px 80px 1fr auto; }
.row.nw { grid-template-columns: 30px 1fr auto; }
.row.nw .tt a { white-space: normal; font-weight: 600; line-height: 1.5; }
.row.yt .tt a { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }

/* news lists */
.nlist { list-style: none; margin: 0; padding: 0; }
.nrow { padding: 11px 0; border-top: 1px solid var(--line); }
.nrow:first-child { border-top: 0; padding-top: 4px; }
.nt { display: block; font-weight: 600; line-height: 1.6; text-decoration: none; unicode-bidi: plaintext; text-align: right; }
.nm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.nm .src { font-weight: 600; color: var(--accent); }
.nm .dot { opacity: .6; }
