body {
	margin: 0;
	background-color: #fff;
	font-size: 0;
	text-align: center;
}

#gameBoard {
	width: 100vmin;
	height: 100vmin;
	display: inline-flex;
	flex-flow: column nowrap;
	font-size: 5vmin;
	line-height: 1;
}

.boardRow, .boardCell {
	display: flex;
	flex: 1;
}

.boardCell {
	justify-content: center;
	align-items: center;
	border: .3vmin solid #999;
	transition: border-top-color 1s, border-right-color 1s, border-bottom-color 1s, border-left-color 1s;
}

.boardRow:nth-of-type(6n+2) > .boardCell:nth-of-type(6n+2) {
	color: #999;
}

.boardRow:nth-of-type(1) > .boardCell,
.boardRow > .boardCell:nth-of-type(8n+1),
.boardRow:nth-of-type(7n+2) > .boardCell:nth-of-type(6n-4) {
	border-top-color: transparent;
}

.boardRow:nth-of-type(6n-4) > .boardCell:nth-of-type(7n+1),
.boardRow:nth-of-type(8n+1) > .boardCell,
.boardRow > .boardCell:nth-of-type(9) {
	border-right-color: transparent;
}

.boardRow:nth-of-type(7n+1) > .boardCell:nth-of-type(6n-4),
.boardRow > .boardCell:nth-of-type(8n+1),
.boardRow:nth-of-type(9) > .boardCell {
	border-bottom-color: transparent;
}

.boardRow > .boardCell:nth-of-type(1),
.boardRow:nth-of-type(8n+1) > .boardCell,
.boardRow:nth-of-type(6n-4) > .boardCell:nth-of-type(7n+2) {
	border-left-color: transparent;
}

#gameBoard.topPlayer > .boardRow:nth-of-type(n+3):nth-of-type(-n+8) > .boardCell:nth-of-type(n+3):nth-of-type(-n+7) {
	border-top-color: #eee;
}

#gameBoard.topPlayer > .boardRow:nth-of-type(n+2):nth-of-type(-n+7) > .boardCell:nth-of-type(n+3):nth-of-type(-n+7) {
	border-bottom-color: #eee;
}

#gameBoard.leftPlayer > .boardRow:nth-of-type(n+3):nth-of-type(-n+7) > .boardCell:nth-of-type(n+2):nth-of-type(-n+7) {
	border-right-color: #eee;
}

#gameBoard.leftPlayer > .boardRow:nth-of-type(n+3):nth-of-type(-n+7) > .boardCell:nth-of-type(n+3):nth-of-type(-n+8) {
	border-left-color: #eee;
}

#gameBoard .topPiece, #gameBoard .leftPiece {
	display: flex;
	position: relative;
	transition: top 1s, left 1s, transform .5s .5s;
	cursor: default;
	user-select: none;
	-webkit-user-select: none;
}

#gameBoard.topPlayer:not(.waitingForServer) .topPiece, #gameBoard.leftPlayer:not(.waitingForServer) .leftPiece {
	cursor: pointer;
}

.helperDots {
	position: absolute;
	z-index: -1;
}

.helperDots > div {
	position: absolute;
	padding: .5vmin;
	border-radius: .5vmin;
	background-color: #999;
	left: -4.5vmin;
}

.boardRow:nth-of-type(8) > .boardCell > .helperDots > div, .boardRow > .boardCell:nth-of-type(8) > .helperDots > div {
	left: 3.5vmin;
}

.helperDots > div:nth-of-type(1):nth-last-of-type(3) {
	top: -2vmin;
}

.helperDots > div:nth-of-type(1):nth-last-of-type(1), .helperDots > div:nth-of-type(2):nth-last-of-type(2) {
	top: -.5vmin;
}

.helperDots > div:nth-of-type(3):nth-last-of-type(1) {
	top: 1vmin;
}

.helperDots > div:nth-of-type(1):nth-last-of-type(2) {
	top: -1.25vmin;
}

.helperDots > div:nth-of-type(2):nth-last-of-type(1) {
	top: .25vmin;
}

