/* =========================================================================
   كأس العالم 2026 — الهوية البصرية (نسخة حماسية)
   خط مرزوق · ألوان نابضة · خلفية شفقية متحركة · توهّج وأنميشن · RTL
   ========================================================================= */

/* ---------- خط مرزوق على كامل الموقع ---------- */
@font-face {
  font-family: "Marzouk";
  src: url("Marzouk.ttf") format("truetype"),
       url("Marzouk.otf") format("opentype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* خلفيات */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #141414;
  --card: rgba(255, 255, 255, 0.05);
  --card-strong: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.12);
  /* ألوان حماسية */
  --gold: #ffffff;
  --gold-bright: #ffffff;
  --orange: #cccccc;
  --cyan: #d6d6d6;
  --cyan-bright: #ffffff;
  --magenta: #b0b0b0;
  --purple: #9a9a9a;
  --crimson: #ffffff;
  --border-gold: rgba(255,255,255, 0.40);
  --glow-gold: 0 0 30px rgba(255,255,255, 0.45);
  --glow-cyan: 0 0 26px rgba(255,255,255, 0.40);
  --text: #ffffff;
  --text-dim: #b6b6b6;
  --text-faint: #6f6f6f;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  --maxw: 1240px;
  --grad-fire: linear-gradient(120deg, #ffffff, #cccccc 55%, #b0b0b0);
  --grad-cool: linear-gradient(120deg, #d6d6d6, #9a9a9a);
  --font: "Marzouk", "Tajawal", system-ui, "Segoe UI", sans-serif;

  /* متغيّرات قابلة للتبديل بين الثيمين */
  --nav-bg: rgba(0,0,0, 0.72);
  --btn-gold-text: #000000;
  --mc-grad: linear-gradient(160deg, #121214, #0b0b0d 55%, #070708);
  --mc-clock-bg: linear-gradient(180deg, rgba(212,175,55,.06), rgba(0,0,0,.5));
  --mc-foot-bg: rgba(0,0,0,.32);
  --seg-bg: rgba(255,255,255,.04);
  --seg-border: rgba(255,255,255,.09);
  --seg-b: #ffffff;
  --gold-grad: linear-gradient(135deg, #f6e2a0, #caa14a);
  --gold-soft: #f3d98b;
  --gold-pill-bg: rgba(212,175,55,.12);
  --gold-pill-border: rgba(212,175,55,.32);
}

/* ========== الثيم النهاري (الفاتح) ========== */
:root[data-theme="light"] {
  --bg-0: #f3f3f1;
  --bg-1: #ffffff;
  --bg-2: #ebebe7;
  --card: rgba(0,0,0,0.045);
  --card-strong: rgba(0,0,0,0.075);
  --border: rgba(0,0,0,0.14);
  --gold: #1a1a1a;
  --gold-bright: #000000;
  --orange: #555555;
  --cyan: #555555;
  --cyan-bright: #111111;
  --magenta: #666666;
  --purple: #666666;
  --crimson: #111111;
  --border-gold: rgba(0,0,0,0.30);
  --glow-gold: 0 0 24px rgba(0,0,0,0.10);
  --glow-cyan: 0 0 22px rgba(0,0,0,0.08);
  --text: #17170f;
  --text-dim: #4d4d49;
  --text-faint: #8a8a86;
  --shadow: 0 16px 40px rgba(0,0,0,0.14);
  --grad-fire: linear-gradient(120deg, #1a1a1a, #444444 55%, #2a2a2a);
  --grad-cool: linear-gradient(120deg, #3a3a3a, #777777);

  --nav-bg: rgba(255,255,255, 0.82);
  --btn-gold-text: #ffffff;
  --mc-grad: linear-gradient(160deg, #ffffff, #f5f5f2 55%, #efefec);
  --mc-clock-bg: linear-gradient(180deg, rgba(212,175,55,.16), rgba(0,0,0,.03));
  --mc-foot-bg: rgba(0,0,0,.035);
  --seg-bg: rgba(0,0,0,.04);
  --seg-border: rgba(0,0,0,.10);
  --seg-b: #1a1a1a;
  --gold-grad: linear-gradient(135deg, #9a7b1e, #c39a3a);
  --gold-soft: #8a6d12;
  --gold-pill-bg: rgba(212,175,55,.18);
  --gold-pill-border: rgba(212,175,55,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* حجم خط جذري متكيّف مع كل الأجهزة (كل المقاسات بالـrem تتبعه) */
html { scroll-behavior: smooth; font-size: clamp(14px, 0.875rem + 0.32vw, 18px); }
html, body { transition: background-color .3s ease, color .3s ease; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}
/* خلفية سوداء سادة بدون أي تأثيرات */
body::before, body::after { display: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--gold); color: var(--bg-0); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.gold { color: var(--gold); }
.muted { color: var(--text-dim); }

/* عنوان متدرّج متحرّك */
.gradient-text {
  background: var(--grad-fire); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* ---------------- شريط التنقل ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.3rem; }
.brand .cup {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--grad-fire); background-size: 160%;
  border-radius: 13px; color: #000000; font-size: 1.3rem;
  box-shadow: var(--glow-gold); animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-4px) rotate(3deg)} }
.brand b { background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav-links a {
  padding: 9px 15px; border-radius: 11px; color: var(--text-dim);
  font-weight: 700; font-size: 1rem; transition: .2s; white-space: nowrap; position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--card); }
.nav-links a.active { color: var(--gold); background: var(--card-strong); box-shadow: inset 0 0 0 1px var(--border-gold); }
.nav-toggle { display: none; background: var(--card); border: 1px solid var(--border); color: var(--text); width: 44px; height: 44px; border-radius: 11px; font-size: 1.4rem; cursor: pointer; margin-inline-start: auto; }
.tz-select { font-family: var(--font); background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 10px; font-size: .82rem; font-weight: 700; cursor: pointer; max-width: 150px; }
.tz-select:focus { outline: none; border-color: var(--gold); }
.tz-select option { background: var(--bg-2); color: var(--text); }

/* ---------------- أزرار ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 12px 24px; border-radius: 13px; font-family: var(--font);
  font-weight: 800; font-size: 1.02rem; border: 1px solid transparent; transition: .22s; position: relative; overflow: hidden;
}
.btn-gold { background: var(--grad-fire); background-size: 200%; color: var(--btn-gold-text); box-shadow: var(--glow-gold); }
.btn-gold:hover { transform: translateY(-3px) scale(1.02); background-position: 100%; box-shadow: 0 0 40px rgba(255,255,255,.6); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--card-strong); border-color: var(--cyan); box-shadow: var(--glow-cyan); transform: translateY(-3px); }

/* ---------------- البطل (Hero) ---------------- */
.hero { position: relative; padding: 72px 0 58px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 900; line-height: 1.12; letter-spacing: -.5px; }
.hero p.lead { color: var(--text-dim); font-size: 1.16rem; margin: 18px 0 28px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--border-gold); color: var(--gold); font-weight: 800; font-size: .9rem; margin-bottom: 18px; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(255,255,255,.2); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1)} 50%{opacity:.4; transform:scale(.85)} }

/* أعلام عائمة في خلفية البطل */
.hero-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-orbs span { position: absolute; font-size: 2.2rem; opacity: .18; animation: float 9s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(0,0,0,.4)); }
@keyframes float { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-26px) rotate(8deg)} }

/* ---------------- العدّاد التنازلي ---------------- */
.countdown-card {
  background: linear-gradient(160deg, var(--card-strong), var(--card));
  border: 1px solid var(--border-gold); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.countdown-card::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: var(--radius);
  background: var(--grad-fire); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .5; pointer-events: none;
}
.cd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cd-head .lbl { color: var(--text-dim); font-weight: 800; font-size: .94rem; }
.cd-match { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 22px; }
.cd-match .t { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 96px; text-align: center; }
.cd-match .t img { width: 54px; height: 40px; object-fit: cover; border-radius: 7px; box-shadow: 0 6px 16px rgba(0,0,0,.5); transition: .25s; }
.cd-match .t:hover img { transform: scale(1.12) rotate(-2deg); }
.cd-match .t span { font-weight: 800; font-size: .96rem; }
.cd-match .vs { font-weight: 900; font-size: 1.3rem; background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-timer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cd-unit { text-align: center; background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px 6px; position: relative; }
.cd-unit b { display: block; font-size: 2.1rem; font-weight: 900; background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.cd-unit small { color: var(--text-faint); font-size: .8rem; }
.cd-unit.tickk b { animation: pop .4s; }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.25)} 100%{transform:scale(1)} }

