body { margin: 0; background: #23272a; color: #fff; font-family: 'Segoe UI', Arial, sans-serif; }
.hidden { display: none !important; }
#auth-view { max-width: 350px; margin: 4rem auto; background: #2f3136; padding: 2rem; border-radius: 10px; box-shadow: 0 2px 16px #0004; }
#auth-form { display: flex; flex-direction: column; gap: 1rem; }
#auth-form input, #auth-form button { padding: 0.7rem; border-radius: 5px; border: none; }
#auth-form button { background: #1db954; color: #fff; font-weight: bold; cursor: pointer; }
#auth-form button:hover { background: #14833b; }
#auth-error { color: #e63946; min-height: 1.2em; }
.top-bar {
  height: 48px; background: #202225; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  border-bottom: 1px solid #23272a;
}
.app-container { display: flex; height: calc(100vh - 48px); }
.servers-bar {
  width: 72px; background: #1a1c20; display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 10px;
}
.server-icon {
  width: 48px; height: 48px; background: #36393f; border-radius: 50%; margin-bottom: 6px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; font-size: 1.4rem; font-weight: bold;
}
.server-icon.selected, .server-icon:hover { background: #1db954; color: #fff; }
.channels-bar {
  width: 220px; background: #2f3136; display: flex; flex-direction: column; padding: 12px 0;
}
.channel {
  padding: 10px 24px; cursor: pointer; color: #b9bbbe; border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.channel.selected, .channel:hover {
  background: #36393f; color: #fff; border-left: 3px solid #1db954;
}
.main-chat {
  flex: 1; display: flex; flex-direction: column; background: #36393f;
}
.chat-header {
  height: 48px; background: #2f3136; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid #23272a;
  font-weight: bold; font-size: 1.1rem;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0;
}
.chat-message {
  display: flex; align-items: flex-start; gap: 10px;
}
.chat-message .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #23272a; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1rem;
}
.chat-message .msg {
  background: #2f3136; border-radius: 8px; padding: 8px 14px;
  max-width: 400px; word-break: break-word;
}
.chat-message .user {
  color: #1db954; font-weight: bold; font-size: 1rem;
}
.chat-message .time {
  color: #aaa; font-size: 0.8rem; margin-left: 8px;
}
.chat-input-bar {
  display: flex; padding: 12px; background: #40444b; border-top: 1px solid #23272a;
}
.chat-input-bar input {
  flex: 1; padding: 10px; border-radius: 6px; border: none; background: #2f3136; color: #fff; font-size: 1rem;
}
.chat-input-bar button {
  margin-left: 12px; padding: 10px 18px; background: #1db954; color: #fff; border: none; border-radius: 6px; font-weight: bold; cursor: pointer;
  transition: background 0.2s;
}
.chat-input-bar button:hover { background: #14833b; }
.members-bar {
  width: 200px; background: #2f3136; border-left: 1px solid #23272a; padding: 12px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.member { padding: 8px 16px; color: #b9bbbe; }
.member.self { color: #1db954; }
.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #2f3136; padding: 2rem; border-radius: 12px; min-width: 320px; color: #fff; }
.modal.hidden { display: none !important; }
#settings-avatar-preview { display: block; margin: 10px 0; }
#settings-form label { display: block; margin: 10px 0 4px 0; }
#settings-form input[type="text"], #settings-form textarea, #settings-form input[type="email"], #settings-form input[type="password"] { width: 100%; }
#settings-form textarea { resize: vertical; min-height: 40px; }
#settings-form button { margin-top: 10px; }
@media (max-width: 900px) {
  .channels-bar, .members-bar { display: none; }
  .app-container { flex-direction: column; }
}


/* Auth Page */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: #2f3136;
    border-radius: 8px;
    padding: 1.5rem;
  }
  
  .auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .tab {
    flex: 1;
    padding: 0.75rem;
    background: #40444b;
    border: none;
    border-radius: 4px;
    color: #b9bbbe;
    cursor: pointer;
  }
  
  .tab.active {
    background: #1db954;
    color: white;
  }
  
  .auth-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
  }
  
  .auth-form.active {
    display: flex;
  }
  
  /* Settings Page */
  .settings-container {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    background: #2f3136;
    border-radius: 8px;
  }
  
  .settings-sidebar {
    width: 200px;
    border-right: 1px solid #40444b;
    padding: 1rem;
  }
  
  .settings-category {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
  }
  
  .settings-category.active {
    background: #40444b;
  }
  
  .settings-content {
    flex: 1;
    padding: 2rem;
  }
  
  .avatar-preview {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    margin: 1rem 0;
  }
  
  #avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  