/* ── CSS variables ── */
.cs2-stats-wrap, .cs2-injected {
    --ms-border: rgba(0,0,0,0.1);
    --ms-bg: rgba(0,0,0,0.02);
}
body.digital_newspaper_dark_mode .cs2-stats-wrap,
body.digital_newspaper_dark_mode .cs2-injected {
    --ms-border: rgba(255,255,255,0.08);
    --ms-bg: rgba(255,255,255,0.03);
}

/* ── ms-player-table (shared; also inlined in map-stats.php for game pages) ── */
.ms-table-wrapper { overflow-x: auto; }
.ms-player-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ms-player-table thead th {
    background: rgba(52,152,219,0.12); color: #3498db;
    font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
    padding: 6px 8px; text-align: center; white-space: nowrap;
    border-bottom: 1px solid var(--ms-border); position: relative;
}
.ms-player-table thead th.ms-col-player { text-align: left; }
.ms-player-table thead th.ms-has-tip { cursor: help; }
.ms-th-tip { display: none; }
.ms-player-table tbody tr { border-bottom: 1px solid var(--ms-border); transition: background .1s; }
.ms-player-table tbody tr:hover { background: var(--ms-bg); }
.ms-player-table td { padding: 7px 8px; text-align: center; vertical-align: middle; }
.ms-col-player { text-align: left !important; width: 180px; max-width: 220px; }
.ms-col-kda  { width: 36px; }
.ms-col-stat { width: 48px; }
.ms-col-net  { width: 60px; color: #f39c12; }
.ms-col-rank { width: 28px; text-align: center; color: #999; font-size: 11px; }
.ms-player-link { display: flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; overflow: hidden; }
.ms-player-link:hover { color: #3498db; }
.ms-player-photo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ms-player-nick { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ms-player-unmatched { opacity: .6; font-style: italic; font-weight: 600; font-size: 13px; }
.ms-totals-row td { border-top: 1px solid var(--ms-border); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; padding-top: 8px; padding-bottom: 8px; }
.ms-totals-label { color: #3498db; }
.ms-kills   { color: #27ae60; font-weight: 700; }
.ms-deaths  { color: #e74c3c; font-weight: 700; }
.ms-won-badge { background: #27ae60; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; }
.ms-team-section__name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.ms-team-logo { width: 36px; height: 36px; object-fit: contain; }
.ms-team-logo-sm { width: 28px; height: 28px; object-fit: contain; display: block; margin: 0 auto; }
.ms-col-date { white-space: nowrap; font-size: 11px; color: #999; }

/* ── CS2 injected (game page tabs) ── */
.cs2-injected { font-size: 13px; }

/* Team section spacing */
.cs2-injected .ms-team-section + .ms-team-section { margin-top: 20px; }

/* Unresolved player nick */
.ms-player-unmatched { opacity: .6; font-style: italic; font-weight: 600; font-size: 13px; }

/* ── Per-map match header ── */
.ms-match-header { padding: 14px; background: var(--ms-bg); border: 1px solid var(--ms-border); border-radius: 6px; }
.ms-team-name { font-weight: 700; font-size: 14px; }
.ms-kill-score { display: flex; align-items: center; gap: 8px; justify-content: center; }
.ms-kill-score__home, .ms-kill-score__away { font-size: 32px; font-weight: 800; line-height: 1; }
.ms-kill-score__sep { font-size: 22px; font-weight: 300; opacity: .5; }
.ms-winner-crown { font-size: 20px; }
.ms-score--win { color: #27ae60 !important; }
.ms-score--lose { color: #e74c3c !important; }

/* Tab shell (mirrors wp-esports-stats map-stats.php inline styles) */
.esports-mapstats { --ms-border: rgba(255,255,255,0.08); --ms-bg: rgba(255,255,255,0.03); }
body:not(.digital_newspaper_dark_mode) .esports-mapstats { --ms-border: rgba(0,0,0,0.1); --ms-bg: rgba(0,0,0,0.02); }
.esports-mapstats__tab { background: var(--ms-bg); border: 1px solid var(--ms-border); border-radius: 4px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer; color: inherit; transition: background .15s, border-color .15s; }
.esports-mapstats__tab.is-active { border-color: #3498db; color: #3498db; background: rgba(52,152,219,0.1); }
.ms-badge { display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.ms-badge.home { background: #27ae60; color: #fff; }
.ms-badge.away { background: #e74c3c; color: #fff; }
.ms-badge.live { background: #ff4757; color: #fff; }
.ms-badge.pending { background: #7f8c8d; color: #fff; }

/* Career stats block on player page */
.cs2-career-wrap { font-size: 13px; }
.cs2-career-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}
.cs2-career-summary strong { color: #2c3e50; }

/* Dark mode tweaks */
body.digital_newspaper_dark_mode .cs2-career-summary { color: #aaa; }
body.digital_newspaper_dark_mode .cs2-career-summary strong { color: #fff; }

/* Team stats grid */
.cs2-team-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.cs2-team-col  { flex: 1; min-width: 220px; }
.cs2-col-title { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: #2c3e50; }
body.digital_newspaper_dark_mode .cs2-col-title { color: #fff; }

/* Tournament tabs */
.cs2-tabs__bar  { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.cs2-tabs__btn  {
    padding: 5px 14px; font-size: 12px; font-weight: 600;
    background: #f0f0f0; border: none; border-radius: 4px;
    cursor: pointer; color: #555;
}
.cs2-tabs__btn.is-active { background: #2c3e50; color: #fff; }
body.digital_newspaper_dark_mode .cs2-tabs__btn { background: #2a2a2a; color: #aaa; }
body.digital_newspaper_dark_mode .cs2-tabs__btn.is-active { background: #fff; color: #111; }

/* Rank column */
.ms-col-rank { width: 28px; text-align: center; color: #999; font-size: 11px; }

/* Map cell with overlay label */
.cs2-map-cell {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 160px;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
}
.cs2-map-thumb {
    display: block;
    width: 100%;
    height: 35px;
    object-fit: cover;
}
.cs2-map-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.72));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .3px;
}

/* ── Map Veto block ── */
.cs2-veto-wrap {
    margin-bottom: 20px;
}
.cs2-veto-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #3498db;
    margin-bottom: 10px;
}
.cs2-veto-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.cs2-veto-card {
    position: relative;
    width: 98px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}
.cs2-veto-map-img,
.cs2-veto-map-placeholder {
    display: block;
    width: 100%;
    height: 70px;
    object-fit: cover;
}
.cs2-veto-map-placeholder {
    background: #2a2a2a;
}

/* Banned card: grayscale + dark overlay */
.cs2-veto-card--ban .cs2-veto-map-img {
    filter: grayscale(100%) brightness(0.45);
}
.cs2-veto-ban-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.cs2-veto-x {
    width: 28px;
    height: 28px;
    color: rgba(255,80,80,0.85);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

/* Left over card: slight dim */
.cs2-veto-card--left .cs2-veto-map-img {
    filter: brightness(0.7) saturate(0.6);
}

/* Picked card: subtle highlight border */
.cs2-veto-card--pick {
    box-shadow: 0 0 0 2px #27ae60, 0 2px 8px rgba(0,0,0,0.25);
}

/* Side accent */
.cs2-veto-card--home { outline: 2px solid rgba(52,152,219,0.5); }
.cs2-veto-card--away { outline: 2px solid rgba(231,76,60,0.4); }
.cs2-veto-card--pick.cs2-veto-card--home { outline: 2px solid #3498db; }
.cs2-veto-card--pick.cs2-veto-card--away { outline: 2px solid #e74c3c; }

.cs2-veto-card__body {
    flex: 1;
    position: relative;
    background: #1a1a2e;
    padding: 5px 6px 6px;
}
body.digital_newspaper_dark_mode .cs2-veto-card__body {
    background: #111;
}

.cs2-veto-action-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 3px;
    text-transform: uppercase;
}
.cs2-veto-action-badge--ban  { background: rgba(231,76,60,0.2);  color: #e74c3c; }
.cs2-veto-action-badge--pick { background: rgba(39,174,96,0.2);  color: #27ae60; }
.cs2-veto-action-badge--left { background: rgba(39,174,96,0.2);  color: #27ae60; }

.cs2-veto-map-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.cs2-veto-team {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
}
.cs2-veto-team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}
.cs2-veto-team-name {
    font-size: 9.5px;
    color: #bbb;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark mode */
body.digital_newspaper_dark_mode .cs2-veto-title { color: #5dade2; }

/* Responsive: scroll on small screens */
@media (max-width: 600px) {
    .cs2-veto-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .cs2-veto-card { width: 80px; }
    .cs2-veto-map-img, .cs2-veto-map-placeholder { height: 56px; }
    .cs2-veto-ban-overlay { height: 56px; }
}

/* Column header tooltips — JS-powered (appended to body) */
.cs2-injected .ms-has-tip,
.cs2-stats-wrap .ms-has-tip { cursor: help; }
.cs2-th-tooltip {
    position: fixed;
    background: #222;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}
.cs2-th-tooltip.is-visible { opacity: 1; }
.cs2-th-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #222;
}
