﻿@font-face
{
	font-family: "Western";
	src: url("fonts/westernbb.woff") format("WOFF");
	font-weight: normal;
	font-style: normal;
	font-dispay: swap; /* Eviter d'afficher du texte invisible : https://web.dev/font-display/?utm_source=lighthouse&utm_medium=unknown#how-to-avoid-showing-invisible-text */
}

body
{
	color: white;
	background-image: url("https://image.freepik.com/photos-gratuite/concept-texture-fond-ecran-bois-materiel_53876-31749.jpg");
	background-repeat: no-repeat;
	background-size: cover;
}

h1, h2, h3, h4, h5, h6
{
	font-family: Western, serif;
	font-weight: normal;
}

h1
{
	font-size: 3em;
}

h2
{
	font-size: 2.5em;
}

h3
{
	font-size: 2em;
}

ul, ol, li
{
	text-align: left;
}

header
{
	text-align: center;
}

h2
{
	text-align: center;
}

a
{
	color: yellow;
}

a:hover
{
	color: orange;
}

h1 a, h1 a:hover
{
	color: unset;
	text-decoration: unset;
}


/* Nouvelle partie */

#flex_start_content
{
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	
}

.start_game
{
	color: black;
	display: inline-block;
	border: 3px solid black;
	background-color: #E8DCAA;
	background-size: cover;
	padding: 25px;
	text-align: center;
	width: 33%;
}

#flex_team
{
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
}

#flex_team figure a
{
	position: relative;
	display: inline-block;
}

#flex_team figure a *
{
	transition: 345ms;
}

#flex_team img[src*="pawn"]
{
	position: absolute;
	width: 64px;
	bottom: -5px;
	opacity: 0;
}

#flex_team a :nth-of-type(2) /* Pion */
{
	left: -10px;
	transform: rotate(-15deg);
}

#flex_team a :nth-of-type(3) /* Pion */
{
	right: -10px;
	transform: rotate(15deg);
}

#flex_team figure a:hover :nth-of-type(1) /* Roi */
{
	transform: scale(1.2);
}

#flex_team figure a:hover img[src*="pawn"]
{
	opacity: 1;
}

#flex_start_content li a img
{
	transition: 456ms;
}

#flex_start_content li a:hover img
{
	transform: rotate(360deg);
}


/* En attente d'un adversaire... */

section#wait
{
	display: flex;
	flex-direction: column;
	align-items: center;
}

#pawn_content
{
	width: 100%; /* A cause de flexbox sur le parent <section>. */
}

@keyframes race_of_pawns {
	from {
		transform: translate();
	}
	
	20% {
		transform: translate(200px);
	}
	
	40% {
		transform: translate(400px);
	}
	
	60% {
		transform: translate(600px);
	}
	
	80% {
		transform: translate(800px);
	}
	
	to {
		transform: translate(1000px);
	}
}

#pawn_content p img /* Deux pions */
{
	animation-name: race_of_pawns;
	animation-duration: 6s;
	animation-iteration-count: infinite;
}

#pawn_content p:last-child img /* Pion noir */
{
	animation-delay: 200ms;
}


/* Devant l'échiquier ! */

#flex_chess
{
	display: flex;
	justify-content: center;
	align-items: center;
}

#flex_chess aside:nth-of-type(1) /* <aside> gauche, les pions vers la droite (par défaut c'est à gauche donc pas besoin pour <aside> droit ;) */
{
	text-align: right;
}

aside
{
	margin: 0 40px;
}

aside ul
{
	list-style-type: none;
	padding: 0;
}

aside li
{
	position: relative;
}

aside li img
{
	width: 73px;
}

/* Tableau */

#flex_chess div:nth-of-type(1)
{
	/* Contient le tableau ;) */
}

#chessboard
{
	width: 600px;
	height: 600px;/*
	table-layout: fixed; /* Tout le monde pareil ! */
}

#chessboard td
{
	position: relative;
	height: 73px; /* Permet au lien d'avoir un "height: 100%;" (fonctionne sans avec Google Chrome...?) */
}

#chessboard td img
{
	width: 73px;
	position: absolute;
	top: 0px;
	left: 0px;
}

.available_cell_to_do_queen, .available_cell_to_do_castling
{
	background-color: purple;
}

.available_cell_to_eat
{
	background-color: red;
}

.available_cell
{
	background-color: blue;
}

.active_cell
{
	background-color: #BACA44;
}

.king_is_in_check
{
	background-color: tomato;
}

.old_cell_occupied
{
	background-color: orange;
}

.new_cell_occupied
{
	background-color: yellow;
}

.white_cell
{
	background-color: #EEEED2;
}

.black_cell
{
	background-color: #769656;
}

#chessboard a
{
	display: block;
	width: 100%;
	height: 100%;
}


/* Footer */

footer
{
	text-align: right;
}



