98 Honda Civic Engine Power Loss

Engine randomly loses power while driving/idling/cold/hot. Stereo and lights still have power. Sometimes I hear brief clicking noise in my dash when it dies. Starts after several turnovers. Replaced main relay. Lost power again today. Any thoughts?