        :root {
            --primary-bg: #0a0a0c; 
            --glass-bg: rgba(20, 20, 25, 0.65);
            --glass-border: rgba(255, 255, 255, 0.08); 
            --glass-blur: blur(20px);
            --neon-pink: #ff2a6d; 
            --neon-blue: #05d9e8;
            --neon-purple: #bd00ff;
            --text-main: #ffffff; 
            --text-dim: #a0a0b0;
            --accent-color: #05d9e8;
        }

* { margin: 0; padding: 0; box-sizing: border-box; }

button {
    font: inherit;
    color: inherit;
}

button:focus-visible,
.color-swatch:focus-visible,
.custom-color-wrapper:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}
        body { background-color: var(--primary-bg); font-family: 'Rajdhani', sans-serif; color: var(--text-main); display: flex; flex-direction: column; align-items: center; min-height: 100vh; overflow-x: hidden; }

        /* ФОН */
        .fixed-bg { position: fixed; inset: 0; background: radial-gradient(circle at 50% 30%, rgba(34, 42, 86, 0.28) 0%, rgba(10, 14, 28, 0.9) 58%, rgba(5, 8, 18, 0.98) 100%); z-index: -2; }
        .grid-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(var(--glass-border) 1px, transparent 1px), linear-gradient(90deg, var(--glass-border) 1px, transparent 1px); background-size: 36px 36px; z-index: -1; opacity: 0.12; transform: perspective(500px) rotateX(58deg) translateY(-92px) translateZ(-200px); animation: gridMove 32s linear infinite; }
        @keyframes gridMove { 0% { background-position: 0 0; } 100% { background-position: 0 40px; } }


        .discord-shell {
            width: min(1180px, 100%);
            display: grid;
            grid-template-columns: 74px 230px minmax(0, 1fr);
            gap: 16px;
            align-items: start;
            padding: 20px 12px 18px;
        }

        .channels-sidebar,
        .server-rail {
            position: sticky;
            top: 18px;
            background: rgba(12, 16, 32, 0.44);
            border: 1px solid var(--glass-border);
            backdrop-filter: var(--glass-blur);
            border-radius: 18px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
        }

        .servers-sidebar {
            position: sticky;
            top: 18px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            max-height: calc(100vh - 40px);
        }

        .server-rail {
            width: 72px;
            padding: 12px 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            max-height: calc(100vh - 150px);
            border-radius: 24px;
            background: rgba(12, 16, 32, 0.46);
            border: 1px solid rgba(124, 136, 186, 0.22);
            box-shadow: inset 0 0 20px rgba(4, 8, 19, 0.9), 0 12px 28px rgba(0, 0, 0, 0.4);
        }

        .server-list { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: center; overflow: visible; }
        .servers-auth-btn {
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            width: 84px;
            height: 84px;
            border-radius: 24px;
            border: 1px solid rgba(72, 97, 141, 0.45);
            background: rgba(18, 24, 44, 0.42);
            display: grid;
            place-items: center;
            cursor: pointer;
            flex-shrink: 0;
            transition: 0.25s;
            overflow: visible;
            box-shadow: inset 0 0 22px rgba(9, 15, 31, 0.95), 0 10px 20px rgba(0,0,0,0.38);
        }
        .servers-auth-btn:hover { border-color: var(--accent-color); transform: translateY(-2px); }
        .servers-auth-btn .sidebar-auth-avatar-wrap { width: 62px; height: 62px; animation: uiFloat 5.5s ease-in-out infinite; }
        .servers-auth-btn .avatar {
            border-width: 2px;
            border-color: #00d9ff;
            box-shadow: 0 0 18px rgba(0, 220, 255, 0.3);
        }
        .servers-auth-btn .avatar-decoration { top: -8%; left: -8%; width: 116%; height: 116%; }
        .servers-auth-btn .status-indicator { width: 12px; height: 12px; border-width: 2px; }
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            margin: -1px;
            padding: 0;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }
        .server-pill {
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 1px solid rgba(118, 132, 173, 0.4);
            background: rgba(20, 26, 46, 0.44);
            display: grid;
            place-items: center;
            cursor: pointer;
            font-family: 'Orbitron', monospace;
            font-weight: 700;
            transition: transform 180ms ease, border-color 180ms ease, box-shadow 220ms ease;
            color: #8ea6d8;
            flex-shrink: 0;
        }
        .server-pill:hover { transform: translateY(-1px); border-color: rgba(5,217,232,0.8); box-shadow: 0 0 0 1px rgba(5,217,232,0.25); color: #fff; }
        .server-pill.active { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(5,217,232,0.22), 0 0 18px rgba(5,217,232,0.3); animation: uiPulse 2.6s ease-in-out infinite; }
        .server-pill img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .server-pill .server-initials { font-size: 12px; letter-spacing: 0.4px; }

        .channels-sidebar {
            padding: 14px 12px;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
        }
        .channels-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 18px;
            margin-bottom: 16px;
            font-family: 'Orbitron', monospace;
            font-size: 14px;
            font-weight: 700;
        }
        .channels-header span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .channel-create-btn {
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.06);
            width: 30px;
            height: 30px;
            border-radius: 9px;
            cursor: pointer;
            display: none;
            color: #b8d7ff;
            align-items: center;
            justify-content: center;
        }
        .channel-create-btn svg { width: 16px; height: 16px; fill: currentColor; }
        .channel-create-btn:hover { color: #fff; border-color: var(--accent-color); background: rgba(5,217,232,0.12); }
        .channels-group-label { display: none; }
        .sidebar-auth-avatar-wrap {
            position: relative;
            width: 44px;
            height: 44px;
            flex-shrink: 0;
            animation: uiFloat 6s ease-in-out infinite;
        }
        .sidebar-auth-avatar-wrap .avatar { border-width: 2px; box-shadow: 0 0 12px rgba(0,0,0,.6); }
        .sidebar-auth-avatar-wrap .avatar-decoration { top: -12%; left: -12%; width: 124%; height: 124%; }
        .sidebar-auth-avatar-wrap .status-indicator { width: 14px; height: 14px; border-width: 2px; bottom: 1px; right: 1px; }
        .sidebar-auth-meta { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
        .sidebar-auth-meta strong { font-family: 'Orbitron', monospace; font-size: 12px; color: #fff; letter-spacing: .4px; }
        .sidebar-auth-meta .discord-status-text { margin-top: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

        .channel-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
        .channel-item {
            backdrop-filter: blur(10px);
            width: 100%;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: #d9d9e6;
            text-align: left;
            padding: 10px 12px;
            cursor: pointer;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .channel-item:hover { background: rgba(255,255,255,0.09); transform: translateX(2px); }
        .channel-item.active { background: rgba(5, 217, 232, 0.14); color: var(--neon-blue); border-radius: 10px; }

        .content-column {
            min-width: 0;
            display: grid;
            justify-items: center;
            align-content: start;
            row-gap: 16px;
        }
        .channel-title {
            position: sticky;
            top: 8px;
            z-index: 50;
            width: min(100%, 860px);
            padding: 10px 14px;
            border: 1px solid rgba(132, 144, 191, 0.2);
            background: rgba(16, 22, 42, 0.44);
            border-radius: 12px;
            font-family: 'Orbitron', monospace;
            letter-spacing: 0.6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* ПРОФИЛЬ И БОТЫ (ГРУППА) */
        .profile-section { display: none; }
        
        .profile-header-group {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 40px; /* Расстояние между аватаркой и ботами */
            margin-bottom: 20px;
        }

        /* Аватар */
.avatar-container { position: relative; width: 130px; height: 130px; cursor: pointer; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: none; background: transparent; }
        .avatar-container:hover { transform: scale(1.08); }
        .avatar { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #747f8d; box-shadow: 0 0 25px rgba(0,0,0,0.8); object-fit: cover; position: relative; z-index: 2; transition: border-color 0.3s; }
        .avatar-decoration { position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; z-index: 3; pointer-events: none; display: none; }
        .status-indicator { position: absolute; bottom: 5px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background-color: #747f8d; border: 4px solid var(--primary-bg); z-index: 4; transition: background-color 0.3s; }
        

        .discord-decoration-animated {
            animation: discordDecorationPulse 2.8s ease-in-out infinite;
            filter: drop-shadow(0 0 8px rgba(0, 217, 232, 0.35));
        }

        @keyframes discordAvatarPulse {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-2px) scale(1.03); }
        }

        @keyframes discordDecorationPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.04); opacity: 0.9; }
        }

        /* Имя и статус */
        .username { font-family: 'Press Start 2P', cursive; font-size: 20px; text-shadow: 0 0 10px var(--neon-blue); color: #fff; letter-spacing: 1px; }
        .discord-status-text { font-family: 'Orbitron', monospace; color: var(--text-dim); margin-top: 8px; font-size: 13px; letter-spacing: 0.5px; }
        

        /* Левитирующие кнопки ботов */
.bot-orbit-btn {
            width: 65px; height: 65px; border-radius: 50%;
            background: rgba(20, 26, 46, 0.40); backdrop-filter: var(--glass-blur);
            border: 2px solid var(--glass-border);
            cursor: pointer; z-index: 15;
            display: flex; align-items: center; justify-content: center;
            overflow: hidden; padding: 4px;
            transition: 0.24s ease;
            animation: uiFloat 6s ease-in-out infinite;
}
.bot-orbit-btn:focus-visible,
.avatar-container:focus-visible {
    box-shadow: 0 0 0 3px rgba(5, 217, 232, 0.5);
}
        .bot-orbit-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        
        .bot-orbit-btn.left-btn { border-color: rgba(189, 0, 255, 0.5); box-shadow: 0 0 20px rgba(189, 0, 255, 0.3); animation-delay: 0.5s; }
        .bot-orbit-btn.left-btn:hover { transform: scale(1.15); box-shadow: 0 0 30px rgba(189, 0, 255, 0.6); border-color: var(--neon-purple); }
        
        .bot-orbit-btn.right-btn { border-color: rgba(5, 217, 232, 0.5); box-shadow: 0 0 20px rgba(5, 217, 232, 0.3); animation-delay: 1.5s; }
        .bot-orbit-btn.right-btn:hover { transform: scale(1.15); box-shadow: 0 0 30px rgba(5, 217, 232, 0.6); border-color: var(--neon-blue); }


        /* ПАНЕЛЬ ВВОДА */
        .chat-input-wrapper { display: none; width: min(100%, 860px); margin-top: 0; position: relative; z-index: 20; }
        .chat-input-container { background: rgba(20, 26, 46, 0.40); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); border-radius: 24px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 12px; transition: border-color 0.3s, box-shadow 0.3s; }
        .chat-input-container.drag-over { border-color: var(--neon-pink); background: rgba(255, 42, 109, 0.1); box-shadow: 0 0 20px rgba(255, 42, 109, 0.3) inset; }

        .preview-area { display: flex; gap: 12px; flex-wrap: wrap; }
        .preview-item { position: relative; width: 60px; height: 60px; border-radius: 14px; overflow: hidden; border: 1px solid var(--glass-border); }
        .preview-item img { width: 100%; height: 100%; object-fit: cover; }
        .preview-item video { width: 100%; height: 100%; object-fit: cover; }
        .preview-item.audio-preview {
            width: auto;
            min-width: 190px;
            max-width: 260px;
            height: auto;
            padding: 8px 10px;
            display: flex;
            align-items: center;
            gap: 18px;
            background: rgba(255, 255, 255, 0.04);
        }
        .preview-item.audio-preview img {
            width: 42px;
            height: 42px;
            border-radius: 8px;
            object-fit: cover;
        }
        .audio-preview-meta { display: flex; flex-direction: column; min-width: 0; }
        .audio-preview-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .audio-preview-subtitle { font-size: 11px; color: var(--text-dim); }

        .music-meta-panel { display: none; align-items: center; gap: 12px; }
        .music-meta-panel.show { display: flex; }
        .music-title-input {
            flex: 1;
            background: rgba(255,255,255,0.06);
            border: 1px solid var(--glass-border);
            color: white;
            border-radius: 10px;
            padding: 8px 12px;
            font-family: 'Rajdhani', sans-serif;
            font-size: 14px;
            outline: none;
        }
        .music-title-input:focus { border-color: var(--accent-color); }
        .remove-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); color: white; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); transition: 0.2s;}
        .remove-btn:hover { background: var(--neon-pink); }

        .input-row { display: flex; align-items: flex-end; gap: 12px; }
        .chat-textarea { flex-grow: 1; background: transparent; border: none; color: white; font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 500; padding: 8px 0; resize: none; max-height: 150px; overflow-y: auto; outline: none; }
        .chat-textarea::placeholder { color: var(--text-dim); }
        .chat-textarea::-webkit-scrollbar { width: 4px; }
        .chat-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

        .icon-btn { background: transparent; border: none; color: var(--text-dim); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; flex-shrink: 0; }
        .icon-btn:hover { background: rgba(255,255,255,0.08); color: white; }
        .icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
        .send-btn { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); margin-left: 5px; }
        .send-btn:hover { background: white; color: black; box-shadow: 0 0 20px white; transform: translateY(-2px); }

        .edit-status-bar { display: none; padding: 0 15px; font-family: 'Orbitron', monospace; font-size: 11px; color: #faa61a; }
        .clear-images-link { color: var(--neon-pink); text-decoration: underline; cursor: pointer; margin-left: 5px; transition: 0.2s; }
        .clear-images-link:hover { color: white; }

        /* ПАНЕЛЬ ЦВЕТОВ */
        .color-popover {
            position: fixed;
            inset: 0;
            background: rgba(6, 10, 22, 0.82);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            display: grid;
            place-items: center;
            padding: 20px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.22s ease, visibility 0.22s ease;
            z-index: 220;
        }
        .color-popover.show { opacity: 1; visibility: visible; pointer-events: auto; }
        .color-popover-panel {
            width: min(680px, 100%);
            border-radius: 22px;
            border: 1px solid var(--glass-border);
            background: rgba(12, 16, 30, 0.95);
            box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
            padding: 20px;
        }
        .color-popover-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            margin-bottom: 16px;
        }
        .color-popover-header h3 {
            margin: 0;
            font-size: 20px;
            font-family: 'Orbitron', monospace;
            letter-spacing: 0.6px;
        }
        .color-popover-close {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.05);
            cursor: pointer;
        }
        .color-popover-close:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .color-swatches-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
            gap: 14px;
        }
        .color-swatch { width: 64px; height: 64px; border-radius: 50%; cursor: pointer; transition: transform 0.2s; border: 3px solid transparent; justify-self: center; }
        .color-swatch:hover { transform: scale(1.2); }
        .color-swatch.active { border-color: white; transform: scale(1.1); box-shadow: 0 0 10px currentColor; }
        .custom-color-wrapper { position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 2px dashed rgba(255,255,255,0.5); cursor: pointer; display: flex; align-items: center; justify-content: center; justify-self: center; }
        .custom-color-wrapper input[type="color"] { position: absolute; opacity: 0; width: 200%; height: 200%; cursor: pointer; }
        .custom-color-wrapper::after { content: '+'; color: white; font-size: 28px; font-weight: bold; pointer-events: none; }

        /* ЛЕНТА СООБЩЕНИЙ */
        .feed-container { width: min(100%, 860px); margin-top: 0; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; z-index: 10; }
        .channel-empty-state { width: min(100%, 860px); margin-top: 0; padding: 20px; border-radius: 16px; border: 1px solid var(--glass-border); background: rgba(8,8,13,0.7); }
        .channel-empty-state h3 { font-family: 'Orbitron', monospace; margin-bottom: 8px; }
        .channel-empty-state p { color: var(--text-dim); }

        .channel-empty-state.legal-channel-view {
            display: block;
            max-height: 72vh;
            overflow-y: auto;
            padding-right: 16px;
        }
        .channel-empty-state.legal-channel-view::-webkit-scrollbar { width: 6px; }
        .channel-empty-state.legal-channel-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 8px; }
        .message-card { position: relative; background: rgba(20, 26, 46, 0.42); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--msg-color, #6e77d4); border-radius: 20px; padding: 20px 18px 16px; box-shadow: 0 10px 26px rgba(0,0,0,0.25); animation: panelIn 320ms cubic-bezier(.2,.8,.2,1) forwards; opacity: 0; transform: translateY(10px) scale(0.995); overflow: hidden; }
        .message-card::before { content: none; }
        
        .message-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
        .msg-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.1); }
        .msg-author { font-family: 'Press Start 2P', cursive; font-size: 10px; color: var(--msg-color, var(--neon-blue)); text-shadow: none; }
        .msg-time { font-family: 'Orbitron', monospace; font-size: 12px; color: var(--text-dim); }

        .message-content { font-size: 16px; line-height: 1.5; color: #e6e6e6; word-wrap: break-word; font-weight: 500; }
        
        .post-images { margin-top: 15px; border-radius: 14px; overflow: hidden; }
        .post-images img { cursor: pointer; transition: filter 0.2s; border-radius: 8px; border: none; }
        .post-images img:hover { filter: brightness(1.1); }
        .post-images.count-1 { display: block; }
        .post-images.count-1 img { width: auto; height: auto; max-width: 100%; max-height: 450px; object-fit: contain; }
        .post-images.grid-mode { display: grid; gap: 6px; }
        .post-images.grid-mode img { width: 100%; height: 100%; object-fit: cover; }
        .post-images.count-2 { grid-template-columns: 1fr 1fr; max-height: 250px; }
        .post-images.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 150px 150px; }
        .post-images.count-3 img:first-child { grid-row: span 2; }

        .post-videos { margin-top: 8px; display: grid; gap: 12px; }
        .post-videos video {
            width: 100%;
            max-height: 420px;
            border-radius: 14px;
            border: 1px solid var(--glass-border);
            background: #000;
        }

        .audio-card {
            margin-top: 8px;
            display: flex;
            gap: 18px;
            align-items: center;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            border-radius: 14px;
            padding: 10px;
        }
        .audio-card-cover {
            width: 56px;
            height: 56px;
            border-radius: 10px;
            object-fit: cover;
            border: 1px solid rgba(255,255,255,0.12);
        }
        .audio-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
        .audio-card-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .audio-card audio { width: 100%; height: 34px; }

        .msg-actions { position: absolute; top: 15px; right: 15px; display: flex; gap: 5px; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--glass-border); opacity: 0; transform: translateY(-5px); transition: 0.2s; pointer-events: none; }
        .message-card:hover .msg-actions { opacity: 1; transform: translateY(0); pointer-events: auto; }
        .action-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; border-radius: 4px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
        .action-btn:hover { background: rgba(255,255,255,0.1); color: white; }
        .action-btn.delete:hover { color: var(--neon-pink); background: rgba(255, 42, 109, 0.1); }
        .action-btn svg { width: 14px; height: 14px; fill: currentColor; }

        /* КАСТОМНЫЕ МОДАЛЬНЫЕ ОКНА */
        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.7); backdrop-filter: var(--glass-blur);
            display: flex; align-items: center; justify-content: center;
            z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s;
        }
        .modal-overlay.show { opacity: 1; visibility: visible; }
        
        .modal-box {
            background: rgba(15, 15, 20, 0.9); border: 1px solid var(--accent-color);
            border-radius: 20px; padding: 30px; text-align: center; max-width: 400px; width: 90%;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
            transform: scale(0.8); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .modal-overlay.show .modal-box { transform: scale(1); }
        .modal-box p { font-size: 18px; margin-bottom: 25px; font-weight: 600; font-family: 'Rajdhani', sans-serif;}
        .modal-actions { display: flex; gap: 15px; justify-content: center; }
        .modal-btn { 
            padding: 10px 25px; border-radius: 10px; cursor: pointer; 
            font-family: 'Orbitron', monospace; font-size: 14px; font-weight: bold;
            border: 1px solid; background: transparent; transition: 0.3s; outline: none;
        }
        .modal-btn.cancel { border-color: var(--text-dim); color: var(--text-dim); }
        .modal-btn.cancel:hover { background: rgba(255,255,255,0.1); color: white; border-color: white; }
        .modal-btn.confirm { border-color: var(--accent-color); color: var(--accent-color); }
        .modal-btn.confirm:hover { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); }

        /* ОКНО ДОКУМЕНТАЦИИ (TOS / Privacy) */
        .legal-modal-box {
            max-width: 800px; width: 95%; max-height: 85vh;
            display: flex; flex-direction: column; text-align: left;
            padding: 30px 20px 20px 30px;
        }
        .close-legal-btn {
            position: absolute; top: 15px; right: 20px;
            background: transparent; border: none; color: var(--text-dim);
            font-size: 20px; cursor: pointer; transition: 0.2s; font-family: sans-serif;
        }
        .close-legal-btn:hover { color: var(--neon-pink); transform: scale(1.2); }
        
        .legal-header { margin-bottom: 20px; text-align: center; }
        .legal-title { font-family: 'Orbitron', monospace; font-size: 22px; color: #fff; margin-bottom: 15px;}
        
        .legal-tabs { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
        .legal-tab {
            background: rgba(255,255,255,0.05); border: 1px solid transparent;
            color: var(--text-dim); padding: 8px 16px; border-radius: 8px;
            cursor: pointer; font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700;
            transition: 0.2s;
        }
        .legal-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
        .legal-tab.active { background: rgba(255,255,255,0.1); color: #fff; border-color: var(--accent-color); box-shadow: 0 0 10px rgba(0,0,0,0.3); }

        .legal-content-area { overflow-y: auto; flex-grow: 1; padding-right: 15px; }
        .legal-content-area::-webkit-scrollbar { width: 6px; }
        .legal-content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

        .legal-text h2 { font-family: 'Orbitron', monospace; font-size: 20px; color: #fff; margin-bottom: 5px; }
        .legal-text .last-updated { font-size: 13px; color: #888; margin-bottom: 20px; font-style: italic; }
        .legal-text h3 { font-family: 'Orbitron', monospace; font-size: 16px; color: var(--accent-color); margin-top: 25px; margin-bottom: 16px; display: flex; align-items: center;}
        .legal-text h3::before { content: ''; display: inline-block; width: 6px; height: 6px; background: currentColor; margin-right: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
        .legal-text p, .legal-text li { font-size: 15px; line-height: 1.6; color: #ddd; margin-bottom: 12px; }
        .legal-text ul { margin-left: 20px; margin-bottom: 20px; }
        .legal-text a { color: #fff; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.5); }
        .legal-text a:hover { color: var(--accent-color); border-bottom-style: solid; }
        .cn-font h2, .cn-font h3, .cn-font p { font-family: 'Noto Sans SC', sans-serif; }

        .hidden-input { display: none; }
        @keyframes panelIn {
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes uiFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-4px); }
        }

        @keyframes uiPulse {
            0%, 100% { box-shadow: 0 0 0 2px rgba(5,217,232,0.18), 0 0 12px rgba(5,217,232,0.22); }
            50% { box-shadow: 0 0 0 2px rgba(5,217,232,0.3), 0 0 20px rgba(5,217,232,0.34); }
        }

        @media (max-width: 1100px) {
            .discord-shell { grid-template-columns: 72px 220px minmax(0, 1fr); padding: 14px 10px 16px; gap: 12px; }
            .chat-input-wrapper,
            .feed-container,
            .channel-empty-state,
            .channel-title {
                width: 100%;
            }
        }

        @media (max-width: 820px) {
            .discord-shell { grid-template-columns: 1fr; gap: 12px; padding: 10px 8px 14px; }
            .servers-sidebar,
            .channels-sidebar,
            .channel-title { position: static; }
            .servers-sidebar { max-height: none; flex-direction: row; justify-content: flex-start; overflow-x: auto; overflow-y: visible; padding: 4px 2px 8px; gap: 10px; scrollbar-width: none; }
            .server-rail { width: auto; min-width: max-content; max-height: none; flex-direction: row; overflow-x: auto; overflow-y: visible; padding: 10px 8px; scrollbar-width: none; }
            .servers-auth-btn { flex-shrink: 0; }
            .server-list { width: auto; flex-direction: row; overflow: visible; gap: 8px; padding: 2px 0; }
            .channels-sidebar { max-height: none; padding: 12px 10px; }
            .content-column { row-gap: 14px; }
            .servers-sidebar::-webkit-scrollbar,
            .server-rail::-webkit-scrollbar { display: none; }
        }

        @media (max-width: 600px) {
            .fixed-bg { background: radial-gradient(circle at 50% 30%, rgba(26, 36, 78, 0.24) 0%, rgba(10, 14, 28, 0.92) 58%, rgba(5, 8, 18, 0.99) 100%); }
            .profile-header-group { gap: 14px; }
            .bot-orbit-btn { width: 48px; height: 48px; }
            .avatar-container { width: 96px; height: 96px; }
            .username { font-size: 16px; text-align: center; }
            .discord-status-text { text-align: center; font-size: 12px; }

            .channel-title { font-size: 13px; padding: 8px 10px; }

            .chat-input-container {
                border-radius: 22px;
                padding: 10px 12px;
            }
            .input-row { gap: 6px; align-items: center; }
            .icon-btn { width: 36px; height: 36px; }
            .icon-btn svg { width: 18px; height: 18px; }
            .chat-textarea { font-size: 16px; min-height: 36px; }
            .music-meta-panel { flex-direction: column; align-items: stretch; }
            .music-title-input { width: 100%; }

            .feed-container { margin-top: 0; margin-bottom: 18px; gap: 12px; }
            .message-card { border-radius: 14px; padding: 12px 10px; }
            .message-content { font-size: 15px; }

            .post-images.count-2,
            .post-images.count-3 {
                grid-template-columns: 1fr;
                grid-template-rows: auto;
                max-height: none;
            }
            .post-images.count-3 img:first-child { grid-row: auto; }

            .audio-card {
                flex-direction: column;
                align-items: flex-start;
            }
            .audio-card-cover {
                width: 100%;
                height: 140px;
            }
            .audio-card-info { width: 100%; }

            .message-card .msg-actions { opacity: 1; transform: none; pointer-events: auto; top: 10px; right: 10px; }
        }
    


        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation: none !important;
                transition: none !important;
            }
        }


        .channel-create-modal-box { max-width: 430px; text-align: left; display: flex; flex-direction: column; gap: 14px; }
        .channel-name-input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.06); color: #fff; font-family: 'Rajdhani', sans-serif; font-size: 16px; }
        .channel-name-input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(5,217,232,0.25); }
