I had a '92 CX that did nearly the same thing, (it never got to the point where it shutdown). If I remember right, it's the main relay.
There was a similar problem posted here recently. When my main relay "went", because I didn't know what it was/where it was, I took it to my "honest" mechanic. The fix was $300. Reading the topic/thread on here, made me believe I paid about $250 too much....versus fixing it myself. I no longer have that car, or I would tell you where the relay in question is. Look on the various boards here, tho, you should find it.
Okay, I just went looking for the thread/posts on this Civic problem I thought I saw here....I guess my "meds" are wearing off. I can't find it here, so maybe I saw it on www.Honda-Acura.net. Either way, try that website for help. You have to register to post a question, but most of the info is available without registering....unlike other websites on the 'net.