/* ==========================================================================
   CKM ENGINE: KARTA ZAWODNIKA (Light UI)
   ========================================================================== */

.ckm-profile-margin {
    margin-top: 40px !important;
}

/* 1. Lekkie Hero (Zintegrowane z tłem strony) */
.ckm-profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    flex-wrap: wrap; /* Zapewnia spadek bloków na telefonach */
}

.ckm-hero-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.ckm-hero-right {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: flex-end;
}

.ckm-profile-photo-box {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    background: #f4f7f5;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ckm-position-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap; /* Gwarantuje, że na mikro-ekranach odznaka spadnie łagodnie do nowej linii */
    margin-top: 5px; /* Delikatny oddech od nazwiska */
}

.ckm-profile-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.ckm-profile-no-photo {
    font-size: 12px;
    color: #9aa5a0;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 50%;
}

.ckm-profile-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px; /* Rozpycha elementy: Numer, Imię, Pozycję */
}

.ckm-profile-number {
    font-size: 24px;
    font-weight: 900;
    color: #00a859;
    line-height: 1;
    margin-bottom: 5px;
}

.ckm-profile-name {
    margin: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ckm-name-last {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    color: #111;
    letter-spacing: 1px;
}

.ckm-name-first {
    font-size: 20px;
    font-weight: 500;
    color: #555;
}

.ckm-profile-position {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: #e9f7ef;
    color: #00a859;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
}

.ckm-captain-horizontal {
    background-color: #d32f2f; /* Ta sama agresywna czerwień co na liście */
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.2);
    display: inline-block;
    line-height: 1;
    transform: translateY(-1px); /* Optyczne wyrównanie względem fontu pozycji */
}
/* 2. Lekkie Karty (Metryka, Bio, Stats) */
.ckm-light-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

/* Minimalistyczny nagłówek sekcji z zielonym akcentem */
.ckm-light-header {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    padding-left: 12px;
    border-left: 4px solid #00a859;
}

/* Nowa siatka dla Metryki wewnątrz Hero */
.ckm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 500px; /* Nie pozwala metryce rozlać się po całym ekranie */
}

.ckm-metric-line {
    background: #f9fbf9;
    border: 1px solid #f0f4f2;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ckm-m-label {
    font-size: 12px;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
}

.ckm-m-value {
    font-size: 16px;
    color: #111;
    font-weight: 800;
}

/* Tekst bio */
.ckm-profile-bio {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

/* 3. Czyszczenie tabeli SportsPress */
.ckm-stats-clean-table .sp-template {
    margin: 0 !important;
}

.ckm-stats-clean-table table {
    width: 100%;
    border-collapse: collapse;
}

.ckm-stats-clean-table th {
    background: transparent !important;
    color: #777 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    border-bottom: 2px solid #eee !important;
    padding: 10px 5px !important;
}

.ckm-stats-clean-table td {
    padding: 12px 5px !important;
    border-bottom: 1px solid #f4f7f5 !important;
    color: #111 !important;
    font-weight: 600;
}

/* ==========================================================================
   CKM ENGINE: DYNAMICZNY DASHBOARD STATYSTYK (SELEKTOR SEZONÓW)
   ========================================================================== */

.ckm-season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.ckm-season-header h3 {
    margin: 0 !important; /* Nadpisuje domyślny margines z klas CKM */
}

.ckm-season-select {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e0e5e2;
    background: #f9fbf9;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #111;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ckm-season-select:hover, .ckm-season-select:focus {
    border-color: #00a859;
    box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.1);
}

/* Silnik ukrywania/pokazywania (Layer JS) */
.ckm-stats-layer {
    display: none !important;
}

.ckm-stats-layer.active {
    display: grid !important; 
}
/* ==========================================================================
   CKM ENGINE: DASHBOARD STATYSTYK ZAWODNIKA (5 W RZĘDZIE)
   ========================================================================== */

.ckm-stats-dashboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Sztywne 5 kolumn na desktopie */
    gap: 15px;
    padding-top: 10px;
}

.ckm-stat-tile {
    background: #f9fbf9;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #f0f4f2;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ckm-stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.ckm-s-val {
    font-size: 32px;
    font-weight: 900;
    color: #111;
    line-height: 1;
    margin-bottom: 8px;
}

.ckm-s-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #777;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Wyróżnienia graficzne dla konkretnych statystyk (Klasy Mistrzowskie) */
.ckm-stat-goal .ckm-s-val {
    color: #00a859; /* Zielony akcent dla bramek */
}

.ckm-stat-yellow .ckm-s-val {
    position: relative;
}
.ckm-stat-yellow .ckm-s-val::before {
    content: '';
    position: absolute;
    top: -5px;
    right: -15px;
    width: 10px;
    height: 14px;
    background: #f1c40f;
    border-radius: 2px;
    transform: rotate(10deg);
}

.ckm-stat-red .ckm-s-val {
    position: relative;
}
.ckm-stat-red .ckm-s-val::before {
    content: '';
    position: absolute;
    top: -5px;
    right: -15px;
    width: 10px;
    height: 14px;
    background: #e74c3c;
    border-radius: 2px;
    transform: rotate(10deg);
}

/* Nowe grafiki dla statystyk */
.ckm-stat-owngoal .ckm-s-val {
    color: #e67e22; /* Pomarańczowy dla samobójczych */
}

/* Wyróżnienia graficzne CKM dla Asyst, Karnych i Win Ratio */
.ckm-stat-assist .ckm-s-val {
    color: #3498db; /* Profesjonalny, sportowy błękit dla asyst */
}

.ckm-stat-cleansheet .ckm-s-val {
    color: #2ecc71; /* Pastelowy jasnozielony dla Czystych Kont */
}
.ckm-stat-penalty .ckm-s-val {
    position: relative;
    color: #111;
}
.ckm-stat-penalty .ckm-s-val::after {
    content: '(PK)';
    position: absolute;
    top: -5px;
    right: -15px;
    font-size: 10px;
    color: #aaa;
    font-weight: 700;
}

.ckm-stat-ratio .ckm-s-val {
    color: #9b59b6; /* Kolor ekspercki dla głębokich statystyk */
}

/* ==========================================================================
   CKM ENGINE: BAZOWA SIATKA DLA PROFILU I INFO O BRAKACH
   ========================================================================== */

.ckm-page-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start;
}

.ckm-page-main-content {
    flex: 1;
    min-width: 0;
}

.ckm-empty-state {
    font-size: 14px;
    color: #9aa5a0;
    font-style: italic;
    margin: 0;
    padding: 10px 0;
}

/* ==========================================================================
   CKM ENGINE: RESPONSIVITY (RWD) - ZSCALONE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 950px) {
    .ckm-profile-hero { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .ckm-hero-right { 
        justify-content: flex-start; 
        margin-top: 10px;
    }
    .ckm-metrics-grid { 
        max-width: 100%; 
    }
    /* Siatka profilu schodzi pod siebie */
    .ckm-page-wrapper {
        flex-direction: column;
    }
    .ckm-sidebar-area {
        width: 100%;
    }
    /* Dashboard statystyk łamie się na 3 kafelki w rzędzie (Tablety) */
    .ckm-stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ckm-hero-left { 
        flex-direction: column; 
        text-align: center; 
    }
    /* Hero Zawodnika dostosowuje się do mniejszych ekranów */
    .ckm-profile-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .ckm-profile-position {
        align-self: center;
    }
}

@media (max-width: 600px) {
    /* Dashboard statystyk na telefonach to 2 duże kafelki */
    .ckm-stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}