* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0b0b0d;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f5f5f7;
}

#app {
  position: fixed;
  inset: 0;
  background: #000;
}

#camera {
  display: none;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-prompt {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.status {
  padding: 10px 18px;
  background: rgba(15, 15, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
  pointer-events: none;
  text-align: center;
  max-width: 84vw;
}

.camera-prompt.hidden {
  opacity: 0;
  pointer-events: none;
}

.camera-button {
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.camera-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.fps {
  font-size: 11px;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
}

.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.15) 70%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dock-label {
  margin: 0;
  font-size: 12.5px;
  opacity: 0.75;
  letter-spacing: 0.01em;
}

.swatches {
  display: flex;
  gap: 14px;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--swatch-color);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.swatch .name {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.swatch:active .chip {
  transform: scale(0.92);
}

.swatch.active .chip {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: scale(1.06);
}

.swatch.active .name {
  opacity: 1;
  font-weight: 600;
}

@media (min-width: 720px) {
  .chip { width: 60px; height: 60px; border-radius: 16px; }
  .dock-label { font-size: 13.5px; }
}
