/* ===================================================================
   yallashootin.online — ملف CSS الوحيد
   خصائص منطقية حصراً · لا ملف ثانٍ للاتجاه · لا خط خارجي
   المرجع البصري: docs/screen.png · الرموز: SPEC §6
   =================================================================== */

:root {
  /* الهوية */
  --pink:      #db2777;
  --pink-deep: #be185d;
  --red:       #dc2626;
  --red-dark:  #8b0000;
  --purple:    #7e22ce;
  --blue:      #2563eb;

  /* الأسطح */
  --bg:        #f3f4f6;
  --surface:   #ffffff;
  --surface-2: #f9fafb;
  --line:      #e5e7eb;
  --line-soft: #f3f4f6;

  /* النص */
  --text:      #111827;
  --text-2:    #6b7280;
  --text-3:    #9ca3af;

  /* الخطوط — خطوط النظام فقط */
  --face: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic",
          "Dubai", Tahoma, sans-serif;
  --face-num: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* السلّم */
  --t-xs: 0.75rem;  --t-sm: 0.875rem; --t-base: 1rem;
  --t-lg: 1.25rem;  --t-xl: 1.5rem;   --t-2xl: 2rem;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;
  --s-4: 16px; --s-5: 24px; --s-6: 32px;

  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;

  --sh-1: 0 1px 2px rgb(0 0 0 / .05);
  --sh-2: 0 4px 12px rgb(0 0 0 / .08);

  --wrap: 1280px;
}

/* ---------- إعادة ضبط ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--face);
  font-size: 17px;                 /* العربي 17px */
  line-height: 1.6;
  min-block-size: 100vh;
}

h1, h2, h3, p, figure { margin: 0; }

img { max-inline-size: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- الأرقام: حرج لمنع CLS ---------- */

.score, .match-time, .minute {
  font-family: var(--face-num);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- الحاوية ---------- */

.wrap {
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-3);
  padding-block: var(--s-5) var(--s-6);
}

@media (min-width: 641px) {
  .wrap { padding-inline: var(--s-5); }
}

/* ---------- الهيدر ---------- */

.topbar {
  background: var(--pink);
  color: #fff;
  block-size: 64px;
}

.topbar__inner {
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  block-size: 100%;
}

.topbar__side {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.topnav {
  display: flex;
  gap: var(--s-4);
  font-size: var(--t-sm);
  font-weight: 600;
}

.topnav a {
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  opacity: .95;
}

.topnav a:hover { opacity: 1; text-decoration: underline; }

.socials { display: flex; gap: var(--s-2); }

.social {
  inline-size: 34px; block-size: 34px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / .2);
  color: #fff;
  transition: background .15s;
}

.social:hover { background: rgb(255 255 255 / .32); }

/* بطاقة الشعار — بيضاء بارزة للأسفل */
.brand {
  background: #fff;
  padding: var(--s-2) var(--s-6);
  border-radius: var(--r-md) var(--r-md) 0 0;
  box-shadow: var(--sh-2);
  position: relative;
  inset-block-start: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__name {
  color: var(--pink);
  font-weight: 700;
  font-size: var(--t-xl);
}

.brand__url {
  color: var(--pink);
  font-size: var(--t-xs);
  letter-spacing: .05em;
  direction: ltr;
  unicode-bidi: isolate;
}

/* الموبايل: البطاقة البارزة تكسر الشريط — بعرض كامل أسفله */
@media (max-width: 640px) {
  .topbar { block-size: auto; }

  .topbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-inline: 0;              /* البطاقة تمتد من حافة لحافة */
  }

  .topbar__side {
    justify-content: space-between;
    block-size: 56px;
    padding-inline: var(--s-3);
  }

  .topnav { gap: var(--s-3); font-size: var(--t-xs); }

  .brand {
    inset-block-start: 0;
    border-radius: 0;
    inline-size: 100%;
    padding-block: var(--s-2);
    box-shadow: var(--sh-1);
  }
}

/* ---------- تبويبات الأيام ---------- */

.tabs {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  margin-block-end: var(--s-5);
  flex-wrap: wrap;
}

.tab {
  padding: var(--s-2) var(--s-5);
  border: 0;
  border-radius: var(--r-sm);
  color: #fff;
  font-weight: 700;
  font-size: var(--t-sm);
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: opacity .15s;
}

.tab:hover { opacity: .9; }
.tab[aria-selected="false"] { opacity: .55; }
.tab[aria-selected="false"]:hover { opacity: .78; }

.tab--today     { background: var(--red); }
.tab--tomorrow  { background: var(--purple); }
.tab--top       { background: var(--red-dark); }
.tab--yesterday { background: var(--text-2); }

/* ---------- البطاقة والقائمة ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--text-2);
  font-size: var(--t-base);
}

.section-title {
  display: inline-flex;
  align-items: center;
  background: #4b5563;
  color: #fff;
  font-size: var(--t-base);
  font-weight: 700;
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-sm);
  margin-block: var(--s-6) var(--s-4);
  min-block-size: 44px;
}

/* ---------- بطاقة المباراة ---------- */

/* حاوية البطاقات — كل مباراة إطار مستقل لا صف في جدول */
.card--list {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.match {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  min-block-size: 128px;              /* ثابت — يمنع CLS */
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.match:hover { border-color: var(--line); box-shadow: var(--sh-2); }

.match__main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  flex: 1;
}

.team {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-inline-size: 0;
}

/* الضيف يقابل المضيف — الشعار عند الحافة والاسم نحو المركز */
.team--away { flex-direction: row-reverse; }

.team__logo {
  inline-size: 48px;
  block-size: 48px;
  flex: 0 0 auto;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
}

.team__name {
  font-weight: 700;
  font-size: var(--t-base);
  overflow-wrap: anywhere;
}

.match__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  min-inline-size: 0;
}

.score {
  font-size: var(--t-xl);
  font-weight: 700;
  min-inline-size: 96px;              /* ثابت */
  text-align: center;
  color: var(--text);
  display: inline-block;
}

/* ---------- الشريط السفلي ---------- */

.match__foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-block-start: 1px solid var(--line-soft);
  background: var(--surface-2);
  font-size: var(--t-xs);
  color: var(--text-2);
}

