/* general styles */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	background-color: #112;
	color: white;
	font-size: 24px;
	font-family: "Trebuchet MS", "Lucida Sans Unicode",
		"Lucida Grande", "Lucida Sans", Arial, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0px 20px;
}

/* heading */

h1 {
	margin: 30px 0px;
}

/* board */

#board {
	--size: 5;
	display: grid;
	width: min(90vw, 400px);
	height: min(90vw, 400px);
	grid-template-columns: repeat(var(--size), 1fr);
	grid-template-rows: repeat(var(--size), 1fr);
	gap: calc(20% / var(--size));
	margin: 50px 0px;
}

/* checkboxes and labels */

input[type="checkbox"] {
	display: none;
}

input[type="checkbox"]:checked + label {
	background-color: #ff0;
	box-shadow: 0px 0px 10px #ff0b;
}

input[type="checkbox"]:not(:checked) + label {
	background-color: #222;
}

#board label {
	border-radius: 5px;
	transition: background-color 200ms, box-shadow 200ms;
	cursor: pointer;
}

/* result message */

#win {
	color: #ff0;
	margin: 20px 0px;
	opacity: 0;
	scale: 0;
	transition: opacity 150ms, scale 150ms;
}

#win.visible {
	scale: 1;
	opacity: 1;
}

/* menu */

menu {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}

/* button */

button {
	font-family: inherit;
	font-size: inherit;
	padding: 6px 10px;
	border: 2px solid white;
	background: none;
	color: inherit;
	cursor: pointer;
	border-radius: 8px;
}

button:hover,
button:focus-visible {
	box-shadow: 0px 0px 8px #fffa;
}

button:active {
	scale: 0.95;
}

/* input */

input[type="text"] {
	font-family: inherit;
	background: none;
	color: inherit;
	font-size: inherit;
	border: 2px solid white;
	outline: none;
	text-align: center;
	padding: 6px;
	width: 50px;
}

input[type="text"]:focus:valid {
	border-color: green;
}

input[type="text"]:invalid {
	border-color: red;
}
