:root {
  --ink: #0a0a0f;
  --paper: #ffffff;
  --text: #1a1a1a;
  --body: #4a4a4a;
  --muted: #6a6a6a;
  --faint: #9a9896;
  --line: #eaeaea;
  --row: #f0f0f0;
  --panel: #fafafa;
  --pink: #da2668;
  --cream: #f5f4f1;
  --soft: #c8c6c4;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

button, p, h1 { margin: 0; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 7px;
  background: var(--pink);
  flex-shrink: 0;
}

.disclaimer {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: right;
}

main {
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}

h1 {
  margin-top: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 40px;
  color: var(--ink);
}

.lead {
  margin-top: 10px;
  max-width: 640px;
  font-size: 15px;
  line-height: 22px;
  color: var(--body);
}

.stage {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 334px;
  gap: 16px;
  align-items: start;
}

.video-card {
  position: relative;
  min-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
}

.video-card video,
.video-card canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.video-card video {
  object-fit: cover;
  background: var(--ink);
}

.video-card canvas {
  pointer-events: none;
}

.vid-id,
.vid-fps,
.vid-note {
  position: absolute;
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--paper);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.vid-id { top: 16px; left: 16px; }
.vid-fps { top: 16px; right: 16px; letter-spacing: 0.04em; }
.vid-note {
  left: 16px;
  bottom: 16px;
  font-weight: 500;
  color: var(--soft);
}

.empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(420px 420px at 72% 18%, rgba(218, 38, 104, 0.38), transparent 70%),
    var(--ink);
}

.empty[hidden] { display: none; }

.constellation { width: 168px; height: auto; }

#start {
  appearance: none;
  border: 0;
  background: var(--pink);
  color: var(--paper);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
}

#start:hover { background: #c4215c; }
#start:disabled { opacity: 0.55; cursor: progress; }

.empty-msg {
  max-width: 280px;
  text-align: center;
  font-size: 13px;
  line-height: 18px;
  color: var(--cream);
}

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

.pose {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 14px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.pose-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.pose-hand { width: 64px; height: auto; }
.pose-arrow { width: 28px; height: auto; flex-shrink: 0; }
.pose-cam { width: 48px; height: auto; flex-shrink: 0; }

.pose-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}

.pose-copy {
  font-size: 13px;
  line-height: 18px;
  color: var(--body);
  text-align: center;
}

.panel-head,
.rule,
.time-row,
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.state {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: var(--pink);
  text-align: right;
}

.state.fail { color: var(--text); }

.rule {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--row);
}

.rule-name,
.time-row p:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text);
}

.mark {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  line-height: 18px;
  color: var(--text);
}

.mark.plain { visibility: hidden; }
.mark.off { color: var(--faint); }

.num {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.time-row { padding-top: 2px; }

.result {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ink);
}

.result p:first-child {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 26px;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.result-meta {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 18px;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
}

.caption {
  margin-top: 16px;
  max-width: 820px;
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
}

.foot {
  margin-top: 28px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .page { padding: 0 20px 24px; }
  .top { align-items: flex-start; flex-direction: column; gap: 8px; }
  .disclaimer { text-align: left; }
  h1 { font-size: 32px; line-height: 36px; }
  .stage { grid-template-columns: 1fr; }
  .video-card { min-height: 420px; }
}
