:root { 
    --aspi-tab-bg: #409fe1; 
    --aspi-tab-color: #FFF; 
}

.aspi_tabs_inner, .aspi_tabs_inner * {
    box-sizing: border-box !important;
}

.aspi_matchTabs .aspi_tab,
.aspi_lineupTeams .f_sq,
.aspi_lineupTeams .s_sq,
.aspi_mstaduim,
.aspi_staduim,
#aspi_evebody .aspi-event,
#aspi_evebody .aspi-event>div {
    font-family: "asp-font-kufi", "Droid Arabic Kufi", "Neo Sans Arabic", "Segoe UI";
}

.aspi_repflex {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
}

.aspi_matchTabs .aspi_tab {
    line-height: 1.2;
    font-size: 14px;
    padding: 13px 8px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-bottom: none;
    background-color: #ddd;
    transition: all .1s ease-in-out;
    flex: 1;
    margin-left: 0.25rem !important;
    font-weight: 700;
    color: #222 !important;
}

.aspi_matchTabs {
    display: flex;
    margin-bottom: 20px;
}

/* إصلاح الكود المكسور هنا الحاصل في التبويب النشط */
.aspi_matchTabs .aspi_tab.is-active {
    background-color: var(--aspi-tab-bg, #409fe1) !important; 
    color: var(--aspi-tab-color, #FFF) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* السطر الحاسم لمنع التكرار العمودي وإخفاء التبويبات غير النشطة */
.aspi_matchTabCon .aspi_tabs_content:not(.is-active) {
    display: none !important;
}

.aspi_title {
    margin: 0 0 15px;
    background: #f8f9fa;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    line-height: 1.2;
    color: #213c51;
    gap: 6px;
}

.f_sq .aspi_title {
    flex-direction: row-reverse;
}

.aspi_title img {
    max-width: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
}

.aspi_lineup {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.aspi_lineup .aspi-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.aspi_lineup .aspi-player-lnp {
    display: block;
    width: 100%;
    float: right;
    margin: 0 0 8px !important;
    overflow: hidden;
    height: auto;
    padding: 0 0 8px !important;
    border-bottom: solid 1px #eee;
    list-style: none !important;
}

.aspi_lineup .aspi-player-lnp:last-child {
    border: 0;
    margin: 0 !important;
}

.aspi_lineup .aspi-player-lnp div {
    flex: 1;
    text-align: left;
}

.aspi_lineup .aspi-player-lnp .f,
.aspi_lineup .aspi-player-lnp .s {
    display: flex;
    width: 100%;
    line-height: 1.4;
    font-size: 12px;
    color: #848484;
    position: relative;
    align-items: center;
    gap: 5px;
}

.aspi_lineup .aspi-player-lnp .f {
    text-align: right;
    flex-direction: row-reverse;
}

.aspi_lineup .aspi-player-lnp .f span {
    right: 0;
}

.aspi_lineup .aspi-player-lnp .f div {
    text-align: right;
}

.aspi_lineup .aspi-player-lnp .s span {
    color: #e93534;
}

.aspi_lineup .aspi-player-lnp span {
    color: #2196f3;
    font-weight: bold;
    padding: 5px;
    font-size: 17px;
    width: 30px;
}

.aspi_lineup .aspi-player-lnp b {
    display: block;
    color: #213c51;
    font-size: 14px;
}

.aspi_tmsForms {
    position: absolute;
    width: 100%;
    height: calc(50% + 10px);
    left: 0;
    display: flex;
    min-width: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    z-index: 40;
}

.aspi_tmsForms>.aspi_splan {
    font-size: 12px;
    position: absolute;
    left: 25px;
    top: 25px;
    background: #ffffff59;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1;
    color: #fff;
}

.aspi_tmsForms.visitant>.aspi_splan {
    top: auto;
    bottom: 25px;
    right: 25px;
    left: auto;
}

.aspi_tmsForms.visitant {
    bottom: 0;
}

.aspi_tmsForms>.DoneRows {
    display: flex;
    justify-content: space-around;
    min-width: 100%;
}

.aspi_tmsForms.visitant>.DoneRows.defens>.aspi_player:first-child,
.aspi_tmsForms.visitant>.DoneRows.defens>.aspi_player:last-child {
    bottom: 0;
    top: auto;
}

.aspi_tmsForms>.DoneRows.center {
    display: flex;
    justify-content: space-evenly;
}

.aspi_player {
    display: flex;
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    align-items: center;
    color: #fff;
    position: relative;
    line-height: 10px;
    flex-direction: column;
    justify-content: center;
}

.aspi_player>svg {
    width: 42px;
    height: 37px;
}

.aspi_player .pname {
    font-weight: 500;
    padding: 3px 0;
    color: #fff;
    display: block;
    overflow: hidden;
    line-height: 13px;
    font-size: 10px;
    position: relative;
    max-height: 25px;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 58px;
}

.aspi_player>span.pnum {
    position: absolute;
    top: 18px;
    font-weight: 700;
    letter-spacing: -1px;
}

.aspi_lineupTeams {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0;
    border-radius: 11px;
    margin: 15px 0;
}

.aspi_staduim {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 680px;
    border-radius: 4px;
    margin: auto;
    max-width: 450px;
}

.aspi_mstaduim, .aspi_staduim {
    width: 100%;
}

/* ==========================================================================
   START: MATCH EVENTS SECTION
   ========================================================================== */
#aspi_events {
    width: 100%;
    position: relative;
    min-height: 100px;
}

#aspi_events::after {
    content: "";
    position: absolute;
    width: 1px;
    left: 50%;
    top: 0;
    background-color: #e4e4e4;
    height: 100%;
}

#aspi_evebody {
    position: relative;
    min-height: 100px;
    z-index: 1;
    width: 100%;
}

#aspi_evebody::after, #aspi_evebody::before {
    content: "";
    width: 10px;
    height: 10px;
    position: absolute;
    left: 50%;
    margin-left: -5px;
    background-color: #00b746;
    border-radius: 50%;
}

