/* Asterisk wildcard selector to override default styles added by the browser */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Add general styles */
body {
    background: url('../images/porsche911turbos.avif') center / cover no-repeat fixed;
}

h1 {
    text-decoration: underline;
}

h1,
h2,
h3 {
    text-transform: uppercase;
}

button:hover {
    cursor: pointer;
}
.hide {
    display: none;
}
#submit {
    width: 50%;
    padding: 5px;
    color: black;
    border: 2px solid #29250D;
    border-radius: 5px;
}

#heading {
    text-align: center;
    color: white;
    font-size: 35px;
    font-weight: bold;
}

.description {
    text-align: center;
    color: white;
    margin: 20px 10%;
}

.description>h2 {
    text-decoration: underline;
}

/* How to play section */
#how-to-play {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    flex-direction: column;
    align-items: center;
}

.htp-btn {
    width: 80%;
    height: 50px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    max-width: 400px;
    cursor: pointer;
}

#how-to-play-box {
    /* Hides the content until the how to play button is clicked */
    display: none;
    /* Style the how to menu */
    position: fixed;
    z-index: 999;
    background: url('../images/lamborghinisvj.avif') center / cover no-repeat fixed;
    border: none;
    color: white;
    height: 100%;
    width: 100%;
    bottom: 0;
}

.htp-text {
    /* Aligns text to the center of the screen */
    padding: 150px 10%;
    text-align: center;
    font-size: 1.2rem;
    background-color: rgba(0, 0, 0, 0.4);
    height: 100%;
}

.htp-text h2 {
    padding-bottom: 10px;
}

.high-score {
    width: 80%;
    height: 50px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    max-width: 400px;
    cursor: pointer;
    margin-top: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Displays the close button 'X' in the top right corner of a screen */
#close-btn {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 50px;
    cursor: pointer;
}

/* Game area section */
.game-screen {
    display: none;
    height: 100vh;
}

#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* This css aligns each game mode to the center of the page, creates the size, border and colors */

.game-overlay {
    z-index: 100;
    color: white;
    font-size: 14px;
    position: relative;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
}

#game-btn-bhp {
    background: url('../images/lambohuracanperf.avif') center / cover no-repeat;
}

#game-btn-speed {
    background: url('../images/porschecarreragt.jpeg') center / cover no-repeat;
}

#game-btn-price {
    background: url('../images/koenigseggjeskoabsolut.avif') center / cover no-repeat;
}

.game-box {
    width: 90%;
    height: 50vh;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #29250D;
    border-radius: 10px;
    margin: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.overlay {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
}

.overlay>button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px 60px;
    margin-bottom: 5px;
    border: 1px solid white;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 700;
    /* Put the higher or lower buttons above the next cars information in the center of the screen */
    position: absolute;
    bottom: 80%;
}

#higher-btn {
    margin: 80px;
}

.overlay>p {
    text-align: center;
    font-weight: 600;
    font-size: 30px;
}

/* Game image styling */
#prev-car,
#next-car {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 50;
    width: 100%;
    height: 50%;
}

#prev-car img,
#next-car img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

#score {
    position: absolute;
    z-index: 55;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border: 1px solid white;
    border-radius: 30px;
    font-size: 30px;
    left: 20px;
    top: 20px;
}

#score div {
    padding: 5px 0;
}

#game-end-img {
    width: 100%;
    height: 100%;
    z-index: -1;
    position: fixed;
    object-fit: cover;
}

#game-end-menu {
    display: none;
}

.game-end-menu {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.overlay-menu {
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
}

#play-again-btn,
#main-menu-btn {
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border: 1px solid white;
    border-radius: 30px;
    font-size: 30px;
    margin-top: 5px;
}

#final-score {
    font-size: 40px;
}

/* Footer */
footer {
    padding-top: 10px;
    text-align: center;
    color: white;
}

#footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#site-build {
    order: 0;
    font-size: 20px;
}

#linkedin {
    order: 1;
    padding-left: 20px;
    font-size: 50px;
}

#github {
    order: 2;
    padding-left: 20px;
    font-size: 50px;
}

/* My media links */
a {
    color: gold;
}

/* Highlight icon when mouse hovers */


/* Media queries */

/* Media query: tablets and larger (768px and up) */

@media screen and (min-width: 768px) {

    /* Add max width to the game box selectors for cleaner look. */
    .game-box {
        max-width: 500px;
    }

    .description {
        margin: 20px 30%;
    }
    #close-btn {
        left: 20px;
    }
}

/* Large devices (laptops and desktops, 992px and up) */

@media screen and (min-width: 992px) {
    #game-area {
        flex-direction: row;
        justify-content: space-around;
    }

    a:hover {
        color: white;
    }

    .htp-btn:hover {
        color: black;
        background-color: rgba(250, 250, 250, 0.7);
        transition: transform 0.4s ease;
        /* Increase the size of the button by 5% when mouse is hovered */
        transform: scale(1.05);
    }

    .game-box:hover {
        /* Transition sets the hover effect to happen slowly, this gives a sleek finish */
        transition: transform 0.4s ease;
        transform: scale(1.03);
    }
    #close-btn {
        top: 0;
        left: 5px;
        font-size: 100px;
    }
    #close-btn:hover {
        color: red;
    }

    #higher-btn:hover,
    #lower-btn:hover,
    #play-again-btn:hover,
    #main-menu-btn:hover {
        color: black;
        background-color: rgba(250, 250, 250, 0.7);
        transition: transform 0.3s ease;
        transform: scale(1.1);
    }  
}