.match__fact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: 0;
}

.match__fact:first-child { justify-content: flex-start; }
.match__fact:last-child  { justify-content: flex-end; }

.match__fact-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match__fact-icon { flex: 0 0 auto; color: var(--text-3); }

/* ---------- التظليل وزر التشغيل ---------- */

.match__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(17 24 39 / .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}

.match:hover .match__play,
.match:focus-visible .match__play { opacity: 1; }

.match__play-btn {
  inline-size: 56px;
  block-size: 56px;
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-2);
  padding-inline-start: 4px;          /* المثلث يتّزن بصرياً داخل الدائرة */
}

/* ---------- شارات الحالة ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
}

.badge--live     { background: var(--red);       color: #fff; }
.badge--soon     { background: #f59e0b;          color: #422006; }
.badge--ended    { background: var(--line); color: var(--text-2); }
/* قرص داكن كما في المرجع — يقرأ فوراً بلا منافسة للأحمر */
.badge--upcoming { background: var(--text-2); color: #fff; }

.badge--live::before {
  content: '';
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .badge--live::before { animation: beat 2s ease-in-out infinite; }
}

@keyframes beat { 50% { opacity: .4; transform: scale(.75); } }

/* مؤشر صامت عند فشل التحديث — لا يُفرغ القائمة */
.stale-note {
  display: none;
  margin-block-start: var(--s-3);
  color: var(--text-3);
  font-size: var(--t-xs);
  text-align: center;
}

body[data-stale="1"] .stale-note { display: block; }

/* ---------- المشغّل (يُستعمل في مرحلة لاحقة) ---------- */

.player-wrap {
  aspect-ratio: 16 / 9;
  inline-size: 100%;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
}

.player-wrap iframe {
  inline-size: 100%;
  block-size: 100%;
  border: 0;
}

.servers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block: var(--s-3);
}

.servers button {
  min-block-size: 48px;
  padding-inline: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--t-sm);
  font-weight: 700;
  cursor: pointer;
}

.servers button.is-active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

/* ---------- الأخبار ---------- */

.news {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.news__card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-1);
}

.news__img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  inline-size: 100%;
}

.news__title {
  padding: var(--s-3);
  font-weight: 700;
  font-size: var(--t-sm);
  line-height: 1.5;
}

/* ---------- الفوتر ---------- */

.footer {
  background: var(--text);
  color: #fff;
  padding-block: var(--s-5);
  margin-block-start: var(--s-6);
}

.footer__inner {
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  font-size: var(--t-sm);
}

.footer__links a {
  color: var(--text-3);
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
}

.footer__links a:hover { color: #fff; }

.footer__by {
  color: var(--text-3);
  font-size: var(--t-sm);
}

.footer__note {
  max-inline-size: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-4);
  margin-block-start: var(--s-3);
  color: var(--text-3);
  font-size: var(--t-xs);
  text-align: start;
}

