.startertk-captcha-challenge {
  --startertk-captcha-accent: #2271b1;
  --startertk-captcha-accent-soft: color-mix(in srgb, var(--startertk-captcha-accent) 14%, transparent);
  --startertk-captcha-ink: #1d2327;
  --startertk-captcha-muted: #646970;
  --startertk-captcha-line: #e3e6ea;
  --startertk-captcha-soft: #f6f7f9;
  --startertk-captcha-success: #10b981;

  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  margin: 20px auto;
  padding: 20px 20px 18px;
  border: 1px solid var(--startertk-captcha-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.05);
  color: var(--startertk-captcha-ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.startertk-captcha-challenge {
  position: relative;
}

.startertk-captcha-challenge.is-validated > :not(.startertk-captcha-validated):not(.startertk-captcha-close) {
  opacity: 0.12;
  transition: opacity 0.25s ease;
}

.startertk-captcha-challenge .startertk-captcha-retry {
  max-width: 280px;
  margin: 0 auto 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.startertk-captcha-challenge *,
.startertk-captcha-challenge *::before,
.startertk-captcha-challenge *::after {
  box-sizing: border-box;
}

.startertk-captcha-challenge.is-solved {
  border-color: var(--startertk-captcha-success);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 185, 129, 0.1);
}

.startertk-captcha-challenge[hidden],
.startertk-captcha-challenge [hidden],
.startertk-captcha-preview[hidden] {
  display: none !important;
}

.startertk-captcha-challenge .startertk-captcha-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 4px;
  color: var(--startertk-captcha-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.startertk-captcha-challenge .startertk-captcha-instructions {
  max-width: 280px;
  margin: 0 auto 16px;
  color: var(--startertk-captcha-muted);
  font-size: 13px;
}

.startertk-captcha-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.startertk-captcha-challenge .startertk-captcha-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid var(--startertk-captcha-line);
  border-radius: 12px;
  background: var(--startertk-captcha-soft);
}

/* ——— Pattern ——— */

.startertk-captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  gap: 8px;
}

.startertk-captcha-challenge .startertk-captcha-grid button {
  appearance: none;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--startertk-captcha-line);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color: var(--startertk-captcha-ink);
  font: 600 14px/1 inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.startertk-captcha-challenge .startertk-captcha-grid button:hover {
  border-color: var(--startertk-captcha-accent);
}

.startertk-captcha-challenge .startertk-captcha-grid button:active {
  transform: scale(0.94);
}

.startertk-captcha-challenge .startertk-captcha-grid button.is-selected {
  border-color: var(--startertk-captcha-accent);
  background: var(--startertk-captcha-accent);
  color: #fff;
}

.startertk-captcha-challenge button:focus-visible,
.startertk-captcha-challenge input:focus-visible {
  outline: 2px solid var(--startertk-captcha-accent);
  outline-offset: 2px;
}

/* ——— Typed answer ——— */

.startertk-captcha-challenge .startertk-captcha-answer {
  display: block;
  max-width: 260px;
  margin: 22px auto 0;
  color: var(--startertk-captcha-muted);
  font-size: 12px;
  font-weight: 500;
}

.startertk-captcha-challenge .startertk-captcha-answer span {
  display: block;
  margin-bottom: 6px;
}

.startertk-captcha-challenge .startertk-captcha-answer input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--startertk-captcha-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05);
  color: var(--startertk-captcha-ink);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-align: center;
}

.startertk-captcha-answer-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.startertk-captcha-answer-row input {
  width: 100%;
}

.startertk-captcha-challenge .startertk-captcha-inline-confirm {
  appearance: none;
  display: grid;
  flex: none;
  place-items: center;
  width: 100%;
  height: 44px;
  margin: 10px 0 0;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--startertk-captcha-accent);
  box-shadow: none;
  color: #fff;
  font: 600 14px/1 inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.startertk-captcha-challenge .startertk-captcha-inline-confirm:hover {
  filter: brightness(1.06);
}

.startertk-captcha-challenge .startertk-captcha-inline-confirm:active {
  transform: scale(0.94);
}

.startertk-captcha-challenge .startertk-captcha-answer input:focus {
  border-color: var(--startertk-captcha-accent);
  box-shadow: 0 0 0 3px var(--startertk-captcha-accent-soft);
  outline: none;
}

.startertk-captcha-challenge .startertk-captcha-reset {
  appearance: none;
  margin: 10px auto 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--startertk-captcha-accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.startertk-captcha-challenge .startertk-captcha-reset:hover {
  background: var(--startertk-captcha-accent-soft);
}

/* ——— Puzzle ——— */

.startertk-captcha-puzzle {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.startertk-captcha-challenge .startertk-captcha-puzzle-background {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.startertk-captcha-challenge .startertk-captcha-puzzle-piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 15.7%;
  height: auto;
  margin: 0;
  border-radius: 3px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: left 0.08s linear;
}

.startertk-captcha-challenge .startertk-captcha-slider {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 8px;
  margin: 20px auto 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--startertk-captcha-soft);
  box-shadow: inset 0 0 0 1px var(--startertk-captcha-line);
  cursor: grab;
  -webkit-appearance: none;
  appearance: none;
}

.startertk-captcha-challenge .startertk-captcha-slider::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--startertk-captcha-accent);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.28);
  cursor: grab;
  -webkit-appearance: none;
  appearance: none;
}

.startertk-captcha-challenge .startertk-captcha-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--startertk-captcha-accent);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.28);
  cursor: grab;
}

/* ——— Bird ——— */

