:root {
  --bg-a: #0b1021;
  --bg-b: #162444;
  --ink: #f3f7ff;
  --panel: #121a35;
  --good: #44f2c3;
  --muted: #b2bedf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 16%, #2b4f98 0%, transparent 35%),
    radial-gradient(circle at 84% 82%, #1c7ca0 0%, transparent 33%),
    linear-gradient(140deg, var(--bg-a), var(--bg-b));
}

.layout {
  width: min(980px, calc(100% - 1.2rem));
  margin: 1rem auto;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1.1fr 0.9fr;
}

.panel {
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  border: 1px solid rgba(162, 211, 255, 0.4);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  backdrop-filter: blur(8px);
}

.camera-wrap {
  position: relative;
  min-height: 58vh;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.progress {
  margin: 0;
  color: #c7d6ff;
  font-weight: 600;
  font-size: 0.92rem;
}

.focus {
  display: grid;
  align-content: center;
  gap: 0.35rem;
}

.step-title {
  margin: 0.15rem 0 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  line-height: 0.94;
  font-size: clamp(3rem, 9vw, 5.3rem);
}

.step-prompt {
  margin: 0;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: #deebff;
  font-weight: 600;
}

.debug {
  margin: 0.4rem 0 0;
  min-height: 1.4rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
}

.link-btn,
.primary-btn {
  text-decoration: none;
  border-radius: 10px;
  padding: 0.56rem 0.86rem;
  font-weight: 700;
}

.link-btn {
  border: 1px solid rgba(197, 221, 255, 0.44);
  color: var(--ink);
}

.primary-btn {
  background: linear-gradient(120deg, #44d7ff, #e45fff);
  color: #0f1327;
}

.primary-btn.disabled {
  pointer-events: none;
  filter: grayscale(0.55) brightness(0.78);
}

.camera-wrap {
  border-radius: 20px;
}

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

.step-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(4.2rem, 15vw, 8rem);
  line-height: 1;
  color: #6cff9e;
  text-shadow:
    0 0 20px rgba(45, 246, 138, 0.5),
    0 0 50px rgba(65, 255, 161, 0.35);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  z-index: 4;
}

.step-check.show {
  animation: check-pop 620ms ease-out forwards;
}

@keyframes check-pop {
  0% {
    opacity: 0;
    transform: scale(0.56);
  }

  24% {
    opacity: 1;
    transform: scale(1.07);
  }

  58% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

.cursor {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 999px;
  border: 2px solid #f8e6ff;
  background: rgba(201, 147, 255, 0.38);
  box-shadow: 0 0 0 8px rgba(138, 222, 255, 0.2);
  pointer-events: none;
  z-index: 3;
}

.cursor.hidden {
  opacity: 0;
}

.ok {
  color: var(--good);
}

@media (max-width: 840px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .camera-wrap {
    min-height: 44vh;
  }

  .focus {
    padding-top: 0.9rem;
  }
}
