Changing the CSS code shouldn't affect the JavaScript functionality as long as you're not modifying the CSS classes or IDs used in the JavaScript code. JavaScript code usually interacts with HTML elements through CSS selectors, so if you modify the class or ID names used in your HTML or CSS code, it could potentially break the JavaScript functionality.
That being said, starting from scratch might not be the best approach, especially if the JavaScript code is already working as intended. Instead, I would recommend making a copy of the existing CSS file and working on it separately, making changes incrementally and testing each change to ensure that it doesn't affect the JavaScript functionality.
If you're having trouble targeting the right elements, you can use browser developer tools to inspect the HTML and CSS code and see how the current layout is constructed. This should help you identify which elements to modify and which CSS selectors to use.