/* ---------------- العناوين ---------------- */
.section { padding: 54px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 900; }
.section-head h2::before { content: "▍"; background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; margin-inline-end: 8px; }
.section-head p { color: var(--text-dim); margin-top: 4px; }

/* ---------------- البطاقات الشبكية ---------------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: .28s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden;
}
.card::after { content:""; position:absolute; top:0; left:-60%; width:50%; height:100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); transition: .5s; }
.card:hover { transform: translateY(-6px); border-color: var(--border-gold); background: var(--card-strong); box-shadow: var(--shadow); }
.card:hover::after { left: 120%; }

.stat { text-align: center; }
.stat b { display: block; font-size: 2.4rem; font-weight: 900; background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--text-dim); font-size: .96rem; font-weight: 700; }

/* ---------------- بطاقة مباراة ---------------- */
/* ===== بطاقة مباراة — فخامة داكنة (أسود عميق + ذهب) ===== */
.match-card {
  position: relative; overflow: hidden; padding: 0; border-radius: var(--radius);
  background: var(--mc-grad);
  border: 1px solid rgba(212,175,55,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 14px 34px rgba(0,0,0,.55);
  transition: transform .26s cubic-bezier(.2,.8,.2,1), box-shadow .26s, border-color .26s;
}
/* خيط ذهبي علوي رفيع */
.match-card::before {
  content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 1px; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.65), transparent); opacity: .55; pointer-events: none;
}
.match-card:hover {
  transform: translateY(-5px); border-color: rgba(212,175,55,.5);
  box-shadow: 0 24px 48px rgba(0,0,0,.65), 0 0 0 1px rgba(212,175,55,.22), 0 0 30px rgba(212,175,55,.14);
}