input[type="button"] {
	width: 9.5vmin;
	height: 9.5vmin;
	padding: 0;
	border-width: .4vmin;
	border-color: #999;
	border-radius: 3vmin;
	background-color: #eee;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

input[type="button"]:disabled {
	opacity: .5;
}

#gameBoard .boardMsg {
	width: 77.77vmin;
	position: absolute;
	font-size: 3vmin;
	color: #555;
}

#gameBoard:not(.leftPlayer) .boardMsg:nth-of-type(1), #gameBoard:not(.topPlayer) .boardMsg:nth-of-type(1) {
	display: none;
}

#gameBoard:not(.waitingForServer) .boardMsg:nth-of-type(2) {
	display: none;
}

#gameBoard.topPlayer.leftPlayer .boardMsg:nth-of-type(3), #gameBoard.waitingForServer .boardMsg:nth-of-type(3), #gameBoard:not(.topPlayer):not(.leftPlayer) .boardMsg:nth-of-type(3) {
	display: none;
}

#gameBoard:not(.showOutcome) .boardMsg:nth-of-type(3) > div {
	display: none;
}

#gameBoard:not(.computerLoss) .boardMsg:nth-of-type(3) > div:nth-of-type(1) {
	display: none;
}

#gameBoard:not(.computerDraw) .boardMsg:nth-of-type(3) > div:nth-of-type(2) {
	display: none;
}

#gameBoard:not(.computerWin) .boardMsg:nth-of-type(3) > div:nth-of-type(3) {
	display: none;
}

#settingsContainer {
	width: 100vw;
	height: 100vh;
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	justify-content: center;
	align-items: center;
	background-color: rgba(255, 255, 255, .5);
}

#settingsContainer > div {
	position: absolute;
	padding: 2vmin;
	border: .5vmin solid #555;
	border-radius: 2vmin;
	background-color: #fff;
	font-size: 4vmin;
}

#gameBoard:not(.showSettings) + #settingsContainer {
	display:none;
}

#gameBoard.showSettings {
	filter: blur(.5vmin);
}

#settingsContainer input[type="range"] {
	width: 45vmin;
	height: 4vmin;
	margin: 0;
	padding: 0;
	vertical-align: middle;
	-webkit-appearance: none;
	outline-color: transparent;
	outline-style: solid;
	outline-width: .5vmin;
	outline-offset: .5vmin;
}

#settingsContainer input[type="range"]:focus {
	outline-color: #999;
}

#settingsContainer input[type="range"]::-webkit-slider-runnable-track {
	width: 45vmin;
	height: 2vmin;
	border: none;
	border-radius: 0;
	background-color: #999;
	-webkit-appearance: none;
}

#settingsContainer input[type="range"]::-moz-range-track {
	width: 45vmin;
	height: 2vmin;
	border: none;
	border-radius: 0;
	background-color: #999;
}

#settingsContainer input[type="range"]::-ms-track {
	width: 45vmin;
	height: 2vmin;
	border-color: transparent;
	border-width: 1vmin 0;
	border-radius: 0;
	background-color: #999;
	color: transparent;
}

#settingsContainer input[type="range"]::-webkit-slider-thumb{
	width: 4vmin;
	height: 4vmin;
	margin-top: -1vmin;
	border: none;
	border-radius: 0;
	background-color: #555;
	-webkit-appearance: none;
}

#settingsContainer input[type="range"]::-moz-range-thumb {
	width: 4vmin;
	height: 4vmin;
	border: none;
	border-radius: 0;
	background-color: #555;
}

#settingsContainer input[type="range"]::-ms-thumb {
	width: 4vmin;
	height: 4vmin;
	border: none;
	border-radius: 0;
	background-color: #555;
}

#settingsContainer input[type="checkbox"] {
	width: 4vmin;
	height: 4vmin;
	margin: 0;
	padding: 0;
	vertical-align: middle;
	appearance: none;
	-webkit-appearance: none;
	border: .5vmin solid #555;
	background-color: transparent;
	outline-color: transparent;
	outline-style: solid;
	outline-width: .5vmin;
	outline-offset: .5vmin;
}

#settingsContainer input[type="checkbox"]:focus {
	outline-color: #999;
}

#settingsContainer input[type="checkbox"]:checked {
	border-color: #999;
	background-color: #555;
}
