/*
 * Wait for resources before animating
 */
.js-loading *,
.js-loading *:before,
.js-loading *:after {
  animation-play-state: paused !important;
}

html {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

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

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

body {
    background: url('../img/grass-min.png');
    font-family: 'Coda', cursive;
}

p {
    font-family: "Courier";
    font-size: 20px;
    margin: 10px 0 0 10px;
    white-space: nowrap;
    overflow: hidden;
    width: 30em;
    -webkit-animation: type 2.5s steps(60, end);
    animation: type 2.5s steps(60, end);
}

.container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

/*
 * Styles for the deck of cards
 */
.game {
    width: 650px;
    min-height: 519px;
    position: absolute;
    -webkit-transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
    -o-transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
    transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
    right: -650px;
}

.deck {
    width: 480px;
    min-height: 480px;
    padding: 7px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin: 0 0 3em;
}

.deck .card {
    height: 95px;
    width: 95px;
    font-size: 0;
    border-radius: 5px;
    cursor: pointer;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/*
* Based on https://desandro.github.io/3dtransforms/docs/card-flip.html
*/
.card-container {
    position: relative;
    -webkit-perspective: 800px;
    perspective: 800px;
}

.card-flip {
    width: 100%;
    height: 100%;
    position: absolute;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: -webkit-transform 0.5s;
    transition: -webkit-transform 0.5s;
    -o-transition: transform 0.5s;
    transition: transform 0.5s;
    transition: transform 0.5s, -webkit-transform 0.5s;
}

.card-flip img,
.card-flip div {
    margin: 0;
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.card-flip .front {
    background: #c2d5cb;
    font-size: 45px;
    text-align: center;
    padding: 8px;
    border: 4px solid white;
}

.card-flip .back {
    background: #2e3d49;
    -webkit-transform: rotateY( 180deg);
    transform: rotateY( 180deg);
}

.card-flip.flipped {
    cursor: default;
    -webkit-transform: rotateY( 180deg);
    transform: rotateY( 180deg);
}

.front,
.back {
    max-width: 95px;
    min-height: 95px;
    border-radius: 5px;
}

.escale {
    -webkit-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}

.escale:hover {
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
    cursor: pointer;
}

/*
 * Styles for the Score Panel
 */
.score-panel,
.time-panel {
    width: 345px;
    margin: 6px 0 0 86px;
}

.time-panel {
    position: absolute;
    top: 0;
    right: 0;
}

.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;
}

/*
 * Styles to create BMO
 */
.bmo-case {
    background: #25ad9f;
    width: 750px;
    margin-top: 20px;
    height: 950px;
    padding: 30px 30px;
    border-radius: 25px 25px 25px 25px;
    position: relative;
    -webkit-box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
}

.bmo-screen {
    background: #b9dfca;
    width: 650px;
    min-height: 519px;
    border-radius: 35px 35px 35px 35px;
    border: 5px solid;
    position: relative;
    overflow: hidden;
}

.bmo-face {
    position: absolute;
    width: 650px;
    min-height: 519px;
    left: -650px;
    top: 0;
    -webkit-transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
    -o-transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
    transition: all .7s cubic-bezier(.22, .68, 0, 1.41);
}

.bmo-transparent-screen {
    opacity: 0.8;
    background: #b9dfca;
    width: 650px;
    min-height: 519px;
    border-radius: 35px 35px 35px 35px;
}

.bmo-eye {
    border-radius: 50%;
    background-color: black;
    width: 43px;
    height: 43px;
    position: absolute;
    top: 180px;
    -webkit-animation: blink 2.1s infinite;
    animation: blink 2.1s infinite;
}

.bmo-button {
    border-radius: 50%;
    border: 4px solid;
    position: absolute;
}

.blue-button {
    background: #014777;
    width: 45px;
    height: 45px;
    right: 105px;
    top: 565px;
}

.bmo-cross {
    background: #fdd04e;
    border-radius: 4%;
    border: 4px solid;
    position: absolute;
}

.vertical-cross {
    width: 55px;
    height: 145px;
    top: 621px;
    left: 190px;
}

.horizontal-cross {
    width: 145px;
    height: 55px;
    left: 145px;
    top: 664px;
}

.transparent-cross {
    width: 47px;
    height: 137px;
    border: 0;
    z-index: 100;
    top: 625px;
    left: 194px;
}

.bmo-triangle-button {
    width: 0;
    height: 0;
    border-left: 47px solid transparent;
    border-right: 47px solid transparent;
    border-bottom: 94px solid;
    position: absolute;
    top: 630px;
    left: 422px;
}

.inside-button {
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 80px solid #44c2df;
    z-index: 200;
    top: 639px;
    left: 429px;
}

.green-button {
    background: #6dbc62;
    width: 65px;
    height: 65px;
    top: 691px;
    left: 567px;
}

.red-button {
    background: #ec3b45;
    width: 85px;
    height: 85px;
    top: 744px;
    left: 474px;
}

.speech-bubble {
    width: 415px;
    height: 75px;
    background: white;
    position: absolute;
    border-radius: 20px;
    padding: 8px;
    -webkit-box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    top: 100px;
    left: 645px;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.short-message {
    width: 260px;
}

.speech-small-bubble {
    background: white;
    position: absolute;
    border-radius: 50%;
    -webkit-box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
}

.bubble1 {
    width: 23px;
    height: 23px;
    top: 181px;
    left: 678px;
}

.bubble2 {
    width: 15px;
    height: 15px;
    top: 204px;
    left: 660px;
}

/*
 * Typing effect
 */
@-webkit-keyframes type {
    from {
        width: 0;
    }
}

@keyframes type {
    from {
        width: 0;
    }
}

/*
* Blink effect based on https://codepen.io/bfred-it/pen/RNGOQW
*/
@-webkit-keyframes blink {
    90% {
        -webkit-transform: none;
        transform: none;
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }
    93% {
        -webkit-transform: translateY(15px) scaleY(0);
        transform: translateY(15px) scaleY(0)
    }
    100% {
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
    }
}

@keyframes blink {
    90% {
        -webkit-transform: none;
        transform: none;
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }
    93% {
        -webkit-transform: translateY(15px) scaleY(0);
        transform: translateY(15px) scaleY(0)
    }
    100% {
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
    }
}

.right-eye {
    right: 110px;
}

.left-eye {
    left: 110px;
}

.bmo-disk {
    height: 30px;
    width: 415px;
    border: 4px solid black;
    background: #024f38;
    border-radius: 5%;
    position: absolute;
    top: 574px;
    left: 105px;
}

.bmo-connector {
    background: #014777;
    width: 95px;
    height: 20px;
    border-radius: 20%;
    position: absolute;
    border: 4px solid black;
    top: 804px;
}

.right-connector {
    left: 232px;
}

.left-connector {
    left: 107px;
}

.center {
    margin: 0 auto;
}

/*
* BMO's smile based on https://codepen.io/goosidious/pen/dPmVQp
*/
div.smile {
    width: 160px;
    height: 70px;
    border: 10px solid #222;
    border-top: 0;
    background: rgba(0, 0, 0, 0);
    border-radius: 0 0 120px 120px / 0 0 90px 90px;
    position: absolute;
    left: 242px;
    top: 281px;
}

div.corner {
    width: 10px;
    height: 30px;
    background: #222;
    border-radius: 100px/160px;
    -webkit-border-radius: 100px 160px;
    -moz-border-radius: 100px/160px;
    position: absolute;
    top: -12px;
    -webkit-transform: rotate(65deg);
    -moz-transform: rotate(65deg);
    left: -12px;
}

div.corner.right {
    left: 142px;
    -webkit-transform: rotate(-65deg);
    -moz-transform: rotate(-65deg);
}

.bmo-face.shown {
    left: 0;
}

.game.shown {
    right: 0;
}

.message {
    z-index: 300;
    position: relative;
    opacity: 0;
    -webkit-transition: opacity 0.4s ease-in;
    -o-transition: opacity 0.4s ease-in;
    transition: opacity 0.4s ease-in;
    right: 47px;
}

.message.shown {
    opacity: 1;
}

.win-smile {
    display: none;
    position: absolute;
    left: 242px;
    top: 281px;
    -webkit-transform: rotate(-5deg);
    -ms-transform: rotate(-5deg);
    transform: rotate(-5deg);
}

.win-smile.shown {
    display: block;
}

.smile.hidden {
    display: none;
}


.big-smile {
    position: absolute;
    background: #c7cfcb;
    border: 4px solid black;
    height: 45px;
    width: 160px;
    -webkit-transition: height 0.6s cubic-bezier(.22, .68, 0, 1.41);
    -o-transition: height 0.6s cubic-bezier(.22, .68, 0, 1.41);
    transition: height 0.6s cubic-bezier(.22, .68, 0, 1.41);
    border-bottom-left-radius: 160px;
    border-bottom-right-radius: 160px;
    top: 20px;
}

.wider {
    height: 90px;
}

.teeth {
    position: absolute;
    height: 25px;
    width: 160px;
    background: white;
    border: 4px solid black;
}

.start-label {
    position: absolute;
    -webkit-transition: opacity 0.4s linear;
    -o-transition: opacity 0.4s linear;
    transition: opacity 0.4s linear;
    top: 575px;
    right: 54px;
    opacity: 0;
}

.start-label.shown {
    opacity: 1;
}

.flipped .firefox-bug {
    display: none;
}