/* ======================================================
   SIXSTATS MATCH PROFILE
   Load after styling2.1.css and language-switcher.css.
====================================================== */

.matchProfileShell {
    width: 100%;
    justify-content: center;
}

.matchProfilePage {
    width: 70vw !important;
    max-width: 72.92vw !important;
    margin: 2vw auto 4vw !important;
    padding: 1.4vw !important;

    color: var(--text-main);
    background: rgba(255,255,255,0.025) !important;
    border: 0.052vw solid rgba(255,255,255,0.10) !important;
    border-radius: 1vw !important;
    box-shadow: 0 0.8vw 2.2vw rgba(0,0,0,0.32) !important;
}

.matchProfilePage button,
.matchProfilePage input,
.matchProfilePage select {
    font-family: "Oswald", system-ui, sans-serif;
}

/* ======================================================
   MATCH HERO
====================================================== */

#matchProfileHero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.2vw;

    background:
        radial-gradient(
            circle at 50% -10%,
            rgba(135,206,250,0.17),
            transparent 29vw
        ),
        linear-gradient(
            135deg,
            rgba(255,255,255,0.045),
            rgba(255,255,255,0.012)
        ),
        var(--bg-card);

    border: 0.052vw solid rgba(135,206,250,0.20);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

#matchHeroTopBar {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1vw 1.2vw 0;
}

#matchProfileHero #backButton {
    width: 2.7vw;
    height: 2.7vw;
    min-width: 2.7vw;
    min-height: 2.7vw;
    margin: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--accent);
    background: rgba(135,206,250,0.12);
    border: 0.052vw solid rgba(135,206,250,0.28);
    border-radius: 50vw;

    font-size: 0.9vw;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

#matchProfileHero #backButton:hover {
    transform: translateY(-0.12vw);
    background: rgba(135,206,250,0.20);
    border-color: rgba(135,206,250,0.50);
}

#matchProfileType {
    display: inline-flex;
    align-items: center;
    gap: 0.5vw;
    padding: 0.42vw 0.72vw;

    color: var(--text-muted);
    background: rgba(15,17,21,0.58);
    border: 0.052vw solid var(--border-soft);
    border-radius: 50vw;

    font-size: 0.7vw;
    letter-spacing: 0.045vw;
    text-transform: uppercase;
}

#matchProfileStatusDot {
    width: 0.46vw;
    height: 0.46vw;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 0.2vw rgba(74,222,128,0.11);
}

#matchHeroLayout {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 10.5vw minmax(0, 1fr);
    gap: 1.6vw;
    align-items: center;

    padding: 1vw 3vw 1.5vw;
}

.matchHeroTeam {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65vw;
    color: var(--text-main);
    text-align: center;
}

.matchHeroLogoFrame {
    width: 10vw;
    height: 10vw;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at 50% 38%,
            rgba(135,206,250,0.14),
            transparent 58%
        ),
        rgba(15,17,21,0.52);

    border: 0.052vw solid rgba(255,255,255,0.09);
    border-radius: var(--radius);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.matchHeroTeam:hover .matchHeroLogoFrame {
    transform: translateY(-0.14vw);
    border-color: rgba(135,206,250,0.35);
    background:
        radial-gradient(
            circle at 50% 38%,
            rgba(135,206,250,0.20),
            transparent 58%
        ),
        rgba(15,17,21,0.60);
}

.matchProfilePage .mapStatsTeamLogos {
    width: 6.8vw;
    height: 6.8vw;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    filter: drop-shadow(0 0.65vw 1vw rgba(0,0,0,0.38));
}

