/* مرصد الملاعب — single stylesheet, no external font dependency.
   Arabic system-font stack keeps first render free of network round-trips. */

:root {
  --ink: #101a15;
  --ink-2: #2c3b34;
  --muted: #64756c;
  --line: #e2e8e4;
  --line-2: #eef2f0;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --brand: #0d7a45;
  --brand-dark: #095c33;
  --brand-tint: #e8f4ed;
  --live: #d0342c;
  --live-tint: #fdeceb;
  --amber: #8a5a00;
  --amber-tint: #fdf3e0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 26, 21, .05), 0 6px 18px -10px rgba(16, 26, 21, .16);
  --wrap: 1140px;
  --font: "Segoe UI", "Noto Sans Arabic", "Cairo", "Tahoma", "Arial", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--surface-2);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 18px; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { inset-inline-start: 0; }

/* ---------- Header ---------- */
.site-head {
  background: linear-gradient(160deg, #0c2019 0%, #0f2b1f 55%, #10331f 100%);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}
.head-bar { display: flex; align-items: center; gap: 16px; padding-block: 15px; }

.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand svg { flex-shrink: 0; }
.brand-name { font-size: 1.22rem; font-weight: 800; letter-spacing: -.2px; line-height: 1.25; }
.brand-sub { display: block; font-size: .69rem; font-weight: 500; color: #8fc9a9; letter-spacing: .2px; }

.nav-toggle {
  margin-inline-start: auto; display: none; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-sm); padding: 9px 13px; font: inherit; font-size: .9rem; cursor: pointer;
}

.site-nav { margin-inline-start: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 3px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; color: #d8ece1; text-decoration: none; font-size: .95rem; font-weight: 600;
  padding: 8px 13px; border-radius: var(--radius-sm);
}
.site-nav a:hover { background: rgba(255, 255, 255, .11); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--brand); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; padding-block: 34px 40px;
  background:
    linear-gradient(160deg, rgba(16,51,31,.94), rgba(12,32,25,.97)),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,.035) 46px 48px),
    #10331f;
}
.hero h1 { margin: 0 0 12px; font-size: clamp(1.55rem, 4.4vw, 2.3rem); line-height: 1.3; letter-spacing: -.4px; }
.hero p { margin: 0; max-width: 68ch; color: #c3ddd0; font-size: 1.03rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2); color: #fff; text-decoration: none;
  padding: 9px 15px; border-radius: 999px; font-size: .92rem; font-weight: 600;
}
.chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip--solid { background: var(--brand); border-color: var(--brand); }
.chip--solid:hover { background: #0fa159; border-color: #0fa159; }

/* ---------- Layout ---------- */
main { display: block; padding-block: 30px 44px; }
main > h1 { font-size: clamp(1.45rem, 4vw, 1.95rem); margin: 0 0 16px; line-height: 1.35; letter-spacing: -.3px; }
.section { margin-bottom: 42px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 {
  margin: 0; font-size: 1.32rem; letter-spacing: -.3px;
  padding-inline-start: 13px; border-inline-start: 4px solid var(--brand); line-height: 1.4;
}
.section-head .more { margin-inline-start: auto; font-size: .92rem; font-weight: 600; }
.section-note { margin: 0 0 16px; color: var(--muted); font-size: .95rem; max-width: 78ch; }

/* ---------- Match cards ---------- */
.match-grid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  list-style: none; margin: 0; padding: 0;
}

.match-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.match-card-link {
  display: flex; flex-direction: column; flex: 1;
  color: inherit; text-decoration: none;
}
.match-card-link:hover .go,
.match-card-link:focus-visible .go { text-decoration: underline; }
.match-card:focus-within { border-color: #b7d4c4; box-shadow: 0 8px 24px -12px rgba(16, 26, 21, .22); }

.mc-top {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line-2);
  font-size: .8rem; color: var(--muted);
}
.mc-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-comp { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.status {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.status--soon { background: var(--brand-tint); color: var(--brand-dark); }
.status--live { background: var(--live-tint); color: var(--live); }
.status--unknown { background: #f3f1ea; color: #6a6558; }
.status--done { background: #eceff0; color: #46555c; }
.status--live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status--live .dot { animation: none; } }

.mc-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 18px 12px; }

.team { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; text-align: center; }
.crest {
  width: 52px; height: 52px; object-fit: contain;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 50%; padding: 5px;
}
.crest--none { display: grid; place-items: center; color: #9fb0a7; font-size: 1.3rem; }
.team-name { font-size: .95rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }

.mc-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-inline: 8px; }
.vs { font-size: .82rem; font-weight: 800; color: #93a49b; letter-spacing: 1px; }
.score { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }

.mc-foot {
  margin-top: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: .85rem;
}
.channel { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.channel svg { flex-shrink: 0; color: var(--muted); }
.mc-foot .go { margin-inline-start: auto; font-weight: 700; font-size: .87rem; white-space: nowrap; }

/* ---------- Feed status strip ---------- */
.feed-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 15px; margin-bottom: 18px; font-size: .9rem; color: var(--ink-2);
}
.feed-bar .lbl { font-weight: 700; }
.feed-bar time { font-variant-numeric: tabular-nums; }
.feed-bar[data-state="snapshot"] { background: var(--amber-tint); border-color: #f0dcb4; color: var(--amber); }
.feed-bar[data-state="live"] { background: var(--brand-tint); border-color: #c6e3d3; color: var(--brand-dark); }
.feed-bar .refresh {
  margin-inline-start: auto; background: transparent; border: 1px solid currentColor; color: inherit;
  border-radius: var(--radius-sm); padding: 6px 13px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
button, .chip, .go, .nav-toggle { cursor: pointer; }
.match-card { transition: border-color .18s ease, box-shadow .18s ease; }
.match-card:hover { border-color: #b7d4c4; box-shadow: 0 8px 24px -12px rgba(16, 26, 21, .22); }
.crest--none svg { width: 26px; height: 26px; display: block; }
.related { margin-top: 28px; }
.related h2 { margin: 0 0 14px; font-size: 1.18rem; }
.facts a { overflow-wrap: anywhere; }
.feed-bar .refresh:hover { background: rgba(0, 0, 0, .05); }
.feed-bar .refresh[aria-busy="true"] { opacity: .55; cursor: progress; }

/* ---------- Notices ---------- */
.notice {
  border: 1px solid var(--line); border-inline-start: 4px solid var(--brand);
  background: var(--surface); border-radius: var(--radius); padding: 15px 17px; margin-block: 22px;
}
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.notice--warn { border-inline-start-color: #c98a10; background: var(--amber-tint); border-color: #f0dcb4; }
.notice strong { color: var(--ink); }
.notice h2, .notice h3 { margin-top: 0; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px 20px; text-align: center; color: var(--muted); }

/* ---------- Cards / links ---------- */
.card-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); list-style: none; margin: 0; padding: 0; }
.link-card {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 19px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.link-card:hover { border-color: var(--brand); }
.link-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.45; color: var(--brand-dark); }
.link-card p { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.65; }
.link-card .kicker { font-size: .74rem; font-weight: 700; color: var(--brand); letter-spacing: .4px; }

/* ---------- Article ---------- */
.crumbs { padding-block: 14px 0; font-size: .87rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0; padding: 0; }
.crumbs li::after { content: "‹"; margin-inline-start: 7px; color: #b3c1ba; }
.crumbs li:last-child::after { content: none; }
.crumbs [aria-current="page"] { color: var(--ink-2); font-weight: 600; }

.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 42px); box-shadow: var(--shadow); }
.article > h1 { margin: 0 0 14px; font-size: clamp(1.5rem, 4.2vw, 2.05rem); line-height: 1.35; letter-spacing: -.4px; }
.article .lead { font-size: 1.09rem; color: var(--ink-2); margin: 0 0 8px; line-height: 1.8; }
.article h2 { margin: 34px 0 12px; font-size: 1.28rem; line-height: 1.45; letter-spacing: -.2px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.article h3 { margin: 24px 0 9px; font-size: 1.06rem; line-height: 1.5; color: var(--ink-2); }
.article p { margin: 0 0 15px; }
.article ul, .article ol { margin: 0 0 17px; padding-inline-start: 1.35em; }
.article li { margin-bottom: 8px; }
.article .meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .87rem; color: var(--muted); padding-bottom: 17px; margin-bottom: 19px; border-bottom: 1px solid var(--line-2); }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
caption { caption-side: top; text-align: start; padding: 11px 14px; font-size: .87rem; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
th, td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-size: .88rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Match page ---------- */
.fixture {
  background: linear-gradient(160deg, #10331f, #0c2019); color: #fff;
  border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); margin-bottom: 26px;
}
.fixture-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.fixture .team-name { font-size: 1.06rem; }
.fixture .crest { width: 74px; height: 74px; background: rgba(255, 255, 255, .95); border-color: rgba(255, 255, 255, .3); }
.fixture .crest--none { background: rgba(255, 255, 255, .12); color: #7fae95; }
.fixture .vs { color: #86b79c; font-size: 1rem; }
.fixture-meta { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 7px 14px; font-size: .87rem; font-weight: 600;
}
.fixture .status--soon { background: #e8f4ed; color: #095c33; border-color: #c6e3d3; }
.fixture .status--live { background: #fdeceb; color: #d0342c; border-color: #f5c4c1; }
.fixture .status--done { background: #eceff0; color: #46555c; border-color: #d5dcde; }

.facts { display: grid; gap: 0; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.facts div { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; border-bottom: 1px solid var(--line-2); }
.facts div:last-child { border-bottom: none; }
.facts dt { padding: 11px 15px; background: var(--surface-2); font-weight: 700; font-size: .9rem; }
.facts dd { margin: 0; padding: 11px 15px; }
.page-guides { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 14px; }

/* ---------- Footer ---------- */
.site-foot { background: #0c2019; color: #a9c6b7; padding-block: 34px 22px; margin-top: 30px; }
.foot-cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.site-foot h2 { font-size: .93rem; color: #fff; margin: 0 0 11px; letter-spacing: .2px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 7px; }
.site-foot a { color: #a9c6b7; text-decoration: none; font-size: .93rem; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot p { font-size: .9rem; line-height: 1.7; margin: 0 0 11px; }
.foot-bottom { margin-top: 26px; padding-top: 17px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 50px 20px; }
.notfound .code { font-size: clamp(3.6rem, 15vw, 6.5rem); font-weight: 800; color: var(--brand); line-height: 1; letter-spacing: -3px; margin: 0; }
.notfound h1 { font-size: clamp(1.35rem, 4.4vw, 1.85rem); margin: 12px 0; }
.notfound p { color: var(--muted); max-width: 58ch; margin-inline: auto; }
.notfound .hero-links { justify-content: center; }
.notfound .chip {
  background: var(--surface); color: var(--brand-dark); border-color: var(--line);
}
.notfound .chip:hover { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand); }
.notfound .chip--solid { background: var(--brand); color: #fff; border-color: var(--brand); }
.notfound .chip--solid:hover { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; flex-basis: 100%; margin-inline-start: 0; }
  .site-nav.is-open { display: block; padding-bottom: 12px; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { padding: 11px 13px; background: rgba(255, 255, 255, .06); }
  .head-bar { flex-wrap: wrap; }
  .facts div { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 3px; background: var(--surface); }
  .facts dd { padding-top: 0; }
  .mc-body { padding: 15px 8px; }
  .crest { width: 46px; height: 46px; }
  .fixture .crest { width: 58px; height: 58px; }
}

@media print {
  .site-head, .site-foot, .feed-bar, .hero-links, .nav-toggle { display: none; }
  body { background: #fff; font-size: 12pt; }
  .article, .match-card { border: 1px solid #ccc; box-shadow: none; }
}
