@charset "utf-8";

/* reset css */
@import url('reset.css');

body {
    background: url('../images/cloud.png') #9ddfff;
    font-family: arial, "微軟正黑體";

}

body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    display: block;
    width: 100%;
    background-size: auto 100%;
    z-index: 1;
}

body::before {
    bottom: 120px;
    height: 448px;
    background-image: url('../images/mountain.png');
    background-position: center bottom;
}

body::after {
    bottom: 0;
    height: 203px;
    background-image: url('../images/ground.png');
    background-position: left bottom;
}

/* .common */
.common {
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .6);
    z-index: 2;
}

/* game-start */
#game-start {
	
}

#game-start .wrap {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

#game-start .wrap .title {
    position: relative;
    width: 100%;
    max-width: 768px;
    height: 172px;
    margin: 0 auto;
    background: url('../images/game_title.png') no-repeat;
    background-size: 100% auto;
    text-indent: -9999px;
}

#game-start .wrap .readme {
    max-width: 800px;
    margin: -70px auto 50px auto;
    padding: 70px 20px 20px 20px;
    background: #feef94;
    border: 10px solid #ffc233;
    border-radius: 10px;
}

#game-start .wrap .readme .type {
    display: flex;
    margin-bottom: 20px;
}

#game-start .wrap .readme .type li {
    width: 100%;
    font-size: 35px;
    color: #fe4251;
    font-weight: bold;
    text-align: center;
}

#game-start .wrap .readme .type li::before {
    content: "";
    display: block;
    width: 50px;
    height: 58px;
    margin: 0 auto 5px auto;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% auto;
}

#game-start .wrap .readme .type li:nth-child(1)::before {
    background-image: url('../images/apple.png');
}

#game-start .wrap .readme .type li:nth-child(2)::before {
    background-image: url('../images/banana.png');
}

#game-start .wrap .readme .type li:nth-child(3)::before {
    background-image: url('../images/cheery.png');
}

#game-start .wrap .readme .type li:nth-child(4)::before {
    background-image: url('../images/orange.png');
}

#game-start .wrap .readme .type li:nth-child(5)::before {
    background-image: url('../images/grape.png');
}

#game-start .wrap .readme p {
    font-size: 23px;
    color: #289c91;
    line-height: 35px;
    letter-spacing: .5px;
    font-weight: bold;
    text-align: center;
}

#game-start .wrap .start {
    display: block;
    width: 280px;
    margin: 0 auto;
    padding: 20px;
    background: #289c91;
    border-radius: 40px;
    font-size: 30px;
    color: #feef94;
    text-align: center;
    font-weight: bold;
    box-sizing: border-box;
    transition: all .3s;
}

#game-start .wrap .start:hover {
    background: #d51730;
}

/* difficulty */
#difficulty {
    visibility: hidden;
    opacity: 0;
    transition: all 1s;
}

#difficulty.active {
    visibility: visible;
    opacity: 1;
}

#difficulty .wrap {}

#difficulty .wrap .title {
    margin-bottom: 30px;
    font-size: 50px;
    color: #FF8800;
    font-weight: bold;
}

#difficulty .wrap .options {
    position: relative;
    display: flex;
    text-align: center;
}

#difficulty .wrap .options::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    display: none;
    width: 100%;
    height: 100%;
}

#difficulty .wrap .options.lock::after {
    display: block;
}

#difficulty .wrap .options a {
    display: block;
    margin: 0 20px;
}

#difficulty .wrap .options a::before {
    content: "";
    display: block;
    width: 100px;
    height: 100px;
    margin: 0 auto 40px auto;
    background-color: #feef94;
    background-size: 100% auto;
    border: 10px solid #ffc233;
    border-radius: 50%;
}

#difficulty .wrap .options a.easy::before {
    background-image: url('../images/difficulty_easy.png')
}

#difficulty .wrap .options a.normal::before {
    background-image: url('../images/difficulty_normal.png')
}

