I actually like your pace and the places you travel to. It is a little rushed. I donft think going to both Matsumoto Castle and Himeji Castle is out of line.
For Tokyo, I would suggest you stay near Shinjuku Station. I think you should add an extra day in Tokyo. There are good passes that can be purchased that start at Shinjuku Station. You mentioned Hakone, Fuji Five Lake, and Yokohama, and all of these are good side trips. If there is a nostalgic reason to visit Yokohama, go. Others have mentioned Kamakura and there is a nice ticket to visit there, as well as Endoshima. I am also including a link to IC cards. I have included the combined Hakone/Kamakura pass, too. There are all sorts of flavors of Fuji passes, so Ifm just going to leave a general link.
https://www.japan-guide.com/e/e2359_003.htmlhttps://www.japan-guide.com/e/e6905.htmlhttps://www.japan-guide.com/e/e2358_008.htmlhttps://www.japan-guide.com/e/e2358_003.htmlhttps://www.japan-guide.com/e/e2361_hakone_kamakura.htmlFrom Tokyo, I believe you are in the Bus section of your trip. It makes sense to travel by bus around Takayama, and to get to Kanazawa. I am also going to suggest that you take a bus from Shinjuku to Takayama. You can get a round trip bus pass from Takayama to Matsumoto, so I would do a day trip from Takayama. A link to Nohi Bus Line, which is based in Takayama.
Going to Takayama by train: 3 1/2 hours, 15,190 yen
Going to Takayama by bus: 5 3/4 hours, 7,000 yen
If you can sleep on a bus, you could do the overnight one.
https://www.nouhibus.co.jp/english/When you leave Kanazawa, I think you should just pay for a train ticket. For the most part, it is best to tour Kyoto by a daily bus pass.
After leaving Kyoto, squeeze Hiroshima, Miyajima, Okayama, and Himeji together, and eventually end up in Osaka. I think the Kansai Hiroshima pass will work.
https://www.japan-guide.com/e/e2361_kansai_hiroshima.htmlI hope I have given a framework that allows you to do your trip. I moved a few things around, so that it might be more cost effective.
Good Luck, in planning your trip.