:root {
  --bg: #000;
  --fg: #e8e8e8;
  --panel: rgba(0, 0, 0, 0.72);
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  overscroll-behavior: none;
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

#stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#screen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

#status {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--panel);
  pointer-events: none;
}

#status:empty { display: none; }

#stats {
  position: fixed;
  right: 8px;
  top: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--panel);
  pointer-events: none;
  white-space: pre;
}

/* Shown only while the stream is below the requested resolution (pixel budget). */
#degraded {
  position: fixed;
  left: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--panel);
  font-size: 11px;
  opacity: 0.65;
  pointer-events: none;
}

#degraded[hidden] { display: none; }

#kbd-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: var(--panel);
  color: var(--fg);
  font-size: 22px;
}

/* Focusable for the mobile keyboard, but invisible. 16px avoids iOS zoom-on-focus. */
#kbd {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 16px;
  resize: none;
}
