:root {
  --bg: #000000;
  --panel: #1e1e1ecc;
  --border: #3c3c3c;
  --text: #d4d4d4;
  --accent: #4fc1ff;
  --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);
}

#mirror-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
  background: #000;
}

#fog-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#hand-debug-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

#debug-panel {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  width: 220px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

#debug-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

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

#debug-content {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity 0.15s ease;
}

body.debug-hidden #debug-content {
  display: none;
}

body.debug-hidden #hand-debug-canvas {
  opacity: 0;
}

.toggle-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #2d2d2d;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.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);
}

.meter-label {
  font-size: 0.7rem;
  color: #9d9d9d;
  display: flex;
  justify-content: space-between;
}

#volume-meter {
  position: relative;
  height: 10px;
  margin: 0.35rem 0 0;
  border-radius: 4px;
  background: #111;
  border: 1px solid var(--border);
  overflow: hidden;
}

#volume-meter-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
  transition: background-color 0.1s linear;
}

#volume-meter-fill.hot {
  background: var(--ok);
}

#volume-meter-threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--warn);
  left: 0%;
}

#pinch-value {
  color: var(--text);
}

#pinch-value.active {
  color: var(--ok);
  font-weight: 600;
}

#blow-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.15s ease-out;
}

#blow-flash.active {
  opacity: 0.85;
  transition: opacity 0.05s ease-in;
}

#countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(28vh, 220px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#countdown-overlay.active {
  opacity: 1;
}

#capture-bar {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

#capture-button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

#capture-button:hover {
  background: #ffffff;
}

#capture-button:active {
  transform: scale(0.92);
}

#capture-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

#capture-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
