/* ============================================================
   Minva Messenger 2.0 — редизайн интерфейса
   Экран входа/регистрации НЕ изменён по просьбе автора.
   Везде дальше — чаты, сообщения, друзья, подарки, игры,
   настройки, админ-панель, модальные окна.
   ============================================================ */

:root {
    /* Фирменные цвета (сохранены) */
    --primary-orange: #FFB347;
    --primary-orange-dark: #F0972E;
    --primary-blue: #89CFF0;
    --primary-blue-dark: #5BAEDC;
    --primary-dark-blue: #7393B3;
    --primary-deep-blue: #2E5077;

    /* Светлая тема — нейтральные тона интерфейса */
    --bg-canvas: #F3F5F8;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F7F9FB;
    --bg-hover: #EEF2F6;
    --text-primary: #1A1D24;
    --text-secondary: #6B7685;
    --text-tertiary: #9AA3AF;
    --border-subtle: #E7EBF0;
    --border-default: #DCE1E7;

    /* Совместимость со старыми именами переменных */
    --bg-light: #ffffff;
    --bg-light-secondary: var(--bg-canvas);
    --text-light: var(--text-primary);
    --text-light-secondary: var(--text-secondary);
    --border-light: var(--border-subtle);
    --input-bg-light: var(--bg-surface-alt);

    /* Тёмная тема */
    --bg-dark: #12141F;
    --bg-dark-secondary: #1B1E2C;
    --bg-dark-tertiary: #232739;
    --bg-dark-hover: #262B40;
    --text-dark: #F4F5F7;
    --text-dark-secondary: #9CA3B5;
    --border-dark: #2A2E40;
    --input-bg-dark: #232739;

    /* Новогодняя тема */
    --bg-/* removed */: #0F3460;
    --bg-/* removed */-secondary: #16213E;
    --text-/* removed */: #ffffff;
    --text-/* removed */-secondary: #C9D6E3;
    --border-/* removed */: #E94560;
    --accent-/* removed */: #E94560;
    --accent-/* removed */-2: #FF6B6B;
    --accent-/* removed */-green: #2E7D32;
    --input-bg-/* removed */: #16213E;

    /* Статусы */
    --success: #34C77B;
    --error: #F2495C;
    --warning: #F5A623;
    --info: #4FA3E8;

    /* Радиусы и тени — единая шкала */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(20, 24, 34, 0.04);
    --shadow-md: 0 6px 20px rgba(20, 24, 34, 0.08);
    --shadow-lg: 0 16px 40px rgba(20, 24, 34, 0.14);
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.2s, color 0.2s;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--r-pill);
}

/* Защитное правило: любой <img> внутри контейнера с "avatar" в названии
   класса никогда не должен вылезать за его границы — даже если для
   конкретного класса забыли прописать overflow:hidden/object-fit
   (именно так раньше "убегали" огромные аватарки пользователей). */
[class*="avatar"] {
    overflow: hidden;
}
[class*="avatar"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

::-webkit-scrollbar-track {
    background: transparent;
}

button, input, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:active,
.chat-item:active,
.friend-item:active,
.gift-item:active,
.game-card:active {
    transform: scale(0.98);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-blue-dark);
    outline-offset: 2px;
}

body,
.app-container,
.navbar,
.side-menu,
.main-content,
.chat-item,
.message,
.chat-view,
.chat-header,
.message-input-container,
.message-input,
.friend-item,
.gift-item,
.game-card,
.settings-container,
.admin-content,
.modal,
.notification {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   ЭКРАН АУТЕНТИФИКАЦИИ — оставлен без изменений
   ============================================================ */
.auth-screen {
    background: linear-gradient(135deg, #FFB347, #89CFF0, #7393B3);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.auth-header h1 i {
    color: #FFB347;
    margin-right: 10px;
}

.version {
    color: #666;
    font-size: 0.9rem;
}

.auth-form h2 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7393B3;
}

.auth-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.auth-input:focus {
    outline: none;
    border-color: #89CFF0;
    box-shadow: 0 0 0 3px rgba(137, 207, 240, 0.2);
    background: white;
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, #FFB347, #89CFF0);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 179, 71, 0.4);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-switch {
    color: #7393B3;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
}

.auth-switch:hover {
    color: #FFB347;
}

.privacy-policy-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(137, 207, 240, 0.1);
    border-radius: 10px;
    border-left: 4px solid #89CFF0;
}

.privacy-policy-box label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.privacy-policy-box input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.privacy-policy-box a {
    color: #FFB347;
    text-decoration: underline;
}

.privacy-policy-box a:hover {
    color: #7393B3;
}

.demo-accounts {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(137, 207, 240, 0.1);
    border-radius: 10px;
}

.demo-accounts h4,
.demo-accounts p {
    color: #333;
}

/* ============================================================
   ПРИЛОЖЕНИЕ — общий каркас
   ============================================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;   /* фолбэк */
    height: 100dvh;  /* реальная видимая высота на мобильных браузерах */
    background: var(--bg-canvas);
}

/* ---------- Навигация ---------- */
.navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-btn {
    background: var(--bg-surface-alt);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.menu-btn:hover {
    background: var(--bg-hover);
}

.app-title {
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
}

.verified-badge {
    color: var(--primary-blue-dark);
    font-size: 1rem;
}

#user-balance {
    background: var(--bg-surface-alt) !important;
    color: var(--primary-orange-dark);
    font-weight: 600;
    border: 1px solid var(--border-subtle);
}

/* ---------- Боковое меню ---------- */
.side-menu {
    position: fixed;
    left: -300px;
    top: 0;
    width: 280px;
    height: 100vh;   /* фолбэк */
    height: 100dvh;  /* реальная видимая высота на мобильных браузерах */
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    transition: left 0.25s ease;
    z-index: 1001;
    padding-top: 76px;
    overflow-y: auto;
    border-right: 1px solid var(--border-subtle);
}

.side-menu.active {
    left: 0;
}

.side-menu-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.side-menu-section h4 {
    padding: 0.5rem 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.side-menu-item {
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-primary);
    transition: background 0.15s;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.side-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.side-menu-item:hover {
    background: var(--bg-hover);
}

.side-menu-item.active {
    background: rgba(255, 179, 71, 0.1);
    border-left-color: var(--primary-orange);
}

.side-menu-item.active i {
    color: var(--primary-orange-dark);
}

.menu-badge {
    margin-left: auto;
    background: var(--primary-orange);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-pill);
    min-width: 18px;
    text-align: center;
}

/* ---------- Основной контент ---------- */
.main-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    position: relative;
    background: var(--bg-canvas);
}

/* ============================================================
   ЧАТЫ — список
   ============================================================ */
.chats-view {
    max-width: 800px;
    margin: 0 auto;
}

.chats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.chats-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.new-chat-btn,
.upload-btn {
    background: var(--primary-orange);
    color: #1A1D24;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.new-chat-btn:hover,
.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 179, 71, 0.35);
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chat-item {
    background: var(--bg-surface);
    border-radius: var(--r-md);
    padding: 0.7rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--bg-hover);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C3D5A;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-avatar:nth-of-type(odd) {
    background: var(--primary-orange);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Галочка верификации — стоит в строке рядом с ником/именем, НЕ поверх аватарки. Цвет совпадает с фоном бывшего бейджа на аватарке (--info), чтобы это оставалось узнаваемым цветом — просто SVG-глиф через шрифт, без круга-фона вокруг иконки, который и давал эффект мыльного пятна на маленьком размере. */
.verified-inline {
    color: var(--info);
    font-size: 0.85em;
    vertical-align: middle;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.secret-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--success);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    border: 2px solid var(--bg-surface);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
    gap: 0.5rem;
}

.chat-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.unread-badge {
    background: var(--primary-orange);
    color: #1A1D24;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-pill);
    min-width: 19px;
    text-align: center;
    flex-shrink: 0;
}

.pinned-badge {
    color: var(--primary-orange-dark);
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

.chat-last-message {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 5px;
    flex-shrink: 0;
}

/* Бейдж-версия для использования ВНУТРИ аватарки (chat-avatar/friend-avatar).
   Без этого модификатора точка попадала в общий flex-поток аватарки и
   сжимала саму картинку, обнажая фон контейнера с правого края —
   на нечётных аватарках он оранжевый, отсюда и "оранжево-зелёный" эффект. */
.online-dot-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    margin-left: 0;
    border: 2px solid var(--bg-surface);
    z-index: 2;
}

body.dark-theme .online-dot-badge {
    border-color: var(--bg-dark-secondary, #1B1E2C);
}

/* ============================================================
   ОКНО ЧАТА
   ============================================================ */
/* .chat-view сама вёрстка — см. "КРИТИЧЕСКИЙ ФИКС" ниже (display:none + .chat-active) */

.chat-header {
    background: var(--bg-surface);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
}

.back-btn:hover {
    background: var(--bg-hover);
}

.chat-name-large {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.chat-actions {
    display: flex;
    gap: 0.3rem;
    margin-left: auto;
}

.chat-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: var(--bg-canvas);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    max-width: 70%;
    padding: 0.6rem 0.85rem;
    border-radius: var(--r-md);
    position: relative;
    animation: fadeIn 0.2s ease;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    background: var(--primary-orange);
    color: #1A1D24;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: var(--bg-surface);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--primary-deep-blue);
}

.message.sent .message-sender {
    color: rgba(26, 29, 36, 0.75);
}

.message-sender:hover {
    text-decoration: underline;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.65;
}

/* ── Статус "прочитано" (галочки) ── */
.read-receipt {
    font-size: .68rem;
    margin-left: .2rem;
    opacity: .6;
    color: currentColor;
}

.read-receipt-read {
    opacity: 1;
    color: #4FC3F7; /* голубой акцент — прочитано, как в большинстве мессенджеров */
}

.message.sent .read-receipt-read {
    color: #1A73E8;
}

.message-content {
    margin-bottom: 0.2rem;
    font-size: 0.92rem;
    line-height: 1.4;
}

.message-reactions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.reaction {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: var(--r-pill);
    padding: 0.15rem 0.55rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.15s;
}

.message.sent .reaction {
    background: rgba(255, 255, 255, 0.35);
}

.reaction:hover {
    transform: scale(1.08);
}

.message-actions {
    position: absolute;
    top: -18px;
    right: 8px;
    display: none;
    gap: 0.2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    padding: 0.2rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.message:hover .message-actions {
    display: flex;
}

.action-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.15s;
    color: var(--text-secondary);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ---------- Голосовые сообщения ---------- */
.voice-message-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--r-pill);
    min-width: 190px;
}

