Quantifying nonstabilizerness through entanglement spectrum flatness