﻿.tournament-stats {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    margin-top: 1rem;
    animation: fadeIn 0.6s ease;
}

.stats-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    color: #1e293b;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* --- Root Card Styles --- */
.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    box-sizing: border-box;
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    }

/* --- Header Row: Icon + Title --- */
.stat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: nowrap;
}

    .stat-header h4{
        margin: 0;
    }

/* --- Icon Styling --- */
.stat-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    font-size: 1.4rem;
}

/* --- Title Text --- */
.stat-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #111827;
    display: inline-block;
    white-space: nowrap;
}

/* --- Player Name --- */
.player-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

/* --- Animated Value --- */
.animated-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.4;
}

/* --- Color Modifiers (Optional) --- */
.stat-card.best {
    border-top: 4px solid #22c55e; /* Green accent */
}

.stat-card.worst {
    border-top: 4px solid #ef4444; /* Red accent */
}

.stat-card.neutral {
    border-top: 4px solid #3b82f6; /* Blue accent */
}

.best-pr .animated-value {
    color: #16a34a;
}

.worst-pr .animated-value {
    color: #dc2626;
}

.luckiest .animated-value {
    color: #22c55e;
}

.unluckiest .animated-value {
    color: #ef4444;
}

.winning .animated-value {
    color: #0ea5e9;
}

.losing .animated-value {
    color: #d946ef;
}

/* --- Responsive Layout --- */
@media (max-width: 900px) {
    .stat-card {
        max-width: 240px;
        padding: 1rem;
    }

    .stat-icon {
        width: 24px;
        height: 24px;
    }

    .stat-title {
        font-size: 1rem;
    }

    .animated-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .stat-card {
        max-width: 100%;
        padding: 0.9rem;
        border-radius: 12px;
    }

    .stat-header {
        gap: 0.5rem;
    }

    .stat-icon {
        width: 22px;
        height: 22px;
    }

    .stat-title {
        font-size: 0.95rem;
    }

    .animated-value {
        font-size: 1.2rem;
    }
}
