/* =========================================================
   LOUREED DESIGN V2 — отдельный CSS
   Перекрывает старые стили. Основа — тёмный сине-фиолетовый
   ========================================================= */

/* =========================================================
   1. ПАЛИТРА
   ========================================================= */

:root {
    --bg:          #1a1a2e;
    --bg-2:        #16162a;
    --surface:     #23233f;
    --surface-2:   #2a2a4a;
    --surface-3:   #35355a;
    --line:        rgba(255, 255, 255, 0.08);
    --line-2:      rgba(255, 255, 255, 0.05);
    --text:        #f5f4fb;
    --muted:       #9a97b8;
    --muted-2:     #6e6b8a;
    --accent:      #7b6cf6;
    --accent-2:    #6a5ce8;
    --accent-soft: rgba(123, 108, 246, 0.15);
    --bubble-in:   #2a2a4a;
    --bubble-out:  #7b6cf6;
    --online:      #4ade80;
    --shadow:      0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Применяем фон и цвет текста */
body {
    background:
        radial-gradient(circle at 15% 10%, rgba(123, 108, 246, 0.10), transparent 30%),
        radial-gradient(circle at 85% 90%, rgba(80, 70, 180, 0.08), transparent 32%),
        var(--bg) !important;
    color: var(--text) !important;
}

/* Общий layout */
#messenger.app {
    background: rgba(20, 20, 40, 0.55) !important;
}

/* =========================================================
   2. САЙДБАР
   ========================================================= */

.sidebar {
    background: #1c1c34 !important;
    border-right: 1px solid var(--line-2) !important;
    padding: 20px 14px 14px !important;
}

/* =========================================================
   3. BRAND-ROW (логотип сверху)
   ========================================================= */

.brand-row {
    padding: 0 6px 22px !important;
}

.brand .logo,
.logo {
    background: linear-gradient(135deg, #9b8dff, #6a5ce8) !important;
    box-shadow: 0 8px 22px rgba(123, 108, 246, 0.35) !important;
}

.brand-name {
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    font-size: 19px !important;
}

/* Connection pill */
.connection-pill {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--line-2) !important;
    color: var(--muted) !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
}
.connection-pill.online {
    color: var(--online) !important;
}
.connection-pill.online .connection-dot {
    background: var(--online) !important;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.7) !important;
}

/* =========================================================
   4. ПОИСК
   ========================================================= */

.search input {
    background: #16162a !important;
    border: 1px solid var(--line-2) !important;
    color: var(--text) !important;
    border-radius: 14px !important;
    height: 44px !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}
.search input::placeholder {
    color: var(--muted-2) !important;
}
.search input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.search-icon {
    color: var(--muted-2) !important;
}

/* =========================================================
   5. SECTION TITLE
   ========================================================= */

.section-title {
    color: var(--muted-2) !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
    padding: 0 10px 10px !important;
    text-transform: uppercase !important;
}

/* =========================================================
   6. СПИСОК ЧАТОВ
   ========================================================= */

#users .user {
    padding: 10px 10px !important;
    margin: 2px 0 !important;
    border-radius: 16px !important;
    gap: 12px !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
    background: transparent !important;
    min-height: 68px !important;
    position: relative !important;
}

#users .user:hover {
    background: rgba(255, 255, 255, 0.035) !important;
}

#users .user.active {
    background: linear-gradient(90deg, rgba(123, 108, 246, 0.20), rgba(123, 108, 246, 0.06)) !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
}

/* Аватарка — круглая */
#users .user .user-avatar,
#users .user .avatar,
#users .user-avatar {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    flex: 0 0 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #4a4478, #2a2a4a);
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    position: relative !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}

/* Онлайн-точка ВНУТРИ аватарки (справа внизу) */
#users .user .user-avatar.is-online::after,
#users .user .avatar.is-online::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 13px !important;
    height: 13px !important;
    border-radius: 50% !important;
    background: var(--online) !important;
    border: 3px solid #1c1c34 !important;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5) !important;
}

/* Имя */
#users .user .user-name,
#users .user .name {
    font-size: 15px !important;
    font-weight: 650 !important;
    color: var(--text) !important;
    letter-spacing: -0.01em !important;
}

/* Превью */
#users .user .user-preview {
    font-size: 13px !important;
    color: var(--muted) !important;
    margin-top: 3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Время справа */
#users .user .user-time,
#users .user .time {
    font-size: 11px !important;
    color: var(--muted-2) !important;
    font-weight: 500 !important;
}

/* Непрочитанные */
#users .user.unread {
    background: rgba(123, 108, 246, 0.05) !important;
}
#users .user.unread .user-name {
    font-weight: 750 !important;
}

/* Бейдж непрочитанных — ФИОЛЕТОВЫЙ */
.unread-badge {
    background: var(--accent) !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 6px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(123, 108, 246, 0.4) !important;
}

/* Разделители между чатами — почти невидимые */
#users .user + .user {
    border-top: none !important;
}

/* =========================================================
   7. БЛОК АККАУНТА ВНИЗУ
   ========================================================= */

.account {
    border-top: 1px solid var(--line-2) !important;
    padding: 12px 6px 4px !important;
    margin-top: 8px !important;
}

.account-avatar {
    background: linear-gradient(145deg, #6a5ce8, #4a3a9a);
    color: #ffffff !important;
    font-weight: 700 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(123, 108, 246, 0.35) !important;
}

.account-label {
    color: var(--muted-2) !important;
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
}

.account-name {
    color: var(--text) !important;
    font-weight: 650 !important;
    font-size: 13px !important;
}

.logout-btn {
    color: var(--muted) !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}
.logout-btn:hover {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* =========================================================
   8. КНОПКИ ЛИДЕРБОРД / ПРОФИЛЬ
   ========================================================= */

.sidebar-meta button {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--line-2) !important;
    color: var(--muted) !important;
    border-radius: 12px !important;
    padding: 10px 8px !important;
    font-weight: 600 !important;
    transition: all 0.15s ease !important;
}

.sidebar-meta button:hover {
    background: var(--accent-soft) !important;
    border-color: rgba(123, 108, 246, 0.35) !important;
    color: #d4c9ff !important;
}


/* =========================================================
   9. НИЖНЯЯ МОБИЛЬНАЯ НАВИГАЦИЯ (только иконки)
   ========================================================= */

@media (max-width: 700px) {

    /* Панель */
    #messenger .mobile-bottom-nav,
    .mobile-bottom-nav,
    #mobileBottomNav {
        background: rgba(35, 35, 63, 0.96) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 26px !important;
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.45),
            0 4px 12px rgba(0, 0, 0, 0.25) !important;
        backdrop-filter: blur(20px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
        padding: 0 !important;
        height: 58px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        left: 14px !important;
        right: 14px !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-around !important;
    }

    /* Кнопки — БЕЗ фонов, чистые иконки */
    #messenger .mobile-bottom-nav button,
    .mobile-bottom-nav button,
    #mobileBottomNav button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        border-radius: 0 !important;
        display: grid !important;
        place-items: center !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        color: var(--muted) !important;
        font-size: 22px !important;
        line-height: 1 !important;
        cursor: pointer !important;
        padding: 0 !important;
        transition: color 0.18s ease, transform 0.15s ease, text-shadow 0.18s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        opacity: 0.7 !important;
    }

    /* Hover (десктоп) */
    #messenger .mobile-bottom-nav button:hover,
    .mobile-bottom-nav button:hover {
        color: #d4c9ff !important;
        opacity: 1 !important;
    }

    /* Активная иконка — фиолетовая + свечение */
    #messenger .mobile-bottom-nav button.active,
    .mobile-bottom-nav button.active,
    #mobileBottomNav button.active {
        background: transparent !important;
        color: var(--accent) !important;
        box-shadow: none !important;
        opacity: 1 !important;
        text-shadow: 0 0 14px rgba(123, 108, 246, 0.85) !important;
        transform: scale(1.08) !important;
    }

    /* Нажатие */
    #messenger .mobile-bottom-nav button:active,
    .mobile-bottom-nav button:active {
        transform: scale(0.92) !important;
    }

    /* SVG внутри кнопок */
    #messenger .mobile-bottom-nav button svg,
    .mobile-bottom-nav button svg {
        width: 22px !important;
        height: 22px !important;
        stroke: currentColor !important;
    }

    /* Эмодзи внутри кнопок */
    #messenger .mobile-bottom-nav button > *:not(svg),
    .mobile-bottom-nav button > *:not(svg) {
        font-size: 22px !important;
        line-height: 1 !important;
    }
}

