:root{
  --bg:#0b1220;
  --card:#0f1b33;
  --card2:#0c162b;
  --text:#e9eefc;
  --muted:#9fb0d0;
  --line:rgba(255,255,255,.08);
  --primary:#2f7dff;
  --danger:#ff3b3b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --r:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 30% -10%, rgba(47,125,255,.35), transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, rgba(102, 255, 214, .10), transparent 55%),
    var(--bg);
}

a{color:inherit;text-decoration:none;opacity:.85}
a:hover{opacity:1}

.topbar{
  position:sticky;top:0;z-index:10;
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;
  background: rgba(9, 14, 27, .78);
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand{display:flex;align-items:center;gap:10px;font-weight:700}
.logoDot{width:10px;height:10px;border-radius:999px;background:var(--primary);box-shadow:0 0 18px rgba(47,125,255,.8)}
.tag{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(47,125,255,.15);
  border:1px solid rgba(47,125,255,.35);
  color: rgba(233,238,252,.9);
}

.links{display:flex;gap:14px;font-size:14px}
.links a{padding:6px 10px;border-radius:10px}
.links a:hover{background: rgba(255,255,255,.06)}

.app{
  width:min(1200px, 96vw);
  margin:18px auto 26px;
  display:grid;
  grid-template-columns: 1.65fr .9fr;
  gap:16px;
}

.stage, .chat{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.stage{padding:14px}
.stageHead{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:6px 6px 10px;
}
.statusTitle{font-size:12px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase}
.statusText{font-size:14px;margin-top:4px;color: rgba(233,238,252,.95)}
.quickActions{display:flex;gap:10px}

.videoRow{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.videoCard{
  position:relative;
  border-radius: 16px;
  overflow:hidden;
  background: rgba(0,0,0,.25);
  border:1px solid var(--line);
  min-height: 260px;
}

.videoLabel{
  position:absolute;left:10px;top:10px;
  font-size:12px;
  color: rgba(233,238,252,.9);
  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  padding:4px 8px;
  border-radius:999px;
  backdrop-filter: blur(8px);
}

video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  background:#000;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
  padding:6px;
}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 14px;
  padding:10px 14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  transition: transform .06s ease, background .15s ease, opacity .15s ease;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn:active{transform: translateY(1px)}
.btn:disabled{opacity:.45;cursor:not-allowed}

.btnIcon{display:inline-flex;width:18px;height:18px}
.btnIcon svg{width:18px;height:18px}

.primary{
  background: rgba(47,125,255,.18);
  border-color: rgba(47,125,255,.40);
}
.primary:hover{background: rgba(47,125,255,.26)}

.danger{
  background: rgba(255,59,59,.14);
  border-color: rgba(255,59,59,.35);
}
.danger:hover{background: rgba(255,59,59,.22)}

.ghost{
  background: rgba(255,255,255,.03);
}

.iconBtn{
  width:40px;height:40px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.iconBtn:hover{background: rgba(255,255,255,.10)}
.iconBtn:disabled{opacity:.45;cursor:not-allowed}
.iconBtn svg{width:20px;height:20px}

.hint{
  font-size:12px;
  color: var(--muted);
  padding: 8px 10px 2px;
}

.chat{
  padding:12px;
  display:flex;
  flex-direction:column;
  min-height: 520px;
}
.chatTop{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;
  padding:6px 6px 10px;
  border-bottom:1px solid var(--line);
}
.chatTitle{font-weight:800}
.chatSub{font-size:12px;color:var(--muted);margin-top:2px}

.chatLog{
  flex:1;
  overflow:auto;
  padding:10px 6px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.chatLine{
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  font-size:14px;
  line-height:1.25;
  max-width: 92%;
  word-break: break-word;
}
.chatLine.me{
  align-self:flex-end;
  background: rgba(47,125,255,.16);
  border-color: rgba(47,125,255,.30);
}
.chatLine.them{
  align-self:flex-start;
}

.chatForm{
  display:flex;
  gap:10px;
  padding:10px 6px 6px;
  border-top:1px solid var(--line);
}
.chatInput{
  flex:1;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 12px;
  outline:none;
}
.chatInput::placeholder{color: rgba(159,176,208,.8)}

.mobileOnly{display:none}

@media (max-width: 980px){
  .app{
    grid-template-columns: 1fr;
  }
  .chat{
    position: fixed;
    left: 10px; right: 10px;
    bottom: 10px;
    top: 70px;
    z-index: 20;
    display:none;
  }
  .chat.open{display:flex}
  .mobileOnly{display:flex}
  .links{display:none}
  .videoRow{grid-template-columns: 1fr}
  .videoCard{min-height: 240px}
}