@import url('https://fonts.googleapis.com/css2?family=Nerko+One&display=swap');

* {
    padding: 0;
    margin: 0;
    font-family: "Nerko One", cursive;
    font-weight: 400;
    font-style: normal;
    box-sizing: border-box;
}

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

.body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 20px;
    color: white;
    margin-bottom: 20px;
}

#Gamername, #scored {
    font-weight: bold;
}

#board {
    background: linear-gradient(rgb(14, 192, 199), rgb(170, 101, 170));
    width: 90vmin;
    height: 90vmin;
    border: 2px solid rgb(233, 2, 2);
    border-radius: 10px;
    display: grid;
    grid-template-rows: repeat(18, 1fr);
    grid-template-columns: repeat(18, 1fr);
}

.snake, .head {
    background: linear-gradient(rgb(14, 199, 29), rgb(201, 46, 201));
    border-radius: 5px;
    border: 2px solid wheat;
}

.food {
    background-color: rgb(255, 74, 255);
    border-radius: 50%;
}

#scored, #highscore {
    position: relative;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: #bf3dc8;
    border: 2px solid red;
    border-radius: 8px;
    width: auto;
    text-align: center;
    padding: 5px 10px;
    margin: 5px 0;
    z-index: 1;
}

#highscore {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: #bf3dc8;
    border: 2px solid red;
    border-radius: 8px;
    padding: 5px 10px;
    width: auto;
}

.controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Arrow controls for PC (Left side) */
.arrow-controls {
    position: fixed;
    top: 50%;
    left: 10px; /* Position at the left side */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.arrow-controls .horizontal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Up, Down, Left, Right Button Styles */
.control-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    border: 2px solid black;
    background-color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background-color: lightgray;
}

/* Make Arrow Buttons Display Like Keyboard Arrows */
#up {
    margin-bottom: 10px;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* For Mobile: Position arrows at the bottom */
@media screen and (max-width: 768px) {
    #board {
        width: 100vw;
        height: 100vw;
    }

    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* Move arrow controls to bottom for mobile */
    .arrow-controls {
        position: fixed;
        bottom: 20px; /* Position at the bottom */
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        gap: 10px;
    }

    .arrow-controls .horizontal-controls {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    /* Adjust button sizes and spacing for mobile */
    #up {
        margin-bottom: 10px;
    }

    #left, #right {
        margin: 0 10px;
    }

    #down {
        margin-top: 10px;
    }
}

footer {
    clear: both;
    border: 1px groove #aaaaaa;
    background: rgb(54, 53, 53);
    color: White;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    line-height: normal;
    margin: 0;
    position: fixed;
    bottom: 0px;
    width: 100%;
  }
  
  a {
    color:rgb(111, 166, 214);
    text-decoration: none;
  }

