Create a classic memory matching game with smooth CSS flip animations, multiple emoji themes, adjustable difficulty levels, a move counter, a running timer, and localStorage high scores. Players flip two cards at a time trying to find matching pairs across a grid that scales from easy 4x4 to challenging 6x6.
Build Prompt
Copy this prompt into Claude Code
Build a single-page memory card matching game as a static HTML/CSS/JS site. Use a dark theme with background #0f0f17, card surfaces #1a1a2a, and accent color #a855f7 (purple). Center the game board on the page with a header area for controls and stats.
The game starts with a menu screen where the player selects a theme and difficulty level. Provide three themes using emoji: Animals (dog, cat, lion, elephant, penguin, dolphin, butterfly, owl, fox, rabbit, turtle, octopus), Flags (US, UK, Japan, Brazil, France, Germany, Italy, Spain, Canada, Australia, India, Mexico), and Food (pizza, burger, sushi, taco, ice cream, donut, cake, cookie, apple, banana, strawberry, watermelon). Each theme needs at least 12 unique emoji so that the 6x6 grid (18 pairs) works. Difficulty levels change the grid size: Easy is 4x4 (8 pairs), Medium is 4x5 (10 pairs), and Hard is 6x6 (18 pairs).
Render the grid using CSS Grid with equal-sized square cards that have rounded corners (8px). Each card has a front face (showing a question mark or decorative pattern) and a back face (showing the emoji). Implement the flip animation using CSS 3D transforms with perspective (1000px) and rotateY, transitioning over 0.4 seconds with an ease-in-out curve. The card front and back should use backface-visibility: hidden. When a card is face-up, apply a subtle glow effect matching the accent color.
Game logic: clicking a card flips it to reveal the emoji. When two cards are face-up, compare them after a 0.6-second delay. If they match, keep both face-up and add a brief scale-up pulse animation to celebrate. If they don't match, flip both back. Prevent clicking a third card while two are being compared, and prevent clicking an already-matched card or the same card twice.
Display a move counter (each pair flip counts as one move), a running timer that starts on the first card click (format MM:SS), and the number of pairs found out of total. When all pairs are matched, show a win celebration: a modal overlay with confetti animation (CSS keyframes with colored dots falling), final stats (time, moves, a star rating based on moves — 3 stars if under 1.5x pairs, 2 stars if under 2.5x, 1 star otherwise), and buttons for "Play Again" and "Change Theme."
Implement high score tracking in localStorage: store the top 5 scores per difficulty level, sorted by fewest moves (time as tiebreaker). Show a "High Scores" button on the menu that opens a modal with a tab for each difficulty. Highlight if the player just set a new record.
Make it fully responsive: on mobile, cards should be smaller (min 60px) and the grid should fit the viewport width with appropriate gaps (6px). Add touch support — tapping a card flips it. Include a restart button (circular arrow icon) in the header that resets the current game. Add a mute toggle for optional click/match/win sound effects using the Web Audio API (short synthesized tones, no audio files needed).
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
Custom Image Themes
Replace emoji with custom image pairs using base64-encoded PNGs or SVGs for branded card decks like company logos or product photos.
Multiplayer Mode
Add a two-player mode where players take turns. Track each player's matched pairs separately and declare a winner at the end.
Timed Challenge
Add a countdown timer mode where players race to match all pairs before time runs out. Adjust time limits per difficulty level.
Power-Ups
Add special cards that grant power-ups when matched: "Peek" reveals all cards for 2 seconds, "Freeze" stops the timer for 10 seconds.
Daily Challenge
Generate a daily seed-based shuffle so all players get the same layout. Show a global-style leaderboard for the day's challenge.
Accessibility Mode
Add color-coded borders, ARIA labels for screen readers, and a text-only mode for visually impaired players to enjoy the game.
SEO Tips
Target "free memory card game online" and "memory matching game" — casual browser game keywords with 30K+ monthly searches and moderate competition.
Create theme-specific pages like "animal memory game for kids" or "flag memory game" to capture educational and niche search traffic from parents and teachers.
Add FAQ schema answering "How does a memory card game improve brain function?" and "What age is memory matching good for?" to win featured snippets.
Include Game schema markup with playMode, numberOfPlayers, and genre to appear in Google's game-related rich results.
Write a blog post about "Brain Training Games You Can Play for Free" and link to your memory game as the top recommendation.
Monetization Ideas
Sell premium theme packs ($1.99 each) featuring custom artwork like space, underwater, or mythology themes with hand-drawn illustrations.
Add non-intrusive banner ads between game rounds — a natural break point where users expect to see content before starting a new game.
Offer a classroom license ($19/year) with student progress tracking, custom word-pair themes for vocabulary, and teacher dashboards.
Create a branded version service ($49) where businesses get their own memory game with company-themed cards for team building events.
Add a "Pro" tier ($2/month) that unlocks unlimited custom themes, advanced statistics, and the ability to create and share your own card sets.