.message.sent .voice-message-player {
    background: rgba(255, 255, 255, 0.3);
}

.play-btn {
    background: var(--bg-surface);
    color: var(--primary-deep-blue);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.08);
}

.voice-progress {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.message.sent .voice-progress {
    background: rgba(255, 255, 255, 0.35);
}

.voice-progress-bar {
    height: 100%;
    background: var(--primary-deep-blue);
    width: 0%;
    transition: width 0.1s linear;
}

.message.sent .voice-progress-bar {
    background: #1A1D24;
}

.voice-duration {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 36px;
}

.message.sent .voice-duration {
    color: rgba(26, 29, 36, 0.7);
}

/* ---------- Панель ввода сообщений ---------- */
.message-input-container {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emoji-btn, .attach-btn, .gift-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.emoji-btn:hover, .attach-btn:hover, .gift-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.message-input-wrapper {
    flex: 1;
}

.message-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    font-size: 0.92rem;
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: border-color 0.2s, background 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-surface);
}

.voice-record-btn {
    background: var(--primary-orange);
    color: #1A1D24;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.voice-record-btn:hover {
    transform: scale(1.05);
}

.voice-record-btn.recording {
    animation: pulse 1.4s infinite;
    background: var(--error);
    color: white;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(242, 73, 92, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(242, 73, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 73, 92, 0); }
}

.send-btn {
    background: var(--primary-deep-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* ============================================================
   ДРУЗЬЯ
   ============================================================ */
.friends-view {
    max-width: 800px;
    margin: 0 auto;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.friends-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.friends-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.friends-tab,
.admin-tab {
    padding: 0.55rem 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.friends-tab:hover,
.admin-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.friends-tab.active,
.admin-tab.active {
    background: var(--primary-deep-blue);
    color: white;
    border-color: var(--primary-deep-blue);
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.friend-item {
    background: var(--bg-surface);
    border-radius: var(--r-md);
    padding: 0.7rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.friend-item:hover {
    background: var(--bg-hover);
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C3D5A;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.friend-status {
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.friend-actions {
    display: flex;
    gap: 0.4rem;
}

.friend-action-btn {
    background: var(--bg-surface-alt);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-secondary);
}

.friend-action-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-deep-blue);
}

.friend-request-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.4rem;
}

.friend-request-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A1D24;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.friend-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-request-info {
    flex: 1;
    min-width: 0;
}

.friend-request-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.friend-request-actions {
    display: flex;
    gap: 0.4rem;
}

.friend-request-accept {
    background: var(--success);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.friend-request-accept:hover {
    transform: scale(1.08);
}

.friend-request-decline {
    background: var(--bg-surface-alt);
    color: var(--error);
    border: 1px solid var(--border-subtle);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.friend-request-decline:hover {
    transform: scale(1.08);
    background: rgba(242, 73, 92, 0.08);
}

/* ============================================================
   ПОДАРКИ
   ============================================================ */
.gifts-view {
    max-width: 1000px;
    margin: 0 auto;
}

.gifts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.gifts-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.gifts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0;
}

.gift-item {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border-subtle);
}

.gift-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.gift-image {
    width: 100%;
    height: 110px;
    object-fit: contain;
    margin-bottom: 0.7rem;
    border-radius: var(--r-sm);
    background: var(--bg-surface-alt);
}

.gift-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.92rem;
}

.gift-price {
    color: var(--primary-orange-dark);
    font-weight: 700;
    margin: 0.3rem 0 0.6rem;
    text-align: center;
    font-size: 1rem;
}

.gift-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
    height: 36px;
    overflow: hidden;
    text-align: center;
}

.send-gift-btn {
    background: var(--primary-deep-blue);
    color: white;
    border: none;
    padding: 0.55rem 1rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.15s;
    width: 100%;
}

.send-gift-btn:hover {
    opacity: 0.88;
}

/* ============================================================
   ИГРЫ
   ============================================================ */
.games-view h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.game-card {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    padding: 1.4rem 1.2rem;
    text-align: center;
    border: 1px solid var(--border-subtle);
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.game-icon {
    width: 54px;
    height: 54px;
    background: var(--primary-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.9rem;
    color: #1A1D24;
    font-size: 1.35rem;
}

.game-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.play-btn {
    background: var(--primary-deep-blue);
    color: white;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.15s;
}

.play-btn:hover {
    opacity: 0.88;
}

.play-btn:disabled {
    background: var(--border-default);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    padding: 1.75rem;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.game-players {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: var(--bg-surface-alt);
    border-radius: var(--r-md);
}

.player-info {
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--r-md);
    transition: all 0.2s;
}

.player-info.current-player {
    background: rgba(52, 199, 123, 0.12);
    border: 2px solid var(--success);
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C3D5A;
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0 auto 0.4rem;
    overflow: hidden;
    position: relative;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-symbol {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.4rem;
    color: var(--text-primary);
}

.vs {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-orange-dark);
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 1.25rem auto;
    max-width: 280px;
}

.ttt-cell {
    aspect-ratio: 1;
    background: var(--bg-surface-alt);
    border: none;
    font-size: 2.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.ttt-cell:hover:not(:disabled) {
    background: var(--bg-hover);
}

.ttt-cell:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.game-status {
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-surface-alt);
    border-radius: var(--r-md);
    color: var(--text-primary);
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

/* ============================================================
   НАСТРОЙКИ
   ============================================================ */
.settings-view {
    max-width: 800px;
    margin: 0 auto;
}

.settings-view h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.settings-container {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-subtle);
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.98rem;
    font-weight: 600;
}

.settings-section h3 i {
    color: var(--primary-orange-dark);
}

.settings-h3-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .82rem;
    flex-shrink: 0;
}

.settings-h3-icon i {
    color: #fff !important;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
}

.settings-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.setting-value {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.setting-select {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(137, 207, 240, 0.2);
}

.settings-btn {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 0.45rem 0.9rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s;
}

.settings-btn:hover {
    background: var(--bg-hover);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-default);
    transition: .25s;
    border-radius: var(--r-pill);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-orange);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ---------- Сессии ---------- */
.session-item {
    background: var(--bg-surface-alt);
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.session-info {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.terminate-btn {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
}

.terminate-btn:hover {
    background: var(--error);
    color: white;
}

/* ============================================================
   АДМИН-ПАНЕЛЬ
   ============================================================ */
.admin-view {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    background: var(--primary-deep-blue);
    color: white;
    padding: 1.4rem 1.5rem;
    border-radius: var(--r-lg);
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.admin-role {
    background: rgba(255, 255, 255, 0.18);
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-pill);
    font-size: 0.85rem;
}

.admin-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-content {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-subtle);
}

.admin-tab-content h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.02rem;
    font-weight: 600;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 1.25rem;
    border-radius: var(--r-md);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card div {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-deep-blue);
}

.admin-user-item,
.admin-gift-item,
.ticket-item,
.report-item {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C3D5A;
    font-weight: 600;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-actions,
.gift-actions {
    display: flex;
    gap: 0.4rem;
}

.ticket-header,
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    width: 100%;
}

.ticket-status,
.report-status {
    padding: 0.18rem 0.6rem;
    border-radius: var(--r-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.ticket-status.pending,
.report-status.pending {
    background: rgba(245, 166, 35, 0.15);
    color: #8A5A0A;
}

.ticket-status.responded {
    background: rgba(52, 199, 123, 0.15);
    color: #1F7A4D;
}

.ticket-status.closed {
    background: var(--border-default);
    color: var(--text-secondary);
}

.ticket-message,
.report-details {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.7rem;
    border-radius: var(--r-sm);
    margin: 0.5rem 0;
    font-size: 0.85rem;
    width: 100%;
}

.ticket-response {
    margin-top: 0.5rem;
    padding: 0.7rem;
    background: rgba(137, 207, 240, 0.12);
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    width: 100%;
}

.report-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    width: 100%;
}

/* ============================================================
   ПОИСК
   ============================================================ */
.search-view {
    max-width: 800px;
    margin: 0 auto;
}

.search-view h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 3rem;
    border: 1px solid var(--border-default);
    border-radius: var(--r-pill);
    font-size: 0.95rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(137, 207, 240, 0.18);
}

.search-results {
    margin-top: 1.25rem;
}

.search-result-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0C3D5A;
    font-weight: 600;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 24, 34, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 50%;
    transition: background 0.15s;
}

.modal-close:hover {
    background: var(--bg-hover);
}

.modal-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    margin-bottom: 0.85rem;
    font-size: 0.92rem;
    background: var(--bg-surface-alt);
    color: var(--text-primary);
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-surface);
}

