:root{
  --bg0:#070a10;
  --bg1:#0b1220;
  --card:#0e1a2d;
  --card2:#0b1628;
  --text:#e8f0ff;
  --muted:#9fb3d9;
  --line:#1f355a;
  --accent:#3ad0c3;
  --accent2:#7aa7ff;
  --warn:#ffcc66;
  --bad:#ff6b8a;
  --ok:#50f2b5;
  --shadow: 0 10px 35px rgba(0,0,0,.35);
  --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, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(1200px 700px at 15% 10%, rgba(58,208,195,.14), transparent 50%),
              radial-gradient(900px 600px at 85% 20%, rgba(122,167,255,.14), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
}
a{color:var(--accent2); text-decoration:none}
a:hover{opacity:.9}

.bg{min-height:100%}
.shell{max-width:1000px; margin:0 auto; padding:18px 14px 40px}
.room-shell{max-width:1400px; margin:0 auto; padding:14px 12px 30px}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border:1px solid var(--line);
  background: rgba(14,26,45,.65);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 20;
}
.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:38px; height:38px; border-radius:12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(58,208,195,.25), rgba(122,167,255,.18));
  border:1px solid rgba(58,208,195,.35);
  font-weight:800;
  letter-spacing:.04em;
}
.brand-name{font-weight:800; letter-spacing:.02em}
.brand-sub{font-size:12px; color:var(--muted)}
.top-actions{display:flex; gap:8px; align-items:center}

.card{
  background: rgba(14,26,45,.8);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.subcard{
  margin-top:12px;
  background: rgba(11,22,40,.85);
  border:1px solid rgba(31,53,90,.9);
  border-radius: 14px;
  padding:12px;
}

h1,h2,h3{margin:0 0 10px}
h1{font-size:22px}
h2{font-size:18px}
h3{font-size:15px}
p{margin:0 0 10px}
.muted{color:var(--muted)}
.tiny{font-size:12px}
.list{padding-left:18px}
.list li{margin:8px 0}

.grid{display:grid; gap:14px; margin-top:14px}
.grid.two{grid-template-columns: 1fr}
@media (min-width: 920px){
  .grid.two{grid-template-columns: 1.2fr .8fr}
}

.field{display:flex; flex-direction:column; gap:6px; margin:12px 0}
label{font-size:12px; color:var(--muted)}
input,select{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(31,53,90,.9);
  background: rgba(7,10,16,.5);
  color: var(--text);
  outline:none;
}
input:focus,select:focus{
  border-color: rgba(58,208,195,.65);
  box-shadow: 0 0 0 3px rgba(58,208,195,.12);
}

.btn{
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.45);
  color: var(--text);
  padding:12px 14px;
  border-radius: 14px;
  cursor:pointer;
  transition: transform .06s ease, opacity .12s ease, border-color .12s ease;
  user-select:none;
}
.btn:hover{opacity:.95; border-color: rgba(58,208,195,.35)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(58,208,195,.25), rgba(58,208,195,.12));
  border-color: rgba(58,208,195,.45);
}
.btn.ghost{background: transparent}
.btn.small{padding:8px 10px; border-radius: 12px; font-size: 13px}

.row{display:flex; align-items:center}
.row.gap{gap:10px}
.row.between{justify-content:space-between}
.wrap{flex-wrap:wrap}

.notice{
  margin-top:12px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(122,167,255,.35);
  background: rgba(122,167,255,.08);
  color: var(--text);
  font-size: 13px;
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.35);
  font-size: 12px;
}
.dot{margin:0 8px; opacity:.6}

.foot{
  margin-top:16px;
  display:flex; gap:10px; justify-content:center; align-items:center;
  font-size: 12px;
}

.hidden{display:none !important;}

/* Room layout */
.room-grid{
  display:grid;
  gap:12px;
  margin-top:12px;
  grid-template-columns: 1fr;
}
@media (min-width: 1000px){
  .room-grid{grid-template-columns: 1fr 360px;}
}
.stage{min-height: 70vh; display:flex; flex-direction:column; gap:12px}
.stage-head{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
.stage-view{
  position:relative;
  flex: 1;
  border-radius: 16px;
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.35);
  overflow:hidden;
  display:grid;
  place-items:center;
}
.empty{padding:14px; text-align:center}
.strip{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:4px;
}
.tile{
  width: 140px;
  min-width: 140px;
  border-radius: 16px;
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.35);
  overflow:hidden;
  position:relative;
  cursor:pointer;
}
.tile .label{
  position:absolute;
  left:10px; bottom:10px;
  right:10px;
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  font-size: 12px;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.badge{
  font-size: 10px;
  padding:4px 8px;
  border-radius: 999px;
  border:1px solid rgba(58,208,195,.45);
  background: rgba(58,208,195,.12);
  color: var(--text);
}
video{
  width:100%;
  height:100%;
  object-fit:cover;
  background:#000;
}

.sidebar{min-height: 70vh}
.tabs{display:flex; gap:8px; margin-bottom:12px}
.tab{
  flex:1;
  padding:10px 10px;
  border-radius: 14px;
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.35);
  color: var(--text);
  cursor:pointer;
}
.tab.active{
  border-color: rgba(58,208,195,.5);
  background: rgba(58,208,195,.10);
}
.parts{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.part{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 10px;
  border-radius: 14px;
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.25);
}
.part .meta{display:flex; flex-direction:column; gap:2px; min-width:0}
.part .meta .name{font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.part .meta .sub{font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.part .actions{display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 92vw;
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(58,208,195,.45);
  background: rgba(7,10,16,.85);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  z-index: 50;
}

.log{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 70vh;
  overflow:auto;
}
.log .entry{
  border:1px solid rgba(31,53,90,.95);
  background: rgba(7,10,16,.25);
  border-radius: 14px;
  padding:10px 10px;
  font-size:12px;
  line-height:1.35;
}
code{color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
