.match-page {
    min-height: 100vh;
    padding: 0 24px 60px;
    box-sizing: border-box;
}

.match-page,
.match-page * {
    font-family: 'CustomFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box;
}

.match-page i,
.match-page .fas,
.match-page .far,
.match-page .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome", sans-serif !important;
}

.match-container {
    max-width: 1680px;
    width: 100%;
    margin: 80px auto 60px;
}

.match-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.match-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(44, 143, 255, 0.1);
    border: 1px solid rgba(44, 143, 255, 0.28);
    color: #50b5ff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-back-btn:hover {
    background: var(--accent-color, #2C8FFF);
    color: #ffffff;
    transform: translateX(-3px);
    box-shadow: 0 4px 14px rgba(44, 143, 255, 0.35);
}

.match-id-pill {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 5px 12px;
    border-radius: 999px;
}

.loading-state,
.error-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-color, #fff);
}

.retry-btn {
    margin-top: 16px;
    padding: 9px 22px;
    background: var(--accent-color, #2C8FFF);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(44, 143, 255, 0.35);
}

.match-header {
    background: var(--card-bg, #151821);
    border: 1px solid var(--e-card-border, rgba(44, 143, 255, 0.18));
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.match-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color, #2C8FFF), #38bdf8, transparent);
}

.match-game-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.game-icon {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.match-info-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-name {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-color, #2C8FFF);
    line-height: 1.2;
}

.server-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.match-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
}

.meta-chip i {
    color: var(--accent-color, #2C8FFF);
}

.match-result {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.match-result.win {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ade80;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}

.match-result.win i {
    color: #f59e0b;
    font-size: 18px;
}

.match-result.draw {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
}

.match-body-grid {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 20px;
    align-items: start;
}

.section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-bar h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-count {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(44, 143, 255, 0.12);
    border: 1px solid rgba(44, 143, 255, 0.25);
    color: #50b5ff;
}

.players-section,
.events-section {
    background: var(--card-bg, #151821);
    border: 1px solid var(--e-card-border, rgba(44, 143, 255, 0.18));
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.events-section {
    position: static;
}

.teams-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.team-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.team-header {
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-count {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.players-table-container {
    overflow-x: auto;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
}

.players-table thead {
    background: rgba(0, 0, 0, 0.15);
}

.players-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    user-select: none;
}

.players-table th.col-place {
    width: 44px;
    text-align: center;
}

.players-table th.col-player {
    min-width: 180px;
}

.players-table th.col-stat {
    width: 85px;
    text-align: center;
}

.players-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

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

.players-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.players-table tbody tr.winner {
    background: rgba(34, 197, 94, 0.08);
}

.players-table td {
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13px;
}

.players-table td.col-place {
    text-align: center;
    font-weight: 800;
    color: #94a3b8;
}

.players-table td.col-stat {
    text-align: center;
    font-weight: 700;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
}

.player-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-info a,
.player-info a:hover,
.player-name a,
.player-name a:hover {
    text-decoration: none !important;
}

.dead-name {
    opacity: 0.6;
    text-decoration: line-through;
}

.events-timeline {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.event-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.event-item-compact:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.event-time-compact {
    font-family: 'CustomFont', monospace !important;
    color: #94a3b8;
    min-width: 44px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.event-icon-compact {
    width: 18px;
    display: flex;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.event-description-compact {
    flex: 1;
    color: #ffffff;
    line-height: 1.35;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-description-compact a {
    text-decoration: none;
    font-weight: 700;
}

.event-action {
    color: #94a3b8;
    margin: 0 4px;
    font-size: 13px;
}

.event-health-compact {
    color: #ef4444;
    font-size: 12px;
    margin-left: 6px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.res-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.res-icon.gold { background: #f59e0b; }
.res-icon.iron { background: #cbd5e1; }
.res-icon.bronze { background: #d97706; }

@media (max-width: 1200px) {
    .match-body-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .match-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
    }

    .match-game-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-icon {
        width: 48px;
        height: 48px;
    }

    .game-name {
        font-size: 22px;
    }

    .match-meta {
        flex-wrap: wrap;
    }

    .players-table th.col-stat:nth-child(n+5),
    .players-table td.col-stat:nth-child(n+5) {
        display: none;
    }
}
