:root {
  --bg: #0b0e14;
  --panel: #131823;
  --panel-border: #232b3d;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(19, 24, 35, 0.9);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #10b981);
  box-shadow: 0 0 12px #6366f1;
}
.brand h1 { font-size: 1.25rem; letter-spacing: 1px; font-weight: 800; }
.badge {
  font-size: 0.7rem; padding: 3px 8px; border-radius: 999px;
  background: rgba(99, 102, 241, 0.18); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4);
}
.status-pill {
  font-size: 0.8rem; color: var(--muted);
  background: #1a2130; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--panel-border);
}

.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px;
  flex: 1;
}

.hero { text-align: center; margin-bottom: 28px; }
.hero h2 { font-size: 1.85rem; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 0.95rem; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #1e293b;
  color: var(--muted);
}
.tag.accent { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #07090e;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e2638;
  display: flex;
  align-items: center;
  justify-content: center;
}

video, canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

.upload-zone {
  border: 2px dashed #334155;
  border-radius: 12px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  position: relative;
}
.upload-zone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.upload-zone img { width: 100%; height: 190px; object-fit: cover; border-radius: 8px; }
#uploadPrompt { display: flex; flex-direction: column; gap: 6px; }
#uploadPrompt span { font-size: 0.78rem; color: var(--muted); }

.presets { margin-top: 14px; }
.preset-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-btn {
  background: #1e2536; border: 1px solid var(--panel-border); color: var(--text);
  padding: 7px 6px; border-radius: 8px; font-size: 0.78rem; cursor: pointer;
}
.preset-btn:hover { border-color: var(--primary); }

.controls { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.btn {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none;
  transition: opacity 0.2s, background 0.2s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.secondary { background: #1e293b; color: #fff; border: 1px solid #334155; }
.btn.outline { background: transparent; color: #cbd5e1; border: 1px solid #334155; }

.metrics {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--panel-border);
}

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; }
}
