/* ============================================================
   CAPTCHA MODAL — CSS
   ============================================================ */

/* Overlay */
.sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: scFadeIn 0.25s ease;
}
.sc-overlay.open { display: flex; }
@keyframes scFadeIn { from{opacity:0} to{opacity:1} }

/* Box */
.sc-box {
    background: var(--bg-card, #12122a);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: scSlideUp 0.3s ease;
}
@keyframes scSlideUp { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }

/* Top gradient bar */
.sc-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #6366f1, #8b5cf6, #10b981);
    background-size: 200% 100%;
    animation: scGlowBar 3s linear infinite;
}
@keyframes scGlowBar { 0%{background-position:0%} 100%{background-position:200%} }

/* Close */
.sc-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--bg-input, rgba(255,255,255,0.04));
    color: var(--text-secondary, #94a3b8);
    font-size: 18px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 2;
}
.sc-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Header */
.sc-header {
    text-align: center;
    padding: 28px 24px 12px;
}
.sc-shield {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 6px 20px rgba(99,102,241,0.3);
    font-size: 26px; color: #fff;
    animation: shieldPulse 3s ease-in-out infinite;
}
@keyframes shieldPulse {
    0%,100%{box-shadow:0 6px 20px rgba(99,102,241,0.3)}
    50%{box-shadow:0 6px 30px rgba(99,102,241,0.5)}
}
.sc-title    { font-size: 17px; font-weight: 800; color: var(--text-primary, #f1f5f9); margin: 0 0 4px; }
.sc-subtitle { font-size: 13px; color: var(--text-muted, #64748b); margin: 0; }

/* Ad slot */
.ad-slot-modal { margin: 0 16px 4px; border-radius: 10px; overflow: hidden; min-height: 50px; }
.ad-placeholder-inner {
    background: var(--bg-card2, #181835);
    border: 1px dashed var(--border, rgba(255,255,255,0.08));
    border-radius: 10px; height: 50px;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.ad-label {
    font-size: 10px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-muted, #64748b);
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* Captcha wrap — shared container */
.sc-captcha-wrap { padding: 12px 20px 4px; }

/* Status wrap */
.sc-status-wrap { padding: 8px 24px 20px; }
.sc-status {
    text-align: center; font-size: 13px;
    color: var(--text-muted, #64748b);
    min-height: 20px; transition: color 0.3s;
}
.sc-status.success { color: #10b981; font-weight: 700; }
.sc-status.error   { color: #ef4444; }

/* Loading */
.sc-loading {
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px; padding: 20px 24px 24px;
    color: var(--text-muted, #64748b); font-size: 13px;
}
.sc-loading.active { display: flex; }
.sc-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border, rgba(255,255,255,0.08));
    border-top-color: #6366f1;
    border-radius: 50%; animation: scSpin 0.8s linear infinite;
}
@keyframes scSpin { to { transform: rotate(360deg); } }

/* ── TYPE 1: SLIDE ─────────────────────────────────────────── */
.sc-track {
    position: relative;
    background: var(--bg-card2, #181835);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 40px; height: 52px;
    cursor: pointer; user-select: none;
    overflow: visible; margin-bottom: 4px;
}

/* Glowing target zone (injected by JS) */
.sc-target-zone {
    position: absolute; top: 0; height: 100%;
    background: rgba(99,102,241,0.15);
    border: 1.5px dashed rgba(99,102,241,0.5);
    border-radius: 6px; pointer-events: none; z-index: 1;
    animation: zonePulse 1.5s ease-in-out infinite;
}
@keyframes zonePulse {
    0%,100% { background: rgba(99,102,241,0.12); }
    50%      { background: rgba(99,102,241,0.28); }
}
.sc-target-line {
    position: absolute; top: 0; left: 50%; width: 2px; height: 100%;
    background: rgba(99,102,241,0.7); transform: translateX(-50%);
}

/* Fill */
.sc-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    width: 52px;
    border-radius: 40px;
    background: linear-gradient(90deg, rgba(99,102,241,0.2), rgba(99,102,241,0.1));
    transition: background 0.4s; pointer-events: none;
}
.sc-fill.success {
    background: linear-gradient(90deg, rgba(16,185,129,0.3), rgba(16,185,129,0.1));
}

/* Handle */
.sc-handle {
    position: absolute; top: 0; left: 0;
    width: 52px; height: 52px; border-radius: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
    cursor: grab; cursor: -webkit-grab;
    transition: background 0.4s, box-shadow 0.4s;
    z-index: 2; touch-action: none;
}
.sc-handle:active { cursor: grabbing; }
.sc-handle.success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 20px rgba(16,185,129,0.5);
}
.sc-handle.shake { animation: scShake 0.4s ease; }
@keyframes scShake {
    0%,100%{transform:translateX(0)}
    20%{transform:translateX(-6px)} 40%{transform:translateX(6px)}
    60%{transform:translateX(-4px)} 80%{transform:translateX(4px)}
}

/* ── TYPE 2: ICON ORDER ────────────────────────────────────── */
.sc-order-label, .sc-least-label {
    font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
    color: var(--text-muted, #64748b);
    text-align: center; text-transform: uppercase;
    margin-bottom: 10px;
}

.sc-order-prompt {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 6px;
    background: var(--bg-card2, #181835);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px; padding: 10px 12px;
    margin-bottom: 14px;
}
.sc-prompt-item {
    position: relative; display: inline-flex;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
}
.sc-prompt-emoji { font-size: 26px; line-height: 1; }
.sc-prompt-num {
    position: absolute; top: -4px; left: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #6366f1; color: #fff;
    font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}
.sc-prompt-arrow {
    color: var(--text-muted, #64748b); font-size: 13px; font-weight: 700;
}

/* Shared icon grid */
.sc-icon-grid {
    display: flex; flex-wrap: wrap;
    gap: 10px; justify-content: center;
    padding: 2px 0;
}

/* Icon cell */
.sc-icon-cell {
    width: 74px; height: 74px;
    border-radius: 16px;
    border: 2px solid var(--border, rgba(255,255,255,0.08));
    background: var(--bg-card2, #181835);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; cursor: pointer; position: relative;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
    user-select: none; -webkit-user-select: none;
}
.sc-icon-cell:hover {
    border-color: rgba(99,102,241,0.5);
    transform: scale(1.07);
}
.sc-icon-cell.clicked {
    border-color: #6366f1;
    background: rgba(99,102,241,0.12);
}
.sc-icon-cell.correct {
    border-color: #10b981;
    background: rgba(16,185,129,0.12);
}
.sc-icon-cell.wrong {
    border-color: #ef4444;
    background: rgba(239,68,68,0.12);
    animation: scShake 0.4s ease;
}
.sc-icon-badge {
    position: absolute; top: -9px; right: -9px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #6366f1; color: #fff;
    font-size: 11px; font-weight: 800;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(99,102,241,0.5);
    border: 2px solid var(--bg-card, #12122a);
}

/* ── TYPE 3: LEAST REPEAT (smaller cells, 4-per-row) ──────── */
.sc-icon-grid--least .sc-icon-cell {
    width: 64px; height: 64px; font-size: 28px; border-radius: 14px;
}

/* ── Ban State ────────────────────────────────────────────── */
.sc-ban-state {
    padding: 24px 20px;
    text-align: center;
}
.sc-ban-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: scBanPulse 2s ease-in-out infinite;
}
@keyframes scBanPulse {
    0%,100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}
.sc-ban-title {
    font-size: 16px;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 6px;
}
.sc-ban-msg {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-bottom: 16px;
    line-height: 1.5;
}
.sc-ban-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 22px;
    font-weight: 800;
    color: #ef4444;
    font-variant-numeric: tabular-nums;
}
.sc-ban-timer i {
    font-size: 16px;
    opacity: 0.7;
}

/* ── Light theme overrides ─────────────────────────────────── */
[data-theme="light"] .sc-box { background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,0.15); }
[data-theme="light"] .sc-track { background: #f0f2f5; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .sc-icon-cell { background: #f0f2f5; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .sc-order-prompt { background: #f0f2f5; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .ad-placeholder-inner { background: #f8f9fb; border-color: rgba(0,0,0,0.1); }
