/* === НОВОЕ: СКРЫВАЕМ ПОЛОСЫ ПРОКРУТКИ === */
body::-webkit-scrollbar,
.page::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
body, .page {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* === КОНЕЦ НОВОГО === */

/* 1. Базовые стили */
:root {
    --brand-blue: #397fff;
}

/* === ХАК ДЛЯ SCROLL (ШАГ 1) === */
html {
    height: auto;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #FFFFFF;
    margin: 0;
    padding: 0; 
    box-sizing: border-box;
    min-height: 100vh;
    overflow: hidden;

    /* === ИЗМЕНЕНО: CSS Переменная для позиции градиента (по умолчанию 0% 0%) === */
    --gradient-x: 0% 0%; 
    background-color: #000000;
    /* Теперь позиция градиента берется из переменной --gradient-x */
    background-image: radial-gradient(circle at var(--gradient-x), rgba(57, 127, 255, 0.25) 0%, transparent 40%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Убираем transition, так как позицию меняет JS */
}
/* style.css (Вставьте это новое правило в самый низ style.css) */
/* Отдельное правило для AI, чтобы градиент был по центру на странице чата */
body.ai-active {
    /* Градиент по центру */
    --gradient-x: center center; 
    transition: none; /* Убираем анимацию при переходе в AI */
}

.main-container {
    padding: 0 15px;
}

/* 1.5. Карточка Профиля */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px 10px 15px; /* Уменьшаем отступы */
    text-align: center;
}
.profile-pic-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #2A2A2A; 
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: var(--brand-blue); 
}
.profile-pic-wrapper img { width: 100%; height: 100%; object-fit: cover; }
#profile-name { 
    margin: 0; 
    font-size: 24px; 
    font-weight: 600; 
    color: #FFFFFF; 
    line-height: 1.2; 
    max-width: 100%; 
    overflow: hidden; 
    text-overflow: ellipsis; 
} 
#profile-username { 
    font-size: 16px; 
    color: #AAAAAA; 
    margin-bottom: 5px; /* Уменьшаем нижний отступ */
    line-height: 1.2; 
}

/* === 1.6. КАРТОЧКИ ПРОФИЛЯ (СТЕКЛО БЕЗ ОБВОДКИ) === */
.profile-card-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}
.profile-nav-card {
    /* Эффект стекла */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === ИЗМЕНЕНО: Убрана обводка === */
    
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.profile-nav-card:active {
    background-color: rgba(255, 255, 255, 0.2); 
}
.profile-nav-card tgs-emoji {
    width: 32px;
    height: 32px;
}
.profile-nav-card span {
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
}

/* === НОВОЕ: СКРЫВАЕМ КАРТОЧКИ ДЛЯ ПАРТНЕРОВ === */
body.is-partner #profile-card-frens,
body.is-partner #profile-card-earn,
body.is-partner #profile-card-leaders,
body.is-partner #settings-button {
    display: none !important;
}
/* === КОНЕЦ НОВОГО === */


/* 2. Блок Баланса (ИЗМЕНЕН) */
.balance-hero {
    text-align: center;
    padding: 10px 15px 25px 15px;
    margin-bottom: 15px;
    
    /* === ИЗМЕНЕНО: Убираем фон и линию === */
    background-color: transparent; 
    background-image: none;
    border-bottom: none; /* === УБРАНА ЛИНИЯ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
}
.balance-hero-title { font-size: 14px; font-weight: 500; color: #AAAAAA; }

#balance-info-button {
    width: 18px;
    height: 18px;
    color: #AAAAAA; 
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
}

.balance-hero-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.balance-hero-coin { width: 40px; height: 40px; }
#token-balance-hero { font-size: 48px; font-weight: 700; color: #FFFFFF; line-height: 1.1; }

/* 3. Группа-список (СТЕКЛО БЕЗ ОБВОДКИ) */
.list-group {
    margin: 0 0 15px 0;
    
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === УБРАНА ОБВОДКА === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    border-radius: 12px;
    overflow: hidden;
}
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 17px;
    
    /* === Разделитель внутри списка (оставляем) === */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}
