* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.body {
    background: url("../bg.jpg");
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.instructions {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 90%;
    text-align: center;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.instructions h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.instructions p {
    font-size: 1rem;
    margin-bottom: 10px;
}

.instructions ul {
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
}

.instructions li {
    font-size: 1rem;
    margin: 5px 0;
}

.score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
}

#board {
    background: linear-gradient(rgb(170, 236, 170), rgb(236, 136, 167));
    width: 90vmin;
    height: 90vmin;
    border: 2px solid black;
    display: grid;
    grid-template-rows: repeat(18, 1fr);
    grid-template-columns: repeat(18, 1fr);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.head {
    background-color: red;
    border-radius: 50%;
    border: 1px solid darkred;
    transform: scale(1.1);
}

.snake {
    background-color: green;
    border-radius: 50%;
    border: 1px solid darkgreen;
}

.food {
    background-color: purple;
    border-radius: 50%;
    border: 1px solid darkpurple;
    transform: scale(0.9);
}

.game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    text-align: center;
    font-family: Arial, sans-serif;
}

.game-over h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-over p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.game-over button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: #ff4040;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.game-over button:hover {
    background-color: #e03333;
}

@media (max-width: 600px) {
    .instructions h2 {
        font-size: 1.5rem;
    }

    .instructions p, .instructions li {
        font-size: 0.9rem;
    }

    .score-board {
        font-size: 1.2rem;
        padding: 8px 15px;
        top: 10px;
        left: 10px;
    }

    #board {
        width: 80vmin;
        height: 80vmin;
        border-width: 1px;
    }

    .head, .snake, .food {
        transform: scale(1);
    }

    .game-over {
        padding: 15px 30px;
    }

    .game-over h1 {
        font-size: 2rem;
    }

    .game-over p {
        font-size: 1.2rem;
    }

    .game-over button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .instructions h2 {
        font-size: 1.2rem;
    }

    .instructions p, .instructions li {
        font-size: 0.8rem;
    }

    .score-board {
        font-size: 1rem;
        padding: 5px 10px;
        top: 5px;
        left: 5px;
    }

    #board {
        width: 75vmin;
        height: 75vmin;
    }

    .game-over {
        padding: 10px 20px;
    }

    .game-over h1 {
        font-size: 1.5rem;
    }

    .game-over p {
        font-size: 1rem;
    }

    .game-over button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}