What about Dirty Dreams?
Q: Can a dream be sin? Larry
A: Certainly, if it originates from within the person, and is unrighteous.
God judges the unrighteous for their thoughts, motives, words, and actions.
In fact, He reminds us the main reason He wiped every sinner off the face of the Earth, apart from Noah and his family, was because, Gen. 6:5-6 KJV;
…GOD saw that the wickedness of man was great in the earth, and that every imagination of the thoughts of his heart was only evil continually. And it repented the LORD that he had made man on the earth, and it grieved him at his heart.
To make that righteous judgment, and statement, the LORD had to know every thought of every person on Earth.