/* =========================================================
   LWFG — Competition Overview / Rounds
   ========================================================= */

.competition-rounds-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.competition-rounds-card .competition-overview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    min-height: 58px;
}

/* سهم الجولة السابقة / القادمة + القائمة المخصصة */
.competition-rounds-header {
    direction: rtl;
}

/*
 * قائمة منسدلة مخصصة (زر + ul) بدل <select> الأصلي.
 * السبب: عرض القائمة المفتوحة لعنصر select الأصلي يتحكم فيه
 * المتصفح بنفسه (حسب محتوى الخيارات + padding داخلي خاص به)
 * ومفيش طريقة نضبطه بدقة عبر CSS. بالقائمة المخصصة، القائمة
 * position:absolute جوه wrapper بعرض ثابت وممتدة left:0/right:0
 * فتاخد بالضبط نفس عرض الزر دايمًا.
 */
.competition-round-selector {
    position: relative;
    display: inline-flex;
    margin: 0 auto;
    direction: rtl;
}

.competition-round-selector__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 120px;
    height: 42px;
    padding: 0 14px;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background-color: #ffffff;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 12px;

    color: #111827;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    box-sizing: border-box;
    cursor: pointer;

}

.competition-round-selector__arrow {
    display: none;
}

.competition-round-selector__label {
    order: 1;
    transform: translateY(2px);
}

[data-competition-round-selector].is-open .competition-round-selector__arrow {
    transform: rotate(225deg);
}

.competition-round-selector__list {
    display: none;
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(20, 25, 30, .12);
    max-height: 260px;
    overflow-y: auto;
}

[data-competition-round-selector].is-open .competition-round-selector__list {
    display: block;
}

.competition-round-selector__option {
    display: block;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #20252b;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.competition-round-selector__option:hover {
    background: #f5f7fa;
}

.competition-round-selector__option.is-selected {
    background: #008F4C;
    color: #fff;
}

.competition-round-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: #f1f3f5;
    color: #20252b;
    text-decoration: none;
    font-size: 25px;
    line-height: 1;
    transition: background .15s ease, opacity .15s ease;
}

.competition-round-nav:hover {
    background: #e7eaee;
}

.competition-round-nav.is-disabled {
    opacity: .35;
    pointer-events: none;
}

/* التاريخ فوق كل مجموعة من مباريات نفس اليوم */
.competition-round-date {
    margin: 0px 0 0;
    padding: 9px 18px;
    background: #f5f5f5;
    color: #20252b;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #edf0f3;
    border-radius: 8px;

}

/* قائمة مباريات الجولة */
.competition-round-matches {
    width: 100%;
}

/*
 * RTL:
 * الفريق المستضيف على اليمين، الشعار ملاصق للنتيجة.
 * الفريق الضيف على اليسار، الشعار ملاصق للنتيجة.
 */
.competition-round-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    align-items: center;
    column-gap: 3px;
    min-height: 70px;
    padding: 10px 20px;
    border-top: 1px solid #edf0f3;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

/* أول مباراة مباشرة بعد التاريخ: بدون خط علوي */
.competition-round-date + .competition-round-match {
    border-top: none !important;
}

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

/* الفريق */
.competition-round-match__team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
}

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

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

/* المستضيف: الاسم ثم الشعار، والشعار قريب من النتيجة */
.competition-round-match__team--home {
    justify-content: flex-end;
}

/* الضيف: الشعار ملاصق للنتيجة ثم اسم الفريق */
.competition-round-match__team--away {
    justify-content: flex-start;
}

.competition-round-match__team--away img {
    order: 1;
}

.competition-round-match__team--away span {
    order: 2;
}

/* تثبيت الشعارات في أعمدة متقابلة وقريبة من النتيجة */
.competition-round-match__team--home img {
    flex: 0 0 38px;
}

.competition-round-match__team--away img {
    flex: 0 0 38px;
    margin-inline-end: 0;
}

