:root {
  color-scheme: light dark;
  --bg: #0d1117;
  --panel: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #72b7ff;
  --border: #30363d;
  --danger: #ff6b6b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #05080f;
  display: flex;
}

.fullscreen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.status {
  margin: 0;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  text-align: center;
}

.status[data-tone="error"] {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffc6c6;
}

.status[data-tone="success"] {
  border-color: rgba(111, 218, 255, 0.5);
  color: #c7ecff;
}

.preview {
  min-width: 0;
  width: min(96vw, 960px);
}

.preview-area {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 30%, rgba(114, 183, 255, 0.08), transparent 35%), #0d1117;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.preview-area canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder {
  text-align: center;
  color: var(--muted);
  padding: 16px;
}

.microcopy {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.controls-floating {
  position: absolute;
  inset: auto 0 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  pointer-events: none;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 420px;
}

.control-btn {
  pointer-events: all;
  cursor: pointer;
  height: 44px;
  min-width: 80px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-weight: 600;
  transition: transform 120ms ease, opacity 120ms ease;
}

.control-btn.ghost {
  background: rgba(0, 0, 0, 0.25);
}

.control-btn.capture {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
}

.control-btn.small {
  height: 38px;
  min-width: 90px;
  padding: 0 12px;
  border-radius: 10px;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .fullscreen {
    padding: 8px;
  }

  .preview {
    width: 100vw;
  }

  .preview-area {
    aspect-ratio: 9 / 16;
    border-radius: 20px;
  }

  .controls-row {
    max-width: 320px;
    gap: 12px;
  }

  .control-btn.capture {
    width: 68px;
    height: 68px;
    min-width: 68px;
  }
}

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), rgba(13, 17, 23, 0.85));
  backdrop-filter: blur(4px);
  z-index: 2;
}

.loader.hidden {
  display: none;
}

.loader-logo {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
}

.loader-text {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: #72b7ff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