.modal-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary-orange);
    color: #1A1D24;
    border: none;
    border-radius: var(--r-pill);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}

.modal-btn:hover {
    transform: translateY(-1px);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.9rem 1.25rem;
    background: var(--bg-surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.25s ease;
    max-width: 350px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-primary);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification-success { border-left-color: var(--success); }
.notification-error { border-left-color: var(--error); }
.notification-info { border-left-color: var(--info); }
.notification-warning { border-left-color: var(--warning); }

.notification-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
    margin-left: auto;
}

/* ---------- Эмодзи-пикер ---------- */
.emoji-picker {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.85rem;
    z-index: 1000;
    width: 200px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.emoji-btn-small {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--r-sm);
    transition: background 0.15s;
}

.emoji-btn-small:hover {
    background: var(--bg-hover);
}

/* ============================================================
   ПУСТЫЕ СОСТОЯНИЯ И ЗАГРУЗКА
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 2.6rem;
    margin-bottom: 0.85rem;
    opacity: 0.5;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(137, 207, 240, 0.25);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Новогодние снежинки ---------- */
#snowflakes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.snowflake {
    position: fixed;
    color: white;
    animation: fall linear infinite;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 0 5px rgba(0,0,0,0.3);
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(360deg); }
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */
body.dark-theme {
    background: var(--bg-dark);
    color: var(--text-dark);

    /* КЛЮЧЕВОЙ ФИКС: раньше тёмная тема переопределяла цвет только для
       конкретных CSS-классов (body.dark-theme .selector {...}), а сами
       базовые переменные --text-primary/--text-secondary/--text-tertiary/
       --bg-surface/--bg-canvas/--bg-hover и т.д. никогда не менялись.
       Из-за этого любой инлайн-стиль вида style="color:var(--text-secondary)"
       (а таких по всему main.js — десятки) всегда оставался светлым, даже
       в тёмной теме — текст сливался с тёмным фоном или наоборот оказывался
       светлым на светлой подложке. Переопределяя сами переменные здесь,
       чиним это сразу для всех мест разом, включая те, что появятся позже. */
    --bg-canvas: var(--bg-dark);
    --bg-surface: var(--bg-dark-secondary);
    --bg-surface-alt: var(--bg-dark-tertiary);
    --bg-hover: var(--bg-dark-hover);
    --text-primary: var(--text-dark);
    --text-secondary: var(--text-dark-secondary);
    --text-tertiary: var(--text-dark-secondary);
    --border-subtle: var(--border-dark);
    --border-default: var(--border-dark);
    --bg-light: var(--bg-dark);
    --bg-light-secondary: var(--bg-dark-secondary);
    --text-light: var(--text-dark);
    --text-light-secondary: var(--text-dark-secondary);
    --border-light: var(--border-dark);
    --input-bg-light: var(--bg-dark-tertiary);
}

body.dark-theme .app-container,
body.dark-theme .main-content {
    background: var(--bg-dark);
}

body.dark-theme .navbar {
    background: var(--bg-dark-secondary);
    border-bottom-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-theme .app-title,
body.dark-theme .user-info {
    color: var(--text-dark);
}

body.dark-theme .menu-btn {
    background: var(--bg-dark-tertiary);
    color: var(--text-dark);
}

body.dark-theme .menu-btn:hover {
    background: var(--bg-dark-hover);
}

body.dark-theme #user-balance {
    background: var(--bg-dark-tertiary) !important;
    border-color: var(--border-dark);
    color: var(--primary-orange);
}

body.dark-theme .side-menu {
    background: var(--bg-dark-secondary);
    border-right-color: var(--border-dark);
}

body.dark-theme .side-menu-section {
    border-bottom-color: var(--border-dark);
}

body.dark-theme .side-menu-item {
    color: var(--text-dark);
}

body.dark-theme .side-menu-item:hover {
    background: var(--bg-dark-hover);
}

body.dark-theme .side-menu-item.active {
    background: rgba(255, 179, 71, 0.12);
}

body.dark-theme .chat-item,
body.dark-theme .friend-item,
body.dark-theme .gift-item,
body.dark-theme .game-card,
body.dark-theme .settings-container,
body.dark-theme .admin-content,
body.dark-theme .search-result-item,
body.dark-theme .modal,
body.dark-theme .friend-request-item,
body.dark-theme .chat-view,
body.dark-theme .chat-header,
body.dark-theme .message-input-container,
body.dark-theme .message.received {
    background: var(--bg-dark-secondary);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.dark-theme .chat-item:hover,
body.dark-theme .friend-item:hover,
body.dark-theme .search-result-item:hover {
    background: var(--bg-dark-hover);
}

body.dark-theme .chat-name,
body.dark-theme .chat-name-large,
body.dark-theme .friend-name,
body.dark-theme .friend-request-name,
body.dark-theme .gift-name,
body.dark-theme .game-card h3,
body.dark-theme .settings-section h3,
body.dark-theme .setting-label,
body.dark-theme .modal-header h3,
body.dark-theme .chats-header h2,
body.dark-theme .friends-header h2,
body.dark-theme .gifts-header h2,
body.dark-theme .games-view h2,
body.dark-theme .settings-view h2,
body.dark-theme .search-view h2,
body.dark-theme .admin-tab-content h3,
body.dark-theme .game-status,
body.dark-theme .game-header,
body.dark-theme .ttt-cell,
body.dark-theme .player-symbol {
    color: var(--text-dark);
}

body.dark-theme .chat-last-message,
body.dark-theme .chat-status,
body.dark-theme .friend-status,
body.dark-theme .gift-description,
body.dark-theme .game-card p,
body.dark-theme .setting-value,
body.dark-theme .empty-state,
body.dark-theme .session-info {
    color: var(--text-dark-secondary);
}

body.dark-theme .message-input,
body.dark-theme .modal-input,
body.dark-theme .setting-select,
body.dark-theme .search-input,
body.dark-theme .session-item,
body.dark-theme .stat-card,
body.dark-theme .admin-user-item,
body.dark-theme .admin-gift-item,
body.dark-theme .ticket-item,
body.dark-theme .report-item,
body.dark-theme .ticket-message,
body.dark-theme .report-details,
body.dark-theme .ttt-cell,
body.dark-theme .game-players,
body.dark-theme .game-status,
body.dark-theme .gift-image {
    background: var(--bg-dark-tertiary);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.dark-theme .message-input::placeholder,
body.dark-theme .modal-input::placeholder,
body.dark-theme .search-input::placeholder {
    color: var(--text-dark-secondary);
}

body.dark-theme .messages-container {
    background: var(--bg-dark);
}

body.dark-theme .ttt-cell:hover:not(:disabled) {
    background: var(--bg-dark-hover);
}

body.dark-theme .notification {
    background: var(--bg-dark-secondary);
    color: var(--text-dark);
}

body.dark-theme .settings-btn {
    background: var(--bg-dark-tertiary);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-theme .friend-action-btn {
    background: var(--bg-dark-tertiary);
    color: var(--text-dark-secondary);
}

body.dark-theme .emoji-picker {
    background: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}

body.dark-theme .back-btn,
body.dark-theme .chat-action-btn,
body.dark-theme .modal-close {
    color: var(--text-dark-secondary);
}

body.dark-theme .back-btn:hover,
body.dark-theme .chat-action-btn:hover,
body.dark-theme .modal-close:hover {
    background: var(--bg-dark-hover);
}

/* ============================================================
   КРИТИЧЕСКИЙ ФИКС: chat-view layout
   ============================================================ */
.chat-view {
    display: none;
    flex-direction: column;
    height: calc(100vh - 64px);       /* фолбэк для старых браузеров */
    height: calc(100dvh - 64px);      /* реальная видимая высота на мобильных —
                                          100vh не учитывает панель адреса браузера,
                                          из-за чего поле ввода "уезжало" за экран */
    background: var(--bg-surface);
    overflow: hidden;
    border-radius: 0;
    border: none;
    max-width: 100%;
    margin: 0;
}
/* Видимое состояние: JS добавляет класс .chat-active */
.chat-view.chat-active {
    display: flex;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-canvas);
    min-height: 0; /* critical — без этого flex-child не сжимается */
}

.message-input-container {
    flex-shrink: 0;   /* никогда не сжимается */
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: .65rem .9rem;
}

.message-input-row {
    display: flex;
    align-items: flex-end;
    gap: .4rem;
}

.reply-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(137,207,240,.15);
    border-left: 3px solid var(--primary-blue);
    padding: .35rem .7rem;
    border-radius: var(--r-sm);
    margin-bottom: .45rem;
    font-size: .82rem;
    color: var(--text-secondary);
}

.reply-preview button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    margin-left: auto;
    font-size: .9rem;
}

.date-separator {
    text-align: center;
    font-size: .74rem;
    color: var(--text-tertiary);
    margin: .6rem 0;
    background: var(--bg-surface-alt);
    display: inline-block;
    padding: .2rem .75rem;
    border-radius: var(--r-pill);
    align-self: center;
    width: fit-content;
    margin-inline: auto;
}

/* ============================================================
   УВЕДОМЛЕНИЯ — выезжающая панель
   ============================================================ */
.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: .45rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.notif-bell-btn:hover { background: var(--bg-hover); }

.notif-bell-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: var(--error);
    color: white;
    font-size: .62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--r-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--bg-surface);
}

.notifications-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,24,34,.25);
    z-index: 1100;
}

.notifications-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    max-width: 92vw;
    height: 100vh;   /* фолбэк */
    height: 100dvh;  /* реальная видимая высота на мобильных браузерах */
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
    border-left: 1px solid var(--border-subtle);
}