#aspi_evebody::before {
    bottom: 0;
    background-color: #e70001;
}

#aspi_evebody::after {
    top: 0;
}

#aspi_evebody ul {
    list-style: none;
    margin: 33px 0;
    padding: 0;
    display: inline-block;
    width: 100%;
}

#aspi_evebody li {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 11px 0;
    float: right;
    text-align: center;
    border: 0;
}

#aspi_evebody li h3 {
    width: 123px;
    text-align: center;
    margin: 0 auto;
    line-height: 2;
    background-color: #f1f1f1;
    border: 1px solid #dadada;
    font-size: 12px;
    display: inline-block;
    padding: 0 12px 6px;
    border-radius: 16px;
}

#aspi_evebody li>span {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -16px;
    width: 32px;
    height: 32px;
    line-height: 28px;
    font-size: 13px;
    text-align: center;
    border: 2px solid #e4e4e4;
    background-color: #fff;
    border-radius: 50%;
    color: #f0a306;
}

#aspi_evebody li span.extra {
    line-height: 1.4;
}

#aspi_evebody li span b {
    font-weight: 700;
    color: #f0a306;
    display: block;
    line-height: .4;
    font-size: 10px;
}

#aspi_evebody li>div {
    width: 50%;
    margin: 0;
    clear: both;
    line-height: 27px;
}

#aspi_evebody div.l {
    float: left;
    padding-right: 18px;
    text-align: right;
}

#aspi_evebody div.r {
    float: right;
    padding-left: 18px;
    direction: ltr;
    text-align: left;
}

.aspi_evIcon {
    background-color: #fff!important;
    border: 1px solid #ddd!important;
    border-radius: 5px!important;
    width: 36px!important;
    height: 40px!important;
    padding: 4px;
}

.aspi_evHead {
    display: flex;
    align-items: center;
}

