/* C:\xampp\shawtain\public\assets\css\league.css */

/* رابط اسم البطولة فالصفحة الرئيسية */
.league-title a { display: flex; align-items: center; gap: 10px; }
.league-title a:hover { color: var(--accent); }

/* رأس صفحة الدوري */
.league-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.league-head h1 { font-size: 1.5rem; }
.league-head img { object-fit: contain; }

/* التبويبات */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }

.tab {
    padding: 10px 20px;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* التنقل بين الجولات */
.round-nav { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 14px; }

.round-nav select {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 16px;
    font: inherit;
    font-weight: 600;
    min-width: 180px;
}

.btn.disabled { opacity: .35; cursor: default; }

/* مباريات الجولة */
.round-matches { padding: 0; overflow: hidden; }

.date-heading {
    font-size: .9rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--card-alt);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

/* جدول الترتيب */
.table-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.group-title { padding: 10px 16px; background: var(--card-alt); border-bottom: 1px solid var(--border); font-size: 1rem; }
.table-wrap { overflow-x: auto; }

table.standings { width: 100%; border-collapse: collapse; font-size: .95rem; table-layout: fixed; }
.standings th, .standings td { padding: 11px 6px; text-align: center; white-space: nowrap; }

.standings thead th {
    background: var(--card-alt);
    color: var(--muted);
    font-weight: 700;
    font-size: .8rem;
    border-bottom: 1px solid var(--border);
}

.standings tbody tr { border-bottom: 1px solid var(--border); }
.standings tbody tr:last-child { border-bottom: 0; }
.standings tbody tr:hover { background: var(--card-alt); }

/* عرض الأعمدة: المركز ثابت، الفريق 26%، آخر 5 ثابت، الباقي كيتوزع بالتساوي */
.standings th:nth-child(1) { width: 52px; }
.standings th:nth-child(2) { width: 26%; }
.standings th:nth-child(11) { width: 150px; }

.standings .t-team { text-align: start; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.t-team img { vertical-align: middle; margin-inline-end: 8px; object-fit: contain; }

.standings .rank { font-weight: 700; border-inline-start: 6px solid transparent; }
.standings .pts { font-weight: 800; color: var(--accent); }

/* فارق الأهداف: نجبرو الاتجاه من اليسار لليمين باش تبقى علامة (-) قدام الرقم */
.standings td:nth-child(9) { direction: ltr; }

/* ألوان المراكز */
.zone-ucl .rank   { border-inline-start-color: #2f8bff; }
.zone-uel .rank   { border-inline-start-color: #ff9f1a; }
.zone-uecl .rank  { border-inline-start-color: #18c29c; }
.zone-rel .rank   { border-inline-start-color: #ff3b5c; }
.zone-other .rank { border-inline-start-color: #9b6bff; }

/* شرح الألوان */
.legend { margin-bottom: 16px; }
.legend ul { list-style: none; margin-top: 10px; display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }

.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-inline-end: 10px; vertical-align: middle; }
.dot.zone-ucl   { background: #2f8bff; }
.dot.zone-uel   { background: #ff9f1a; }
.dot.zone-uecl  { background: #18c29c; }
.dot.zone-rel   { background: #ff3b5c; }
.dot.zone-other { background: #9b6bff; }

/* آخر 5 مباريات: نقط كبار */
.form { display: inline-flex; gap: 6px; direction: ltr; }
.form i { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: .78rem; font-weight: 700; color: #000; line-height: 1; }
.f-w { background: #22c55e; }
.f-d { background: #94a3b8; }
.f-l { background: #ef4444; }

@media (max-width: 640px) {
    /* فالهاتف: كل الأعمدة كتبان، والجدول كيتحرك يمين ويسار */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.standings { table-layout: auto; min-width: 680px; font-size: .9rem; }
    .standings th, .standings td { padding: 10px 8px; }
    .standings th:nth-child(n) { width: auto; }
    .standings th:nth-child(1) { width: 40px; }
    .standings th:nth-child(2) { min-width: 150px; }
    .standings th:nth-child(11) { width: 150px; }
    /* الترتيب والفريق يبقاو ثابتين وقت التحريك */
    .standings th:nth-child(1), .standings td:nth-child(1),
    .standings th:nth-child(2), .standings td:nth-child(2) {
        position: sticky; background: var(--card); z-index: 2;
    }
    .standings th:nth-child(1), .standings td:nth-child(1) { inset-inline-start: 0; }
    .standings th:nth-child(2), .standings td:nth-child(2) { inset-inline-start: 40px; }
    .round-nav select { min-width: 140px; }
    .tab { padding: 10px 14px; }
}
/* نص تعريفي قصير فوق المباريات */
.league-intro { margin-bottom: 14px; color: var(--muted); font-size: .93rem; line-height: 1.8; }

/* القناة الناقلة */
.league-tv{
  display:inline-block; margin-inline-start:10px; padding:2px 8px;
  border-radius:20px; background:rgba(255,255,255,.07);
  color:var(--muted); font-size:.78rem; font-weight:500; white-space:nowrap;
}
@media (max-width:640px){ .league-tv{ display:block; margin:6px 0 0; width:fit-content; } }

/* بديل الشعارات: دائرة بالحروف الأولى */
.crest{
  display:inline-flex; align-items:center; justify-content:center;
  flex:none; border-radius:50%;
  background:hsl(var(--crest-h,210) 42% 34%);
  color:#fff; font-weight:800; line-height:1; letter-spacing:0;
  text-transform:uppercase; overflow:hidden;
}
