:root {
  color-scheme: dark;
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: #f1f0fa;
  background: #101119;
  --panel: #191b26;
  --border: #323545;
  --muted: #acaec2;
  --accent: #c0afff;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 1.25rem; }
h2 { font-size: 1rem; }
.wrap { width: min(75rem, calc(100% - 3rem)); margin-inline: auto; }
.site-header { background: #151620; border-bottom: 1px solid var(--border); }
.header-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .6rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 750; white-space: nowrap; }
.brand-icon { width: 1.85rem; height: 1.85rem; border-radius: .55rem; background: var(--accent); display: grid; place-items: center; }
.brand-icon::after { content: ""; border: .32rem solid transparent; border-left: .52rem solid #292145; margin-left: .35rem; }
.presence { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: .2rem .5rem; color: var(--muted); font-size: .875rem; }
.presence-count { color: #f1f0fa; font-weight: 650; white-space: nowrap; }
.presence-note { font-size: .8125rem; white-space: nowrap; }
main { padding-block: clamp(1.5rem, 4vw, 3rem); }
.room { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .38fr); gap: 1rem; align-items: stretch; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; }
.panel-header { min-height: 3.6rem; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--border); }
.status { color: var(--accent); background: #2b2542; border-radius: 1rem; padding: .2rem .65rem; font-size: .875rem; white-space: nowrap; }
.stage {
  display: grid;
  place-items: center;
  min-height: 14rem;
  aspect-ratio: 16 / 9;
  padding: 1.25rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 45%, #222039, #0c0d14 72%);
}
.stage-content { display: grid; justify-items: center; gap: .5rem; }
.stage-title { font-size: clamp(1rem, 2.6vw, 1.25rem); font-weight: 700; }
.monitor { position: relative; width: 3.25rem; height: 2.2rem; border: 2px solid var(--accent); border-radius: .38rem; margin-bottom: .8rem; }
.monitor::after { content: ""; position: absolute; width: 1.45rem; height: .46rem; left: 50%; bottom: -.58rem; transform: translateX(-50%); border-bottom: 2px solid var(--accent); }
.muted { color: var(--muted); font-size: .875rem; }
.chat { display: flex; flex-direction: column; }
.nickname { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.nickname label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 650; }
input, button { font: inherit; min-height: 2.75rem; border: 1px solid var(--border); border-radius: .55rem; }
input { width: 100%; min-width: 0; padding: .45rem .65rem; color: inherit; background: #11131c; }
input::placeholder { color: var(--muted); }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input-detail { display: flex; justify-content: space-between; gap: .5rem; margin-top: .3rem; color: var(--muted); font-size: .8125rem; }
.messages { display: grid; place-content: center; justify-items: center; gap: .4rem; flex: 1; min-height: 8rem; padding: 1rem; color: var(--muted); font-size: .875rem; text-align: center; }
.bubble { width: 2rem; line-height: 1.3; border: 1px solid #676781; border-radius: .55rem .55rem .55rem .15rem; }
.composer { display: flex; gap: .5rem; padding: .85rem 1rem; border-top: 1px solid var(--border); }
button { padding: .45rem .75rem; white-space: nowrap; }
:disabled { color: #9396ab; background: #242634; opacity: 1; cursor: default; }
input:disabled::placeholder { color: #9396ab; }
.stream-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .75rem 1rem; }
.stream-picker label { font-size: .875rem; font-weight: 650; }
.stream-picker select { font: inherit; min-height: 2.75rem; max-width: 100%; border: 1px solid var(--border); border-radius: .55rem; padding: .4rem .6rem; }
.broadcast { max-width: 40rem; }
.broadcast-controls { display: grid; gap: .65rem; padding: 1rem; }
.room-link { color: var(--accent); font-size: .875rem; }
.room-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 48rem) {
  .wrap { width: calc(100% - 2rem); }
  .room { grid-template-columns: minmax(0, 1fr); }
}