/* شريط اليوم البارز */
.mc-day {
  display: flex; align-items: center; gap: 9px; padding: 12px 18px; position: relative; z-index: 2;
  background: linear-gradient(90deg, rgba(212,175,55,.12), rgba(212,175,55,.03) 45%, transparent);
  border-bottom: 1px solid rgba(212,175,55,.10);
}
.mc-day-ic { font-size: 1.05rem; opacity: .9; }
.mc-day-name { font-weight: 900; font-size: 1.02rem; letter-spacing: .2px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mc-day-date { font-weight: 700; font-size: .9rem; color: var(--text-dim); margin-inline-start: auto; }

.mc-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; position: relative; z-index: 2; }
.mc-meta { font-size: .82rem; color: var(--text-faint); display: flex; align-items: center; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.mc-group { background: var(--gold-pill-bg); border: 1px solid var(--gold-pill-border); color: var(--gold-soft); padding: 3px 11px; border-radius: 999px; font-weight: 900; font-size: .76rem; letter-spacing: .3px; }
.mc-venue { color: var(--text-faint); }
.mc-actions { display: flex; gap: 6px; }
.mc-fav, .mc-int { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); cursor: pointer; font-size: 1.02rem; color: var(--text-faint); transition: .2s; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.mc-fav:hover, .mc-int:hover { transform: translateY(-2px) scale(1.08); color: var(--gold-soft); border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.08); }
.mc-fav.on { color: var(--gold-soft); border-color: rgba(212,175,55,.6); background: rgba(212,175,55,.14); box-shadow: 0 0 12px rgba(212,175,55,.4); }
.mc-int.on { color: var(--gold-soft); border-color: rgba(212,175,55,.6); background: rgba(212,175,55,.14); box-shadow: 0 0 14px rgba(212,175,55,.4); animation: ring-pulse 2s infinite; }
@keyframes ring-pulse { 0%,100%{transform:rotate(0)} 92%{transform:rotate(0)} 94%{transform:rotate(-14deg)} 96%{transform:rotate(12deg)} 98%{transform:rotate(-8deg)} }

