:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080d18;
  color: #f3f6fb;
  font-synthesis: none;
  --bg: #080d18;
  --panel: rgba(16, 24, 39, .9);
  --line: rgba(142, 166, 207, .18);
  --muted: #93a4bd;
  --blue: #8fa7ff;
  --green: #83e4ad;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100dvh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 82% -5%, rgba(87, 112, 255, .2), transparent 34%), radial-gradient(circle at 12% 18%, rgba(42, 154, 193, .1), transparent 30%), var(--bg); }
body::before { position: fixed; z-index: -1; inset: 0; content: ""; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
button, input { font: inherit; }
button { min-height: 46px; cursor: pointer; border: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(143, 167, 255, .42); outline-offset: 2px; }
.shell { width: min(720px, calc(100% - 32px)); margin: 0 auto; padding: clamp(48px, 9vh, 100px) 0 56px; }
.hero { margin-bottom: 30px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: #91a7c7; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.04em; }
h1 { margin-bottom: 0; font-size: clamp(42px, 8vw, 70px); line-height: .95; }
h2 { margin-bottom: 0; font-size: clamp(32px, 7vw, 46px); line-height: 1; letter-spacing: .05em; }
h3 { margin-bottom: 0; font-size: 16px; }
.intro { margin: 17px 0 0; color: var(--muted); font-size: 16px; }
.panel { border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(24, 35, 57, .95), var(--panel)); box-shadow: 0 26px 90px rgba(0, 0, 0, .3), inset 0 1px rgba(255,255,255,.035); padding: clamp(22px, 5vw, 34px); }
.lobby-note { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 11px 13px; border: 1px solid rgba(143, 167, 255, .16); border-radius: 13px; color: #b6c4dc; background: rgba(103, 128, 225, .08); font-size: 13px; line-height: 1.45; }
.note-icon { display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #c2ceff; background: rgba(143, 167, 255, .18); }
.actions { display: grid; gap: 12px; margin-top: 20px; }
.channel-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 4px; border: 1px solid rgba(143, 167, 255, .2); border-radius: 12px; color: #cbd6ff; background: rgba(103, 128, 225, .08); font-size: 14px; font-weight: 700; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.channel-link:hover { border-color: rgba(143, 167, 255, .38); background: rgba(103, 128, 225, .16); }
.channel-panel { padding-top: 22px; }
.channel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.channel-head .eyebrow { margin-bottom: 8px; text-align: left; }
.channel-title { margin: 0; font-size: clamp(28px, 6vw, 40px); letter-spacing: -.04em; }
.channel-title small { display: block; margin-top: 10px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.channel-status-row { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.channel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 15px 0 11px; }
.channel-heading span { color: #71829e; font-size: 12px; }
.channel-rooms { display: grid; gap: 9px; }
.channel-room { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 67px; border: 1px solid rgba(142, 166, 207, .15); border-radius: 14px; padding: 12px 14px; background: rgba(11, 18, 31, .55); }
.channel-room-info { display: grid; min-width: 0; gap: 6px; }
.channel-room-info strong { overflow: hidden; color: #eef3fb; text-overflow: ellipsis; white-space: nowrap; }
.channel-room-info span { color: var(--muted); font-size: 12px; }
.channel-join { min-width: 64px; padding-inline: 12px; color: #dce5ff; background: rgba(83, 106, 180, .72); }
.channel-join:disabled { cursor: not-allowed; color: #8e9bb1; background: rgba(55, 67, 88, .55); }
.channel-empty { margin: 0; padding: 25px 12px; border: 1px dashed rgba(142, 166, 207, .2); border-radius: 14px; color: var(--muted); text-align: center; font-size: 13px; }
.channel-create { width: 100%; margin-top: 15px; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input { width: 100%; min-height: 46px; border: 1px solid #3a4b67; border-radius: 12px; background: rgba(7, 13, 24, .7); color: #f4f7fb; padding: 12px 14px; outline: none; }
input::placeholder { color: #65758e; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(143, 167, 255, .12); }
button { border-radius: 12px; padding: 11px 16px; color: #edf3ff; background: #293951; font-weight: 750; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
button:hover { transform: translateY(-1px); background: #354968; }
.primary { color: #0a1221; background: linear-gradient(135deg, #91aaff, #718cff); box-shadow: 0 8px 22px rgba(113, 140, 255, .18); }
.primary:hover { background: linear-gradient(135deg, #a8baff, #829bff); }
.quiet { color: #c2cee1; background: rgba(45, 61, 87, .7); font-size: 13px; }
.danger { color: #ffbcc4; background: rgba(121, 45, 61, .62); }
.error { min-height: 20px; margin: 13px 0 0; color: #ff9f9f; font-size: 14px; }
.room-panel { padding-top: 22px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.room-brand { display: flex; align-items: center; gap: 9px; color: #dbe5f6; font-size: 14px; font-weight: 750; }
.live-dot, .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(131, 228, 173, .12), 0 0 16px rgba(131, 228, 173, .65); }
.room-live { padding: 4px 7px; border-radius: 6px; color: #9aebbb; background: rgba(131, 228, 173, .1); font-size: 9px; letter-spacing: .1em; }
.copy-button { min-height: 38px; padding: 8px 12px; }
.room-code-card { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 24px 0 18px; padding: 20px 21px; border: 1px solid rgba(143, 167, 255, .2); border-radius: 18px; background: radial-gradient(circle at 95% 10%, rgba(143, 167, 255, .14), transparent 40%), rgba(8, 14, 26, .45); }
.room-code-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.room-count { display: grid; justify-items: end; gap: 4px; color: var(--muted); font-size: 12px; }
.room-count strong { color: #eaf0ff; font-size: 22px; letter-spacing: -.03em; }
.room-status-row { display: flex; align-items: center; gap: 9px; min-height: 25px; }
.status-dot { width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 0 3px rgba(131, 228, 173, .1); }
.status-dot[data-good="false"] { background: #ff9f9f; box-shadow: 0 0 0 3px rgba(255, 159, 159, .1); }
.status { margin: 0; color: var(--green); font-size: 13px; }
.members-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 25px 0 11px; }
.members-heading span { color: #71829e; font-size: 12px; }
.members { display: grid; gap: 9px; }
.member { display: flex; align-items: center; gap: 10px; min-height: 53px; border: 1px solid rgba(142, 166, 207, .15); border-radius: 14px; padding: 12px 14px; background: rgba(11, 18, 31, .55); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.member[data-speaking="true"] { border-color: rgba(131, 228, 173, .52); background: rgba(39, 91, 76, .25); box-shadow: 0 0 0 3px rgba(131, 228, 173, .07); }
.member-name { min-width: 0; overflow: hidden; color: #eef3fb; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.voice-meter { display: flex; align-items: center; gap: 2px; width: 31px; height: 22px; padding: 0 2px; }
.voice-meter i { display: block; width: 4px; height: 17px; border-radius: 3px; opacity: .3; background: #70809a; transform: scaleY(.35); transform-origin: center; transition: height .08s linear, transform .08s linear, opacity .08s linear, background .15s ease; }
.voice-meter[data-active="true"] i { background: var(--green); }
.host { margin-left: 1px; padding: 4px 7px; border-radius: 6px; color: #b8c5ff; background: rgba(143, 167, 255, .12); font-size: 10px; font-weight: 750; }
.peer-state { margin-left: auto; color: #93a4bd; font-size: 11px; white-space: nowrap; }
.peer-state[data-state="connected"] { color: var(--green); }
.peer-state[data-state="transport-connected"], .peer-state[data-state="audio-received"] { color: #f3c77a; }
.peer-state[data-state="failed"], .peer-state[data-state="audio-blocked"] { color: #ff9f9f; }
.room-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.room-actions button { padding-inline: 10px; font-size: 15px; }
.mic-toggle { background: linear-gradient(135deg, #91aaff, #718cff); }
.mic-toggle[data-state="closed"] { color: #ffd8dd; background: rgba(121, 45, 61, .78); box-shadow: none; }
.mic-toggle[data-state="disabled"] { color: #ffe0aa; border-color: rgba(255, 208, 122, .25); background: rgba(111, 76, 34, .65); box-shadow: none; }
.speaker-toggle { color: #b9eef0; border: 1px solid rgba(104, 212, 218, .2); background: rgba(32, 91, 103, .68); }
.speaker-toggle:hover { background: rgba(42, 117, 130, .8); }
.speaker-toggle[data-enabled="false"] { color: #ffe0aa; border-color: rgba(255, 208, 122, .25); background: rgba(111, 76, 34, .65); }
.leave-button { grid-column: 1 / -1; }
#audio-container { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
@media (max-width: 520px) {
  .shell { width: min(100% - 22px, 720px); padding-top: 42px; }
  .hero { margin-bottom: 20px; }
  .panel { border-radius: 20px; padding: 20px 16px; }
  .room-head { align-items: flex-start; }
  .room-brand { padding-top: 9px; }
  .copy-button { max-width: 132px; }
  .room-code-card { margin-top: 20px; padding: 17px 16px; }
  .room-actions { grid-template-columns: 1fr 1fr; }
  .channel-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
}