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/pinkdust.png'); /* Background pattern from Subtle Patterns */
    font-family: 'Coda', cursive;
}

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

h1 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    color:#4df1f7;
    width: 100%;
}

/*
 * Styles for the deck of cards
 */

.deck {
    
    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 {
    
    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);
}

.deck .card.open {
    background: #02b3e4;
    cursor: default;
    animation-name: flipcard;/*adding the flipcard animation when the user clicks the card to open*/
    animation-duration: 1s;/*setting the duration for animation*/
}

.deck .card.match {
    cursor: default;
    background: #02cc8c;/*changed the background color to green if matched*/
    animation: shake 0.5s;/*adding the animation for shaking when the cards match */
}
.deck .card.unmatch{

    background:#cc1e02;/*changed the background color to red if unmatched*/
    animation: shake 0.5s;/*adding the animation for shaking when the cards match */
}

/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: center;/*aligned it in center*/
    width: 345px;
    margin-bottom: 10px;
}

.score-panel .stars {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
    max-width: 100%;

}

.score-panel .stars li {
    list-style: none;
    display: inline-block;
    color:#4df1f7;
}
.moves{
    color:#4df1f7;
    max-width: 100%;
}
.movecolor{
    color:#4df1f7;
    max-width: 100%;
}
.restart {
    float: right;
    max-width: 100%;
    cursor: pointer;
    color:#4df1f7;
}
.timer{
    color:#4df1f7;
    max-width: 100%;/*to make it responsive on all viewport sizes*/
}
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 32px;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    text-align: center;
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.winningcontent,
.modaltime,
.modalmoves,
.modalstars{
    font-size: 15px;
}
.button{/*play again button styling*/

    background-color: #4df1f7;
    border: none;
    color: black;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: auto;
    cursor: pointer;
}
@keyframes flipcard {/*animation for flipping cards when u make it open*/

    0%{
        -webkit-transform: rotateX(-90deg); /* Safari */
        transform: rotateX(-90deg);
        }
    
    100% {
        -webkit-transform: rotateX(0deg); /* Safari */
         transform: rotateX(0deg);
         }
}
@keyframes shake {/*animation for shaking cards when the cards match*/
    0% {
        -webkit-transform:translate(1px, 1px) rotate(0deg); 
        transform: translate(1px, 1px) rotate(0deg); 
        }
    10% {
        -webkit-transform:translate(-1px, -2px) rotate(-1deg); 
         transform: translate(-1px, -2px) rotate(-1deg); 
        }
    20% { 
        -webkit-transform:translate(-3px, 0px) rotate(1deg); 
        transform: translate(-3px, 0px) rotate(1deg); 
         }
    30% { 
        -webkit-transform:translate(3px, 2px) rotate(0deg); 
        transform: translate(3px, 2px) rotate(0deg); 
        }
    40% { 
        -webkit-transform:translate(1px, -1px) rotate(1deg);
        transform: translate(1px, -1px) rotate(1deg); 
        }
    50% { 
        -webkit-transform:translate(-1px, 2px) rotate(-1deg); 
        transform: translate(-1px, 2px) rotate(-1deg); 
        }
    60% {
        -webkit-transform:translate(-3px, 1px) rotate(0deg);
        transform: translate(-3px, 1px) rotate(0deg);
        }
    70% {
        -webkit-transform:translate(3px, 1px) rotate(-1deg);
         transform: translate(3px, 1px) rotate(-1deg);
        }
    80% {
        -webkit-transform:translate(-1px, -1px) rotate(1deg); 
         transform: translate(-1px, -1px) rotate(1deg); 
         }
    90% {
        -webkit-transform:translate(1px, 2px) rotate(0deg);
         transform: translate(1px, 2px) rotate(0deg); 
        }
    100% {
        -webkit-transform:translate(1px, -2px) rotate(-1deg); 
        transform: translate(1px, -2px) rotate(-1deg); 
        }
}