#stage {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

#video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

#title-overlay {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 60px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
  pointer-events: none;
  mix-blend-mode: difference;
  z-index: 5;
}

.title-line {
  font-weight: 500;
  margin-bottom: 2px;
}

.data-line {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  word-break: break-all;
  max-height: 3.6em;
  overflow: hidden;
}

#byte-counter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 110px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

#shutter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: rgba(255, 255, 255, 0.15);
  z-index: 6;
  transition: transform 80ms ease, background 120ms ease;
}

#shutter:active {
  transform: translateX(-50%) scale(0.94);
  background: rgba(255, 255, 255, 0.3);
}

#gallery-btn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  font-family: 'Archivo-Medium', 'Archivo-Variable', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.85);
  z-index: 6;
}

#gallery-btn:active {
  color: #fff;
}

#flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

#flash.on {
  opacity: 1;
  transition: opacity 100ms ease-out;
}

#error-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding: 24px;
  font-size: 14px;
  z-index: 20;
}
