*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.overlay[hidden] {
  display: none;
}

.overlay-content {
  max-width: 320px;
  text-align: center;
}

.camera-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  color: rgba(255, 255, 255, 0.85);
}

.camera-icon svg {
  width: 100%;
  height: 100%;
}

.overlay-content h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.overlay-content p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 28px;
}

#enable-camera {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 32px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#enable-camera:active {
  transform: scale(0.97);
  opacity: 0.9;
}

#enable-camera:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-message {
  margin-top: 16px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ff6b6b;
}

.error-message[hidden] {
  display: none;
}

.recording-indicator {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.recording-indicator[hidden] {
  display: none;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.record-btn {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.record-btn[hidden] {
  display: none;
}

.record-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.record-btn:not(:disabled):active {
  transform: translateX(-50%) scale(0.94);
}

.record-btn-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ff3b30;
  transition: border-radius 0.2s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

.record-btn.is-recording {
  background: rgba(255, 255, 255, 0.18);
}

.record-btn.is-recording .record-btn-inner {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #ff3b30;
}
