Phase transitions in two-dimensional cosmology and polymer systems