.competition-round-match__team--home span,
.competition-round-match__team--away span {
    min-width: 0;
}

/* النتيجة / وقت المباراة */
.competition-round-match__score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    min-width: 74px;
    text-align: center;
    justify-self: center;
}

.competition-round-match__score strong {
    display: inline;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #20252b;
    font-size: 14px;
    font-weight: 600;
}

.competition-round-match__score span {
    color: #9aa3ad;
    font-size: 12px;
    font-weight: 700;
}

.competition-round-match__time {
    color: #717171 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* الهاتف */
@media (max-width: 768px) {

    .competition-rounds-card .competition-overview-card__header {
        min-height: 58px;
        padding: 10px 12px;
    }

    .competition-round-nav {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 23px;
    }

.competition-round-date {
    margin: 2px 0 0;
    padding: 8px 12px;
    font-size: 11px;
    border-top: none !important;
}

    .competition-round-match {
        grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
        column-gap: 2px;
        min-height: 64px;
        padding: 8px 12px;
    }

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

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

    .competition-round-match__score {
        width: 60px;
        min-width: 60px;
        justify-self: center;
    }

.competition-round-match__score strong {
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    color: #20252b;
    font-size: 14px;
}

    .competition-round-match__time {
        font-size: 13px !important;
    }
}

/* ---------------------------------------------------------
   الهاتف — البطاقة لا تلتصق بحواف الشاشة
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .competition-rounds-card {
        width: calc(100% - 24px);
        margin-inline: 12px;
        box-sizing: border-box;
        border-radius: 14px;
    }

    .competition-rounds-card .competition-round-matches,
    .competition-rounds-card .competition-round-date {
        width: 100%;
        box-sizing: border-box;
    }
}


/* =========================================================
   FINAL MOBILE — الجولة
   سهم يسار ← select وسط → سهم يمين
   ========================================================= */
@media (max-width: 768px) {

    .competition-rounds-card {
        width: calc(100% - 24px);
        max-width: calc(100% - 24px);
        margin-inline: 12px;
        box-sizing: border-box;
    }

    .competition-rounds-card .competition-overview-card__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 62px;
        padding: 10px 14px;
        box-sizing: border-box;
        gap: 8px;
    }

    /*
     * لا نعتمد على position:absolute على السهمين هنا — flex +
     * space-between كافي، وبما أن السهمين متساويين بالحجم، القائمة
     * تضل بالمنتصف تلقائيًا بدون أي position معقّد.
     */
    .competition-rounds-header {
        width: 100% !important;
        min-height: 42px;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        direction: ltr;
    }

    .competition-round-selector {
        position: relative !important;
        display: inline-flex !important;
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

.competition-round-selector__trigger {
    display: flex;
    align-items: center;
   justify-content: space-between;

    width: 120px;
    height: 42px;
    padding: 0 14px;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background-color: #ffffff;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 12px;

    color: #111827;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    box-sizing: border-box;
    cursor: pointer;
}

    .competition-round-selector__arrow {
        order: 2;
    }

    .competition-round-selector__label {
        order: 1;
    }

    .competition-round-selector__list {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .competition-round-selector__label {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .competition-round-nav {
        position: static;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: 30px;
        height: 30px;
    }

    /* اليسار = الجولات القادمة، اليمين = الجولات السابقة */
    .competition-round-nav--next {
        order: -1;
    }

    .competition-round-nav--previous {
        order: 1;
    }

    .competition-round-nav--next::before {
        content: '‹';
        display: block;
        line-height: 1;
    }

    .competition-round-nav--previous::before {
        content: '›';
        display: block;
        line-height: 1;
    }

    /* إخفاء الرمز الأصلي حتى لا يظهر سهمان */
    .competition-round-nav {
        font-size: 0;
    }

    .competition-round-nav::before {
        font-size: 23px;
        font-weight: 800;
    }

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

/* إزالة الخط الفاصل أسفل هيدر الجولات */
.competition-rounds-card .competition-overview-card__header {
    border-bottom: none !important;
}

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

@media (max-width: 768px) {

    .competition-matches-content,
    .competition-standings-content {
        width: calc(100% - 0px);
        max-width: none;
        margin: 14px auto 0;
    }

}

.competition-rounds-card .competition-round-date {
    border: none !important;
    border-left: 1px solid #edf0f3 !important;
    border-right: 1px solid #edf0f3 !important;
    border-bottom: 1px solid #edf0f3 !important;
}

.competition-rounds-card .competition-round-matches {
    border-bottom: none !important;
    box-shadow: none !important;
}

.competition-rounds-card .competition-round-matches::before,
.competition-rounds-card .competition-round-matches::after {
    display: none !important;
    border: none !important;
    box-shadow: none !important;
}

.competition-round-date {
    position: relative;
    z-index: 2;
}

/* إزالة أي خط علوي فوق شريط التاريخ نهائيًا (حتى لو جاء من مصدر آخر) */
.competition-rounds-card .competition-round-date,
.competition-round-matches .competition-round-date {
    border-top: 0 none !important;
    box-shadow: none !important;
    outline: none !important;
}

.competition-rounds-card .competition-round-match,
.competition-round-matches .competition-round-match {
    box-shadow: none !important;
    outline: none !important;
}

.competition-rounds-card .competition-round-match {
    border-top: none !important;
}

.competition-rounds-card {
    position: relative;
}

.competition-rounds-card.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: .65;
    pointer-events: none;
    z-index: 20;
    animation: competitionRoundsLoading .45s ease-in-out infinite alternate;
}

@keyframes competitionRoundsLoading {
    from {
        opacity: .45;
    }

    to {
        opacity: .75;
    }
}

/* =========================================================
   French — Competition Rounds LTR
   ========================================================= */

.competition-rounds-card--fr .competition-rounds-header {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-selector {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-selector__trigger {
    direction: ltr;
    text-align: left;
    background-position: right 14px center;
}

.competition-rounds-card--fr .competition-round-selector__label {
    order: 1;
}

.competition-rounds-card--fr .competition-round-selector__list {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-selector__option {
    direction: ltr;
    text-align: center;
}

.competition-rounds-card--fr .competition-round-date {
    direction: ltr;
    text-align: left;
}

.competition-rounds-card--fr .competition-round-match {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-match__team--home {
    justify-content: flex-end;
}

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

.competition-rounds-card--fr .competition-round-match__team--away img {
    order: 0;
}

.competition-rounds-card--fr .competition-round-match__team--away span {
    order: 0;
}

/* =========================================================
   French — Matches tab / Full rounds card
   ========================================================= */

.competition-rounds-card--fr {
    direction: ltr;
}

.competition-rounds-card--fr .competition-rounds-header {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-nav--previous {
    order: 1;
}

.competition-rounds-card--fr .competition-round-selector {
    order: 2;
}

.competition-rounds-card--fr .competition-round-nav--next {
    order: 3;
}

.competition-rounds-card--fr .competition-round-date {
    direction: ltr;
    text-align: left;
}

.competition-rounds-card--fr .competition-round-match {
    direction: ltr;
}

.competition-rounds-card--fr .competition-round-match__team--home {
    justify-content: flex-end;
    text-align: right;
}

.competition-rounds-card--fr .competition-round-match__team--away {
    justify-content: flex-start;
    text-align: left;
}

.competition-rounds-card--fr .competition-round-match__score {
    direction: ltr;
}

/* =========================================================
   French — Mobile arrows
   ========================================================= */

@media (max-width: 768px) {

    .competition-rounds-card--fr .competition-round-nav--previous::before {
        content: '‹';
    }

    .competition-rounds-card--fr .competition-round-nav--next::before {
        content: '›';
    }

}