/* Team page — matches sidebar (dark + light, RTL/LTR) */

#match_list_conf:has(.matches-wrapper.wide) {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section blocks */
#match_list_conf > .matches-wrapper.wide {
    background: #151825;
    border: 1px solid #1e2235;
    border-radius: 16px;
    padding: 18px 16px 14px;
    margin-bottom: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* Section titles */
#match_list_conf .matches-top-title {
    margin: 0 0 14px;
    padding: 0 0 12px;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    text-align: right;
    background: none;
    border-bottom: 1px solid #1e2235;
    letter-spacing: 0.01em;
}

/* League / date header */
#match_list_conf .matches-week-title.two-rows-title {
    margin: 0 0 6px;
    min-height: 34px;
    height: auto;
    padding: 6px 12px;
    background: rgba(90, 131, 255, 0.1);
    border: 1px solid rgba(90, 131, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #8fa4e8;
}

#match_list_conf .matches-week-title.two-rows-title .champ-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    transition: color 0.2s ease;
}

#match_list_conf .matches-week-title.two-rows-title .champ-title:hover {
    color: #39dbbf;
}

#match_list_conf .matches-week-title.two-rows-title .champ-title b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

#match_list_conf .matches-week-title.two-rows-title .champ-title .img {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

#match_list_conf .matches-week-title.two-rows-title .champ-title .img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#match_list_conf .matches-week-title.two-rows-title .date {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #707488;
    margin-right: auto;
}

/* Inner match list wrapper */
#match_list_conf .matches-wrapper.wide > .matches-wrapper {
    margin-bottom: 0;
}

#match_list_conf .matches-wrapper.wide > .matches-wrapper + .matches-week-title,
#match_list_conf #coming_match_load > .matches-week-title + .ajax-match-item ~ .matches-week-title,
#match_list_conf #end_match_load > .matches-week-title + .ajax-match-item ~ .matches-week-title,
#match_list_conf #postponed_match_load > .matches-week-title + .ajax-match-item ~ .matches-week-title {
    margin-top: 10px;
}

/* Match cards — default (upcoming / ended) */
#match_list_conf .inline-match-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 62px;
    margin-bottom: 4px;
    padding: 12px 14px;
    background: #191d2d;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

#match_list_conf .inline-match-item:last-child {
    margin-bottom: 0;
}

#match_list_conf .inline-match-item:hover {
    background: #1e2438;
    border-color: rgba(57, 219, 191, 0.15);
}

#match_list_conf .inline-match-item .first-team,
#match_list_conf .inline-match-item .second-team {
    flex: 1 1 0;
    min-width: 0;
}

#match_list_conf .inline-match-item .first-team .team---item,
#match_list_conf .inline-match-item .second-team .team---item {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bfc3d4;
    font-size: 12px;
}

#match_list_conf .inline-match-item .first-team .team---item b,
#match_list_conf .inline-match-item .second-team .team---item b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    color: #d8dbe8;
    transition: color 0.2s ease;
}

#match_list_conf .inline-match-item:hover .team---item b {
    color: #fff;
}

#match_list_conf .inline-match-item .first-team .team---item {
    justify-content: flex-end;
}

#match_list_conf .inline-match-item .second-team .team---item {
    justify-content: flex-start;
}

#match_list_conf .inline-match-item .first-team .img,
#match_list_conf .inline-match-item .second-team .img {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
}

#match_list_conf .inline-match-item .first-team .img img,
#match_list_conf .inline-match-item .second-team .img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Score / time badge */
#match_list_conf .inline-match-item .result-wrap {
    flex: 0 0 auto;
    width: auto;
    min-width: 68px;
    max-width: 100px;
    margin: 0 12px !important;
    padding: 6px 10px;
    height: auto;
    min-height: 30px;
    background: #12151f;
    border: 1px solid #252a3d;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
}

/* Ended matches with status label above score row */
#match_list_conf .inline-match-item .result-wrap:has(.result-status-text):not(:has(> .first-team-result)) {
    flex-direction: column;
    gap: 2px;
}

