:root{
  --bg:#070713;
  --panel:#0e0e22;
  --panel2:#101033;
  --text:#f2f2ff;
  --muted:#b8b8d9;
  --line:rgba(255,255,255,.10);
  --gold:#f7c84b;
  --purple:#7c3aed;
  --danger:#ff4d6d;
  --ok:#22c55e;
}

*{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;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(124,58,237,.25), transparent 60%),
    radial-gradient(900px 600px at 80% 90%, rgba(247,200,75,.18), transparent 60%),
    linear-gradient(180deg, #060612, #050510);
  color:var(--text);
}

a{color:var(--gold); text-decoration:none}
a:hover{text-decoration:underline}

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:28px 18px 40px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.logo{
  width:34px;height:34px;border-radius:12px;
  background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(247,200,75,.85));
  box-shadow: 0 0 20px rgba(124,58,237,.35), 0 0 16px rgba(247,200,75,.25);
}
.brand h1{margin:0;font-size:18px;letter-spacing:.2px}
.brand .sub{margin:0;color:var(--muted);font-size:12px}

.grid{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:14px;
  min-height: calc(100vh - 120px);
}

.card{
  background: linear-gradient(180deg, rgba(16,16,51,.92), rgba(14,14,34,.92));
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  box-shadow: 0 12px 60px rgba(0,0,0,.35);
}

.card h2{
  margin:0;
  font-size:14px;
  letter-spacing:.25px;
  color:var(--muted);
  padding:14px 14px;
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,.02);
}

.section{padding:14px}

.row{display:flex; gap:10px; align-items:center}
.col{display:flex; flex-direction:column; gap:10px}

input, button, select, textarea{
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:12px 12px;
  outline:none;
  font-size:14px;
}
textarea{resize:none}

button{
  cursor:pointer;
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(247,200,75,.85));
  border:none;
  color:#0b0b14;
  font-weight:700;
}
button.secondary{
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  font-weight:600;
}
button.danger{
  background: rgba(255,77,109,.18);
  border:1px solid rgba(255,77,109,.35);
  color: #ffd6de;
}

.small{font-size:12px;color:var(--muted)}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-size:12px;
  color:var(--muted);
}
.dot{width:8px;height:8px;border-radius:999px;background:var(--ok); box-shadow:0 0 10px rgba(34,197,94,.5)}

.rooms{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.room{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  cursor:pointer;
}
.room.active{
  border-color: rgba(247,200,75,.45);
  box-shadow: 0 0 0 1px rgba(247,200,75,.15) inset;
}
.room .name{font-weight:700}
.room .meta{font-size:12px;color:var(--muted); margin-top:3px}

.chat{
  display:flex;
  flex-direction:column;
  height:100%;
}
.msgs{
  padding:14px;
  overflow:auto;
  height: calc(100vh - 260px);
}
.msg{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: rgba(255,255,255,.02);
  margin-bottom:10px;
}
.msg .head{
  display:flex;
  gap:10px;
  align-items:baseline;
}
.msg .sender{font-weight:800}
.msg .time{font-size:12px;color:var(--muted)}
.msg .body{margin-top:6px; white-space:pre-wrap; line-height:1.35}

.composer{
  border-top:1px solid var(--line);
  padding:12px;
  background: rgba(255,255,255,.02);
}
.composer .row{align-items:flex-end}
.composer textarea{width:100%; min-height:44px; max-height:140px}

@media (max-width: 920px){
  .grid{grid-template-columns:1fr; min-height:auto}
  .msgs{height: 55vh}
}
