/*import the audiowide fonts*/
@font-face {
  font-family: "Audiowide";
  src: url("fonts/Audiowide-Regular.ttf") format("truetype");
}

/*the root element ie html*/
/*define global variables*/
:root {
    --board: 320px;
}

/*light theme*/
.light {
    --color1: #F2F2F2;
    --color2: #2F2F2F;
}

/*dark theme*/
.dark {
    --color1: #2F2F2F;
    --color2: #F2F2F2;
}

/*for all*/
* {
    margin: 0;
    padding: 0;
}

/*body*/
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color1);
}

/*name*/
#name {
    position: fixed;
    top: 0;
    font-family: Audiowide;
    font-size: 2.3rem;
}

/*odd spans in name*/
#name span:nth-child(odd) {
    color: var(--color2);
}

/*even spans in name*/
#name span:nth-child(even) {
    color: var(--color1);
    -webkit-text-stroke: 1px var(--color2);
    stroke-width: 16px;
}

/*button of king in name*/
#kingit {
    background: none;
    border: none;
}

/*svg of king in kingit*/
#kingit svg {
    color: var(--color2);
    width: 2.5rem;
    position: sticky;
    top: 6px;
}

/*the board*/
.board{
    width: var(--board);
    aspect-ratio: 1;
    display: flex;
    flex-wrap: wrap;
    background: var(--color2);
    border: 0.5rem solid var(--color2);
    border-radius: 1.5rem;
    overflow: hidden;
}

/*all cells*/
.cell{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: calc(var(--board)/8);
    aspect-ratio: 1;
    background: var(--color1);
}

/*overwrite the cells as per the pattern*/
.cell:nth-child(16n + 2),
.cell:nth-child(16n + 4),
.cell:nth-child(16n + 6),
.cell:nth-child(16n + 8),
.cell:nth-child(16n + 9),
.cell:nth-child(16n + 11),
.cell:nth-child(16n + 13),
.cell:nth-child(16n + 15) {
    background: var(--color2);
}

/*highlight selected cell*/
.cell.highlight::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,0,0.25);
    border: 2px solid rgba(255, 255, 0, 1);
}

/*all pieces*/
.piece {
    width: calc(var(--board)/8);
    stroke-width: 16px;
}

/*white pieces*/
.white {
    color: var(--color1);
    stroke: var(--color2);
}

/*black pieces*/
.black {
    color: var(--color2);
    stroke: var(--color1);
}

/*footer*/
footer {
	position: fixed;
	font-family: "Audiowide";
	bottom: 0;
	right: 0;
	margin: 1rem;
	margin-right: 3rem;
	font-size: 14px;
}

/*the link in footer*/
footer a {
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	color: var(--color2);
}

/*behaviour of the link in footer*/
footer a:active {
	font-size: 12px;
}

/*the image in the footer*/
footer img {
	position: absolute;
	height: 1.5rem;
	bottom: 0;
	margin-left: 6px;
}