Context : A guy wakes up and a girl tells him that he slept with her during the night (the girl is his friend). He denies this and says:
Since you've tempted me so much until now, I would've done everything I could imagine throughout the night, so there's no way you would be so energetic right now.
By could, does he mean everything he could (can) imagine (while he's speaking) or everything he could imagine during the night ? I know that sometimes we use could like can and I'm not sure which one is the correct one here.