* {
    /* CSS reset */
    box-sizing: border-box;
    margin: 0;
    padding: 0;

    /*  
        Prevent zoom when double tapping on mobile,
        as that can move the grid out of sight 
        when using the control pad
    */
    touch-action: manipulation; 
}

body {
    background-color: #091109;

    color: #ccfbe8;

    font-family: 'Averia Libre', cursive;
}

#ctn_app {
    display: flex;
    flex-direction: column;
    padding: 5vmin;
}

@media(orientation: landscape) {
    #ctn_app.mobile {
        flex-direction: row;
    }
}

#main_panel {
    text-align: center;
    align-self: center;
    flex: 0 1 25%;
}

#game-title {
    margin-bottom: 24px;
    font-size: 3rem;
}

#game-controls {
    margin-top: 24px;
}

.game_btn {
    background-color: #243424;
    color: #ccfbe8;
    padding: 1vh;
    width: 92px;
    border-style: none;
    border-radius: 20%;
    cursor: pointer;
    text-transform: uppercase;
    margin-right: 4px;
}

#main_grid {
    background-color: #243424;
    width: 60vmin;
    height: 60vmin;
    margin: 32px auto;

    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
}

.snake {
    background-color: #0bf40a;
}

.food {
    background-color: #c83c3a;
}

#control-pad {
    text-align: center;
    align-self: center;
    margin-top: 50px;
}

#control-pad.desktop {
    display: none;
}

#control-pad.mobile {
    display: block;
}

.cpad_button {
    padding: 5.5vh;
    background-color: gray;
    border-style: none;
    border-radius: 20%;
    opacity: 33%;
}

#btn_pad_up {
    margin-bottom: 2.5vh;
}

#btn_pad_down {
    margin-top: 2.5vh;
}

#ctn_game-over-screen {
    display: none;
}

#bg_game-over-screen {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

#msg_game-over-screen {
    position: fixed;
    
    /* Centralize with fixed positioning */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #ccfbe8;
    color: #091109;
    padding: 100px;
    text-align: center;
}

#msg_game-over-text {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

#msg_new-best-score {
    display: none;
}

footer {
    text-align: center;
    margin-top: 16px;
    font-size: small;
}

