/* Google Font*/
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&family=Roboto:wght@300;400;500&display=swap');

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

body {
    background: linear-gradient(0deg, rgb(0, 255, 123), rgb(1, 30, 1) 40%, rgb(0, 251, 255));
    font-family: 'Roboto', sans-serif;
    font-size: 1.125rem;
    font-weight: bold;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header a {
    position: fixed;
    left: 0;
    top: 0;
    margin: 20px;
    text-decoration: none;
}

.logo {
    padding: 0.2em 1em;
}

.btn-container button,
.btn-container select {
    margin-bottom: 20px; 
}

.head {
    text-align: center;
    padding: 0.5em 5em;
    font-family: 'Orbitron', sans-serif;
    font-size: 30px;
    text-shadow: 2px 2px orange;
}

#tips-btn {
    top: 50%;
    left: 50%;
    border: none;
    border-radius: 0.3em;
    padding: 1em 1.5em;
    cursor: pointer;
    background-color: rgb(13, 0, 255);
    font-size: 16px;
    color: white;
}

#tips-container,
#end-container {
    background-color: #f0f0f0;
    border-radius: 20px;
    width: 70%;
    border: 3px solid #94c4c7;
    padding: 10px 5px;
    line-height: 1.3em;
    position: fixed;
    z-index: 20;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 70%;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    display: flex;
}

#close-container,
#close-end-container {
    color: black;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.4rem;
}

h3 {
    color: red;
    text-align: center;
    font-size: 30px;
}

.btn-container {
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#memory-settings-grid,
#tips-btn,
#start {
    width: 100%;
}
#memory-settings-grid:hover,
#tips-btn:hover,
#start:hover {
    background-color: #0056b3;
}
.game-container {
    max-width: 800px;
    margin: 10px auto;
}

#details {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: row;
    height: 5vh;
}

#restart:hover {
    background-color: #0056b3;
}

.controls-container {
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    background: url('../images/number.jpg') no-repeat center center/cover;
    padding: 40px 60px;
    flex-wrap: wrap;
    width: 100%;
    height: 70vh;
}

#memory-settings-grid {
    font-size: 16px;
    background: rgb(13, 0, 255);
    color: white;
    height: 50px;
    text-align: center;
    cursor: pointer;
    border-radius: 0.3em;
}

button {
    border: none;
    border-radius: 0.3em;
    padding: 1em 1.5em;
    cursor: pointer;
    background-color:rgb(13, 0, 255);
    font-size: 16px;
    color: #fff;
}

/* Game Styles */
#card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; 
}


.card,
.card-front {
    text-align: center;
    position: relative;
    width: 15vw;
    height: 200px;
    max-width: 200px;
    max-height: 250px;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: transform 1s ease;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4em;
}

sup {
    margin-left: -0.09em;
    vertical-align: middle;
    line-height: 1.1;
    bottom: 15px;
    position: relative;
    font-size: smaller;
}

.card .view {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: xx-large;
    color: white;
    border-radius: 10px;
}

.front {
    background-color: #3498db;
    border: 2px white;
    z-index: 3;
}

.back {
    background-color: #c794a8;
    border: 2px white;
  
}

.hide {
    display: none !important;
}


#win {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 10vh;
}

/* Media queries */

@media screen and (min-width: 425px) and (max-width: 1024px) {
    .game-container {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 800px;
        margin: 0px auto;
    }
    
    #memory-settings-grid,
    #tips-btn,
    #start {
        width: 100%;
        margin-bottom: 10px;
    }
}

.open {
    border: 1px solid #fff;
    transform: scale(0.98);
}

.matched {
    border: 1px solid green;
}

@media screen and (max-width: 425px) {
    #tips-container,
    #end-container {
        width: 100%;
        height: 90%;
    }

    .head {
        font-size: 20px;
        padding: 1.5em 2em;
    }

    .logo {
        padding: 0.5em;
        padding: 0.1em 0.5em;
        font-size: 18px;
    }

    .btn-container {
        width: 150px;
    }

    #tips-btn,
    #memory-setting-grid,
    #start {
        display: block;
        margin: 10px auto;
    }

    h3 {
        font-size: 24px;
    }
}
.disable,
.match {
    pointer-events: none;
}

.card, .card-front {
    height: 150px;
    width:  70px;
}

#details {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: row;
    height: 8vh;
}