* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
  color: #000;
}

/* ---------- LOGIN SCREEN ---------- */

#login-screen {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
#login-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #333 radial-gradient(circle at center, #555, #222);
  filter: blur(6px);
}
#login-box {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid #000;
  padding: 24px 28px;
  width: 260px;
  text-align: center;
}
#login-box h1 {
  font-size: 16px;
  margin: 0 0 14px 0;
}
#login-box input {
  width: 100%;
  padding: 6px;
  font-size: 13px;
  border: 1px solid #999;
  margin-bottom: 8px;
}
#login-box button {
  width: 100%;
  padding: 6px;
  font-size: 13px;
  border: 1px solid #000;
  background: #eee;
  cursor: pointer;
}
#login-box button:hover {
  background: #ddd;
}
#login-error {
  color: #b00000;
  font-size: 11px;
  margin-top: 8px;
  min-height: 14px;
}
.hint {
  font-size: 10px;
  color: #555;
  margin-top: 10px;
  line-height: 1.4;
}

/* ---------- APP SCREEN ---------- */

#app-screen {
  display: flex;
  width: 100%;
  height: 100vh;
  background: #fff;
}

#sidebar {
  width: 220px;
  min-width: 220px;
  border-right: 2px solid #000;
  background: #fafafa;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.me {
  border: 1px solid #ccc;
  background: #fff;
  padding: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}
.section {
  margin-bottom: 14px;
}
#rooms-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.section-title {
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid #ccc;
  margin-bottom: 4px;
  padding-bottom: 2px;
}
#pinned-list, #room-list, #online-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#room-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid transparent;
}
#pinned-list li, #room-list li {
  padding: 4px 6px;
  border: 1px solid #ddd;
  background: #fff;
  margin-bottom: 3px;
  cursor: pointer;
}
#pinned-list li {
  font-weight: bold;
  border-color: #000;
}
#room-list li:hover, #pinned-list li:hover {
  background: #eee;
}
#room-list li.active, #pinned-list li.active {
  background: #ddd;
  border-color: #000;
}
#room-list li .room-sub {
  display: block;
  font-size: 10px;
  color: #888;
  font-weight: normal;
}
#online-list li {
  padding: 2px 4px;
  font-size: 12px;
  cursor: pointer;
}
#online-list li:hover {
  text-decoration: underline;
}
#online-list li:before {
  content: "\25CF ";
  color: #2a2;
}
.new-row {
  display: flex;
  margin-top: 4px;
}
.new-row input {
  flex: 1;
  padding: 4px;
  font-size: 12px;
  border: 1px solid #999;
}
.new-row button {
  padding: 4px 8px;
  border: 1px solid #000;
  background: #eee;
  cursor: pointer;
}
.new-row button:hover {
  background: #ddd;
}
.private-toggle {
  display: block;
  font-size: 11px;
  color: #444;
  margin-top: 4px;
}
#room-list li .room-sub.private {
  color: #b00000;
}

.badge-verified {
  color: #1d9bf0;
  font-weight: bold;
  margin-left: 3px;
}

.username-link {
  cursor: pointer;
}
.username-link:hover {
  text-decoration: underline;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#chat-header {
  border-bottom: 2px solid #000;
  padding: 8px 12px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#invite-box input {
  padding: 3px;
  font-size: 12px;
  border: 1px solid #999;
  font-weight: normal;
}
#invite-box button {
  padding: 3px 8px;
  border: 1px solid #000;
  background: #eee;
  font-weight: normal;
  cursor: pointer;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: #fff;
}
.msg {
  margin-bottom: 6px;
  border-bottom: 1px dotted #eee;
  padding-bottom: 4px;
}
.msg .who {
  font-weight: bold;
}
.msg .when {
  color: #888;
  font-size: 10px;
  margin-left: 6px;
}
.msg .text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

#message-error {
  color: #b00000;
  font-size: 11px;
  padding: 0 12px;
  min-height: 14px;
}

#compose {
  display: flex;
  border-top: 2px solid #000;
  padding: 8px;
}
#compose input {
  flex: 1;
  padding: 6px;
  font-size: 13px;
  border: 1px solid #999;
}
#compose button {
  padding: 6px 16px;
  border: 1px solid #000;
  background: #eee;
  cursor: pointer;
}
#compose button:hover {
  background: #ddd;
}
