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

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

/*light theme*/
.light {
    --color1: hsla(0, 0%, 80%, 1);
    --color2: hsla(0, 0%, 20%, 1);
}

/*dark theme*/
.dark {
    --color1: hsla(0, 0%, 20%, 1);
    --color2: hsla(0, 0%, 80%, 1);
}

/*for all*/
* {
    margin: 0;
    padding: 0;
    font-family: Audiowide;
}

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

/*name*/
#name {
    position: fixed;
    top: 0;
    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*/
#switcher {
    background: none;
    border: none;
}

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

#cord-bar {
    width: 100%;
    position: fixed;
    top: 3.75rem;
    font-size: 0.85rem;
    left: 0;
    padding: 0 2rem;
    background: var(--color2);
    height: 2rem;
    color: var(--color1);
    word-wrap: nowrap;
    display: flex;
    align-items: center;
}

/*the board*/
.board{
    width: var(--board);
    aspect-ratio: 1;
    display: grid;
    grid-template-rows: repeat(8,1fr);
    grid-template-columns: repeat(8,1fr);
    border-radius: 1rem;
    overflow: hidden;
}

.board-wrapper {
    background: var(--color2);
    padding: 5vw;
    border-radius: 1.75rem;
    font-size: 0.25rem;
    color: var(--color1);
}

.indentX {
    position: absolute;
    display: flex;
    flex-direction: column-reverse;
}

.indentY {
    position: absolute;
    display: flex;
    flex-direction: row;
}

.indentX div {
    height: calc(var(--board)/8);
    width: 5vw;
    transform: translateX(-5vw);
    display: flex;
    justify-content: center;
    align-items: center;
}

.indentY div {
    width: calc(var(--board)/8);
    height: 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*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 .piece {
    transform: scale(1.1);
}

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

/*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: 1rem;
	right: 0;
	margin-right: 1rem;
	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;
}