I haven't heard of this happening with 3DS, but my guess is that it's a short in the display cable that goes from the motherboard to the top screen. Happens all the time with laptops and other similarly-hinged electronics.

Best you can do is contact Nintendo and see how much repairs will be. Is it still under warranty?