*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--vh, 100%);
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--vh, 100%);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background: #fff;
}

#screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--vh, 100%);
    display: block;
    background: #fff;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    contain: layout paint;
}

/* Transparent textarea that overlays the canvas on mobile.
   Captures touch events and opens the keyboard when a remote
   input field is focused. Invisible to the user. */
#mobile-input {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--vh, 100%);
    opacity: 0;
    font-size: 16px;
    border: none;
    padding: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    resize: none;
    outline: none;
    z-index: 2;
    pointer-events: none;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-appearance: none;
}

#mobile-input.enabled {
    pointer-events: auto;
}

#overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #888;
    font-size: 14px;
    z-index: 10;
    transition: opacity 0.3s;
}

#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #888;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

.spinner.error {
    border: none;
    animation: none;
    border-radius: 0;
    position: relative;
}

.spinner.error::before,
.spinner.error::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: #e74c3c;
    border-radius: 1px;
}

.spinner.error::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.spinner.error::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes captchaFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#captcha-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 20;
    transition: opacity 0.25s ease;
}

#captcha-screen.hidden {
    display: none;
}

.captcha-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    max-width: 340px;
    width: 100%;
    animation: captchaFadeIn 0.35s ease both;
}

.captcha-header {
    font-size: 20px;
    font-weight: 600;
    color: #3498db;
    text-align: center;
    margin-bottom: 16px;
}

.captcha-verify {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    user-select: none;
    transition:
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s;
}

.captcha-verify:hover {
    border-color: #bbb;
    background: #fafafa;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.captcha-verify:active {
    background: #f5f5f5;
}

.captcha-checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.15s;
}

.captcha-verify:active .captcha-checkmark {
    transform: scale(0.92);
}

.captcha-verify.verifying {
    pointer-events: none;
    border-color: #3498db;
}

.captcha-verify.verifying .captcha-checkmark {
    border-radius: 50%;
    border: 2px solid #ddd;
    border-top-color: #3498db;
    animation: spin 0.8s linear infinite;
}

.captcha-verify.checked {
    pointer-events: none;
    border-color: #2ecc71;
    background: #f0fdf4;
}

.captcha-verify.checked .captcha-checkmark {
    background: #2ecc71;
    border-color: #2ecc71;
}

