/* ========================================
   STATISTICS MODAL REDESIGN - PREMIUM GRID
   Compact, Graphically Amazing, No Scroll
   ======================================== */

/* Modal Container Override */
#statsModal .modal-content {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.05);
    padding: 1.5rem;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    /* Ensure fits on screen */
    overflow-y: auto;
    /* Scroll strictly inside if needed */
    position: relative;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
}

#statsModal .modal-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--clr-gold-neon, #ffd700);
    text-transform: uppercase;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 0.5rem;
}

/* Close Button */
#statsModal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff4444;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#statsModal .modal-close:hover {
    background: #ff4444;
    color: white;
    box-shadow: 0 0 10px #ff4444;
}

/* GRID LAYOUT - THE KEY FIX */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    /* Responsive grid */
    gap: 1rem;
    margin-bottom: 1rem;
}

/* New Premium Stat Card Style */
.stat-card.glass-panel {
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.6), rgba(20, 20, 30, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    /* Uniform height */
}

.stat-card.glass-panel:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.1);
    background: linear-gradient(145deg, rgba(40, 40, 50, 0.7), rgba(30, 30, 40, 0.9));
}

/* Glow Effect on Hover */
.stat-card.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card.glass-panel:hover::before {
    opacity: 1;
}

/* Icon Styling */
.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

/* Value Styling */
.stat-card-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    margin-bottom: 0.25rem;
}

/* Label Styling */
.stat-card-label {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Specific Card Colors (Optional polish) */
.stat-card:nth-child(1) .stat-card-value {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Gold */
.stat-card:nth-child(2) .stat-card-value {
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

/* Blue */
.stat-card:nth-child(3) .stat-card-value {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.4);
}

/* Red */
.stat-card:nth-child(4) .stat-card-value {
    color: #44ff44;
    text-shadow: 0 0 8px rgba(68, 255, 68, 0.4);
}

/* Green */

/* Success Rate Display */
.success-rate-display {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
    margin-top: 1rem;
}

.success-rate-label {
    color: #ddd;
    font-size: 1rem;
}

.success-rate-value {
    color: #44ff44;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(68, 255, 68, 0.5);
}

/* MOBILE OPTIMIZATION - 2 COLUMNS */
@media (max-width: 768px) {
    #statsModal .modal-content {
        padding: 1rem;
        width: 90%;
        max-height: 85vh;
        /* Safe area for modals */
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        /* FORCE 2 COLUMNS */
        gap: 0.75rem;
    }

    .stat-card.glass-panel {
        padding: 0.5rem;
        min-height: 100px;
    }

    .stat-card-icon {
        font-size: 1.5rem;
    }

    .stat-card-value {
        font-size: 1.1rem;
    }

    .stat-card-label {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    #statsModal .modal-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
}