:root {
  --bg: #0f1419;
  --panel: #1a212b;
  --accent: #2f6fed;
  --text: #e6edf3;
  --muted: #8b97a7;
  --error: #ff6b6b;
  --border: #2a3340;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.brand { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.brand span { color: var(--accent); }

.status {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.status.live { color: #4ade80; border-color: #2f6f4d; }
.status.connecting { color: #fbbf24; }

main { flex: 1; display: flex; min-height: 0; }

.panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }

#connect-panel {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 24px;
}
#connect-panel h1 { font-size: 24px; margin: 0; }
#connect-panel p { color: var(--muted); margin: 4px 0; }

#join-form { display: flex; gap: 10px; margin-top: 16px; }

#code-input {
  font-size: 28px;
  letter-spacing: 10px;
  width: 220px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c1117;
  color: var(--text);
}

button {
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.error { color: var(--error); min-height: 18px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.toolbar .toggle { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
#session-label { font-weight: 600; }
.toolbar .ghost { margin-left: auto; }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
  overflow: hidden;
}

#screen {
  max-width: 100%;
  max-height: 100%;
  outline: none;
  cursor: crosshair;
}

.hidden { display: none !important; }
