/* Layout */

body {
	font-family: "Lucida Grande", "Trebuchet MS", sans-serif;
	background-color: #fff;
}

/* Header */

#header {
	line-height: 20px;
	width: 100%;
	padding: 5px 30px;
	background-color: #5a4232;
	color: #ccc;
	
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-o-box-sizing: border-box;
	-ie-box-sizing: border-box;
	
	box-shadow: 0 -10px 10px 10px #000;
	-moz-box-shadow: 0 -10px 10px 10px #000;
	-webkit-box-shadow: 0 -10px 10px 10px #000;
	-o-box-shadow: 0 -10px 10px 10px #000;
	-ie-box-shadow: 0 -10px 10px 10px #000;
}

#header a {
	color: inherit;
	text-decoration: none;
}

#header a:hover, #header a.active {
	color: #999;
	text-decoration: underline;
}

/* Headline */

h1 {
	width: 100%;
	position: absolute;
	top: -58px;
	color: #342217;
	font-size: 36pt;
	font-weight: bold;
	text-align: right;
	text-shadow: 0 0 10px RGBa(0,0,0,0.5);
}

h1 a {
	text-decoration: none;
	color: inherit;
}

.light {
	color: #793e12; /* 793e12 / 905622 */
	font-weight: lighter;
}

#main a {
	text-decoration: none;
	color: inherit;
}

/* Container & Flipping */

#main {
	position: relative;
	width: 540px;
	height: 540px;
	margin: 0 auto 0 auto;
	top: 86px;
	
	-webkit-perspective: 900;
}

#flip {
	width: inherit;
	height: inherit;
	-webkit-transform-style: preserve-3d;
	-webkit-transition: -webkit-transform 1.5s;
}

.flipped {
	-webkit-transform: rotateX(180deg);
}

#faq {
	-webkit-transform: rotateX(180deg);
}

#chess {
	-webkit-transform: rotateX(0deg);
}

#faq, #chess {
	-webkit-backface-visibility: hidden;
	transition: opacity 1.5s;
	-moz-transition: opacity 1.5s;
	-webkit-transition: opacity 1.5s;
	-o-transition: opacity 1.5s;
	-ie-transition: opacity 1.5s;
}

#faq, #flip.flipped #chess {
	opacity: 0;
	z-index: 0;
}

#flip.flipped #faq, #chess {
	opacity: 1;
	z-index: 1;
}

/* FAQ */

#wideBorder {
	position: absolute;
	left: -120px;
	height: 540px;
	width: 780px;
	border: 30px solid #342217;
	background: url("../img/bgTile.png") bottom left repeat;
	
	border-radius: 20px;
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	-o-border-radius: 20px;
	-ie-border-radius: 20px;
	
	box-shadow: 0 0 10px #000;
	-moz-box-shadow: 0 0 10px #000;
	-webkit-box-shadow: 0 0 10px #000;
	-o-box-shadow: 0 0 10px #000;
	-ie-box-shadow: 0 0 10px #000;
	
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-o-box-sizing: border-box;
	-ie-box-sizing: border-box;
}

#content {
	background-color: RGBa(161, 142, 128, 0.93);
	top: 30px;
	left: -90px;
	padding: 30px;
	height: 480px;
	width: 720px;
	position: absolute;
	
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	-ie-border-radius: 5px;
	
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-o-box-sizing: border-box;
	-ie-box-sizing: border-box;
	
	overflow: scroll;
	overflow-x: auto;
	overflow-y: scroll;
}

#faq h2:first-child {
	margin: 0px 0 10px 0;
	font-size: 16pt;
}

#faq h2 {
	margin: 30px 0 10px 0;
	font-size: 16pt;
}

#faq h3 {
	margin: 10px 0 10px 0;
}

#faq p, #faq ul {
	line-height: 120%;
	margin-bottom: 10px;
}

#faq ul {
	list-style: inside disc;
}

#faq a {
	color: #342217;
	text-decoration: underline;
}

/* Chess */

