:root {
  --bg: #fbfaf7;
  --fg: #1b1a17;
  --muted: #6d6a62;
  --line: #e4e0d7;
  --accent: #7a5c3e;
  --warn: #8a3d2a;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #ece8e0;
    --muted: #9a958a;
    --line: #2c2a26;
    --accent: #c99a6b;
    --warn: #d98b72;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

h2 { font-size: 1.75rem; margin: 0 0 0.25rem; }

.sub { color: var(--muted); margin: 0 0 2rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

.room { font-size: 0.95rem; color: var(--muted); }
.room strong { color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.share { display: flex; gap: 0.5rem; margin: 0.5rem 0 2rem; }
.share input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

input, select, button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}

button { cursor: pointer; background: transparent; }
button:hover { border-color: var(--accent); }
button.on { border-color: var(--accent); color: var(--accent); }
button.danger:hover { border-color: var(--warn); color: var(--warn); }
button:disabled { opacity: 0.5; cursor: default; }

form#join { display: grid; gap: 1rem; max-width: 22rem; }
form#join label { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
#join-button {
  border-color: var(--accent);
  color: var(--accent);
  padding: 0.7rem;
  font-size: 1.05rem;
}

.warn {
  margin-top: 1.5rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--warn);
  color: var(--warn);
  font-size: 0.9rem;
}

.promise {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Room --------------------------------------------------------------- */

#room header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.45rem;
}

.controls { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.controls button, .controls select { padding: 0.35rem 0.55rem; font-size: 0.85rem; }

#feed {
  height: min(68vh, 40rem);
  overflow-y: auto;
  padding: 1.5rem 0;
  scroll-behavior: smooth;
}

.line { margin-bottom: 1.6rem; }

.who {
  display: block;
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

/* The Italian is the point. It is set large, and the translation sits under it as
   support rather than as an equal. A learner who reads only the English has not had
   the experience this room is for. */
.it {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.35;
}

.en {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  color: var(--muted);
  font-family: system-ui, -apple-system, sans-serif;
}

.partial { opacity: 0.55; }
.partial .it { font-style: italic; }

#room footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Which Mark this is, always on screen. A comparison is worthless if anyone has to
   remember afterwards which build they were in. */
.mark {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.downloads { line-height: 2; padding-left: 1.1rem; }
.downloads a { color: var(--accent); }