#match_list_conf .inline-match-item .result-wrap .first-team-result,
#match_list_conf .inline-match-item .result-wrap .second-team-result {
    font-size: 13px;
    font-weight: 800;
    min-width: 14px;
    text-align: center;
    line-height: 1;
}

#match_list_conf .inline-match-item .result-wrap > i {
    font-style: normal;
    color: #505668;
    font-weight: 400;
    font-size: 12px;
    line-height: 1;
}

#match_list_conf .inline-match-item.match-with-result .result-wrap .match-date {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    letter-spacing: 0.02em;
}

#match_list_conf .inline-match-item.match-with-result .result-wrap i,
#match_list_conf .inline-match-item.match-with-result .result-wrap .match-date i {
    margin: 0;
    font-style: normal;
    color: #505668;
    font-weight: 400;
}

#match_list_conf .inline-match-item.match-with-result .result-wrap .first-team-result.winner,
#match_list_conf .inline-match-item.match-with-result .result-wrap .second-team-result.winner {
    color: #39dbbf;
}

#match_list_conf .inline-match-item.match-with-result .result-wrap .first-team-result.loser,
#match_list_conf .inline-match-item.match-with-result .result-wrap .second-team-result.loser {
    color: rgba(255, 255, 255, 0.4);
}

#match_list_conf .inline-match-item .result-wrap .result-status-text {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    display: block;
    font-size: 9px;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    text-align: center;
    color: #707488;
    font-weight: 600;
}

#match_list_conf .inline-match-item .result-wrap .result-status-text.match-status-cancelled {
    color: #fc4d4d;
}

/* Live / active matches */
#match_list_conf .inline-match-item.active-match {
    min-height: 80px;
    padding: 16px 14px;
    background: linear-gradient(135deg, #191d2d 0%, #1a2035 100%);
    border-color: rgba(252, 77, 77, 0.2);
    flex-wrap: wrap;
}

#match_list_conf .inline-match-item.active-match.live-match {
    border-color: rgba(252, 77, 77, 0.35);
    box-shadow: 0 0 0 1px rgba(252, 77, 77, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#match_list_conf .inline-match-item.active-match.stopped-match {
    border-color: rgba(255, 196, 32, 0.25);
}

#match_list_conf .inline-match-item.active-match .match-team-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#match_list_conf .inline-match-item.active-match .match-team-item.first-team {
    justify-content: flex-end;
}

#match_list_conf .inline-match-item.active-match .match-team-item.second-team {
    justify-content: flex-start;
}

#match_list_conf .inline-match-item.active-match .match-team-item .team---item {
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

#match_list_conf .inline-match-item.active-match .match-team-item .team---item b {
    font-size: 10px;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#match_list_conf .inline-match-item.active-match .match-team-item .img {
    width: 32px;
    height: 32px;
    margin: 0 !important;
}

#match_list_conf .inline-match-item.active-match .team-result {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    min-width: 22px;
    text-align: center;
}

#match_list_conf .inline-match-item.active-match .team-result.winner {
    color: #39dbbf;
}

#match_list_conf .inline-match-item.active-match .team-result.loser {
    color: rgba(255, 255, 255, 0.45);
}

#match_list_conf .inline-match-item.active-match .active-match-progress {
    margin: 0 10px;
    flex: 0 0 auto;
}

#match_list_conf .inline-match-item.active-match .result-status-text.live-match-status {
    position: static !important;
    bottom: auto !important;
    top: auto !important;
    transform: none !important;
    font-size: 9px;
    font-weight: 700;
    color: #fc4d4d;
    margin-top: 4px;
    text-align: center;
}

/* Quick action icons */
#match_list_conf .inline-match-item .active-match-quick-links {
    position: absolute;
    left: 8px;
    bottom: 6px;
    top: auto;
    transform: none;
}

