:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef5;
  --muted: #8b9aab;
  --accent: #2f9e6b;
  --danger: #c44b4b;
  --border: #2a3542;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #1d2a36, var(--bg));
  color: var(--text);
  font-family: var(--font);
}

.hidden {
  display: none !important;
}

.panel {
  width: min(420px, 92vw);
  margin: 12vh auto 0;
  padding: 28px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.panel h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 650;
}

.hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0c1117;
  color: var(--text);
  font-size: 1rem;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #04140d;
  font-weight: 650;
  cursor: pointer;
}

button.danger {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.status {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.session {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(12, 17, 23, 0.92);
  border-bottom: 1px solid var(--border);
}

.toolbar .left,
.toolbar .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #243041;
  font-size: 0.85rem;
}

.badge.ok {
  background: #1d4a36;
}

.badge.warn {
  background: #4a3a1d;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.stage {
  position: relative;
  overflow: hidden;
  background: #000;
}

#screen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: none;
  outline: none;
  background: #000;
}

.local-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 200, 255, 0.85);
  box-shadow: 0 0 0 1px #000, 0 0 10px rgba(0, 200, 255, 0.7);
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: none;
}

.local-cursor.visible {
  display: block;
}

.camera-preview {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(280px, 36vw);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