.notifications-panel.open { right: 0; }

.notifications-panel-header {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-shrink: 0;
}

.notifications-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-read-all-btn {
    background: none;
    border: 1px solid var(--border-default);
    border-radius: var(--r-pill);
    padding: .25rem .7rem;
    font-size: .78rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s;
}

.notif-read-all-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.notifications-close-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: .3rem;
    border-radius: 50%;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    position: relative;
    margin-bottom: .25rem;
}

.notif-item:hover { background: var(--bg-hover); }
.notif-unread { background: rgba(137,207,240,.1); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-orange);
    color: #1A1D24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: .88rem; color: var(--text-primary); margin-bottom: .15rem; }
.notif-text { font-size: .82rem; color: var(--text-secondary); line-height: 1.35; }
.notif-time { font-size: .72rem; color: var(--text-tertiary); margin-top: .25rem; }

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-blue-dark);
    flex-shrink: 0;
    margin-top: .3rem;
}

/* ============================================================
   MINVA+ ПРЕМИУМ
   ============================================================ */
.premium-active-card {
    background: linear-gradient(135deg, #FFB347 0%, #FF9A3C 50%, #FF8A00 100%);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #1A1D24;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(255,154,60,.3);
}

.premium-active-card h3 { font-size: 1.1rem; font-weight: 700; }
.premium-active-card p { font-size: .88rem; opacity: .85; margin-top: .2rem; }

.premium-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .75rem;
    margin-bottom: 2rem;
}

.premium-feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 1rem;
    text-align: center;
}

.premium-feature-card i {
    font-size: 1.5rem;
    color: var(--primary-orange-dark);
    margin-bottom: .5rem;
}

.premium-feature-card h4 { font-size: .88rem; font-weight: 600; color: var(--text-primary); margin-bottom: .2rem; }
.premium-feature-card p { font-size: .78rem; color: var(--text-secondary); }

.premium-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.premium-plan {
    background: var(--bg-surface);
    border: 2px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}

.premium-plan:hover { border-color: var(--primary-orange); transform: translateY(-2px); }
.premium-plan-selected { border-color: var(--primary-orange); background: rgba(255,179,71,.08); }
.premium-plan-best { border-color: var(--primary-orange-dark); }

.plan-badge {
    background: var(--primary-orange);
    color: #1A1D24;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: var(--r-pill);
    display: inline-block;
    margin-bottom: .6rem;
}

.plan-badge-best { background: var(--success); color: white; }

.premium-plan h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-orange-dark);
    margin: .4rem 0;
}

.plan-desc { font-size: .82rem; color: var(--text-secondary); margin-bottom: 1rem; }

.premium-buy-btn {
    background: var(--primary-orange);
    color: #1A1D24;
    border: none;
    padding: .65rem 1.5rem;
    border-radius: var(--r-pill);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: all .15s;
    width: 100%;
}

.premium-buy-btn:hover { opacity: .88; transform: translateY(-1px); }

.payment-amount {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-orange-dark);
    margin-bottom: 1rem;
}

.payment-card-block {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    padding: 1rem;
    margin-bottom: .75rem;
}

