body { font-family: Arial, sans-serif; text-align: center; } h1 { margin-top: 20px; font-size: 28px; } #score { font-size: 20px; margin: 10px 0; } #animal { font-size: 140px; display: block; margin: 20px auto; border-radius: 15px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); width: 180px; height: 180px; line-height: 180px; } .option { display: block; width: 80%; max-width: 300px; margin: 10px auto; padding: 15px; font-size: 18px; background-color: #1e73be; color: #fff; border: none; border-radius: 10px; cursor: pointer; } .option:hover { opacity: 0.9; } #message { margin-top: 15px; font-size: 18px; font-weight: bold; } #next-btn, #restart-btn { margin-top: 20px; padding: 10px 20px; font-size: 18px; border: none; border-radius: 10px; cursor: pointer; background-color: #444; color: white; } #next-btn { display: none; } #restart-btn { display: none; } 🐾 اختر الحيوان الصحيح 🐾 الإجابات الصحيحة: 0/0 🐶 السؤال التالي البداية const animals = [ {name:"كلب", emoji:"🐶"}, {name:"قطة", emoji:"🐱"}, {name:"أسد", emoji:"🦁"}, {name:"نمر", emoji:"🐯"}, {name:"حصان", emoji:"🐴"}, {name:"حمار", emoji:"🫏"}, {name:"غزال", emoji:"🦌"}, {name:"فيل", emoji:"🐘"}, {name:"دب", emoji:"🐻"}, {name:"باندا", emoji:"🐼"}, {name:"قرد", emoji:"🐵"}, {name:"خفاش", emoji:"🦇"}, {name:"كنغر", emoji:"🦘"}, {name:"كوالا", emoji:"🐨"}, {name:"بطريق", emoji:"🐧"}, {name:"بطة", emoji:"🦆"}, {name:"سنجاب", emoji:"🐿️"}, {name:"سلحفاة", emoji:"🐢"}, {name:"سمكة", emoji:"🐟"}, {name:"أخطبوط", emoji:"🐙"}, {name:"دلفين", emoji:"🐬"}, {name:"قرش", emoji:"🦈"}, {name:"تمساح", emoji:"🐊"}, {name:"نعامة", emoji:"🦩"}, {name:"ديك", emoji:"🐓"}, {name:"بقرة", emoji:"🐄"}, {name:"خنزير", emoji:"🐖"}, {name:"ضفدع", emoji:"🐸"}, {name:"طاووس", emoji:"🦚"}, {name:"فراشة", emoji:"🦋"}, {name:"نحلة", emoji:"🐝"}, {name:"عصفور", emoji:"🐦"}, {name:"حمامة", emoji:"🕊️"}, {name:"عقاب", emoji:"🦅"}, {name:"بومة", emoji:"🦉"}, {name:"نسر", emoji:"🦅"}, {name:"كنغر", emoji:"🦘"}, {name:"حصان البحر", emoji:"🐴"}, {name:"سمكة قرش", emoji:"🦈"}, {name:"غوريلا", emoji:"🦍"} ]; let correctAnswer = null; let score = 0; let attempts = 0; const animalDiv = document.getElementById("animal"); const option1 = document.getElementById("option1"); const option2 = document.getElementById("option2"); const message = document.getElementById("message"); const nextBtn = document.getElementById("next-btn"); const restartBtn = document.getElementById("restart-btn"); const scoreDiv = document.getElementById("score"); function updateScore() { scoreDiv.textContent = `الإجابات الصحيحة: ${score}/${attempts}`; } function newQuestion() { message.textContent = ""; nextBtn.style.display = "none"; const choices = []; while (choices.length < 2) { const rand = animals[Math.floor(Math.random() * animals.length)]; if (!choices.includes(rand)) choices.push(rand); } correctAnswer = choices[Math.floor(Math.random() * choices.length)]; animalDiv.textContent = correctAnswer.emoji; const shuffled = choices.sort(() => Math.random() - 0.5); option1.textContent = shuffled[0].name; option2.textContent = shuffled[1].name; } function checkAnswer(selected) { attempts++; if (selected === correctAnswer.name) { score++; message.textContent = "إجابتك صحيحة ✅"; nextBtn.style.display = "inline-block"; } else { message.textContent = "❌ حاول ثانية"; } updateScore(); } option1.onclick = () => checkAnswer(option1.textContent); option2.onclick = () => checkAnswer(option2.textContent); nextBtn.onclick = newQuestion; restartBtn.onclick = () => { score = 0; attempts = 0; updateScore(); restartBtn.style.display = "none"; newQuestion(); }; // بدء اللعبة updateScore(); newQuestion();