/* =========================================================
   Competition Overview - Layout
   ========================================================= */

.lwf-competition-overview {
    width: calc(100% - 48px);
    max-width: 1320px;
    margin: 16px auto 0;
    box-sizing: border-box;
}

.lwf-competition-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    direction: rtl;
}

.lwf-competition-overview-grid > * {
    min-width: 0;
}

/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */

.competition-overview-grid > * {
    min-width: 0;
}

.competition-overview-card {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    direction: rtl;
}


/* ---------------------------------------------------------
   Card Header
   --------------------------------------------------------- */

.competition-overview-card__header {
    min-height: 68px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #edf0f2;
}

.competition-overview-card__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
}

.competition-standings-subtitle {
    display: block;
    margin-top: 4px;
    color: #687386;
    font-size: 13px;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Group / Round Select
   --------------------------------------------------------- */

.competition-group-selector,
.competition-round-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.competition-group-selector label,
.competition-round-selector label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.competition-group-selector select,
.competition-round-selector select {
    min-width: 125px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d8dde3;
    border-radius: 9px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.competition-group-selector select:focus,
.competition-round-selector select:focus {
    border-color: #0a9f55;
}


/* ---------------------------------------------------------
   Standings Filters
   --------------------------------------------------------- */

.lwf-standings-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.lwf-standings-filter button {
    height: 36px;
    padding: 0 14px;
    border: 1px solid #dfe4e8;
    border-radius: 18px;
    background: #fff;
    color: #344054;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.lwf-standings-filter button.active {
    background: #08a657;
    border-color: #08a657;
    color: #fff;
}


/* ---------------------------------------------------------
   Standings Table
   --------------------------------------------------------- */

.competition-standings-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.competition-standings-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    direction: rtl;
}

.competition-standings-table th,
.competition-standings-table td {
    height: 48px;
    padding: 8px 7px;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid #eef0f2;
    font-size: 12px;
}

.competition-standings-table th {
    background: #fafbfc;
    color: #344054;
    font-weight: 800;
}

.competition-standings-table td {
    color: #182230;
    font-weight: 700;
}

.competition-standings-table tbody tr:last-child td {
    border-bottom: 0;
}


/* Team column */

.competition-standings-table th:nth-child(2),
.competition-standings-table td:nth-child(2) {
    min-width: 180px;
    text-align: right;
}

.competition-team-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    color: inherit;
    text-decoration: none;
}

.competition-team-cell img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex: 0 0 30px;
}

.competition-team-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Points */

.competition-standings-table td:last-child {
    font-size: 14px;
}


/* Deduction */

.lwf-deduction {
    color: #dc2626;
    font-weight: 800;
}


/* ---------------------------------------------------------
   Rounds
   --------------------------------------------------------- */

.competition-rounds-card {
    direction: rtl;
}

.competition-round-matches {
    padding: 8px 14px 14px;
}

.competition-round-match {
    min-height: 66px;
    padding: 10px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #eef0f2;
    transition: background-color .15s ease;
}

.competition-round-match:last-child {
    border-bottom: 0;
}

/* شيل الخط من آخر مباراة في كل مجموعة تاريخ (قبل صف التاريخ التالي مباشرة) */
.competition-round-match:has(+ .competition-round-date) {
    border-bottom: 0;
}

.competition-round-match:hover {
    background: #fafcfb;
}


/* Teams */

.competition-round-match__team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
}

.competition-round-match__team span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.competition-round-match__team img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: 0 0 32px;
}

.competition-round-match__team--home {
    justify-content: flex-start;
}

.competition-round-match__team--away {
    justify-content: flex-start;
}


/* Score */

.competition-round-match__score {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
}

.competition-round-match__score strong {
    min-width: 54px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #08a657;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.competition-round-match__score span {
    color: #98a2b3;
    font-size: 11px;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Empty State
   --------------------------------------------------------- */

.competition-overview-empty {
    padding: 35px 20px;
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Legend
   --------------------------------------------------------- */

.lwf-standings-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px solid #eef0f2;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.legend-color {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-color.withdrawn {
    background: #f59e0b;
}

.legend-color.excluded {
    background: #ef4444;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 1100px) {

    .competition-overview-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
        gap: 16px;
    }

    .competition-overview-card__header {
        padding: 14px 16px;
    }

    .competition-round-matches {
        padding-inline: 10px;
    }

}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 768px) {

 .lwf-competition-overview-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    direction: rtl;
}

    .competition-overview-card__header {
        min-height: auto;
        padding: 14px;
        flex-wrap: wrap;
    }

    .competition-overview-card__header h2 {
        font-size: 16px;
    }

    .competition-standings-subtitle {
        font-size: 12px;
    }

    .competition-group-selector,
    .competition-round-selector {
        width: 100%;
        justify-content: space-between;
    }

    .competition-group-selector select,
    .competition-round-selector select {
        flex: 1;
        max-width: 180px;
    }

    .lwf-standings-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .lwf-standings-filter button {
        flex: 0 0 auto;
        padding-inline: 12px;
    }

    .competition-standings-table {
        min-width: 650px;
    }

    .competition-round-match {
        grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr);
        min-height: 62px;
        padding-inline: 5px;
    }

    .competition-round-match__team {
        font-size: 11px;
    }

    .competition-round-match__team img {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .competition-round-match__score strong {
        min-width: 48px;
        padding: 5px 6px;
        font-size: 12px;
    }

}


/* ---------------------------------------------------------
   Small Mobile
   --------------------------------------------------------- */

@media (max-width: 480px) {

   .lwf-competition-overview-grid {
    gap: 12px;
}

    .competition-overview-card {
        border-radius: 13px;
    }

    .competition-overview-card__header {
        padding: 12px;
    }

    .competition-round-matches {
        padding: 4px 8px 8px;
    }

    .competition-round-match {
        grid-template-columns: minmax(0, 1fr) 55px minmax(0, 1fr);
        gap: 4px;
    }

    .competition-round-match__team {
        gap: 5px;
        font-size: 10px;
    }

    .competition-round-match__team img {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }

}

@media (max-width: 768px) {

    .lwf-competition-overview {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px auto 0;
    }

    .lwf-competition-overview-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

}

/* =========================================================
   FINAL — عرض بطاقات نظرة عامة في الهاتف
   ========================================================= */

@media (max-width: 768px) {

    .lwf-competition-overview {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        margin: 12px auto 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .lwf-competition-overview-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 14px !important;
        box-sizing: border-box !important;
    }

    .lwf-competition-overview-grid > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

}

/* =========================================================
   FINAL MOBILE — بطاقة المباريات بنفس عرض الأخبار
   ========================================================= */

@media (max-width: 768px) {

    .lwf-competition-overview-rounds {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .lwf-competition-overview-rounds .competition-rounds-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

}

@media (max-width: 768px) {

    .lwf-competition-overview-standings {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .lwf-competition-overview-standings .competition-overview-standings-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

}

/* =========================================================
   FINAL MOBILE — توحيد بطاقات معلومات المنافسة
   ========================================================= */

@media (max-width: 768px) {

    .lwf-competition-info {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
        box-sizing: border-box !important;
    }

    .lwf-competition-info .lwf-info-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
        box-sizing: border-box !important;
    }

}

/* =========================================================
   French — Overview Cards Layout
   ========================================================= */

.lwf-competition-overview-grid--fr {
    direction: ltr;
}

@media (max-width: 768px) {

    .lwf-competition-overview-grid--fr {
        direction: ltr;
    }

}