:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --line: #2b3642;
  --text: #e7eef6;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --ok: #3ecf8e;
  --bad: #f07178;
  --warn: #e6c07b;
  font-family: "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; }

.app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 16px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.status {
  color: var(--muted);
  font-size: 13px;
}
.status.online { color: var(--ok); }
.status.busy { color: var(--accent); }
.status.error { color: var(--bad); }

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.nav-link:hover { text-decoration: underline; }

.top .wall-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.controls select {
  background: #0d1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
}

.controls label select {
  width: 100%;
}

.controls input {
  background: #0d1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  background: #243041;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
#btnConnect, #btnStart { background: #1d3b5c; border-color: #2f5f90; }

.hint { font-size: 12px; color: var(--muted); }
.hint button.link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
}

.stage-wrap {
  min-height: 0;
  display: grid;
}

.stage {
  position: relative;
  margin: 0 auto;
  width: min(100%, 420px);
  aspect-ratio: 9 / 19.5;
  background: #090d12;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
  image-rendering: -webkit-optimize-contrast;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
  z-index: 1;
}

.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  gap: 12px;
}
.login-card .brand { font-size: 18px; }
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.login-card input {
  background: #0d1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.login-card button {
  background: var(--accent);
  color: #061018;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .stage { width: 100%; }
}
