* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Captcha Screen Styles */
.captcha-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #4285F4;
}

.checkbox-container label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.recaptcha-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    color: #555;
}

.logo-text span:first-child {
    font-weight: 600;
    font-size: 11px;
    color: #333;
}

.privacy-terms {
    font-size: 9px;
    color: #999;
}

.captcha-challenge {
    padding: 20px;
    transition: all 0.3s ease;
}

.captcha-challenge.hidden {
    display: none;
}

.checkbox-container input[type="checkbox"]:checked {
    position: relative;
}

.checkbox-container.loading input[type="checkbox"] {
    opacity: 0.3;
}

.checkbox-container.loading::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 3px solid #4285F4;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.challenge-header {
    margin-bottom: 20px;
}

.challenge-header h2 {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-bottom: 4px;
}

.challenge-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.challenge-header p {
    font-size: 12px;
    color: #999;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.image-cell {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #f5f5f5;
}

.image-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.image-cell:hover img {
    transform: scale(1.05);
}

.image-cell.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(66, 133, 244, 0.5);
    border: 3px solid #4285F4;
}

.image-cell.selected::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    font-weight: bold;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.image-cell.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.captcha-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.icon-btn {
    background: none;
    border: none;
    color: #4285F4;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: #f0f0f0;
}

.verify-btn {
    background: #4285F4;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.verify-btn:hover {
    background: #3367D6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.verify-btn:active {
    transform: translateY(1px);
}

.verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Result Screen Styles */
.result-box {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.heart-animation {
    margin-bottom: 30px;
}

.heart {
    width: 100px;
    height: 100px;
    fill: #ff4757;
    filter: drop-shadow(0 4px 12px rgba(255, 71, 87, 0.4));
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1.05);
    }
}

.result-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

.result-message {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.distance {
    color: #ff4757;
    font-weight: 700;
    font-size: 20px;
}

.decorative-hearts {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-heart {
    position: absolute;
    font-size: 24px;
    animation: floatUp 4s ease-in infinite;
    opacity: 0;
}

.float-heart:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.float-heart:nth-child(2) {
    left: 25%;
    animation-delay: 0.8s;
}

.float-heart:nth-child(3) {
    left: 50%;
    animation-delay: 1.6s;
}

.float-heart:nth-child(4) {
    left: 75%;
    animation-delay: 2.4s;
}

.float-heart:nth-child(5) {
    left: 90%;
    animation-delay: 3.2s;
}

@keyframes floatUp {
    0% {
        bottom: -10%;
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(100px) rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .captcha-box {
        border-radius: 4px;
    }

    .result-box {
        padding: 40px 20px;
    }

    .result-title {
        font-size: 24px;
    }

    .result-message {
        font-size: 16px;
    }
}