.aspi_evName {
    color: #1b8e26;
    padding: 0 5px;
}

.aspi_evMinute {
    font-weight: 600;
    color: #28333e;
    font-family: Tahoma;
}

.aspi_txt {
    color: #9a9a9a;
    font-size: 90%;
}

.aspi_switch_in .eveblock {
    margin-top: -36px;
    border-top: 0!important;
    padding-top: 0!important;
    border-top-right-radius: 0;
    padding-right: 22px;
    line-height: 1;
}

.aspi_switch_in .eveblock::after {
    display: none!important;
}

.aspi_switch_in .aspi_evIcon {
    display: none!important;
}

#aspi_evebody div.l img {
    display: inline-block!important;
    margin: 0 10px 0 5px;
}

#aspi_evebody div.r img {
    display: inline-block!important;
    margin: 0 5px 0 10px;
}

.aspi_eve_2 {
    background-color: #f8f9fa;
    padding: 20px 30px;
    border-radius: 10px;
}

#aspi_evebody .eveblock {
    background-color: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    padding: 12px 15px;
    position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
    transition: transform .2s ease, box-shadow .2s ease;
}

#aspi_evebody .eveblock:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

#aspi_evebody div.r .eveblock {
    background-color: #f9fcff;
    border-right: 4px solid #0085ba;
    border-left: 1px solid #e4e4e4;
}

#aspi_evebody div.r .eveblock::after {
    content: "";
    display: block;
    position: absolute;
    top: 20px;
    left: -7px;
    width: 14px;
    height: 14px;
    background: #f9fcff;
    border-left: 1px solid #e4e4e4;
    border-bottom: 1px solid #e4e4e4;
    transform: rotate(45deg);
}
.rtl #aspi_evebody div.l .eveblock {
    border-right: 1px solid #ddd;
    border-left: #dc3545 4px solid;
}
.rtl #aspi_evebody div.r .eveblock {
    border-left: 1px solid #ddd;
    border-right: #0085ba 4px solid;
}

#aspi_evebody div.l .eveblock::after {
    content: "";
    display: block;
    position: absolute;
    top: 20px;
    right: -7px;
    width: 14px;
    height: 14px;
    background: #fffafa;
    border-right: 1px solid #e4e4e4;
    border-top: 1px solid #e4e4e4;
    transform: rotate(45deg);
}

.aspi_lineupTeams .f_sq, .aspi_lineupTeams .s_sq {
    flex: 0 0 50%;
}

.soccer_field_svg {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    height: 100%!important;
    width: 100%!important;
}

.soccer_field {
    display: none;
}

/* التبديلات والشارات المضافة للنسخة النظيفة */
#aspi_evebody li.aspi-match-boundary {
    width: 100%;
    text-align: center;
    clear: both;
}

#aspi_evebody li.match-start {
    margin: 10px 0 25px 0;
}

#aspi_evebody li.match-end {
    margin: 25px 0 10px 0;
}

#aspi_evebody .boundary-badge {
    display: inline-block;
    background-color: transparent;
    padding: 6px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

#aspi_evebody li.match-start .boundary-badge {
    border: 2px solid #28a745;
    color: #28a745;
}

#aspi_evebody li.match-end .boundary-badge {
    border: 2px solid #dc3545;
    color: #dc3545;
}

.aspi_txt.aspi_sub_in {
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
    margin: 0 4px;
}

.aspi_txt.aspi_sub_out {
    color: #dc3545;
    font-weight: bold;
    font-size: 12px;
    margin: 0 4px;
}

.aspi_sub_in_s1 {
    color: #28a745;
    font-weight: bold;
    font-size: 11px;
    margin: 0 4px;
}

.aspi_sub_out_s1 {
    color: #dc3545;
    font-weight: bold;
    font-size: 11px;
    margin: 0 4px;
}

