I think this is the picture that a lot of junior developers miss. Sure, that 12-16 hour marathon session sounds horrible and unsustainable in many ways, but it's also the fastest way to achieve mastery (or realization, burnout and career change). There are obviously a ton of other variables involved, but time is the most important investment you can make. Ideally, you are also working with practical tools and compelling business requirements on a regular basis.
Assuming you survive the first 2-3 years of hell and approach that level of master, you are now in a position to back off your time commitment substantially because every second you spend working as a master is like a lifetime to an apprentice. Gains in mastery in this craft are NOT linear in my experience. It's more like a polynomial or exponential curve.
I also think time spent playing with abstractions in isolation from larger projects is also key to obtaining mastery. Much like trying to master a difficult piano concerto. You can't just play it from the top every time or you'd go insane. If you want to find the smartest guy in the room at a Microsoft shop, go look in everyone's users/[username]/source/repos path. Whoever has the highest numbered ConsoleApp wins the prize. Again, no substitute for practice and breaking things. Remember, there are zero consequences if you write shitty code and its still contained to your local machine. You can just type git reset --hard and go to lunch like nothing happened.