I am so sorry that I am not concentrating for your project - hopefully this is correct - this looks like you could flip the shelf shape around the closet over - it is 16" wide on the now 40" side and 12" on the 65" side over the door.
I removed the full straight on the 40" side to make it work.
There are rulers on the edges for reference - open the photo and zoom it on your screen