.list-group .list-item:last-child { border-bottom: none; }
.list-item-content { display: flex; align-items: center; gap: 14px; }
.list-item-icon { width: 24px; height: 24px; color: #AAAAAA; }
.list-item-value { font-weight: 500; color: #AAAAAA; }
.list-item-header { padding: 16px 16px 10px 16px; }
.list-item-header h3 { margin: 0 0 4px 0; font-size: 20px; font-weight: 600; }
.list-item-header p { margin: 0; font-size: 14px; color: #AAAAAA; }

/* 4. Поля ввода и кнопки (БЕЗ ОБВОДКИ) */
input[type="text"] {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 12px 16px;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    
    /* === ИЗМЕНЕНО: Стиль стекла для инпута (без обводки) === */
    border: none; /* === УБРАНА ОБВОДКИ === */
    background-color: rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
}
input[type="text"]:focus { border: none; } /* === ИЗМЕНЕНО === */
button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 0 16px 16px 16px;
    padding: 14px;
    background-color: var(--brand-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
button:active { background-color: #2a61cc; }
button svg { width: 20px; height: 20px; stroke-width: 2; color: #FFFFFF; }

/* 5. Таблица Лидеров */
#leaderboard-list .list-item { gap: 15px; }
.leader-rank { font-size: 17px; font-weight: 600; color: #AAAAAA; width: 25px; text-align: center; }
.leader-rank[data-rank="1"] { color: #FFD700; }
.leader-rank[data-rank="2"] { color: #C0C0C0; }
.leader-rank[data-rank="3"] { color: #CD7F32; }
.leader-info { flex-grow: 1; overflow: hidden; }
.leader-name { font-size: 17px; font-weight: 500; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-balance { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; color: #AAAAAA; }
.leader-balance-coin { width: 14px; height: 14px; }

/* --- 6. СТИЛИ ДЛЯ СТРАНИЦ И ТАБ-БАРА --- */
.page {
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%; 
    overflow-y: auto;
    box-sizing: border-box;
    padding-top: calc(constant(safe-area-inset-top) + 50px);
    padding-top: calc(env(safe-area-inset-top) + 50px);
    padding-bottom: 90px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

.page.active { 
    opacity: 1;
    pointer-events: auto;
}
/* === 6.1. ТАБ-БАР (ЧЕРНЫЙ, С ЕЛЕ ЗАМЕТНОЙ ОБВОДКОЙ) === */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; 
    display: flex;
    align-items: stretch; 
    z-index: 50;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);

    /* === ИЗМЕНЕНО: Сплошной темный фон + полупрозрачная обводка === */
    background-color: #000000; /* Черный фон */
    /* Еле заметная белая полупрозрачная линия */
    border-top: 1px solid rgba(255, 255, 255, 0.15); 
    
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
}
.tab-bar-button {
    flex-grow: 1; flex-basis: 0; display: flex; align-items: center; justify-content: center;
    background: none; border: none; padding: 6px 0; margin: 0; border-radius: 0;
    font-family: inherit; 
    -webkit-tap-highlight-color: transparent;
}

.tab-bar-button i {
    font-size: 24px;
    color: #AAAAAA;
    transition: color 0.1s ease;
}
.tab-bar-button.active i {
    color: #FFFFFF;
}
.tab-bar-button:active {
    color: #FFFFFF; 
    background-color: transparent !important;
}

/* Скрываем кнопки Store, Earn и Leaders для всех (как было) */
.tab-bar-button[data-page="store"],
.tab-bar-button[data-page="earn"],
.tab-bar-button[data-page="leaders"] { display: none !important; }

/* Кнопку KB (База знаний) и Frens (Друзья) по умолчанию показываем (если они есть в HTML) */
.tab-bar-button[data-page="kb"],
.tab-bar-button[data-page="frens"] { display: flex; } 

.admin-button { display: none; }
body.is-admin .admin-button { display: flex; }

/* === НОВОЕ: СКРЫТИЕ КНОПОК ТАБ-БАРА ДЛЯ ПАРТНЕРОВ === */
body.is-partner .tab-bar-button[data-page="kb"],
body.is-partner .tab-bar-button[data-page="frens"] {
    display: none !important;
}
/* === КОНЕЦ НОВОГО === */


/* --- 7. АДМИН-ПАНЕЛЬ --- */
#admin-user-list .list-item { cursor: pointer; transition: background-color 0.2s ease; }
#admin-user-list .list-item:active { background-color: rgba(0, 0, 0, 0.2); }
#admin-user-list .admin-user-info { flex-grow: 1; overflow: hidden; }
#admin-user-list .admin-user-name { font-size: 17px; font-weight: 500; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#admin-user-list .admin-user-id { font-size: 13px; color: #AAAAAA; }
#admin-user-list .admin-user-balance { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 600; color: var(--brand-blue); }
.admin-user-balance-coin { width: 16px; height: 16px; }

/* 7.1. Вкладки Админки */
.admin-tabs-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px; 
    padding: 0 15px;
}
.admin-tab-btn {
    flex-grow: 1; 
    padding: 10px 12px; 
    border-radius: 8px; 
    border: none;
    font-size: 15px; 
    font-weight: 600;
    cursor: pointer;  /* === ИСПРАВЛЕНО: Добавлена точка с запятой === */
    background: #2A2A2A; 
    color: #AAAAAA; 
    transition: background-color 0.2s ease, color 0.2s ease;
}
.admin-tab-btn.active { background: var(--brand-blue); color: #FFFFFF; }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* === 7.2. СТИЛИ АДМИНКИ (Списки БЗ) === */
.admin-add-new-btn {
    width: auto; padding: 6px 12px;
    margin: 0; font-size: 14px;
    position: absolute; top: 12px; right: 16px;
}
.list-item-header {
    position: relative;
}
.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}
.admin-list-item:last-child { border-bottom: none; }
.admin-item-info { flex-grow: 1; overflow: hidden; }
.admin-item-info .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-info .details { font-size: 13px; color: #AAAAAA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-controls { display: flex; gap: 8px; flex-shrink: 0; }
.admin-item-controls .edit-btn,
.admin-item-controls .delete-btn {
    width: 40px; height: 32px; padding: 0; margin: 0;
    background: #333;
}
.admin-item-controls .delete-btn { background: #552222; }
.admin-item-controls .edit-btn:active { background: #444; }
.admin-item-controls .delete-btn:active { background: #773333; }
.admin-item-controls svg { width: 18px; height: 18px; }


/* --- 8. МОДАЛЬНЫЕ ОКНА (СТЕКЛО БЕЗ ОБВОДКИ) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 15px;
}
.modal-content {
    width: 100%;
    max-width: 320px;
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box; 
    position: relative;
    
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    background-color: rgba(40, 40, 40, 0.7); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none; /* === УБРАНА ОБВОДКИ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
}
.modal-content h4 { margin: 0 0 15px 0; font-size: 20px; font-weight: 600; text-align: center; }
.modal-content p { margin: 0 0 16px 0; font-size: 15px; color: #AAAAAA; text-align: center; }
.modal-content label { display: block; font-size: 13px; font-weight: 500; color: #AAAAAA; margin-bottom: 6px; }

/* === ИЗМЕНЕНО: Инпуты в модалке (БЕЗ ОБВОДКИ) === */
.modal-content input[type="number"],
.modal-content input[type="text"],
.modal-content select,
.modal-content textarea {
    display: block; width: 100%; margin: 0 0 10px 0; padding: 12px;
    font-size: 16px; font-family: inherit; border-radius: 8px;
    color: #FFFFFF; box-sizing: border-box; outline: none;
    -webkit-appearance: none;
    
    border: none; /* === УБРАНА ОБВОДКИ === */
    background-color: rgba(0, 0, 0, 0.2);
}
/* === КОНЕЦ ИЗМЕНЕНИЙ === */

.modal-content textarea { resize: vertical; min-height: 80px; }
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus { border: none; } /* === ИЗМЕНЕНО === */
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex-grow: 1; width: auto; margin: 0; padding: 12px; }
.modal-btn-primary { background-color: var(--brand-blue); color: #FFFFFF; }
.modal-btn-primary:active { background-color: #2a61cc; }
.modal-btn-secondary { background-color: #333; color: #FFFFFF; }
.modal-btn-secondary:active { background-color: #444; }

.modal-content .kb-admin-form { padding: 0; gap: 10px; }
.modal-content .kb-admin-form button { margin: 0; }
.modal-content .kb-admin-form label { margin-bottom: -4px; }


/* --- 9. СТРАНИЦА ЛИДЕРОВ (СТЕКЛО БЕЗ ОБВОДКИ) --- */
.leaderboard-hero {
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === УБРАНА ОБВОДКИ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px; 
}
.leaderboard-cup-img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 10px; }
.leaderboard-hero h2 { margin: 0; font-size: 28px; font-weight: 700; color: #FFFFFF; }
.leaderboard-hero p { margin: 4px 0 0 0; font-size: 15px; color: #DDD; }

/* === 10. СТИЛИ ДЛЯ КЛИЕНТА БЗ (СТРАНИЦЫ) === */
.page-header {
    margin-bottom: 20px;
}
.page-header h2 { font-size: 28px; font-weight: 700; margin: 0 0 4px 0; }
.page-header p { font-size: 15px; color: #AAAAAA; margin: 0; }

.page-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--brand-blue);
    font-size: 16px;
    font-weight: 500;
    padding: 0;
    margin: 0 0 8px 0;
    width: auto;
    cursor: pointer;
}
.page-back-btn:active { background: none; color: #2a61cc; }
.page-back-btn svg { width: 20px; height: 20px; margin-left: -5px; }


/* === 10.1. СЕТКА КАТЕГОРИЙ (СТЕКЛО БЕЗ ОБВОДКИ) === */
#kb-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.kb-category-card {
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === УБРАНА ОБВОДКИ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.kb-category-card:active {
    background-color: rgba(255, 255, 255, 0.2);
}
.kb-category-card h4 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
}
.kb-category-card p {
    margin: 0;
    font-size: 14px;
    color: #AAAAAA;
}

/* === 10.2. СПИСОК СТАТЕЙ (СТЕКЛО БЕЗ ОБВОДКИ) === */
.kb-article-card {
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === УБРАНА ОБВОДКИ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.kb-article-card:active { 
    background-color: rgba(255, 255, 255, 0.2);
}
.kb-article-card-icon {
    width: 50px; height: 50px; border-radius: 10px;
    background-color: #333; background-size: cover; background-position: center;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--brand-blue);
}
.kb-article-card-info { flex-grow: 1; overflow: hidden; }
.kb-article-card-info h4 {
    margin: 0 0 4px 0; font-size: 17px; font-weight: 600; color: #FFFFFF;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-article-card-info p {
    margin: 0; font-size: 14px; color: #AAAAAA;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* === 10.3. СТРАНИЦА СТАТЬИ (БЗ, Экран 3) === */
.kb-article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #333;
}
#page-kb-article h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 15px 0 8px 0;
}
#page-kb-article p {
    font-size: 16px;
    color: #DDDDDD;
    line-height: 1.5;
    margin-bottom: 20px;
    white-space: normal;
}

/* === 10.4. ЛИПКИЙ ФУТЕР (ПРОЗРАЧНЫЙ) И СТЕКЛЯННАЯ КНОПКА === */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: none;
    gap: 8px;
    z-index: 100;
    
    /* === ИЗМЕНЕНО: Полностью прозрачный фон === */
    background-color: transparent;
    border-top: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    padding-bottom: calc(15px + constant(safe-area-inset-bottom));
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
}

/* Общие стили для кнопок в футере (остались) */
.sticky-footer button {
    width: auto; 
    margin: 0;
    flex-grow: 1; 
    border-radius: 999px; 
    font-weight: 700; 
    padding: 14px; 
}

/* Кнопка "Назад" (мы ее удалили, но стиль на всякий случай убираем) */
#kb-article-back-btn {
    display: none; /* Скрываем на случай, если осталась в HTML */
}

/* Кнопка "Перейти" (ДЕЛАЕМ СТЕКЛЯННОЙ) */
#kb-article-link-btn {
    flex-grow: 1; 
    
    /* === НОВОЕ: Эффект стекла === */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}
#kb-article-link-btn:active {
    background-color: rgba(255, 255, 255, 0.2); /* Чуть светлее при нажатии */
}
.sticky-footer button {
    width: auto; 
    margin: 0;
    flex-grow: 1; 
    border-radius: 999px; 
    font-weight: 700; 
    padding: 14px; 
}
#kb-article-back-btn {
    background-color: #333;
    color: #FFFFFF;
    flex-grow: 0; 
    flex-basis: auto; 
    padding: 14px 20px; 
}
#kb-article-back-btn:active {
    background-color: #444;
}
#kb-article-link-btn {
    flex-grow: 1; 
}


/* === 10.5. ЛОГИКА СКРЫТИЯ ТАБ-БАРА - ИЗМЕНЕНО === */
body.kb-article-active .tab-bar {
    display: none;
}
body.kb-article-active #kb-article-footer {
    display: flex;
}
body.kb-article-active .page-full-article {
    padding-bottom: 130px; 
}

/* === 11. СТИЛИ ДЛЯ PAGE-FRENS (СТЕКЛО БЕЗ ОБВОДКИ) === */
.frens-bonus-card {
    /* === ИЗМЕНЕНО: Эффект стекла (без обводки) === */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none; /* === УБРАНА ОБВОДКИ === */
    /* === КОНЕЦ ИЗМЕНЕНИЙ === */
    
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.frens-bonus-coin {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}
.frens-bonus-info h4 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 600;
    color: #FFFFFF;
}
.frens-bonus-info span {
    font-size: 14px;
    color: #AAAAAA;
}

#page-frens .list-item-icon {
    width: 24px;
    height: 24px;
    font-size: 22px;
    text-align: center;
    color: #AAAAAA;
}

/* Скрытие/показ футера для page-frens */
body.frens-active .tab-bar {
    display: none;
}
body.frens-active #frens-footer {
    display: flex;
}
body.frens-active #page-frens {
    padding-bottom: 105px;
}
/* === 12. СТИЛИ ДЛЯ ЗАГЛУШКИ (ПУСТАЯ СТРАНИЦА) === */

.empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh; /* Чтобы блок был по центру экрана */
    padding: 20px 0;
}

.empty-placeholder-img {
    width: 100%;
    max-width: 320px; /* Макс. ширина для горизонтального фото */
    border-radius: 12px; /* Сделаем красиво */
    margin-bottom: 25px;
    background-color: transparent; /* Фон на случай, если картинка не загрузится */
}

.empty-placeholder h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #FFFFFF;
}

.empty-placeholder p {
    font-size: 16px;
    color: #AAAAAA;
    margin: 0;
    line-height: 1.5;
    max-width: 300px;
}
/* === 13. СТИЛИ ДЛЯ РЕГИСТРАЦИИ И ЗАГРУЗКИ === */

/* Спиннер загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-bottom-color: #FFFFFF;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: spin 1s linear infinite;
}

/* Форма регистрации */
.page-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-form label {
    font-size: 14px;
    font-weight: 500;
    color: #AAAAAA;
    margin-bottom: -5px;
}

/* Стилизуем инпуты, селекты и textarea */
.page-form input[type="text"],
.page-form select,
.page-form textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    color: #FFFFFF;
    -webkit-appearance: none;
    
    /* Эффект стекла */
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.page-form input[type="text"]:focus,
.page-form select:focus,
.page-form textarea:focus {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Кнопка отправки */
#register-submit-btn {
    width: 100%;
    margin: 15px 0 0 0;
}
#register-submit-btn {
    border-radius: 999px; /* === НОВОЕ: Полное закругление === */
}
/* === 14. ПРАВКИ АДМИНКИ ЮЗЕРОВ === */

/* Делаем .admin-user-id чуть меньше, чтобы помещался баланс */
#admin-tab-users .admin-user-id {
    font-size: 13px;
    color: #AAAAAA;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Наследуем стили имени из .admin-item-info */
#admin-tab-users .admin-user-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* === 15. ЛОГИКА СКРЫТИЯ ТАБ-БАРА === */

/* Скрываем на служебных страницах */
body.hide-tab-bar .tab-bar {
    display: none;
}


/* Скрываем навигационную панель и показываем футер чата */
/* === 16. СТИЛИ ДЛЯ AI ЧАТА === */

body.ai-active .tab-bar {
    display: none !important;
}

/* Футер ввода: Закругление плашки */
body.ai-active .ai-input-footer,
body.ai-active #ai-input-footer {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: #000000;
    
    /* === СТИЛИ ДЛЯ ЗАКРУГЛЕНИЯ ПЛАШКИ ChatGPT === */
    border-top-left-radius: 18px; 
    border-top-right-radius: 18px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5); 
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Едва заметный разделитель */
    /* === КОНЕЦ СТИЛЕЙ ЗАКРУГЛЕНИЯ === */

    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 9999;
}

