Create a polished trivia quiz game with five categories, timed multiple-choice questions, lifelines like 50/50 and skip, a detailed end-of-round summary, and a persistent leaderboard. Players pick a category, answer 10 questions under time pressure, and compete against their own high scores stored in localStorage.
Build Prompt
Copy this prompt into Claude Code
Build a single-page trivia quiz game as a static HTML/CSS/JS site. Use a dark theme with background #0f0f17, card surfaces #1a1a2a, and accent color #a855f7 (purple). The layout should be centered on the page with a max-width of 700px.
Start with a category selection screen. Display five category cards in a grid: Science (atom emoji), History (scroll emoji), Geography (globe emoji), Pop Culture (star emoji), and Sports (trophy emoji). Each card should have the category name, emoji, and a subtitle showing total questions available. Hovering a card scales it slightly and adds a purple border glow. Clicking a category starts a 10-question round from that category.
Each category must have at least 30 hardcoded questions (150+ total across all categories). Each question object has: question text, four answer options (shuffled each time), the correct answer index, and a difficulty rating (easy, medium, hard). Questions should be factual, interesting, and varied in difficulty. For each round, randomly select 10 questions from the chosen category without repeats.
The question screen displays: a progress bar at the top showing question N of 10, the category name and emoji, a 30-second countdown timer (circular progress ring that depletes, turning red under 10 seconds), the question text in large font, and four answer buttons in a 2x2 grid. Answer buttons have letter prefixes (A, B, C, D) and change color on hover. When the player selects an answer, immediately highlight the correct answer in green and the wrong answer (if chosen) in red. Show a brief "Correct!" or "Wrong!" indicator with the right answer. Auto-advance to the next question after 1.5 seconds. If the timer runs out, mark it wrong and show the correct answer.
Implement two lifelines, each usable once per round. Display them as buttons below the timer. "50/50" removes two incorrect answers (gray them out and disable clicking). "Skip" skips the current question without penalty (does not count as wrong, but no points awarded). Gray out each lifeline after use. Add a subtle animation when a lifeline is activated.
Scoring: award 100 base points for a correct answer plus a time bonus (remaining seconds multiplied by 10). Display a running score counter in the header that animates upward when points are added. Track streak — consecutive correct answers — and show a streak multiplier (x2 after 3 in a row, x3 after 5).
After the 10th question, show an end-of-round summary screen with: total score with breakdown, correct/total count, average response time, longest streak, a performance rating (S/A/B/C/D/F based on score thresholds), and a list of all questions showing which were right (green check) and wrong (red X) with the correct answers. Include buttons for "Play Again" (same category), "Change Category," and "View Leaderboard."
Implement a leaderboard in localStorage: store the top 10 scores across all categories with player name (prompted on new high score), score, category, date, and correct count. Show the leaderboard in a modal accessible from the main menu, with filtering by category.
Make it fully responsive: on mobile, answer buttons stack vertically instead of 2x2. Category cards use a single column. Touch-friendly tap targets (min 48px height). Add keyboard support: 1-4 to select answers, H for 50/50, S for skip.
Read the guide at https://accessagent.ai/api/guide and follow it to deploy the site to AccessAgent.ai. My email is [your@email.com].
Make It Yours
Daily Challenge Mode
Add a daily quiz with a fixed set of 10 mixed-category questions that changes every day. Show a calendar of completed daily challenges.
Explanation Cards
After each answer, show a brief "Did you know?" fact explaining why the correct answer is right. Great for educational value.
Difficulty Selection
Let players choose Easy, Medium, or Hard before starting. Easy gives 45 seconds and shows only easy questions. Hard gives 15 seconds with harder questions.
Sound Effects
Add synthesized audio feedback using Web Audio API: a positive chime for correct, a buzz for wrong, a tick for the timer, and fanfare for high scores.
Share Results
Generate a shareable text summary of the round result (like Wordle) with emoji blocks showing correct/wrong patterns and the final score.
True/False Mode
Add an alternate game mode with true/false statements instead of multiple choice. Faster-paced with 15-second timers and 20 questions per round.
Update Prompt
Update Prompt — Run periodically to refresh data
Open the trivia quiz game HTML file at the deployed site. Find the question database arrays for each category (Science, History, Geography, Pop Culture, Sports). Add 20 new questions to each category (100 new questions total). Each question must follow the existing format: an object with "question" (string), "options" (array of 4 strings), "correct" (index 0-3 of the right answer), and "difficulty" (string: "easy", "medium", or "hard"). Ensure the new questions are factual, verified, and do not duplicate any existing questions. Mix difficulty levels roughly evenly. For Pop Culture and Sports, include questions about recent events from 2025-2026 to keep the content fresh and current. After adding the questions, verify that no two questions in the same category have identical question text. Do not modify any game logic, styling, or other code — only append to the question arrays.
Read the guide at https://accessagent.ai/api/guide and follow it to deploy the site to AccessAgent.ai. My email is [your@email.com].
SEO Tips
Target "free trivia quiz online" and "trivia game" — these keywords get 50K+ monthly searches and work well for casual browser games.
Create category-specific landing pages like "science trivia quiz" or "history trivia questions" to capture long-tail searches from students and trivia enthusiasts.
Add FAQ schema answering "How many questions are in the trivia game?" and "What categories of trivia are available?" to improve search visibility.
Include Game schema markup with genre "Trivia" and numberOfPlayers "1" to appear in Google's game-related search features.
Publish a "200 Fun Trivia Questions and Answers" article that links back to your interactive game as a way to play through them.
Monetization Ideas
Sell premium category packs ($2.99 each) for niche topics like Movies, Music Decades, Mythology, or Space — import as JSON data files.
Offer a "Trivia Night" package ($29) for bars and restaurants with a host mode, team scoring, projector-friendly display, and round management.
Add interstitial ads between rounds — a natural break point where players expect a pause before the next category or replay.
Create a corporate team-building version ($99) with custom company-themed trivia questions and branded styling for onboarding or training.
Offer an API subscription ($5/month) that provides fresh trivia questions weekly, so other developers can embed your questions in their apps.