I am sure you can buy ticket on the bus
last bus leaves 23:15 as far as i can see here
http://www.ezadar.hr/clanak/gradski-red-voznje-liburnija
It seems the buses actually go right through the night, though with
diminished frequency (several official sources). In any case it was no problem
to get one at 22:50 (flight was about 40 mins late) and yes, you can buy the
ticket on the bus. So total cost: airport bus
25 Kuna Local Bus 8 Kuna door-to-door trip time just about 1 hour.
The airport bus driver was very helpful and friendly and spoke excellent
english and german - glad I didn't order that taxi for EUR53!