/* ================================================================
   Catch the Mails - Anti-Bot Mini-Game Styles
   Aionda GmbH | mail.aionda.com
   ================================================================ */

/* Container */
.ctm-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    user-select: none;
    -webkit-user-select: none;
}

/* Canvas wrapper (for overlay positioning) */
.ctm-canvas-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.ctm-canvas {
    display: block;
    cursor: pointer;
    touch-action: none;
    border-radius: 10px;
}

/* ----------------------------------------------------------------
   Difficulty Bar
   ---------------------------------------------------------------- */

.ctm-difficulty-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.ctm-diff-btn {
    padding: 6px 16px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: transparent;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ctm-diff-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.ctm-diff-btn.ctm-diff-active {
    background: #3b82f6;
    color: #fff;
}

/* Dark mode difficulty */
.dark .ctm-diff-btn {
    border-color: #60a5fa;
    color: #93bbfc;
}

.dark .ctm-diff-btn:hover {
    background: rgba(96, 165, 250, 0.15);
}

.dark .ctm-diff-btn.ctm-diff-active {
    background: #2563eb;
    color: #fff;
}

/* Mute button */
.ctm-mute-btn {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.ctm-mute-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}
.dark .ctm-mute-btn {
    border-color: #60a5fa;
}
.dark .ctm-mute-btn:hover {
    background: rgba(96, 165, 250, 0.15);
}

/* ----------------------------------------------------------------
   Overlays
   ---------------------------------------------------------------- */

.ctm-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 10px;
    z-index: 10;
    animation: ctm-fadein 0.3s ease;
}

@keyframes ctm-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ctm-result {
    text-align: center;
    color: #fff;
    padding: 24px;
}

.ctm-check {
    display: inline-block;
    font-size: 48px;
    color: #4ade80;
    margin-bottom: 8px;
}

.ctm-result p {
    margin: 6px 0;
    font-size: 18px;
    font-weight: 600;
}

/* Game Over screen */
.ctm-go-title {
    font-size: 28px !important;
    color: #f87171;
}

.ctm-go-score {
    font-size: 22px !important;
    color: #e2e8f0;
}

.ctm-go-new {
    color: #fbbf24 !important;
    font-size: 16px !important;
}

.ctm-go-hs {
    color: #94a3b8 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.ctm-restart-btn {
    margin-top: 16px;
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ctm-restart-btn:hover {
    background: #2563eb;
}

/* ----------------------------------------------------------------
   Highscore
   ---------------------------------------------------------------- */

.ctm-highscore {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.dark .ctm-highscore {
    color: #64748b;
}

/* ----------------------------------------------------------------
   Accessibility Fallback
   ---------------------------------------------------------------- */

.ctm-accessibility {
    max-width: 420px;
    text-align: center;
}

.ctm-a11y-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.ctm-a11y-toggle:hover {
    color: #3b82f6;
}

.ctm-a11y-info {
    margin-top: 8px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.ctm-a11y-info a {
    color: #2563eb;
    word-break: break-all;
}

.ctm-a11y-note {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
}

/* Dark mode accessibility */
.dark .ctm-a11y-toggle {
    color: #94a3b8;
}

.dark .ctm-a11y-toggle:hover {
    color: #60a5fa;
}

.dark .ctm-a11y-info {
    background: #1e293b;
    color: #cbd5e1;
}

.dark .ctm-a11y-info a {
    color: #60a5fa;
}

.dark .ctm-a11y-note {
    color: #64748b;
}

/* ----------------------------------------------------------------
   Error message
   ---------------------------------------------------------------- */

.ctm-error {
    padding: 12px 20px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    font-size: 14px;
    max-width: 420px;
    text-align: center;
}

.dark .ctm-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media (max-width: 480px) {
    .ctm-container {
        padding: 8px 0;
        gap: 8px;
    }

    .ctm-difficulty-bar {
        gap: 4px;
    }

    .ctm-diff-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .ctm-canvas-wrapper {
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }

    .ctm-canvas {
        border-radius: 8px;
    }

    .ctm-result p {
        font-size: 16px;
    }

    .ctm-go-title {
        font-size: 24px !important;
    }

    .ctm-restart-btn {
        padding: 8px 22px;
        font-size: 14px;
    }
}