.aspi_action_badge, .aspi_action_badge_s1 {
    display: inline-block;
    margin: 0 6px;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid currentColor;
    opacity: 0.65;
    font-weight: normal;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================================== */
@media (min-width:768px) {
    .aspi_stad_2 .aspi_staduim .soccer_field_vert {
        display: none;
    }
    .aspi_stad_2 .aspi_staduim .soccer_field {
        display: block;
    }
    .aspi_eve_2 #aspi_evebody li>span {
        top: 10px;
    }
    .aspi_eve_2 #aspi_evebody div.r {
        padding-left: 40px;
    }
    .aspi_eve_2 #aspi_evebody div.l {
        padding-right: 40px;
    }
    .aspi_mstaduim {
        display: block;
        overflow: hidden;
        flex: 0 0 60%;
        max-width: 500px;
        padding: 0 20px;
    }
    .aspi_lineupTeams .f_sq, .aspi_lineupTeams .s_sq {
        flex: 1;
        max-width: 280px;
    }
    .aspi_stad_1 .f_sq {
        order: 1;
        margin-right: auto;
    }
    .aspi_stad_1 .aspi_mstaduim {
        order: 2;
    }
    .aspi_stad_1 .s_sq {
        order: 3;
        margin-left: auto;
    }
    .aspi_stad_2 .aspi_mstaduim {
        padding: 0;
        order: 1;
        flex: 0 0 100%;
        max-width: 100%;
        clear: both;
        margin: auto auto 20px;
        text-align: center;
    }
    .aspi_stad_2 .f_sq {
        padding-right: 20px;
        order: 2;
        flex: 0 0 50%!important;
        max-width: 360px;
        margin-left: auto;
    }
    .aspi_stad_2 .s_sq {
        padding-left: 20px;
        order: 3;
        flex: 0 0 50%!important;
        max-width: 360px;
        margin-right: auto;
    }
    .aspi_stad_2 {
        flex-wrap: wrap;
    }
    .aspi_stad_2 .aspi_staduim {
        min-width: 625px;
        height: 400px;
        max-width: 720px;
        margin-right: auto;
        margin-left: auto;
        width: 100%;
    }
    .aspi_stad_2 .aspi_tmsForms {
        position: absolute;
        height: 100%;
        width: calc(50% + 10px);
        right: 0;
        display: flex;
        min-width: calc(50% + 10px);
        flex-direction: row;
        justify-content: space-between;
        min-height: 100%;
        left: auto;
        bottom: 0;
        top: 0;
    }
    .aspi_stad_2 .aspi_tmsForms.visitant {
        bottom: 0;
        left: 0;
        right: auto;
    }
    .aspi_stad_2 .aspi_tmsForms>.DoneRows {
        min-width: 60px;
        min-height: 100%;
        flex-direction: column;
    }
    .aspi_stad_2 .aspi_tmsForms>.aspi_splan {
        right: 25px;
        left: auto;
        bottom: auto!important;
    }
    .aspi_stad_2 .aspi_tmsForms.visitant>.aspi_splan.aspi_splan {
        top: 25px;
        bottom: auto;
        right: auto;
        left: 25px;
    }
    .aspi_stad_3 .f_sq {
        padding-right: 20px;
        margin-left: auto;
    }
    .aspi_stad_3 .s_sq {
        padding-left: 20px;
        margin-right: auto;
    }
}

