html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #111;
  color: #ddd;
  font: 13px/1.4 system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

video {
  display: block;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
  touch-action: none;
}

video:focus {
  outline: none;
}

#hud {
  position: fixed;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  white-space: pre;
  pointer-events: none;
}

#toolbar {
  position: fixed;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100vw - 16px);
}

#toolbar[hidden], #keyrow[hidden], #toolbar button[hidden] {
  display: none;
}

#toolbar button, #keyrow button {
  min-width: 44px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #555;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #ddd;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

#toolbar button:disabled {
  cursor: default;
  opacity: 0.55;
}

#keyrow {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

#keyrow button.on {
  background: #2d6cdf;
  border-color: #6da0ff;
  color: #fff;
}

/* The box the phone keyboard types into: on the page (so it can take focus) but not seen. 16px keeps iOS from zooming in on it. */
#typer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}

#readout {
  padding: 8px;
  font: 20px/1.3 ui-monospace, Consolas, monospace;
}
