/* =====================================================================
   NADI ERRABI3 — styles
   The two club colours (--primary, --accent) come from data.js.
   ===================================================================== */

:root {
  --primary: #035420;
  --accent: #d1ad3f;
  --primary-dark: color-mix(in srgb, var(--primary) 80%, #000);
  --primary-deep: color-mix(in srgb, var(--primary) 62%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 8%, #fff);
  --accent-ink: color-mix(in srgb, var(--primary) 40%, #000);

  --ink: #14211a;
  --ink-2: #3a4840;
  --muted: #62716a;
  --line: #e0e7e3;
  --bg: #ffffff;
  --bg-alt: #f3f6f4;

  /* match outcome (always shown with a letter too, never colour alone) */
  --win: #1d8a4b;
  --draw: #b7800e;
  --loss: #c93c3c;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .05), 0 6px 20px rgba(16, 40, 28, .06);
  --shadow-hover: 0 2px 4px rgba(16, 40, 28, .06), 0 16px 36px rgba(16, 40, 28, .14);
  --shadow-lg: 0 24px 60px rgba(2, 20, 10, .4);

  --font-display: "Bebas Neue", "Cairo", Impact, "Arial Narrow", sans-serif;
  --font-body: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 68px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: .92rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-light { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .2); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .06); cursor: pointer; transition: background .2s;
}
.icon-btn:hover { background: rgba(0, 0, 0, .12); }
.icon-btn .icon { width: 22px; height: 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--primary-deep) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; gap: 10px; height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: 10px; margin-inline-end: auto; min-width: 0;
  color: #fff; text-decoration: none;
  font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .04em; line-height: 1; white-space: nowrap;
}
.brand img { width: 42px; height: 42px; flex: none; }
.nav { display: flex; gap: 2px; }
.nav a {
  color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 600; font-size: .93rem;
  padding: 7px 11px; border-radius: 999px; transition: color .2s, background .2s; white-space: nowrap;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.active { color: var(--accent-ink); background: var(--accent); }

.lang-switch { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .25); }
.lang-switch button {
  border: 0; background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer;
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: .8rem; line-height: 1;
}
.lang-switch button:hover { background: rgba(255, 255, 255, .1); }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--primary-deep); }
.menu-btn { display: none; }

@media (max-width: 1180px) {
  .menu-btn {
    display: inline-flex; flex: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 0 11px; border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .08); cursor: pointer;
  }
  .menu-btn span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s, opacity .2s; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; inset-inline: 0; top: var(--header-h);
    flex-direction: column; gap: 4px; padding: 12px 16px 20px;
    background: var(--primary-deep); box-shadow: 0 20px 30px rgba(0, 0, 0, .25);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; font-size: 1rem; }
}
@media (max-width: 420px) {
  .header-inner { gap: 8px; }
  .brand { font-size: 1.3rem; gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .lang-switch button { min-width: 30px; padding: 0 6px; font-size: .75rem; }
}
@media (max-width: 340px) { .brand span { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 56px 0 80px;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 65%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-deep) 85%);
}
.hero.has-photo {
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 82%, transparent) 0%, color-mix(in srgb, var(--primary-deep) 95%, transparent) 75%),
    var(--hero-img) center 40% / cover no-repeat,
    var(--primary-deep);
}
.hero::before { /* mowed-grass stripes */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 90px, transparent 90px 180px);
}
.hero::after { /* centre circle */
  content: ""; position: absolute; pointer-events: none;
  width: 560px; height: 560px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .08);
  inset-inline-start: -200px; bottom: -300px;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero-crest { width: 128px; height: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .4)); margin-bottom: 18px; }