.mc-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 18px 16px; position: relative; z-index: 2; }
.mc-team { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.mc-team.away { flex-direction: row-reverse; text-align: left; }
.mc-team img { width: 44px; height: 32px; object-fit: cover; border-radius: 7px; border: 1px solid rgba(212,175,55,.25); box-shadow: 0 5px 16px rgba(0,0,0,.6); transition: transform .25s, box-shadow .25s; }
.mc-team:hover img { transform: scale(1.12) translateY(-1px); box-shadow: 0 9px 22px rgba(0,0,0,.7); }
.mc-center { text-align: center; min-width: 92px; }

/* ساعة الانطلاق */
.mc-clock {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--mc-clock-bg);
  border: 1px solid rgba(212,175,55,.3); border-radius: 16px; padding: 9px 15px; min-width: 80px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 16px rgba(0,0,0,.5);
}
.mc-clock .time { font-weight: 900; font-size: 1.42rem; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.mc-clock .score { font-weight: 900; font-size: 1.55rem; line-height: 1; color: var(--text); }
.mc-clock small { color: var(--text-faint); font-size: .7rem; font-weight: 700; }
.mc-clock.done { border-color: rgba(255,255,255,.12); }

/* الديدلاين (العدّاد) */
.mc-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid rgba(212,175,55,.1); background: var(--mc-foot-bg); position: relative; z-index: 2; }
.mc-deadline { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mc-deadline .dl-lbl { font-size: .8rem; font-weight: 800; color: var(--text-dim); white-space: nowrap; }
.mc-deadline .dl-segs { display: flex; gap: 6px; }
.mc-deadline .dl-seg { display: inline-flex; flex-direction: column; align-items: center; min-width: 36px; background: var(--seg-bg); border: 1px solid var(--seg-border); border-radius: 10px; padding: 5px 7px; }
.mc-deadline .dl-seg b { font-size: 1.05rem; font-weight: 900; line-height: 1; color: var(--seg-b); font-variant-numeric: tabular-nums; }
.mc-deadline .dl-seg i { font-style: normal; font-size: .6rem; color: var(--text-faint); font-weight: 700; margin-top: 2px; }
.mc-deadline.soon .dl-seg { border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.1); }
.mc-deadline.soon .dl-seg b { color: var(--gold-soft); }
.mc-deadline.soon .dl-lbl { color: var(--gold-soft); }
.mc-deadline.live .dl-lbl { color: var(--gold-soft); animation: pulse 1.3s infinite; }
.mc-cal { font-family: var(--font); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); color: var(--text-dim); cursor: pointer; font-size: .8rem; font-weight: 800; padding: 8px 13px; border-radius: 11px; transition: .2s; white-space: nowrap; }
.mc-cal:hover { color: var(--gold-soft); border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.08); transform: translateY(-2px); }

