/*html {
    box-sizing: border-box;
}

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

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

body {
    background: #d5dee2 url('/img/games/memory/bg.jpg') bottom;
    background-size: cover;
    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: 400;
    color: #d5dee2;
    text-shadow: 1px 1px 2px rgba(80, 80, 80, 0.6);
}
*/

.containergioco {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
/*
 * Background styles for cards
 */
svg {
    display: none;
    background-color: transparent;
    fill: currentColor;
    width: 50px;
    height: 50px;
}

.display-icon {
    display: inline-block;
    animation: showicon 0.4s;
    animation-iteration-count: 1;
}

.fallback {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 90%;
    height: 90%;
}

.fallback-png-1 {
    background-image: url(/img/games/memory/01.png);
}

.fallback-png-2 {
    background-image: url(/img/games/memory/02.png);
}

.fallback-png-3 {
    background-image: url(/img/games/memory/03.png);
}

.fallback-png-4 {
    background-image: url(/img/games/memory/04.png);
}

.fallback-png-5 {
    background-image: url(/img/games/memory/05.png);
}

.fallback-png-6 {
    background-image: url(/img/games/memory/06.png);
}

.fallback-png-7 {
    background-image: url(/img/games/memory/07.png);
}

.fallback-png-8 {
    background-image: url(/img/games/memory/08.png);
}


/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #045d9b 0%, #1b8edc 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: #083961;
    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: #1f92e7;
    cursor: default;
    animation: flip 0.4s;
    animation-iteration-count: 1;
}

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

.deck .card.match {
    cursor: default;
    background: #f5ce67;
    font-size: 33px;
    animation: flip 0.4s;
    animation-iteration-count: 1;
    transition: background 0.6s;
}

/*
 * Styles for the Score Panel
 */

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

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

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

.score-panel .timer {
    display: inline;
    position: absolute;
    left: 56%;
}

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

/*
 * Styles for the Final Score Modal
 */

.final-score.modal {
    position: absolute;
    /* top: 47%; */
    width: 340px;
    min-height: 300px;
    color: #d5dee2;
    background: linear-gradient(160deg, #7494b3 0%, #1b8edc 100%);
    padding: 32px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    display: none;
    z-index: 2;
}

.final-score.modal h1 {
    text-align: center;
}

.final-score.modal .controls {
    display: flex;
    justify-content: space-between;
}

.final-score.modal .play-again {
    cursor: pointer;
    font-size: 0.9em;
}

.final-score.modal .fa.fa-times {
    cursor: pointer;
}

.final-score.modal .modal-stars {
    color: #f5ce67;
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 1.5em 0;
}

.final-score.modal p.comment {
    font-size: 1.2em;
    padding: 0;
    margin: 0em 0 -0.6em 0;
}

.final-score.modal .fa.fa-star {
    margin: 0.2em;
    font-size: x-large;
}

.final-score.modal p {
    text-align: center;
}

.backdrop {
    display: none;
    width: 100%;
}

.backdrop-show {
    display: block;
    position: absolute;
    background: rgba(46, 61, 73, 0.1);
    z-index: 1;
}

/*
* Footer styles
*/
footer p {
    padding: 0;
    padding-bottom: 1em;
}

.left,
.right,
.left a:hover,
.right a:hover {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: #d5dee2;
    text-align: left;
    text-decoration: none;
}

.left a,
.right a {
    color: #effaff;
    text-decoration: none;
}

.left {
    float: left;
    margin-left: -324px;
}

.right {
    float: right;
    margin-right: -310px;
}

/*
* CSS Animations
*/

@keyframes flip {
    0% { transform: rotateY(180deg); background: #083961; }
    49% { background: #083961; }
    50% { transform: rotateY(90deg); background: #1f92e7; }
    100% { transform: rotateY(0deg); }
}

@keyframes reverseflip {
    0% { transform: rotateY(0deg); background: #1f92e7; }
    49% { background: #1f92e7; }
    50% { transform: rotateY(90deg); background: #083961; }
    100% { transform: rotateY(180deg); background: #083961; }
}

@keyframes showicon {
    0% { opacity: 0;}
    49% { opacity: 0;}
    50% { opacity: 1;}
    100% { opacity: 1;}
}

@keyframes hideicon {
    0% { opacity: 1;}
    49% { opacity: 1;}
    50% { opacity: 0;}
    100% { opacity: 0;}
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); background: #f50625; }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    40% { transform: translate(2px, -1px) rotate(1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    80% { transform: translate(1px, -1px) rotate(1deg); }
    100% { transform: translate(0px, 0px) rotate(-1deg); background: #f50625; }
}

/* MEDIA QUERIES */
/* Ipad */
@media only screen
  and (min-device-width: 768px)
  and (max-device-width: 1024px) {
    .score-panel {
        width: 576px;
        font-size: 1.2em;
    }

    .final-score.modal h1 {
        font-size: 3em;
    }

    .score-panel .timer {
        left: 67%;
    }

    .deck {
        width: 860px;
        min-height: 880px;
    }

    .deck .card {
        height: calc(880px/5);
        width: calc(860px/5);
    }

    svg {
        width: 74px;
        height: 74px;
    }

    .final-score.modal {
        width: 600px;
        min-height: 562px;
    }

    .final-score.modal .controls {
        font-size: 2em;
    }

    .final-score.modal p.comment {
        font-size: 1.8em;
    }

    .final-score.modal .fa.fa-star {
        font-size: 3em;
    }

    .final-score.modal p {
        font-size: 1.8em;
    }
}

/*  iPhone X, 6, 7, 8  */

@media only screen
  and (min-device-width: 375px)
  and (max-device-width: 812px) {
    h1 {
        font-size: 3.4em;
    }

    .score-panel {
        width: 659px;
        font-size: 2em;
        margin-bottom: 20px;
    }

    .score-panel .timer {
        left: 67%;
    }

    .deck {
        width: 860px;
        min-height: 880px;
    }

    .deck .card {
        height: calc(880px/5);
        width: calc(860px/5);
    }

    svg {
        width: 96px;
        height: 96px;
    }

    .left,
    .right,
    .left a:hover,
    .right a:hover {
        font-size: 1.3em;
        letter-spacing: 0.1em;
    }
}

/*  iPhone 5  */

@media only screen
  and (min-device-width: 320px)
  and (max-device-width: 568px) {
    h1 {
        font-size: 3.4em;
    }

    .score-panel {
        width: 659px;
        font-size: 2em;
        margin-bottom: 20px;
    }

    .score-panel .timer {
        left: 67%;
    }

    .deck {
        width: 860px;
        min-height: 880px;
    }

    .deck .card {
        height: calc(880px/5);
        width: calc(860px/5);
    }

    svg {
        width: 96px;
        height: 96px;
    }

    .left,
    .right,
    .left a:hover,
    .right a:hover {
        font-size: 1.3em;
        letter-spacing: 0.1em;
    }

    .final-score.modal {
        width: 700px;
        min-height: 590px;
    }

    .final-score.modal .controls {
        font-size: 2em;
    }

    .final-score.modal p.comment {
        font-size: 2em;
    }

    .final-score.modal .fa.fa-star {
        font-size: 3em;
    }

    .final-score.modal p {
        font-size: 1.8em;
    }
}