@media (max-width:769px) {
    .aspi_lineupTeams {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .aspi_mstaduim {
        margin: 0 0 20px;
        overflow: hidden;
        clear: both;
    }
    .aspi_staduim {
        height: 620px;
    }
    .aspi_lineupTeams .f_sq, .aspi_lineupTeams .s_sq {
        max-width: 360px;
        min-width: 50%;
        width: 50%;
        float: left;
    }
    .aspi-d-flex .aspi_title {
        flex-direction: column!important;
        align-items: center;
    }
    .f_sq {
        padding-left: 12px;
        margin-left: auto;
    }
    .s_sq {
        padding-right: 12px;
        margin-right: auto;
    }
    .aspi_lineupTeams .f_sq .aspi-player-lnp .f {
        flex-direction: row;
        text-align: right;
    }
    .aspi_lineupTeams .f_sq .aspi-player-lnp .f span {
        color: #2196f3;
        font-weight: bold;
        font-size: 17px;
        width: 30px;
        display: block;
        text-align: center;
    }
    .aspi_lineupTeams .s_sq .aspi-player-lnp .s {
        flex-direction: row-reverse;
        text-align: left;
    }
    .aspi_lineupTeams .s_sq .aspi-player-lnp .s span {
        color: #e93534;
        font-weight: bold;
        font-size: 17px;
        width: 30px;
        display: block;
        text-align: center;
    }
    .aspi_lineupTeams .f_sq .aspi-player-lnp .player_area {
        text-align: right;
    }
    .aspi_lineupTeams .s_sq .aspi-player-lnp .player_area {
        text-align: left;
    }
    .aspi_eve_2 {
        padding: 15px;
    }
    #aspi_evebody li>div {
        width: 50%;
        padding: 0 10px!important;
    }
    .aspi_eve_2 #aspi_evebody li>span {
        display: block;
        position: static;
        margin: 0 auto 10px;
        width: auto;
    }
    应当 #aspi_evebody li.aspi-match-boundary {
        width: 100% !important;
        float: none !important;
        display: block !important;
        text-align: center !important;
        margin: 15px 0 !important;
        clear: both !important;
    }
    #aspi_evebody li.aspi-match-boundary .boundary-badge {
        display: inline-block !important;
        width: auto !important;
        max-width: 90%;
        box-sizing: border-box;
    }
}

.aspi_stad_3 {
    flex-wrap: wrap!important;
}
.aspi_stad_3 .aspi_mstaduim {
    min-width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}
.EmptyFormate {
    color: #fff;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==========================================================================
   ADDED BACK: RTL DIRECTION RULES TO PREVENT VERTICAL OVERLAPS IN ARABIC
   ========================================================================== */
.rtl #aspi_evebody div.r {
    float: right;
    padding-left: 18px;
    padding-right: 0;
    direction: ltr;
    text-align: left;
}
.rtl #aspi_evebody div.l {
    float: left;
    padding-right: 18px;
    padding-left: 0;
    text-align: right;
}

.rtl #aspi_evebody div.l .eveblock::after {
    left: auto;
    right: -8px;
    transform: rotate(-135deg);
}
.rtl #aspi_evebody div.r .eveblock::after {
    right: auto;
    left: -8px;
    transform: rotate(45deg);
}
.rtl .aspi_lineup .aspi-player-lnp .f div {
    text-align: left;
}
.rtl .aspi_lineup .aspi-player-lnp div {
    text-align: right;
}
.rtl .aspi_stad_2 .f_sq, .rtl .aspi_stad_3 .f_sq {
    padding-left: 20px;
    padding-right: 0;
    margin-left: 0;
    margin-right: auto;
}
.rtl .aspi_stad_2 .s_sq, .rtl .aspi_stad_3 .s_sq {
    padding-right: 20px;
    padding-left: 0;
    margin-right: 0;
    margin-left: auto;
}

.aspi-d-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}
.aspi-d-flex .aspi_title {
    flex: 1;
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
}
.aspi-d-flex .aspi_title.awat-club {
    flex-direction: row-reverse;
}
.aspi-block-header {
    background-color: #dddddd;
    font-size: 20px;
    line-height: 26px;
    border-bottom: 2px solid #e2e8ee;
    text-transform: uppercase;
    word-spacing: 1px;
    margin-bottom: 10px;
    padding: 6px 10px;
    font-weight: 600;
}


.ltr #aspi_evebody div.l .eveblock {
    border-right: 1px solid #ddd;
    border-left: #dc3545 4px solid;
}
.ltr #aspi_evebody div.r .eveblock {
    border-left: 1px solid #ddd;
    border-right: #0085ba 4px solid;
}