.startertk-captcha-sky {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 280 / 150;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #bfdffb 0%, #e3f1fd 65%, #f3f9fe 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.startertk-captcha-landscape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.startertk-captcha-cloud {
  position: absolute;
  width: 64px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.9;
  animation: startertk-captcha-drift 20s linear infinite;
}

.startertk-captcha-cloud::before,
.startertk-captcha-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.startertk-captcha-cloud::before {
  top: -12px;
  left: 12px;
  width: 26px;
  height: 26px;
}

.startertk-captcha-cloud::after {
  top: -8px;
  left: 30px;
  width: 20px;
  height: 20px;
}

.startertk-captcha-cloud-one {
  top: 22%;
  left: -25%;
}

.startertk-captcha-cloud-two {
  top: 68%;
  left: -25%;
  opacity: 0.7;
  transform: scale(0.75);
  animation-duration: 28s;
  animation-delay: -12s;
}

@keyframes startertk-captcha-drift {
  to {
    translate: 420px 0;
  }
}

.startertk-captcha-challenge .startertk-captcha-animal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  line-height: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
}

/* The animal wears the primary color: a darker shade for wing, tail and legs, a pale one for the belly. */
.startertk-captcha-animal-body {
  fill: var(--startertk-captcha-accent);
}

.startertk-captcha-animal-dark {
  fill: color-mix(in srgb, var(--startertk-captcha-accent) 72%, #000);
}

.startertk-captcha-cat-tail {
  stroke: color-mix(in srgb, var(--startertk-captcha-accent) 72%, #000);
}

.startertk-captcha-animal-light {
  fill: color-mix(in srgb, var(--startertk-captcha-accent) 16%, #fff);
}

/* The cat trots: its legs swing in two alternating pairs. */
.startertk-captcha-cat-leg {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: startertk-captcha-trot 0.3s ease-in-out infinite alternate;
}

.startertk-captcha-cat-leg-back {
  animation-direction: alternate-reverse;
}

@keyframes startertk-captcha-trot {
  from {
    transform: rotate(18deg);
  }

  to {
    transform: rotate(-18deg);
  }
}

.startertk-captcha-animal-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform 0.2s ease;
}

.startertk-captcha-animal.is-flying-left .startertk-captcha-animal-svg {
  transform: scaleX(-1);
}

.startertk-captcha-bird-wing {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: startertk-captcha-flap 0.26s ease-in-out infinite alternate;
}

@keyframes startertk-captcha-flap {
  to {
    transform: scaleY(-0.55);
  }
}

/* Caught: the animal bursts and vanishes. */
.startertk-captcha-challenge .startertk-captcha-animal.is-caught {
  pointer-events: none;
}

.startertk-captcha-animal.is-caught .startertk-captcha-bird-wing,
.startertk-captcha-animal.is-caught .startertk-captcha-cat-leg {
  animation: none;
}

.startertk-captcha-animal.is-caught .startertk-captcha-animal-svg {
  animation: startertk-captcha-vanish 0.45s ease forwards;
}

.startertk-captcha-animal.is-caught::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 3px solid #fff;
  border-radius: 50%;
  animation: startertk-captcha-poof 0.5s ease-out forwards;
}

@keyframes startertk-captcha-vanish {
  40% {
    opacity: 1;
    scale: 1.25;
  }

  100% {
    opacity: 0;
    scale: 0;
  }
}

@keyframes startertk-captcha-poof {
  from {
    opacity: 1;
    scale: 0.3;
  }

  to {
    opacity: 0;
    scale: 1.6;
  }
}


.startertk-captcha-message {
  text-align: center;
}

.startertk-captcha-preview .startertk-captcha-challenge {
  margin: 12px auto 4px;
}

/* Right answer: the confirmation shows in the middle of the challenge, or of the landscape for the catch. */
.startertk-captcha-validated {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.12);
  color: #047857;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: startertk-captcha-validated 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.15s both;
}

.startertk-captcha-validated svg {
  display: block;
  flex: none;
  color: var(--startertk-captcha-success);
}

@keyframes startertk-captcha-validated {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

/* ——— Dialog ——— */

html.startertk-captcha-locked {
  overflow: hidden;
}

.startertk-captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}

.startertk-captcha-modal[hidden] {
  display: none !important;
}

.startertk-captcha-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: startertk-captcha-fade 0.2s ease;
}

.startertk-captcha-modal .startertk-captcha-challenge {
  position: relative;
  margin: 0;
  padding-top: 26px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  animation: startertk-captcha-rise 0.24s ease;
}

.startertk-captcha-challenge .startertk-captcha-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--startertk-captcha-muted);
  cursor: pointer;
}

.startertk-captcha-challenge .startertk-captcha-close:hover {
  background: var(--startertk-captcha-soft);
  color: var(--startertk-captcha-ink);
}





.startertk-captcha-challenge.is-shaking {
  animation: startertk-captcha-shake 0.35s ease;
}

@keyframes startertk-captcha-fade {
  from {
    opacity: 0;
  }
}

@keyframes startertk-captcha-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes startertk-captcha-shake {
  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .startertk-captcha-backdrop,
  .startertk-captcha-modal .startertk-captcha-challenge,
  .startertk-captcha-challenge.is-shaking,
  .startertk-captcha-validated {
    animation: none;
  }

  .startertk-captcha-cloud,
  .startertk-captcha-bird-wing,
  .startertk-captcha-cat-leg,
  .startertk-captcha-animal.is-caught::after {
    animation: none;
  }

  .startertk-captcha-animal.is-caught .startertk-captcha-animal-svg {
    animation: none;
    opacity: 0;
  }
}