.payment-card-number {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: .1em;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.payment-card-number:hover { color: var(--primary-orange-dark); }

/* ============================================================
   БОТЫ — команды
   ============================================================ */
.bot-commands-list { display: flex; flex-direction: column; gap: .4rem; }

.bot-command-item {
    padding: .6rem .8rem;
    background: var(--bg-surface-alt);
    border-radius: var(--r-sm);
    font-size: .88rem;
    color: var(--text-primary);
}

.bot-command-item code {
    background: var(--bg-hover);
    padding: .1rem .4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: .85rem;
    color: var(--primary-deep-blue);
}

/* ============================================================
   ЭФФЕКТЫ СООБЩЕНИЙ (Premium)
   ============================================================ */
@keyframes effectConfetti {
    0%   { box-shadow: 0 0 0 0 rgba(255,179,71,.8); }
    70%  { box-shadow: 0 0 0 12px rgba(255,179,71,.0); }
    100% { box-shadow: 0 0 0 0 rgba(255,179,71,.0); }
}

@keyframes effectHearts {
    0%, 100% { transform: scale(1); }
    20%       { transform: scale(1.05); }
}

@keyframes effectFire {
    0%   { filter: brightness(1) hue-rotate(0deg); }
    50%  { filter: brightness(1.15) hue-rotate(15deg); }
    100% { filter: brightness(1) hue-rotate(0deg); }
}

@keyframes effectSnow {
    0%   { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

@keyframes effectStars {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

.effect-confetti { animation: effectConfetti 1s ease-out; }
.effect-hearts   { animation: effectHearts .6s ease-in-out; }
.effect-fire     { animation: effectFire 1.2s ease-in-out; }
.effect-stars    { animation: effectStars 1s ease-in-out; }

/* ============================================================
   PREMIUM MENU ITEM GRADIENT
   ============================================================ */
.premium-menu-item i { color: var(--primary-orange-dark); }

.side-menu-item.premium-menu-item.active {
    background: linear-gradient(to right, rgba(255,179,71,.18), transparent);
}

/* ============================================================
   ТЕМНАЯ ТЕМА — новые компоненты
   ============================================================ */
body.dark-theme .notifications-panel { background: var(--bg-dark-secondary); border-left-color: var(--border-dark); }
body.dark-theme .notifications-panel-header { border-bottom-color: var(--border-dark); }
body.dark-theme .notifications-panel-header h3 { color: var(--text-dark); }
body.dark-theme .notif-item:hover { background: var(--bg-dark-hover); }
body.dark-theme .notif-unread { background: rgba(137,207,240,.08); }
body.dark-theme .notif-title { color: var(--text-dark); }
body.dark-theme .notif-text { color: var(--text-dark-secondary); }
body.dark-theme .premium-feature-card,
body.dark-theme .premium-plan { background: var(--bg-dark-secondary); border-color: var(--border-dark); }
body.dark-theme .premium-plan h3,
body.dark-theme .plan-price { color: var(--text-dark); }
body.dark-theme .payment-card-block { background: var(--bg-dark-tertiary); border-color: var(--border-dark); }
body.dark-theme .payment-card-number { color: var(--text-dark); }
body.dark-theme .bot-command-item { background: var(--bg-dark-tertiary); color: var(--text-dark); }
body.dark-theme .bot-command-item code { background: var(--bg-dark-hover); color: #89CFF0; }
body.dark-theme .reply-preview { background: rgba(137,207,240,.1); }
body.dark-theme .message.received { background: var(--bg-dark-secondary); border-color: var(--border-dark); color: var(--text-dark); }
body.dark-theme .messages-container { background: var(--bg-dark); }
body.dark-theme .message-input-container { background: var(--bg-dark-secondary); border-top-color: var(--border-dark); }
body.dark-theme .date-separator { background: var(--bg-dark-tertiary); }

/* ============================================================
   СТЕКЛЯННАЯ ТЕМА — новые компоненты
   (полное правило для .premium-feature-card/.premium-plan теперь
   ниже, вместе с остальными карточками — см. body.glass-theme
   .chat-item, .gift-item, ... .premium-feature-card, .premium-plan)
   ============================================================ */

/* ============================================================
   АДАПТИВНЫЙ ДИЗАЙН ДЛЯ ТЕЛЕФОНОВ И ПЛАНШЕТОВ
   ============================================================ */

/* ── Общие переменные для мобайла ── */
:root {
    --bottom-nav-height: 60px;
    --navbar-height: 58px;
}

/* ============================================================
   ПЛАНШЕТ (481px – 1024px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 1024px) {

    .app-container { flex-direction: column; }

    .navbar {
        padding: .7rem 1.1rem;
        height: var(--navbar-height);
    }

    .main-content {
        padding: .75rem;
    }

    /* Боковое меню шире на планшете */
    .side-menu {
        width: 300px;
        padding-top: var(--navbar-height);
    }

    /* Чаты — одна колонка */
    .chats-view { max-width: 100%; }

    .chat-item { padding: .75rem; }

    .chat-avatar { width: 46px; height: 46px; }

    /* chat-view — почти полный экран */
    .chat-view {
        height: calc(100vh - var(--navbar-height));   /* фолбэк */
        height: calc(100dvh - var(--navbar-height));
    }

    /* Настройки */
    .settings-container { padding: 1rem 1.25rem; }

    /* Подарки — 3 колонки */
    .gifts-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* Премиум */
    .premium-features-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .premium-plans {
        grid-template-columns: 1fr 1fr;
    }

    /* Игры */
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    /* Уведомления */
    .notifications-panel { width: 320px; }
}

/* ============================================================
   ТЕЛЕФОН (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {

    /* ── Navbar: гамбургер ВСЕГДА виден — это единственный 100% надёжный
       путь в боковое меню. Нижняя навигация — это ДОПОЛНИТЕЛЬНЫЙ быстрый
       доступ, а не единственный. Если один из двух путей сломается по
       любой причине, второй всё равно работает. ── */
    .navbar {
        padding: .55rem .7rem;
        height: var(--navbar-height);
        gap: .4rem;
    }

    .menu-btn {
        width: 36px;
        height: 36px;
        font-size: .95rem;
        flex-shrink: 0;
    }

    .app-title {
        font-size: .92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .conn-dot { flex-shrink: 0; }

    .user-info { gap: .35rem; flex-shrink: 0; }

    /* Имя пользователя скрываем в навбаре на узких экранах — оно и так
       доступно в разделе "Профиль", а место в навбаре критично важно */
    #current-username { display: none; }

    #verified-icon { display: none; }

    .notif-bell-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    #user-balance {
        font-size: .78rem;
        padding: .3rem .55rem;
        white-space: nowrap;
    }

    /* ── Контент учитывает нижнюю панель навигации ── */
    .main-content {
        padding: .6rem;
        padding-bottom: calc(var(--bottom-nav-height) + .6rem);
    }

    /* ── Боковое меню — на всю ширину экрана ── */
    .side-menu {
        width: 100%;
        left: -100%;
        padding-top: var(--navbar-height);
        z-index: 1050;
    }

    /* ── Нижняя навигация — быстрый доступ, дублирует основные разделы ── */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: var(--bg-surface);
        border-top: 1px solid var(--border-subtle);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 1000;
        padding: 0 .25rem;
        box-shadow: 0 -4px 20px rgba(20,24,34,.06);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: .6rem;
        font-weight: 500;
        color: var(--text-tertiary);
        cursor: pointer;
        padding: .4rem .2rem;
        border-radius: var(--r-sm);
        transition: color .15s;
        position: relative;
        min-width: 0;
        min-height: 44px; /* минимальный тач-таргет по гайдлайнам Apple/Google */
    }

    .bottom-nav-item i { font-size: 1.15rem; }

    .bottom-nav-item.active { color: var(--primary-orange-dark); }

    .bottom-nav-item.active i { transform: scale(1.1); }

    .bottom-nav-badge {
        position: absolute;
        top: .2rem;
        right: calc(50% - 14px);
        background: var(--error);
        color: white;
        font-size: .58rem;
        font-weight: 700;
        min-width: 15px;
        height: 15px;
        border-radius: var(--r-pill);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        border: 1.5px solid var(--bg-surface);
    }

    /* ── chat-view занимает весь экран ── */
    .chat-view {
        position: fixed;
        inset: 0;
        z-index: 900;
        height: 100vh;   /* фолбэк */
        height: 100dvh;  /* реальная видимая высота — фикс "уезжающего" поля ввода */
        border-radius: 0;
    }

    .chat-view .message-input-container {
        padding-bottom: calc(.65rem + env(safe-area-inset-bottom, 0px));
    }

    .chat-header { padding: .65rem .75rem; gap: .5rem; }

    .chat-name-large { font-size: .96rem; }

    .chat-status { font-size: .76rem; }

    .chat-actions { gap: .1rem; }

    .chat-action-btn { width: 34px; height: 34px; font-size: .92rem; }

    /* ── Список чатов ── */
    .chats-view { max-width: 100%; }

    .chats-header h2 { font-size: 1.1rem; }

    .chat-item { padding: .65rem .5rem; gap: .7rem; min-height: 60px; }

    .chat-avatar { width: 46px; height: 46px; font-size: .95rem; }

    .chat-name { font-size: .9rem; }

    .chat-last-message { font-size: .8rem; }

    /* ── Кнопки: минимальный тач-таргет 44px ── */
    .new-chat-btn {
        padding: .65rem 1.1rem;
        font-size: .84rem;
        min-height: 44px;
    }

    /* ── Модальные окна — полный экран снизу, удобно для больших пальцев ── */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        width: 100%;
        max-height: 92vh;
        padding: 1.25rem;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
        animation: slideUpModal .25s ease;
    }

    @keyframes slideUpModal {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0);   opacity: 1; }
    }

    .modal-btn, .modal-input, .setting-select {
        min-height: 44px;
    }

    /* ── Панель уведомлений ── */
    .notifications-panel {
        width: 100%;
        top: auto;
        bottom: -100%;
        right: 0;
        height: 85vh;
        border-radius: 20px 20px 0 0;
        transition: bottom .25s ease;
    }

    .notifications-panel.open { bottom: 0; right: 0; }

    /* ── Поле ввода сообщения ── */
    .message-input-container { padding: .5rem .6rem; }

    .emoji-btn, .attach-btn, .gift-btn {
        width: 36px;
        height: 36px;
        font-size: .95rem;
    }

    .voice-record-btn, .send-btn {
        width: 40px;
        height: 40px;
        font-size: .95rem;
    }

    .message-input {
        font-size: .9rem;
        min-height: 40px;
    }

    /* ── Сообщения ── */
    .message { max-width: 85%; }

    .message-actions { gap: .1rem; }

    .action-btn { width: 36px; height: 36px; font-size: .95rem; }

    /* ── Настройки ── */
    .settings-container { padding: .9rem 1rem; }

    .settings-section h3 { font-size: .92rem; }

    .settings-item {
        flex-wrap: wrap;
        gap: .5rem;
        min-height: 44px;
    }

    .setting-label { font-size: .85rem; }

    .setting-select {
        font-size: .85rem;
        padding: .5rem .7rem;
    }

    .settings-btn { min-height: 38px; padding: .5rem 1rem; }

    /* ── Подарки ── */
    .gifts-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: .7rem;
    }

    .gift-item { padding: .75rem; }

    .gift-image { height: 90px; }

    .gift-name { font-size: .85rem; }

    .gift-price { font-size: .9rem; }

    .send-gift-btn { min-height: 40px; }

    /* ── Игры ── */
    .games-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }

    .game-card { padding: 1rem .85rem; }

    .game-icon { width: 44px; height: 44px; font-size: 1.1rem; }

    .play-btn { min-height: 40px; }

    /* ── Игровая доска / модалки игр ── */
    .game-container {
        width: 98%;
        padding: 1rem;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        max-height: 90vh;
        overflow-y: auto;
    }

    .tic-tac-toe-board { max-width: 240px; }

    .ttt-cell { font-size: 1.8rem; min-height: 44px; }

    .bs-cell { width: 26px; height: 26px; font-size: .72rem; }

    /* ── Админ ── */
    .admin-header { padding: 1rem 1.1rem; flex-direction: column; align-items: flex-start; gap: .5rem; }

    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; gap: .3rem; -webkit-overflow-scrolling: touch; }

    .admin-tab {
        white-space: nowrap;
        padding: .55rem .85rem;
        font-size: .82rem;
        min-height: 40px;
    }

    .admin-content { padding: .9rem 1rem; }

    .admin-stats { grid-template-columns: 1fr 1fr; gap: .6rem; }

    .stat-card { padding: 1rem; }

    .stat-card div { font-size: 1.4rem; }

    .admin-user-item, .admin-gift-item, .ticket-item, .report-item {
        padding: .7rem .8rem;
    }

    /* ── Поиск ── */
    .search-view h2 { font-size: 1.1rem; }

    .search-input { min-height: 44px; }

    /* ── Заголовки разделов ── */
    .chats-header h2,
    .gifts-header h2,
    .games-view h2,
    .settings-view h2,
    .search-view h2 {
        font-size: 1.1rem;
    }

    /* ── Каналы ── */
    .channels-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }

    .friends-tab { min-height: 38px; }

    /* ── Уведомления-попап приглашения в игру ── */
    .game-invite-popup {
        bottom: calc(var(--bottom-nav-height) + 12px);
        right: 12px;
        left: 12px;
        max-width: 100%;
    }

    /* ── Профиль ── */
    .profile-avatar-large { width: 84px; height: 84px; }
}

/* ============================================================
   ТЁМНАЯ ТЕМА — нижняя навигация
   ============================================================ */
body.dark-theme .bottom-nav {
    background: var(--bg-dark-secondary);
    border-top-color: var(--border-dark);
}

body.dark-theme .bottom-nav-item { color: var(--text-dark-secondary); }
body.dark-theme .bottom-nav-item.active { color: var(--primary-orange); }

/* ============================================================
   СТЕКЛЯННАЯ ТЕМА — нижняя навигация
   ============================================================ */


/* ============================================================
   SAFE AREA (iPhone notch / home indicator)
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + .6rem);
    }
}


/* ============================================================
   LIQUID GLASS THEME v2 — полный редизайн
   ============================================================ */

/* 1. Живой многоцветный фон */
body.glass-theme {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: #C9D8E8;          /* нейтральный светло-стальной */
    color: #1A1C28;
    -webkit-font-smoothing: antialiased;
}

