:root {
  --bg: #111418;
  --panel: #1b2027;
  --line: #2c333d;
  --text: #e6e9ee;
  --muted: #8b94a3;
  --accent: #3b82f6;
  --error: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

[hidden] { display: none !important; }

#login {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

#login-form {
  width: min(320px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

#login-form h1 { margin: 0 0 4px; font-size: 18px; }

input, button, select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}

button { cursor: pointer; background: var(--panel); }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: default; }
button[type="submit"] { background: var(--accent); border-color: var(--accent); }

.error { color: var(--error); margin: 0; min-height: 1.5em; }

#main {
  height: 100%;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

header button, header select { padding: 4px 10px; }
#status { color: var(--muted); }
.spacer { flex: 1; }

#stage {
  flex: 1;
  min-height: 0;
  background: #000;
}

#screen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
  cursor: default;
  touch-action: none;
}
