/* =================================================================== */
/* ===             MODERN BENTO PROFILE CSS (EXTENDED)             === */
/* =================================================================== */

/* 0. ГЛОБАЛЬНЫЕ НАСТРОЙКИ ПРОФИЛЯ */
#profile-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px; /* Чуть больше воздуха для десктопа */
    scroll-behavior: smooth;
}

/* Главный контейнер (Ограничитель ширины) */
.profile-dashboard-container {
    width: 100%;
    max-width: 1400px; /* Оптимальная ширина для Bento-сетки */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Расстояние между основными блоками */
    color: #fff;
    padding-bottom: 80px; /* Отступ под скролл */
}

/* Кастомный скроллбар */
#profile-view::-webkit-scrollbar { width: 6px; }
#profile-view::-webkit-scrollbar-track { background: transparent; }
#profile-view::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.15); border-radius: 4px; }
#profile-view::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.3); }


/* --- 1. HERO SECTION (Шапка + Баланс) --- */
.dashboard-hero {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 66% профиль, 33% баланс */
    gap: 16px;
    min-height: 160px;
}

/* Карточка Профиля */
.hero-profile-card {
    background: var(--bg-panel, #151921); /* Фолбек цвет */
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}

.hero-profile-card.is-vip-glow {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.05);
}

/* Аватар */
.hero-avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2b303b;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}

