Why does the ending of the word вино change to вина in the sentence:
у меня нет вина.

but the word пива remains the same in a similar sentence:
у меня нет пива.

What grammar rule is at play here?