Notice that we are thinking about an impossible past condition.
You did not win the lottery. So the condition was not true, and
that particular condition can never be true because it is finished.
We use the Past Perfect tense to talk about the impossible
past condition. We usewould have + past participle to talk
about the impossible past result. The important thing about the
third conditional is that both the condition and result are
impossible now.
Look at these example senteces:
if
condition
result
Past Perfect
would have + past
participle
If
I had seen Mary,
I would have told her.
If
Tara had been free
yesterday,
I would have invited her.
If
they had not passed their
exam,
their teacher would have been
sad.
If
it had rained yesterday,
would you have stayed at
home?
If
it had rained yesterday,
what would you have done?