Oh jez...if mine did that I'd have passed out! I hate electrical issues because I stink at them.
However, could you get a general location of that relay you heard clicking? I'm asking as they are a bunch of them in our cars. There are like four or five right in the cockpit. The clicking should be the contacts pulling in & out as it lost power to keep them in. This could be a feed or a ground that was becoming intermittent....on our cars I would say a ground is a good bet unless your battery is leaving. It may not be dead, but rather have a cell or two that are becoming shorted and that would cause a voltage drop. I think I would look to see as many grounds as I could find to eye up, and then I would test the battery for both voltage and do a hydrometer test or a load test if you have a load tester.
One time my car behaved like that I had left something on & I killed my battery. I opened the door and all I had was I think the relay that does the interior lights' delay timer doing that clicking thing before everything went dark.

Tom