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-size: 16px;
    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: 300px;
}

/*
 * Styles for the deck of cards
 */
.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #d6d6d6 0%, #008f00 100%);
    padding: 1rem;
    border-radius: 4px;
    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;
    margin: 0.2rem 0.2rem;
    background: #2e3d49;
    font-size: 0;
    color: #ffffff;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.deck .card.open {

    transform: rotateY(0);
    animation: flip 0.4s;
    background: #5534ff;
    cursor: default;
}

@keyframes flip {

  0% {
    background-color: #fffb00;
    color: #fffb00;
    transform: rotateY(180deg);
  }

  60% {

    background-color: #8efa00;
    color: #8efa00;
  }
}

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

.deck .card.match {
    animation-name: stretch;
    animation-duration: .75s;
    animation-timing-function: ease-out;
    animation-delay: 0s;
    animation-direction: normal;
    animation-iteration-count: 1;
    animation-fill-mode: none;
    animation-play-state: running;
    cursor: default;
    background: #008f00; /* #02ccba;*/
    font-size: 33px;

}

@keyframes stretch {

  0% {
    transform: scale(.3);
    background-color: #ff40ff;
    border-radius: 100%;
  }

  50% {
    background-color: #ff9300;
  }
  100% {
    transform: scale(1.5);
    background-color: #fffb00;
  }
}

.deck .card.noMatch {
    animation-name: pulse 5s infinite;
    background: #ff40ff;
}

@keyframes pulse {

  0% {
    transform: scale(1);

  }

  50% {
    transform: scale(1);
  }
}

.deck .card.disabled {
    pointer-events: none;
    opacity: 0.9;
}

/*
 * Styles for the Score Panel
 */
.score-panel {
    text-align: left;
    width: 345px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.stars-rating .star {
    display: inline-block;
    font-size: 1.375rem;
    margin: 0 5px 0 0;
    margin: 0;
    padding: 0;
}

.score-panel .moves {
    font-size: 1.375rem;
    margin-left: auto;
    margin-right: auto;
}

.score-panel .restart {
    margin-left: auto;
    cursor: pointer;
    padding: 8px;
    font-size: 1.375rem;
}

.stars-rating .fa-star {
    color: #34fc00;
}

.score-panel .timer {
    font-size: 1.375rem;
    width: 70px;
    display: inline-block;
    margin-left: auto;
}

/*
 * Styles for congratulations modal
 */
.my-modal{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transition: opacity 500ms;
    visibility: hidden;
    opacity: 0;
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.1);
    border-radius: 9px 9px 9px 9px;
    -moz-border-radius: 9px 9px 9px 9px;
    -webkit-border-radius: 9px 9px 9px 9px;
}

.my-modal:target {
    visibility: visible;
     opacity: 1;
}

.modal-text {
    margin: 70px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    width: 90%;
    position: relative;
    border: 1px solid #888;
    transition: all 5s ease-in-out;
    font-family: 'Coda', cursive;
}

.modal-text h2 {
    margin: 0.5rem 0;
    color: #011969;
    font-family: Tahoma, Arial, sans-serif;
    border-bottom: 2px solid #e4e4e4;
}

.modal-text .exit {
    position: absolute;
    top: 20px;
    right: 30px;
    transition: all 200ms;
    font-size: 40px;
    font-weight: bold;
    text-decoration: none;
    color: #011969;
    padding: 0 10px;
    line-height: 40px;
}

.modal-text .exit:hover,
.modal-text .exit:focus{
    color: #8efa00;
    text-decoration: none;
    cursor: pointer;
}

.modal-text .text-one,
.text-two {
    max-height: 30%;
    overflow: auto;
    text-align: center;

}

.modal-text .text-two {
    border-bottom: 2px solid #e4e4e4;
}

.show {
    visibility: visible !important;
    opacity: 100 !important;
}

#rating i {
    display: inline-block;
}


.modal-options {
    display: flex;
    justify-content: space-around;
    padding: 20px 0px;
}

#modal-close {
    padding: 5px;
    border-radius: 3px;
    border: solid 1px #aaa;
    background-color: #ebebeb;
    font-family: 'Coda', cursive;
    width: 25%;
}

#modal-close:hover,
#modal-close:focus {
    color: #fff;
    background-color: #757575;
    cursor: pointer;
}

#play-again {
    background-color: #8efa00;
    font-family: 'Coda', cursive;
    width: 25%;
    padding: 5px;
    border-radius: 3px;
    border: solid 1px #aaa;
    font-weight: bold;
}

#play-again:hover,
#play-again:focus {
    background-color: #ebebeb;
    color: #011969;
    cursor: pointer;
}

/*
 * Styles for canvas
 */
#canvas {
    position: absolute;
    visibility: hidden;
    overflow-y: hidden;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

/*
 * Media queries
 * For small screen
 */
@media screen and (max-width: 600px) {
    .score-panel {
        width: 300px;
    }
    .score-panel .timer,
    .score-panel .moves,
    .score-panel .restart {
        font-size: 16px;
    }

    .stars-rating .star {
        font-size: 16px;
    }

    .deck {
        width: 100%;
        min-width: 360px;
        min-height: 100%;
        padding: 10px;
    }
    .deck .card {
        margin: 8px;
        height: 85px;
        flex: 0 20%;
    }
}

/*
 * For Tablets and larger screens
 */
@media screen and (min-width: 768px) {
    .container {
        font-size: 1.375rem;
    }
    .modal-text {
        width: 60%;
    }
}
