:root {
  color-scheme: dark;
  --bg: #141210;
  --line: #2e2924;
  --text: #f4efe8;
  --muted: #cbbbaa;
  --amber: #e2a56a;
  --ink: #1a120b;
  --danger: #f0c2b6;
  --sans: "Source Sans 3", "Segoe UI", "Liberation Sans", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
}

#app { height: 100%; }

::selection { background: var(--amber); color: var(--ink); }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

button,
input { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { cursor: default; opacity: 0.55; }

.shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.status {
  flex: none;
  margin: 0;
  padding: 10px 14px;
  color: var(--amber);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.gate,
.room {
  flex: 1;
  min-height: 0;
}

.gate { overflow: auto; }

.nick-form,
.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.nick-form { width: 100%; max-width: 22rem; }

.field-label { font-size: 14px; }

.nick-input,
.say-input {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #100e0c;
  padding: 8px 12px;
}

.join,
.send,
.ghost {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 650;
  padding: 0 16px;
}

.join { width: 100%; }

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 550;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.room {
  display: flex;
  flex-direction: column;
}

.log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 14px;
}

.empty {
  margin: 0;
  padding: 4px 14px 8px;
  color: var(--muted);
  font-size: 14px;
}

.msg { padding: 8px 0; }

.msg + .msg { border-top: 1px solid var(--line); }

.msg-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.nick { font-weight: 650; }

.time {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}

.msg-text,
.system {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.msg.action .msg-text { font-style: italic; }

.system { color: var(--muted); font-size: 14px; }

.msg a { color: var(--amber); }

.reconnect {
  flex: none;
  padding: 0 14px;
}

.composer {
  flex: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

.composer-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composer-row .say-input { flex: 1; min-width: 0; }

.send { flex: none; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--amber);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
}

.skip:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot,
.boot-fail {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
}

@media (max-width: 359px) {
  .composer-row { flex-direction: column; align-items: stretch; }
  .send { width: 100%; }
}