.matchHeroTeamName {
    max-width: 15vw;
    overflow: hidden;
    color: var(--text-main);
    font-size: 1.12vw;
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matchHeroTeam.isLoser {
    opacity: 0.68;
}

.matchHeroTeam.isWinner .matchHeroLogoFrame {
    border-color: rgba(135,206,250,0.34);
    box-shadow:
        inset 0 0 1.3vw rgba(135,206,250,0.045),
        0 0.8vw 1.8vw rgba(0,0,0,0.22);
}

#matchHeroScorePanel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#matchHeroFormat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2vw;
    margin-bottom: 0.7vw;
    padding: 0.3vw 0.55vw;

    color: var(--accent);
    background: rgba(135,206,250,0.08);
    border: 0.052vw solid rgba(135,206,250,0.20);
    border-radius: 50vw;
    font-size: 0.65vw;
    letter-spacing: 0.04vw;
}

.matchProfilePage #mapsStatsScore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7vw;
    margin: 0;
    color: var(--text-main);
    font-size: 3.35vw;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.matchProfilePage #mapsStatsScore small {
    color: var(--text-muted);
    font-size: 1.35vw;
    font-weight: 300;
}

.winningTeamMatchScore {
    color: var(--accent);
}

.matchProfilePage .losingTeamMapScore {
    color: var(--text-muted);
}

#matchHeroVersus {
    width: 100%;
    margin: 0.65vw 0 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.68vw;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#matchHeroMeta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8vw;
    padding: 0.9vw 1.2vw;

    background: rgba(15,17,21,0.42);
    border-top: 0.052vw solid rgba(255,255,255,0.065);
}

.matchProfilePage #mapsStatsEvent,
.matchProfilePage #mapsStatsDate {
    width: auto;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45vw;
    color: var(--text-muted);
    font-size: 0.78vw;
}

.matchProfilePage #mapsStatsEvent {
    color: var(--text-main);
    transition: color 0.18s ease;
}

.matchProfilePage #mapsStatsEvent:hover {
    color: var(--accent);
}

.matchProfilePage #qualifiesToLogo {
    width: 1.45vw;
    height: 1.45vw;
    margin: 0;
    object-fit: contain;
}

.matchProfilePage #mapsStatsDate i {
    color: var(--accent);
}

#matchMetaDivider {
    width: 0.22vw;
    height: 0.22vw;
    background: rgba(255,255,255,0.28);
    border-radius: 50%;
}

/* ======================================================
   SHARED SECTION CARDS
====================================================== */

.matchProfileSection {
    margin-top: 2.2vw;
    padding: 1.2vw;
    background: rgba(255,255,255,0.018);
    border: 0.052vw solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    background-color: var(--bg-card);
}

.matchSectionHeader {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1vw;
    margin-bottom: 0.9vw;
}

.matchSectionHeader h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.35vw;
    font-weight: 600;
    line-height: 1.1;
}

.matchSectionEyebrow {
    display: block;
    margin-bottom: 0.28vw;
    color: var(--accent);
    font-size: 0.66vw;
    font-weight: 600;
    letter-spacing: 0.09vw;
    text-transform: uppercase;
}

.matchSectionCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2vw;
    height: 1.75vw;
    padding: 0 0.55vw;

    color: var(--text-muted);
    background: rgba(15,17,21,0.55);
    border: 0.052vw solid var(--border-soft);
    border-radius: 50vw;
    font-size: 0.66vw;
}

/* ======================================================
   MAP RESULTS
====================================================== */

.matchProfilePage #matchmapscontainer {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1vw;
    margin: 1vw 0 2vw;
}

.matchProfilePage .matchmapdiv {
    position: relative;
    overflow: hidden;
    min-height: 10vw;
    padding: 0.9vw;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.matchProfilePage .matchmapdiv::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.35),
        rgba(0,0,0,0.55)
    );
    pointer-events: none;
}

.matchProfilePage .matchmapdiv > * {
    position: relative;
    z-index: 1;
}

.matchProfilePage .mapscore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6vw;

    color: var(--text-main);
    background: rgba(15,17,21,0.65);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;

    width: fit-content;
    margin: 0 auto;
    margin-top: 2vw;
    padding: 0.35vw 0.7vw;
    font-size: 1vw;
    font-variant-numeric: tabular-nums;
}

