html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #ffffff url('../img/geometry2.png'); /* Background pattern from Subtle Patterns */
    font-family: 'Coda', cursive;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

h1 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
}

/*
 * Styles for the idle buttons of deck
 */

.idle {
    position: relative;
}

.idle .btn_container {
    position: absolute;
    min-width: 660px;
    min-height: 680px;
    border-radius: 10px;
    top: 0;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15em;
    color: rgba(255, 255, 255, 0.5);
}

.btn_container .fa:hover {
    transform: scale(1.1);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: transform 0.3 ease, color 0.3 ease;
}

.btn_container.hide {
    display: none;
}

/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 32px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 3em;
}

.deck .card {
    height: 125px;
    width: 125px;
    background: #2e3d49;
    font-size: 0;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);

    transform: rotateY(180deg) scale3d(1, 1, 1);
    transition: transform 0.2s linear, background 0.2s;
}

.deck .card.open {
    transform: rotateY(0deg);
    background: #02b3e4;
    cursor: default;
    transition: transform 0.2s linear;
}

.deck .card.show {
    font-size: 33px;
}

.deck .card.match {
    cursor: default;
    background: #02ccba;

    animation: matched 0.2s;
    transition: background 0.2s;
}

.deck .card.unMatched {
    cursor: default;
    background: #f22;

    animation: matched 0.2s;
    transition: background 0.2s linear;
}

/* Animation for matched cards. */
@keyframes matched {
    50% {transform: scale3d(1.15, 0.85, 1);}
}

/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: left;
    width: 345px;
    margin-bottom: 10px;
}

.score-panel .stars {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
}

.score-panel .stars li {
    list-style: none;
    display: inline-block;
}

.score-panel .restart {
    float: right;
    cursor: pointer;
}

.score-panel .pause {
    float: right;
    margin-right: 1em;
    cursor: pointer;
}

.score-panel .time {
    float: right;
    margin-right: 1em;
}

/*
 * Style for the score-board
 */
.score-board {
    position: absolute;
    top: 35%;
    width: 500px;
    background-color: white;
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.9));
    border: 1px solid black;
    border-radius: 12px;
    box-shadow: 5px 5px 5px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translate(0, -9999px);
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.score-board.show {
    transform: translate(0, 0);
    opacity: 1;
    transition: opacity 1s ease, transform 0.3s ease;
}

.score-board .stats {
    list-style: none;
    margin: 0 auto 15px;
    text-align: left;
    width: 200px;
}

.stats_rating ul {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
}

.stats_rating ul li {
    list-style: none;
    display: inline-block;
}

.btn {
    margin: 0 3px 15px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 110%;
    color: white;
    background: linear-gradient(rgba(0, 180, 20, 0.7), rgba(0, 180, 20, 0.9), rgba(0, 180, 20, 0.7));
    border: 2px dotted green;
}

.btn:focus{
    border: 1.5px solid darkblue;
    outline-style: none;
}

.btn:hover {
    cursor: pointer;
    box-shadow: 2px 2px 10px 1px rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    background: linear-gradient(rgba(0, 220, 0, 0.7), rgba(0, 220, 0, 0.9), rgba(0, 220, 0, 0.7));
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.8);
    transition: scale 0.3s ease, text-shadow 0.3s ease-out;
}

.btn.close {
    background: linear-gradient(rgba(180, 0, 20, 0.7), rgba(180, 0, 20, 0.9), rgba(180, 0, 20, 0.7));
}

/*
 * Pop up windows.
 */
 .pop-up {
     position: absolute;
     top: 25%;
     min-width: 500px;
     background-color: white;
     background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.9));
     border: 1px solid black;
     border-radius: 12px;
     box-shadow: 5px 5px 5px 2px rgba(0, 0, 0, 0.3);
     text-align: center;

     transform: translate(-9999px, 0);
     opacity: 0;
     transition: opacity 1s ease, transform 1s ease;
}

.pop-up.show {
    transform: translate(0, 0);
    opacity: 1;
    transition: opacity 1s ease, transform 0.3s ease;
}

.start-up ul {
    list-style: none;
    padding: 0;
    margin: 0 auto 10px;
}

/* Styles for player name placeholder */
.start-up input {
    padding: 3px 5px;
    margin-left: 5px;
    width: 10em;
    border-radius: 8px;
}

.start-up input.invalid {
    animation: wrongInput 1s linear;
}

.start-up.invalid {
    animation: wrongAction 1s linear;
}

@keyframes wrongInput {
    50% {background: red;}
}

@keyframes wrongAction {
    50% {border: 2.5px solid red;}
}

/*
 * Styles for different screens with @media.
 */

/* Large screen styles */
@media screen and (max-width: 750px) {
    /* Idle action button style */
    .idle .btn_container {
        min-width: 520px;
        min-height: 520px;
    }

    .deck {
        width: 520px;
        min-height: 520px;
    }

    .deck .card {
        width: 100px;
        height: 100px;
    }

    .deck .card.show {
        font-size: 26px;
    }

    .pop-up, .score-board {
        max-width: 500px;
    }
}

/* Styles for medium screens */
@media screen and (max-width: 580px) {
    /* Idle action button style */
    .idle .btn_container {
        min-width: 400px;
        min-height: 420px;
    }

    .deck {
        width: 400px;
        min-height: 420px;
    }

    .deck .card {
        width: 70px;
        height: 70px;
    }

    .deck .card.show {
        font-size: 22px;
    }

    .score-board {
        min-width: 200px;
        max-width: 380px;
    }

    .pop-up {
        min-width: 200px;
        max-width: 380px;
        top: 5%;
    }
}

/* Styles for small screens */
@media screen and (max-width: 445px) {
    /* Idle action button style */
    .idle .btn_container {
        min-width: 292px;
        min-height: 292px;
    }

    .deck {
        width: 292px;
        min-height: 292px;
    }

    .deck .card {
        width: 48px;
        height: 48px;
    }

    .deck .card.show {
        font-size: 18px;
    }

    .score-panel {
        width: 80vw;
    }

    .score-board {
        min-width: 200px;
        max-width: 95vw;
    }

    .pop-up {
        min-width: 200px;
        max-width: 95vw;
        top: 5%;
    }
}
