/*通用设置*/
a{
	display: block;
	margin: 20px auto;
	width: 100px;
	padding: 10px 10px;
	background-color: #8f7a66;
	color: #fff;
	border-radius: 10px;
	text-decoration: none;
	font-weight: bold;
}
/*主界面*/
html,body {
	margin: 0;
	padding: 0;
	background-color: #faf8ef;
	color: #776e65;
	font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  	font-size: 18px;
}


/*头部游戏名区域*/
header {
	display: block;
	margin: 0 auto;
	width: 500px;
	text-align: center;

	
}
header h1 {
	font-size: 60px;
	font-weight: bold;
	
}


header #newGameButton:hover {
	background-color: #978b77;
}
header p {
	display: inline-block;
	font-size: 24px;
	padding: 0 20px;
}




/*游戏主体区域*/
.game-container {
	position: relative;
	width: 460px;
	height: 460px;
	margin: 50px auto;
	padding: 20px;
	background-color: #bbada0;
	border-radius: 6px;
}

/*游戏终止信息区域*/
.game-message {
	width: 500px;
	height: 500px;
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	background-color: rgba(238,228,218,.5);
	z-index: 999;
	text-align: center;
}

.game-message p {
	font-size: 60px;
	font-weight: bold;
	height: 60px;
	line-height: 60px;
	margin-top: 222px;
	
}

.game-message .lower {
	display: block;
	margin-top: 59px;	
}

.game-message a {
	display: inline-block;

}

.game-won {
	background-color: rgba(237,194,46,.5);
	color: #F9F6F2;
}


/*背景cell设置*/
.grid-container {
	position: absolute;
	z-index: 1;
}

.grid-row {
	margin-bottom: 20px;
}
.grid-row:last-child {
	margin-bottom: 0;
}
.grid-row:after {
	content: "";
	display: block;
	clear: both;
}

.grid-cell {
	width: 100px;
	height: 100px;
	margin-right: 20px;
	float: left;
	border-radius: 6px;
	background-color: rgba(238,228,218,.35);
	
}

.grid-cell:last-child {
	margin-right: 0;
}

/*棋子tile设置*/
.tile-container {
	position: absolute;
	left: 20px;
	top: 20px;
	z-index: 2;
}

@keyframes show{
	from{font-size: 0;width: 0;height: 0;transform: translate(50px,50px);}
	to{width: 100px;height: 100px;}
}

@-moz-keyframes show{
	from{font-size: 0;width: 0;height: 0;transform: translate(50px,50px);}
	to{width: 100px;height: 100px;}
}
@-ms-keyframes show{
	from{font-size: 0;width: 0;height: 0;transform: translate(50px,50px);}
	to{width: 100px;height: 100px;}
}
@-webkit-keyframes show{
	from{font-size: 0;width: 0;height: 0;transform: translate(50px,50px);}
	to{width: 100px;height: 100px;}
}

.tile-new {
	animation: show 200ms ease;
}

.tile {
	width: 100px;
	height: 100px;
	border-radius: 6px;
	font-weight: bold;
	font-size: 60px;
	line-height: 100PX;
	text-align: center;
	position: absolute;
}

/*不同数字字体背景设置*/
.tile-128,.tile-256,.tile-512 {
	font-size: 50px;
}


.tile-1024,.tile-2048 {
	font-size: 40px;
}


.tile-2 {
	background-color: #eee4da;
	box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}
.tile-4 {
	background: #ede0c8;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}
.tile-8 {
	color: #f9f6f2;
    background: #f2b179;
}
.tile-16 {
	color: #f9f6f2;
    background: #f59563;
}
.tile-32 {
	color: #f9f6f2;
    background: #f67c5f;
}
.tile-64 {
	color: #f9f6f2;
    background: #f65e3b; 
}
.tile-128 {
	color: #f9f6f2;
    background: #edcf72;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.2381), inset 0 0 0 1px rgba(255, 255, 255, 0.14286);
}

.tile-256 {
	color: #f9f6f2;
    background: #edcc61;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.19048);
}
.tile-512 {
	color: #f9f6f2;
    background: #edc850;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.39683), inset 0 0 0 1px rgba(255, 255, 255, 0.2381);
}

.tile-1024 {
	color: #f9f6f2;
    background: #edc53f;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.28571);
}
.tile-2048 {
	color: #f9f6f2;
    background: #edc22e;
    box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.55556), inset 0 0 0 1px rgba(255, 255, 255, 0.33333);
}

