:root {
  --bg: #1b1712;
  --panel: #27211a;
  --line: #3d3328;
  --text: #ece3d4;
  --muted: #a8998a;
  --accent: #c89b4f;
  --ok: #7fae6a;
  --bad: #c8664f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px;
}

h1 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

h1 span {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
}

h2 {
  margin: 24px 0 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

form {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-align: center;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #1b1712;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: default; }
button.off { background: var(--bad); color: var(--text); }

.hint { margin: 0; font-size: 14px; color: var(--muted); }
#empty { margin-bottom: 12px; }

.me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label { font-size: 13px; color: var(--muted); }
.name { font-size: 20px; font-weight: 700; }
.state { font-size: 14px; color: var(--ok); }
.state.dead { color: var(--bad); }

.meter {
  height: 6px;
  margin-top: 16px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.meter div {
  height: 100%;
  width: 0;
  background: var(--ok);
  transition: width 80ms linear;
}

ul { list-style: none; margin: 0 0 12px; padding: 0; }

li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

li .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li .info { font-size: 13px; color: var(--muted); white-space: nowrap; }
li .bar { width: 64px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
li .bar div { height: 100%; background: var(--accent); transition: width 300ms; }

#status { min-height: 24px; margin-top: 16px; font-size: 14px; color: var(--muted); }
#status.error { color: var(--bad); }
