* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0f14;
  --panel: #131a22;
  --panel-2: #1a222c;
  --border: #2a3542;
  --text: #e7edf3;
  --muted: #8ba0b5;
  --accent: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 18px; font-weight: 600; }
header .meta { color: var(--muted); font-size: 14px; display: flex; gap: 16px; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.live .dot { background: var(--red); }
.badge.live { color: #fff; }

main { padding: 20px; max-width: 1200px; margin: 0 auto; }

.layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }

.video-frame {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}
.video-frame video, .video-frame canvas { width: 100%; height: 100%; object-fit: contain; display: block; }

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--red); }
button.success { background: var(--green); }
button.small { padding: 5px 12px; font-size: 13px; border-radius: 6px; }

input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  width: 100%;
  font-family: inherit;
}

.controls { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.5; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}
.list .row .actions { display: flex; gap: 6px; }
.empty { color: var(--muted); font-size: 13px; font-style: italic; }

.join-card {
  max-width: 420px;
  margin: 60px auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.join-card h2 { font-size: 20px; color: var(--text); text-transform: none; letter-spacing: 0; }
.join-card p { color: var(--muted); font-size: 14px; line-height: 1.5; }

.stage-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.stage-strip .video-frame { aspect-ratio: 16 / 9; }
.stage-strip .name-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  text-align: center;
}
.modal h3 { margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.modal .controls { justify-content: center; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  z-index: 60;
}

.hidden { display: none !important; }

/* Landing page */
.landing { max-width: 720px; margin: 80px auto; padding: 0 20px; text-align: center; }
.landing h1 { font-size: 28px; margin-bottom: 10px; }
.landing p { color: var(--muted); margin-bottom: 40px; line-height: 1.6; }
.landing .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .landing .cards { grid-template-columns: 1fr; } }
.landing a.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px 20px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.landing a.card:hover { border-color: var(--accent); }
.landing a.card .icon { font-size: 34px; margin-bottom: 12px; }
.landing a.card h2 { font-size: 18px; margin-bottom: 8px; }
.landing a.card span { color: var(--muted); font-size: 14px; }
