/* ═══════════════════════════════════════════════════════════════════ */
/* CHALLENGE SYSTEM CSS — Mathico Multiplayer                          */
/* ═══════════════════════════════════════════════════════════════════ */

.challenge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s forwards;
}

.challenge-content {
    background: var(--bg-card, #ffffff);
    color: var(--text-primary);
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
    border: 1px solid var(--border-color);
}

.challenge-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.challenge-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.challenge-btn {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.challenge-create-btn {
    background-color: #10b981;
    color: white;
}

.challenge-create-btn:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.challenge-join-btn {
    background-color: #8b5cf6;
    color: white;
}

.challenge-join-btn:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
}

.challenge-input-group {
    margin-top: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.challenge-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.challenge-input:focus {
    border-color: #8b5cf6;
    outline: none;
}

.challenge-submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #8b5cf6;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

.challenge-loading {
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* In-game overrides */
.challenge-active-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 12px;
    margin-bottom: 15px;
    animation: pulseHeader 2s infinite;
}

@keyframes pulseHeader {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Result Modal */
.cr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cr-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.cr-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.cr-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: #10b981;
    margin: 15px 0;
}

.cr-code-box {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    margin: 20px 0;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: #334155;
}

.cr-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 20px;
}