Gill hits ton as Punjab beats Karnataka in thriller