* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; width: 100%; overflow: hidden; }
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #111;
  color: #ddd;
}
#app { display: flex; flex-direction: column; }

.hidden { display: none !important; }

.screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 240px;
}

.title { font-weight: bold; text-align: center; }
.hint { color: #888; font-size: 11px; text-align: center; }

input, button, select {
  font: inherit;
  color: inherit;
  background: #1c1c1c;
  border: 1px solid #333;
  padding: 4px 6px;
  outline: none;
}
input:focus, button:focus, select:focus { border-color: #5a8; }
button { cursor: pointer; background: #234; border-color: #345; }
button:hover { background: #345; }
button.ghost { background: transparent; }

#screen-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

#chat-header {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #333;
  background: #181818;
  flex-shrink: 0;
}
#chat-header > * {
  padding: 2px 4px;
  border: none;
  background: transparent;
  color: #ddd;
  font: inherit;
  min-width: 0;
}
#chat-header #chat-me {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chat-header select { background: #1c1c1c; border: 1px solid #333; }
#chat-header button { cursor: pointer; border: 1px solid #333; }

#chat-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

#messages .line {
  padding: 1px 3px;
  border-bottom: 1px solid #1a1a1a;
  line-height: 1.25;
}
#messages .line.system { color: #888; font-style: italic; }
#messages .line.radio { color: #fe8; }
#messages .line.self .who { color: #9cf; }
#messages .line.mod .who { color: #f88; font-weight: bold; }
#messages .line .who { color: #cfc; margin-right: 4px; }
#messages .line .who.clickable { cursor: pointer; text-decoration: underline dotted; }

#roster {
  width: 90px;
  min-width: 60px;
  max-width: 40%;
  border-left: 1px solid #333;
  overflow-y: auto;
  overflow-x: hidden;
  background: #161616;
  flex-shrink: 0;
}
#roster .r {
  padding: 1px 3px;
  border-bottom: 1px solid #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#roster .r.mod { color: #f88; }
#roster .r.radio::before { content: "📻 "; }

#chat-input {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid #333;
}
#chat-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: #1c1c1c;
}
#chat-input button {
  border: none;
  background: #234;
  padding: 0 8px;
}

#mod-panel {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border-top: 1px solid #333;
  background: #181818;
}
#mod-panel button {
  font-size: 11px;
  padding: 2px 4px;
  flex: 0 0 auto;
}
