:root {
  --ink: #1a2430;
  --muted: #3d4d5c;
  --high: #0c7a62;
  --moderate: #8a5a12;
  --low: #a1263a;
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --edge: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 50px rgba(48, 72, 96, 0.16);
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Golos Text", "Liberation Sans", sans-serif;
  font-size: 1.05rem;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(255, 255, 255, 0.95), transparent 55%),
    radial-gradient(700px 480px at 100% 0%, #b7e7dc 0%, transparent 50%),
    radial-gradient(800px 600px at 70% 110%, #c9d7f2 0%, transparent 46%),
    #d5e3ee;
}

header,
main {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

header,
.stage-wrap,
.result {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.status {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
  max-width: 28ch;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
  gap: 1rem;
  align-items: start;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.stage-wrap { padding: 0.85rem; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(18, 28, 38, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #121c26;
}

.tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  margin: 0;
  padding: 0.28rem 0.6rem;
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  font-size: 0.95rem;
}

.actions { margin-top: 0.7rem; }

.mirror {
  margin: 0.7rem 0.2rem 0;
  color: var(--muted);
  line-height: 1.45;
}

.steps {
  list-style: none;
  margin: 0.8rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.steps li {
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 180ms ease;
}

.steps li.current {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.steps strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  max-width: 68ch;
  line-height: 1.5;
}

.steps li:not(.current) p { color: var(--muted); }

.steps li.done strong::after {
  content: ", снято";
  font-weight: 500;
  color: var(--high);
}

.challenge {
  margin: 0.1rem 0.2rem 0.8rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

button.primary,
button.secondary {
  width: 100%;
  border: 1px solid var(--edge);
  border-radius: 16px;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

button.primary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 #fff;
}

button.secondary {
  margin-top: 0.45rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
}

button.primary:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  cursor: wait;
}

button.text {
  display: inline;
  width: auto;
  margin-left: 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0c5f86;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid #0c5f86;
  outline-offset: 3px;
}

.shots,
.faces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.shots { margin-top: 0.9rem; }

figure { margin: 0; }

.shots img,
.faces img {
  width: 100%;
  display: block;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
}

figcaption {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.result {
  position: sticky;
  top: 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
  scroll-margin-top: 0.75rem;
  transition: background 220ms ease;
}

.result:focus { outline: none; }

.result.revealed {
  background: var(--glass-strong);
}

.score-label {
  margin: 0;
  color: var(--muted);
}

.score {
  margin: 0.1rem 0 0;
  font-size: 4.6rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.score.empty {
  margin-top: 0.35rem;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.score.high { color: var(--high); }
.score.moderate { color: var(--moderate); }
.score.low { color: var(--low); }

.cosine,
.message,
.crop-note,
.checks {
  color: var(--muted);
  line-height: 1.5;
  max-width: 36ch;
}

.cosine { margin: 0.55rem 0 0; min-height: 1.2em; }
.message { margin: 0.75rem 0 0; color: var(--ink); }
.checks {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.checks li {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.checks li.ok { color: var(--high); }
.checks li.bad { color: var(--low); }
.crop-note { margin: 0.8rem 0 0; }
.faces { margin-top: 1rem; }

@media (max-width: 860px) {
  header { flex-direction: column; align-items: start; }
  .status { text-align: left; max-width: 46ch; }
  main { grid-template-columns: 1fr; }
  .result { position: static; }
  main { padding-bottom: 70vh; }
  h1 { font-size: 1.35rem; white-space: normal; }
  .score { font-size: 3.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .steps li,
  .result { transition: none; }
}