/* =========================================================
   10. ПРИБИРАЕМ ПАРАЗИТНЫЕ ФОНЫ ПОД ПАНЕЛЬЮ
   ========================================================= */

@media (max-width: 700px) {
    /* Убираем «второй слой» — старый фон от mobile-redesign */
    #messenger .sidebar::after,
    #messenger .app::after {
        display: none !important;
    }

    /* Сам .app на мобильном — не даём лишних теней */
    #messenger.app {
        box-shadow: none !important;
    }

    /* Отступ в списке чатов, чтобы панель не перекрывала последний чат */
    #messenger #users {
        padding-bottom: 90px !important;
    }

    /* Аккаунт внизу — прячем, если панель и так закрывает */
    #messenger .account {
        margin-bottom: 80px !important;
    }
}

/* =========================================================
   11. НИЖНЯЯ НАВИГАЦИЯ V2 — SVG-иконки
   ========================================================= */

@media (max-width: 700px) {

    #messenger .mobile-bottom-nav button,
    .mobile-bottom-nav button,
    #mobileBottomNav button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        cursor: pointer !important;
        color: var(--muted) !important;
        opacity: 0.65 !important;
        transition:
            color 0.18s ease,
            opacity 0.18s ease,
            transform 0.15s ease,
            filter 0.18s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* SVG */
    #messenger .mobile-bottom-nav button svg,
    .mobile-bottom-nav button svg,
    #mobileBottomNav button svg {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
        stroke-width: 2 !important;
        stroke: currentColor !important;
        fill: none !important;
        transition: stroke 0.18s ease !important;
    }

    /* Hover */
    #messenger .mobile-bottom-nav button:hover,
    .mobile-bottom-nav button:hover {
        color: #c8bfff !important;
        opacity: 1 !important;
    }

    /* Активная — фиолетовая, с glow */
    #messenger .mobile-bottom-nav button.active,
    .mobile-bottom-nav button.active,
    #mobileBottomNav button.active {
        color: var(--accent) !important;
        opacity: 1 !important;
        filter: drop-shadow(0 0 10px rgba(123, 108, 246, 0.7)) !important;
        transform: scale(1.08) !important;
    }

    #messenger .mobile-bottom-nav button.active svg,
    .mobile-bottom-nav button.active svg {
        stroke-width: 2.4 !important;
    }

    /* Нажатие */
    #messenger .mobile-bottom-nav button:active,
    .mobile-bottom-nav button:active {
        transform: scale(0.92) !important;
    }
}

/* =========================================================
   12. МОДАЛКА «ИГРЫ»
   ========================================================= */

.games-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 3, 9, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.games-modal-overlay.show {
    display: flex;
    animation: gamesFadeIn 0.18s ease;
}

@keyframes gamesFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.games-modal {
    position: relative;
    width: min(480px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--surface, #23233f);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    animation: gamesSlideUp 0.22s ease;
}

@keyframes gamesSlideUp {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.games-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.games-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #f5f4fb);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-modal-title svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent, #7b6cf6);
    stroke-width: 2;
    fill: none;
}

.games-modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text, #fff);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease;
}

.games-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.games-modal-body {
    padding: 14px 16px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.games-modal-body::-webkit-scrollbar { width: 5px; }
.games-modal-body::-webkit-scrollbar-thumb {
    background: #3a3a5f;
    border-radius: 99px;
}

/* Кнопки разделов внутри модалки «Игры» */
.games-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    margin-bottom: 10px;
}

.games-tile:hover {
    background: rgba(123, 108, 246, 0.10);
    border-color: rgba(123, 108, 246, 0.30);
}

.games-tile:active {
    transform: scale(0.985);
}

.games-tile-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #7b6cf6, #5a4ac8);
    box-shadow: 0 6px 20px rgba(123, 108, 246, 0.35);
}

.games-tile-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
}

.games-tile-text {
    flex: 1 1 auto;
    min-width: 0;
}

.games-tile-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text, #f5f4fb);
    letter-spacing: -0.01em;
}

.games-tile-sub {
    font-size: 12px;
    color: var(--muted, #9a97b8);
    margin-top: 2px;
}


/* =========================================================
   13. СКРЫТИЕ ПАНЕЛИ В ОТКРЫТОМ ЧАТЕ
   ========================================================= */

@media (max-width: 700px) {
    /* Когда открыт чат — панель скрыта */
    #messenger.mobile-chat-open .mobile-bottom-nav,
    #messenger.mobile-chat-open #mobileBottomNav,
    #messenger.mobile-chat-open #mobileBottomNav {
        display: none !important;
    }

    /* Убираем нижний отступ у списка чатов, когда чат открыт */
    #messenger.mobile-chat-open #users {
        padding-bottom: 16px !important;
    }
}

/* =========================================================
   14. ДИАЛОГИ V2 — чат, шапка, пузыри, input
   ========================================================= */

/* ---------- ШАПКА ЧАТА ---------- */

.chat-header {
    background: #1c1c34 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    min-height: 72px !important;
    height: 72px !important;
    padding: 0 20px !important;
    gap: 14px !important;
}

.chat-avatar {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #4a4478, #2a2a4a);
    color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}

.chat-title {
    font-size: 16px !important;
    font-weight: 750 !important;
    letter-spacing: -0.02em !important;
    color: var(--text) !important;
}

.chat-status {
    font-size: 12px !important;
    color: var(--online) !important;
    margin-top: 3px !important;
    font-weight: 500 !important;
}

.chat-actions {
    color: var(--muted) !important;
    font-size: 20px !important;
    gap: 6px !important;
}

