body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.title {
    color: #4CAF50;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    margin-right: 10px;
}

.btn:hover {
    background-color: #45a049;
}

.scoreboard {
    margin: 20px 0;
    font-size: 1.2em;
}

.color-picker {
    margin: 20px 0;
}

.timer {
    font-size: 1.5em;
    margin: 20px 0;
}

#game-board {
    width: 600px;
    height: 600px;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 2px;
    background-color: #ddd;
    margin: 20px auto;
    border: 2px solid #333;
}

.game-cell {
    background-color: #fff;
    border: 1px solid #e1e1e1;
}

.food {
    background-color: red;
}

.mobile-controls {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 200px; /* Adjust as necessary */
}

.control-btn {
    padding: 15px;
    margin: 5px;
    font-size: 16px;
    border: 1px solid #333;
    border-radius: 50%; /* Circular buttons */
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    width: 100px; /* Adjust as necessary */
    height: 100px; /* Adjust as necessary */
}

/* Positioning the buttons */
#upBtn {
    order: 1;
    grid-column: 2;
    grid-row: 1;
}

#leftBtn {
    order: 2;
    grid-column: 1;
    grid-row: 2;
}

#downBtn {
    order: 3;
    grid-column: 2;
    grid-row: 3;
}

#rightBtn {
    order: 4;
    grid-column: 3;
    grid-row: 2;
}

@media screen and (max-width: 1000px) {
    .mobile-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }

    .instructions {
        display: none; /* Hide the instructions on mobile */
    }


}


/* The switch - the box around the slider */
/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 40px; /* Reduced width */
    height: 22px; /* Reduced height */
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px; /* Match the height for rounded corners */
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; /* Reduced height */
    width: 18px; /* Reduced width */
    left: 2px; /* Adjusted for smaller size */
    bottom: 2px; /* Adjusted for smaller size */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(18px); /* Adjusted for smaller size */
}

/* ... existing CSS ... */

.container {
    position: relative; /* Establish a positioning context */
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: center; /* Center content */
}

.instructions {
    position: absolute; /* Absolute position for the instructions */
    left: 200px; /* Adjust as needed */
    top: 400px; /* Adjust as needed, align with game board */
    width: 250px; /* Set a fixed width for the instructions */
    height: 350px;
    padding: 20px;
    border: 1px solid #ccc; /* Optional: adds a border around the instructions */
    border-radius: 5px; /* Optional: rounds the corners of the instructions box */
    background-color: #f9f9f9; /* Optional: sets a background color for the instructions box */
    box-shadow: 0 0 5px #ccc; /* Optional: adds a shadow to the instructions box */
    font-size: 1.1em;
}




/* ... existing CSS ... */


.game-mode {
    margin: 20px 0;
}

.game-mode select {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #333;
}


/* ... existing CSS ... */