/* ============================================================
   Muyuan behavior captcha - popup styles
   ============================================================ */

.myc-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.myc-modal.show {
    opacity: 1;
    visibility: visible;
}

.myc-panel {
    width: 404px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ---------- header ---------- */

.myc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px 16px;
    border-bottom: 1px solid #eef0f2;
    gap: 8px;
}

.myc-tip {
    font-size: 13px;
    color: #4b5563;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.myc-hint-seq {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.myc-hint-ico {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.myc-hint-ico svg {
    width: 16px;
    height: 16px;
    display: block;
}

.myc-hint-ch {
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #dc2626;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.myc-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.myc-tool-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: background 0.2s, color 0.2s;
}

.myc-tool-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.myc-tool-btn svg {
    width: 15px;
    height: 15px;
}

/* ---------- stage ---------- */

.myc-stage {
    position: relative;
    padding: 14px 16px 8px;
}

.myc-stage-inner {
    position: relative;
    width: 368px;
    height: 230px;
    background: #eef0f2;
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
}

.myc-stage-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.myc-canvas-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.myc-interactive {
    position: absolute;
    inset: 0;
}

/* clickable chips */

.myc-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.62);
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
    transition: background 0.15s, transform 0.15s;
}

.myc-chip:hover {
    background: rgba(255, 107, 53, 0.9);
    transform: translate(-50%, -50%) scale(1.06);
}

.myc-chip.picked {
    background: var(--brand, #ff6b35);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.55), 0 2px 6px rgba(15, 23, 42, 0.3);
}

.myc-chip.myc-chip-wrong {
    background: #dc2626;
    animation: myc-shake 0.3s ease;
}

.myc-chip.picked::after {
    content: attr(data-index);
    position: absolute;
    top: -9px;
    right: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1f2937;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.myc-chip .myc-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    flex-shrink: 0;
}

.myc-chip .myc-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

@keyframes myc-shake {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-54%, -50%); }
    75% { transform: translate(-46%, -50%); }
}

/* ---------- slider track ---------- */

.myc-track {
    position: relative;
    height: 38px;
    margin-top: 12px;
    background: #f5f5f5;
    border: 1px solid #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}

.myc-track-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(0, 244, 171, 0.28);
    border: 1px solid #00d9a0;
    border-right: none;
    box-sizing: border-box;
    pointer-events: none;
}

.myc-track-thumb {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: #fff;
    border: 1px solid #e2e5e8;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d9a0;
    cursor: grab;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.16);
    z-index: 2;
}

.myc-track-thumb svg {
    width: 18px;
    height: 18px;
}

.myc-track-thumb:active {
    cursor: grabbing;
}

.myc-track-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #88949d;
    pointer-events: none;
    letter-spacing: 1px;
}

/* ---------- word chips on image ---------- */

.myc-word-chip {
    min-width: 44px;
    height: 38px;
    font-size: 17px;
}

/* ---------- scratch patterns ---------- */

.myc-scratch-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.myc-pattern {
    position: absolute;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myc-pattern-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}

.myc-pattern-svg svg {
    width: 34px;
    height: 34px;
    display: block;
}

/* ---------- pow ---------- */

.myc-pow {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fafbfc;
}

.myc-pow-bar {
    width: 220px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.myc-pow-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand, #ff6b35);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.myc-pow-text {
    font-size: 13px;
    color: #6b7280;
}

.myc-pow-done {
    color: #059669;
    font-weight: 600;
}

/* ---------- curve drawing ---------- */

.myc-draw-layer {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
}

/* ---------- jigsaw ---------- */

.myc-jigsaw {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
    background: #e2e8f0;
    padding: 3px;
}

.myc-tile {
    position: relative;
    background-repeat: no-repeat;
    cursor: pointer;
    border-radius: 2px;
    transition: box-shadow 0.15s;
}

.myc-tile:hover {
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.7);
}

.myc-tile.selected {
    box-shadow: 0 0 0 3px var(--brand, #ff6b35);
    z-index: 2;
}

/* ---------- footer (whitespace only, no logo) ---------- */

.myc-footer {
    height: 22px;
}

/* ---------- scratch gray layer ---------- */

.myc-scratch-gray {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #6b7280;
    box-shadow: -2px 0 6px rgba(15, 23, 42, 0.35);
    pointer-events: none;
}

/* ---------- state overlays ---------- */

.myc-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.96);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

.myc-state.show {
    opacity: 1;
    visibility: visible;
}

.myc-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myc-state-icon svg {
    width: 30px;
    height: 30px;
}

.myc-state-ok .myc-state-icon { background: #059669; }
.myc-state-ok .myc-state-icon svg { stroke: #fff; }

.myc-state-text {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* ---------- widget toast ---------- */

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-90px);
    background: #1f2937;
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 20000;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
    transition: transform 0.25s ease;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #1f2937;
}