/* Кнопки в шапке (колокольчик, ⋯, очистка) — без фона */
.chat-actions .wake-button,
#clearChatButton {
    color: var(--muted) !important;
    background: transparent !important;
    opacity: 0.75 !important;
    transition: opacity 0.15s ease, color 0.15s ease !important;
}
.chat-actions .wake-button:hover,
#clearChatButton:hover {
    opacity: 1 !important;
    color: #d4c9ff !important;
}

/* ---------- ОБЛАСТЬ СООБЩЕНИЙ ---------- */

.messages {
    /* background: НЕ !important — JS-фон должен перебивать */
    background: var(--bg);
    padding: 22px clamp(18px, 4vw, 60px) !important;
}

/* ---------- ПУЗЫРИ ---------- */

.message {
    max-width: min(650px, 78%) !important;
    min-width: 100px !important;
    padding: 10px 14px 8px !important;
    margin: 3px 0 !important;
    border: 0 !important;
    border-radius: 18px 18px 18px 5px !important;
    background: var(--bubble-in) !important;
    color: var(--text) !important;
    font-size: 14.5px !important;
    line-height: 1.45 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    position: relative !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.message.mine {
    align-self: flex-end !important;
    border-radius: 18px 18px 5px 18px !important;
    background: var(--bubble-out) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(123, 108, 246, 0.30) !important;
}

.message:not(.mine) {
    align-self: flex-start !important;
}

/* Текст сообщения — не залезает под время */
.message-text {
    padding-right: 44px !important;
    padding-bottom: 0 !important;
}

/* Время внутри пузыря */
.message-time {
    position: absolute !important;
    right: 12px !important;
    bottom: 6px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    color: rgba(255, 255, 255, 0.55) !important;
    font-weight: 500 !important;
}

.message:not(.mine) .message-time {
    color: rgba(255, 255, 255, 0.42) !important;
}

/* Информация «Вы» — приглушаем */
.message-info {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-bottom: 3px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
}

.message.mine .message-info {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Метка «Изм.» — компактно, в стиле времени */
.message-edited-time {
    right: 46px !important;
    bottom: 6px !important;
    font-size: 9.5px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-weight: 500 !important;
}

/* Кнопка меню сообщения (⋮) */
.message-menu-button {
    opacity: 0.4 !important;
    transition: opacity 0.15s ease !important;
}

.message:hover .message-menu-button {
    opacity: 0.85 !important;
}

/* ---------- EMPTY STATE ---------- */

.empty-chat {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--muted) !important;
    font-size: 13px !important;
    padding: 14px 22px !important;
    border-radius: 16px !important;
}

/* ---------- INPUT-БАР ---------- */

.input-area {
    background: #1c1c34 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 12px 18px !important;
    gap: 10px !important;
    align-items: center !important;
}

.input-area input,
#messageInput {
    height: 46px !important;
    padding: 0 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 24px !important;
    background: #16162a !important;
    color: var(--text) !important;
    font-size: 14.5px !important;
    flex: 1 !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.input-area input:focus,
#messageInput:focus {
    border-color: rgba(123, 108, 246, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.12) !important;
    outline: none !important;
}

.input-area input::placeholder,
#messageInput::placeholder {
    color: var(--muted-2) !important;
}

/* Кнопка отправки */
.send {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    color: #ffffff !important;
    font-size: 18px !important;
    display: grid !important;
    place-items: center !important;
    box-shadow: 0 4px 14px rgba(123, 108, 246, 0.4) !important;
    transition: filter 0.15s ease, transform 0.1s ease !important;
    flex-shrink: 0 !important;
}

.send:hover {
    filter: brightness(1.1) !important;
}

.send:active {
    transform: scale(0.94) !important;
}

.send:disabled {
    opacity: 0.4 !important;
    filter: none !important;
    cursor: not-allowed !important;
}

/* Emoji-кнопка */
#emojiButton {
    color: var(--muted) !important;
    font-size: 22px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    transition: color 0.15s ease, background 0.15s ease !important;
}

#emojiButton:hover {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Emoji picker — в стиле V2 */
#emojiPicker {
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    padding: 12px !important;
}

#emojiPicker button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    font-size: 22px !important;
    transition: background 0.12s ease !important;
}

#emojiPicker button:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- БАР РЕДАКТИРОВАНИЯ ---------- */

.edit-mode-bar {
    background: rgba(123, 108, 246, 0.14) !important;
    border: 1px solid rgba(123, 108, 246, 0.30) !important;
    border-radius: 14px !important;
    padding: 10px 14px !important;
}

.edit-mode-title {
    color: var(--accent) !important;
    font-weight: 700 !important;
}

.edit-mode-preview {
    color: var(--muted) !important;
}

.edit-cancel {
    color: var(--muted) !important;
}
.edit-cancel:hover {
    color: var(--text) !important;
}

/* ---------- МОБИЛЬНАЯ АДАПТАЦИЯ ---------- */

@media (max-width: 700px) {
    .chat-header {
        padding: 0 14px !important;
        min-height: 64px !important;
        height: 64px !important;
    }
    .chat-avatar {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
    .chat-title {
        font-size: 15px !important;
    }
    .chat-status {
        font-size: 11px !important;
    }

    .messages {
        padding: 16px 12px !important;
    }

    .message {
        max-width: 84% !important;
        font-size: 14px !important;
    }

    .input-area {
        padding: 10px 12px !important;
    }

    .input-area input,
    #messageInput {
        height: 44px !important;
        font-size: 14px !important;
    }

    .send {
        width: 44px !important;
        height: 44px !important;
    }
}


/* =========================================================
   15. МЕНЮ ДЕЙСТВИЙ СООБЩЕНИЯ (⋮) — фикс фона
   ========================================================= */

.message-actions-menu {
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55) !important;
    padding: 6px !important;
    min-width: 180px !important;
    z-index: 1000 !important;
}

.message-actions-menu button {
    display: block !important;
    width: 100% !important;
    padding: 10px 12px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--text) !important;
    text-align: left !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: background 0.15s ease !important;
    cursor: pointer !important;
}

.message-actions-menu button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

.message-actions-menu .delete-action {
    color: #ff667a !important;
}

.message-actions-menu .delete-action:hover {
    background: rgba(255, 102, 122, 0.12) !important;
}

/* Кнопка ⋮ на самом сообщении — без фона */
.message-menu-button {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--muted) !important;
}

/* =========================================================
   16. INPUT-БАР — место под emoji
   ========================================================= */

.input-area input,
#messageInput {
    padding-left: 54px !important;
}

/* Убеждаемся, что emoji-кнопка внутри поля */
#emojiButton {
    position: absolute !important;
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    z-index: 2 !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 20px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    padding: 0 !important;
    border: 0 !important;
    cursor: pointer !important;
}

#emojiButton:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text) !important;
}

/* Позиционирование относительно .input-area */
.input-area {
    position: relative !important;
}

/* =========================================================
   17. КНОПКА ОЧИСТКИ ЧАТА (#clearChatButton)
   ========================================================= */

#clearChatButton {
    background: transparent !important;
    color: var(--muted) !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 0.75 !important;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease !important;
}

