One final point, Japanese castles did not have underground structures like dungeons, cellars or tunnels - except for one.

I mentioned having visited Matsue Castle in Shimaneken. This castle is unique in that it had a tunnel that connected the main fortress with one of the outlying lesser fortresses, primarily for missle assaults - the outlying tower defended a corner of the outer wall. I thought is was cool at the time, I got to visit the unique castle.

Regarding Himeiji castle, as it was built in 1592, defense from artillery was a big deal for that castle and the moat system included 3 different moats the furthest to prevent ranged guns to reach the main castle itself (at least in the technology available at the time of construction.)

These moats are deep, about 60 feet deep, were generally dry moats with stone walls encasing the the moat walls. Some of these moats were 100 feet across. The bridged lands that crossed the moats were located on different sides of the castle forcing attackers to have to move around the castle to reach the next bridge to cross the next moat.

GP