I mean I have tried HTML and Javascript, and looked into CSS, but unless you are using tools that make the game for you in html I would avoid this path, just because, at least with my experience, you are pretty much creating an engine itself which has a lot of technical aspects that must be dealt with on its own. If you are fine with beating your head against a brick wall as the way to learn code, trying to do it the hardest way possible, then continue as you are.
It depends on how much time you want to invest in making this or any other possible game idea in the future. The more time and energy you are willing to invest, the more you can control exactly what you want the game to be. If you don't have too much time and energy to learn, tools such as rpgmaker, twine with sugarcube plugin, or game maker (once a classic, now is pretty commercialized). These let you make games without having to code. Now the issue is the non standard stuff, because you can't fit that in these too well without having to get to coding. Renpy and Unity I would say would be your best bet if you want to learn to code. The issue is that you can't just jump in, everything is a blank canvas so there are no easy steps, so you need prior experience to be able to figure out how to create the things you want. IE i think originally renpy was more of a visual novel game, but by abusing the power of various systems and techniques, there were able to build a renpy game mechanism that wasn't originally designed to be part of renpy (such as maps). But there are tutorials. Unity, however, is a much more professionally oriented system. By professional, I mean, because it wasn't designed with anything in mind, it is more open ended, so its more like sitting in the middle of a lake with no shore in site, not really sure where to go or what to do or how to get anywhere. unity has one of the larger online communities which you can learn from, out of just about any software that would be used by most of the indie community, but not to say it is perfect for new users who are not yet mentally ready to handle technical oriented problem-solving.
A lot of the time coding is 4 parts: figuring out how to solve a particular problem with the coding knowledge you have (hence why prior knowledge helps), writing out the code itself, debugging the code to work, and in many cases modifying the code so that it works with all your other code (because it is hard to test things all together at first).
If you really want to get into the knowledge of coding and learning basic skills so that you can make some basic games, and work your way up to game engine logic eventually, but still be able to play with making a game fairly easily, I recommend looking up Processing dot org. It is a type of programming environment. it is similar to Java, but was designed for artist (not programmers) to create art with code. It basically removes all the technical parts of the code needed to make the graphics, but it is not as nearly as bloated with features like unity would be. I often used it to prototype game ideas to robot simulations years ago. The nice thing is that there are tons of tutorials to walk you through core ideas, from making buttons, drawing sprites, to the introduction of object-oriented programming, which is what just about every game system uses.
Java, C++, C#(unity), Python (renpy), and many more, are object-oriented programming language, and once you learn the idea of one language, you pretty much can code in the other languages as well. I would say C# is the most powerful one. With the processing thing I mentioned, it would not have game engine code itself, so you would have to experiment with code and understanding game logic an creating it yourself. Not too different from your HTML and Java stuff, but should be less technicall with the processing api in place. I use monogame engine, it is just a set of code that makes it easy to draw to the screen, and has a basic data managment system and game logic system, all in C#, but nothing else, using one's understanding of game logic and making systems, that is where one needs to start to eventually put a game together. not too different from renpy and unity which would be considered easier, but unity tends to be bloated and overwhelming for new users and renpy is half well documented and half still being explored and documented (such as the map idea, I don't know how well coding ideas have been shared online for that).
You could maybe search for a summary, but if you want I could give you a brief run through of key ideas and the concept of some code and game logic ideas, and tell you to run, but a lot of it will be coming down to, as you get experienced, you recognize particual problems or tasks that need to be done, know what kind of task it is and what kind of trick you need to use to solve it with code, and that kind of knowledge comes with experience. In the end it is all a matter of experience.
I do find that picking a project and beating your head against a wall, googling each step and issue along the way is the best way to learn, but don't expect this to get done in the next 3 to 8 years.
on a side note, I am working on a new way of programming. Rather than make code, you describe your idea, and it generate the code for you, but I am not even at a working prototype yet.