#clearChatButton:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text) !important;
    opacity: 1 !important;
}

#chatActionsMenu {
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55) !important;
    padding: 6px !important;
}

#chatActionsMenu button {
    color: #ff667a !important;
    border-radius: 10px !important;
    font-size: 14px !important;
}

#chatActionsMenu button:hover {
    background: rgba(255, 102, 122, 0.12) !important;
}

/* =========================================================
   18. МЕНЮ ПОДТВЕРЖДЕНИЯ (Очистить чат / Удалить)
   ========================================================= */

#messengerConfirmBox {
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55) !important;
    color: var(--text) !important;
}

#messengerConfirmTitle {
    color: var(--text) !important;
}

#messengerConfirmText {
    color: var(--muted) !important;
}

#messengerConfirmCancel {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text) !important;
    border-radius: 12px !important;
    transition: background 0.15s ease !important;
}

#messengerConfirmCancel:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

#messengerConfirmOk {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    transition: filter 0.15s ease !important;
}

#messengerConfirmOk:hover {
    filter: brightness(1.1) !important;
}


/* =========================================================
   19. ТОЧНОЕ ПОЗИЦИОНИРОВАНИЕ EMOJI-КНОПКИ
   ========================================================= */

.input-area {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.input-area #emojiButton {
    position: absolute !important;
    left: 8px !important;
    top: 0 !important;
    bottom: 0 !important;
    margin: auto !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    z-index: 5 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    transform: none !important;
}

.input-area #emojiButton:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text) !important;
}

/* На мобильном — чуть компактнее */
@media (max-width: 700px) {
    .input-area #emojiButton {
        left: 6px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 19px !important;
    }
    .input-area input,
    #messageInput {
        padding-left: 52px !important;
    }
}


/* =========================================================
   20. INPUT-БАР — GRID LAYOUT (emoji | input | send)
   ========================================================= */

.input-area {
    display: grid !important;
    grid-template-columns: 46px 1fr 46px !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 10px 14px !important;
    background: #1c1c34 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Emoji — в потоке, не absolute */
.input-area #emojiButton {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    z-index: 2 !important;
}

.input-area #emojiButton:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text) !important;
}

/* Input — на всю ширину между emoji и send */
.input-area input,
#messageInput {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 46px !important;
    min-width: 0 !important;
    padding: 0 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 24px !important;
    background: #16162a !important;
    color: var(--text) !important;
    font-size: 14.5px !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.input-area input:focus,
#messageInput:focus {
    border-color: rgba(123, 108, 246, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.12) !important;
}

.input-area input::placeholder,
#messageInput::placeholder {
    color: var(--muted-2) !important;
}

/* Send — правый столбец */
.input-area .send {
    grid-column: 3 !important;
    grid-row: 1 !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    color: #ffffff !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(123, 108, 246, 0.4) !important;
    transition: filter 0.15s ease, transform 0.1s ease !important;
    margin: 0 !important;
}

.input-area .send:hover {
    filter: brightness(1.1) !important;
}

.input-area .send:active {
    transform: scale(0.94) !important;
}

.input-area .send:disabled {
    opacity: 0.4 !important;
    filter: none !important;
    cursor: not-allowed !important;
}

/* Emoji picker — теперь относительно .input-area */
.input-area #emojiPicker {
    position: absolute !important;
    left: 14px !important;
    bottom: calc(100% + 8px) !important;
    width: min(340px, calc(100vw - 28px)) !important;
    max-height: 260px !important;
    background: var(--surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
    padding: 12px !important;
    z-index: 2000 !important;
}

/* На мобильном — компактнее */
@media (max-width: 700px) {
    .input-area {
        grid-template-columns: 44px 1fr 44px !important;
        gap: 6px !important;
        padding: 8px 10px !important;
    }
    .input-area #emojiButton {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        font-size: 21px !important;
    }
    .input-area input,
    #messageInput {
        height: 44px !important;
        font-size: 14px !important;
        padding: 0 16px !important;
    }
    .input-area .send {
        width: 44px !important;
        height: 44px !important;
    }
}


/* =========================================================
   21. МОДАЛКА ЛИДЕРБОРД — V2
   ========================================================= */

/* Overlay */
#lbLeaderboardModal.lb-modal-overlay,
#lbProfileModal.lb-modal-overlay {
    background: rgba(10, 10, 25, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Само окно */
#lbLeaderboardModal .lb-modal,
#lbProfileModal .lb-modal {
    /* background: НЕ !important — JS-фон должен перебивать */
    background-color: var(--surface, #23233f);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 22px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6) !important;
}

/* Header */
#lbLeaderboardModal .lb-modal-header,
#lbProfileModal .lb-modal-header {
    padding: 18px 20px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#lbLeaderboardModal .lb-modal-title,
#lbProfileModal .lb-modal-title {
    font-size: 17px !important;
    font-weight: 750 !important;
    color: var(--text, #f5f4fb) !important;
    letter-spacing: -0.02em !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Кнопка закрытия */
#lbLeaderboardModal .lb-modal-close,
#lbProfileModal .lb-modal-close {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text, #fff) !important;
    font-size: 22px !important;
    border: 0 !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    transition: background 0.15s ease !important;
}

#lbLeaderboardModal .lb-modal-close:hover,
#lbProfileModal .lb-modal-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Тело */
#lbLeaderboardModal .lb-modal-body,
#lbProfileModal .lb-modal-body {
    padding: 14px 16px 18px !important;
}

/* Строка лидера */
.lb-row {
    padding: 11px 14px !important;
    border-radius: 14px !important;
    gap: 14px !important;
    transition: background 0.15s ease !important;
}

.lb-row.clickable:hover {
    background: rgba(123, 108, 246, 0.10) !important;
}

/* Ранг */
.lb-rank {
    width: 34px !important;
    flex: 0 0 34px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--muted, #9a97b8) !important;
    font-variant-numeric: tabular-nums !important;
}

.lb-rank.medal {
    font-size: 20px !important;
}

