:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  color: #202e29;
  background: #f3f5f2;
  --green: #245c46;
  --muted: #54635a;
  --line: #d3dbd3;
}

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

body {
  margin: 0 auto;
  width: min(100% - 2rem, 52rem);
  padding: clamp(1.25rem, 4vw, 3rem) 0;
  line-height: 1.5;
}

.room-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.room-mark {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--green);
  border-radius: .75rem;
}

.room-mark i { width: 3px; height: 5px; background: #d6f1cd; border-radius: 2px; }
.room-mark i:nth-child(even) { height: 12px; }
.room-mark i:nth-child(3) { height: 20px; }

h1, h2, p { margin: 0; }
h1 { font-size: 1.125rem; font-weight: 500; overflow-wrap: anywhere; }
h1 bdi { font-weight: 700; }
h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.025em; }

.panel, #status:not(:empty) {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}

.join-card, #status:not(:empty) {
  max-width: 29rem;
  margin: clamp(1.25rem, 7vh, 4rem) auto 0;
}

.join-card h2 { font-size: clamp(1.65rem, 5vw, 2rem); }
.hint { margin: .5rem 0 1.25rem; color: var(--muted); font-size: .9375rem; }
.join-card > label { display: block; margin-top: 1rem; font-weight: 600; }

.join-card > label input {
  display: block;
  margin-top: .375rem;
  padding: .65rem .875rem;
  width: 100%;
  font: inherit;
  font-weight: 400;
  border: 1px solid #939f95;
  border-radius: .625rem;
  background: #fff;
  color: inherit;
}

.voice-choice { margin: 1.25rem 0; }
.voice-choice label { display: flex; align-items: baseline; gap: .5rem; font-weight: 600; }
.voice-choice input { align-self: flex-start; margin: .22em 0 0; width: 1rem; height: 1rem; accent-color: var(--green); flex: none; }
.voice-choice .hint { margin: .25rem 0 0 1.5rem; font-size: .875rem; }

button {
  min-height: 2.75rem;
  padding: .65rem 1rem;
  border: 1px solid #aeb9af;
  border-radius: .625rem;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

button:hover { background: #edf2eb; }
button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover { background: #184834; }
.join-card button { width: 100%; }
button.leave { color: #864335; }
button.leave:hover { background: #fcf0ec; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #357955; outline-offset: 3px; }
[role="alert"]:not(:empty) { margin-top: .75rem; color: #9c3225; }

.room-content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  margin-top: clamp(1.25rem, 4vw, 2rem);
}

.room-actions, #participants { grid-column: 1 / -1; }
.room-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .625rem; }

#activity-list {
  display: grid;
  gap: .5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.voice-person {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem 1rem;
  border-radius: .625rem;
  background: #f3f5f2;
}

.voice-name, #participants, output { overflow-wrap: anywhere; }
.voice-dot { flex: none; width: .625rem; height: .625rem; border: 2px solid #79877c; border-radius: 50%; }
.voice-person.is-speaking { background: #e7f2e7; }
.is-speaking .voice-dot {
  background: #247248;
  border-color: #247248;
  animation: voice-pulse 1.4s ease-out infinite;
}

@keyframes voice-pulse {
  from { box-shadow: 0 0 0 0 rgb(36 114 72 / 55%); }
  to { box-shadow: 0 0 0 .45rem rgb(36 114 72 / 0%); }
}

@media (prefers-reduced-motion: reduce) {
  .is-speaking .voice-dot { animation: none; }
}

output:not(:empty), meter { display: block; margin-top: .75rem; }
output { color: var(--muted); font-size: .9375rem; }
meter { width: 100%; accent-color: var(--green); }

@media (max-width: 40rem) {
  .room-content { grid-template-columns: minmax(0, 1fr); }
}
