It sounds like you have an issue with the master cylinder. The reason it goes to the floor with the engine running is because you have assist from the brake booster. When the engine is off, you no longer have this assistance so the brake feels harder.
When you have a leak internally to the master cylinder you wont see a leak on the outside. Just to confirm, you need to ensure you have no external leak because you didn't mention that.
I included a test for the brake booster as well. You will want to ensure you don't have an issue here before you replace the master cylinder because there are times that this can fail and cause similar issues. However, based on what you described, it sounds like a master cylinder issue.
Here are a couple guides that you should review as well:
Images (Click to enlarge)
Sunday, May 12th, 2019 AT 5:08 PM