Yoosful Game ((full)) May 2026

// win condition: all tasks completed function checkWin() { if (currentTasks.length === 0 && completedTasks.length === TASKS.length) { // game finished const winModal = document.createElement('div'); winModal.className = 'win-overlay'; winModal.id = 'winModal'; winModal.innerHTML = ` <div class="win-card"> <h2>🏆 YOU WON! 🏆</h2> <p style="font-size:1.2rem">Final Score: ${score}</p> <p>🔥 Best Streak: ${bestStreak}</p> <button class="new-game-win-btn" id="winNewGameBtn">✨ Play Again ✨</button> </div> `; document.body.appendChild(winModal); const newGameBtn = document.getElementById('winNewGameBtn'); if (newGameBtn) newGameBtn.onclick = () => { removeWinModal(); resetGame(); }; setMessage("⭐ VICTORY! You completed all useful tasks! ⭐"); } }

// show temporary message (overwrites but keep) function setMessage(msg, isError = false) { gameMessage = msg; gameMessageDiv.innerText = msg; if (!isError) { // auto clear neutral after 2 sec? not needed but nice setTimeout(() => { if (gameMessage === msg) { // only if not overwritten gameMessage = "🎯 Keep matching!"; gameMessageDiv.innerText = gameMessage; } }, 1800); } else { // error style just visual, but stays setTimeout(() => { if (gameMessage === msg) { gameMessage = "👆 Select a task & tool again!"; gameMessageDiv.innerText = gameMessage; } }, 1500); } updateUIStats(); } yoosful game

.score-value { font-size: 2rem; font-weight: 800; line-height: 1; color: #ffd966; } // win condition: all tasks completed function checkWin()

function removeWinModal() { const existing = document.getElementById('winModal'); if (existing) existing.remove(); } ⭐"); } } // show temporary message (overwrites