.captcha-verify.checked .captcha-checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.captcha-error {
    color: #e74c3c;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

.captcha-type-cloudflare,
.captcha-type-recaptcha {
    background: #fff !important;
    align-items: stretch !important;
    flex-direction: column !important;
    padding: 0 !important;
}

.captcha-type-cloudflare {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif !important;
    justify-content: stretch !important;
}

.captcha-type-recaptcha {
    font-family: arial, sans-serif !important;
    justify-content: flex-start !important;
}

.cf-page,
.rc-page {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cf-body {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 80px 40px 40px;
}

.rc-body {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    padding: 40px;
}

.cf-content,
.rc-content {
    width: 100%;
    animation: captchaFadeIn 0.4s ease both;
}

.cf-content {
    max-width: 720px;
}
.rc-content {
    max-width: 600px;
}

.cf-domain {
    font-size: 30px;
    font-weight: 400;
    color: #333;
    line-height: 1.3;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.cf-subtitle {
    font-size: 18px;
    color: #555;
    margin: 0 0 28px;
    line-height: 1.4;
}

.cf-desc {
    font-size: 16px;
    color: #666;
    line-height: 1.65;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    max-width: 540px;
}

.cf-widget {
    width: 310px;
    height: 65px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.03),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

.cf-widget-check {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.captcha-type-cloudflare .captcha-verify {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
    flex: 1;
    background: transparent;
}

.captcha-type-cloudflare .captcha-verify:hover {
    background: rgba(0, 0, 0, 0.015);
    border: none;
}
.captcha-type-cloudflare .captcha-verify:active {
    background: rgba(0, 0, 0, 0.03);
}

.captcha-type-cloudflare .captcha-checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #c0c0c0;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.12s;
    background: #fff;
}

.captcha-type-cloudflare .captcha-verify:active .captcha-checkmark {
    transform: scale(0.9);
}
.cf-verify-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.cf-widget-side {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px 6px 0;
    background: #fafafa;
    gap: 2px;
}

.cf-widget-brand {
    display: flex;
    align-items: center;
    justify-content: center;
}
.cf-brand-logo {
    width: 68px;
    height: auto;
    display: block;
}

.cf-widget-links {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    line-height: 1;
    margin-top: 4px;
    padding-bottom: 2px;
}

.cf-widget-links a {
    color: #888;
    text-decoration: underline;
    font-size: 8px;
}
.cf-widget-links a:hover {
    color: #555;
}
.cf-widget-links span {
    color: #aaa;
    font-size: 7px;
}

@keyframes cfDotSpin {
    to {
        transform: rotate(360deg);
    }
}

.captcha-type-cloudflare .captcha-verify.verifying {
    pointer-events: none;
}

.captcha-type-cloudflare .captcha-verify.verifying .captcha-checkmark {
    border: none;
    border-radius: 50%;
    background: transparent;
    animation: none;
}

.captcha-type-cloudflare .captcha-verify.verifying .captcha-checkmark::before {
    content: '';
    position: absolute;
    inset: 0;
    animation: cfDotSpin 1s steps(8, end) infinite;
    background-image:
        radial-gradient(circle 2px at 12px 2px, #2d9b4e 99%, transparent),
        radial-gradient(circle 2px at 19px 5px, #2d9b4e 99%, transparent),
        radial-gradient(circle 2px at 22px 12px, #2d9b4e 99%, transparent),
        radial-gradient(circle 2px at 19px 19px, #2d9b4e 99%, transparent),
        radial-gradient(circle 2px at 12px 22px, #ccc 99%, transparent),
        radial-gradient(circle 2px at 5px 19px, #ccc 99%, transparent),
        radial-gradient(circle 2px at 2px 12px, #ccc 99%, transparent),
        radial-gradient(circle 2px at 5px 5px, #ccc 99%, transparent);
    background-size: 24px 24px;
    background-repeat: no-repeat;
}

.captcha-type-cloudflare .captcha-verify.verifying .captcha-checkmark::after {
    display: none;
}

.captcha-type-cloudflare .captcha-verify.checked {
    pointer-events: none;
}
.captcha-type-cloudflare .captcha-verify.checked .captcha-checkmark {
    background: #2d9b4e;
    border-color: #2d9b4e;
    border-radius: 50%;
}
.captcha-type-cloudflare .captcha-verify.checked .captcha-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.captcha-type-cloudflare .captcha-error {
    font-size: 14px;
    color: #d63638;
    margin-top: 12px;
    min-height: 0;
}

.rc-top-line,
.rc-sep-line {
    height: 1px;
    background: #dadada;
}

.rc-top-line {
    margin-bottom: 36px;
}
.rc-sep-line {
    margin: 28px 0 22px;
    max-width: 500px;
}

.rc-widget {
    width: 304px;
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.rc-widget-inner {
    display: flex;
    align-items: center;
    height: 74px;
}
.rc-check-area {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.captcha-type-recaptcha .captcha-verify {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    flex: 1;
    height: 100%;
    background: transparent;
}

.captcha-type-recaptcha .captcha-verify:hover {
    background: transparent;
    border: none;
}

.captcha-type-recaptcha .captcha-checkmark {
    width: 28px;
    height: 28px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    flex-shrink: 0;
    position: relative;
    transition:
        border-color 0.15s,
        background 0.15s,
        transform 0.1s,
        box-shadow 0.15s;
    background: #fff;
    cursor: pointer;
}

.captcha-type-recaptcha .captcha-checkmark:hover {
    border-color: #b2b2b2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) inset;
}
.captcha-type-recaptcha .captcha-verify:active .captcha-checkmark {
    transform: scale(0.9);
    border-color: #a0a0a0;
}
.rc-verify-text {
    font-size: 14px;
    color: #000;
}

.rc-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 73px;
    flex-shrink: 0;
}

.rc-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rc-logo-img,
.rc-logo-img svg {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-logo-text {
    font-size: 10px;
    line-height: 1;
    text-align: center;
    margin-top: 1px;
}
.rc-logo-re {
    color: #555;
    font-style: italic;
}
.rc-logo-captcha {
    color: #555;
    font-weight: 700;
}

.rc-terms-links {
    font-size: 8px;
    color: #555;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}
.rc-terms-links a {
    color: #555;
    text-decoration: none;
}
.rc-terms-links a:hover {
    text-decoration: underline;
}

.rc-about {
    max-width: 500px;
}
.rc-about-title {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    margin: 0 0 12px;
    line-height: 1.3;
}

.rc-about-text {
    font-size: 13px;
    color: #333;
    line-height: 1.65;
    margin: 0 0 14px;
}
.rc-about-text a {
    color: #1a0dab;
    text-decoration: none;
}
.rc-about-text a:hover {
    text-decoration: underline;
}

.rc-about-meta {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}
.rc-about-meta p {
    margin: 0;
    word-break: break-all;
}

.captcha-type-recaptcha .captcha-verify.verifying {
    pointer-events: none;
}
.captcha-type-recaptcha .captcha-verify.verifying .captcha-checkmark {
    border: 3px solid #dbdbdb;
    border-top-color: #4285f4;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    background: transparent;
    box-shadow: none;
}

.captcha-type-recaptcha .captcha-verify.checked {
    pointer-events: none;
}
.captcha-type-recaptcha .captcha-verify.checked .captcha-checkmark {
    background: transparent;
    border-color: transparent;
    border-radius: 2px;
    box-shadow: none;
}
.captcha-type-recaptcha .captcha-verify.checked .captcha-checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 12px;
    height: 22px;
    border: solid #2e7d32;
    border-width: 0 3px 3px 0;
    transform: rotate(40deg);
}

.captcha-type-recaptcha .captcha-error {
    font-size: 13px;
    color: #d93025;
    margin-top: 8px;
    min-height: 0;
}

@media (max-width: 600px) {
    .cf-body {
        padding: 40px 20px 20px;
    }
    .cf-domain {
        font-size: 24px;
    }
    .cf-subtitle {
        font-size: 16px;
    }
    .cf-desc {
        font-size: 14px;
        margin-top: 32px;
    }
    .rc-body {
        padding: 24px 16px;
    }
}
