/**
 * HLTV Match Stats — AdriaZone
 * ----------------------------------------------------------------
 * Companion to [hltv_match_card]. Per-team player stats card for
 * embedding inline in news articles. Same palette and corner radii
 * so it stacks cleanly under (or above) the match card.
 *
 * v1.1 — Each team is now its own card with a gap between them
 *        (was a single card with internal divider).
 *
 * Palette (matches the rest of the site):
 *   #0d1117 darkest     #161a21 panel       #1c2333 inset
 *   #21262d divider     #30363d border      #6e7681 muted
 *   #8fa3b3 sub text    #c9d1d9 body        #e6edf3 strong
 *   #e94560 accent      #3fb950 good        #f85149 bad
 *   #f5a623 mvp gold
 * ---------------------------------------------------------------- */


/* ============================================================
   Outer container — flex column, transparent, just spacing
   ============================================================ */
.hltv-mst {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 22px auto;
    color: #c9d1d9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
    max-width: 720px;
    width: 100%;
}

.hltv-mst *,
.hltv-mst *::before,
.hltv-mst *::after { box-sizing: border-box; }


/* Empty / error state — keeps card-like styling so it doesn't float bare */
.hltv-mst-empty {
    background: #161a21;
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 22px 18px;
    text-align: center;
    color: #6e7681;
    font-size: 13px;
}


/* ============================================================
   Per-team CARD (each team gets its own panel + border + radius)
   ============================================================ */
.hltv-mst-team {
    background: #161a21;
    border: 1px solid #21262d;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease;
}

.hltv-mst-team:hover {
    border-color: #2d343f;
}


/* Team header bar — sits above the table */
.hltv-mst-team-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #0d1117;
    border-bottom: 1px solid #21262d;
}

.hltv-mst-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4));
}

.hltv-mst-team-logo--placeholder {
    background: #1c2333;
    border: 1px dashed #30363d;
    border-radius: 4px;
    filter: none;
}

.hltv-mst-team-name {
    font-size: 14px;
    font-weight: 800;
    color: #e6edf3;
    text-decoration: none !important;
    letter-spacing: .02em;
    transition: color .15s ease;
}

a.hltv-mst-team-name:hover {
    color: #e94560;
}


/* ============================================================
   Stats table
   ============================================================ */
.hltv-mst-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hltv-mst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0;
    background: transparent;
}

.hltv-mst-table th,
.hltv-mst-table td {
    padding: 9px 10px;
    text-align: left;
    border: none;
    vertical-align: middle;
    background: transparent;
}

.hltv-mst-table thead th {
    background: #1c2333;
    border-bottom: 1px solid #21262d;
    font-size: 10px;
    font-weight: 700;
    color: #8fa3b3;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.hltv-mst-table tbody tr {
    border-bottom: 1px solid #21262d;
    transition: background .12s ease;
}

.hltv-mst-table tbody tr:last-child {
    border-bottom: none;
}

.hltv-mst-table tbody tr:hover {
    background: rgba(233, 69, 96, .04);
}


/* ── Player column ── */
.hltv-mst-th-player {
    width: 50%;
}

