/* ── Match History ── */

.match-container {
    flex: 1;
    padding: var(--space-xl);
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.match-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-black);
    margin-bottom: var(--space-sm);
}

.match-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* ── Match metadata ── */

.match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.match-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.match-meta-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-meta-value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

/* ── Match detail table ── */

.match-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.match-detail-card .table-full {
    margin-bottom: 0;
}

.match-detail-card .table-header {
    background: var(--color-primary-dark);
}

.match-detail-card .table-row:nth-child(even) {
    background: #f8fafc;
}

.match-detail-card .table-row:hover {
    background: #eef2f7;
}

/* ── Summary section below rounds ── */

.match-summary {
    border-top: 3px solid var(--color-primary);
    background: #f1f5f9;
}

.match-summary-row {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid #e2e8f0;
}

.match-summary-row:first-child {
    border-top: none;
}

.match-summary-label {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.match-summary-values {
    display: flex;
    flex: 1;
}

.match-summary-value {
    flex: 1;
    text-align: right;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    padding: 0 var(--space-lg);
}

/* ── Table cell modifiers ── */

.match-cell-winner {
    color: var(--color-success);
    font-weight: var(--font-weight-bold);
}

.match-cell-timeout {
    color: var(--text-secondary);
    font-style: italic;
}

.match-cell-skip {
    color: var(--text-secondary);
    font-style: italic;
}

.match-country-hint {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    display: block;
}

/* ── Placement badges ── */

.match-placement {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-black);
}

.match-placement-1 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    box-shadow: 0 1px 3px rgba(146, 64, 14, 0.2);
}

.match-placement-2 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

.match-placement-3 {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #9a3412;
}

.match-actions {
    margin-top: var(--space-xl);
    display: flex;
    gap: var(--space-md);
}

/* ── Compare page ── */

.match-compare-selector {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.match-compare-selector label {
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.match-compare-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.match-compare-match-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-primary-light);
}

.match-compare-match-title a {
    color: var(--color-primary);
    text-decoration: none;
}

.match-compare-match-title a:hover {
    text-decoration: underline;
}

/* ── Capital leaderboard ── */

.match-capital-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.match-capital-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.match-capital-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

.match-capital-country {
    font-size: var(--font-size-sm);
    opacity: 0.85;
}

.match-capital-region {
    font-size: var(--font-size-xs);
    opacity: 0.7;
    margin-left: auto;
}

.match-capital-card .table-header {
    background: #1e3a5f;
}

/* ── Pagination ── */

.match-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.match-pagination a {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.match-pagination a:hover {
    background: var(--color-primary);
    color: var(--text-inverse);
}

.match-pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ── Player link ── */

.match-player-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}

.match-player-link:hover {
    text-decoration: underline;
}

/* ── Empty state ── */

.match-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .match-container {
        padding: var(--space-md);
    }

    .match-meta {
        flex-direction: column;
        gap: var(--space-md);
    }

    .match-compare-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .match-detail-card,
    .table-container {
        overflow-x: auto;
    }

    .match-summary-label {
        min-width: 100px;
    }
}