/* Аватарка в лидерборде */
.lb-avatar {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    background: linear-gradient(145deg, #4a4478, #2a2a4a);
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Имя */
.lb-name {
    font-size: 14.5px !important;
    font-weight: 650 !important;
    color: var(--text, #f5f4fb) !important;
    letter-spacing: -0.01em !important;
}

/* Баланс */
.lb-score {
    font-size: 14px !important;
    font-weight: 750 !important;
    color: var(--accent, #7b6cf6) !important;
    font-variant-numeric: tabular-nums !important;
}

/* Своя позиция */
.lb-row.me {
    background: linear-gradient(90deg, rgba(123, 108, 246, 0.18), rgba(123, 108, 246, 0.06)) !important;
    border: 1px solid rgba(123, 108, 246, 0.28) !important;
    box-shadow: 0 4px 16px rgba(123, 108, 246, 0.15) !important;
}

/* Разделитель */
.lb-separator {
    margin: 14px 0 8px !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Подсказка внизу */
.lb-hint {
    color: var(--muted-2, #6e6b8a) !important;
    font-size: 12px !important;
    text-align: center !important;
    margin-top: 14px !important;
    letter-spacing: 0.02em !important;
}

/* Empty state */
.lb-empty {
    color: var(--muted, #9a97b8) !important;
    font-size: 14px !important;
    text-align: center !important;
    padding: 30px 10px !important;
}

/* =========================================================
   22. МОДАЛКА ПРОФИЛЬ — V2
   ========================================================= */

.pf-body {
    padding: 26px 22px 22px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Большая аватарка */
.pf-avatar {
    width: 92px !important;
    height: 92px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    background-color: #5a4ac8 !important;
    background-image: linear-gradient(145deg, #9b8dff, #6a5ce8);
    background-size: cover !important;
    background-position: center !important;
    color: #ffffff !important;
    font-size: 38px !important;
    font-weight: 800 !important;
    box-shadow: 0 16px 44px rgba(123, 108, 246, 0.4) !important;
    margin-bottom: 14px !important;
    border: 3px solid rgba(255, 255, 255, 0.06) !important;
    overflow: hidden !important;
}

/* Username */
.pf-username {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--text, #f5f4fb) !important;
    letter-spacing: -0.03em !important;
    text-align: center !important;
    word-break: break-word !important;
    max-width: 100% !important;
}

/* Дата регистрации */
.pf-since {
    font-size: 12.5px !important;
    color: var(--muted, #9a97b8) !important;
    margin-top: 4px !important;
    margin-bottom: 22px !important;
    text-align: center !important;
    letter-spacing: 0.02em !important;
}

/* Карточки статы */
.pf-stat {
    width: 100% !important;
    padding: 14px 18px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
}

.pf-stat:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
}

.pf-stat-label {
    font-size: 13.5px !important;
    color: var(--muted, #9a97b8) !important;
    font-weight: 500 !important;
}

.pf-stat-value {
    font-size: 16px !important;
    font-weight: 750 !important;
    color: var(--text, #f5f4fb) !important;
    font-variant-numeric: tabular-nums !important;
}

.pf-stat-value.fish {
    color: var(--accent, #7b6cf6) !important;
    font-size: 18px !important;
}

/* Кнопка выхода */
.pf-logout {
    width: 100% !important;
    margin-top: 16px !important;
    padding: 14px 16px !important;
    border: 1px solid rgba(255, 102, 122, 0.22) !important;
    border-radius: 16px !important;
    background: rgba(255, 102, 122, 0.10) !important;
    color: #ff667a !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease !important;
    letter-spacing: -0.01em !important;
}

.pf-logout:hover {
    background: rgba(255, 102, 122, 0.18) !important;
    border-color: rgba(255, 102, 122, 0.35) !important;
}

.pf-logout:active {
    transform: scale(0.985) !important;
}

/* =========================================================
   23. МОДАЛКА E2EE-ПАРОЛЬ — V2 (перекрашиваем)
   ========================================================= */

#e2eePasswordOverlay > div {
    background: var(--surface, #23233f) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 22px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6) !important;
}

#e2eePasswordOverlay input {
    background: #16162a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    color: var(--text, #f5f4fb) !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

#e2eePasswordOverlay input:focus {
    border-color: rgba(123, 108, 246, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.12) !important;
    outline: none !important;
}

#e2eePasswordOverlay button#e2eePasswordSubmit {
    background: var(--accent, #7b6cf6) !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(123, 108, 246, 0.35) !important;
    transition: filter 0.15s ease !important;
}

#e2eePasswordOverlay button#e2eePasswordSubmit:hover {
    filter: brightness(1.1) !important;
}


/* =========================================================
   24. КНОПКА «НАЗАД» В ШАПКЕ ЧАТА (мобильная)
   ========================================================= */

/* Убираем кружок/фон у кнопки назад */
.mobile-redesign-back,
#mobileRedesignBack {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--text) !important;
    font-size: 26px !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, opacity 0.15s ease !important;
    opacity: 0.85 !important;
    flex-shrink: 0 !important;
}

.mobile-redesign-back:hover,
#mobileRedesignBack:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    opacity: 1 !important;
}

.mobile-redesign-back:active,
#mobileRedesignBack:active {
    transform: scale(0.92) !important;
}


/* =========================================================
   25. СКРЫТИЕ БЛОКА «ВЫ ВОШЛИ КАК» В САЙДБАРЕ
   ========================================================= */

/* Полностью убираем блок аккаунта */
.sidebar .account {
    display: none !important;
}

/* Компенсируем освободившееся место — увеличиваем нижний отступ у списка чатов */
#users {
    padding-bottom: 20px !important;
}

/* На мобильном — тоже */
@media (max-width: 700px) {
    .sidebar .account {
        display: none !important;
    }
    #messenger #users {
        padding-bottom: 90px !important; /* панель навигации не должна перекрывать */
    }
}


/* =========================================================
   28. ЭКРАН ЛОГИНА — ПОВЕРХ ВСЕГО
   ========================================================= */

#loginScreen.login {
    z-index: 2147483647 !important;
}

/* =========================================================
   29. СКРЫТИЕ ВСЕГО МЕССЕНДЖЕРА ПРИ LOGOUT
   ========================================================= */

body[data-logged-out="true"] #messenger,
body[data-logged-out="true"] #messenger.app,
body[data-logged-out="true"] #messenger .sidebar,
body[data-logged-out="true"] #messenger .chat,
body[data-logged-out="true"] #messenger .mobile-bottom-nav,
body[data-logged-out="true"] #messenger #mobileBottomNav {
    display: none !important;
}

/* А логин — показываем */
body[data-logged-out="true"] #loginScreen.login {
    display: block !important;
}

/* =========================================================
   31. ЭКРАН ЛОГИНА — ФОРС (id в 3 раза + !important)
   ========================================================= */

#loginScreen#loginScreen#loginScreen.login,
#loginScreen#loginScreen#loginScreen.login[style],
body#loginScreen.login {
    background: rgba(35, 35, 63, 0.96) !important;
    background-color: rgba(35, 35, 63, 0.96) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 26px !important;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(123, 108, 246, 0.06) inset !important;
    backdrop-filter: blur(24px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
}

/* Лого */
#loginScreen#loginScreen#loginScreen.login .logo {
    background: linear-gradient(135deg, #9b8dff, #6a5ce8) !important;
    box-shadow: 0 12px 32px rgba(123, 108, 246, 0.45) !important;
}

/* Кнопки */
#loginScreen#loginScreen#loginScreen.login button:nth-of-type(1) {
    background: linear-gradient(135deg, #7b6cf6, #6a5ce8) !important;
    box-shadow: 0 8px 24px rgba(123, 108, 246, 0.4) !important;
}

#loginScreen#loginScreen#loginScreen.login button:nth-of-type(2) {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    color: #9a97b8 !important;
}

/* Инпуты */
#loginScreen#loginScreen#loginScreen.login input {
    background: #16162a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f5f4fb !important;
}

#loginScreen#loginScreen#loginScreen.login input:focus {
    border-color: rgba(123, 108, 246, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.14) !important;
}

/* Заголовки */
#loginScreen#loginScreen#loginScreen.login h2 {
    color: #f5f4fb !important;
}

