.auth-puzzle {
  width: min(24rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--color-border, #31433e);
  border-radius: 1rem;
  background: #181b20;
  color: var(--color-fg, #eee);
  box-shadow: 0 1rem 3rem #0008;
  font-size: .875rem;
  color-scheme: dark;
  opacity: 0;
  transform: translateY(4px) scale(.985);
  transition: opacity 160ms, transform 160ms, display 160ms allow-discrete, overlay 160ms allow-discrete;
}

.auth-puzzle[open] { opacity: 1; transform: none; }
.auth-puzzle::backdrop {
  background: #04070bd1;
  opacity: 0;
  transition: opacity 160ms, display 160ms allow-discrete, overlay 160ms allow-discrete;
}
.auth-puzzle[open]::backdrop { opacity: 1; }

@starting-style {
  .auth-puzzle[open] { opacity: 0; transform: translateY(4px) scale(.985); }
  .auth-puzzle[open]::backdrop { opacity: 0; }
}

.auth-puzzle-header,
.auth-puzzle-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.auth-puzzle-header { margin-bottom: .75rem; }
.auth-puzzle-header h2 { font-size: 1.125rem; font-weight: 600; }
.auth-puzzle-header button {
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: .5rem;
  background: #ffffff0c;
  font-size: 1.25rem;
  line-height: 1;
}
.auth-puzzle-image { position: relative; overflow: hidden; border-radius: .4rem; }
.auth-puzzle-image[hidden] { display: none; }
.auth-puzzle-image img { display: block; width: 100%; height: auto; }
.auth-puzzle-image img:last-child {
  position: absolute;
  filter: drop-shadow(0 0 1px #e1fff7) drop-shadow(0 1px 2px #172423);
  pointer-events: none;
}

.auth-puzzle label { display: block; margin-top: .65rem; }
.auth-puzzle input {
  display: block;
  width: 100%;
  margin-block: .2rem;
  min-height: 2rem;
  accent-color: var(--color-accent, #48e0aa);
  cursor: ew-resize;
}
.auth-puzzle-footer { min-height: 2rem; }
.auth-puzzle-footer span { color: var(--color-fg-dim, #a3b7b0); }
.auth-puzzle-footer button {
  flex: 0 0 auto;
  min-height: 2rem;
  color: var(--color-accent, #48e0aa);
}
.auth-puzzle button {
  transition: opacity 150ms, transform 150ms;
}
.auth-puzzle button:disabled { opacity: .5; }
.auth-puzzle button:active { transform: scale(.96); }
.auth-puzzle :is(button, input):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .auth-puzzle, .auth-puzzle::backdrop, .auth-puzzle button { transition: none; }
}