/* Анимированные цветные блobs */
body.glass-theme::before {
    content: "";
    position: fixed;
    inset: -15%;
    z-index: -1;
    background:
        radial-gradient(ellipse 65% 55% at 12% 18%,  rgba(255,195,85,0.75)  0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 88% 12%,  rgba(137,207,240,0.75) 0%, transparent 55%),
        radial-gradient(ellipse 55% 50% at 75% 82%,  rgba(181,88,175,0.55)  0%, transparent 55%),
        radial-gradient(ellipse 50% 55% at 18% 88%,  rgba(68,170,219,0.60)  0%, transparent 55%),
        radial-gradient(ellipse 80% 70% at 50% 50%,  rgba(240,248,255,0.50) 0%, transparent 65%);
    filter: blur(55px);
    animation: glassOrbs 22s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes glassOrbs {
    0%   { transform: translate(0%, 0%)    scale(1); }
    33%  { transform: translate(-2%, 4%)   scale(1.05); }
    66%  { transform: translate(3%, -2%)   scale(0.97); }
    100% { transform: translate(-1%, -3%)  scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    body.glass-theme::before { animation: none; }
}

/* 2. Базовая "стеклянная" поверхность */
.glass-surface {
    background:  rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(22px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(200%) brightness(1.08);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 8px 32px rgba(31,50,80, 0.12),
        inset 0 1.5px 0 rgba(255,255,255,0.75),   /* верхний блик */
        inset 0 -1px 0  rgba(255,255,255,0.15);    /* нижний тонкий блик */
}

/* 3. Приложение */
body.glass-theme .app-container,
body.glass-theme .main-content {
    background: transparent;
}

/* 4. Навбар */
body.glass-theme .navbar {
    background:  rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(28px) saturate(220%) brightness(1.1);
    -webkit-backdrop-filter: blur(28px) saturate(220%) brightness(1.1);
    border-bottom: 1px solid rgba(255,255,255,0.45);
    box-shadow: 0 2px 24px rgba(31,50,80,0.10), inset 0 1px 0 rgba(255,255,255,0.75);
    color: #1A1C28;
}

body.glass-theme .app-title,
body.glass-theme #current-username { color: #1A1C28; }

/* 5. Боковое меню */
body.glass-theme .side-menu {
    background:  rgba(240, 248, 255, 0.40);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-right: 1px solid rgba(255,255,255,0.45);
    box-shadow: 4px 0 32px rgba(31,50,80,0.10), inset -1px 0 0 rgba(255,255,255,0.5);
}

body.glass-theme .side-menu-item { color: #1A1C28; }

body.glass-theme .side-menu-item:hover {
    background: rgba(255, 255, 255, 0.35);
}

body.glass-theme .side-menu-item.active {
    background: rgba(255, 190, 80, 0.25);
    border-left-color: #E09020;
}

body.glass-theme .side-menu-section { border-bottom-color: rgba(255,255,255,0.35); }
body.glass-theme .side-menu-section h4 { color: rgba(26,28,40,0.55); }

/* 6. Карточки, чаты, список */
body.glass-theme .chat-item,
body.glass-theme .gift-item,
body.glass-theme .game-card,
body.glass-theme .search-result-item,
body.glass-theme .friend-request-item,
body.glass-theme .stat-card,
body.glass-theme .admin-user-item,
body.glass-theme .admin-gift-item,
body.glass-theme .ticket-item,
body.glass-theme .report-item,
body.glass-theme .session-item,
body.glass-theme .premium-feature-card,
body.glass-theme .premium-plan,
body.glass-theme .bot-command-item {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: 0 6px 24px rgba(31,50,80,0.08),
                inset 0 1.5px 0 rgba(255,255,255,0.72);
    color: #1A1C28;
}

body.glass-theme .chat-item:hover,
body.glass-theme .gift-item:hover,
body.glass-theme .game-card:hover,
body.glass-theme .search-result-item:hover {
    background: rgba(255,255,255,0.38);
    box-shadow: 0 10px 36px rgba(31,50,80,0.14), inset 0 1.5px 0 rgba(255,255,255,0.80);
    transform: translateY(-1px);
}

/* 7. Панели (settings, admin) */
body.glass-theme .settings-container,
body.glass-theme .admin-content {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: 0 8px 32px rgba(31,50,80,0.08), inset 0 1.5px 0 rgba(255,255,255,0.72);
}

body.glass-theme .settings-section { border-bottom-color: rgba(255,255,255,0.4); }

/* 8. Окно чата */
body.glass-theme .chat-view,
body.glass-theme .chat-header {
    background: rgba(255,255,255,0.20);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: none;
}

body.glass-theme .messages-container { background: transparent; }

body.glass-theme .message-input-container {
    background: rgba(255,255,255,0.28);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255,255,255,0.45);
    box-shadow: 0 -4px 24px rgba(31,50,80,0.06), inset 0 1px 0 rgba(255,255,255,0.65);
}

/* 9. Сообщения */
body.glass-theme .message.received {
    background: rgba(255,255,255,0.32);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.48);
    box-shadow: 0 4px 16px rgba(31,50,80,0.08), inset 0 1px 0 rgba(255,255,255,0.72);
    color: #1A1C28;
}

body.glass-theme .message.sent {
    background: linear-gradient(145deg, rgba(255,200,100,0.88), rgba(255,155,55,0.82));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 4px 18px rgba(210,120,20,0.25), inset 0 1px 0 rgba(255,255,255,0.75);
    color: #2A1800;
}

/* 10. Поля ввода */
body.glass-theme .message-input,
body.glass-theme .modal-input,
body.glass-theme .setting-select,
body.glass-theme .search-input {
    background: rgba(255,255,255,0.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: inset 0 2px 6px rgba(31,50,80,0.06);
    color: #1A1C28;
}

body.glass-theme .message-input:focus,
body.glass-theme .modal-input:focus,
body.glass-theme .search-input:focus {
    background: rgba(255,255,255,0.55);
    border-color: rgba(137,207,240,0.75);
    box-shadow: 0 0 0 3px rgba(137,207,240,0.25), inset 0 2px 4px rgba(31,50,80,0.04);
}

body.glass-theme .message-input::placeholder,
body.glass-theme .modal-input::placeholder,
body.glass-theme .search-input::placeholder { color: rgba(26,28,40,0.42); }

/* 11. Модальные окна */
body.glass-theme .modal-overlay {
    background: rgba(180,205,230,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.glass-theme .modal {
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(32px) saturate(220%) brightness(1.08);
    -webkit-backdrop-filter: blur(32px) saturate(220%) brightness(1.08);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 20px 60px rgba(31,50,80,0.16), inset 0 1.5px 0 rgba(255,255,255,0.85);
    color: #1A1C28;
}

body.glass-theme .modal-header h3 { color: #1A1C28; }

/* 12. Кнопки */
body.glass-theme .new-chat-btn,
body.glass-theme .upload-btn,
body.glass-theme .modal-btn,
body.glass-theme .premium-buy-btn {
    background: linear-gradient(145deg, rgba(255,200,100,0.92), rgba(255,155,55,0.86));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 6px 20px rgba(210,120,20,0.28), inset 0 1.5px 0 rgba(255,255,255,0.72);
    color: #2A1800;
}

body.glass-theme .send-btn {
    background: linear-gradient(145deg, rgba(150,215,245,0.92), rgba(90,165,210,0.86));
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 6px 20px rgba(60,130,190,0.22), inset 0 1.5px 0 rgba(255,255,255,0.75);
    color: #12304A;
}

body.glass-theme .voice-record-btn {
    background: linear-gradient(145deg, rgba(255,200,100,0.90), rgba(255,155,55,0.84));
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 6px 18px rgba(210,120,20,0.25), inset 0 1.5px 0 rgba(255,255,255,0.70);
    color: #2A1800;
}

body.glass-theme .menu-btn,
body.glass-theme .back-btn,
body.glass-theme .chat-action-btn,
body.glass-theme .modal-close,
body.glass-theme .emoji-btn,
body.glass-theme .attach-btn,
body.glass-theme .gift-btn,
body.glass-theme .friend-action-btn,
body.glass-theme .action-btn,
body.glass-theme .settings-btn,
body.glass-theme .notif-bell-btn {
    background: rgba(255,255,255,0.30);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.45);
    color: #1A1C28;
}

body.glass-theme .menu-btn:hover,
body.glass-theme .back-btn:hover,
body.glass-theme .chat-action-btn:hover,
body.glass-theme .emoji-btn:hover,
body.glass-theme .attach-btn:hover,
body.glass-theme .gift-btn:hover,
body.glass-theme .settings-btn:hover,
body.glass-theme .notif-bell-btn:hover {
    background: rgba(255,255,255,0.52);
}

/* 13. Вкладки */
body.glass-theme .friends-tab,
body.glass-theme .admin-tab {
    background: rgba(255,255,255,0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.45);
    color: rgba(26,28,40,0.75);
}

body.glass-theme .friends-tab.active,
body.glass-theme .admin-tab.active {
    background: linear-gradient(145deg, rgba(255,200,100,0.88), rgba(255,160,60,0.80));
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 4px 16px rgba(210,120,20,0.20), inset 0 1px 0 rgba(255,255,255,0.70);
    color: #2A1800;
}

/* 14. Уведомления */
body.glass-theme .notification {
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.60);
    box-shadow: 0 12px 40px rgba(31,50,80,0.14), inset 0 1.5px 0 rgba(255,255,255,0.80);
    color: #1A1C28;
}

body.glass-theme .notifications-panel {
    background: rgba(230,242,252,0.52);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-left: 1px solid rgba(255,255,255,0.50);
}

body.glass-theme .notifications-panel-header { border-bottom-color: rgba(255,255,255,0.40); }
body.glass-theme .notifications-panel-header h3 { color: #1A1C28; }
body.glass-theme .notif-item:hover { background: rgba(255,255,255,0.32); }
body.glass-theme .notif-unread { background: rgba(137,207,240,0.18); }
body.glass-theme .notif-title { color: #1A1C28; }

/* 15. Унифицированные тексты */
body.glass-theme .chat-name,
body.glass-theme .chat-name-large,
body.glass-theme .gift-name,
body.glass-theme .game-card h3,
body.glass-theme .settings-section h3,
body.glass-theme .setting-label,
body.glass-theme .modal-header h3,
body.glass-theme .chats-header h2,
body.glass-theme .gifts-header h2,
body.glass-theme .games-view h2,
body.glass-theme .settings-view h2,
body.glass-theme .search-view h2,
body.glass-theme .admin-tab-content h3,
body.glass-theme .game-status,
body.glass-theme .ttt-cell,
body.glass-theme .player-symbol,
body.glass-theme .side-menu-item,
body.glass-theme .admin-header h2 { color: #1A1C28; }

body.glass-theme .chat-last-message,
body.glass-theme .chat-status,
body.glass-theme .gift-description,
body.glass-theme .game-card p,
body.glass-theme .setting-value,
body.glass-theme .empty-state,
body.glass-theme .session-info { color: rgba(26,28,40,0.60); }

/* 16. Игровые ячейки */
body.glass-theme .ttt-cell {
    background: rgba(255,255,255,0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.50);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.70);
}

body.glass-theme .ttt-cell:hover:not(:disabled) {
    background: rgba(255,255,255,0.50);
}

body.glass-theme .game-players,
body.glass-theme .game-status {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.40);
}

/* 17. Скроллбар */
body.glass-theme ::-webkit-scrollbar-thumb {
    background: rgba(26,28,40,0.20);
    border-radius: var(--r-pill);
}

/* 18. Нижняя навигация (мобайл) */
body.glass-theme .bottom-nav {
    background: rgba(230,242,252,0.52);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-top: 1px solid rgba(255,255,255,0.50);
}

body.glass-theme .bottom-nav-item { color: rgba(26,28,40,0.55); }
body.glass-theme .bottom-nav-item.active { color: #C07010; }

/* 19. Оверлей при открытом меню */
body.glass-theme #user-balance {
    background: rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.45);
    color: #1A1C28;
}

/* 20. Платёжный блок */
body.glass-theme .payment-card-block {
    background: rgba(255,255,255,0.30);
    border: 1px solid rgba(255,255,255,0.50);
}

body.glass-theme .payment-card-number { color: #1A1C28; }
body.glass-theme .admin-header {
    background: linear-gradient(135deg, rgba(100,150,200,0.55), rgba(50,100,160,0.45));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.40);
}

/* ============================================================
   МОРСКОЙ БОЙ — стили
   ============================================================ */
.bs-modal { max-height: 96vh; overflow-y: auto; }

.bs-info {
    padding: .55rem .8rem;
    background: var(--bg-surface-alt);
    border-radius: var(--r-md);
    font-size: .88rem;
    color: var(--text-primary);
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.bs-grids {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.bs-grid-wrap { flex: 0 0 auto; }

.bs-grid-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: .45rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.bs-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    user-select: none;
}

.bs-cell {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    cursor: pointer;
    transition: background .1s;
}

.bs-cell:hover { background: var(--bg-hover); }

.bs-ship { background: var(--primary-dark-blue); border-color: var(--primary-deep-blue); }
.bs-hit  { background: var(--error); border-color: #c0001a; }
.bs-miss { background: var(--bg-canvas); border-color: var(--border-default); color: var(--text-tertiary); }
.bs-preview { background: rgba(137,207,240,.4); border-color: var(--primary-blue-dark); }

/* Тёмная тема */
body.dark-theme .bs-cell { background: var(--bg-dark-tertiary); border-color: var(--border-dark); }
body.dark-theme .bs-cell:hover { background: var(--bg-dark-hover); }
body.dark-theme .bs-ship { background: #3A5577; }
body.dark-theme .bs-miss { background: var(--bg-dark); }
body.dark-theme .bs-info { background: var(--bg-dark-tertiary); color: var(--text-dark); }

/* Стеклянная тема */
body.glass-theme .bs-cell {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,.40);
}
body.glass-theme .bs-cell:hover { background: rgba(255,255,255,.42); }
body.glass-theme .bs-ship { background: rgba(46,80,119,.70); border-color: rgba(137,207,240,.55); }
body.glass-theme .bs-miss { background: rgba(255,255,255,.12); }
body.glass-theme .bs-info {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    color: #1A1C28;
}

@media (max-width: 640px) {
    .bs-cell { width: 26px; height: 26px; font-size: .72rem; }
    .bs-grids { gap: .85rem; }
    .bs-grid { gap: 1px; }
}

@media (max-width: 420px) {
    .bs-cell { width: 22px; height: 22px; font-size: .65rem; }
}

/* ============================================================
   МУЛЬТИПЛЕЕР — СТИЛИ
   ============================================================ */

/* Строка пользователя в поиске приглашений */
.invite-user-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    border: 1px solid var(--border-subtle);
    margin-bottom: .35rem;
}

.invite-user-row:hover { background: var(--bg-hover); }

/* Спиннер ожидания */
.waiting-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(137,207,240,.3);
    border-top-color: var(--primary-blue-dark);
    border-radius: 50%;
    animation: spin .85s linear infinite;
    margin: .5rem auto;
}

/* ── Попап входящего приглашения ── */
.game-invite-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 11000;
    animation: slideInRight .3s cubic-bezier(.34,1.56,.64,1);
    max-width: 340px;
    width: calc(100vw - 40px);
}

.game-invite-popup-out {
    animation: slideOutRight .25s ease forwards;
}

@keyframes slideOutRight {
    to { transform: translateX(110%); opacity: 0; }
}

.game-invite-popup-inner {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    box-shadow: var(--shadow-lg);
}

.game-invite-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-alt);
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
}

.game-invite-body { flex: 1; min-width: 0; }

.game-invite-title {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text-primary);
    margin-bottom: .15rem;
}

