*{margin:0;padding:0;box-sizing:border-box}
:root{--bg-primary:#1e1f22;--bg-secondary:#2b2d31;--bg-tertiary:#111214;--bg-accent:#3f4147;--bg-hover:#35373c;--text-primary:#f2f3f5;--text-secondary:#b5bac1;--text-muted:#949ba4;--brand:#5865F2;--brand-hover:#4752c4;--green:#57F287;--red:#ED4245;--yellow:#FEE75C}
body{font-family:'gg sans','Noto Sans',Helvetica,Arial,sans-serif;background:var(--bg-primary);color:var(--text-primary);height:100vh;overflow:hidden}
.auth-container{display:flex;align-items:center;justify-content:center;min-height:100vh;background:var(--brand)}
.auth-box{background:var(--bg-primary);padding:32px;border-radius:8px;width:100%;max-width:480px;box-shadow:0 2px 10px rgba(0,0,0,.3)}
.auth-logo{text-align:center;margin-bottom:8px}
.auth-box h1{text-align:center;font-size:24px;margin-bottom:8px}
.auth-subtitle{text-align:center;color:var(--text-secondary);margin-bottom:20px}
.auth-tabs{display:flex;gap:8px;margin-bottom:20px}
.auth-tab{flex:1;padding:10px;background:var(--bg-secondary);border:none;border-radius:4px;color:var(--text-secondary);cursor:pointer;font-weight:600}
.auth-tab.active{background:var(--brand);color:#fff}
.auth-form{display:none}.auth-form.active{display:block}
.auth-error{background:var(--red);color:#fff;padding:10px;border-radius:4px;margin-bottom:16px;font-size:14px}
.form-group{margin-bottom:16px}.form-group label{display:block;font-size:12px;font-weight:700;color:var(--text-secondary);margin-bottom:8px;text-transform:uppercase}
.form-group input,.form-group select{width:100%;padding:10px;background:var(--bg-tertiary);border:none;border-radius:4px;color:var(--text-primary);font-size:16px;outline:none}
.form-group input:focus{outline:2px solid var(--brand)}
.btn-primary{width:100%;padding:12px;background:var(--brand);color:#fff;border:none;border-radius:4px;font-size:16px;font-weight:600;cursor:pointer}.btn-primary:hover{background:var(--brand-hover)}
.app-container{display:flex;height:100vh}
.server-list{width:72px;background:var(--bg-tertiary);display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:8px;overflow-y:auto}
.server-icon{width:48px;height:48px;border-radius:50%;background:var(--bg-primary);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s}
.server-icon:hover,.server-icon.active{border-radius:16px;background:var(--brand)}
.server-icon.home:hover,.server-icon.home.active{background:var(--green)}
.server-icon.add:hover{background:var(--green);color:var(--bg-tertiary)}
.server-divider{width:32px;height:2px;background:var(--bg-accent)}
.channel-sidebar{width:240px;background:var(--bg-secondary);display:flex;flex-direction:column}
.server-header{padding:16px;border-bottom:1px solid var(--bg-tertiary);box-shadow:0 1px 0 rgba(0,0,0,.2)}.server-header h2{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.channels-list{flex:1;overflow-y:auto;padding:8px 0}
.channels-list::-webkit-scrollbar{width:4px}.channels-list::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:2px}
.channel-category{display:flex;justify-content:space-between;align-items:center;padding:16px 8px 4px 16px;font-size:12px;font-weight:700;color:var(--text-muted);text-transform:uppercase}
.channel-add{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;padding:0 8px}.channel-add:hover{color:var(--text-primary)}
.channel{display:flex;align-items:center;padding:6px 8px;margin:1px 8px;border-radius:4px;cursor:pointer;color:var(--text-muted);font-size:15px}.channel:hover{background:var(--bg-hover);color:var(--text-primary)}.channel.active{background:var(--bg-accent);color:var(--text-primary)}
.channel-icon{margin-right:6px;font-size:18px;opacity:.7}
.channel-name{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.channel-lock{margin-left:4px;font-size:12px}
.voice-channel{position:relative;display:flex;flex-direction:column;padding:0;margin:1px 8px}
.voice-channel-header{display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:4px;cursor:pointer;color:var(--text-muted);transition:all .1s}.voice-channel-header:hover{background:var(--bg-hover);color:var(--text-primary)}.voice-channel-header.connected{color:var(--text-primary)}
.voice-status-dot{width:8px;height:8px;border-radius:50%;background:var(--green);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
.voice-users{padding-left:36px;margin-top:0;min-height:4px;display:block}
.voice-user{display:flex;align-items:center;gap:8px;padding:4px 8px;border-radius:4px;font-size:14px;color:var(--text-secondary);cursor:pointer}.voice-user:hover{background:var(--bg-hover)}
.voice-user .mini-avatar{width:24px;height:24px;border-radius:50%;position:relative;flex-shrink:0}
.voice-user-icon{font-size:14px;margin-left:auto;opacity:.6}
.voice-user-icon.muted{opacity:1;color:var(--red)}
.voice-user .muted{color:var(--text-muted);text-decoration:line-through;opacity:.5}
.user-panel{display:flex;align-items:center;padding:8px;background:rgba(0,0,0,.15)}.user-info{display:flex;align-items:center;gap:8px;flex:1;min-width:0}
.user-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;overflow:hidden}
.user-avatar img{width:32px;height:32px;border-radius:50%;object-fit:cover;display:block}
.user-details{min-width:0}.user-name{display:block;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-tag{font-size:11px;color:var(--text-muted)}
.user-controls{display:flex;gap:4px}
.control-btn{background:none;border:none;color:var(--text-secondary);cursor:pointer;padding:6px;border-radius:4px;font-size:16px}.control-btn:hover{background:var(--bg-hover);color:var(--text-primary)}
.chat-area{flex:1;display:flex;flex-direction:column;background:var(--bg-primary);min-width:0}
.chat-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--bg-tertiary);box-shadow:0 1px 2px rgba(0,0,0,.1)}.chat-header h3{font-size:16px;font-weight:600}
.chat-header-icons{display:flex;gap:8px}
.header-btn{background:none;border:none;color:var(--text-secondary);cursor:pointer;padding:6px;border-radius:4px;font-size:18px}.header-btn:hover{color:var(--text-primary)}
.messages-container{flex:1;overflow-y:auto;padding:16px}.messages-container::-webkit-scrollbar{width:8px}.messages-container::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:4px}
.message{display:flex;gap:16px;padding:4px 0;margin-bottom:4px}.message:hover{background:rgba(0,0,0,.05)}
.message-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;margin-top:2px}
.message-content{flex:1;min-width:0}
.message-header{display:flex;align-items:baseline;gap:8px;margin-bottom:4px}
.message-author{font-weight:600;cursor:pointer}.message-author:hover{text-decoration:underline}
.message-time{font-size:11px;color:var(--text-muted)}
.message-text{color:var(--text-secondary);line-height:1.4;word-wrap:break-word}
.message-item{position:relative}
.message-actions{position:absolute;right:16px;top:-16px;background:var(--bg-secondary);border-radius:4px;padding:2px;display:none}
.message:hover .message-actions{display:flex}
.msg-action-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px 8px;font-size:14px}.msg-action-btn:hover{color:var(--text-primary)}
.welcome-message{text-align:center;padding:40px 20px}.welcome-icon{width:68px;height:68px;background:var(--brand);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:32px}.welcome-message h2{font-size:28px;margin-bottom:8px}.welcome-message p{color:var(--text-muted)}
.typing-indicator{padding:4px 16px;font-size:13px;color:var(--text-muted);height:24px}
#message-input-container{position:relative;background:var(--bg-accent);border-radius:8px;display:flex;align-items:center;padding:0 16px;margin:0 16px 24px}
.input-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:10px 8px;font-size:18px}.input-btn:hover{color:var(--text-primary)}
#message-input{flex:1;background:transparent;border:none;color:var(--text-primary);font-size:15px;padding:12px 0;outline:none}
#message-input::placeholder{color:var(--text-muted)}
.input-icons{display:flex;gap:4px}
.members-sidebar{width:240px;background:var(--bg-secondary);padding:16px 8px;overflow-y:auto}
.members-title{font-size:12px;font-weight:700;color:var(--text-muted);padding:8px;text-transform:uppercase}
.member-group{margin-bottom:16px}
.member-group-title{font-size:12px;font-weight:600;color:var(--text-muted);padding:8px;display:flex;align-items:center;gap:4px}
.member{display:flex;align-items:center;gap:12px;padding:6px 8px;border-radius:4px;cursor:pointer}.member:hover{background:var(--bg-hover)}
.member-avatar{width:32px;height:32px;border-radius:50%;position:relative}
.status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;border:3px solid var(--bg-secondary)}
.status-dot.online{background:var(--green)}.status-dot.idle{background:var(--yellow)}.status-dot.dnd{background:var(--red)}.status-dot.offline{background:var(--text-muted)}
.member-name{font-size:14px;font-weight:500}.member.offline .member-name{opacity:.3}
.member-role-badge{font-size:10px;padding:1px 4px;border-radius:3px;color:#fff;margin-left:4px}
.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:1000}
.modal{background:var(--bg-primary);border-radius:8px;width:100%;max-width:440px}
.modal.large{max-width:600px}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px}.modal-header h2{font-size:20px}
.modal-close{background:none;border:none;color:var(--text-muted);font-size:24px;cursor:pointer}
.modal-body{padding:20px}
.perms-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.perms-grid label{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-secondary);cursor:pointer}
.role-item{display:flex;align-items:center;gap:12px;padding:8px;border-radius:4px;margin-bottom:4px;background:var(--bg-secondary)}.role-item:hover{background:var(--bg-hover)}
.role-color-dot{width:16px;height:16px;border-radius:50%;flex-shrink:0}
.role-name{flex:1;font-weight:500}
.role-actions{display:flex;gap:4px}
.role-action-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px;font-size:14px}.role-action-btn:hover{color:var(--text-primary)}
.role-action-btn.delete:hover{color:var(--red)}
.role-select{background:var(--bg-tertiary);border:none;color:var(--text-primary);padding:4px 8px;border-radius:4px;font-size:13px}
.context-menu{position:fixed;background:var(--bg-secondary);border:1px solid var(--bg-accent);border-radius:4px;padding:4px;min-width:180px;z-index:999;box-shadow:0 8px 16px rgba(0,0,0,.3)}
.context-menu-item{padding:8px 12px;border-radius:3px;cursor:pointer;font-size:14px;display:flex;align-items:center;gap:8px}.context-menu-item:hover{background:var(--brand)}.context-menu-item.danger:hover{background:var(--red)}
.settings-tab{padding:8px 16px;background:var(--bg-secondary);border:none;border-radius:4px;color:var(--text-secondary);cursor:pointer;font-weight:600;font-size:14px}
.settings-tab.active{background:var(--brand);color:#fff}
.user-item{display:flex;align-items:center;gap:12px;padding:8px;border-radius:4px;margin-bottom:4px;background:var(--bg-secondary)}.user-item:hover{background:var(--bg-hover)}
.user-item .user-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0}
.user-item .user-name-text{flex:1;font-weight:500}
.user-item .user-password{font-size:12px;color:var(--text-muted);font-family:monospace;cursor:pointer;padding:2px 6px;border-radius:3px;background:var(--bg-tertiary)}
.user-item .user-password:hover{background:var(--bg-accent)}
.voice-indicator{font-size:12px;margin-left:4px;opacity:.7}
.voice-indicator:hover{opacity:1}
.voice-panel{background:#1a1b1e;padding:8px;margin:4px 8px 8px;border-radius:8px;border:1px solid var(--bg-tertiary)}
.voice-panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid var(--bg-tertiary)}
.voice-user-info{display:flex;align-items:center;gap:8px}
.voice-user-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0}
.voice-user-details{display:flex;flex-direction:column;gap:2px}
.voice-username{font-size:14px;font-weight:600;color:var(--text-primary)}
.voice-channel-label{font-size:12px;color:var(--text-muted)}
.voice-channel-name{font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px}
.voice-channel-name::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green)}
.emoji-picker{position:absolute;bottom:60px;right:16px;width:340px;max-height:350px;background:var(--bg-secondary);border:1px solid var(--bg-accent);border-radius:8px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.4);display:flex;flex-direction:column}
.emoji-search{padding:8px;border-bottom:1px solid var(--bg-accent)}
.emoji-search input{width:100%;padding:8px 12px;background:var(--bg-tertiary);border:none;border-radius:4px;color:var(--text-primary);font-size:14px;outline:none}
.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;padding:8px;overflow-y:auto;max-height:280px}
.emoji-grid::-webkit-scrollbar{width:6px}
.emoji-grid::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:3px}
.emoji-item{width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;border-radius:4px;transition:background .1s}
.emoji-item:hover{background:var(--bg-hover)}
.message-attachment{margin-top:4px}
.message-attachment img{max-width:300px;max-height:200px;border-radius:8px;cursor:pointer}
.message-attachment a{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--bg-accent);border-radius:4px;color:var(--text-primary);text-decoration:none;font-size:13px}
.message-attachment a:hover{background:var(--bg-hover)}
.voice-disconnect-btn{background:none;border:none;color:var(--red);padding:4px 8px;border-radius:4px;font-size:18px;cursor:pointer}.voice-disconnect-btn:hover{background:rgba(237,66,69,.15)}
.voice-controls{display:flex;gap:8px;justify-content:center}
.voice-ctrl-btn{background:var(--bg-accent);border:none;color:var(--text-primary);width:32px;height:32px;border-radius:50%;font-size:16px;cursor:pointer;transition:all .15s;display:flex;align-items:center;justify-content:center}
.voice-ctrl-btn:hover{background:var(--bg-hover)}
.voice-ctrl-btn.muted{background:var(--red)!important;color:#fff!important}
.channel-private{font-size:11px;margin-left:4px;opacity:.5}
::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:4px}
.speaking-avatar{transition:box-shadow .15s ease,transform .15s ease}
.speaking-avatar.speaking{box-shadow:0 0 0 3px rgba(87,242,135,.6),0 0 12px rgba(87,242,135,.4);transform:scale(1.05)}
.member-avatar{transition:box-shadow .15s ease,transform .15s ease;position:relative}
.member-avatar img{width:32px;height:32px;border-radius:50%;object-fit:cover;display:block}
.member-avatar.speaking{box-shadow:0 0 0 3px rgba(87,242,135,.6),0 0 12px rgba(87,242,135,.4);transform:scale(1.08)}
.message-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;overflow:hidden}
.message-avatar img{width:40px;height:40px;border-radius:50%;object-fit:cover;display:block}
.mini-avatar{transition:box-shadow .15s ease,transform .15s ease;position:relative}
.mini-avatar img{width:24px;height:24px;border-radius:50%;object-fit:cover;display:block}
.mini-avatar.speaking{box-shadow:0 0 0 2px rgba(87,242,135,.6),0 0 8px rgba(87,242,135,.4);transform:scale(1.05)}
.voice-user-avatar{width:32px;height:32px;border-radius:50%;overflow:hidden;flex-shrink:0}
.voice-user-avatar img{width:32px;height:32px;border-radius:50%;object-fit:cover;display:block}
.voice-user-avatar-placeholder{width:32px;height:32px;border-radius:50%;flex-shrink:0}
.audio-attachment{padding:12px;background:var(--bg-tertiary);border-radius:8px;margin-top:6px}
.audio-attachment audio{width:100%;max-width:400px;height:40px;margin-bottom:6px}
.audio-download{font-size:13px;color:var(--text-secondary);text-decoration:none}.audio-download:hover{color:var(--text-primary);text-decoration:underline}
.toggle-switch{position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0}
.toggle-switch input{opacity:0;width:0;height:0}
.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:var(--bg-accent);border-radius:24px;transition:.2s}
.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.2s}
.toggle-switch input:checked+.toggle-slider{background:var(--green)}
.toggle-switch input:checked+.toggle-slider:before{transform:translateX(20px)}