#difficulty .wrap .options a.hard::before {
    background-image: url('../images/difficulty_hard.png')
}

#difficulty .wrap .options a span {
    display: block;
    padding: 10px 20px;
    background: #289c91;
    border-radius: 20px;
    font-size: 20px;
    color: #ffee94;
    letter-spacing: 5px;
    font-weight: bold;
}

#difficulty .wrap .options a:hover::before,
#difficulty .wrap .options a.active::before {
    border-color: #d51730;
}

/* game */
#game {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 120px;
    display: none;
    overflow: hidden;
    cursor: none;
    z-index: 2;
}

#game .basket {
    position: absolute;
    left: 45%;
    bottom: 0;
    width: 200px;
    height: 85px;
    background: url('../images/basket.png');
    background-size: 100% auto;
    text-indent: -9999px;
}

#game .fruits {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    text-indent: -9999px;
}

#game .fruits li {
    position: absolute;
    bottom: 100%;
    width: 150px;
    background-size: 100% auto;
    animation-name: fruit;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

#game .fruits .f1 {
    height: 157px;
    background-image: url('../images/apple.png');
}

#game .fruits .f2 {
    height: 139px;
    background-image: url('../images/banana.png');
}

#game .fruits .f3 {
    height: 158px;
    background-image: url('../images/cheery.png');
}

#game .fruits .f4 {
    height: 174px;
    background-image: url('../images/orange.png');
}

#game .fruits .f5 {
    height: 151px;
    background-image: url('../images/grape.png');
}

@keyframes fruit {
    to {
        bottom: 0;
    }
}

#game .timer {
    position: absolute;
    right: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    padding: 20px;
    background: #feef94;
    border: 5px solid #ffc233;
    border-radius: 50px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, .3);
    font-size: 50px;
    color: #FF9100;
    font-weight: bold;
    box-sizing: border-box;
}

#game .timer::before {
    content: "";
    display: block;
    width: 40px;
    height: 50px;
    margin-right: 10px;
    background: url('../images/timer.png');
    background-size: 100% auto;
}

#game .score {
    position: absolute;
    left: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    padding: 20px;
    background: #289c91;
    border-radius: 50px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, .3);
    font-size: 50px;
    color: #feef94;
    font-weight: bold;
    text-align: center;
}

#game .score::before {
    content: "$";
    display: block;
    width: 50px;
    height: 50px;
    margin-right: 10px;
    background: #feef94;
    border: 5px solid #ffc233;
    border-radius: 50%;
    font-size: 40px;
    color: #289c91;
    line-height: 50px;
}

/* mobile-control */
#mobile-control {
	display: none;
}

#mobile-control a {
	position: fixed;
	bottom: 10px;
	display: block;
	width: 45px;
	height: 45px;
	background: url('../images/mobile.png') #feef94;
	border: 3px solid #ffc233;
	border-radius: 50%;
	text-indent: -9999px;
	z-index: 3;
}

#mobile-control a.left {
	left: 10px;
	background-position: left center;
}

#mobile-control a.right {
	right: 10px;
	background-position: right center;
}

/* game-over */
#game-over {
    visibility: hidden;
    opacity: 0;
    transition: all 1s;
}

#game-over.active {
    visibility: visible;
    opacity: 1;
}

#game-over .wrap {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
    box-sizing: border-box;
}

#game-over .wrap .rank {
    position: relative;
    display: flex;
    justify-content: center;
    width: 358px;
    height: 80px;
    margin: 0 auto;
    background: url('../images/rank.png');
    background-size: 100% auto;
}

#game-over .wrap .rank li {
    display: block;
    width: 58px;
    height: 58px;
    margin: -22px 5px 0 5px;
    background: url('../images/star.png') no-repeat;
    background-size: 300% auto;
    text-indent: -9999px;
    opacity: 0;
    transform: scale(2, 2);
    animation-name: star;
    animation-duration: 1s;
    animation-fill-mode: forwards;
}

#game-over .wrap .rank li:nth-child(1) {
    background-position: left top;
    animation-delay: .1s;
}

