* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0b0f14;
  color: #e8edf2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  background: #000;
}

#video, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlay {
  pointer-events: none;
}

#panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 90vw);
  max-height: 100%;
  overflow-y: auto;
  background: rgba(15, 20, 28, 0.92);
  backdrop-filter: blur(6px);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px 24px;
  font-size: 14px;
}

#panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#panel-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: inherit;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
}

#panel.collapsed #panel-body { display: none; }

label {
  display: block;
  margin-bottom: 10px;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="number"], select {
  width: 100%;
  padding: 6px 8px;
  margin-top: 4px;
  background: #10161f;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: inherit;
}

fieldset {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  margin: 0 0 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hint {
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.4;
}

button#start-btn, button#stop-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button#start-btn { background: #2f9e63; color: #04140b; }
button#stop-btn { background: #a6394a; color: #1a0508; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

#status {
  font-size: 12px;
  opacity: 0.85;
  white-space: pre-line;
  margin-top: 8px;
}