#loginScreen#loginScreen#loginScreen.login .login-sub {
    color: #9a97b8 !important;
}


/* =========================================================
   32. РАЗДЕЛИТЕЛИ ДАТ В ЧАТЕ
   ========================================================= */

.date-separator {
    align-self: center !important;
    margin: 14px auto !important;
    padding: 5px 14px !important;
    border-radius: 100px !important;
    background: rgba(35, 35, 63, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    user-select: none !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* Первый разделитель — чуть меньше отступ сверху */
.date-separator:first-child {
    margin-top: 8px !important;
}

/* На мобильном — компактнее */
@media (max-width: 700px) {
    .date-separator {
        margin: 12px auto !important;
        padding: 4px 12px !important;
        font-size: 10.5px !important;
    }
}


/* =========================================================
   33. ИКОНКА E2EE (замочек) У СООБЩЕНИЙ
   ========================================================= */

.message-e2ee-lock {
    position: absolute !important;
    right: 12px !important;
    bottom: 6px !important;
    width: 11px !important;
    height: 11px !important;
    opacity: 0.5 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    pointer-events: none !important;
}

.message-e2ee-lock svg {
    width: 11px !important;
    height: 11px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    fill: none !important;
    display: block !important;
}

/* Если есть замочек — сдвигаем время левее, чтобы не мешало */
.message .message-time.has-lock {
    right: 28px !important;
}

/* На мобильном — компактнее */
@media (max-width: 700px) {
    .message-e2ee-lock {
        right: 10px !important;
        bottom: 5px !important;
        width: 10px !important;
        height: 10px !important;
    }
    .message-e2ee-lock svg {
        width: 10px !important;
        height: 10px !important;
    }
    .message .message-time.has-lock {
        right: 26px !important;
    }
}


/* =========================================================
   34. ПУЗЫРИ — правильный layout времени и замочка
   ========================================================= */

.message {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 8px 12px 6px !important;
    padding-right: 12px !important;
}

/* Текст — на всю ширину, без padding-right */
.message .message-text,
.message-text {
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    display: block !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* Инфо «Вы» — компактнее */
.message .message-info,
.message-info {
    margin-bottom: 1px !important;
}

/* Строка с временем и замочком — под текстом, справа */
.message .message-time,
.message-time {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    align-self: flex-end !important;
    margin-top: 2px !important;
    margin-left: auto !important;
    font-size: 10px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: rgba(255, 255, 255, 0.55) !important;
}

.message:not(.mine) .message-time {
    color: rgba(255, 255, 255, 0.42) !important;
}

/* Замочек — теперь в потоке рядом со временем */
.message .message-e2ee-lock,
.message-e2ee-lock {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    width: 10px !important;
    height: 10px !important;
    opacity: 0.6 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.message .message-e2ee-lock svg,
.message-e2ee-lock svg {
    width: 10px !important;
    height: 10px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    fill: none !important;
}

/* Метка «Изм.» — тоже в потоке под текстом */
.message .message-edited-time,
.message-edited-time {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    align-self: flex-end !important;
    margin-top: 1px !important;
    margin-left: auto !important;
    font-size: 9.5px !important;
    color: rgba(255, 255, 255, 0.4) !important;
}


/* =========================================================
   35. СКЕЛЕТОН СПИСКА ЧАТОВ
   ========================================================= */

.users-skeleton {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 4px 0 !important;
}

.users-skeleton-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 10px !important;
    min-height: 68px !important;
}

/* Аватарка-плейсхолдер */
.users-skeleton-avatar {
    width: 50px !important;
    height: 50px !important;
    flex: 0 0 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(
        90deg,
        rgba(123, 108, 246, 0.10) 0%,
        rgba(123, 108, 246, 0.20) 50%,
        rgba(123, 108, 246, 0.10) 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: skeletonShimmer 1.4s ease-in-out infinite !important;
}

/* Колонка с именем и превью */
.users-skeleton-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.users-skeleton-line {
    height: 12px !important;
    border-radius: 6px !important;
    background: linear-gradient(
        90deg,
        rgba(123, 108, 246, 0.10) 0%,
        rgba(123, 108, 246, 0.20) 50%,
        rgba(123, 108, 246, 0.10) 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: skeletonShimmer 1.4s ease-in-out infinite !important;
}

.users-skeleton-line.name {
    width: 45% !important;
    height: 14px !important;
}

.users-skeleton-line.preview {
    width: 70% !important;
    height: 11px !important;
    opacity: 0.7 !important;
}

@keyframes skeletonShimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* На мобильном */
@media (max-width: 700px) {
    .users-skeleton-row {
        min-height: 74px !important;
        padding: 9px 8px !important;
    }
    .users-skeleton-avatar {
        width: 52px !important;
        height: 52px !important;
        flex: 0 0 52px !important;
    }
}


/* =========================================================
   36. УБИРАЕМ КОЛОКОЛЬЧИК (wakeButton) ИЗ ШАПКИ ЧАТА
   ========================================================= */

#wakeButton,
.wake-button,
.chat-actions .wake-button,
#messenger .chat-actions .wake-button {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}


/* =========================================================
   37. РЕАКЦИИ НА СООБЩЕНИЯ
   ========================================================= */

/* ---- Popover выбора реакции ---- */

.reactions-popover {
    position: fixed;
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: var(--surface, #23233f);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 100px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: reactionsPopIn 0.18s ease;
    transform-origin: center bottom;
}

@keyframes reactionsPopIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.reactions-popover button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.14s ease, transform 0.14s ease;
    padding: 0;
}

.reactions-popover button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.15);
}

.reactions-popover button:active {
    transform: scale(0.95);
}

/* ---- Пилюли реакций под сообщением ---- */

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
    align-self: flex-start;
}

.message.mine .message-reactions {
    align-self: flex-end;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px 3px 6px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
    animation: reactionPillIn 0.2s ease;
}

@keyframes reactionPillIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reaction-pill:hover {
    background: rgba(255, 255, 255, 0.10);
    transform: scale(1.05);
}

.reaction-pill.mine {
    background: rgba(123, 108, 246, 0.20);
    border-color: rgba(123, 108, 246, 0.40);
}

.reaction-pill .reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.reaction-pill .reaction-count {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
}

.reaction-pill.mine .reaction-count {
    color: #d4c9ff;
}

/* Убеждаемся, что reactions идут ПОСЛЕ времени */
.message .message-reactions {
    order: 10;
}

/* ---- Мобильный ---- */
@media (max-width: 700px) {
    .reactions-popover {
        padding: 5px 6px;
        gap: 2px;
    }
    .reactions-popover button {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    .reaction-pill {
        padding: 2px 8px 2px 5px;
        font-size: 12px;
    }
    .reaction-pill .reaction-emoji {
        font-size: 13px;
    }
}


/* =========================================================
   38. РЕАКЦИИ — БЕЙДЖ НА ПУЗЫРЕ (без счётчика)
   ========================================================= */

/* Убираем старые пилюли */
.message-reactions {
    display: none !important;
}

/* Новый контейнер для бейджа реакции */
.message-reaction-badge {
    position: absolute !important;
    right: -8px !important;
    top: -8px !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    gap: 0 !important;
    z-index: 5 !important;
    pointer-events: none !important;
}

/* Один бейдж (кружок с эмодзи) */
.reaction-badge-item {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: #23233f !important;
    border: 2px solid var(--bg, #1a1a2e) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35) !important;
    transition: transform 0.14s ease, box-shadow 0.14s ease !important;
    user-select: none !important;
    margin-left: -8px !important;
    animation: reactionBadgeIn 0.22s ease !important;
}

.reaction-badge-item:first-child {
    margin-left: 0 !important;
}

@keyframes reactionBadgeIn {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reaction-badge-item:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
    z-index: 6 !important;
}

.reaction-badge-item:active {
    transform: scale(0.92) !important;
}

/* Моя реакция — фиолетовый фон */
.reaction-badge-item.mine {
    background: linear-gradient(145deg, #7b6cf6, #6a5ce8) !important;
    border-color: #1a1a2e !important;
}

/* Для своих сообщений — тоже правый верхний, но чуть аккуратнее */
.message.mine .message-reaction-badge {
    right: -8px !important;
    left: auto !important;
    top: -8px !important;
    flex-direction: row-reverse !important;
}

/* На мобильном — чуть компактнее */
@media (max-width: 700px) {
    .reaction-badge-item {
        width: 24px !important;
        height: 24px !important;
        font-size: 13px !important;
    }
}


/* =========================================================
   39. ЭМОДЗИ-СТАТУС РЯДОМ С НИКОМ
   ========================================================= */

.status-emoji {
    display: inline-block !important;
    margin-left: 6px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    opacity: 0.95 !important;
}

/* В списке чатов — чуть меньше */
#users .user-name .status-emoji {
    font-size: 13px !important;
    margin-left: 5px !important;
}

/* В шапке чата — чуть крупнее */
.chat-title .status-emoji {
    font-size: 15px !important;
    margin-left: 7px !important;
}

/* В профиле — крупнее */
.pf-username .status-emoji {
    font-size: 22px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
}

/* В лидерборде */
.lb-name .status-emoji {
    font-size: 13px !important;
    margin-left: 5px !important;
}

/* =========================================================
   40. ПИКЕР ЭМОДЗИ-СТАТУСА В ПРОФИЛЕ
   ========================================================= */

.status-picker {
    width: 100% !important;
    margin-bottom: 18px !important;
    padding: 14px 14px 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
}

.status-picker-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--muted, #9a97b8) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 10px !important;
}

.status-picker-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
}

@media (max-width: 700px) {
    .status-picker-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

.status-picker-btn {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease !important;
    padding: 0 !important;
    font-family: inherit !important;
    color: inherit !important;
}

.status-picker-btn:hover {
    background: rgba(123, 108, 246, 0.10) !important;
    border-color: rgba(123, 108, 246, 0.30) !important;
    transform: scale(1.05) !important;
}

.status-picker-btn:active {
    transform: scale(0.94) !important;
}

.status-picker-btn.active {
    background: rgba(123, 108, 246, 0.20) !important;
    border-color: rgba(123, 108, 246, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(123, 108, 246, 0.35) inset !important;
}

.status-picker-clear {
    color: var(--muted, #9a97b8) !important;
    font-size: 16px !important;
}


/* =========================================================
   41. ЛИДЕРБОРД — БЕЗ КЛИКА НА ЮЗЕРА
   ========================================================= */

/* Убираем hover-эффект (значит «не кликабельно») */
#lbLeaderboardModal .lb-row.clickable {
    cursor: default !important;
}

#lbLeaderboardModal .lb-row.clickable:hover {
    background: transparent !important;
}

/* Оставляем только подсветку «своей» позиции */
#lbLeaderboardModal .lb-row.me:hover {
    background: linear-gradient(90deg, rgba(123, 108, 246, 0.18), rgba(123, 108, 246, 0.06)) !important;
}

/* На мобильном — то же */
@media (max-width: 700px) {
    #lbLeaderboardModal .lb-row.clickable {
        cursor: default !important;
        pointer-events: none !important;
    }
    #lbLeaderboardModal .lb-row.clickable.me {
        pointer-events: auto !important;
    }
}


