/* Dark mode (default) */
.esports-agg {
    --agg-border: rgba(255,255,255,0.08);
    --agg-bg: rgba(255,255,255,0.03);
    font-family: inherit;
    color: inherit;
    margin: 0;
}
/* Light mode override */
body:not(.digital_newspaper_dark_mode) .esports-agg {
    --agg-border: rgba(0,0,0,0.1);
    --agg-bg: rgba(0,0,0,0.02);
}

/* Sub-section label (Топ герої, etc.) */
.esports-agg__section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .55;
    margin: 16px 0 8px;
}
.esports-agg__section-meta {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Summary stat boxes */
.esports-agg__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.esports-agg__stat {
    background: var(--agg-bg);
    border: 1px solid var(--agg-border);
    border-top: 2px solid #3498db;
    border-radius: 0 0 6px 6px;
    padding: 6px 10px;
    text-align: center;
    min-width: 0;
    flex: 1 1 auto;
}
.esports-agg__val {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.2;
    color: #3498db;
}
body:not(.digital_newspaper_dark_mode) .esports-agg__val {
    color: #1a6ea8;
}
.esports-agg__lbl {
    display: block;
    font-size: .58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .55;
    margin-top: 3px;
    white-space: nowrap;
}

/* Hero cards (player page) */
.esports-agg__heroes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.esports-agg__hero {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--agg-bg);
    border: 1px solid var(--agg-border);
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 180px;
}
.esports-agg__hero-icon {
    width: 50px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}
.esports-agg__hero-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.esports-agg__hero-name {
    font-size: .85rem;
    font-weight: 600;
}
.esports-agg__hero-stats {
    font-size: .75rem;
    opacity: .65;
}

/* Tables */
.esports-agg__table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    margin-top: 4px;
}
.esports-agg__table thead th {
    background: rgba(52,152,219,0.12);
    padding: 6px 10px;
    text-align: left;
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #3498db;
    border-bottom: 1px solid var(--agg-border);
    white-space: nowrap;
}
.esports-agg__table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--agg-border);
    white-space: nowrap;
}
.esports-agg__table tbody tr:hover td {
    background: var(--agg-bg);
}

/* Hero cell with icon */
.esports-agg__hero-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}
.esports-agg__hero-cell img {
    width: 46px;
    height: 26px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Value accents */
.esports-agg__win  { color: #27ae60; font-weight: 700; }
.esports-agg__loss { color: #e74c3c; font-weight: 700; }
.esports-agg__pct  { color: #f39c12; }

/* Tournament: center-align numeric columns */
.esports-agg--tournament .esports-agg__table thead th:nth-child(n+2),
.esports-agg--tournament .esports-agg__table tbody td:nth-child(n+2) {
    text-align: center;
}

/* Match cell: team chip (logo + abbr) */
.esports-agg__match-cell { white-space: nowrap; }
.esports-agg__vs-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.esports-agg__vs-link:hover { text-decoration: underline; }
.esports-agg__vs-sep { font-size: .7em; opacity: .5; margin: 0 2px; }
.esports-agg__team-chip { display: inline-flex; align-items: center; gap: 4px; }
.esports-agg__team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}
.esports-agg__player-link { color: inherit; text-decoration: none; }
.esports-agg__player-link:hover { text-decoration: underline; }
.esports-agg__player-chip { display: inline-flex; align-items: center; gap: 5px; }
.esports-agg__player-avatar {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}
.esports-agg__player-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip for abbreviated column headers */
.esports-agg__table thead th.ms-has-tip { cursor: default; }
.ms-th-tip { display: none; }
.ms-float-tip {
    display: none;
    position: fixed;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
}
