Court rules against teen in marijuana cookie case