:root {
  --bg: #000000;
  --panel: #1e1e1ecc;
  --border: #3c3c3c;
  --text: #d4d4d4;
  --ok: #4ec9b0;
  --warn: #ce9178;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

#neon-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
}

#webcam-preview-box {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

#webcam-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#status-bar {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
}

#brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.status-pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #2d2d2d;
  border: 1px solid var(--border);
  color: var(--text);
}

.status-pill.ok {
  color: var(--ok);
  border-color: var(--ok);
}

.status-pill.error {
  color: var(--warn);
  border-color: var(--warn);
}

#gesture-panel {
  position: fixed;
  top: 4.2rem;
  left: 1rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: min(90vw, 30rem);
}

.gesture-row {
  color: #8a8a8a;
  transition: color 0.1s ease;
}

.gesture-row.active {
  color: #ff5c85;
  font-weight: 600;
}

#color-picker {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.color-swatch {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch-color, #fff);
  box-shadow: 0 0 6px var(--swatch-color, #fff);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: #fff;
  transform: scale(1.2);
}

#color-custom {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

#color-custom.active {
  border-color: #fff;
  transform: scale(1.2);
}

#color-custom::-webkit-color-swatch-wrapper {
  padding: 0;
}

#color-custom::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

#clear-button {
  position: fixed;
  top: 3.7rem;
  right: 1rem;
  z-index: 10;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  color: #ff6b8a;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

#clear-button:hover {
  background: #ff1258;
  border-color: #ff1258;
  color: #fff;
  transform: scale(1.04);
}

#clear-button:active {
  transform: scale(0.97);
}
