﻿.game-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin: 30px 0 20px;
    color: #6a1b9a;
    font-family: 'Cairo', sans-serif;
}

@media (max-width: 600px) {
    .game-title {
        margin-top: 130px;
        font-size: 24px;
    }

    .sentence {
        font-size: 18px;
    }

    .option-btn {
        font-size: 16px;
        padding: 10px 14px;
    }
}

.question-card {
    background-color: #fffdf4;
    max-width: 650px;
    margin: auto;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 12px rgba(0,0,0,0.1);
    text-align: center;
    transition: background-color 0.3s ease;
}

.sentence {
    font-size: 22px;
    font-weight: bold;
    color: #4e342e;
    margin-bottom: 25px;
    direction: ltr;
    unicode-bidi: plaintext;
}

.blank {
    padding: 0 14px;
    border-bottom: 3px dashed #ffa500;
    font-size: 24px;
    color: #fb8c00;
}

.options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    background-color: #e1f5fe;
    color: #0277bd;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transition: background-color 0.3s, transform 0.2s;
    animation: popIn 0.4s ease;
}

    .option-btn:hover {
        background-color: #81d4fa;
        transform: scale(1.05);
    }

/* ======= احصائيات ======= */
.stats-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 250px;
    gap: 20px;
}

.stat-box-group {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-box {
    padding: 12px 20px;
    font-size: 17px;
    font-weight: bold;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    background-color: #fff;
    min-width: 220px;
    text-align: center;
}

    .stat-box.total {
        background-color: #eeeeee;
    }

    .stat-box.correct {
        background-color: #c8e6c9;
        color: #2e7d32;
    }

    .stat-box.wrong {
        background-color: #ffcdd2;
        color: #c62828;
    }

    .stat-box.progress {
        background-color: #bbdefb;
        color: #1565c0;
    }

/* أنيميشن */
@keyframes popIn {
    0% {
        transform: scale(.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================= Popup مطابق لِـ WriteTheWord ================= */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    text-align: center;
    max-width: 420px;
    animation: popupFade .3s ease-in-out;
}

.popup-correct {
    border: 3px solid #4caf50;
    background-color: #e8f5e9;
    color: #2e7d32;
}

.popup-wrong {
    border: 3px solid #f44336;
    background-color: #ffebee;
    color: #c62828;
}

.popup-image {
    width: 100px;
    margin: 15px 0;
    animation: pulse 1s infinite;
    display: block;
}

.close-popup {
    background-color: #3b82f6;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

    .close-popup:hover {
        background-color: #2563eb;
    }

/* زر إعادة تشغيل السؤال */
.repeat-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb); /* تدرج أزرق */
    color: #fff;
    padding: 12px 26px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px; /* زر دائري ناعم */
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    /* أيقونة الدوران (🔁) */
    .repeat-btn::before {
        content: "🔁";
        font-size: 1.2rem;
        display: inline-block;
        animation: spin-icon 1.8s linear infinite paused; /* متوقّف افتراضياً */
    }

    /* عند التحويم بالماوس */
    .repeat-btn:hover {
        transform: scale(1.07);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    }

    /* عند الضغط */
    .repeat-btn:active {
        transform: scale(0.95);
    }

    /* تشغيل حركة الأيقونة عند التحويم */
    .repeat-btn:hover::before {
        animation-play-state: running;
    }

/* أنيميشن دوران الأيقونة */
@keyframes spin-icon {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}



@keyframes popupFade {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}
