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

body {
	font-family: Arial, Helvetica, sans-serif;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background-color: #111;
	color: white;
}

img {
	display: block;
	max-width: 100%;
}

.game {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

h1 {
	font-weight: 400;
	font-size: 2.5rem;
	text-align: center;
}

button {
	font-family: inherit;
	font-size: inherit;
	background: none;
	border: none;
	transition: all 100ms;
	cursor: pointer;
	background-color: #222;
	color: white;
	padding: 0.4rem;
	border-radius: 0.25rem;
}

button:focus-visible {
	outline: 0.1rem solid white;
	outline-offset: 0.1rem;
}

button:hover {
	filter: brightness(1.4);
}

.board {
	--size: 3;
	margin-block: 2rem;
	display: grid;
	grid-template: repeat(var(--size), 1fr) / repeat(var(--size), 1fr);
	gap: 0.5rem;
	transition: scale 100ms;
}

.outcome {
	margin-bottom: 1.5rem;
}

.cell {
	width: 4rem;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
	border: 0.1rem solid #aaa;
	border-radius: 0.5rem;
	padding: 0;
}

.cell:not(:empty),
.board.ended .cell {
	cursor: not-allowed;
}

.cell.highlight {
	box-shadow: 0 0 1rem #fff4;
	background-color: #0f05;
}

.restart {
	width: 2rem;
	padding: 0.4rem;
}

.visually-hidden {
	position: absolute;
	left: -100vw;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.dialog {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	border: none;
	border-radius: 0.5rem;
	padding: 1.5rem;
	background-color: white;
	color: #111;
	text-align: center;
	font-size: 1.25rem;
	box-shadow: 0rem 0rem 1rem #0007;
}

.dialog_text {
	margin-bottom: 1rem;
}

.dialog button {
	outline-color: #222;
}
