:root{
  --bg:#0b1220;
  --panel:rgba(255,255,255,0.06);
  --border:rgba(255,255,255,0.12);
  --text:#e5e7eb;
  --muted:rgba(229,231,235,0.72);
  --accent:#6366f1;
  --danger:#ef4444;
  --shadow:0 12px 38px rgba(0,0,0,0.45);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  color:var(--text);
  background:
    radial-gradient(1100px 600px at 15% 5%, rgba(99,102,241,0.35), transparent 60%),
    radial-gradient(900px 500px at 85% 15%, rgba(34,197,94,0.18), transparent 55%),
    radial-gradient(900px 500px at 60% 95%, rgba(239,68,68,0.12), transparent 55%),
    var(--bg);
}

.container{max-width:1100px;margin:0 auto;padding:20px}

.topbar{
  position:sticky;top:0;z-index:10;
  background:rgba(8,12,20,0.78);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar__inner{display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{display:flex;align-items:center;gap:12px}
.brand__logo{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:var(--panel);border:1px solid var(--border)}
.brand__name{font-weight:800;font-size:18px;line-height:1.1}
.brand__tag{font-size:12px;color:var(--muted)}
.topbar__right{display:flex;align-items:center;gap:12px}

.link{color:var(--text);text-decoration:none;opacity:.86}
.link:hover{opacity:1}

.hero{margin:18px 0 8px}
.hero h1{margin:0 0 8px;font-size:28px;letter-spacing:-0.02em}
.hero p{margin:0;color:var(--muted);line-height:1.6}

.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0 40px}
@media (max-width:860px){.grid{grid-template-columns:1fr}}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:18px 0 40px}
@media (max-width:980px){.grid2{grid-template-columns:1fr}}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}
.card h2{margin:0 0 8px;font-size:18px;letter-spacing:-0.01em}
.cardHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}
.card--chat{grid-column:1/-1}

.muted{color:var(--muted)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}

.field{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.field span{font-size:12px;color:var(--muted)}
input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,0.28);
  color:var(--text);
  outline:none;
}
input:focus{border-color:rgba(99,102,241,0.65);box-shadow:0 0 0 3px rgba(99,102,241,0.18)}

.btn{
  cursor:pointer;
  border:none;
  padding:11px 14px;
  border-radius:14px;
  background:rgba(255,255,255,0.10);
  color:var(--text);
  border:1px solid var(--border);
  transition:transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{background:rgba(255,255,255,0.14)}
.btn:active{transform:translateY(1px)}
.btn--primary{background:rgba(99,102,241,0.25);border-color:rgba(99,102,241,0.45)}
.btn--primary:hover{background:rgba(99,102,241,0.32)}
.btn--ghost{background:transparent}
.btn--danger{background:rgba(239,68,68,0.20);border-color:rgba(239,68,68,0.35)}
.btn--danger:hover{background:rgba(239,68,68,0.28)}

.row{display:flex;align-items:center;gap:12px;margin-top:12px}
.row.wrap{flex-wrap:wrap}

.hint{font-size:12px;color:var(--muted)}
.hint--error{color:rgba(248,113,113,0.95)}

.list{margin:10px 0 0;padding-left:16px;color:var(--muted);line-height:1.6}

.roomHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-top:12px}
@media (max-width:980px){.roomHeader{flex-direction:column}}
.roomTitle{margin:0 0 6px;font-size:22px;letter-spacing:-0.02em}
.roomHeader__right{display:flex;flex-direction:column;gap:10px;min-width:280px}

.pill{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 12px;border-radius:14px;background:rgba(0,0,0,0.22);border:1px solid var(--border)}

.participants{display:flex;flex-direction:column;gap:8px}
.participant{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 12px;border-radius:14px;
  background:rgba(0,0,0,0.22);border:1px solid var(--border)
}
.participant__left{display:flex;align-items:center;gap:10px;min-width:0}
.avatar{width:32px;height:32px;border-radius:12px;background:rgba(99,102,241,0.22);border:1px solid rgba(99,102,241,0.35);display:grid;place-items:center;font-weight:700}
.participant__name{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.participant__meta{font-size:12px;color:var(--muted)}

.voiceGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:860px){.voiceGrid{grid-template-columns:1fr}}
.voiceCard{padding:12px;border-radius:16px;background:rgba(0,0,0,0.22);border:1px solid var(--border)}
.voiceCard__title{font-size:12px;color:var(--muted);margin-bottom:8px}
.remoteAudios{display:flex;flex-direction:column;gap:10px}
.remoteAudio{
  padding:10px 10px;border-radius:14px;
  background:rgba(255,255,255,0.06);
  border:1px solid var(--border);
}
.remoteAudio__label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);margin-bottom:6px}

.chatLog{
  height:320px;
  overflow:auto;
  padding:12px;
  border-radius:16px;
  background:rgba(0,0,0,0.22);
  border:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.chatMsg{max-width:78%;padding:10px 10px;border-radius:16px;border:1px solid var(--border)}
.chatMsg--self{align-self:flex-end;background:rgba(99,102,241,0.22);border-color:rgba(99,102,241,0.35)}
.chatMsg--peer{align-self:flex-start;background:rgba(255,255,255,0.06)}
.chatMsg__meta{font-size:11px;color:var(--muted);margin-bottom:6px}
.chatMsg__text{white-space:pre-wrap;word-break:break-word}

.chatInputRow{display:flex;gap:10px;margin-top:12px}
.chatInputRow input{flex:1}

.footer{padding:24px 0;border-top:1px solid var(--border);background:rgba(8,12,20,0.55)}

.modal{position:fixed;inset:0;display:none;z-index:50}
.modal.is-open{display:block}
.modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.62)}
.modal__panel{
  position:relative;
  max-width:520px;
  margin:12vh auto 0;
  background:rgba(15,23,42,0.92);
  border:1px solid var(--border);
  border-radius:20px;
  padding:18px;
  box-shadow:var(--shadow);
}
.modal__panel h2{margin:0 0 8px}
