:root {
  --bg: #0b0d10;
  --surface: #151920;
  --surface-2: #1d222b;
  --line: #2a313c;
  --text: #eef1f5;
  --muted: #8b95a3;
  --green: #34d27b;
  --green-soft: rgba(52, 210, 123, 0.16);
  --white: #ffffff;
  --tick: #3a424e;
  --accent: #7cc4ff;
  --danger: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.01em; }
.screen.center { display: flex; flex-direction: column; align-items: center; text-align: center; min-height: calc(100dvh - 72px); justify-content: center; }
[hidden] { display: none !important; }

.lead { color: var(--muted); margin: 0 0 20px; }
.tips { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; text-align: left; }
.tips li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tips li::before { content: "•"; color: var(--green); margin-right: 8px; }
.notice { font-size: 13px; color: var(--muted); max-width: 440px; margin: 0 0 24px; }

button { font: inherit; cursor: pointer; }
.primary {
  background: var(--green); color: #04130a; border: 0; border-radius: 999px;
  padding: 14px 36px; font-weight: 700; font-size: 16px; min-width: 200px;
}
.primary:disabled { opacity: 0.6; cursor: progress; }
.secondary {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.secondary:hover { border-color: var(--green); }
.secondary.copied { border-color: var(--green); color: var(--green); }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; }

/* Capture stage: video circle (72% of the ring box) under the SVG ring. */
.stage { position: relative; width: min(88vw, 440px, 62dvh); aspect-ratio: 1; }
.stage video {
  position: absolute; inset: 14%; width: 72%; height: 72%;
  object-fit: cover; border-radius: 50%; transform: scaleX(-1); background: #000;
}
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tick { stroke: var(--tick); stroke-width: 3.2; stroke-linecap: round; transition: stroke 0.15s; }
.tick.target { stroke: #566070; }
.tick.lit { stroke: var(--white); }
.tick.done { stroke: var(--green); }
.ring-inner { fill: none; stroke: transparent; stroke-width: 3; transition: stroke 0.3s; }
.ring-inner.active { stroke: rgba(255, 255, 255, 0.25); }
.ring-inner.done { stroke: var(--green); }
.ring-label {
  fill: var(--green); font-size: 15px; font-weight: 700; opacity: 0; transition: opacity 0.3s;
}
.ring-label.show { opacity: 1; }
.ring-arrow { fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ring-arrow.show { animation: nudge 1.1s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.95; } }

.hint { font-size: 18px; font-weight: 600; margin: 18px 0 10px; min-height: 1.6em; transition: color 0.2s; }
.hint.good { color: var(--green); }
.chips { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 10px; flex-wrap: wrap; justify-content: center; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.chips li.active { border-color: var(--white); color: var(--text); }
.chips li.done { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.pose { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin: 0 0 6px; min-height: 1.4em; }

/* Result */
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.upload { margin: 0; font-size: 13px; color: var(--muted); }
.upload.ok { color: var(--green); }
.upload.err { color: var(--danger); }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.card span { color: var(--muted); font-size: 12px; }
.card strong { font-size: 18px; }
.result-grid { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: 16px; align-items: start; }
.mockup-wrap { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 16px; }
.mockup-wrap svg { width: 100%; height: auto; max-height: 70dvh; display: block; }
.mockup-wrap figcaption { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: center; }
.mk-oval { fill: var(--surface-2); stroke: #6b7686; stroke-width: 0.8; }
.mk-feature { fill: none; stroke: #9aa5b4; stroke-width: 0.7; stroke-linejoin: round; stroke-linecap: round; }
.mk-iris { fill: #9aa5b4; }
.mk-dim line { stroke: var(--accent); stroke-width: 0.45; }
.mk-dim .mk-guide, .mk-dims > .mk-guide { stroke: var(--line); stroke-dasharray: 1 1; stroke-width: 0.35; }
.mk-text { fill: var(--accent); font-size: 3.4px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 0.9px; }
.mk-dim.hl line { stroke: var(--green); stroke-width: 0.8; }
.mk-dim.hl .mk-text { fill: var(--green); font-size: 4.2px; }
.mk-dim { cursor: default; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.features { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.features th, .features td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.features thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.features thead th small { display: block; font-weight: 400; font-size: 11px; }
.features tbody th { text-align: left; font-weight: 500; }
.features .unit { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }
.features th:first-child { text-align: left; }
.features tr.group th { background: var(--bg); color: var(--green); font-size: 12px; font-weight: 700; padding-top: 10px; }
.features td.merged, .features th.merged { color: var(--text); font-weight: 700; background: rgba(124, 196, 255, 0.06); }
.features tbody tr[data-key]:hover, .features tr.hl { background: var(--green-soft); }
.features tbody td { color: var(--muted); }

.disclaimer { color: var(--muted); font-size: 12px; margin: 16px 0 24px; }
#result > .primary { display: block; margin: 0 auto; }

@media (max-width: 820px) {
  .result-grid { grid-template-columns: 1fr; }
  .mockup-wrap { position: static; }
  .summary { grid-template-columns: repeat(2, 1fr); }
}
