.human-check {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(4, 6, 9, 0.28);
  opacity: 1;
  transition: opacity 0.6s ease, background-color 0.6s ease;
}

body.human-check-pending {
  overflow: hidden !important;
}

body.human-check-pending > *:not(.human-check) {
  filter: blur(11px);
  transform: translateZ(0) scale(1.02);
  transition: filter 0.22s ease, transform 0.22s ease;
  will-change: filter, transform;
  backface-visibility: hidden;
  pointer-events: none !important;
  user-select: none;
}

body.human-check-releasing > *:not(.human-check) {
  filter: blur(0);
  transform: translateZ(0) scale(1);
  transition:
    filter 3s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.human-check-skip > *:not(.human-check) {
  transition-duration: 0.08s;
}

.human-check-turnstile {
  width: min(100%, 340px);
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.28s ease, transform 0.35s ease;
}

.human-check-turnstile iframe {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.34);
}

.human-check-turnstile.is-hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  pointer-events: none;
}

.human-check-success-animation {
  position: absolute;
  width: min(72vw, 310px);
  aspect-ratio: 1;
  opacity: 0;
  transform: translateZ(0) scale(0.7);
  contain: strict;
  will-change: transform, opacity;
}

.human-check-success-animation.is-visible {
  opacity: 1;
  transform: scale(1);
  animation: human-check-pop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.human-check-success-animation canvas,
.human-check-success-animation svg {
  width: 100% !important;
  height: 100% !important;
}

body.human-check-low-power .human-check-success-animation {
  width: min(64vw, 240px);
}

.human-check-status {
  position: absolute;
  left: 50%;
  top: calc(50% + 56px);
  width: min(82vw, 330px);
  margin: 0;
  color: #ff7474;
  text-align: center;
  font: 700 12px/1.35 Inter, Arial, sans-serif;
  transform: translateX(-50%);
}

.human-check.is-blocked .human-check-status {
  top: 50%;
  color: #ff8080;
  font-size: 14px;
  transform: translate(-50%, -50%);
}

.human-check.is-simple .human-check-status {
  top: calc(50% + 210px);
}

.human-check-actions {
  position: absolute;
  left: 50%;
  top: calc(50% + 86px);
  display: flex;
  gap: 8px;
  width: min(92vw, 360px);
  justify-content: center;
  transform: translateX(-50%);
}

.human-check-actions[hidden],
.human-check-simple-panel[hidden] {
  display: none;
}

.human-check-retry,
.human-check-simple,
.human-check-simple-submit,
.human-check-simple-new {
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #ff1d2f;
  font: 750 13px/1 Inter, Arial, sans-serif;
  cursor: pointer;
}

.human-check-retry {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.human-check-simple-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: min(92vw, 360px);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(14, 12, 17, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.human-check-simple-image {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
}

.human-check-simple-input {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: 800 18px/1 Inter, Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.human-check-simple-input:focus {
  border-color: #ff3345;
  box-shadow: 0 0 0 3px rgba(255, 29, 47, 0.16);
}

.human-check-simple-submit {
  border-radius: 12px;
}

.human-check-simple-new {
  grid-column: 1 / -1;
  min-height: 32px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.human-check.is-success {
  background: rgba(4, 6, 9, 0);
  transition: background-color 3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.human-check.is-releasing {
  opacity: 0;
  pointer-events: none;
}

@keyframes human-check-pop {
  0% { opacity: 0; transform: scale(0.7); }
  70% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body.human-check-pending > *:not(.human-check),
  .human-check,
  .human-check-turnstile {
    transition-duration: 0.15s;
  }
}