/* ---------- الموبايل ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }

  .match__main {
    gap: var(--s-2);
    padding: var(--s-3);
  }

  .team { flex-direction: column; gap: var(--s-1); text-align: center; }
  .team--away { flex-direction: column; }
  .team__logo { inline-size: 40px; block-size: 40px; }
  .team__name { font-size: var(--t-sm); }

  .score {
    font-size: var(--t-lg);
    min-inline-size: 76px;
  }

  .match__foot { padding-inline: var(--s-3); font-size: 11px; }
  .match__fact-icon { display: none; }
  .match__play-btn { inline-size: 48px; block-size: 48px; }

  .footer__inner { justify-content: center; text-align: center; }
}

/* ---------- صفحة المباراة ---------- */

.page-title {
  font-size: var(--t-xl);
  font-weight: 700;
  margin-block-end: var(--s-4);
  text-align: start;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--text-2);
  margin-block-end: var(--s-3);
}

.crumbs a { color: var(--blue); }
.crumbs a:hover { text-decoration: underline; }

.card--pad { margin-block-end: var(--s-4); }

.player-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.player-msg { color: var(--text-2); font-size: var(--t-sm); }

.player-note {
  color: var(--text-3);
  font-size: var(--t-xs);
  margin-block-start: var(--s-2);
  text-align: start;
}

.facts {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  overflow: hidden;
  margin: 0;
}

.facts__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-block-end: 1px solid var(--line-soft);
  font-size: var(--t-sm);
}

.facts__row:last-child { border-block-end: 0; }
.facts dt { color: var(--text-2); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.watch-more {
  margin-block-start: var(--s-4);
  font-size: var(--t-sm);
  font-weight: 700;
}

.watch-more a { color: var(--blue); }
.watch-more a:hover { text-decoration: underline; }

/* ---------- الصفحات النصية ---------- */

.prose {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: var(--s-5);
  max-inline-size: 75ch;
}

.prose h2 {
  font-size: var(--t-lg);
  margin-block: var(--s-5) var(--s-2);
}

.prose h2:first-child { margin-block-start: 0; }
.prose p, .prose li { margin-block-end: var(--s-3); font-size: var(--t-base); }
.prose ul { padding-inline-start: var(--s-5); margin: 0; }
.prose a { color: var(--blue); text-decoration: underline; }

.contact-line { font-weight: 700; }

@media (max-width: 640px) {
  .facts__row { grid-template-columns: 1fr; gap: var(--s-1); }
  .prose { padding: var(--s-4); }
}

/* ---------- مبدّل المنطقة الزمنية ---------- */

.tzbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  justify-content: flex-end;
  margin-block-end: var(--s-3);
  font-size: var(--t-sm);
  color: var(--text-2);
}

.tzbar select {
  min-block-size: 44px;
  padding-inline: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--t-sm);
  font-weight: 700;
}

/* ---------- قائمة البطولات ---------- */

.leagues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.leagues a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-block-size: 56px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: background .15s;
}

.leagues a:hover { background: var(--surface-2); }
.leagues__name { font-weight: 700; font-size: var(--t-sm); }
.leagues__count { color: var(--text-2); font-size: var(--t-xs); white-space: nowrap; }

/* حالات لا يحدّدها الوقت — المصدر وحده يعرفها */
.badge--postponed { background: #fef3c7; color: #78350f; }
.badge--cancelled { background: var(--line);  color: var(--text-2); text-decoration: line-through; }

/* علم المنتخب بديلاً عن الشعار — نفس أبعاد الدائرة فلا إزاحة */
.team__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  background: var(--surface-2);
}

/* روابط المصدر الخارجية — ليست سيرفرات تُضمَّن */
.player-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-block-start: var(--s-3);
  font-size: var(--t-sm);
  font-weight: 700;
}

.player-links a { color: var(--blue); }
.player-links a:hover { text-decoration: underline; }

/* بطاقة مفردة على صفحة المباراة — بلا رابط لنفسها */
.card--single { margin-block-end: var(--s-4); }

/* فقرة تمهيدية — تحمل عبارات البحث طبيعياً لا حشواً */
.intro {
  color: var(--text-2);
  font-size: var(--t-sm);
  line-height: 1.7;
  max-inline-size: 80ch;
  margin-block-end: var(--s-4);
}

.facts dd a { color: var(--blue); }
.facts dd a:hover { text-decoration: underline; }