#faq, #chess {
	position: absolute;
	width: inherit;
	height: inherit;
}

#border {
	position: absolute;
	width: inherit;
	height: inherit;
	background-color: #342217;
	
	border-radius: 20px;
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	-o-border-radius: 20px;
	-ie-border-radius: 20px;
}

#border table {
	display: none;
}

th {
	font-weight: normal;
	color: #999;
}

tr > th:first-child {
	height: 60px;
	padding-right: 9px;
	vertical-align: middle;
}

tr:last-child > th {
	width: 60px;
	padding-top: 5px;
	text-align: center;
}


/* Chess board */

#board, #border table {
	position: absolute;
	top: 30px;
	right: 30px;
}

#board {	
	border-radius: 10px;
	-moz-border-radius: 10px;
	-webkit-border-radius: 10px;
	-o-border-radius: 10px;
	-ie-border-radius: 10px;
	
	box-shadow: inset 0 0 5px #000;
	-moz-box-shadow: inset 0 0 5px #000;
	-webkit-box-shadow: inset 0 0 5px #000;
	-o-box-shadow: inset 0 0 5px #000;
	-ie-box-shadow: inset 0 0 5px #000;
}

#board td {
	width: 60px;
	height: 60px;
	text-align: center;
	vertical-align: middle;
	background-color: #793e12;
	
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	-ie-border-radius: 5px;
}

#board tr:nth-child(odd) > td:nth-child(odd), #board tr:nth-child(even) > td:nth-child(even) {
	background-color: #d19a53; /* #986534 */
}

#board tr:first-child > td:first-child {
	border-top-left-radius: 10px;
	-moz-border-radius-topleft: 10px;
	-webkit-border-top-left-radius: 10px;
	-o-border-top-left-radius: 10px;
	-ie-border-top-left-radius: 10px;
}

#board tr:first-child > td:last-child {
	border-top-right-radius: 10px;
	-moz-border-radius-topright: 10px;
	-webkit-border-top-right-radius: 10px;
	-o-border-top-right-radius: 10px;
	-ie-border-top-right-radius: 10px;
}

#board tr:last-child > td:first-child {
	border-bottom-left-radius: 10px;
	-moz-border-radius-bottomleft: 10px;
	-webkit-border-bottom-left-radius: 10px;
	-o-border-bottom-left-radius: 10px;
	-ie-border-bottom-left-radius: 10px;
}

#board tr:last-child > td:last-child {
	border-bottom-right-radius: 10px;
	-moz-border-radius-bottomright: 10px;
	-webkit-border-bottom-right-radius: 10px;
	-o-border-bottom-right-radius: 10px;
	-ie-border-bottom-right-radius: 10px;
}

.acceptable:empty {
	background-image: url("../img/acceptable.png");
	background-position: center center;
	background-repeat: no-repeat;
}

.acceptable > .piece {
	opacity: 0.5;
}

.piece {
	width: 60px;
	height: 60px;
	overflow: hidden;
	font: 40pt "MS Gothic", "Arial Unicode", "Apple Symbols";
	color: transparent;
	background: url("../img/sprites.png") no-repeat;
	
	background-size: 360px auto;
	-moz-background-size: 360px auto;
	-webkit-background-size: 360px auto;
	-o-background-size: 360px auto;
	-ie-background-size: 360px auto;
}

.white.pawn {
	background-position: 0 0;
}

.white.knight {
	background-position: 20% 0;
}

.white.bishop {
	background-position: 40% 0;
}

.white.rook {
	background-position: 60% 0;
}

.white.queen {
	background-position: 80% 0;
}

.white.king {
	background-position: 100% 0;
}

.black.pawn {
	background-position: 0 28.57%;
}

.black.knight {
	background-position: 20% 28.57%;
}

.black.bishop {
	background-position: 40% 28.57%;
}

.black.rook {
	background-position: 60% 28.57%;
}

.black.queen {
	background-position: 80% 28.57%;
}

.black.king {
	background-position: 100% 28.57%;
}