.eyebrow {
  display: inline-block; margin: 0; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: var(--accent);
  font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(3.4rem, 9vw, 6.4rem); line-height: .92; letter-spacing: .02em;
  margin: 14px 0 10px; text-shadow: 0 4px 24px rgba(0, 0, 0, .3);
}
.slogan { margin: 0; font-size: 1.25rem; font-weight: 600; color: color-mix(in srgb, var(--accent) 55%, #fff); max-width: 34ch; }

.form-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.form-strip:empty { display: none; }
.form-label { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.form-list { display: flex; gap: 6px; }
.form-chip {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  font-weight: 800; font-size: .9rem; color: #fff; cursor: default;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}
.form-chip.W, .res-badge.W, .stat-mark.W { background: var(--win); }
.form-chip.D, .res-badge.D, .stat-mark.D { background: var(--draw); }
.form-chip.L, .res-badge.L, .stat-mark.L { background: var(--loss); }

/* Next match card */
.next-match { background: #fff; color: var(--ink); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.nm-top {
  display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  padding: 11px 22px; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
}
.nm-body { padding: 26px 24px 24px; }
.nm-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; text-align: center; }
.nm-team .crest { width: 80px; height: 80px; margin: 0 auto 10px; font-size: 1.5rem; }
.nm-name { display: block; font-weight: 800; line-height: 1.25; }
.nm-team.us .nm-name { color: var(--primary-dark); }
.nm-vs { font-family: var(--font-display); font-size: 2.4rem; line-height: 80px; color: var(--muted); }
.nm-info { list-style: none; margin: 22px 0 18px; padding: 14px 16px; display: grid; gap: 8px; background: var(--bg-alt); border-radius: 12px; font-weight: 600; color: var(--ink-2); }
.nm-info li { display: flex; align-items: center; gap: 10px; }
.nm-info .icon { color: var(--primary); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-box { background: var(--primary-deep); color: #fff; border-radius: 12px; padding: 10px 4px 8px; text-align: center; }
.cd-num { display: block; font-family: var(--font-display); font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-lbl { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.nm-live { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 12px; background: #fdecec; color: var(--loss); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--loss); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201, 60, 60, .6); } 100% { box-shadow: 0 0 0 12px rgba(201, 60, 60, 0); } }
.nm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.nm-actions .btn { flex: 1 1 auto; }
.nm-empty { display: grid; justify-items: center; gap: 8px; padding: 44px 24px; text-align: center; color: var(--muted); font-weight: 600; }
.nm-empty .icon { width: 40px; height: 40px; color: var(--primary); }
.nm-empty p { margin: 0; }

@media (max-width: 900px) {
  .hero { padding: 36px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-crest { width: 96px; }
}
@media (max-width: 420px) {
  .nm-body { padding: 22px 16px 18px; }
  .nm-team .crest { width: 64px; height: 64px; font-size: 1.2rem; }
  .nm-vs { line-height: 64px; font-size: 2rem; }
  .cd-num { font-size: 1.9rem; }
}

/* Crests (team logos / initials) */
.crest { display: block; width: 44px; height: 44px; object-fit: contain; }
.crest-initials {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c, #4a5a6a); color: #fff;
  font-weight: 800; font-size: .85rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25);
}
.crest-unknown { background: #2b3540; font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; box-shadow: inset 0 0 0 3px var(--accent); }
.nm-team .crest-unknown { font-size: 2.6rem; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 30px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.3rem, 5vw, 3.3rem); line-height: 1; letter-spacing: .02em;
  color: var(--primary-deep);
}
.section-head h2::after { content: ""; display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--accent); margin-top: 12px; }
.section-head p { margin: 12px 0 0; color: var(--muted); font-size: 1.05rem; }
.section-head p:empty { display: none; }
@media (max-width: 600px) { .section { padding: 60px 0; } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.toolbar:has(.chips:empty):not(:has(.segmented)) { display: none; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); }
.segmented button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 8px 18px; border-radius: 999px;
  font-weight: 700; color: var(--muted); cursor: pointer; transition: background .2s, color .2s;
}
.segmented button[aria-pressed="true"] { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .07); font-size: .75rem; }
.segmented button[aria-pressed="true"] .count { background: rgba(255, 255, 255, .2); }
.count:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.empty { padding: 36px; text-align: center; color: var(--muted); background: var(--bg-alt); border-radius: var(--radius); font-weight: 600; }
.note { margin: 18px 0 0; font-size: .85rem; color: var(--muted); }
.note:empty { display: none; }
.table-wrap { overflow-x: auto; }
.group-title {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  font-size: .92rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group-title .count { background: var(--primary-soft); color: var(--primary-deep); }

/* ---------- Matches ---------- */
.match-list { display: grid; gap: 14px; }
.match-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  border-inline-start: 5px solid var(--line);
}
.match-card.res-W { border-inline-start-color: var(--win); }
.match-card.res-D { border-inline-start-color: var(--draw); }
.match-card.res-L { border-inline-start-color: var(--loss); }
.match-card.upcoming { border-inline-start-color: var(--accent); }
.mc-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 14px 20px 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.comp-badge { color: var(--primary); font-weight: 800; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }
.mc-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 20px; }
.mc-team { display: flex; align-items: center; gap: 12px; font-weight: 700; line-height: 1.25; min-width: 0; }
.mc-team.home { justify-content: flex-end; text-align: end; }
.mc-team.us .tname { color: var(--primary-dark); font-weight: 800; }
.mc-team .crest { width: 46px; height: 46px; flex: none; }
.mc-score {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px; border-radius: 12px; background: var(--primary-deep); color: #fff;
  font-family: var(--font-display); font-size: 2.3rem; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.mc-score .sep { opacity: .5; }
.mc-time {
  padding: 8px 14px; border-radius: 12px; background: var(--bg-alt); color: var(--ink);
  font-family: var(--font-display); font-size: 1.8rem; line-height: 1; letter-spacing: .03em;
}
.mc-time.pending { font-family: var(--font-body); font-size: .8rem; font-weight: 700; color: var(--muted); }
.mc-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 0 20px 14px; font-size: .88rem; color: var(--ink-2); }
.mc-venue { display: inline-flex; align-items: center; gap: 6px; }
.mc-venue .icon { color: var(--muted); }
.res-badge { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; color: #fff; font-weight: 800; font-size: .85rem; }
.mc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 16px; }
.tbc { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 4px; font-size: .85rem; font-weight: 700; color: var(--draw); }

.mc-details { border-top: 1px dashed var(--line); }
.mc-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 20px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: .9rem; color: var(--primary);
}
.mc-details summary::-webkit-details-marker { display: none; }
.mc-details summary .icon { transition: transform .2s; }
.mc-details[open] summary .icon { transform: rotate(180deg); }
.mc-details-body { display: grid; gap: 14px; padding: 0 20px 18px; }
.mc-details h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.mc-details p { margin: 0; color: var(--ink-2); }
.mc-details-body > .btn { justify-self: start; }
.ht-score { display: inline-flex; gap: 6px; font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--ink) !important; }
.scorer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.scorer-list li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--primary-soft); font-weight: 700; font-size: .9rem; }
.scorer-list .icon { color: var(--primary); }
.times { padding: 0 6px; border-radius: 6px; background: var(--primary); color: #fff; font-size: .78rem; line-height: 1.5; }
.minute { color: var(--muted); font-weight: 600; }

@media (max-width: 600px) {
  .mc-board { gap: 10px; padding: 14px 14px; }
  .mc-meta, .mc-foot, .mc-actions { padding-inline: 14px; }
  .mc-details summary, .mc-details-body { padding-inline: 14px; }
  .mc-team, .mc-team.home { flex-direction: column; justify-content: flex-start; text-align: center; gap: 6px; font-size: .9rem; }
  .mc-team.home .crest { order: -1; }
  .mc-team .crest { width: 42px; height: 42px; }
  .mc-score { font-size: 1.9rem; padding: 6px 12px; gap: 8px; }
  .mc-time { font-size: 1.5rem; }
}

/* ---------- Season ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); }
.stat-num { font-family: var(--font-display); font-size: 2.9rem; line-height: 1; color: var(--ink); }
.stat-lbl { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.stat-mark { width: 10px; height: 10px; border-radius: 3px; flex: none; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } .stat-num { font-size: 2.5rem; } }

.season-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; align-items: start; }
.season-grid.no-table { grid-template-columns: 1fr; }
.season-side { display: grid; gap: 20px; align-content: start; }
@media (min-width: 760px) { .season-side.two { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .season-grid { grid-template-columns: 1fr; } }

.standings { width: 100%; border-collapse: collapse; font-size: .92rem; }
.standings th, .standings td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.standings th { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.standings td { font-variant-numeric: tabular-nums; }
.standings .team { text-align: start; font-weight: 700; white-space: normal; min-width: 130px; }
.standings .pos { width: 36px; color: var(--muted); font-weight: 700; }
.standings .pts { font-weight: 800; color: var(--ink); }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings tr.us td { background: var(--primary-soft); color: var(--primary-deep); font-weight: 800; }
.standings tr.us .team { box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 560px) {
  .standings .opt { display: none; }
  .standings th, .standings td { padding: 9px 4px; }
  .panel { padding: 18px 14px; }
}

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rank-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; }
.rank-num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-deep);
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1;
}
.rank-name { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.bar { height: 8px; margin-top: 6px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.rank-value { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: var(--ink); min-width: 1.2em; text-align: end; }
.ranking .empty { padding: 20px; }

/* ---------- Squad ---------- */
.squad-group + .squad-group { margin-top: 40px; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .player-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.player-card {
  display: flex; flex-direction: column; padding: 0; text-align: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.player-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.pc-media, .pm-media {
  position: relative; display: block; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #fff 0%, var(--primary-soft) 60%, color-mix(in srgb, var(--primary) 16%, #fff) 100%);
}
.pc-media { aspect-ratio: 4 / 5; }
.pc-media::after { /* little pitch line under the shirt */
  content: ""; position: absolute; inset-inline: 18%; bottom: 9%; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}
.pc-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pc-media .jersey { width: 74%; margin: 16% auto 0; filter: drop-shadow(0 10px 14px rgba(3, 40, 16, .28)); transition: transform .3s; }
.player-card:hover .jersey { transform: scale(1.04) rotate(-2deg); }
.pc-num {
  position: absolute; top: 8px; inset-inline-start: 12px;
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.pc-captain {
  position: absolute; top: 10px; inset-inline-end: 10px;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.pc-trial {
  position: absolute; top: 12px; inset-inline-start: 10px;
  padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--draw);
  border: 1.5px solid var(--draw); font-size: .7rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.pc-body { display: block; padding: 12px 14px 14px; }
.pc-name { display: block; font-weight: 800; line-height: 1.25; }
.pc-pos { display: block; margin-top: 2px; font-size: .82rem; font-weight: 600; color: var(--muted); }

.jersey { display: block; overflow: visible; }
.jersey .j-body { fill: var(--primary); stroke: var(--primary-deep); stroke-width: 1; stroke-linejoin: round; }
.jersey .j-side { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.jersey .j-cuff { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.jersey .j-collar { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.jersey .j-collar-trim { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.jersey .j-num { font-family: var(--font-display); font-size: 46px; fill: #fff; stroke: var(--accent); stroke-width: 1.6; paint-order: stroke; }

/* Player modal */
.modal {
  width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 22px; box-shadow: var(--shadow-lg); overflow: auto;
}
.modal::backdrop { background: rgba(2, 18, 9, .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; background: rgba(255, 255, 255, .9); }
.pm { display: grid; grid-template-columns: 280px 1fr; }
.pm-media { min-height: 340px; }
.pm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pm-media .jersey { position: absolute; inset: 0; width: 72%; margin: auto; filter: drop-shadow(0 12px 18px rgba(3, 40, 16, .3)); }
.pm-body { padding: 30px 28px 28px; }
.pm-head { display: flex; align-items: flex-end; gap: 14px; padding-inline-end: 40px; }
.pm-num { font-family: var(--font-display); font-size: 4.4rem; line-height: .85; color: var(--primary); }
.pm-pos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 2px; font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pm-tag { padding: 1px 9px; border-radius: 999px; border: 1.5px solid var(--draw); color: var(--draw); font-size: .72rem; }
.pm-tag.gold { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.pm-name { font-size: 1.7rem; line-height: 1.15; font-weight: 800; }
.pm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0 0; }
.pm-stat { background: var(--bg-alt); border-radius: 12px; padding: 10px 14px; }
.pm-stat dt { font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pm-stat dd { margin: 0; font-weight: 800; font-size: 1.1rem; }
.pm-bio { margin: 18px 0 0; color: var(--ink-2); }
@media (max-width: 640px) {
  .pm { grid-template-columns: 1fr; }
  .pm-media { min-height: 0; aspect-ratio: 16 / 11; }
  .pm-media .jersey { width: 46%; }
  .pm-body { padding: 22px 18px 22px; }
  .pm-head { padding-inline-end: 0; }
}

/* ---------- Staff ---------- */
.staff-group + .staff-group { margin-top: 40px; }
.staff-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.staff-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.avatar {
  display: grid; place-items: center; flex: none; width: 62px; height: 62px; border-radius: 50%;
  object-fit: cover; background: var(--primary-soft); color: var(--primary-deep);
  font-weight: 800; font-size: 1.15rem;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent);
}
.staff-role { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.staff-name { font-weight: 800; font-size: 1.04rem; line-height: 1.3; }
.staff-bio { margin: 8px 0 0; font-size: .9rem; color: var(--ink-2); }
.staff-card.featured { flex-direction: column; align-items: center; text-align: center; padding: 26px 22px 24px; position: relative; overflow: hidden; }
.staff-card.featured::before { content: ""; position: absolute; inset: 0 0 auto; height: 74px; background: linear-gradient(165deg, var(--primary), var(--primary-deep)); }
.staff-card.featured .avatar { position: relative; width: 104px; height: 104px; font-size: 1.8rem; margin-top: 8px; }
.staff-card.featured .staff-name { font-size: 1.2rem; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.g-item { position: relative; display: block; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-alt); cursor: zoom-in; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.g-item:hover img { transform: scale(1.06); }
.g-cap {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; text-align: start;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff;
  font-size: .82rem; font-weight: 700; line-height: 1.3;
}
.g-cap small { display: block; font-weight: 600; opacity: .8; }
@media (max-width: 480px) { .g-cap small { display: none; } .g-cap { font-size: .75rem; padding: 22px 8px 7px; } }

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(2, 10, 6, .96); color: #fff;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox .icon-btn { background: rgba(255, 255, 255, .1); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 700; opacity: .9; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; user-select: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lb-prev { inset-inline-start: 10px; }
.lb-next { inset-inline-end: 10px; }
[dir="rtl"] .lb-nav .icon { transform: scaleX(-1); }
.lb-caption { padding: 14px 16px 22px; text-align: center; font-size: .95rem; }
.lb-caption span { display: block; font-size: .82rem; opacity: .7; }
@media (max-width: 600px) {
  .lb-stage { padding: 0 8px; }
  .lightbox .lb-nav { width: 42px; height: 42px; background: rgba(0, 0, 0, .45); }
  .lb-prev { inset-inline-start: 14px; }
  .lb-next { inset-inline-end: 14px; }
}

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.news-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.news-card:not(.has-img) { border-top: 4px solid var(--accent); }
.news-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 30%; }
.news-body { padding: 20px; }
.news-date { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.news-title { margin: 6px 0 8px; font-size: 1.2rem; line-height: 1.3; font-weight: 800; }
.news-text { margin: 0; color: var(--ink-2); white-space: pre-line; }

/* ---------- Club ---------- */
.club-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.club-grid:has(.club-side[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 900px) { .club-grid { grid-template-columns: 1fr; } }
.history { margin: 0; font-size: 1.07rem; color: var(--ink-2); white-space: pre-line; }
.values { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; }
.values li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-deep); font-weight: 800;
}
.values .icon { color: var(--primary); width: 1.25em; height: 1.25em; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0 0; }
.fact { padding: 14px 16px; background: var(--bg-alt); border-radius: 12px; }
.fact dt { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact dd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; }
.swatches { display: inline-flex; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch + .swatch { margin-inline-start: -6px; }
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } }
.club-side { display: grid; gap: 20px; }
.sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.session { padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); border-inline-start: 4px solid var(--accent); }
.session-when { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.session-when .icon, .session-line .icon { color: var(--primary); }
.session-time { padding: 1px 8px; border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.session-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--ink-2); font-weight: 600; }
.session-line.muted { color: var(--muted); font-weight: 600; font-size: .9rem; }
.trophies { list-style: none; margin: 0; padding: 0; }
.trophies li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.trophies li:last-child { border-bottom: 0; }
.trophies .icon { width: 26px; height: 26px; color: var(--accent); }
.trophy-year { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--primary); min-width: 3ch; }

.kits-block { margin-top: 48px; }
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.kit { margin: 0; }
.kit-img { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); background: var(--primary-deep); }
.kit-img img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s; }
.kit-img:hover img { transform: scale(1.04); }
.kit figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-weight: 800; color: var(--ink-2); }
.kit figcaption .icon { color: var(--primary); }

.join {
  position: relative; overflow: hidden; margin-top: 48px; padding: 34px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: 22px; color: #fff;
  background:
    radial-gradient(500px 200px at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    linear-gradient(135deg, var(--primary), var(--primary-deep));
}
.join:empty { display: none; }
.join h3 { font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; line-height: 1; letter-spacing: .02em; }
.join p { margin: 8px 0 0; opacity: .9; max-width: 52ch; }
.join-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .join { padding: 26px 20px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-deep); color: rgba(255, 255, 255, .78); padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer h3 { color: #fff; font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer h3.mt { margin-top: 24px; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { width: 64px; height: 64px; flex: none; }
.footer-brand strong { display: block; color: #fff; font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1; letter-spacing: .03em; }
.footer-brand p { margin: 8px 0 0; }
.hashtag { color: var(--accent); font-weight: 800; }
.hashtag:empty { display: none; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list li { display: flex; align-items: flex-start; gap: 10px; }
.contact-list .icon { margin-top: 4px; color: var(--accent); }
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; transition: background .2s, color .2s; }
.social a:hover { background: var(--accent); color: var(--accent-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }

/* ---------- Data error banner ---------- */
.data-error { position: relative; z-index: 300; padding: 14px 20px; background: #fff3cd; color: #6b4e00; border-bottom: 2px solid #e0b100; font-weight: 600; line-height: 1.5; }

/* ---------- Arabic / right-to-left tweaks ---------- */
/* Arabic letters must never be spaced out, and Cairo needs more line height. */
[dir="rtl"] body { line-height: 1.75; }
[dir="rtl"] .hero h1,
[dir="rtl"] .section-head h2,
[dir="rtl"] .join h3,
[dir="rtl"] .footer-brand strong,
[dir="rtl"] .brand { font-weight: 800; letter-spacing: 0; line-height: 1.25; }
[dir="rtl"] .hero h1 { font-size: clamp(2.8rem, 8vw, 5rem); }
[dir="rtl"] .section-head h2 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); }
[dir="rtl"] .brand { font-size: 1.3rem; }
[dir="rtl"] .eyebrow, [dir="rtl"] .nm-top, [dir="rtl"] .comp-badge, [dir="rtl"] .staff-role,
[dir="rtl"] .group-title, [dir="rtl"] .form-label, [dir="rtl"] .news-date, [dir="rtl"] .pm-pos,
[dir="rtl"] .fact dt, [dir="rtl"] .pm-stat dt, [dir="rtl"] .cd-lbl, [dir="rtl"] .site-footer h3,
[dir="rtl"] .standings th, [dir="rtl"] .mc-details h4, [dir="rtl"] .pc-trial { letter-spacing: 0; }
