:root {
  --bg: #030812;
  --panel: rgba(7, 18, 33, .82);
  --panel-2: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.15);
  --text: #f6f9fd;
  --muted: #93a6bb;
  --blue: #16488f;
  --blue-2: #2d79e8;
  --yellow: #fcde07;
  --shadow: 0 28px 80px rgba(0,0,0,.48);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(45,121,232,.22), transparent 28%),
    radial-gradient(circle at 96% 18%, rgba(252,222,7,.07), transparent 22%),
    linear-gradient(180deg, #07182c 0%, #030812 54%, #02060d 100%);
  overflow-x: hidden;
}
body.camera-open { overflow: hidden; }
button, input { font: inherit; }
button, label, summary { -webkit-tap-highlight-color: transparent; }

.page-glow { position: fixed; border-radius: 50%; filter: blur(110px); pointer-events: none; opacity: .28; }
.page-glow-a { width: 320px; height: 320px; top: -100px; left: -80px; background: rgba(45,121,232,.3); }
.page-glow-b { width: 260px; height: 260px; top: 220px; right: -90px; background: rgba(252,222,7,.1); }

.app-shell { position: relative; z-index: 1; width: min(720px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--yellow); color: #061526; font-weight: 900; box-shadow: 0 14px 34px rgba(252,222,7,.15); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.privacy-pill { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: #dce7f4; font-size: 11px; }

.workspace { display: grid; gap: 16px; }
.intro { text-align: center; padding: 2px 18px 6px; }
.eyebrow { color: var(--yellow); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.intro h1 { margin: 8px 0 6px; font-size: clamp(32px, 8vw, 54px); line-height: .98; letter-spacing: -.055em; }
.intro p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.editor-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.editor-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 4px 12px; }
.editor-topline > div { display: grid; gap: 3px; }
.editor-topline strong { font-size: 14px; }
.editor-topline span { color: var(--muted); font-size: 11px; }
.zoom-badge { min-width: 58px; padding: 8px 10px; text-align: center; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #e8f1fb !important; font-weight: 700; }

.stage-wrap { position: relative; width: min(100%, 470px); aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden; border-radius: 22px; background: #02070d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 20px 56px rgba(0,0,0,.45); touch-action: none; }
#stage { display: block; width: 100%; height: 100%; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; padding: 30px; background: linear-gradient(180deg, rgba(7,31,58,.52), rgba(2,7,13,.76)); pointer-events: none; }
.empty-state strong { font-size: 20px; letter-spacing: -.03em; }
.empty-state span { color: var(--muted); font-size: 12px; }
.face-guide { width: 34%; aspect-ratio: .78; margin-bottom: 10px; border: 2px dashed rgba(255,255,255,.36); border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.04); }
.working-badge { position: absolute; top: 50%; left: 50%; translate: -50% -50%; z-index: 5; padding: 11px 13px; border-radius: 999px; background: rgba(0,0,0,.72); color: white; font-size: 11px; }
.hidden { display: none !important; }

.source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; padding: 0 15px; cursor: pointer; text-decoration: none; font-weight: 750; transition: transform .16s ease, opacity .16s ease, border-color .16s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .36; cursor: not-allowed; }
.button-primary { color: white; background: linear-gradient(135deg, var(--blue-2), var(--blue)); box-shadow: 0 10px 24px rgba(45,121,232,.18); }
.button-secondary { color: white; background: rgba(255,255,255,.045); border: 1px solid var(--line-strong); }
.button-yellow { color: #061526; background: var(--yellow); }
.button-ghost { color: white; background: transparent; border: 1px solid var(--line-strong); }
.button-icon { font-size: 16px; line-height: 1; }

.adjustments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.adjustments.disabled { opacity: .4; pointer-events: none; }
.control-block { padding: 13px 14px; border-radius: 18px; border: 1px solid rgba(255,255,255,.055); background: var(--panel-2); }
.compact-control { margin-top: 10px; }
.control-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.control-label label { color: #dfeaf7; font-size: 12px; font-weight: 650; }
.control-label strong { font-size: 12px; }
input[type="range"] { width: 100%; accent-color: var(--yellow); }
.gesture-tip { margin: 12px 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.45; }
.final-actions { display: grid; grid-template-columns: .85fr 1fr 1fr; gap: 9px; }

.more-info { border: 1px solid var(--line); background: rgba(7,18,33,.48); border-radius: 18px; overflow: hidden; }
.more-info summary { list-style: none; cursor: pointer; padding: 15px 17px; color: #dce7f4; font-size: 12px; font-weight: 650; }
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::after { content: '+'; float: right; color: var(--yellow); font-size: 16px; line-height: 1; }
.more-info[open] summary::after { content: '–'; }
.more-info-content { padding: 0 17px 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.more-info-content p { margin: 0 0 8px; }
.more-info-content p:last-child { margin-bottom: 0; }

footer { display: flex; justify-content: space-between; gap: 14px; padding: 0 4px; color: #667b92; font-size: 10px; }

.camera-modal { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: #00070f; }
.camera-topbar { min-height: 62px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; background: rgba(3,8,18,.96); border-bottom: 1px solid rgba(255,255,255,.07); }
.camera-topbar strong { justify-self: center; font-size: 14px; }
.camera-text-button { border: 0; background: transparent; color: white; padding: 8px 0; font-weight: 650; }
.camera-topbar .camera-text-button:last-child { justify-self: end; }
.camera-viewport { position: relative; min-height: 0; overflow: hidden; display: grid; place-items: center; background: #000; touch-action: none; }
.camera-viewport video { width: 100%; height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; }
.camera-guide { position: absolute; left: 50%; top: 43%; translate: -50% -50%; width: min(42vw, 210px); aspect-ratio: .78; border: 2px solid rgba(255,255,255,.58); border-radius: 50%; pointer-events: none; }
.camera-help { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; white-space: nowrap; padding: 8px 11px; border-radius: 999px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.08); color: #e9f1fa; font-size: 10px; pointer-events: none; }
.camera-controls { padding: 14px 18px max(18px, env(safe-area-inset-bottom)); background: rgba(3,8,18,.98); border-top: 1px solid rgba(255,255,255,.07); display: grid; justify-items: center; gap: 14px; }
.camera-zoom-row { width: min(520px, 100%); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.camera-zoom-row label, .camera-zoom-row strong { font-size: 12px; color: #dfe9f4; }
.capture-button { width: 78px; height: 78px; border: 4px solid white; border-radius: 50%; padding: 5px; background: rgba(255,255,255,.16); }
.capture-button span { display: block; width: 100%; height: 100%; border-radius: inherit; background: white; }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 16px, 720px); padding-top: 10px; }
  .topbar { margin-bottom: 16px; }
  .privacy-pill { display: none; }
  .intro { padding-inline: 12px; }
  .editor-card { padding: 9px; border-radius: 22px; }
  .editor-topline { padding: 3px 3px 10px; }
  .stage-wrap { width: 100%; border-radius: 17px; }
  .source-actions { grid-template-columns: 1fr 1fr; }
  .final-actions { grid-template-columns: 1fr 1fr; }
  .final-actions .button-ghost { grid-column: 1 / -1; order: 3; }
}