#whiteCemetery {
	position: absolute;
	top: 30px;
	left: -130px;
	width: 120px;
	height: 480px;
	padding-right: 10px;
}

#blackCemetery {
	position: absolute;
	top: 30px;
	left: 540px;
	width: 120px;
	height: 480px;
	padding-left: 10px;
}

#whiteCemtery > li, #blackCemtery > li {
	width: 60px;
	height: 60px;
	text-align: center;
	vertical-align: middle;
}

#whiteCemetery > li {
	float: right;
}

#blackCemetery > li {
	float: left;
}

/* Info drawer */

#info {
	position: absolute;
	width: 540px;
	height: 540px;
	
	border-radius: 20px;
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	-o-border-radius: 20px;
	-ie-border-radius: 20px;
	
	color: #ccc;
	
	box-shadow: 0 0 10px #000;
	-moz-box-shadow: 0 0 10px #000;
	-webkit-box-shadow: 0 0 10px #000;
	-o-box-shadow: 0 0 10px #000;
	-ie-box-shadow: 0 0 10px #000;
	
	background-color: #5a4232;
}

#info > p {
	width: 480px;
	position: absolute;
	bottom: 9px;
	left: 30px;
	right: 30px;
}

#currentTurn {
	float: left;
	width: 22%;
	text-align: left;
}

#gameTime {
	text-align: center;
}

#lastMove {
	float: right;
	width: 42%;
	text-align: right;
}

/* Pawn promotion menu */

.promotion {
	display: none;
	background-color: RGBa(52,34,23,0.9);
	width: 240px;
	height: 60px;
	position: absolute;
	left: 140px;
	
	border-radius: 20px;
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	-o-border-radius: 20px;
	-ie-border-radius: 20px;
	
	padding: 10px;
	
	box-shadow: 0 0 10px #000;
	-moz-box-shadow: 0 0 10px #000;
	-webkit-box-shadow: 0 0 10px #000;
	-o-box-shadow: 0 0 10px #000;
	-ie-box-shadow: 0 0 10px #000;
}

#top.promotion {
	top: 105px;
}

#bottom.promotion {
	top: 355px;
}

.promotion > div {
	border-color: transparent;
	border-style: solid;
	border-width: 20px;
	height: 1px;
	width: 1px;
	position: absolute;
	left: 110px;
}

#top.promotion > div {
	border-bottom-color: RGBa(52,34,23,0.9);
	top: -41px;
}

#bottom.promotion > div {
	border-top-color: RGBa(52,34,23,0.9);
	top: 80px;
}

.promotion > ul {
	background-color: #5a4232;
	width: 240px;
	height: 60px;
	
	border-radius: 15px;
	-moz-border-radius: 15px;
	-webkit-border-radius: 15px;
	-o-border-radius: 15px;
	-íe-border-radius: 15px;
}

.promotion > ul > li > div {
	transition: opacity 0.3s;
	-moz-transition: opacity 0.3s;
	-webkit-transition: opacity 0.3s;
	-o-transition: opacity 0.3s;
	-ie-transition: opacity 0.3s;
}

.promotion > ul:hover div {
	opacity: 0.3;
}

.promotion > ul > li {
	float: left;
}

.promotion > ul > li:first-child > div {
	transform: scaleX(-1);
	-moz-transform: scaleX(-1);
	-webkit-transform: scaleX(-1);
	-o-transform: scaleX(-1);
	-ie-transform: scaleX(-1);
}

.promotion > ul > li:hover > div {
	opacity: 1;
}

/* Menu general */

.menu {
	display: none;
	height: 480px;
	width: 480px;
	overflow: hidden;
	position: absolute;
	top: 30px;
	left: 30px;
}

.stripe {
	width: 100%;
	height: 25%;
	position: relative;
	overflow: hidden;
}

.menu > .stripe:first-child {
	border-radius: 10px 10px 0 0;
	-moz-border-radius: 10px 10px 0 0;
	-webkit-border-radius: 10px 10px 0 0;
	-o-border-radius: 10px 10px 0 0;
	-ie-border-radius: 10px 10px 0 0;
}

