It's a good question, it's not stupid. Actually, this phenomena can be observed with liquids and solids as well. Each element has its own distinct spectral line and this fact can and has been used to identify an element. However, it is much more difficult to observe the spectral lines of liquids and solids due to how close together the atoms are. Also, tables of the spectral lines of elements only seem to go up to the 99th element, Einsteinium (not including Astatine (At, 85) and Francium (Fr, 87).
I could not find any data as to why this may be, however, I believe it is simply because we could not test for the spectral lines of the heavier elements due to their instability and scarcity. It's incredible because some of the heavier and more unstable elements have insanely short half lives ranging from 100.5 days (the most stable isotope of fermium (Fm, 100)), to 0.69 microseconds (0.00069 milliseconds) (Oganesson (Og, 118)). This would make measuring their spectral lines nearly impossible. This isn't even considering how much this would cost. These heavier elements likely have their own spectral lines, however, due to all I stated above, it isn't exactly possible to measure.
I hope this helped,
You can see a list of of all the known spectral lines of elements on Wikipedia since it seems to have the most updated table. mostly all textbooks on the spectral lines of elements tend to only go up to uranium, however, textbooks go into much more detail for each element.