:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-2: #171c22;
  --border: #232a33;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #d7ff3a;
  --accent-2: #ff4d6d;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(215,255,58,0.05), transparent),
              radial-gradient(900px 500px at 110% 110%, rgba(255,77,109,0.06), transparent);
  z-index: 0;
}
.topbar {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: rgba(11,13,16,0.6); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; letter-spacing: 0.12em; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand-title { font-weight: 600; }
.brand-sub { color: var(--muted); font-family: 'Instrument Serif', serif; font-style: italic; font-size: 20px; margin-left: 6px; }
.status { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .1em; font-weight: 600; }
.pill.live { background: var(--accent-2); color: white; box-shadow: 0 0 12px rgba(255,77,109,.5); }
.pill.offair { background: #1f262e; color: var(--muted); border: 1px solid var(--border); }
.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 340px 1fr 340px;
  gap: 18px; padding: 18px; min-height: calc(100vh - 66px);
}
.panel, .stage, .chat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; box-shadow: var(--shadow);
}
.join-panel h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.join-panel label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.join-panel input, .join-panel select {
  width: 100%; margin-top: 6px; padding: 10px 12px; font-family: inherit; font-size: 14px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.join-panel input:focus, .join-panel select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(215,255,58,.15); }
.join-panel button, .stage button, .chat-form button {
  background: var(--accent); color: #0b0d10; border: none; padding: 10px 14px; border-radius: 999px;
  font-family: inherit; font-weight: 600; letter-spacing: .06em; cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.join-panel button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(215,255,58,.25); }
.hint { color: var(--muted); font-size: 11px; margin-top: 12px; line-height: 1.6; }
.stage { display: flex; flex-direction: column; }
.stage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.room-name { font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.me { color: var(--muted); font-size: 12px; margin-top: 4px; }
.host-controls button { background: var(--accent-2); color: white; margin-right: 8px; }
#leaveBtn { background: #2a323b; color: var(--text); }
.video-grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; align-content: start; min-height: 300px; padding: 8px;
  background: var(--panel-2); border-radius: 10px; border: 1px dashed var(--border);
}
.video-grid:empty::after {
  content: 'Waiting for hosts to start broadcasting…'; color: var(--muted); font-size: 12px;
  grid-column: 1/-1; text-align: center; padding: 60px 0;
}
.tile { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; border: 1px solid var(--border); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile .tile-label { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 6px; font-size: 11px; }
.reactions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.reactions button { background: var(--panel-2); border: 1px solid var(--border); font-size: 22px; padding: 6px 10px; border-radius: 10px; cursor: pointer; transition: transform .1s; }
.reactions button:hover { transform: scale(1.15); }
.react-counts { color: var(--muted); font-size: 11px; margin-left: 8px; }
.chat { display: flex; flex-direction: column; }
.chat-header { color: var(--accent); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.chat-log { flex: 1; list-style: none; margin: 0; padding: 6px; overflow-y: auto; max-height: 60vh;
  background: var(--panel-2); border-radius: 8px; border: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.chat-log li { padding: 4px 6px; }
.chat-log .who { color: var(--accent); font-weight: 600; margin-right: 6px; }
.chat-log .who.host { color: var(--accent-2); }
.chat-log .sys { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; outline: none; font-family: inherit; font-size: 13px; }
.chat-form input:focus { border-color: var(--accent); }
.floating-reactions { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.floating-reactions .fr { position: absolute; bottom: 100px; font-size: 28px; animation: floatUp 2.4s ease-out forwards; opacity: 0.9; }
@keyframes floatUp {
  from { transform: translateY(0) scale(.8); opacity: 1; }
  to   { transform: translateY(-320px) scale(1.2); opacity: 0; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .chat-log { max-height: 240px; }
}