.menu > .stripe:last-child {
	border-radius: 0 0 10px 10px;
	-moz-border-radius: 0 0 10px 10px;
	-webkit-border-radius: 0 0 10px 10px;
	-o-border-radius: 0 0 10px 10px;
	-ie-border-radius: 0 0 10px 10px;
}

.thin {
	height: 12.5%;
}

.tone30 {
	background-color: RGBa(161, 142, 128, 0.93);
}

.tone40 {
	background-color: RGBa(155, 130, 111, 0.94); /* RGBa(180,180,180,0.9) & RGBa(121,62,18,0.40) */
}

.tone55 {
	background-color: RGBa(146, 112, 87, 0.96); /* RGBa(180,180,180,0.9) & RGBa(121,62,18,0.55) */
}

.tone70 {
	background-color: RGBa(137, 95, 63, 0.97); /* RGBa(180,180,180,0.9) & RGBa(121,62,18,0.70) */
}

.tone85 {
	background-color: RGBa(129, 78, 40, 0.99); /* RGBa(180,180,180,0.9) & RGBa(121,62,18,0.85) */
}

.tone100 {
	background-color: RGBa(121, 62, 18, 1); /* RGBa(180,180,180,0.9) & RGBa(121,62,18,1) */
}

.stripe > h2 {
	font-size: 28pt;
	font-weight: normal;
	color: #342217;
	position: absolute;
	left: 147px;
	top: 27px;
}

.stripe > h2 span:first-child {
	font: 128.1px 'MS Gothic', 'Arial Unicode', 'Apple Symbols'; /* HACK font-size is odd for correct placing in firefox */
	position: absolute;
	left: -125px;
	top: -25px;
	width: 120px;
	height: 120px;
	color: transparent;
	background: url("../img/sprites.png") no-repeat;
}

.menu input {
	border: 0; 
	background-color: #5a4232;
	padding: 4px;
	
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	-ie-border-radius: 5px;
	
	font-size: 14pt;
	color: #999;
}

.menu input[type="text"] {
	width: 205px;
	position: absolute;
	left: 147px;
	top: 70px;
	height: 21px;
}

.menu input[type="button"] {
	width: 40px;
	position: absolute;
	left: 366px;
	top: 70px;
	height: 29px;
}

.menu .error {
	background-color: rgb(153,30,30);
}

.inactive {
	opacity: 0.3;
}

/* Specific menu items */

#pause h2, #end > .tone100 > h2 {
	font-size: 44pt;
}

#start > .tone55 > h2 span {
	background-position: 0 57.14%;
}

#start > .tone70 > h2 span {
	background-position: 20% 57.14%;
}

#start > .tone85 > h2 span {
	background-position: 40% 57.14%;
}

#pause > .tone55 > h2 span {
	background-position: 60% 57.14%;
}

#pause > .tone70 > h2 span {
	background-position: 80% 57.14%;
}

#pause > .tone85 > h2 span {
	background-position: 100% 57.14%;
}

#end > .tone100 > h2 span:first-child {
	background-position: 0px 100%;
	width: 180px;
	height: 180px;
	left: -175px;
	top: -57px
}

#end  > .stripe > h2 {
	left:  165px;
}

/* Selection behaviour */

#info, #border, #board, #whiteCemetery, #blackCemetery, #promotion, .menu h2 {
	user-select: none;
	-moz-user-select: none;
	-webkit-user-select: none;
	-o-user-select: none;
	-ie-user-select: none;
	cursor: default;
}

/* Animations */

.horizontal {
	transform: scaleX(0);
	-moz-transform: scaleX(0);
	-webkit-transform: scaleX(0);
	-o-transform: scaleX(0);
	-ie-transform: scaleX(0);
}

.vertical {
	transform: scaleY(0);
	-moz-transform: scaleY(0);
	-webkit-transform: scaleY(0);
	-o-transform: scaleY(0);
	-ie-transform: scaleY(0);
}