:root {
  color-scheme: dark;
  --bg: #000000;
  --green: #39ff14;
  --green-dim: #1c8a0c;
  --text: #c8ffc8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", monospace;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

#output {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #000;
}

#webcam {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14vh;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.overlay.hidden {
  display: none;
}

.overlay.dimmed {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.hint {
  color: var(--green-dim);
  font-size: 0.8rem;
  margin: 0;
  text-shadow: 0 0 6px #000, 0 0 6px #000;
}

.status {
  color: #ff6a6a;
  max-width: 80vw;
  text-align: center;
  font-size: 0.85rem;
  margin: 0;
  text-shadow: 0 0 6px #000, 0 0 6px #000;
}

/* Floating panels (settings, share/QR): TuiCSS window/fieldset, recolored to green-on-black. */

.tui-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: min(92vw, 22rem);
  max-height: 85vh;
  overflow-y: auto;
  background-color: #000;
  color: var(--green);
  box-shadow: 10px 10px rgba(0, 0, 0, 0.8);
}

.tui-panel.active {
  display: block;
}

.tui-panel .tui-fieldset {
  border: 4px double var(--green);
  background-color: inherit;
}

.tui-panel .tui-fieldset legend {
  color: var(--green);
  text-shadow: 0 0 6px var(--green-dim);
}

.tui-panel .tui-fieldset-button {
  color: var(--green);
  background-color: inherit;
}

.tui-panel .tui-fieldset-button:active {
  color: #fff !important;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 0.5rem;
}

.range-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text);
}

.value {
  color: var(--green);
  font-size: 0.75rem;
}

.tui-panel .tui-input-fieldset {
  border: 2px solid var(--green-dim);
  background-color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tui-panel .tui-input-fieldset legend {
  color: var(--green);
}

.tui-panel .tui-checkbox {
  color: var(--text);
}

.tui-panel .tui-checkbox input:checked ~ span::after {
  color: var(--green);
}

.tui-panel .tui-button {
  background-color: #0e1f0e;
  color: var(--green);
  border: 1px solid var(--green-dim);
  box-shadow: 4px 4px #000;
  align-self: flex-start;
}

.tui-panel .tui-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tui-panel::-webkit-scrollbar-track {
  background-image: none;
  background-color: #000;
}

.tui-panel::-webkit-scrollbar-thumb,
.tui-panel::-webkit-scrollbar-thumb:hover {
  background-color: var(--green-dim);
}

input[type="range"] {
  accent-color: var(--green);
  width: 100%;
}

.qr-body {
  align-items: center;
  text-align: center;
}

.qr-canvas {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  background-color: #000;
}

.qr-url {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text);
  word-break: break-all;
}

.qr-body .tui-button {
  align-self: center;
}
