/* Room 8 theme: dark lounge (docs/phase1-ux-spec.md §2.2). Tokens first; components use only these. */
:root {
  color-scheme: dark;
  --bg: #0D0A14;
  --bg-glow: #1C1030;
  --surface: #15111E;
  --surface-2: #1D1829;
  --surface-3: #272036;
  --line: #2C2540;
  --line-strong: #3B3254;
  --text: #F3EEF8;
  --muted: #A99FBD;
  --faint: #716789;
  --accent: #FFB547;
  --accent-hover: #FFC56E;
  --accent-ink: #1E1405;
  --accent-soft: rgba(255, 181, 71, 0.14);
  --live: #45D6B5;
  --live-soft: rgba(69, 214, 181, 0.14);
  --danger: #FF6B7D;
  --danger-soft: rgba(255, 107, 125, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 15% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h3 { font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.icon { flex: 0 0 auto; }

/* ---------- Controls ---------- */

button {
  font: inherit; font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  transition: background 120ms, border-color 120ms, transform 80ms;
}
button:hover:not(:disabled) { background: var(--surface-3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.big { padding: 13px 26px; font-size: 16px; }
button.secondary { background: transparent; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover:not(:disabled) { background: none; color: var(--text); }
button.icon-btn { padding: 7px; border-color: transparent; background: transparent; color: var(--muted); }
button.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }

input[type=text], select {
  min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit;
}
input::placeholder { color: var(--faint); }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }

/* ---------- Building blocks used inside settings and troubleshooting ---------- */

.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input[type=text], .row > select { flex: 1 1 200px; }
select.compact { flex: 0 0 auto; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.mix label { display: flex; gap: 10px; align-items: center; flex: 1 1 200px; color: var(--muted); }
.mix input[type=range] { flex: 1 1 auto; }
.good { color: var(--live); }
.bad { color: var(--danger); }
details > summary { cursor: pointer; }