/* =========================================================
   42. КНОПКА РЕДАКТИРОВАНИЯ ПРОФИЛЯ — рядом с крестиком
   ========================================================= */

/* Кнопка карандаша — компактно */
#profileEditBtn {
    width: 34px !important;
    height: 34px !important;
    margin-right: 5px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f5f4fb !important;
    font-size: 16px !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
    flex-shrink: 0 !important;
}

#profileEditBtn:hover {
    background: rgba(123, 108, 246, 0.22) !important;
    transform: scale(1.05) !important;
}

#profileEditBtn:active {
    transform: scale(0.94) !important;
}

/* Обёртка кнопок в шапке — без лишних зазоров */
#lbProfileModal .lb-modal-header {
    gap: 0 !important;
}

/* Кнопка закрытия — тоже без margin */
#lbProfileModal .lb-modal-close {
    margin-left: 0 !important;
}


/* =========================================================
   43. РАВНЫЕ ОТСТУПЫ МЕЖДУ КНОПКАМИ ШАПКИ ПРОФИЛЯ
   ========================================================= */

/* Обёртка кнопок — только gap, без margins */
.lb-profile-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

/* Все кнопки внутри — без собственных margins */
.lb-profile-actions > button {
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* На мобильном — gap чуть меньше */
@media (max-width: 700px) {
    .lb-profile-actions {
        gap: 5px !important;
    }
}


/* =========================================================
   44. ПРОФИЛЬ — @ник и О себе
   ========================================================= */

/* @ник под именем */
.pf-handle {
    font-size: 13px !important;
    color: var(--accent, #7b6cf6) !important;
    font-weight: 600 !important;
    margin-top: 3px !important;
    letter-spacing: -0.01em !important;
    text-align: center !important;
}

/* Блок «О себе» */
.pf-bio {
    width: 100% !important;
    padding: 14px 18px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 10px !important;
    font-size: 13.5px !important;
    color: #e5e2f0 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
}

/* pf-username — добавим статус-эмодзи */
.pf-username .status-emoji {
    font-size: 22px !important;
    margin-left: 8px !important;
}


/* =========================================================
   45. ИГРА «КОТИКИ В КОРОБКАХ»
   ========================================================= */

@keyframes catBoxPopIn {
    0% {
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.cat-box-emoji {
    display: block;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

.cat-box-cell {
    position: relative;
}

.cat-box-cell:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.cat-box-cell:active {
    transform: scale(0.96);
}

/* Подсветка при удачном клике */
.cat-box-cell[data-clicked="1"] {
    background: rgba(123, 216, 138, 0.25) !important;
    border-color: rgba(123, 216, 138, 0.5) !important;
}


/* =========================================================
   46. БАННЕР — ЛИЧНЫЙ СЧЁТЧИК РЫБОВ
   ========================================================= */

.maintenance-fish-mine {
    display: block !important;
    font-size: 12px !important;
    color: #9a97b8 !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
}

.maintenance-fish-mine b {
    color: #7b6cf6 !important;
    font-weight: 750 !important;
    font-variant-numeric: tabular-nums !important;
}

/* =========================================================
   47. БАННЕР — СЧЁТЧИК СОБАЧКОВ
   ========================================================= */

.maintenance-dog-mine {
    display: block !important;
    font-size: 12px !important;
    color: #f6a86c !important;
    font-weight: 600 !important;
    margin-top: 2px !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
}

.maintenance-dog-mine b {
    color: #f6a86c !important;
    font-weight: 750 !important;
    font-variant-numeric: tabular-nums !important;
}

/* =========================================================
   48. ГАЛОЧКИ СТАТУСА СООБЩЕНИЯ
   ========================================================= */

.message-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    margin-left: 2px;
    letter-spacing: -0.05em;
    vertical-align: middle;
    transition: color 0.2s ease;
}

/* Отправлено — серые */
.message-status.sent {
    color: rgba(255, 255, 255, 0.45);
}

/* Доставлено — серые, двойные */
.message-status.delivered {
    color: rgba(255, 255, 255, 0.55);
}

/* Прочитано — зелёная галочка */
.message-status.read {
    color: #4ADE80;
    font-weight: 700;
}

/* В чужих сообщениях — не показываем */
.message:not(.mine) .message-status {
    display: none !important;
}


/* =========================================================
   49. ЭКРАН ЛОГИНА — ПРИГЛАШЕНИЕ
   ========================================================= */

/* Скрытая кнопка «Войти» при инвайте */
#loginScreen.invite-mode #loginEnterBtn {
    display: none !important;
}

/* Приветствие при инвайте */
#loginScreen .login-invite-title {
    display: none;
}

#loginScreen.invite-mode .login-invite-title {
    display: block;
    font-size: 15px;
    color: #cbb8ff;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* В режиме инвайта — заголовок «Loureed» меньше */
#loginScreen.invite-mode h2 {
    font-size: 22px !important;
}


/* =========================================================
   50. ФОНЫ ЧАТА И ПРОФИЛЯ
   ========================================================= */

/* Сообщения — фон применяется через JS (inline) */
.messages {
    transition: background 0.3s ease;
}

/* Модалка профиля — фон через JS */
#lbProfileModal .lb-modal {
    transition: background-image 0.3s ease;
    background-color: #23233f;
    background-repeat: repeat;
}