#game-over .wrap .rank li:nth-child(2) {
    background-position: center top;
    animation-delay: .2s;
}

#game-over .wrap .rank li:nth-child(3) {
    background-position: right top;
    animation-delay: .3s;
}

@keyframes star {
    to {
        opacity: 1;
        transform: scale(1, 1);
    }
}

#game-over .wrap .score {
    margin: -30px auto 40px auto;
    padding: 40px 20px 20px 20px;
    background: #feef94;
    border: 10px solid #ffc233;
    border-radius: 50px;
    font-size: 50px;
    color: #289c91;
    font-weight: bold;
    text-align: center;
}

#game-over .wrap .buttons {
    display: flex;
    text-align: center;
}

#game-over .wrap .buttons a {
    display: block;
    width: 100%;
    margin: 0 15px;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, .5);
    font-size: 25px;
    font-weight: bold;
    box-sizing: border-box;
    transition: all .3s;
}

#game-over .wrap .buttons a.share {
    background: #4267b2;
    color: #FFF;
}

#game-over .wrap .buttons a.restart {
    background: #289c91;
    color: #feef94;
}


#game-over .wrap .buttons a:hover {
    opacity: .6;
}

/* RWD */
@media screen and (max-width: 768px) {

    /* game-start */
    #game-start .wrap .title {
        height: auto;
        padding-bottom: 20%;
    }

}

@media screen and (max-width: 740px) {

    body::before {
        bottom: 70px;
        height: 200px;
    }

    body::after {
        height: 100px;
    }

    /* game-start */
    #game-start .wrap .readme {
        margin: -40px auto 10px auto;
        padding: 30px 10px 10px 10px;
        border-width: 5px;
    }

	#game-start .wrap .readme .type {
    	margin-bottom: 10px;
    }

    #game-start .wrap .readme .type li {
        font-size: 20px;
    }

    #game-start .wrap .readme .type li::before {
        width: 30px;
        height: 30px;
    }

    #game-start .wrap .readme p {
        font-size: 18px;
        line-height: 26px;
    }

    #game-start .wrap .start {
        width: 100%;
        padding: 10px;
        font-size: 25px;
    }

    /* difficulty */
    #difficulty .wrap .options a::before {
        width: 50px;
        height: 50px;
        margin-bottom: 20px;
        border-width: 5px;
    }

    #difficulty .wrap .options a span {
        padding: 10px;
        font-size: 17px;
        letter-spacing: 0;
        font-weight: normal;
    }

    /* game */
    #game {
        bottom: 60px;
    }

    #game .basket {
        width: 100px;
        height: 39px;
    }

    #game .fruits li {
        width: 50px;
    }

    #game .fruits .f1 {
        height: 52px;
    }

    #game .fruits .f2 {
        height: 46px;
    }

    #game .fruits .f3 {
        height: 53px;
    }

    #game .fruits .f4 {
        height: 58px;
    }

    #game .fruits .f5 {
        height: 50px;
    }

    #game .score {
        padding: 10px;
        font-size: 25px;
    }

    #game .score::before {
        width: 30px;
        height: 30px;
        font-size: 25px;
        line-height: 30px;
    }

    #game .timer {
    	padding: 10px;
        font-size: 25px;
    }

    #game .timer::before {
        width: 23px;
        height: 29px;
    }

    /* game-over */
    #game-over .wrap .rank {
    	width: 250px;
    	height: 56px;
    }

    #game-over .wrap .rank li {
    	width: 40px;
    	height: 35px;
    	margin-top: -14px;
    }

    #game-over .wrap .score {
    	margin-bottom: 20px;
    	padding: 30px 10px 10px 10px;
    	border-width: 5px;
    	font-size: 30px;
    }

    #game-over .wrap .buttons {
    	display: block;
    }

    #game-over .wrap .buttons a {
    	margin: 10px auto;
    	padding: 10px;
    	font-size: 20px;
    }

}