ul.flip {
	position: relative;
	float: left;
	margin: 1px;
	width: 28px;
	height: 34px;
	font-size: 28px;
	font-weight: normal;
	line-height: 36px;
	border-radius: 3px;
	font-family: Roboto, sans-serif;
	list-style: none;
}

ul.flip li {
z-index: 1;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;

}

ul.flip li:first-child {
	z-index: 2;
}

ul.flip .digit-wrapper {
	display: block;
	height: 100%;
	perspective: 200px;
}

ul.flip .digit-wrapper div {
	z-index: 1;
	position: absolute;
	left: 0;
	width: 100%;
	height: 50%;
	overflow: hidden;
}

ul.flip .digit-wrapper div .shadow {
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 2;
}

ul.flip .digit-wrapper div.up {
	transform-origin: 50% 100%;
	top: 0;
}

ul.flip .digit-wrapper div.up:after {
	content: "";
	position:absolute;
	top:16px;
	left:0;
	z-index: 5;
	width: 100%;
	height: 3px;
	background-color: rgba(0,0,0,.4);
}

ul.flip .digit-wrapper div.down {
	transform-origin: 50% 0%;
	bottom: 0;
}

ul.flip .digit-wrapper div div.inn {
	position: absolute;
	left: 0;
	z-index: 1;
	width: 100%;
	height: 200%;
	color: #ffffff;
	text-shadow: 0 1px 2px #000;
	text-align: center;
	background-color: #414141;
	border-radius: 3px;
	padding-left: 2px;
}

ul.flip .digit-wrapper div.up div.inn {
	top: 0;

}

ul.flip .digit-wrapper div.down div.inn {
	bottom: 0;
}

/* PLAY */

ul.flip li.before {
	z-index: 3;
}

ul.flip li.active {
	animation: asd .5s .5s linear both;
	z-index: 2;
}

@keyframes asd {
	0% {
		z-index: 2;
	}
	5% {
		z-index: 4;
	}
	100% {
		z-index: 4;
	}
}

ul.flip li.active .down {
	z-index: 2;
	animation: turn .5s .5s linear both;
}

@keyframes turn {
	0% {
		transform: rotateX(90deg);
	}
	100% {
		transform: rotateX(0deg);
	}
}

body.play ul li.before .up {
	z-index: 2;
	animation: turn2 .5s linear both;
}

@keyframes turn2 {
	0% {
		transform: rotateX(0deg);
	}
	100% {
		transform: rotateX(-90deg);
	}
}

/* SHADOW */

ul.flip li.before .up .shadow {
	background: -moz-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, .1)), color-stop(100%, rgba(0, 0, 0, 1)));
	background: linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -o-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -ms-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	animation: show .5s linear both;
}

ul.flip li.active .up .shadow {
	background: -moz-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, .1)), color-stop(100%, rgba(0, 0, 0, 1)));
	background: linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -o-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: -ms-linear-gradient(top, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 1) 100%);
	animation: hide .5s .3s linear both;
}

/*DOWN*/

ul.flip li.before .down .shadow {
	background: -moz-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 1)), color-stop(100%, rgba(0, 0, 0, .1)));
	background: linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -o-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -ms-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	animation: show .5s linear both;
}

ul.flip li.active .down .shadow {
	background: -moz-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 1)), color-stop(100%, rgba(0, 0, 0, .1)));
	background: linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -o-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: -ms-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, .1) 100%);
	animation: hide .5s .3s linear both;
}
.flip-dot {
	float: left;
	color: #fff6f6;
	font-size: 26px;
	line-height: 48px;
	display: inline-block;
	width: 10px;
	height: 34px;
	vertical-align: bottom;
}
.flip-counter-wrapper::after {
	content: '';
	display: block;
	width: 100%;
	clear: both;
}

@keyframes show {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes hide {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}