<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Birthday Countdown & Quiz</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background: linear-gradient(135deg, #ff9a9e, #fad0c4);
            color: #333;
            margin: 0;
            padding: 0;
        }

        .container {
            padding: 20px;
            margin-top: 50px;
        }

        .countdown {
            font-size: 2em;
            margin: 20px 0;
        }

        .birthday-card {
            display: none;
            background: #fff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            margin-top: 20px;
        }

        .quiz, .result {
            display: none;
            margin-top: 20px;
        }

        .quiz button {
            margin-top: 10px;
            padding: 10px 20px;
            font-size: 16px;
            background: #4caf50;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        .quiz button:hover {
            background: #45a049;
        }

        .surprise {
            display: none;
            font-size: 1.5em;
            color: #333;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="countdown" id="countdown">Loading...</div>

        <div class="birthday-card" id="birthday-card">
            <h1>🎉 Happy Birthday! 🎉</h1>
            <p>Welcome to your birthday adventure! 🎂</p>
            <button onclick="startQuiz()">Start the Quiz</button>
        </div>

        <div class="quiz" id="quiz">
            <h2>How well do you know your birthday?</h2>
            <p id="quiz-question">Question will appear here</p>
        </div>

        <div class="result" id="result">
            <h2>You did it! 🎉</h2>
            <p>Your surprise is ready!</p>
            <div class="surprise" id="surprise">✨ Here's a personalized birthday message for you! ✨</div>
        </div>
    </div>

    <script>
        const birthday = new Date("2025-01-05T00:00:00");
    
        function updateCountdown() {
            const now = new Date();
            const timeDiff = birthday - now;
    
            if (timeDiff <= 0) {
                document.getElementById('countdown').style.display = 'none';
                document.getElementById('birthday-card').style.display = 'block';
                return;
            }
    
            const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
            const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
    
            document.getElementById('countdown').innerHTML = `Time until your birthday: ${days}d ${hours}h ${minutes}m ${seconds}s`;
        }
    
        setInterval(updateCountdown, 1000);
    
        const quizQuestions = [
            {
                question: "What do you watch the most?",
                correctAnswer: 'hentai'
            },
            {
                question: "Favourite person?",
                correctAnswer: 'Elisa'
            },
            {
                question: "Do you like me?",
                correctAnswer: ''
            }
        ];
    
        let currentQuestion = 0;
        let score = 0;

        function startQuiz() {
            document.getElementById('birthday-card').style.display = 'none';
            document.getElementById('quiz').style.display = 'block';
            showQuestion();
        }

        function showQuestion() {
            const question = quizQuestions[currentQuestion];
            document.getElementById('quiz-question').innerHTML = `
                <p>${question.question}</p>
                <input type="text" id="user-answer" placeholder="Enter your answer" />
                <button onclick="checkAnswer()">Submit</button>
            `;
        }

        function checkAnswer() {
            const userAnswer = document.getElementById('user-answer').value.trim().toLowerCase();
            const correctAnswer = quizQuestions[currentQuestion].correctAnswer.toLowerCase();

            if (userAnswer === correctAnswer) {
                score++;
            }
            
            currentQuestion++;
            if (currentQuestion < quizQuestions.length) {
                showQuestion();
            } else {
                endQuiz();
            }
        }

        function endQuiz() {
            document.getElementById('quiz').style.display = 'none';
            document.getElementById('result').style.display = 'block';

            if (score === quizQuestions.length) {
                document.getElementById('result').innerHTML = `
                    <h2>Congratulations! 🎉</h2>
                    <p>You got all answers correct!</p>
                    <div class="surprise" id="surprise">✨ Here's a personalized birthday message for you! ✨</div>
                `;
            } else {
                document.getElementById('result').innerHTML = `
                    <h2>Nice Try! 🎉</h2>
                    <p>But you need to answer all questions correctly to see the surprise!</p>
                    <button onclick="retryQuiz()">Try Again</button>
                `;
            }
        }

        function retryQuiz() {
            currentQuestion = 0;
            score = 0;
            document.getElementById('result').style.display = 'none';
            document.getElementById('quiz').style.display = 'block';
            showQuestion();
        }
    </script>
</body>
</html>
