* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  font-family: 'ABC-Diatype', monospace;
}

body.inverted {
  background-color: #fff;
  color: #000;
}
canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

#toolbar {
  position: fixed;
  inset: auto 0 0 0;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

#toolbar .toolbar-section {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: auto;
}

#toolbar .toolbar-link,
#toolbar button {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  font-family: 'ABCDiatype', monospace;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  line-height: 1;
  white-space: nowrap;
}

#toolbar .toolbar-link:hover,
#toolbar button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#toolbar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#swapCameraButton,
#cameraModeButton {
  display: none;
}

#toolbar .toolbar-button-group {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

#toolbar .toolbar-button-group button {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
}

#toolbar .toolbar-button-group button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

#toolbarStats {
  opacity: 0.6;
  margin-left: auto;
}

#toolbar .toolbar-inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.75);
}

#toolbar .toolbar-inline-control input {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'ABCDiatype', monospace;
  font-size: 12px;
}

#toolbar .toolbar-inline-control input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
}

#glitchButton.active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.45);
}

#imageControls {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.toolbar-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.toolbar-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0.85;
  gap: 10px;
}

.toolbar-control input[type="range"] {
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.toolbar-control input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.toolbar-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  margin-top: -5px;
}

.toolbar-control input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.toolbar-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: none;
  border-radius: 50%;
}

.toolbar-exports {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-exports button {
  padding-inline: 12px;
}

.control-hint {
  font-size: 11px;
  opacity: 0.55;
}

@media (max-width: 680px) {
  #toolbar {
    align-items: center;
  }

  .toolbar-control {
    min-width: 140px;
  }

  #toolbar .toolbar-link,
  #toolbar button {
    font-size: 11px;
    padding: 6px 8px;
  }
}
