.jigsaw-modal-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.jigsaw-modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    z-index: 1000;
    width: min(95vw, 440px);
    max-width: 440px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
}

.jigsaw-captcha-container {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.jigsaw-modal-close {
    width: 48px;
    height: 48px;
    background: #eee;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 36px;
}

.jigsaw-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    transition: color 0.3s;
}

.jigsaw-title.error {
    color: #ff4444;
}

#jigsaw-image-container {
    width: 100%;
    aspect-ratio: 2/1;
    position: relative;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    overflow: hidden;
}

#jigsaw-base-image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:root {
    --gap-x: -1000px;
    --gap-y: -1000px;
    --gap-size: 50px;
}

#jigsaw-base-image::after {
    content: "";
    position: absolute;
    background: rgba(0,0,0,0.3);
    border: 1px solid white;
    pointer-events: none;
    left: var(--gap-x, -1000px);
    top: var(--gap-y, -1000px);
    width: var(--gap-size, 50px);
    height: var(--gap-size, 50px);
}

#jigsaw-gap-image {
    position: absolute;
    left: 0;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    cursor: grab;
    border: 3px solid white;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.jigsaw-slider-container {
    position: relative;
    height: 50px;
    background: #eee;
    border-radius: 25px;
    margin: 15px 0;
}

.jigsaw-slider-bg-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 50px;
    color: #999;
    font-size: 14px;
    user-select: none;
    pointer-events: none;
}

#jigsaw-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    background: #ffffff;
    border-radius: 25px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid #ddd;
    z-index: 1;
}

#jigsaw-slider::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-30%, -50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid #999;
}

#jigsaw-slider.disabled {
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #ddd;
}

.jigsaw-refresh-btn {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.jigsaw-refresh-btn:disabled {
    background: #90caf9;
    cursor: not-allowed;
}