.badge-live { background: #000; color: #fff; border: 1px solid rgba(255,255,255,.55); font-size: .72rem; font-weight: 900; padding: 3px 9px; border-radius: 7px; animation: pulse 1.3s infinite; box-shadow: 0 0 14px rgba(255,255,255,.6); }
.badge-done { background: rgba(255,255,255,.1); color: var(--text-dim); font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 7px; }

/* ---------------- الفلاتر ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.filters select, .filters input {
  font-family: var(--font); background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 11px 15px; border-radius: 12px; font-size: 1rem; font-weight: 700;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--gold); box-shadow: var(--glow-gold); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text-dim); font-weight: 800; font-size: .9rem; cursor: pointer; transition: .2s; font-family: var(--font); }
.chip:hover { color: var(--text); transform: translateY(-2px); }
.chip.active { background: var(--grad-fire); color: #000000; border-color: transparent; box-shadow: var(--glow-gold); }

/* ---------------- جدول المجموعات ---------------- */
.group-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .25s; }
.group-card:hover { border-color: var(--border-gold); box-shadow: var(--shadow); }
.group-card h3 { padding: 15px 19px; font-weight: 900; font-size: 1.15rem; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.08), transparent); border-bottom: 1px solid var(--border); }
.group-card h3 span { background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.standings { width: 100%; border-collapse: collapse; font-size: .92rem; }
.standings th { color: var(--text-faint); font-weight: 800; font-size: .78rem; padding: 9px 10px; text-align: center; }
.standings th:first-child { text-align: start; }
.standings td { padding: 10px; text-align: center; border-top: 1px solid var(--border); font-weight: 700; }
.standings td.team-cell { text-align: start; }
.standings .team-cell a { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.standings .team-cell img { width: 28px; height: 21px; object-fit: cover; border-radius: 4px; }
.standings tr:hover { background: rgba(255,255,255,.04); }
.standings .qual td:first-child { box-shadow: inset 4px 0 0 var(--cyan); }

/* ---------------- صفحة المنتخب ---------------- */
.team-hero { display: flex; align-items: center; gap: 26px; padding: 36px; border-radius: var(--radius); background: linear-gradient(150deg, var(--card-strong), var(--card)); border: 1px solid var(--border-gold); flex-wrap: wrap; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.team-hero img.bigflag { width: 128px; height: 92px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.team-hero h1 { font-size: 2.7rem; font-weight: 900; }
.team-hero .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.team-hero .meta span { background: var(--card); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; font-size: .9rem; color: var(--text-dim); font-weight: 700; }

/* ---------------- ركن الجماهير ---------------- */
.vote-bar { height: 15px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; margin: 6px 0; }
.vote-bar > span { display: block; height: 100%; background: var(--grad-fire); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.comment { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 17px; margin-bottom: 10px; transition: .2s; }
.comment:hover { border-color: var(--border-gold); }
.comment .c-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.comment .c-av { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-cool); display: grid; place-items: center; font-weight: 900; color: #000000; }
.comment .c-name { font-weight: 900; font-size: .94rem; }
.comment .c-time { color: var(--text-faint); font-size: .78rem; margin-inline-start: auto; }
.input-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.input-row input, .input-row textarea { flex: 1; font-family: var(--font); background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 12px 15px; border-radius: 12px; font-weight: 600; }
.input-row input:focus, .input-row textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--glow-gold); }

/* ---------------- الخريطة ---------------- */
#map { height: 540px; border-radius: var(--radius); border: 1px solid var(--border-gold); overflow: hidden; box-shadow: var(--shadow); }
.leaflet-popup-content-wrapper { background: var(--bg-2); color: var(--text); border-radius: 12px; font-family: var(--font); }
.leaflet-popup-tip { background: var(--bg-2); }
.map-pop b { color: var(--gold); }

/* ---------------- شريط أخبار متحرك ---------------- */
.ticker { background: rgba(0,0,0,.4); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-block; padding: 11px 0; animation: ticker 40s linear infinite; }
.ticker-track span { margin: 0 26px; color: var(--text-dim); font-weight: 700; }
.ticker-track span b { color: var(--gold); }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------------- التذييل ---------------- */
.footer { border-top: 1px solid var(--border); margin-top: 44px; padding: 38px 0 28px; color: var(--text-dim); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.footer h4 { color: var(--text); margin-bottom: 12px; font-size: 1.05rem; }
.footer a { display: block; padding: 4px 0; color: var(--text-dim); font-size: .94rem; }
.footer a:hover { color: var(--gold); }
.footer .copy { text-align: center; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text-faint); }

/* ---------------- الإشعارات (Toast) ---------------- */
.toast-box { position: fixed; bottom: 22px; left: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--bg-2); border: 1px solid var(--border-gold); border-radius: 13px; padding: 14px 19px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 11px; animation: slideIn .35s; max-width: 330px; font-weight: 700; }
.toast .ic { font-size: 1.4rem; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.empty { text-align: center; padding: 50px 20px; color: var(--text-faint); font-weight: 700; }
.reveal { opacity: 0; transform: translateY(26px); transition: .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- شاشة الترحيب ---------------- */
.welcome {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  background: radial-gradient(60% 60% at 50% 40%, var(--bg-2), var(--bg-0));
  transition: opacity .8s, visibility .8s;
}
.welcome.hide { opacity: 0; visibility: hidden; }
.welcome-inner { text-align: center; padding: 20px; }
.welcome .wc-cup {
  font-size: 5.5rem; display: inline-block;
  animation: cupIn 1s cubic-bezier(.2,1.4,.4,1) both, bob 3s ease-in-out 1s infinite;
  filter: drop-shadow(0 0 30px rgba(255,255,255,.7));
}
@keyframes cupIn { 0%{transform:scale(0) rotate(-180deg); opacity:0} 100%{transform:scale(1) rotate(0); opacity:1} }
.welcome h1 { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 900; margin: 16px 0 8px; animation: rise .7s .4s both; }
.welcome p { color: var(--text-dim); font-size: 1.15rem; font-weight: 700; animation: rise .7s .6s both; }
@keyframes rise { from{transform:translateY(20px); opacity:0} to{transform:none; opacity:1} }
.welcome .wc-flags { margin-top: 22px; font-size: 1.8rem; letter-spacing: 6px; animation: rise .7s .8s both; }
.welcome .wc-bar { width: 220px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.12); margin: 26px auto 0; overflow: hidden; }
.welcome .wc-bar > span { display: block; height: 100%; width: 0; background: var(--grad-fire); animation: load 2.2s ease forwards; }
@keyframes load { to { width: 100%; } }
.welcome .wc-ring { position: absolute; width: 380px; height: 380px; border: 2px solid var(--border-gold); border-radius: 50%; opacity: .25; animation: ring 4s linear infinite; }
.welcome .wc-ring.r2 { width: 540px; height: 540px; animation-duration: 7s; border-color: rgba(255,255,255,.25); }
@keyframes ring { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* ---------------- التجاوب ---------------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; position: absolute; top: 70px; right: 0; left: 0; flex-direction: column; background: var(--bg-1); border-bottom: 1px solid var(--border); padding: 10px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px; }
  .nav-toggle { display: block; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .cd-timer { gap: 6px; }
  .cd-unit b { font-size: 1.6rem; }
  .team-hero { padding: 24px; }
  .welcome .wc-ring { width: 280px; height: 280px; }
  .welcome .wc-ring.r2 { width: 380px; height: 380px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---------------- شريط أدوات التصدير ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .btn { padding: 10px 18px; font-size: .95rem; }

/* ---------------- منطقة الطباعة / PDF ---------------- */
#printArea { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; color: #111 !important; }
  body::before, body::after { display: none !important; }
  nav, footer, .filters, .toolbar, .section-head, #matchList, #empty,
  .toast-box, .welcome, .ticker, .hero-orbs { display: none !important; }
  #printArea { display: block !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-family: var(--font); color: #111; }

  .pr-header { text-align: center; border-bottom: 3px solid #111; padding-bottom: 14px; margin-bottom: 16px; }
  .pr-header .pr-cup { font-size: 2.6rem; line-height: 1; }
  .pr-header h1 { font-size: 1.7rem; font-weight: 900; margin: 6px 0 4px; }
  .pr-header p { color: #555; font-size: .85rem; }

  .pr-day { font-weight: 900; font-size: 1.05rem; margin: 16px 0 6px; padding-bottom: 5px;
            border-bottom: 2px solid #111; break-after: avoid; page-break-after: avoid; }

  .pr-row { display: grid; grid-template-columns: 1fr 100px 1fr; align-items: center; gap: 8px;
            padding: 7px 6px; border-bottom: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
  .pr-team { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; }
  .pr-team.away { flex-direction: row-reverse; }
  .pr-team img { width: 30px; height: 22px; object-fit: cover; border: 1px solid #ccc; border-radius: 2px; }
  .pr-time { text-align: center; font-weight: 900; font-size: 1.1rem; }
  .pr-time small { display: block; font-weight: 400; color: #888; font-size: .62rem; }
  .pr-venue { grid-column: 1 / -1; text-align: center; font-size: .68rem; color: #999; margin-top: 2px; }

  .pr-foot { text-align: center; margin-top: 22px; padding-top: 10px; border-top: 1px solid #ccc;
             color: #777; font-size: .72rem; }
}

/* =========================================================================
   تحسينات الأداء
   ========================================================================= */

/* أداة الفلترة: إخفاء البطاقة دون حذفها من الـDOM (تبديل رخيص بدل إعادة بناء) */
.is-hidden { display: none !important; }

/* شجرة الإقصاء التفاعلية: خانات قابلة للنقر */
.ko-pick { cursor: pointer; border-radius: 8px; transition: background .15s, box-shadow .15s; }
.ko-pick:not(.empty):hover { background: rgba(212,175,55,.12); }
.ko-slot.win { background: rgba(212,175,55,.16); box-shadow: inset 0 0 0 1px rgba(212,175,55,.45); }
.ko-slot.win span { color: var(--gold-soft); }
.ko-slot.empty { opacity: .5; cursor: default; }
.ko-tick { margin-inline-start: auto; color: #19f08a; font-weight: 900; }

/* =========================================================================
   العدّاد النيون الأخضر لانطلاق المونديال (الصفحة الرئيسية)
   ========================================================================= */
.wcc-band {
  position: relative; overflow: hidden; text-align: center;
  padding: 54px 16px 46px; margin: 8px 0;
  background:
    radial-gradient(60% 80% at 50% 28%, rgba(0,230,118,.10), transparent 70%),
    linear-gradient(180deg, #02110a, #000 70%);
  border-top: 1px solid rgba(0,230,118,.22);
  border-bottom: 1px solid rgba(0,230,118,.22);
}
.wcc-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(42% 46% at 50% 36%, rgba(0,230,118,.28), transparent 62%);
  filter: blur(26px); animation: wccBreath 4.5s ease-in-out infinite;
}
.wcc-corner {
  position: absolute; top: 16px; font-size: .7rem; font-weight: 800; letter-spacing: 2px;
  color: rgba(0,230,118,.45); z-index: 1;
}
.wcc-tl { left: 20px; } .wcc-tr { right: 20px; }
.wcc-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wcc-kicker { color: #19f08a; font-weight: 800; font-size: .92rem; letter-spacing: 1px; text-shadow: 0 0 14px rgba(0,230,118,.6); }
.wcc-numwrap { position: relative; line-height: .9; margin: 8px 0 4px; }
.wcc-num {
  font-family: var(--font); font-weight: 900;
  font-size: clamp(150px, 44vw, 380px); color: #06140d;
  -webkit-text-stroke: 3px #19f08a;
  text-shadow: 0 0 18px rgba(0,230,118,.95), 0 0 55px rgba(0,230,118,.6), 0 0 120px rgba(0,200,90,.45);
  animation: wccFlicker 5s linear infinite;
}
.wcc-num.pop { animation: wccPop .6s cubic-bezier(.2,1.5,.4,1); }
.wcc-reflect {
  position: absolute; left: 0; right: 0; top: 100%;
  transform-origin: top; transform: scaleY(-1); opacity: .16; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 55%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 55%);
  animation: none;
}
.wcc-label { font-weight: 900; font-size: clamp(1.1rem, 4vw, 1.7rem); margin-top: 8px;
  background: linear-gradient(90deg, #19f08a, #8effc0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wcc-sub { font-weight: 800; letter-spacing: 3px; color: #19f08a; font-size: 1.1rem; text-shadow: 0 0 12px rgba(0,230,118,.5); }
.wcc-sub small { display: block; letter-spacing: normal; font-size: .68rem; color: var(--text-faint); margin-top: 3px; font-weight: 700; }
.wcc-cta { margin-top: 16px; display: inline-block; padding: 12px 28px; border-radius: 999px; font-weight: 900;
  color: #00190d; background: linear-gradient(120deg, #19f08a, #00e676); box-shadow: 0 0 26px rgba(0,230,118,.5); transition: .25s; }
.wcc-cta:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,230,118,.85); }
.wcc-band.started .wcc-num { -webkit-text-stroke-color: #19f08a; }

@keyframes wccBreath { 0%,100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.09); } }
@keyframes wccFlicker { 0%,18%,22%,80%,100% { opacity: 1; } 20% { opacity: .8; } 21% { opacity: .92; } }
@keyframes wccPop { 0% { transform: scale(.45); opacity: 0; filter: blur(7px); } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; filter: blur(0); } }
@media (max-width: 600px) { .wcc-band { padding: 36px 12px 30px; } .wcc-corner { display: none; } }

/* تخطّي تخطيط ورسم البطاقات خارج الشاشة تلقائياً (مكسب كبير مع 72 بطاقة).
   contain-intrinsic-size يحجز ارتفاعاً تقديرياً فيبقى شريط التمرير مستقراً. */
.match-card { content-visibility: auto; contain-intrinsic-size: auto 240px; }

/* احترام تفضيل تقليل الحركة: نوقف الأنيميشن اللانهائي الثقيل (الخلفية الشفقية،
   النبضات، الشريط المتحرك) ونُظهر عناصر reveal فوراً بلا انتقالات. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  body::before { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ===== دعم الثيم النهاري + زر التبديل + تكيّف إضافي ===== */
/* تباين النصوص فوق أزرار/شارات التدرّج في الثيم النهاري */
:root[data-theme="light"] .player .pos,
:root[data-theme="light"] .pred-choices button.sel,
:root[data-theme="light"] .gp-badge.done { color: var(--btn-gold-text); }

/* زر تبديل الثيم في شريط التنقّل */
.theme-toggle { background: var(--card); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 11px; cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; transition: .2s; flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--border-gold); transform: translateY(-1px); }

/* تكيّف إضافي مع الشاشات الصغيرة جداً */
@media (max-width: 600px) {
  .wrap { padding: 0 14px; }
  .section { padding: 38px 0; }
  .nav-inner { gap: 10px; }
  .tz-select { max-width: 150px; }
}

/* ===== شعار الشريط العلوي ===== */
.brand-logo { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: block; }

/* ===== تصحيح ألوان عناصر داكنة عند الثيم النهاري ===== */
:root[data-theme="light"] .ticker { background: rgba(0,0,0,.04); }
:root[data-theme="light"] .cd-unit { background: rgba(0,0,0,.05); }
:root[data-theme="light"] .cmp-bar,
:root[data-theme="light"] .pred-progress,
:root[data-theme="light"] .vote-bar { background: rgba(0,0,0,.08); }
:root[data-theme="light"] .standings tr:hover { background: rgba(0,0,0,.04); }
:root[data-theme="light"] .ko-round h3 { background: linear-gradient(90deg, rgba(0,0,0,.07), transparent); }
:root[data-theme="light"] .badge-live { background: #1a1a1a; }

/* ===== صفحة البحث ===== */
.search-big { width: 100%; font-family: var(--font); background: var(--card); border: 1px solid var(--border-gold); color: var(--text); padding: 16px 18px; border-radius: 14px; font-size: 1.1rem; font-weight: 700; }
.search-big:focus { outline: none; box-shadow: var(--glow-gold); }
.sr-head { margin: 22px 0 10px; color: var(--gold); font-size: 1.05rem; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sr-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-weight: 700; transition: .18s; }
.sr-item:hover { border-color: var(--border-gold); background: var(--card-strong); transform: translateY(-2px); }
.sr-item img { width: 30px; height: 22px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.sr-item small { color: var(--text-faint); font-weight: 700; margin-inline-start: auto; font-size: .76rem; }
.sr-pos { width: 34px; height: 34px; border-radius: 9px; background: var(--gold-pill-bg); border: 1px solid var(--gold-pill-border); color: var(--gold-soft); display: grid; place-items: center; font-weight: 900; font-size: .68rem; flex-shrink: 0; }

/* ===== صفحة اللاعب ===== */
.pl-hero { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--border-gold); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); flex-wrap: wrap; }
.pl-pos { width: 64px; height: 64px; border-radius: 16px; background: var(--gold-grad); color: var(--btn-gold-text); display: grid; place-items: center; font-weight: 900; font-size: .9rem; flex-shrink: 0; }
.pl-hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; }
.pl-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--text-dim); font-weight: 700; margin-top: 6px; font-size: .9rem; }
.pl-meta a { display: inline-flex; align-items: center; gap: 7px; }
.pl-meta img { width: 26px; height: 19px; border-radius: 3px; object-fit: cover; }