/* Модалка user-profile — фон через JS */
#userProfileModal > div > div {
    transition: background-image 0.3s ease;
    background-color: #23233f;
    background-repeat: repeat;
}

/* Чтобы контент был читаем поверх узора */
#lbProfileModal .lb-modal-body,
#userProfileModal .lb-modal-body {
    position: relative;
    z-index: 1;
}


/* =========================================================
   51. ИГРА 2048 С КОТИКАМИ
   ========================================================= */

.g2048-grid {
    background: rgba(0, 0, 0, 0.20);
    border-radius: 16px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.g2048-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    display: grid;
    place-items: center;
    transition: transform 0.12s ease;
}

.g2048-cell.has-value {
    background: rgba(123, 108, 246, 0.08);
    border: 1px solid rgba(123, 108, 246, 0.20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: g2048Pop 0.18s ease;
}

@keyframes g2048Pop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.g2048-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

.g2048-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    pointer-events: none;
}

/* На маленьких экранах — компактнее */
@media (max-width: 500px) {
    .g2048-cell {
        border-radius: 8px;
    }
    .g2048-badge {
        font-size: 9px;
        bottom: 3px;
        right: 3px;
    }
}


/* Убираем старую кнопку Лидеры из нижнего бара */
#mobileLeaderboardBtn {
    display: none !important;
}


/* Убираем статус Online из шапки сайдбара */
.sidebar .connection-pill,
#connectionPill {
    display: none !important;
}


/* =========================================================
   52. ВКЛАДКИ ЧАТЫ / ГРУППЫ В САЙДБАРЕ
   ========================================================= */

.sidebar-tabs {
    display: flex;
    margin: 0 4px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-tab {
    flex: 1;
    padding: 10px 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #9a97b8;
    font: inherit;
    font-weight: 650;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.sidebar-tab:hover {
    color: #cbb8ff;
}

.sidebar-tab.active {
    color: #cbb8ff;
    border-bottom-color: #7b6cf6;
}

/* Бейдж на вкладке */
.sidebar-tab .tab-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: #7b6cf6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    vertical-align: middle;
}

/* Скрытие групп, когда активна вкладка «Чаты» */
.sidebar-tabs[data-active="chats"] ~ #users #groupsSection {
    display: none !important;
}

/* Скрытие диалогов, когда активна вкладка «Группы» */
.sidebar-tabs[data-active="groups"] ~ #users .user:not(.group-chat) {
    display: none !important;
}

/* На мобильном — компактнее */
@media (max-width: 700px) {
    .sidebar-tab {
        font-size: 12px;
        padding: 8px 6px;
    }
    .sidebar-tab .tab-badge {
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        font-size: 9px;
        margin-left: 4px;
    }
}


/* ==== Android install banner ==== */
.android-install-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2c2c2e, #1f1f26);
    border: 1px solid rgba(255,255,255,0.06);
    color: #f5f4fb;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.android-install-banner:hover {
    background: linear-gradient(135deg, #343438, #24242c);
}
.android-install-banner:active {
    transform: scale(0.98);
}
.android-install-icon {
    font-size: 22px;
    line-height: 1;
}
.android-install-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.android-install-title {
    font-size: 13px;
    font-weight: 600;
    color: #f5f4fb;
}
.android-install-sub {
    font-size: 11px;
    color: #8e8e93;
}

/* Узкий sidebar — скрываем подписи баннера, оставляем иконку */
@media (max-width: 900px) {
    .android-install-copy { display: none; }
    .android-install-banner {
        justify-content: center;
        padding: 8px;
        margin: 6px 0;
    }
}

/* ==== Floating Android install banner (mobile only) ==== */
.android-float-banner {
    display: none;
}

@media (max-width: 900px) {
    .android-float-banner {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        z-index: 9999;
        padding: 12px 14px;
        border-radius: 14px;
        background: linear-gradient(135deg, #3a3a44, #2a2a33);
        border: 1px solid rgba(123, 108, 246, 0.55);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
        color: #f5f4fb;
        text-decoration: none;
        font-family: Inter, ui-sans-serif, system-ui, sans-serif;
        animation: androidSlideUp 0.35s ease;
    }
    .android-float-icon {
        font-size: 26px;
        line-height: 1;
        flex-shrink: 0;
    }
    .android-float-text {
        flex: 1;
        font-size: 14px;
        font-weight: 600;
        color: #f5f4fb;
        line-height: 1.2;
    }
    .android-float-close {
        width: 28px;
        height: 28px;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        color: #f5f4fb;
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        display: grid;
        place-items: center;
        flex-shrink: 0;
    }
    .android-float-close:hover {
        background: rgba(255, 255, 255, 0.16);
    }
}

@keyframes androidSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