.hltv-mst-td-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hltv-mst-flag {
    width: 16px;
    height: 12px;
    border-radius: 1.5px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.hltv-mst-pname {
    font-weight: 700;
    color: #e6edf3;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    transition: color .15s ease;
}

a.hltv-mst-pname:hover {
    color: #e94560;
}

.hltv-mst-mvp-star {
    color: #f5a623;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(245, 166, 35, .35));
}


/* ── Numeric columns ── */
.hltv-mst-th-num,
.hltv-mst-td-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hltv-mst-td-num {
    color: #c9d1d9;
    font-weight: 600;
}


/* K - D combined cell */
.hltv-mst-kd-pair {
    color: #c9d1d9;
}

.hltv-mst-kd-pair .hltv-mst-k {
    color: #e6edf3;
    font-weight: 700;
}

.hltv-mst-kd-pair .hltv-mst-d {
    color: #8fa3b3;
    font-weight: 600;
}

.hltv-mst-kd-pair .hltv-mst-dash {
    color: #30363d;
    margin: 0 4px;
    font-weight: 400;
}


/* K/D ratio + Rating tiers */
.hltv-mst-ratio,
.hltv-mst-rating {
    font-weight: 800;
}

.hltv-mst-ratio.is-good,
.hltv-mst-rating.is-good { color: #3fb950; }

.hltv-mst-ratio.is-ok,
.hltv-mst-rating.is-ok   { color: #e6edf3; }

.hltv-mst-ratio.is-bad,
.hltv-mst-rating.is-bad  { color: #f85149; }


/* Empty row */
.hltv-mst-empty-row {
    text-align: center !important;
    padding: 18px 12px !important;
    color: #6e7681;
    font-size: 12px;
    font-style: italic;
}


/* ============================================================
   Tablet (≤768 px) — drop the optional cols (A, HS%, ADR)
   keep K-D, K/D, Rating which fit on a phone
   ============================================================ */
@media (max-width: 768px) {
    .hltv-mst-col-opt {
        display: none;
    }

    .hltv-mst-table th,
    .hltv-mst-table td {
        padding: 8px 8px;
    }

    .hltv-mst-th-player {
        width: 60%;
    }
}


/* ============================================================
   Phone (≤480 px)
   ============================================================ */
@media (max-width: 480px) {

    .hltv-mst {
        margin: 16px 0;
        gap: 10px;
    }

    .hltv-mst-team {
        border-radius: 8px;
    }

    .hltv-mst-team-bar {
        padding: 8px 11px;
        gap: 8px;
    }

    .hltv-mst-team-logo {
        width: 18px;
        height: 18px;
    }

    .hltv-mst-team-name {
        font-size: 13px;
    }

    .hltv-mst-table {
        font-size: 12px;
    }

    .hltv-mst-table th,
    .hltv-mst-table td {
        padding: 7px 6px;
    }

    .hltv-mst-table thead th {
        font-size: 9px;
    }

    .hltv-mst-flag {
        width: 14px;
        height: 10px;
    }

    .hltv-mst-pname {
        font-size: 12px;
    }

    .hltv-mst-mvp-star {
        width: 9px;
        height: 9px;
    }
}


/* ============================================================
   Astra theme overrides — defeat .entry-content link styles
   (same pattern as hltv-tournament-style.css)
   ============================================================ */
body .hltv-mst,
.entry-content .hltv-mst,
.post-content   .hltv-mst,
article         .hltv-mst,
.wp-block-post-content .hltv-mst { color: #c9d1d9 !important; }

body .hltv-mst a,
body .hltv-mst a:link,
body .hltv-mst a:visited,
body .hltv-mst a:hover,
body .hltv-mst a:focus,
body .hltv-mst a:active,
.entry-content .hltv-mst a,
.entry-content .hltv-mst a:hover,
.post-content   .hltv-mst a,
article         .hltv-mst a {
    text-decoration: none !important;
}

.entry-content .hltv-mst .hltv-mst-team-name,
.post-content   .hltv-mst .hltv-mst-team-name,
article         .hltv-mst .hltv-mst-team-name { color: #e6edf3 !important; }

.entry-content .hltv-mst .hltv-mst-team-name:hover,
.post-content   .hltv-mst .hltv-mst-team-name:hover,
article         .hltv-mst .hltv-mst-team-name:hover { color: #e94560 !important; }

.entry-content .hltv-mst .hltv-mst-pname,
.post-content   .hltv-mst .hltv-mst-pname,
article         .hltv-mst .hltv-mst-pname { color: #e6edf3 !important; }

.entry-content .hltv-mst .hltv-mst-pname:hover,
.post-content   .hltv-mst .hltv-mst-pname:hover,
article         .hltv-mst .hltv-mst-pname:hover { color: #e94560 !important; }

.entry-content .hltv-mst .hltv-mst-ratio.is-good,
.entry-content .hltv-mst .hltv-mst-rating.is-good,
.post-content   .hltv-mst .hltv-mst-ratio.is-good,
.post-content   .hltv-mst .hltv-mst-rating.is-good,
article         .hltv-mst .hltv-mst-ratio.is-good,
article         .hltv-mst .hltv-mst-rating.is-good { color: #3fb950 !important; }

.entry-content .hltv-mst .hltv-mst-ratio.is-bad,
.entry-content .hltv-mst .hltv-mst-rating.is-bad,
.post-content   .hltv-mst .hltv-mst-ratio.is-bad,
.post-content   .hltv-mst .hltv-mst-rating.is-bad,
article         .hltv-mst .hltv-mst-ratio.is-bad,
article         .hltv-mst .hltv-mst-rating.is-bad { color: #f85149 !important; }

.entry-content .hltv-mst .hltv-mst-ratio.is-ok,
.entry-content .hltv-mst .hltv-mst-rating.is-ok,
.post-content   .hltv-mst .hltv-mst-ratio.is-ok,
.post-content   .hltv-mst .hltv-mst-rating.is-ok,
article         .hltv-mst .hltv-mst-ratio.is-ok,
article         .hltv-mst .hltv-mst-rating.is-ok { color: #e6edf3 !important; }

/* Keep the K-D text colors readable in entry-content */
.entry-content .hltv-mst .hltv-mst-kd-pair .hltv-mst-k,
.post-content   .hltv-mst .hltv-mst-kd-pair .hltv-mst-k,
article         .hltv-mst .hltv-mst-kd-pair .hltv-mst-k { color: #e6edf3 !important; }

.entry-content .hltv-mst .hltv-mst-kd-pair .hltv-mst-d,
.post-content   .hltv-mst .hltv-mst-kd-pair .hltv-mst-d,
article         .hltv-mst .hltv-mst-kd-pair .hltv-mst-d { color: #8fa3b3 !important; }

.entry-content .hltv-mst .hltv-mst-kd-pair .hltv-mst-dash,
.post-content   .hltv-mst .hltv-mst-kd-pair .hltv-mst-dash,
article         .hltv-mst .hltv-mst-kd-pair .hltv-mst-dash { color: #30363d !important; }