#match_list_conf .inline-match-item .active-match-quick-link {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(25, 29, 45, 0.9);
    border: 1px solid #2a3048;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#match_list_conf .inline-match-item .active-match-quick-link:hover {
    background: #252b42;
    border-color: rgba(57, 219, 191, 0.3);
}

/* Penalties row */
#match_list_conf .inline-match-item .penalties-wrapper {
    margin-top: 12px;
    padding: 0 10px;
}

/* Show more button */
#match_list_conf .show-more-matches.view-all-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    margin-top: 10px;
    padding: 0 16px;
    background: transparent;
    border: 1px dashed #2a3048;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #707488;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#match_list_conf .show-more-matches.view-all-button:hover {
    color: #39dbbf;
    border-color: rgba(57, 219, 191, 0.4);
    background: rgba(57, 219, 191, 0.05);
}

/* ── Light mode ── */
html.light #match_list_conf > .matches-wrapper.wide {
    background: #fff;
    border-color: #e8ebf2;
    box-shadow: 0 2px 16px rgba(19, 21, 33, 0.06);
}

html.light #match_list_conf .matches-top-title {
    color: #131521;
    border-bottom-color: #eef1f8;
}

html.light #match_list_conf .matches-week-title.two-rows-title {
    background: rgba(90, 131, 255, 0.08);
    border-color: rgba(90, 131, 255, 0.12);
    color: #4a5f9e;
}

html.light #match_list_conf .matches-week-title.two-rows-title .date {
    color: #505668;
}

html.light #match_list_conf .inline-match-item {
    background: #f4f6fb;
}

html.light #match_list_conf .inline-match-item:hover {
    background: #eef1f8;
    border-color: rgba(57, 219, 191, 0.25);
}

html.light #match_list_conf .inline-match-item .first-team .team---item b,
html.light #match_list_conf .inline-match-item .second-team .team---item b {
    color: #2a3142;
}

html.light #match_list_conf .inline-match-item:hover .team---item b {
    color: #131521;
}

html.light #match_list_conf .inline-match-item .first-team .img,
html.light #match_list_conf .inline-match-item .second-team .img {
    background: #fff;
}

html.light #match_list_conf .inline-match-item .result-wrap {
    background: #fff;
    border-color: #e0e4ef;
}

html.light #match_list_conf .inline-match-item.match-with-result .result-wrap .match-date {
    color: #131521;
}

html.light #match_list_conf .inline-match-item.match-with-result .result-wrap .first-team-result.loser,
html.light #match_list_conf .inline-match-item.match-with-result .result-wrap .second-team-result.loser {
    color: rgba(19, 21, 33, 0.4);
}

html.light #match_list_conf .inline-match-item.active-match {
    background: linear-gradient(135deg, #f4f6fb 0%, #eef1f8 100%);
}

html.light #match_list_conf .inline-match-item.active-match .team-result {
    color: #131521;
}

html.light #match_list_conf .inline-match-item.active-match .team-result.loser {
    color: rgba(19, 21, 33, 0.4);
}

html.light #match_list_conf .show-more-matches.view-all-button {
    border-color: #d8dce8;
    color: #505668;
}

html.light #match_list_conf .show-more-matches.view-all-button:hover {
    border-color: rgba(57, 219, 191, 0.5);
    color: #1a9e88;
    background: rgba(57, 219, 191, 0.06);
}

/* ── LTR: logo + name side by side (home / team / championship) ── */
html[dir="ltr"] #match_list_conf .matches-top-title {
    text-align: left;
}

/* Default match row: crests face the score in the middle */
html[dir="ltr"] #match_list_conf .inline-match-item .first-team {
    text-align: left;
}

html[dir="ltr"] #match_list_conf .inline-match-item .second-team {
    text-align: right;
}

html[dir="ltr"] #match_list_conf .inline-match-item .first-team .team---item {
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

html[dir="ltr"] #match_list_conf .inline-match-item .second-team .team---item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

