.puzzle-captcha {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    font-family: inherit;
}

.puzzle-captcha__label {
    font-size: 0.875rem;
    color: #4b5563;
    font-weight: 500;
}

.puzzle-captcha__stage {
    position: relative;
    width: 320px;
    max-width: 100%;
    height: 180px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.puzzle-captcha__bg,
.puzzle-captcha__piece {
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

.puzzle-captcha__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.puzzle-captcha__piece {
    position: absolute;
    top: 0;
    left: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    transition: left 80ms linear;
}

.puzzle-captcha__track {
    position: relative;
    width: 320px;
    max-width: 100%;
    height: 40px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.puzzle-captcha__track-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: #dbeafe;
    transition: width 60ms linear;
}

.puzzle-captcha__handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #2563eb;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
    z-index: 2;
}

.puzzle-captcha__handle:active {
    cursor: grabbing;
}

.puzzle-captcha__handle--success {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
    cursor: default;
}

.puzzle-captcha__handle--error {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
}

.puzzle-captcha__hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 1;
}

.puzzle-captcha__status {
    min-height: 1.25rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.puzzle-captcha__status--success {
    color: #059669;
}

.puzzle-captcha__status--error {
    color: #dc2626;
}

.puzzle-captcha__refresh {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: color 120ms ease, border-color 120ms ease;
}

.puzzle-captcha__refresh:hover {
    color: #2563eb;
    border-color: #93c5fd;
}
