<script>-tag is ruining my CSS?

Hello!

When I add the Javascript, the “grid”-function goes away. What is causing this?

Code in codepen: