*{box-sizing:border-box}
body{margin:0;background:#050505;color:#fff;font-family:Arial,Tahoma,sans-serif;overflow:hidden}
.hidden{display:none!important}

.app{
  height:100vh;
  display:grid;
  grid-template-columns:72px 270px 1fr;
  background:#050505;
}

.servers{
  background:#050505;
  padding:12px 8px;
  border-left:1px solid #260707;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.serverBubble{
  width:48px;height:48px;
  border:0;border-radius:16px;
  background:#181818;color:#fff;
  font-weight:900;cursor:pointer;
}
.serverBubble.active{background:#c40000}
.serverBubble.plus{background:#09220e;color:#59ff75}

.sidebar{
  background:#120707;
  padding:18px;
  border-left:1px solid #2a0b0b;
  overflow:auto;
}

main{
  min-width:0;
  height:100vh;
  background:#080808;
}

#auth{
  max-width:360px;
  margin:12vh auto;
  background:#111;
  padding:24px;
  border-radius:20px;
  border:1px solid #2a0b0b;
}

#auth input,.modalBox input,.modalBox textarea,.modalBox select,#newChannel{
  width:100%;
  margin:7px 0;
  padding:13px;
  border-radius:12px;
  border:1px solid #333;
  background:#080808;
  color:white;
}

#chat{
  height:100vh;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.top{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-bottom:1px solid #222;
  background:#0d0d0d;
}

#channelTitle{
  margin:0;
  color:#fff;
  font-size:24px;
}

.topActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

button,.ghost,.fileBtn{
  border:0;
  border-radius:12px;
  background:#1b1b1b;
  color:white;
  padding:10px 14px;
  font-weight:bold;
  cursor:pointer;
  display:inline-block;
}
button:hover,.ghost:hover,.fileBtn:hover{background:#2a2a2a}
#logoutBtn{background:#8b0000}
.fileBtn input{display:none}

#serverTitle{
  color:#ff2b2b;
  font-size:30px;
  margin:0 0 4px;
}
.sub{color:#999;margin:0 0 18px}
#userBox{text-align:right;margin:14px 0}
hr{border:0;border-top:1px solid #333;margin:16px 0}

#channels button{
  width:100%;
  padding:13px 14px;
  margin:6px 0;
  border:1px solid #262626;
  border-radius:12px;
  background:#181818;
  color:white;
  text-align:right;
  font-weight:bold;
}
#channels button.active{
  background:#2a0909;
  border-color:#d00000;
}

#voicePanel{
  flex:0 0 240px;
  margin:12px 18px 0;
  border:1px solid #260707;
  border-radius:16px;
  background:#020202;
  overflow:hidden;
  position:relative;
}

.voiceHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 14px;
  border-bottom:1px solid #161616;
}

#voiceMembers{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.voicePill{
  background:#202020;
  border:1px solid #333;
  border-radius:999px;
  padding:6px 10px;
  font-size:13px;
}

#remoteVideos{
  height:190px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  overflow:auto;
}
#remoteVideos video,#localVideo{
  max-height:170px;
  max-width:260px;
  background:#000;
  border-radius:14px;
}

.contentGrid{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns:1fr 260px;
  gap:0;
}

#messages{
  min-height:0;
  overflow:auto;
  padding:18px 22px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

#membersPanel{
  border-right:1px solid #222;
  background:#0e0808;
  padding:16px;
  overflow:auto;
}

#membersList{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.memberItem{
  display:flex;
  gap:10px;
  align-items:center;
  background:#171010;
  border:1px solid #271010;
  padding:10px;
  border-radius:14px;
}
.memberItem img,.avatarFallback{
  width:36px;height:36px;
  border-radius:50%;
  background:#b90000;
  display:grid;
  place-items:center;
  font-weight:bold;
  flex:0 0 auto;
}
.memberItem p{margin:3px 0 0;color:#888;font-size:12px}
.memberItem small{color:#aaa}

.msg{
  background:#111;
  border:1px solid #251010;
  border-radius:14px;
  padding:12px 14px;
  max-width:80%;
}
.msg b{color:#fff}
.msg small{color:#777;margin-right:8px}
.msg a{color:#ff3b3b}

.composer{
  flex:0 0 auto;
  display:flex;
  gap:10px;
  padding:14px 18px;
  border-top:1px solid #222;
  background:#101010;
}

#msgInput{
  flex:1;
  min-width:0;
  border:1px solid #333;
  background:#080808;
  color:#fff;
  border-radius:14px;
  padding:13px;
  outline:none;
}

.dropZone{
  margin:10px 18px 0;
  border:2px dashed rgba(255,255,255,.18);
  border-radius:14px;
  padding:10px;
  text-align:center;
  color:#aaa;
}
.dropZone.drag{border-color:#ff2b2b;background:#210909}
.uploadProgress{height:7px;background:#222;border-radius:999px;overflow:hidden;margin-top:8px}
.uploadProgressBar{height:100%;width:0%;background:#d00000}

.filePreview img{
  max-width:320px;
  max-height:220px;
  border-radius:12px;
}
.systemMsg{
  align-self:center;
  padding:7px 12px;
  border-radius:999px;
  background:#1a1a1a;
  color:#aaa;
  font-size:13px;
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  display:grid;
  place-items:center;
}
.modalBox{
  width:min(420px,92vw);
  background:#111;
  border:1px solid #2a0b0b;
  border-radius:20px;
  padding:20px;
}
.row{display:flex;gap:8px}
