* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  width: 100dvw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  font-family: sans-serif;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

#start-btn {
  font-size: 2rem;
  padding: 1em 2em;
  border: none;
  border-radius: 1em;
  background: #fff;
  color: #111;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

#start-btn:active { opacity: 0.7; }

#pattern-label {
  position: fixed;
  bottom: 1.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

#toolbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.4em 0.6em;
  background: rgba(0, 0, 0, 0.45);
  flex-direction: row;
  gap: 0.5em;
  z-index: 10;
}

.tool-btn {
  font-size: 0.8rem;
  padding: 0.3em 0.7em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.4em;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.tool-btn:active { opacity: 0.6; }

#fullscreen-btn { display: none; }

#debug-panel {
  display: none;
  position: fixed;
  top: 2.6rem;
  left: 0;
  right: 0;
  padding: 0.5em 0.8em;
  background: rgba(0, 0, 0, 0.65);
  font-family: monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
}

#debug { white-space: pre; line-height: 1.5; }

#decode-log {
  margin-top: 0.4em;
  white-space: pre;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.3em;
}

#threshold-row {
  margin-top: 0.4em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.3em;
}

#threshold { width: 140px; accent-color: #aef; }
