/* Browser Reset */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

h1,
h2 {
    margin: 0;
}

p {
    margin: 0;
}


/* Basic Elements */

body {
    background: #29282d url(pozadi1.png) no-repeat center center fixed;
    background-size: cover;
    font: 18px/ 1.33 "Raleway", sans-serif;
    color: #fff;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

header {
    padding: 1rem 2rem 2rem;
}

h1 {
    font-size: 3.2rem;
    font-weight: 300;
    text-align: center;
}

h2 {
    font-size: 1.6rem;
    font-weight: 300;
    text-align: center;
}


/*
 * Styles for the deck of cards
 */

.deck {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0;
}

.deck li {
    width: calc(100%/4);
    margin: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.deck .card {
    margin: 8px;
}

.deck .card_top {
    border-radius: 8px;
    background: url(backo1.png) no-repeat center center;
    background-size: cover;
    box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);
}

.deck img {
    position: relative;
    display: block;
    height: auto;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    transition: 0.5s all;
    -webkit-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    -o-transform: rotateY(0deg);
    transform: rotateY(0deg);
    opacity: 0;
}

img.selected:hover,
img.match:hover,
img.incorrect:hover {
    cursor: default;
}

img.selected,
img.incorrect {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
    transform: rotateY(180deg);
    opacity: 1;    
}

img.match {
    -webkit-animation: match 0.5s;
    opacity: 1; 
}

/*
 * Animations
 */

@-webkit-keyframes match {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }

    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }

    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

@keyframes match {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }

    50% {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }

    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}


/*
 * Styles for the Score Panel
 */

.score-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    padding: 0 2rem;
}

.score-panel .stars {
    display: flex;
    flex-grow: 1;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 90px;
    margin: 0;
    padding: 0;
}

.score-panel .stars li {
    list-style: none;
    margin: 0 5px 0 0;
}

.fa-star {
    color: #fbca39;
}

.score-panel .moves {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    min-width: 90px;
}

.score-panel .moves .paragraph_moves {
    align-items: center;
}

.score-panel .timer {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    min-width: 90px;
}

.score-panel .timer .paragraph_timer {
    align-items: center;
}

.score-panel #restart,
.score-panel #advanced {
    flex-grow: 1;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: transparent;
    font-family: "Raleway", sans-serif;
    font-size: 1rem;
    min-width: 100px;
    border: none;
    outline: none;
}

.score-panel #restart:hover,
.score-panel #advanced:hover {
    color: #fbca39;
}


/*
 * Styles Winner Message
 */

.winner_message {
    color: #29282d;
    background-color: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    padding: 2em;
    left: 50%;
    top: -150%;
    text-align: center;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    transition: 0.5s all ease-in;
}

.winner_message.active {
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    top: 50%;
    z-index: 100;
}

.winner-message .container {
    position: relative;
    z-index: 100;
}

.winner_message .winner_title {
    font-size: 1.6rem;
}

.winner_message .line {
    width: 80%; 
    margin: 1rem auto;
    border: 1px solid #b3b3b3;
}

.winner_message .winning_stars {
    display: flex;
    flex-grow: 1;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.winner_message .winning_stars li {
    list-style: none;
    margin: 0 5px 0 0;
}

   /*
 * Styles Winner Message2
 */

.winner_message2 {
    color: #29282d;
    background-color: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    padding: 2em;
    left: 50%;
    top: -100%;
    text-align: center;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    transition: 0.5s all ease-in;
}

.winner_message2.active {
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    top: 40%;
    z-index: 100;
}

.winner-message2 .container {
    position: relative;
    z-index: 100;
}

.winner_message2 .winner_title {
    font-size: 1.6rem;
}

.winner_message2 .line {
    width: 80%; 
    margin: 1rem auto;
    border: 1px solid #b3b3b3;
}

.winner_message2 .winning_stars {
    display: flex;
    flex-grow: 1;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.winner_message2 .winning_stars li {
    list-style: none;
    margin: 0 5px 0 0;
}

.play_again {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-color: #fbca39;
    border: 1px solid #fbca39;
    margin-top: 1rem;
    padding: .375rem .75rem;
    font-family: "Raleway", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.play_again:hover {
    background-color: #e1b533;
    border-color: #e1b533;
}


/*
 * Styles Footer
 */

footer {
    padding: 0 2rem 1rem;
}

footer p,
footer a {
    color: #746e6e;
    font-size: 0.9rem;
    text-align: center;
}


/*
 * Media Queries
 */

@media only screen and (max-width: 800px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .deck {
        padding: 0.75rem 1rem;
    }
}  

@media only screen and (max-width: 537px) {
    .score-panel {
        padding: 0 1rem;
    }

    .score-panel .stars,
    .score-panel .moves,
    .score-panel .timer {
        min-width: calc(100%/3);
    }

    .score-panel #restart,
    .score-panel #advanced {
        padding-top: 0.5rem;
    }
}

@media only screen and (max-width: 334px) {
     h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.0rem;
    }
}