:root {
	--cell-size: 1.5em; /* 24px */
	--cell-radius: 0.5em; /* 10px */
	--cell-border-size: 0.15em; /* 2px */
	--font-size: 1.1em; /* 18px */
	--color-inactive: lightgray;
	--color-default: #9e9e9e;
	--color-wrong: black;
	--color-close: #c9b458;
	--color-correct: #6aaa64;
}

body, select {
	font-family: "Roboto";
}

#main {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
    align-items: center;
    flex-direction: column;
}

#container {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
    align-items: center;
    flex-direction: column;
	width: fit-content;
}

#container > div {
	margin: 5px auto;
}

#gameboard {
	width: min-content;
	display: flex;
	flex-wrap: wrap;
}

#gameboard .row, #keyboard .row {
	display: flex;
}

#keyboard {
	width: fit-content;
}
#keyboard .row {
	justify-content: center;
}

.cell {
	width: var(--cell-size);
	height: var(--cell-size);
	margin: 3px;
	text-align: center;
	line-height: 200%;
	border-radius: var(--cell-radius);

	font-family: "Roboto";
	font-weight: bold;
	font-size: var(--font-size);

	display: flex;
	justify-content: center;
	align-items: center;

	text-transform: uppercase;
	user-select: none;
	
	border-width: var(--cell-border-size);
	border-style: solid;
	
	color: white;
}

#gameboard .active .cell, #keyboard .cell {
	color: black;
}

.inactive .cell {
	border-color: var(--color-inactive);
}
.active .cell {
	border-color: var(--color-default);
}
.guessed .cell {
	border-color: var(--color-default);
	background-color: var(--color-default);
	color: white;
}
.final .cell {
	border-color: var(--color-default);
	background-color: var(--color-default);
	color: white;
}

/* Hide the divider if the word is unguessed */
.row:not(.guessed) .divider {
	visibility: hidden;
}

/* The divider between the word and the clue cells */
.divider {
	width: 3px;
	border-radius: 5px;
	background-color: var(--color-inactive);
	margin-right: 4px;
	pointer-events: none;
	margin: 4px;
}

/* Hiden the clue cells for unguessed words and the final word */
.result {
	visibility: hidden;
}
.guessed .result {
	visibility: visible;
}

.final {
	border-top: 3px solid var(--color-inactive);
}

.victory .cell:not(.wrong):not(.close) {
	border-color: var(--color-correct) !important;
	background-color: var(--color-correct) !important;
	color: white !important;
}

.hidden {
	display: none;
}

#keyboard .cell {
	background-color: var(--color-inactive);
	border-color: var(--color-inactive);
}

.key_enter {
    text-transform: capitalize;
    width: fit-content;
    padding: 0 5px;
}

#timer {
	font-family: "Roboto";
	font-size: 24px;
}


#start, #confirm, #clear {
	font-family: "Roboto";
	font-size: 16px;
	height: 24px;
	width: 100px;
	border-radius: 10px;
	font-weight: bold;
	border: 2px solid var(--color-active);
}

#start, #clear {
	background-color: var(--color-inactive);
}
#confirm {
	animation: bg-slide 2s linear;
	background: linear-gradient(to left, var(--color-inactive) 50%, #eeeeee 50.1%);
    background-size: 200% 200%;
	background-position: 100% 0%;
}

@keyframes bg-slide {
    0%	{background-position: 0% 0% }
    100%{background-position: 100% 0% }
}

#game {
	display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
	width: 100%;
}

#keyboard .cell:not(.key_enter) {
	width: 20px !important;
}

#gameboard .note_green, #tutorial .note_green {
	border-color: var(--color-correct);
	background-color: var(--color-correct);
	color: white !important;
}

#gameboard .note_yellow, #tutorial .note_yellow {
	border-color: var(--color-close);
	background-color: var(--color-close);
	color: white !important;
}

#gameboard .note_black, #tutorial .note_black {
	border-color: var(--color-wrong);
	background-color: var(--color-wrong);
	color: white !important;
}


/* Cursor */
.guessed .cell:not(.result):not(.divider), #keyboard .cell, #start, #confirm, #clear, #help, #close, #openstats {
	cursor: pointer;
}

#gameboard {
	margin-top: 0px !important;
}
#info {
	width: 100%;
	display: flex;
	justify-content: space-between;
	margin: 0px !important;
	user-select: none;
}
#title {
	text-align: center;
	font-size: 20px;
	font-weight: bold;
}
#openstats {
	border-radius: 50%;
	font-weight: bold;
	width: 20px;
	height: 20px;
	text-align: center;
}
#help {
	border-radius: 50%;
	border: 1px solid black;
	font-weight: bold;
	width: 20px;
	height: 20px;
	text-align: center;
}


#dialog-container {
	width: 100%;
	height: 100%;
	
	position: absolute;
	top: 0;
	left: 0;
	
	display: flex;
	align-items: center;
    justify-content: center;
	
	pointer-events: none;
}

.dialog {
	border: 2px solid var(--color-default);
	border-radius: 1em;
	padding: 20px 40px;
	max-width: 400px;
	width: 65%;
	height: fit-content;
	background-color: white;
	box-shadow: 0 10px 10px gray;
	
	pointer-events: auto;
}

#tutorial .cell {
	display: inline-block;
    vertical-align: middle;
}


#guessTable > div > span:first-child {
	font-size: 40px;
}
#guessTable span {
	display: block;
	text-align: center;
}
#guessTable {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-around;
}

#distribution > div {
	display: flex;
	margin: 4px 0;
}
#stats .number {
	width: 20px;
	display: inline-block;
}
#stats .bar {
    display: flex;
    font-weight: bold;
    color: white;
    background-color: var(--color-default);
    min-width: 10px;
    width: var(--percent);
    justify-content: flex-end;
    padding-right: 2px;
}