/* Исправляем отступ страницы */
body.ai-active #page-ai {
    padding-bottom: 75px !important; 
}

/* Стилизация input для формы: Круглый вид */
.ai-input-footer input[type="text"] {
    width: 100%;
    border: none !important;
    background-color: rgba(255, 255, 255, 0.1); 
    
    border-radius: 999px; /* Полностью круглый */
    padding: 12px 20px; 
    margin: 0;
    color: #FFFFFF;
}

/* Стилизация кнопки отправки: Круглая кнопка */
.ai-input-footer button {
    border-radius: 999px; /* Круглая кнопка */
    padding: 0;
    width: 45px; 
    height: 45px;
    margin: 0;
    flex-shrink: 0;
}

/* === ИСПРАВЛЕННЫЕ СТИЛИ ЧАТА (Пузырьки) === */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.message {
    display: flex;
    max-width: 85%;
    word-wrap: break-word; /* Переносим длинные слова */
}

.user-message {
    justify-content: flex-end;
    align-self: flex-end;
}

.ai-message {
    justify-content: flex-start;
    align-self: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.4;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word; /* === НОВОЕ: Правильный перенос слов === */
    display: inline-block; /* === НОВОЕ: Помогает с высотой === */
}

.user-message .message-content {
    background-color: var(--brand-blue);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

/* === ИСПРАВЛЕНО: AI сообщения теперь с фоном === */
.ai-message .message-content {
    background-color: #2a2a2a; /* === ИЗМЕНЕНО: Более видимый фон === */
    color: #DDDDDD;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1); /* === НОВОЕ: Тонкая обводка === */
}

/* Стиль для Markdown (заголовки, списки) */
.ai-message .message-content h1,
.ai-message .message-content h2,
.ai-message .message-content h3 {
    font-size: 1.1em;
    font-weight: 700;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    color: #FFFFFF; /* === НОВОЕ: Белые заголовки === */
}

.ai-message .message-content p {
    margin: 0.5em 0;
}

.ai-message .message-content ul,
.ai-message .message-content ol {
    padding-left: 20px;
    margin: 0.5em 0;
}

.ai-message .message-content li {
    margin-bottom: 0.3em;
}

.ai-message .message-content code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.ai-message .message-content pre {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5em 0;
}

/* === НОВЫЕ СТИЛИ ДЛЯ АДМИН-ДАШБОРДА === */
.admin-dashboard-block {
    padding: 0 15px;
    margin-bottom: 25px;
}

.admin-dashboard-block h3 {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 12px 0;
    padding-bottom: 0;
    border: none;
}

/* === СТАТИСТИКА: 3 ПЛАШКИ В РЯД === */
.admin-dashboard-block .stat-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.stat-row .profile-nav-card {
    flex: 1;
    padding: 14px 8px;
    min-width: 0;
}

/* === УПРАВЛЕНИЕ ФУНКЦИЯМИ: 3 ПЛАШКИ В РЯД === */
.admin-dashboard-block .control-grid {
    /* Удален display: flex, он был переопределен в HTML,
       но оставляем класс для стилизации карточек */
    gap: 10px;
    width: 100%;
}

.control-grid .profile-nav-card {
    flex: none; /* Убираем flex: 1, чтобы не конфликтовал с Grid */
    padding: 14px 8px;
    min-width: 0;
}

/* === УНИВЕРСАЛЬНЫЕ СТИЛИ ДЛЯ ПЛАШЕК === */
.profile-nav-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-nav-card:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Иконка */
.profile-nav-card .profile-nav-icon {
    font-size: 24px;
    color: var(--brand-blue);
    width: 24px;
    height: 24px;
}

/* === ВАЖНО: РАЗНЫЕ РАЗМЕРЫ ДЛЯ ЦИФРЫ И ТЕКСТА === */
/* Первый span — ЦИФРА (большая) */
.stat-row .profile-nav-card span:first-of-type {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
}

/* Второй span — текст (маленький) */
.stat-row .profile-nav-card span:last-of-type {
    font-size: 11px;
    font-weight: 500;
    color: #AAAAAA;
}

/* Для управления функциями (просто текст) */
.control-grid .profile-nav-card span {
    font-size: 13px;
    font-weight: 500;
    color: #FFFFFF;
}
/* === 17. СТИЛИ ДЛЯ АНАЛИТИКИ (PAGE-ADMIN-ANALYTICS) === */

.analytics-block {
    margin-bottom: 20px;
}

.funnel-chart {
    padding: 15px 10px;
}

.funnel-step {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.funnel-bar-container {
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.funnel-bar {
    height: 100%;
    background-color: var(--brand-blue);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.funnel-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.funnel-labels .step-name {
    color: #FFFFFF;
}

.funnel-labels .step-count {
    color: #AAAAAA;
}

/* Стиль для списка событий (аналогично админ-листу) */
#analytics-events-list .analytics-event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
}

#analytics-events-list .analytics-event-item:last-child {
    border-bottom: none;
}

#analytics-events-list .event-name {
    font-weight: 500;
    color: #FFFFFF;
}

#analytics-events-list .event-count {
    font-weight: 600;
    color: var(--brand-blue);
}