.matchProfilePage .mapteamlogo {
    width: auto;
    height: 1.6vw;
    min-height: 20px;
    object-fit: contain;
}

.matchProfilePage .maptitle {
    text-align: center;
    font-size: 1vw;
    color: var(--accent);
    margin-top: 0.6vw;
    padding: 0.35vw 0.7vw;

    background: rgba(15,17,21,0.65);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
}

.matchMapsEmpty {
    grid-column: 1 / -1;
    min-height: 7vw;
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-muted);
    background: var(--bg-card);
    border: 0.052vw dashed rgba(135,206,250,0.24);
    border-radius: var(--radius-sm);
    font-size: 0.8vw;
}

/* ======================================================
   PLAYER STATISTICS + TOGGLE
====================================================== */

.matchProfilePage #sortbyteamcontainer {
    margin: 0 0 0.9vw;
    padding: 0.75vw 0.9vw;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1vw;

    background: var(--bg-secondary);
    border: 0.052vw solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.matchProfilePage #sortbyteamtitle {
    margin: 0;
    color: var(--text-main);
    font-size: 0.88vw;
    font-weight: 500;
}

.matchProfilePage .switch {
    width: 2.7vw;
    height: 1.45vw;
    min-width: 2.7vw;
    min-height: 1.45vw;
}

.matchProfilePage .slider {
    border: 0.052vw solid var(--border-soft);
}

.matchProfilePage .slider::before {
    width: 1.05vw;
    height: 1.05vw;
    min-width: 1.05vw;
    min-height: 1.05vw;
    left: 0.17vw;
    bottom: 0.15vw;
}

.matchProfilePage .switch input:checked + .slider::before {
    transform: translateX(1.22vw);
}

.matchProfilePage #mapsContainer,
.matchProfilePage #sortedTeamsDivMapsStats {
    width: 100%;
    overflow-x: auto;
    margin: 0;
    padding-bottom: 0.15vw;
    scrollbar-color: rgba(135,206,250,0.34) rgba(255,255,255,0.04);
    scrollbar-width: thin;
}

.matchProfilePage #sortedTeamsDivMapsStats {
    display: none;
}

.matchProfilePage .teamSortDiv {
    margin: 0 0 0.9vw;
}

.matchProfilePage .teamSortDiv:last-child {
    margin-bottom: 0;
}

.matchProfilePage #statstable {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    overflow: hidden;
    background: transparent;
    border: 0.052vw solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.matchProfilePage #statstable caption {
    padding: 0.8vw;
    color: var(--text-main);
    background: var(--bg-secondary);
    border: 0.052vw solid var(--border-soft);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.88vw;
    text-align: left;
}

.matchProfilePage #statstable th {
    padding: 0.8vw;
    color: var(--text-main);
    background: var(--bg-secondary);
    border-bottom: 0.052vw solid var(--border-soft);
    font-size: 0.85vw;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.matchProfilePage #statstable td {
    padding: 0.78vw;
    color: var(--text-muted);
    border-bottom: 0.052vw solid rgba(255,255,255,0.055);
    font-size: 0.85vw;
    line-height: 1.25;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.matchProfilePage #statstable tbody tr:last-child td {
    border-bottom: 0;
}

.matchProfilePage #statstable tbody tr {
    transition: background 0.15s ease;
}

.matchProfilePage #statstable tbody tr:hover {
    background: rgba(135,206,250,0.055);
}

.matchProfilePage #playerprofilelink {
    color: var(--text-main);
    transition: color 0.16s ease;
}

.matchProfilePage #playerprofilelink:hover {
    color: var(--accent);
    text-decoration: underline;
}

.matchProfilePage #playerEventLogo {
    display: inline-block;
    width: 1.8vw;
    height: 1.8vw;
    min-width: 1.25vw;
    min-height: 1.25vw;
    margin: 0 0.4vw 0 0;
    object-fit: contain;
    vertical-align: middle;
}

