﻿/* ✅ منع الشريط الأفقي */
body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* العنوان */
.title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #6a1b9a;
    margin-top: 30px;
    margin-bottom: 10px;
    font-family: 'Cairo', sans-serif;
}

.instruction {
    text-align: center;
    font-size: 20px;
    color: #555;
    margin-bottom: 10px;
    font-family: 'Cairo', sans-serif;
}

/* عرض الكلمة */
.target-word-display {
    font-size: 3rem;
    font-weight: bold;
    color: #007bff;
    text-align: center;
    letter-spacing: 10px;
    margin-top: 10px;
    margin-bottom: 30px;
    animation: pulse 1.5s infinite;
    overflow-wrap: break-word;
}

/* نبض */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: .85;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* المربعات */
.drop-zone-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.drop-slot {
    width: 60px;
    height: 60px;
    border: 2px dashed #ff9800;
    border-radius: 12px;
    background-color: #fff3e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    transition: background-color .3s ease;
    touch-action: none;
    user-select: none;
}

    .drop-slot:hover {
        background-color: #ffe0b2;
    }

.drag-over {
    background-color: #ffe0b2 !important;
    border: 3px dashed #ff9800 !important;
}

/* الحروف */
.dropped-letter {
    background-color: #ffe082;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    transition: transform .2s;
}

    .dropped-letter:hover {
        transform: scale(1.1);
    }

html, body {
    overflow-x: hidden !important;
}

.drag-source {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px auto 25px;
    padding: 0 15px;
    max-width: 100%;
}

.drag-letter {
    background-color: #ffecb3;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: grab;
    transition: transform .2s;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    user-select: none;
    touch-action: none;
    flex-shrink: 0;
}

    .drag-letter:hover {
        transform: scale(1.1);
        background-color: #ffd54f;
    }

/* الأزرار */
.buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-check {
    background-color: #4caf50;
    color: #fff;
}

.btn-next {
    background-color: #2196f3;
    color: #fff;
}

.btn-reset {
    background-color: #ff9800;
    color: #fff;
}

.btn-clear {
    background-color: #9e9e9e;
    color: #fff;
}

.btn-sound {
    background-color: #ffd54f;
    color: #333;
}

.btn-check, .btn-next, .btn-reset, .btn-clear, .btn-sound {
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .3s;
    font-family: 'Cairo', sans-serif;
}

    .btn-check:hover {
        background-color: #388e3c;
    }

    .btn-next:hover {
        background-color: #1976d2;
    }

    .btn-reset:hover {
        background-color: #fb8c00;
    }

    .btn-clear:hover {
        background-color: #757575;
    }

    .btn-sound:hover {
        background-color: #fbc02d;
    }

/* نتيجة */
.result {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
    color: #d84315;
}

/* موبايل */
@media (max-width: 768px) {
    .drop-slot, .dropped-letter, .drag-letter {
        width: 50px;
        height: 50px;
        font-size: 22px;
        padding: 10px 14px;
    }

    .title {
        font-size: 24px;
    }

    .instruction {
        font-size: 18px;
    }

    .btn-check, .btn-next, .btn-reset, .btn-clear, .btn-sound {
        font-size: 16px;
        padding: 10px 20px;
    }

    .target-word-display {
        font-size: 2.2rem;
        letter-spacing: 5px;
    }
}

/* ================= 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;
    }

@keyframes popupFade {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