html[dir="ltr"] #match_list_conf .inline-match-item .first-team .img,
html[dir="ltr"] #match_list_conf .inline-match-item .second-team .img {
    margin: 0 !important;
    flex: 0 0 28px;
    order: 0;
}

html[dir="ltr"] #match_list_conf .inline-match-item .first-team .team---item b,
html[dir="ltr"] #match_list_conf .inline-match-item .second-team .team---item b {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    order: 0;
}

html[dir="ltr"] #match_list_conf .inline-match-item {
    padding-right: 34px;
}

html[dir="ltr"] #match_list_conf .inline-match-item .result-wrap {
    margin: 0 8px !important;
    flex-shrink: 0;
}

/* Live matches — horizontal logo + name (not stacked) */
html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item {
    gap: 6px;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item.first-team {
    justify-content: flex-end;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item.second-team {
    justify-content: flex-start;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item .team---item,
html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item a {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item .team---item {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    text-align: left;
    margin: 0 !important;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item.second-team .team---item {
    flex-direction: row;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item .team---item b {
    max-width: none;
    font-size: 11px;
    text-align: left;
}

html[dir="ltr"] #match_list_conf .inline-match-item.active-match .match-team-item .img {
    width: 26px;
    height: 26px;
    margin: 0 !important;
}

html[dir="ltr"] #match_list_conf .matches-week-title.two-rows-title .date {
    margin-right: 0;
    margin-left: auto;
}

html[dir="ltr"] #match_list_conf .matches-week-title.two-rows-title .champ-title .img {
    margin-right: 6px;
    margin-left: 0;
}

html[dir="ltr"] #match_list_conf .inline-match-item .active-match-quick-links {
    left: auto;
    right: 6px;
    bottom: 6px;
    top: auto;
    transform: none;
}

/* Championship header row — LTR */
html[dir="ltr"] #match_list_conf .matches-wrapper .header {
    padding: 9px 12px 7px 14px;
    gap: 8px;
}

html[dir="ltr"] #match_list_conf .matches-wrapper .header .champ-title {
    min-width: 0;
    flex: 1 1 0;
    max-width: 48%;
}

html[dir="ltr"] #match_list_conf .matches-wrapper .header .champ-title b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="ltr"] #match_list_conf .matches-wrapper .header .champ-title .img {
    margin-right: 8px !important;
    margin-left: 0 !important;
    flex-shrink: 0;
}

html[dir="ltr"] #match_list_conf .matches-wrapper .header .champ-actions {
    margin-left: auto !important;
    margin-right: 0 !important;
    gap: 10px;
    flex-shrink: 0;
}

html[dir="ltr"] #match_list_conf .champ-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

html[dir="ltr"] #match_list_conf .champ-links a {
    margin: 0 !important;
    white-space: nowrap;
    font-size: 11px;
}

html[dir="ltr"] #match_list_conf .champ-settings-dropdown-wrap {
    margin-left: 6px !important;
    margin-right: 0 !important;
}

/* ── Responsive (tablet) ── */
@media (max-width: 1199px) {
    #match_list_conf .inline-match-item .first-team .team---item b,
    #match_list_conf .inline-match-item .second-team .team---item b {
        max-width: 90px;
    }

    html[dir="ltr"] #match_list_conf .inline-match-item .first-team .team---item b,
    html[dir="ltr"] #match_list_conf .inline-match-item .second-team .team---item b {
        max-width: none;
    }

    html[dir="ltr"] #match_list_conf .matches-wrapper .header .champ-title {
        max-width: 42%;
    }
}

@media (max-width: 991px) {
    #match_list_conf {
        gap: 12px;
    }

    #match_list_conf > .matches-wrapper.wide {
        padding: 14px 12px 12px;
        border-radius: 12px;
    }

    #match_list_conf .inline-match-item {
        min-height: 56px;
        padding: 10px 10px;
    }

    #match_list_conf .inline-match-item .result-wrap {
        min-width: 56px;
        margin: 0 8px !important;
        padding: 5px 8px;
    }
}