.matchProfilePage .kddiff {
    color: var(--accent);
}

.matchProfilePage .playerEventOpsDiv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25vw;
}

.matchProfilePage #playerOperatorLogo,
.matchProfilePage .statsopimg {
    width: 2.2vw;
    height: 2.2vw;
    min-width: 0;
    min-height: 0;
    margin: 0 auto;
    object-fit: contain;
}

.matchProfilePage #teamsSortedLogo {
    display: inline-block;
    width: 1.8vw;
    height: 1.8vw;
    min-width: 1.25vw;
    min-height: 1.25vw;
    margin: 0 0 0 0.4vw;
    object-fit: contain;
    vertical-align: middle;
}

/* ======================================================
   ADMIN EDIT ACTION
====================================================== */

.matchProfilePage #editMatchStatsDiv {
    margin: 1vw 0 0;
    display: flex;
    justify-content: flex-end;
}

.matchProfilePage #editMatchStatsBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55vw 0.9vw;

    color: var(--accent);
    background: rgba(135,206,250,0.10);
    border: 0.052vw solid rgba(135,206,250,0.28);
    border-radius: 50vw;

    font-size: 0.75vw;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.matchProfilePage #editMatchStatsBtn:hover {
    transform: translateY(-0.1vw);
    background: rgba(135,206,250,0.18);
    border-color: rgba(135,206,250,0.45);
}

/* ======================================================
   TABLET
====================================================== */

@media (max-width: 1024px) {
    .matchProfilePage {
        width: 92vw !important;
        max-width: 92vw !important;
    }

    .matchProfilePage #matchmapscontainer {
        grid-template-columns: repeat(3, 1fr);
    }

    .matchProfilePage .matchmapdiv {
        min-height: 13vw;
    }

    .matchProfilePage #statstable {
        min-width: 980px;
    }
}

/* ======================================================
   MOBILE
====================================================== */

