/* ==========================================================================
   SharkCaptcha — reusable slider-puzzle modal.
   Visual identity ported from index/register.php (neon-cyan glass), but fully
   self-contained: no external CSS deps, mobile-first, works in the Telegram
   webview. Width is NOT coordinate-critical: the JS maps the on-screen drag
   range onto the server's [0..250] offset space by ratio (see MAXOFF in
   shark-captcha.js), so the target stays reachable at any panel width and under
   box-sizing:border-box (Bootstrap). .shkc-piece width must match PIECE (56) in JS.
   ========================================================================== */

.shkc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 6, 16, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.shkc-overlay.shkc-open { display: flex; }

.shkc-panel {
    width: 100%;
    max-width: 340px;
    border-radius: 20px;
    padding: 20px 18px 18px;
    background: linear-gradient(160deg, rgba(17, 18, 34, 0.98), rgba(10, 11, 24, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.28);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 240, 255, 0.12);
    color: #eaf6ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: shkcPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes shkcPop {
    from { transform: translateY(14px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.shkc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.shkc-head .shkc-logo {
    width: 30px; height: 30px;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.7));
}
.shkc-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: linear-gradient(90deg, #00f0ff, #7af9ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex: 1;
}
.shkc-close {
    background: none; border: none; color: rgba(255,255,255,0.55);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.shkc-close:hover { color: #fff; }

.shkc-sub {
    font-size: 0.82rem;
    color: rgba(234, 246, 255, 0.6);
    margin: 2px 0 14px;
}

/* --- puzzle stage (coordinate-critical: keep width fixed) --- */
.shkc-area {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 168px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 20% 10%, rgba(0, 240, 255, 0.10), transparent 60%),
        linear-gradient(135deg, #10162b, #0a1120 70%);
    border: 1px solid rgba(0, 240, 255, 0.18);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
    touch-action: none;
}
/* faint grid for texture */
.shkc-area::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(0,240,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,240,255,0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

.shkc-cutout {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px; height: 56px;
    border-radius: 12px;
    border: 2px dashed rgba(0, 240, 255, 0.6);
    background: rgba(0, 240, 255, 0.06);
    box-shadow: 0 0 26px rgba(0, 240, 255, 0.35);
    pointer-events: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.shkc-piece {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 56px; height: 56px;
    border-radius: 12px;
    background-color: rgba(0, 240, 255, 0.22);   /* fallback if the coin image 404s */
    background-size: cover;
    background-position: center;
    cursor: grab;
    touch-action: none;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.6));
    transition: filter 0.12s;
    z-index: 3;
}
.shkc-piece.shkc-drag { cursor: grabbing; }
.shkc-piece.shkc-near { filter: drop-shadow(0 0 18px rgba(0, 255, 136, 0.9)); }

/* --- slider --- */
.shkc-slider {
    position: relative;
    height: 42px;
    margin: 16px auto 6px;
    width: 100%;
    max-width: 320px;
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.18);
    touch-action: none;
    overflow: hidden;
}
.shkc-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0;
    background: linear-gradient(90deg, #00f0ff, #b06bff);
    opacity: 0.35;
}
.shkc-handle {
    position: absolute;
    top: 3px; left: 3px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #0090ff);
    box-shadow: 0 4px 14px rgba(0, 240, 255, 0.5);
    display: flex; align-items: center; justify-content: center;
    color: #061018; font-size: 1rem;
    cursor: grab;
    touch-action: none;
    z-index: 2;
}
.shkc-handle.shkc-drag { cursor: grabbing; }
.shkc-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: rgba(234, 246, 255, 0.45);
    pointer-events: none;
}

.shkc-msg {
    min-height: 20px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 8px;
    color: rgba(234, 246, 255, 0.7);
}
.shkc-msg.shkc-ok  { color: #00ff88; font-weight: 600; }
.shkc-msg.shkc-err { color: #ff6b7d; font-weight: 600; }

.shkc-foot {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.shkc-refresh {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #7af9ff;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.shkc-refresh:hover { background: rgba(0, 240, 255, 0.18); }

/* "Show me how" helper button (green = help/assist) */
.shkc-howto {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.32);
    color: #8affc4;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.shkc-howto:hover { background: rgba(0, 255, 136, 0.18); }

/* assistant demo: translucent logo glides from the start into the slot */
.shkc-ghost {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    width: 56px; height: 56px;
    border-radius: 12px;
    background-size: cover; background-position: center;
    opacity: 0.55;
    pointer-events: none;
    z-index: 4;
    filter: drop-shadow(0 0 14px rgba(0, 255, 136, 0.75));
    transition: left 1.25s cubic-bezier(.34,.8,.3,1), opacity 1.25s ease;
}

/* success/verified state on the cutout */
.shkc-area.shkc-solved .shkc-cutout {
    border-color: #00ff88;
    box-shadow: 0 0 34px rgba(0, 255, 136, 0.7);
}