.hero-avatar.vip-glow {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.hero-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 36px;
    height: 36px;
    background: var(--bg-main, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 3px solid #1e222d;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background-color 0.2s;
    z-index: 2;
}

.hero-avatar-wrapper:hover { transform: scale(1.05); }
.hero-avatar-wrapper:hover .hero-avatar-edit {
    transform: scale(1.1) rotate(-10deg);
    background: #2563eb;
}

/* Информация в шапке */
.hero-info { flex-grow: 1; min-width: 0; } /* min-width fix for flex truncation */

.hero-username {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.2;
    color: #fff;
}

.hero-meta {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Прогресс бар */
.mini-level-bar { width: 100%; max-width: 100%; }
.level-header {
    display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; font-weight: 700;
}
.level-badge { color: #fff; }
.xp-text { color: var(--text-secondary, #9ca3af); }

.custom-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.custom-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    position: relative;
    transition: width 0.5s ease-out;
}
/* Блик на прогресс баре */
.progress-glow {
    position: absolute; top:0; right:0; bottom:0; width: 10px;
    background: rgba(255,255,255,0.6);
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    filter: blur(2px);
}

.hero-bell-btn {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary, #94a3b8);
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.hero-bell-btn:hover { background: rgba(255,255,255,0.15); color: #fff; transform: translateY(-2px); }

/* Карточка Баланса */
.hero-balance-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-balance-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.balance-label {
    font-size: 0.9rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
}
.balance-amount {
    font-size: 2.2rem; font-weight: 900; color: #fff; margin: 12px 0 16px 0;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5); line-height: 1;
}

.btn-shine-effect {
    background: var(--accent-color, #3b82f6);
    color: #fff; border: none; padding: 12px 0; border-radius: 12px;
    font-weight: 700; font-size: 1rem; width: 100%; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; overflow: hidden;
}
.btn-shine-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    background: #2563eb;
}


/* --- 2. ACTIONS GRID (Кнопки действий) --- */
.actions-grid {
    display: grid;
    /* Умная сетка: заполняет пространство, минимум 150px на кнопку */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.action-card {
    background: var(--background-tertiary, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 18px;
    padding: 20px;
    display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 130px;
}

.action-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.action-icon { font-size: 2rem; margin-bottom: 12px; transition: transform 0.3s; }
.action-card:hover .action-icon { transform: scale(1.15) rotate(5deg); }
.action-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: #fff; }
.action-desc { font-size: 0.75rem; color: var(--text-secondary, #94a3b8); line-height: 1.3; }

/* Акцентные карточки */
.highlight-card {
    background: rgba(236, 72, 153, 0.08); border-color: rgba(236, 72, 153, 0.2);
}
.highlight-card:hover { border-color: rgba(236, 72, 153, 0.5); box-shadow: 0 8px 20px rgba(236, 72, 153, 0.15); }

.admin-card-bg {
    background: rgba(249, 115, 22, 0.08); border-color: rgba(249, 115, 22, 0.2);
}


/* --- 3. INFO GRID (Нижняя часть) --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки */
    gap: 16px;
    align-items: start;
}

.info-column, .stats-column { display: flex; flex-direction: column; gap: 16px; }

/* Карточка VIP статуса */
/* --- Карточка VIP статуса --- */
.vip-status-card {
    /* Сложный фон: золотой отсвет слева сверху + темное стекло */
    background: radial-gradient(circle at 0% 0%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
                linear-gradient(165deg, rgba(35, 35, 35, 0.8) 0%, rgba(10, 10, 10, 0.95) 100%);
    
    /* Тонкая, но заметная рамка */
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-top: 1px solid rgba(255, 215, 0, 0.3); /* Верхняя грань светлее (свет падает сверху) */
    
    border-radius: 24px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    
    /* Размытие фона под карточкой */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Объемная тень */
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    
    min-height: 100px;
    transition: all 0.3s ease;
}

.btn-vip-gold {
    position: relative;
    /* Добавлен !important, чтобы перебить Bootstrap или другие темы */
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%) !important;
    border: none !important;
    color: #1a1a1a !important; /* Темно-серый текст */
    
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    
    padding: 12px 24px;
    border-radius: 14px;
    
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 
                0 4px 15px rgba(255, 165, 0, 0.3);
    
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.btn-vip-gold:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 
                0 8px 25px rgba(255, 165, 0, 0.5);
    color: #000 !important;
}

/* Добавляем легкое золотое свечение внутри активной карточки */
.vip-status-card.active::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Карточка Награды (Next Level) */
.next-level-card {
    background: var(--background-tertiary, #1f2937);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 20px;
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    width: 100%;
}

.reward-icon-container {
    width: 56px; height: 56px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.reward-icon { font-size: 1.8rem; }

.reward-info { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.reward-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.reward-title { font-size: 0.95rem; font-weight: 700; color: #fff; }
.reward-xp-left {
    background: rgba(255, 255, 255, 0.08); color: #cbd5e1;
    padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 600;
}
.reward-prizes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.reward-prize-item {
    background: rgba(59, 130, 246, 0.15); color: #93c5fd;
    padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 700;
}

/* Статистика (Achievements) */
.stats-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 16px;
}
.stats-header {
    font-size: 0.85rem; font-weight: 700; color: var(--text-secondary);
    margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 8px;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 в ряд на десктопе */
    gap: 8px;
}
.achievement-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px; padding: 10px 5px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: background 0.2s; min-height: 70px;
}
.achievement-item:hover { background: rgba(255, 255, 255, 0.08); }
.achievement-value { font-size: 1rem; font-weight: 700; color: #fff; }
.achievement-label { font-size: 0.65rem; color: #94a3b8; margin-top: 2px; }

/* Челленджи */
.challenge-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 16px;
    display: flex; gap: 12px; transition: transform 0.2s;
    width: 100%;
}
.challenge-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.06); }
.challenge-icon { font-size: 1.8rem; flex-shrink: 0; }
.btn-telegram-join {
    background: #24A1DE; color: white; padding: 6px 14px; border-radius: 8px;
    text-decoration: none; font-size: 0.8rem; font-weight: 600; margin-left: auto;
}
.btn-telegram-join:hover { background: #1f8ebf; color: white; }
.reward-pill { font-size: 0.7rem; background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; color: #fbbf24; }

/* --- 4. FOOTER --- */
.dashboard-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.text-logout-btn {
    background: transparent; border: 1px solid rgba(239, 68, 68, 0.4); color: #ef4444;
    font-weight: 600; cursor: pointer; padding: 10px 24px; border-radius: 12px;
    transition: all 0.2s;
}
.text-logout-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; color: #f87171; }

/* === MODERN CHALLENGE CARD === */

/* Контейнер карточки */
.challenge-card-modern {
    background: var(--bg-panel, #1e232e); /* Темный фон */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.challenge-card-modern:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* 1. Шапка (Иконка + Текст) */
.challenge-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Квадратная подложка под иконку */
.challenge-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.challenge-icon-box.audio {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}
.challenge-icon-box.art {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f472b6;
}

.challenge-meta {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.challenge-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    line-height: 1.2;
}

.challenge-date {
    font-size: 0.8rem;
    color: #94a3b8; /* Серый текст */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Статус (Badge) */
.status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.pending {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
.status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* 2. Ряд с наградами (Сетка призов) */
.challenge-prizes-row {
    display: flex;
    gap: 8px; /* Отступы между призами */
    flex-wrap: wrap; /* Если не влезут, перенесутся */
    margin-top: 4px;
}

/* Оформление отдельного приза (Badge) */
.prize-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

/* Цвета для мест (Золото, Серебро, Бронза) */
.prize-pill.place-1 {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700; /* Золотой текст */
}

.prize-pill.place-2 {
    background: rgba(226, 232, 240, 0.1);
    border-color: rgba(226, 232, 240, 0.3);
    color: #e2e8f0; /* Серебряный текст */
}

.prize-pill.place-3 {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.3);
    color: #fb923c; /* Бронзовый текст */
}

.prize-icon {
    font-size: 1rem;
}

/* 3. Кнопка "Участвовать" */
.btn-challenge-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Растягиваем на всю ширину */
    padding: 12px 0;
    margin-top: 5px;
    
    background: #0ea5e9; /* Красивый синий цвет */
    color: white !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 10px;
    
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2);
}

.btn-challenge-action:hover {
    background: #0284c7; /* Темнее при наведении */
    transform: translateY(-1px);
}

.btn-challenge-action:active {
    transform: scale(0.98);
}


/* =================================================================== */
/* ===                АДАПТИВНОСТЬ (MOBILE RESPONSIVE)             === */
/* =================================================================== */

/* 1. Планшеты и маленькие ноутбуки (до 992px) */
@media (max-width: 992px) {
    #profile-view {
        padding: 16px; /* Уменьшаем отступы контейнера */
    }

    /* Шапка превращается в колонку */
    .dashboard-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    /* Профиль становится компактнее */
    .hero-profile-card {
        padding: 20px;
    }

    /* Баланс сжимается по высоте, но растягивается по ширине */
    .hero-balance-card {
        display: grid !important;
        /* Левая колонка (текст) растягивается, правая (кнопка) по содержимому */
        grid-template-columns: 1fr auto; 
        /* Две строки для текста: Лейбл и Сумма */
        grid-template-rows: auto auto;
        gap: 2px 20px; /* Отступы: 2px между строками текста, 20px до кнопки */
        padding: 16px 24px !important;
        align-content: center;
        text-align: left; /* Текст прижимаем влево */
    }

    .hero-balance-card::before { background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 80%); }

    .balance-amount {
        grid-column: 1;
        grid-row: 2;
        margin: 0 !important;
        font-size: 1.6rem !important;
        align-self: start; /* Прижимаем к верху ячейки */
        line-height: 1.2;
    }
    .balance-label {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        align-self: end; /* Прижимаем к низу ячейки */
        line-height: 1.2;
    }
    
    /* Кнопка пополнения внутри карточки баланса */
    .btn-shine-effect {
        grid-column: 2;
        grid-row: 1 / span 2; /* Кнопка занимает высоту обеих строк текста */
        width: auto !important;
        min-width: 130px; /* Минимальная ширина кнопки */
        height: 44px; /* Фиксированная высота, чтобы не растягивалась */
        margin: 0 !important;
        align-self: center; /* Центрируем кнопку по вертикали */
        border-radius: 12px;
        font-size: 0.95rem;
    }

    /* Сетка инфо превращается в колонку */
    .info-grid {
        grid-template-columns: 1fr; 
    }
}

/* 3. Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    #profile-view {
        padding: 12px 10px; /* Минимальные отступы */
    }

    .profile-dashboard-container {
        gap: 12px;
    }

    /* Еще меньше аватар */
    .hero-avatar-wrapper {
        width: 80px;
        height: 80px;
    }

    .hero-username { font-size: 1.25rem; }
    .hero-meta { font-size: 0.8rem; gap: 10px; }

    /* Кнопка "Уведомления" (колокольчик) меньше */
    .hero-bell-btn {
        width: 32px; height: 32px;
        top: 12px; right: 12px;
    }
    .hero-bell-btn svg { width: 16px; height: 16px; }

    /* VIP карточка: стек элементов */
    .vip-status-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }
    .vip-status-card .d-flex {
        flex-direction: column;
    }
    .btn-vip-gold {
        margin-left: 0;
        width: 100%;
    }

    /* Награда за уровень */
    .next-level-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    .reward-header {
        flex-direction: column;
        gap: 5px;
    }
    .reward-prizes {
        justify-content: center;
    }

    /* Челленджи */
    .challenge-card {
        flex-wrap: wrap;
    }
    .challenge-card .w-100 .d-flex.align-items-start {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .challenge-icon { margin-right: 0; margin-bottom: 8px; }
    .challenge-rewards { margin-bottom: 10px; justify-content: center; }
    .btn-telegram-join { width: 100%; text-align: center; }

    /* Футер */
    .dashboard-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch; /* Кнопки на всю ширину */
    }
    .text-logout-btn { width: 100%; text-align: center; }
    
    /* Модальные окна (тарифы VIP) */
    .vip-tariff-selector {
        grid-template-columns: 1fr; /* Одна колонка для тарифов */
    }
}

/* =================================================================== */
/* ===      FIX: АДАПТАЦИЯ ДЛЯ КВАДРАТНЫХ МОНИТОРОВ И НОУТБУКОВ    === */
/* ===  (Когда есть 3 колонки, и центр слишком узкий на 1280-1400px) === */
/* =================================================================== */

@media (max-width: 1450px) {
    
    /* 1. Сбрасываем жесткую сетку Bento в одну колонку */
    .dashboard-hero {
        grid-template-columns: 1fr !important; /* Аватар и баланс друг под другом */
        gap: 12px;
    }

    .info-grid {
        grid-template-columns: 1fr !important; /* Статистика и Челленджи друг под другом */
    }

    /* 2. Уменьшаем карточку профиля, чтобы она влезала */
    .hero-profile-card {
        padding: 16px;
        gap: 15px;
    }
    
    .hero-avatar-wrapper {
        width: 80px; /* Уменьшаем аватар */
        height: 80px;
    }
    
    .hero-username {
        font-size: 1.2rem; /* Уменьшаем шрифт имени */
    }
    
    .hero-bell-btn {
        top: 10px; 
        right: 10px;
    }

    /* 3. Исправляем карточку баланса */
    .hero-balance-card {
        display: grid !important;
        /* Левая колонка занимает всё место (1fr), правая — по размеру контента (auto) */
        grid-template-columns: 1fr auto !important; 
        grid-template-rows: auto auto !important;
        gap: 2px 20px; 
        padding: 16px 24px !important;
        align-content: center;
    }

    /* Лейбл "ВАШ БАЛАНС" */
    .balance-label {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        align-self: end;
        text-align: left; /* Текст слева */
    }

    /* Сумма */
    .balance-amount {
        grid-column: 1;
        grid-row: 2;
        margin: 0 !important;
        font-size: 1.6rem !important;
        align-self: start;
        text-align: left; /* Текст слева */
    }

    /* Кнопка "Пополнить" */
    .btn-shine-effect {
        grid-column: 2;
        grid-row: 1 / span 2; /* Занимает высоту двух строк текста */
        
        width: auto !important; /* Кнопка ТОЛЬКО по ширине текста */
        min-width: 140px !important; /* Не даем ей стать слишком маленькой */
        max-width: 200px !important; /* Не даем ей стать гигантской */
        height: 44px !important; /* Фиксированная высота */
        
        margin: 0 !important;
        align-self: center;
        justify-self: end !important; /* Прижимаем К ПРАВОМУ КРАЮ */
        
        padding: 0 25px !important; /* Аккуратные отступы внутри */
        border-radius: 12px;
        font-size: 0.95rem;
    }

    /* 4. Кнопки действий (Пополнить, Промокод...) */
    .actions-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Строго 2 колонки */
    }
    .action-card {
        padding: 15px;
        min-height: 100px;
    }

    /* 5. Исправляем обрезание Челленджей и VIP */
    .vip-status-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .btn-vip-gold {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    /* Адаптация челлендж-карточек для узкого пространства */
    .challenge-card-modern {
        padding: 12px;
    }
    .challenge-header {
        flex-wrap: wrap; /* Разрешаем перенос, если совсем узко */
    }
    .challenge-name {
        font-size: 0.9rem;
    }
    .prize-pill {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    /* 6. Уменьшаем отступы самого контейнера */
    #profile-view {
        padding: 10px 15px;
    }
}