@media (max-width: 768px) {
    .matchProfileShell {
        padding: 14px 0;
    }

    .matchProfilePage {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 0 auto 24px !important;
        padding: 10px !important;

        border: 1px solid rgba(255,255,255,0.10) !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 30px rgba(0,0,0,0.30) !important;
    }

    #matchProfileHero {
        margin-bottom: 10px;
        border: 1px solid rgba(135,206,250,0.20);
        border-radius: 14px;
    }

    #matchHeroTopBar {
        padding: 12px 12px 0;
    }

    #matchProfileHero #backButton {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        border-width: 1px;
        font-size: 15px;
    }

    #matchProfileType {
        gap: 7px;
        padding: 7px 10px;
        border-width: 1px;
        font-size: 10px;
        letter-spacing: 0.6px;
    }

    #matchProfileStatusDot {
        width: 7px;
        height: 7px;
    }

    #matchHeroLayout {
        grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
        gap: 8px;
        padding: 16px 10px 18px;
    }

    .matchHeroTeam {
        gap: 8px;
    }

    .matchHeroLogoFrame {
        width: 82px;
        height: 82px;
        border-width: 1px;
        border-radius: 12px;
    }

    .matchProfilePage .mapStatsTeamLogos {
        width: 56px;
        height: 56px;
    }

    .matchHeroTeamName {
        max-width: 110px;
        font-size: 14px;
        white-space: normal;
    }

    #matchHeroFormat {
        min-width: 44px;
        margin-bottom: 8px;
        padding: 5px 7px;
        border-width: 1px;
        font-size: 10px;
    }

    .matchProfilePage #mapsStatsScore {
        gap: 7px;
        font-size: 32px;
    }

    .matchProfilePage #mapsStatsScore small {
        font-size: 15px;
    }

    #matchHeroVersus {
        display: none;
    }

    #matchHeroMeta {
        flex-wrap: wrap;
        gap: 7px 10px;
        padding: 10px 12px;
        border-top-width: 1px;
    }

    .matchProfilePage #mapsStatsEvent,
    .matchProfilePage #mapsStatsDate {
        gap: 6px;
        font-size: 12px;
    }

    .matchProfilePage #qualifiesToLogo {
        width: 21px;
        height: 21px;
    }

    #matchMetaDivider {
        width: 4px;
        height: 4px;
    }

    .matchProfileSection {
        margin-top: 10px;
        padding: 10px;
        border-width: 1px;
        border-radius: 14px;
    }

    .matchSectionHeader {
        gap: 10px;
        margin-bottom: 10px;
    }

    .matchSectionHeader h2 {
        font-size: 19px;
    }

    .matchSectionEyebrow {
        margin-bottom: 4px;
        font-size: 10px;
        letter-spacing: 0.8px;
    }

    .matchSectionCount {
        min-width: 34px;
        height: 27px;
        padding: 0 8px;
        border-width: 1px;
        font-size: 11px;
    }

    .matchProfilePage #matchmapscontainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 10px 0 16px;
    }

    .matchProfilePage .matchmapdiv {
        min-height: 140px;
        padding: 10px;
        border-width: 1px;
        border-radius: 14px;
    }

    .matchProfilePage .mapteamlogo {
        width: auto;
        height: 20px;
        min-height: 20px;
    }

    .matchProfilePage .mapscore,
    .matchProfilePage .maptitle {
        padding: 6px 10px;
        border-width: 1px;
        font-size: 12px;
    }

    .matchMapsEmpty {
        min-height: 110px;
        border-width: 1px;
        border-radius: 10px;
        font-size: 13px;
    }

    .matchProfilePage #sortbyteamcontainer {
        margin-bottom: 9px;
        padding: 10px 11px;
        border-width: 1px;
        border-radius: 10px;
    }

    .matchProfilePage #sortbyteamtitle {
        font-size: 13px;
    }

    .matchProfilePage .switch {
        width: 46px;
        height: 26px;
        min-width: 46px;
        min-height: 26px;
    }

    .matchProfilePage .slider::before {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        left: 3px;
        bottom: 2px;
    }

    .matchProfilePage .switch input:checked + .slider::before {
        transform: translateX(19px);
    }

    .matchProfilePage #mapsContainer,
    .matchProfilePage #sortedTeamsDivMapsStats {
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .matchProfilePage #statstable {
        display: block;
        min-width: 980px;
        overflow-x: auto;
        border-width: 1px;
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .matchProfilePage #statstable caption {
        padding: 10px 11px;
        border-width: 1px;
        font-size: 13px;
    }

    .matchProfilePage #statstable th,
    .matchProfilePage #statstable td {
        padding: 9px 9px;
        border-bottom-width: 1px;
        font-size: 12px;
    }

    .matchProfilePage #playerEventLogo {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .matchProfilePage #playerOperatorLogo,
    .matchProfilePage .statsopimg {
        width: 27px;
        height: 27px;
    }

    .matchProfilePage #teamsSortedLogo {
        width: 24px;
        height: 24px;
        margin-left: 6px;
    }

    .matchProfilePage #editMatchStatsDiv {
        margin-top: 10px;
    }

    .matchProfilePage #editMatchStatsBtn {
        padding: 9px 13px;
        border-width: 1px;
        font-size: 12px;
    }
}

@media (max-width: 440px) {
    #matchHeroLayout {
        grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
        gap: 5px;
    }

    .matchHeroLogoFrame {
        width: 70px;
        height: 70px;
    }

    .matchProfilePage .mapStatsTeamLogos {
        width: 48px;
        height: 48px;
    }

    .matchHeroTeamName {
        max-width: 94px;
        font-size: 12px;
    }

    .matchProfilePage #mapsStatsScore {
        font-size: 28px;
    }
}