/*棋子各位置的position设置*/
/*第一列*/
.tile-0-0 {
	top: 0;
	left: 0;
}
.tile-0-1 {
  	top:120px;
  	left: 0;
  	
}
.tile-0-2 {
	top: 240px;
	left: 0;
}
.tile-0-3 {
	top: 360px;;
	left: 0;
}
/*第二列*/
.tile-1-0 {
  	top: 0;
	left: 120px;
}
.tile-1-1 {
  	top: 120px;
  	left: 120px;
}
.tile-1-2 {
  	top: 240px;
  	left: 120px;
}
.tile-1-3 {
  	top: 360px;
  	left: 120px;
}
/*第三列*/
.tile-2-0 {
  	top: 0;
  	left: 240px;
}
.tile-2-1 {
  	top: 120px;
  	left: 240px;
  	
}
.tile-2-2 {
  	top: 240px;
  	left: 240px;
}
.tile-2-3 {
  	top: 360px;
  	left: 240px;
}
/*第四列*/
.tile-3-0 {
  	top: 0;
  	left: 360px;
}
.tile-3-1 {
  	top: 120px;
  	left: 360px;
}
.tile-3-2 {
  	top: 240px;
  	left: 360px;
}
.tile-3-3 {
  	top: 360px;
  	left: 360px;
}


@media screen and (max-width:520px) {
	/*通用*/
	a{
		margin: 0 auto;
	}
	/*主界面*/
	html,body {
	  	font-size: 14px;
	}
	
	
	/*头部游戏名区域*/
	header {
		width: 100%;
	}
	header h1 {
		font-size: 30px;
		margin: 15px;
	}
	
	header p {
		font-size: 18px;
		padding: 0 5px;
	}
	
	
	
	
	/*游戏主体区域*/
	.game-container {
		width: 264px;
		height: 264px;
		margin: 0 auto;
		padding: 8px;
	}
	
	/*游戏终止信息区域*/
	.game-message {
		width: 280px;
		height: 280px;
	}
	
	.game-message p {
		font-size: 30px;
		font-weight: bold;
		height: 30px;
		line-height: 30px;
		margin-top: 100px;
		
	}
	
	.game-message .lower {
		margin-top: 40px;	
	}
	
	
	/*背景cell设置*/
	.grid-container {
		position: absolute;
		z-index: 1;
	}
	
	.grid-row {
		margin-bottom: 8px;
	}
	/*.grid-row:last-child {
		margin-bottom: 0;
	}*/

	
	.grid-cell {
		width: 60px;
		height: 60px;
		margin-right: 8px;
		border-radius: 6px;
		
	}
	
	/*.grid-cell:last-child {
		margin-right: 0;
	}*/
	
	/*棋子tile设置*/
	.tile-container {
		left: 8px;
		top: 8px;
	}
	
	@keyframes show{
		from{font-size: 0;width: 0;height: 0;transform: translate(30px,30px);}
		to{width: 60px;height: 60px;}
	}
	
	@-moz-keyframes show{
		from{font-size: 0;width: 0;height: 0;transform: translate(30px,30px);}
		to{width: 60px;height: 60px;}
	}
	@-ms-keyframes show{
		from{font-size: 0;width: 0;height: 0;transform: translate(30px,30px);}
		to{width: 60px;height: 60px;}
	}
	@-webkit-keyframes show{
		from{font-size: 0;width: 0;height: 0;transform: translate(30px,30px);}
		to{width: 60px;height: 60px;}
	}

	
	.tile {
		width: 60px;
		height: 60px;
		font-size: 30px;
		line-height: 60PX;

	}
	
	/*不同数字字体背景设置*/
	.tile-128,.tile-256,.tile-512 {
		font-size: 30px;
	}
	
	
	.tile-1024,.tile-2048 {
		font-size: 20px;
	}
	
	
	
	/*棋子各位置的position设置*/
	/*第一列*/
	.tile-0-0 {
		top: 0;
		left: 0;
	}
	.tile-0-1 {
	  	top:68px;
	  	left: 0;
	  	
	}
	.tile-0-2 {
		top: 136px;
		left: 0;
	}
	.tile-0-3 {
		top: 204px;;
		left: 0;
	}
	/*第二列*/
	.tile-1-0 {
	  	top: 0;
		left: 68px;
	}
	.tile-1-1 {
	  	top: 68px;
	  	left: 68px;
	}
	.tile-1-2 {
	  	top: 136px;
	  	left: 68px;
	}
	.tile-1-3 {
	  	top: 204px;
	  	left: 68px;
	}
	/*第三列*/
	.tile-2-0 {
	  	top: 0;
	  	left: 136px;
	}
	.tile-2-1 {
	  	top: 68px;
	  	left: 136px;
	  	
	}
	.tile-2-2 {
	  	top: 136px;
	  	left: 136px;
	}
	.tile-2-3 {
	  	top: 204px;
	  	left: 136px;
	}
	/*第四列*/
	.tile-3-0 {
	  	top: 0;
	  	left: 204px;
	}
	.tile-3-1 {
	  	top: 68px;
	  	left: 204px;
	}
	.tile-3-2 {
	  	top: 136px;
	  	left: 204px;
	}
	.tile-3-3 {
	  	top: 204px;
	  	left: 204px;
	}
}
