/* Kontener */
.profile-container { width: 100%; max-width: 100%; box-sizing: border-box; margin: 0 auto; background: #fff; border: 1px solid #e1e6ef; border-radius: 8px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }

/* Nagłówek */
.profile-overview {
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(360px, 0.85fr);
    align-items: center;
    gap: 28px;
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f0f0f0;
}
.profile-header { display: flex; align-items: center; gap: 20px; min-width: 0; text-align: left; margin: 0; padding: 0; border: 0; }
.profile-image-wrapper { position: relative; flex: 0 0 118px; width: 118px; height: 118px; border-radius: 50%; overflow: hidden; background: #f8f9fa; display: flex; justify-content: center; align-items: center; }
.profile-identity { min-width: 0; }
.avatar-circle { font-size: 4em; line-height: 1; margin-bottom: 10px; }
.username { margin: 0 0 8px; color: #333; font-size: 1.8em; overflow-wrap: anywhere; }
.user-meta { color:#888; font-size:0.9em; margin-top:5px; }
.status-badge { display: inline-block; font-size: 0.8em; padding: 3px 10px; border-radius: 12px; font-weight: bold; }
.status-badge.active { background: #e8f6e8; color: #28a745; }
.status-badge.blocked { background: #ffebeb; color: #dc3545; }

/* Sekcje */
.section-title { font-size: 0.95em; font-weight: bold; color: #666; text-transform: uppercase; margin: 30px 0 15px 0; border-left: 4px solid #0077cc; padding-left: 10px; }

/* Grid Statystyk */
.stats-box { background: #f9fafc; border: 1px solid #e1e6ef; border-radius: 8px; padding: 15px; }
.stats-label-row { font-size: 0.75em; color: #999; font-weight: bold; letter-spacing: 1px; margin-bottom: 8px; text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { background: #fff; border: 1px solid #e1e6ef; border-radius: 6px; padding: 10px 5px; text-align: center; }
.stat-card.success { background: #f0fff4; border-color: #b2f5ea; }
.stat-card.danger { background: #fff5f5; border-color: #feb2b2; }
.stat-val { font-size: 1.3em; font-weight: bold; color: #333; }
.stat-lbl { font-size: 0.75em; color: #777; text-transform: uppercase; }

.profile-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-top: 25px;
    margin-bottom: 25px;
}

.profile-column-box {
    min-width: 0;
}

.profile-column-box .section-title {
    margin-top: 0;
}

.profile-form-box {
    /*min-height: 100%;*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff;
}

/* Historia */
.history-section { margin-bottom: 20px; }
.history-list { list-style: none; padding: 0; margin: 0; border: 1px solid #eee; border-radius: 6px; overflow: hidden; }
.history-list li { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #eee; background: #fff; align-items: center; font-size: 0.9em; }
.history-list li:last-child { border-bottom: none; }
.hist-date { color: #888; font-size: 0.85em; width: 80px; }
.hist-match { flex: 1; font-weight: 500; }
.hist-pick { margin: 0 10px; color: #555; }
.hist-pts { font-weight: bold; color: green; background: #e8f6e8; padding: 2px 6px; border-radius: 4px; }

/* Formularze */
.profile-form { background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; font-size: 0.9em; margin-bottom: 5px; color: #444; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-family: inherit; }

/* Ulubiona drużyna */
.fav-team-box { background: #fdfdfd; border: 1px solid #eee; border-radius: 8px; padding: 15px; }

/* Hasło */
.password-section { margin-top: 40px; border-top: 1px solid #eee; padding-top: 20px; background: #f9f9f9; padding: 15px; border-radius: 8px; }
.password-section h3 { margin-top: 0; font-size: 1.1em; margin-bottom: 10px; }
.pass-input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; min-width: 120px; }

/* Alerty */
.alert { padding: 10px; border-radius: 4px; margin-bottom: 15px; font-size: 0.95em; }
.alert-success { background: #d5f5d0; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Zwijane sekcje profilu */
.profile-collapse {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    margin: 18px 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.profile-collapse summary .summary-team-name {
    color: #333;
    text-transform: none;
    font-weight: 800;
}
.profile-collapse summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-size: 0.95em;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    border-left: 4px solid #0077cc;
    background: #f9fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-collapse summary::-webkit-details-marker {
    display: none;
}

.profile-collapse summary::after {
    content: "Rozwiń ▼";
    font-size: 0.75em;
    color: #718096;
    font-weight: normal;
    text-transform: none;
}

.profile-collapse[open] summary::after {
    content: "Zwiń ▲";
}

.profile-collapse-body {
    padding: 18px;
}

/* Nawigacja i grupowanie sekcji profilu */
.profile-section-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}
.profile-section-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #dce3ec;
    border-radius: 6px;
    background: #f9fafc;
    color: #34495e;
    font-size: 0.88em;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}
.profile-section-nav a:hover,
.profile-section-nav a:focus-visible {
    border-color: #0077cc;
    background: #eef7ff;
    color: #0063aa;
}
.profile-section-anchor {
    scroll-margin-top: 90px;
}
.profile-career-box {
    margin-bottom: 24px;
}
.profile-settings-title {
    margin-top: 34px;
}
.profile-settings-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}
.profile-settings-group .profile-collapse {
    min-width: 0;
    margin: 0;
}
.profile-settings-group .profile-collapse summary {
    min-height: 49px;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .profile-overview {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-section-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .profile-container { padding: 14px 12px; border-radius: 6px; }
    .profile-overview { gap: 14px; margin-bottom: 20px; padding-bottom: 18px; }
    .profile-header { gap: 14px; text-align: left; }
    .profile-image-wrapper { flex-basis: 86px; width: 86px; height: 86px; }
    .profile-image-wrapper .avatar-circle { font-size: 3em; }
    .username { font-size: 1.45em; margin-bottom: 6px; }
    .theme-switcher { padding: 6px 9px !important; }
    .theme-switcher > span { display: none; }
    .profile-section-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin: 0;
    }
    .profile-section-nav a { min-height: 40px; padding: 7px 6px; font-size: 0.82em; }
    .section-title { margin-top: 24px; margin-bottom: 11px; }
    .stats-box { padding: 11px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .profile-two-columns,
    .profile-settings-group { grid-template-columns: 1fr; }
    .profile-two-columns { gap: 14px; margin-top: 20px; margin-bottom: 20px; }
    .profile-settings-group { gap: 10px; }
    .profile-collapse-body { padding: 14px 12px; }
    .profile-collapse summary { padding: 12px; gap: 8px; }
    .profile-collapse summary::after { flex: 0 0 auto; }
    .history-list li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 10px;
        align-items: center;
    }
    .hist-date { width: auto; grid-column: 1; grid-row: 1; }
    .hist-match {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .hist-pick { grid-column: 1; grid-row: 3; margin: 0; }
    .hist-pts { grid-column: 2; grid-row: 1 / span 3; }
    .pass-input { flex: 1 1 100%; width: 100%; box-sizing: border-box; }
    .profile-settings-group form { align-items: stretch !important; }
}
    /* Styl dla sekcji scrollowanej */
    .archive-scroll-box {
        max-height: 220px;
        overflow-y: auto;
        padding-right: 5px;
        scrollbar-width: thin;
        scrollbar-color: #ccc #f9f9f9;
    }
    .archive-scroll-box::-webkit-scrollbar { width: 6px; }
    .archive-scroll-box::-webkit-scrollbar-track { background: #f9f9f9; }
    .archive-scroll-box::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }

    /* Pojedynczy wiersz */
    .archive-row-link { text-decoration: none; color: inherit; display: block; margin-bottom: 8px; }
    .archive-row { display: flex; align-items: center; padding: 10px 15px; border: 1px solid #eee; border-radius: 6px; transition: transform 0.2s, box-shadow 0.2s; }
    .archive-row:hover { transform: translateX(3px); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
    
    .ar-icon { font-size: 1.5em; margin-right: 15px; width: 30px; text-align: center; }
    .ar-info { flex: 1; }
    .ar-season { font-size: 0.9em; font-weight: bold; color: #333; }
    .ar-rank { font-size: 0.85em; }
    .ar-arrow { color: #ccc; font-size: 1.2em; font-weight: bold; }
    .archive-row:hover .ar-arrow { color: #0077cc; }

/* Prosty wykres narastającej punktacji w sekcji Twoja forma */
.profile-form-chart {
    width: 100%;
    height: 150px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid #edf2f7;
}

.profile-form-chart canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

html[data-theme="dark"] .profile-form-chart {
    border-top-color: rgba(160, 174, 192, 0.24);
}

@media (max-width: 600px) {
    .profile-form-chart {
        height: 190px;
    }
}