.game-invite-from {
    font-size: .8rem;
    color: var(--text-secondary);
}

.game-invite-actions {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-shrink: 0;
}

.game-invite-accept {
    background: var(--success);
    color: white;
    border: none;
    padding: .4rem .85rem;
    border-radius: var(--r-pill);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
}

.game-invite-accept:hover { opacity: .88; }

.game-invite-decline {
    background: var(--bg-surface-alt);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
    padding: .35rem .7rem;
    border-radius: var(--r-pill);
    font-size: .82rem;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.game-invite-decline:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Мобайл — попап снизу */
/* game-invite-popup mobile positioning перенесена в общий мобильный блок ниже */

/* ── Тёмная тема ── */
body.dark-theme .game-invite-popup-inner {
    background: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}

body.dark-theme .game-invite-icon {
    background: var(--bg-dark-tertiary);
    border-color: var(--border-dark);
}

body.dark-theme .game-invite-title { color: var(--text-dark); }
body.dark-theme .game-invite-from  { color: var(--text-dark-secondary); }
body.dark-theme .game-invite-decline { background: var(--bg-dark-tertiary); border-color: var(--border-dark); }
body.dark-theme .invite-user-row { border-color: var(--border-dark); }
body.dark-theme .invite-user-row:hover { background: var(--bg-dark-hover); }

/* ── Стеклянная тема ── */
body.glass-theme .game-invite-popup-inner {
    background: rgba(255,255,255,.52);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-color: rgba(255,255,255,.6);
    box-shadow: 0 16px 48px rgba(31,50,80,.18), inset 0 1.5px 0 rgba(255,255,255,.85);
}

body.glass-theme .game-invite-icon {
    background: rgba(255,255,255,.3);
    border-color: rgba(255,255,255,.5);
}

body.glass-theme .game-invite-title { color: #1A1C28; }
body.glass-theme .game-invite-decline {
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.45);
    color: #1A1C28;
}

body.glass-theme .invite-user-row {
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.4);
}

body.glass-theme .invite-user-row:hover { background: rgba(255,255,255,.38); }

/* ============================================================
   CONNECTION STATUS DOT
   ============================================================ */
.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .4s, box-shadow .4s;
    cursor: help;
}

.conn-online {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(52,199,123,.25);
}

.conn-offline {
    background: var(--error);
    box-shadow: 0 0 0 2px rgba(242,73,92,.25);
}

.conn-connecting {
    background: var(--warning);
    animation: connPulse 1.2s ease-in-out infinite;
}

@keyframes connPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245,166,35,.5); }
    50%       { opacity: .7; box-shadow: 0 0 0 5px rgba(245,166,35,0); }
}

/* ============================================================
   SECRET CHAT BUTTON
   ============================================================ */
.chat-action-btn.secret-active {
    background: rgba(52,199,123,.15);
    color: var(--success);
    border: 1px solid rgba(52,199,123,.35);
}

/* ============================================================
   NOTIFICATION IMPROVEMENTS
   ============================================================ */
.notif-actionable {
    cursor: pointer;
    position: relative;
}

.notif-actionable::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-md);
    border: 1.5px solid transparent;
    transition: border-color .15s;
    pointer-events: none;
}

.notif-actionable:hover::after { border-color: var(--primary-orange); }

