:root{
  --bg:#070b16;
  --bg-2:#0b1020;
  --panel:rgba(15,20,36,.76);
  --panel-strong:rgba(13,18,32,.92);
  --line:rgba(255,255,255,.08);
  --line-2:rgba(124,92,255,.22);
  --text:#eef3ff;
  --muted:#9aa8cd;
  --muted-2:#7583a9;
  --accent:#7c5cff;
  --accent-2:#22d3c5;
  --danger:#ff5f78;
  --shadow:0 24px 80px rgba(0,0,0,.4);
  --radius:26px;
  --radius-sm:18px;
}

*{box-sizing:border-box}
html,body{min-height:100%;margin:0}
body{
  background:
    radial-gradient(circle at 10% 10%, rgba(124,92,255,.18), transparent 32%),
    radial-gradient(circle at 90% 15%, rgba(34,211,197,.14), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(0,102,255,.12), transparent 30%),
    linear-gradient(180deg, #050812 0%, #070b16 100%);
  color:var(--text);
  font-family:'Montserrat',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
  overflow-x:hidden;
}

button,input,textarea{font:inherit}
button{cursor:pointer;border:none}
input,textarea{
  width:100%;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(8,12,22,.9);
  color:var(--text);
  padding:12px 14px;
  outline:none;
  transition:.2s ease;
}
input:focus,textarea:focus{
  border-color:rgba(124,92,255,.7);
  box-shadow:0 0 0 4px rgba(124,92,255,.12);
}
textarea{resize:vertical;min-height:110px}
a{color:inherit}

.hidden{display:none !important}
.muted{color:var(--muted)}
.grow{flex:1}
.wrap{flex-wrap:wrap}
.spaced{margin-top:18px}
.stack{display:flex;flex-direction:column;gap:14px}
.row{display:flex;gap:12px;align-items:center}
.field{display:flex;flex-direction:column;gap:8px}
.field span{font-size:13px;color:var(--muted)}

.orb{
  position:fixed;
  pointer-events:none;
  filter:blur(90px);
  opacity:.48;
  z-index:0;
}
.orb-a{width:340px;height:340px;background:#4d3cff;top:-80px;left:-60px}
.orb-b{width:380px;height:380px;background:#19b6ff;right:-120px;top:120px}

.app-shell{
  position:relative;
  z-index:1;
  max-width:1600px;
  margin:0 auto;
  padding:18px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 18px;
  margin-bottom:18px;
  background:rgba(8,12,21,.72);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
}

.brand{display:flex;align-items:center;gap:14px}
.brand-mark{
  width:54px;height:54px;
  border-radius:18px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  font-weight:900;color:white;
  box-shadow:0 14px 32px rgba(124,92,255,.3);
}
.brand-title{font-size:24px;font-weight:900;line-height:1.1}
.brand-subtitle{color:var(--muted);font-size:13px;margin-top:4px}

.nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center}
.nav-btn,.ghost-btn,.secondary-btn,.primary-btn,.danger-btn,.icon-btn,.switch-btn,.upload-btn{
  border-radius:16px;
  transition:transform .16s ease,box-shadow .2s ease,background .2s ease,border-color .2s ease,opacity .2s ease;
}
.nav-btn{
  padding:11px 15px;
  background:#0f1627;
  color:var(--text);
  border:1px solid var(--line);
}
.nav-btn.active,.nav-btn:hover{
  border-color:rgba(124,92,255,.45);
  background:linear-gradient(135deg,rgba(124,92,255,.95),rgba(34,211,197,.65));
}
.topbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.status-pill,.auth-pill,.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-size:13px;
  border:1px solid var(--line);
  background:rgba(12,16,28,.9);
  color:var(--muted);
}
.auth-pill{color:var(--text)}
.icon-btn{
  width:42px;height:42px;
  display:grid;place-items:center;
  background:#10182b;
  color:var(--text);
  border:1px solid var(--line);
}

.pages{display:block}
.page{display:none;animation:fade .22s ease}
.page.active{display:block}
@keyframes fade{from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}

.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
}
.section,.hero,.card{padding:18px}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:14px;
}
.section-title{font-size:20px;font-weight:900}
.section-subtitle{margin-top:4px;color:var(--muted);font-size:13px;line-height:1.45}
.room-meta,.hero-side{display:flex;gap:10px;flex-wrap:wrap}
.badge{color:var(--text)}
.hero{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(320px,.9fr);
  gap:18px;
}
.hero-copy h1{
  margin:10px 0 12px;
  font-size:clamp(30px,4vw,56px);
  line-height:1.02;
  letter-spacing:-.04em;
}
.hero-kicker{color:var(--accent-2);font-weight:700;font-size:13px;text-transform:uppercase;letter-spacing:.08em}
.hero-copy p{margin:0;color:var(--muted);max-width:68ch;line-height:1.65}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.primary-btn,.secondary-btn,.danger-btn,.ghost-btn,.switch-btn{
  padding:12px 16px;
  font-weight:800;
  color:var(--text);
  border:1px solid transparent;
}
.primary-btn{background:linear-gradient(135deg,var(--accent),#5c9dff);box-shadow:0 16px 34px rgba(124,92,255,.24)}
.secondary-btn{background:#10182b;border-color:var(--line)}
.ghost-btn{background:rgba(255,255,255,.03);border:1px solid var(--line)}
.danger-btn{background:linear-gradient(135deg,#ff6177,#ff8f66)}
.switch-btn{background:#0f1627;border-color:var(--line)}
.primary-btn:hover,.secondary-btn:hover,.danger-btn:hover,.ghost-btn:hover,.switch-btn:hover,.icon-btn:hover,.nav-btn:hover{
  transform:translateY(-1px);
}
.primary-btn:disabled,.secondary-btn:disabled,.danger-btn:disabled,.ghost-btn:disabled,.icon-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}

.hero-side{
  flex-direction:column;
  gap:12px;
}
.hero-card,.mini-card,.profile-box,.invite,.member,.chat-item,.video-box,.setting,.info-row{
  background:rgba(9,13,23,.78);
  border:1px solid var(--line);
  border-radius:22px;
}
.hero-card{padding:16px}
.hero-label{color:var(--muted);font-size:13px}
.hero-value{font-size:20px;font-weight:900;margin:8px 0 6px}
.hero-note{color:var(--muted);line-height:1.5}
.hero-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.mini-card{padding:14px}
.mini-card span{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}
.mini-card strong{font-size:16px}

.grid-3,.grid-2,.video-grid{
  display:grid;
  gap:18px;
}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:18px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.card-title{font-size:18px;font-weight:900;margin-bottom:8px}
.card-text{margin:0 0 14px;color:var(--muted);line-height:1.55}

.profile-box{
  display:flex;
  gap:14px;
  align-items:center;
  padding:16px;
  margin-bottom:14px;
}
.avatar-lg,.avatar-sm{
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:white;
  font-weight:900;
}
.avatar-lg{width:62px;height:62px;border-radius:20px;font-size:28px}
.avatar-sm{width:42px;height:42px;border-radius:14px;font-size:18px}
.profile-name{font-size:18px;font-weight:900}
.profile-sub{color:var(--muted);font-size:13px;margin-top:4px;word-break:break-word}
.hint{color:var(--muted);font-size:13px;line-height:1.5}
.badge{font-weight:700}
.invite{padding:14px}
.invite-head{color:var(--muted);font-size:13px;margin-bottom:8px}
.invite-row{display:flex;gap:10px;align-items:center}
.invite-row input{font-weight:700;letter-spacing:.06em}

.members-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;color:var(--muted);font-size:13px}
.members-list,.chat-log{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:240px;
  max-height:540px;
  overflow:auto;
  padding-right:4px;
}
.member,.chat-item{
  padding:12px;
}
.member{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.member-main{flex:1;min-width:0}
.member-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.member-name{font-weight:900}
.member-about,.member-status{color:var(--muted);font-size:12px;line-height:1.45;margin-top:4px}
.member-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  font-size:12px;
}
.tag.online{border-color:rgba(34,211,197,.4);background:rgba(34,211,197,.1)}
.tag.host{border-color:rgba(124,92,255,.4);background:rgba(124,92,255,.1)}
.tag.me{border-color:rgba(255,255,255,.15)}
.tag.offline{opacity:.55}

.player-frame{
  position:relative;
  overflow:hidden;
  border-radius:28px;
  background:#050812;
  border:1px solid rgba(255,255,255,.08);
}
.main-player{
  width:100%;
  aspect-ratio:16/9;
  background:#02040a;
  display:block;
  object-fit:contain;
}
.player-overlay{
  position:absolute;
  left:0;right:0;bottom:0;
  padding:16px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  background:linear-gradient(180deg,transparent,rgba(5,8,18,.92));
}
.overlay-kicker{color:var(--muted);font-size:12px}
.overlay-title{font-size:18px;font-weight:900;max-width:56ch}
.player-controls{display:flex;gap:10px;flex-wrap:wrap}
.media-tools{
  display:flex;
  gap:10px;
  align-items:end;
  flex-wrap:wrap;
  margin-top:14px;
}
.upload-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:0 18px;
  background:#10182b;
  border:1px solid var(--line);
  overflow:hidden;
}
.upload-btn input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.media-tools .field{min-width:280px}
.chat-log{min-height:420px}
.chat-item.me{border-color:rgba(124,92,255,.45);background:rgba(124,92,255,.1)}
.chat-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}
.chat-name{font-weight:900}
.chat-time{color:var(--muted-2);font-size:12px}
.chat-body{white-space:pre-wrap;line-height:1.5}
.compose{display:flex;gap:10px;align-items:center;margin-top:12px}
.compose input{flex:1}
.typing-line{min-height:20px;color:var(--muted);font-size:12px;margin-top:8px}
.video-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:16px}
.video-box{padding:12px;overflow:hidden}
.video-label{color:var(--muted);font-size:13px;margin-bottom:10px}
.video-box video{
  width:100%;
  aspect-ratio:4/3;
  background:#02040a;
  border-radius:18px;
  object-fit:cover;
}

.settings-list{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.setting{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px;
}
.setting strong{display:block;font-size:14px;margin-bottom:4px}
.setting span{display:block;color:var(--muted);font-size:12px;line-height:1.45}
.info-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}
.info-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding:14px;
}
.info-row span{color:var(--muted);font-size:13px}
.info-row strong{font-size:14px;word-break:break-word}

.toast{
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translateX(-50%) translateY(20px);
  background:rgba(8,12,20,.92);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:999px;
  padding:12px 18px;
  box-shadow:var(--shadow);
  opacity:0;
  pointer-events:none;
  transition:.25s ease;
  z-index:20;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

.compact .panel,.compact .section,.compact .hero,.compact .card{padding:14px}
.compact .hero-copy h1{font-size:clamp(28px,3.6vw,50px)}
.compact .members-list,.compact .chat-log{max-height:460px}

@media (max-width: 1240px){
  .hero,.grid-2,.grid-3{grid-template-columns:1fr}
  .video-grid{grid-template-columns:1fr}
}
@media (max-width: 920px){
  .app-shell{padding:12px}
  .topbar{flex-direction:column;align-items:stretch}
  .topbar-right,.nav{justify-content:flex-start}
  .hero{grid-template-columns:1fr}
  .hero-actions,.row,.compose,.media-tools,.player-overlay{flex-direction:column;align-items:stretch}
  .player-overlay{position:static;background:linear-gradient(180deg,rgba(5,8,18,.96),rgba(5,8,18,.88))}
  .invite-row,.info-row,.setting{flex-direction:column;align-items:stretch}
  .media-tools .field{min-width:0}
}
