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

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light dark;
  --bg: #f3efe6;
  --ink: #1c1915;
  --muted: #4e493f;
  --line: #d5cfc3;
  --surface: #fffdf8;
  --accent: #0c6b4d;
  --accent-ink: #f4fbf7;
  --danger: #8d2a2a;
  --ok: #0c6b4d;
  --focus: #0c6b4d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --ink: #f3efe6;
    --muted: #c4bcae;
    --line: #3c3830;
    --surface: #221f1b;
    --accent: #8fd0b0;
    --accent-ink: #10231b;
    --danger: #ffb4ab;
    --ok: #8fd0b0;
    --focus: #8fd0b0;
  }
}

html {
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: "Segoe UI", "Liberation Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.45;
}

main {
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
  padding: 1.25rem 1rem 2.5rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

p {
  margin: 0 0 0.75rem;
}

#note,
#login-hint,
#logout-hint,
.room-current {
  color: var(--muted);
}

#logout-hint {
  flex-basis: 100%;
  margin: 0;
}

#login-form,
.room {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

label {
  margin-top: 0.45rem;
}

input,
select,
button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
}

button {
  margin-top: 0.65rem;
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

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

input:focus-visible,
select:focus-visible,
button:focus-visible,
h2:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.rooms-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}

#logout-button {
  width: auto;
  margin: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.room-name {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.room-current,
.room-hint,
.room-status {
  margin: 0;
}

.room-hint {
  color: var(--muted);
}

.room-status {
  min-height: 1.2em;
}

.room-status.is-ok {
  color: var(--ok);
}

#login-error,
.room-status.is-bad {
  color: var(--danger);
}

#login-error {
  min-height: 1.2em;
}

@media (min-width: 40rem) {
  main {
    padding: 2rem 1.5rem 3rem;
  }
}
