/* ========================================================= */
/* --- ДОСТИЖЕНИЯ ВОКРУГ АВАТАРА --- */
/* Добавить в конец player_detail.css */
/* ========================================================= */

/* Контейнер аватара должен быть relative для позиционирования иконок */
.player-avatar-container {
    position: relative;
}

.avatar-achievements {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.avatar-achievement-icon {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3d2b5a 0%, #355a8a 100%);
    border: 2px solid rgba(100, 150, 200, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.avatar-achievement-icon:hover {
    transform: scale(1.25) !important;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.5);
}

/* +N кнопка */
.avatar-achievement-more {
    font-size: 10px !important;
    font-weight: 700;
    color: #b3b3b3;
}

/* Редкость — цвет рамки иконки */
.avatar-achievement-icon.rarity-legendary {
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.avatar-achievement-icon.rarity-epic {
    border-color: #9B59B6;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
}
.avatar-achievement-icon.rarity-rare {
    border-color: #3498DB;
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.4);
}
.avatar-achievement-icon.rarity-common {
    border-color: rgba(100, 150, 200, 0.5);
}

/* ========================================================= */
/* --- МОДАЛКА СО ВСЕМИ ДОСТИЖЕНИЯМИ --- */
/* ========================================================= */

.achievements-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.achievements-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: linear-gradient(135deg, #3d2b5a 0%, #355a8a 100%);
    border: 2px solid rgba(100, 150, 200, 0.5);
    border-radius: 20px;
    width: min(520px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.achievements-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(100, 150, 200, 0.3);
    flex-shrink: 0;
}

.achievements-modal-header h3 {
    color: #00FFFF;
    margin: 0;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.modal-close-btn {
    background: transparent;
    border: 1px solid rgba(100, 150, 200, 0.5);
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close-btn:hover {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #f44336;
}

.achievements-modal-list {
    overflow-y: auto;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Скроллбар в стиле сайта */
.achievements-modal-list::-webkit-scrollbar {
    width: 6px;
}
.achievements-modal-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.achievements-modal-list::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}
.achievements-modal-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* ========================================================= */
/* --- КАРТОЧКА ДОСТИЖЕНИЯ В МОДАЛКЕ --- */
/* ========================================================= */

.achievement-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(100, 150, 200, 0.2);
    border-left: 3px solid rgba(100, 150, 200, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.achievement-item.rarity-legendary {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.04);
}
.achievement-item.rarity-epic {
    border-left-color: #9B59B6;
    background: rgba(155, 89, 182, 0.04);
}
.achievement-item.rarity-rare {
    border-left-color: #3498DB;
    background: rgba(52, 152, 219, 0.04);
}
.achievement-item.rarity-common {
    border-left-color: rgba(100, 150, 200, 0.5);
}

.achievement-item-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 38px;
    text-align: center;
    line-height: 1;
    margin-top: 2px;
}

.achievement-item-info {
    flex: 1;
    min-width: 0;
}

.achievement-item-name {
    color: #f0f8ff;
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 3px;
}

.achievement-item-desc {
    color: #b3b3b3;
    font-size: 0.85em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.achievement-item-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Бейджи редкости */
.achievement-rarity-badge {
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-legendary {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.badge-epic {
    background: rgba(155, 89, 182, 0.15);
    color: #9B59B6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}
.badge-rare {
    background: rgba(52, 152, 219, 0.15);
    color: #3498DB;
    border: 1px solid rgba(52, 152, 219, 0.3);
}
.badge-common {
    background: rgba(100, 150, 200, 0.1);
    color: #b3b3b3;
    border: 1px solid rgba(100, 150, 200, 0.2);
}

.achievement-type-badge {
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 255, 255, 0.1);
    color: #00FFFF;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.achievement-item-date {
    font-size: 0.75em;
    color: rgba(179, 179, 179, 0.7);
}

.achievement-item-note {
    font-size: 0.8em;
    color: #00FFFF;
    margin-top: 5px;
    opacity: 0.85;
}
/* ========================================================= */
/* --- Стили для страницы ачивок --- */
/* ========================================================= */
/* Файл: static/css/achievements.css */
/* Стили для страницы достижений в стиле player_detail.css */

/* ========================================================= */
/* --- ОСНОВНОЙ КОНТЕЙНЕР --- */
/* ========================================================= */

.achievements-page {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #f0f8ff;
}

/* ========================================================= */
/* --- ЗАГОЛОВОК СТРАНИЦЫ --- */
/* ========================================================= */

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #3d2b5a 0%, #355a8a 100%);
    border-radius: 20px;
    border: 2px solid rgba(100, 150, 200, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.page-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.subtitle {
    color: #b3b3b3;
    font-size: 1em;
    margin: 0;
}

/* ========================================================= */
/* --- ТАБЫ --- */
/* ========================================================= */

.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    color: #b3b3b3;
    font-weight: 500;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tab:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00FFFF;
    color: #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.tab.active {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00FFFF;
    color: #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* ========================================================= */
/* --- СЕКЦИИ РЕДКОСТИ --- */
/* ========================================================= */

.rarity-section {
    margin-bottom: 30px;
}

.rarity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 12px 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rarity-icon {
    font-size: 1.4em;
}

.rarity-label {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rarity-common { color: #b3b3b3; }
.rarity-rare { color: #42a5f5; }
.rarity-epic { color: #ab47bc; }
.rarity-legendary { color: #ff9800; }

/* ========================================================= */
/* --- КАРТОЧКИ ДОСТИЖЕНИЙ --- */
/* ========================================================= */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.ach-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(61, 43, 90, 0.6) 0%, rgba(53, 90, 138, 0.6) 100%);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.ach-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(100, 150, 200, 0.6);
}

.ach-icon {
    font-size: 44px;
    min-width: 54px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.ach-info {
    flex: 1;
    min-width: 0;
}

.ach-name-link {
    font-weight: 700;
    font-size: 1.1em;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.ach-name-link:hover {
    color: #00FFFF;
}

.ach-desc {
    font-size: 0.85em;
    color: #b3b3b3;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ach-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
}

.ach-holders {
    color: #888;
}

.ach-percent {
    color: #00FFFF;
    font-weight: 600;
}

/* ========================================================= */
/* --- СТРИКИ (ПРОГРЕСС) --- */
/* ========================================================= */

.streaks-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.streak-card {
    background: linear-gradient(135deg, rgba(61, 43, 90, 0.7) 0%, rgba(53, 90, 138, 0.7) 100%);
    border: 1px solid rgba(100, 150, 200, 0.4);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.streak-card:hover {
    border-color: rgba(100, 150, 200, 0.6);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.streak-player {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    border: 2px solid #00FFFF;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.player-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00FFFF;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.top-avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto 10px;
    display: block;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #ffffff;
}

.streak-target {
    font-size: 0.85em;
    color: #b3b3b3;
}

.streak-progress {
    margin-bottom: 6px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.fill-common { background: linear-gradient(90deg, #9e9e9e, #bdbdbd); }
.fill-rare { background: linear-gradient(90deg, #42a5f5, #64b5f6); box-shadow: 0 0 8px rgba(66, 165, 245, 0.4); }
.fill-epic { background: linear-gradient(90deg, #ab47bc, #ce93d8); box-shadow: 0 0 8px rgba(171, 71, 188, 0.4); }
.fill-legendary { background: linear-gradient(90deg, #ff9800, #ffb74d); box-shadow: 0 0 8px rgba(255, 152, 0, 0.4); }

.progress-text {
    text-align: right;
    font-weight: 600;
    font-size: 0.95em;
    color: #00FFFF;
}

.streak-detail {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.day-dot {
    font-size: 22px;
}

.day-dot.empty {
    opacity: 0.25;
}

/* ========================================================= */
/* --- ТОП ИГРОКОВ --- */
/* ========================================================= */

.top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.top-card {
    background: linear-gradient(135deg, rgba(61, 43, 90, 0.6) 0%, rgba(53, 90, 138, 0.6) 100%);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.top-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.top-card.gold {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.top-card.silver {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, rgba(158, 158, 158, 0.08) 100%);
}

.top-card.bronze {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.12) 0%, rgba(185, 103, 30, 0.08) 100%);
}

.top-rank {
    font-size: 32px;
    margin-bottom: 10px;
}

.top-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: white;
    margin: 0 auto 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.top-name {
    font-weight: 700;
    font-size: 0.95em;
    color: #ffffff;
    margin-bottom: 6px;
    word-break: break-word;
}

.top-count {
    font-size: 0.8em;
    color: #00FFFF;
    font-weight: 500;
}

/* ========================================================= */
/* --- ПУСТЫЕ СОСТОЯНИЯ --- */
/* ========================================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(61, 43, 90, 0.5) 0%, rgba(53, 90, 138, 0.5) 100%);
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 200, 0.3);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #b3b3b3;
    margin-bottom: 8px;
    font-size: 1.3em;
}

.empty-state p {
    color: #888;
    font-size: 0.95em;
}

/* Карточки обладателей */
.holders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.holder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(61, 43, 90, 0.6) 0%, rgba(53, 90, 138, 0.6) 100%);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.3s ease;
}

.holder-card:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 150, 200, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.holder-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00FFFF;
    flex-shrink: 0;
}

.holder-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border: 2px solid #00FFFF;
    flex-shrink: 0;
}

.holder-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95em;
}

.holder-date {
    font-size: 0.8em;
    color: #888;
}

/* ========================================================= */
/* --- АДАПТИВНОСТЬ --- */
/* ========================================================= */

@media (max-width: 768px) {
    .achievements-page {
        padding: 15px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .tabs {
        gap: 6px;
    }
    
    .tab {
        padding: 10px 18px;
        font-size: 0.9em;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .top-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rarity-header {
        font-size: 1.1em;
    }

    .avatar-achievement-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .achievements-modal {
        max-height: 85vh;
        border-radius: 16px;
    }

    .achievements-modal-header {
        padding: 16px 18px;
    }

    .achievements-modal-list {
        padding: 14px 18px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* На мобиле аватар меньше — уменьшаем иконки */
    .avatar-achievement-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .page-header h1 {
        font-size: 1.5em;
    }
    
    .top-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .streak-player {
        flex-direction: column;
        text-align: center;
    }
    
    .player-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .holders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
}