#viz-host {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--viz-opacity, 0.88);
  background: #000;
}

#viz-host.is-disabled {
  opacity: 0;
  visibility: hidden;
}

#viz-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

#viz-host .viz-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Lato, sans-serif;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 16px;
}

#viz-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: Lato, sans-serif;
}

.viz-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.viz-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
}

.viz-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.viz-thumb-track {
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 22px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.15s ease;
  cursor: pointer;
}

.viz-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c78dff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.viz-toggle:checked + .viz-thumb-track {
  background: rgba(139, 172, 15, 0.35);
  border-color: #8bac0f;
}

.viz-toggle:checked + .viz-thumb-track .viz-thumb {
  transform: translateX(20px);
  background: #eaee09;
}

.viz-toggle:focus-visible + .viz-thumb-track {
  outline: 2px solid #eaee09;
  outline-offset: 2px;
}

.viz-btn {
  font-family: Lato, sans-serif;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
}

.viz-btn:hover:not(:disabled) {
  border-color: #8bac0f;
  color: #eaee09;
}

.viz-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.viz-pack-select,
.viz-preset-select {
  font-family: Lato, sans-serif;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
}

.viz-pack-select {
  min-width: 138px;
  max-width: min(220px, calc(100vw - 112px));
}

.viz-preset-select {
  min-width: 160px;
  max-width: min(360px, calc(100vw - 80px));
}

.viz-pack-select:focus-visible,
.viz-preset-select:focus-visible {
  outline: 2px solid #eaee09;
  outline-offset: 2px;
}

.viz-pack-select:disabled,
.viz-preset-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.viz-opacity {
  width: 88px;
  accent-color: #8bac0f;
}

.viz-error {
  font-size: 0.7rem;
  color: #ff8a8a;
  max-width: 200px;
  text-align: right;
}

@media (max-width: 480px) {
  #viz-controls {
    top: 8px;
    right: 8px;
  }

  .viz-opacity {
    width: 72px;
  }
}
