/* ============================================
   Player Stats Modal
   ============================================ */

.player-stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.player-stats-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.player-stats-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.player-stats-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.player-stats-content h2 {
    margin: 0 0 30px 0;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.player-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stats-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.stats-card.full-width {
    grid-column: 1 / -1;
}

.stats-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.stats-card canvas {
    max-height: 300px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 20px 0;
}

.stat-box {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #764ba2;
}

.stat-value {
    display: block;
    font-size: 42px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
    .player-stats-content {
        padding: 20px;
        max-height: 95vh;
    }

    .player-stats-content h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .player-stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-card canvas {
        max-height: 250px;
    }

    .stats-summary {
        flex-direction: column;
    }

    .stat-box {
        min-width: 100%;
    }

    .stat-value {
        font-size: 28px;
    }

    .advanced-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Advanced Stats Section
   ============================================ */

.advanced-stats-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.advanced-stats-section h3 {
    color: white;
    font-size: 24px;
    margin: 0 0 25px 0;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.advanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.stat-card.advanced-stat {
    background: white;
    border: none;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card.advanced-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-card.advanced-stat h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.advanced-stat-value {
    text-align: center;
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.advanced-stat-value strong {
    color: #667eea;
    font-size: 20px;
}

.advanced-stat-value .streak-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.advanced-stat-value .partner-name {
    font-weight: bold;
    color: #667eea;
    font-size: 20px;
    margin-bottom: 5px;
}

.advanced-stat-value .partner-details {
    font-size: 14px;
    color: #777;
}

.advanced-stat-value .mvp-percentage {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 5px;
}

.advanced-stat-value .mvp-percentage.high {
    color: #10b981;
}

.advanced-stat-value .mvp-percentage.medium {
    color: #f59e0b;
}

.advanced-stat-value .mvp-percentage.low {
    color: #ef4444;
}

.advanced-stat-value .mvp-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.stat-card.team-blue {
    border-left: 4px solid #3b82f6;
}

.stat-card.team-red {
    border-left: 4px solid #ef4444;
}

.advanced-stat-value .team-stat-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 5px 0;
    font-size: 14px;
}

.advanced-stat-value .team-stat-line strong {
    font-size: 16px;
}

