* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  height: 100dvh;
}

#app {
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* Join screen */
#join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
}

#join-screen h1 {
  font-size: 2rem;
}

#join-screen p {
  color: #888;
}

#join-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#name-input {
  padding: 0.75rem 1rem;
  border: 1px solid #333;
  border-radius: 0.5rem;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
  width: 220px;
}

#name-input:focus {
  border-color: #2563eb;
}

/* Chat screen */
#chat-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #222;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

#user-label {
  color: #888;
  font-size: 0.875rem;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message.system {
  text-align: center;
  color: #555;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
}

.message.chat {
  display: flex;
  gap: 0.5rem;
  line-height: 1.5;
}

.msg-name {
  font-weight: 600;
  flex-shrink: 0;
}

.msg-name::after {
  content: ":";
}

.msg-text {
  word-break: break-word;
}

#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #222;
}

#msg-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #333;
  border-radius: 0.5rem;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
}

#msg-input:focus {
  border-color: #2563eb;
}

button {
  padding: 0.75rem 1.5rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

#refresh-btn {
  background: #333;
  padding: 0.75rem;
}

#refresh-btn:hover {
  background: #444;
}
