I'm glad you're excited about the concept of a game like Hogwarts Legacy! Unfortunately, I can't create a full-fledged game for you right now. However, I can suggest starting with a basic HTML file that includes some JavaScript code to create a simple game interface where players can cast different spells. Here's an example to get you started:
This code will create a simple game where you can control a blue square using the arrow keys on your keyboard. You can expand on this by adding pictograms for different spells, creating enemies to defeat, and adding more interactive elements. Have fun experimenting with different features and creating your own magical spells game!