.notif-action-hint {
    font-size: .72rem;
    color: var(--primary-orange-dark);
    font-weight: 600;
    margin: .2rem 0;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.notif-icon-game_invite { background: linear-gradient(135deg, #7393B3, #2E5077); color: white; }
.notif-icon-premium_purchased,
.notif-icon-premium_bonus { background: linear-gradient(135deg, #FFB347, #FF9A3C); color: #1A1D24; }
.notif-icon-group_invite { background: linear-gradient(135deg, #89CFF0, #5BAEDC); color: #0C3D5A; }
.notif-icon-gift_received { background: linear-gradient(135deg, #E94560, #C01D3A); color: white; }

/* ============================================================
   DARK THEME — new components
   ============================================================ */
body.dark-theme .conn-online  { box-shadow: 0 0 0 2px rgba(52,199,123,.2); }
body.dark-theme .conn-offline { box-shadow: 0 0 0 2px rgba(242,73,92,.2); }

/* ============================================================
   GLASS THEME — new components
   ============================================================ */
body.glass-theme .conn-dot {
    border: 1px solid rgba(255,255,255,.5);
}

body.glass-theme .chat-action-btn.secret-active {
    background: rgba(52,199,123,.2);
    backdrop-filter: blur(8px);
}


/* ============================================================
   ПОЛНЫЙ КОНТРОЛЬ (Owner / Tech Leader)
   ============================================================ */
.fc-subtabs {
    display: flex;
    gap: .4rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.fc-subtab {
    padding: .45rem .9rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .15s;
}

.fc-subtab:hover { background: var(--bg-hover); }

.fc-subtab.active {
    background: var(--primary-deep-blue);
    color: white;
    border-color: var(--primary-deep-blue);
}

.fc-user-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    border: 1px solid var(--border-subtle);
    margin-bottom: .35rem;
    position: relative;
}

.fc-user-row:hover { background: var(--bg-hover); }

.fc-session-item, .fc-error-item {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    padding: .6rem .75rem;
    margin-bottom: .4rem;
}

.fc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem .75rem;
    background: var(--bg-surface-alt);
    border-radius: var(--r-md);
    padding: .75rem;
    font-size: .84rem;
}

.fc-detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.fc-label {
    font-size: .72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Тёмная тема */
body.dark-theme .fc-subtab { background: var(--bg-dark-tertiary); border-color: var(--border-dark); color: var(--text-dark-secondary); }
body.dark-theme .fc-user-row { border-color: var(--border-dark); }
body.dark-theme .fc-user-row:hover { background: var(--bg-dark-hover); }
body.dark-theme .fc-session-item, body.dark-theme .fc-error-item, body.dark-theme .fc-detail-grid {
    background: var(--bg-dark-tertiary); border-color: var(--border-dark);
}

/* Стеклянная тема */
body.glass-theme .fc-subtab { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.45); color: #1A1C28; }
body.glass-theme .fc-user-row, body.glass-theme .fc-session-item, body.glass-theme .fc-error-item, body.glass-theme .fc-detail-grid {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(14px);
    border-color: rgba(255,255,255,.4);
}

@media (max-width: 480px) {
    .fc-detail-grid { grid-template-columns: 1fr; }
    .fc-subtabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .fc-subtab { white-space: nowrap; }
}

/* ============================================================
   РЕДАКТОР ПРОФИЛЯ (Edit Profile Modal)
   ============================================================ */
.epm-tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: .25rem;
}

.epm-tab {
    flex: 1;
    padding: .55rem .5rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .15s;
    text-align: center;
}

.epm-tab:hover { background: var(--bg-hover); }

.epm-tab.active {
    background: var(--primary-deep-blue);
    color: white;
    border-color: var(--primary-deep-blue);
}

body.dark-theme .epm-tab { background: var(--bg-dark-tertiary); border-color: var(--border-dark); color: var(--text-dark-secondary); }
body.glass-theme .epm-tab { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.45); color: #1A1C28; }

/* ============================================================
   ЦИТАТА ОТВЕТА (reply quote) ВНУТРИ СООБЩЕНИЯ
   ============================================================ */
.reply-quote {
    display: flex;
    gap: .5rem;
    margin: .3rem 0 .45rem;
    padding: .3rem .5rem;
    background: rgba(0,0,0,.05);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background .15s;
}

.message.sent .reply-quote { background: rgba(255,255,255,.25); }

.reply-quote:hover { background: rgba(0,0,0,.09); }
.message.sent .reply-quote:hover { background: rgba(255,255,255,.38); }

.reply-quote-bar {
    width: 3px;
    border-radius: 2px;
    background: var(--primary-deep-blue);
    flex-shrink: 0;
}

.message.sent .reply-quote-bar { background: rgba(26,29,36,.55); }

.reply-quote-body { min-width: 0; flex: 1; }

.reply-quote-sender {
    font-size: .76rem;
    font-weight: 700;
    color: var(--primary-deep-blue);
    margin-bottom: .1rem;
}

.message.sent .reply-quote-sender { color: rgba(26,29,36,.8); }

.reply-quote-text {
    font-size: .8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message.sent .reply-quote-text { color: rgba(26,29,36,.65); }

.reply-quote-missing { opacity: .6; cursor: default; }

.forwarded-label {
    font-size: .74rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.message.sent .forwarded-label { color: rgba(26,29,36,.55); }

/* Подсветка сообщения при переходе по цитате */
@keyframes messageHighlightPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,179,71,0); }
    30% { box-shadow: 0 0 0 4px rgba(255,179,71,.55); }
}

.message-highlight {
    animation: messageHighlightPulse 1.2s ease;
}

/* ============================================================
   РЕАКЦИИ — своя реакция выделена
   ============================================================ */
.reaction-mine {
    background: rgba(255,179,71,.35) !important;
    box-shadow: inset 0 0 0 1.5px var(--primary-orange-dark);
}

/* ============================================================
   БЫСТРЫЕ РЕАКЦИИ (quick picker)
   ============================================================ */
.quick-reactions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}

.quick-reaction-btn {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, background .15s;
}

.quick-reaction-btn:hover {
    transform: scale(1.15);
    background: var(--bg-hover);
}

/* ============================================================
   ПОЛНЫЙ ЭМОДЗИ-ПИКЕР (1700+)
   ============================================================ */
.emoji-picker-modal {
    max-width: 420px;
    width: 92vw;
}

.emoji-cat-tabs {
    display: flex;
    gap: .3rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--border-subtle);
    -webkit-overflow-scrolling: touch;
}

.emoji-cat-tab {
    flex-shrink: 0;
    background: var(--bg-surface-alt);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.emoji-cat-tab:hover { background: var(--bg-hover); }

.emoji-cat-tab.active {
    background: rgba(255,179,71,.2);
    border-color: var(--primary-orange);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .15rem;
    max-height: 320px;
    overflow-y: auto;
    padding: .25rem;
}

.emoji-grid-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    padding: .4rem 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background .12s, transform .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.emoji-grid-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.2);
}

/* ============================================================
   ПЕРЕСЫЛКА СООБЩЕНИЙ
   ============================================================ */
.fwd-target-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .7rem;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    border: 1px solid transparent;
    margin-bottom: .3rem;
}

.fwd-target-row:hover { background: var(--bg-hover); }

.fwd-target-selected {
    background: rgba(52,199,123,.12);
    border-color: rgba(52,199,123,.4);
}

/* ============================================================
   ТЁМНАЯ ТЕМА — новые компоненты
   ============================================================ */
body.dark-theme .reply-quote { background: rgba(255,255,255,.07); }
body.dark-theme .reply-quote:hover { background: rgba(255,255,255,.12); }
body.dark-theme .reply-quote-sender { color: #89CFF0; }
body.dark-theme .reply-quote-text { color: var(--text-dark-secondary); }
body.dark-theme .quick-reaction-btn,
body.dark-theme .emoji-cat-tab { background: var(--bg-dark-tertiary); border-color: var(--border-dark); }
body.dark-theme .emoji-cat-tab.active { background: rgba(255,179,71,.25); }
body.dark-theme .emoji-cat-tabs { border-bottom-color: var(--border-dark); }
body.dark-theme .fwd-target-row:hover { background: var(--bg-dark-hover); }
body.dark-theme .forwarded-label { color: var(--text-dark-secondary); }

/* ============================================================
   СТЕКЛЯННАЯ ТЕМА — новые компоненты
   ============================================================ */
body.glass-theme .reply-quote { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); }
body.glass-theme .quick-reaction-btn,
body.glass-theme .emoji-cat-tab,
body.glass-theme .fwd-target-row {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.4);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ НОВЫХ ЭЛЕМЕНТОВ
   ============================================================ */
@media (max-width: 480px) {
    .emoji-picker-grid { grid-template-columns: repeat(6, 1fr); max-height: 260px; }
    .emoji-grid-btn { font-size: 1.3rem; }
    .quick-reaction-btn { width: 42px; height: 42px; font-size: 1.3rem; }
    .emoji-picker-modal { width: 94vw; }
}

/* ============================================================
   УЧАСТНИКИ ЧАТА / УПРАВЛЕНИЕ ГРУППОЙ И КАНАЛОМ
   ============================================================ */
.chat-member-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .4rem;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.chat-member-row:hover { background: var(--bg-hover); }

.member-more-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}

.member-more-btn:hover { background: var(--bg-surface); color: var(--text-primary); }

.chat-manage-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem .9rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background .15s;
    text-align: left;
}

.chat-manage-btn:hover { background: var(--bg-hover); }

.chat-manage-btn i { width: 18px; text-align: center; color: var(--text-secondary); }

.chat-manage-danger {
    color: var(--error);
    border-color: rgba(242,73,92,.3);
}

.chat-manage-danger i { color: var(--error); }

.chat-manage-danger:hover { background: rgba(242,73,92,.08); }

.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: .9rem;
}

.perm-row:last-child { border-bottom: none; }

.action-log-item {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: .7rem .85rem;
    margin-bottom: .5rem;
}

.action-log-detail {
    font-size: .82rem;
    color: var(--text-secondary);
    margin-top: .3rem;
    padding: .4rem .55rem;
    background: var(--bg-surface);
    border-radius: var(--r-sm);
    word-break: break-word;
}

/* Тёмная тема */
body.dark-theme .chat-member-row:hover { background: var(--bg-dark-hover); }
body.dark-theme .member-more-btn:hover { background: var(--bg-dark-tertiary); }
body.dark-theme .chat-manage-btn { background: var(--bg-dark-tertiary); border-color: var(--border-dark); color: var(--text-dark); }
body.dark-theme .chat-manage-btn:hover { background: var(--bg-dark-hover); }
body.dark-theme .perm-row { border-bottom-color: var(--border-dark); }
body.dark-theme .action-log-item { background: var(--bg-dark-tertiary); border-color: var(--border-dark); }
body.dark-theme .action-log-detail { background: var(--bg-dark-secondary); color: var(--text-dark-secondary); }

/* Стеклянная тема */
body.glass-theme .chat-manage-btn,
body.glass-theme .action-log-item {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.4);
}