@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;700&display=swap');

* {
    margin: 0;
    box-sizing: border-box;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 62.5%;
    height: 100%;
}

body {
    display: flex;
    min-height: 95vh;
    max-width: 95vw;
    margin: auto;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
    font-size: 2rem;
    line-height: 4rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    color: white;
    background-color: #404040;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    padding-top: 2rem;
}

h1 {
    text-align: center;
    font-size: 4.5rem;
    padding-bottom: 1rem;
}

h2 {
    text-align: center;
    font-size: 3.5rem;
    padding-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

/* nav */
nav {
    font-weight: 700;
    margin: 2rem;
    position: relative;
    display: flex;
    justify-content: center;
}

nav a {
    padding: 1rem 0.9rem;
    border: none;
    background-image: linear-gradient(to bottom right,rgba(182, 182, 182, 0.5), rgba(0, 0, 0, 0.65));
    border-radius: 2.5rem;
}

.nav-buttons {
    padding: 0 1rem;
    text-align: center;
}

/* home page */
/* start button */
#start-button {
    height: 100%;
    width: 10rem;
    margin: 0px 0.5rem;
    border: none;
    background-color: inherit;
    font-family: inherit;
    background-image: linear-gradient(to bottom right, rgba(252, 189, 15, .6), rgba(0, 0, 0, 0.65));
    border-radius: 2.5rem;
    font-weight: 700;
    font-size: inherit;
    cursor: pointer;
    text-align: center;
}

/* cards */
#card-grid {
    flex-grow: 1;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    max-width: 47rem;
    margin: 0 auto;
    cursor: auto;
    align-content: center;
}

.column {
    perspective: 1000px;
    -webkit-perspective: 1000px;
    width: calc(25% - 1rem);
    position: relative;
    margin: 5px;
    align-items: center;
}

.thirds{
    width: calc(33.333% - 10px);
}
  
.card {
    transform-style: preserve-3d;
    transition: transform 0.6s;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
    height: 100%;
    vertical-align: middle;
}

.card-faces {
    border-radius: 10%;
    width: 100%;
    height: 100%;
    display: block;
    box-shadow: 4px 4px 4px black;
}

.inner-face, .outer-face {
    transition: transform 0.6s;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    visibility:visible;
}

.inner-face {
    transform: rotateY(180deg);    
    -webkit-transform: rotateY(180deg);
    position: absolute;
}

.column > .flipped {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.column > .match {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    cursor: auto;
}

/* reset button */
#reset-button, #cookie-button {
    display: block;
    height: 4.5rem;
    width: 28rem;
    margin: 1rem auto 0 auto;
    border: none;
    background-color: inherit;
    font-family: inherit;
    background-image: linear-gradient(to bottom right,rgb(255, 61, 181, .6), rgb(0, 0, 0));
    border-radius: 2.5rem;
    font-weight: 700;
    font-size: inherit;
    cursor: pointer;
    text-align: center;    
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    cursor: pointer;
}

/* button actions */
button:hover {
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.4);
    transform: scale(1.03);
}

button:active{
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
    transform: scale(.98);
}

/* game modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 25rem;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: black;
    margin: auto;
    padding: 20px;
    border-radius: 2.5rem;
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80%;
    transform: translateX(-50%) translateY(-50%);
    font-weight: 700;
}

input[type=text] {
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    padding: 1rem 2rem;
    width: 24rem;
    display: inline-block;
    border: 1px solid black;
    border-radius: 1rem;
}

input[type=submit] {
    display: block;
    height: 3.5rem;
    width: 11rem;
    margin: 1rem auto 0 auto;
    border: none;
    background-color: inherit;
    font-family: inherit;
    background-image: linear-gradient(to bottom right,rgb(58, 216, 255, 0.7), rgb(0, 0, 0));
    border-radius: 2.5rem;
    font-weight: 700;
    font-size: inherit;
    cursor: pointer;
    color: inherit;
    color: rgb(58, 216, 255);
}

/* rule page */
#game-rules {
    text-align: center;
    padding: 4rem 5rem;
}

/* scoreboard */
ul {
    padding-top: 2rem;
    text-align: center;
}

li {
    display: flex;
    width: 100%;
}

#scoreboard-layout {
    flex-grow: 1;
    margin: auto;
    width: 50rem;
    text-align: center;
}

li span {
    text-align: center;
    padding: 0 2rem;
}

.clear {
    text-align: center;
    font-size: smaller;
}

#scoreboard {
    height: 100%;
    width: 50rem;
    margin: auto;
    text-align: center;
}

#scoreboard li {
    padding: 0px 3rem;
    justify-content: space-between;
    text-decoration: none;
    list-style-type: none;
}

#scoreboard li:first-child {
    font-weight: 700;
    justify-content: space-around;
}

/* footer */
footer {
    position: relative;
    font-weight: 700;
    text-align: center;
    font-size: 1.5rem;
    color: rgb(252, 189, 15);
}

/* font colors */
.pink {
    color: rgb(255, 61, 181);
}

.orange {
    color: rgb(252, 189, 15);
}

.yellow {
    color: rgb(238, 255, 0);
}

.green {
    color: rgb(70, 255, 45);
}

.blue {
    color: rgb(58, 216, 255);
}

.purple {
    color: rgb(187, 23, 219);
}

/* for screens sizes from 572px wide and down */
@media screen and (max-width: 572px){
    header {
        padding-top: 1rem;
    }

    nav {
        margin: auto;
        width: 100%;
    }

    li span {
        font-size: 1.5rem;
    }
    
    nav a {
        font-size: 1.5rem;
        padding: 1rem 0.9rem;
        background-image: linear-gradient(to bottom right,rgba(182, 182, 182, 0), rgba(0, 0, 0, 0));
    }
    
    #game-rules {
        padding: 0;
    }

    .nav-buttons {
        padding: 0;
        text-align: center;
    }

    #start-button {
        padding: 1rem 0;
        font-size: 1.5rem;
        width: 6rem;
        margin: 0;
        font-size: 1.5rem;
    }

    #reset-button, #cookie-button {
        height: 3rem;
        font-size: 1.5rem;
        width: 16rem;
    }
}

/* for screens sizes from 450px wide and down */
@media screen and (max-width: 450px){
    h1 {
        font-size: 4rem;
    }

    input[type=text] {
        padding: 0.5rem 0.5rem;
        margin: 1rem 0;
        width: 17rem;
    }

    .reset-parent {
        display: grid;
        justify-content: center;
        align-content: center;
    }

    #scoreboard-layout {
        height: 100%;
        width: 100%;
    }

    #scoreboard {
        width: 100%;
    }

    .column {
        width: calc(33.33% - 1rem);
    }

    #card-grid {
        max-width: 28rem;
    }
}

/* for screens sizes from 312px wide and down */
@media screen and (max-width: 312px){
    nav {
        flex-flow: column;
    }
}