* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	user-select: none;
	-webkit-user-select: none;
}

body {
	font-family: Arial, Roboto, sans-serif;
	font-size: 24px;
}

body {
	background: radial-gradient(circle at center, #1a1a3d 0%, #0a0a1f 70%, #000000 100%);
}

canvas {
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
}

#menu {
	z-index: 1000000;
	position: relative;
	padding: 10px 20px;
	gap: 20px;
	display: flex;
	justify-content: flex-start;
}

#menu > div {
	cursor: pointer;
}

#gameSelector {
	width: 100vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	position: absolute;
	color: #fff;
}

#gameSelector .game {
	cursor: pointer;
}

.table {
	display: flex;
	gap: 16px;
	padding: 0 16px 16px;
}

.holder {
	flex-shrink: 0;
	width: calc(var(--psize) * var(--sc) * 3 + 13px * 2);
}

.body {
	flex-shrink: 0;
}

.el {
	transition: all .1s linear, transform .2s linear, filter 0s linear;
	position: absolute;
	overflow: hidden;
}

.el .img {
	background-position: 0 0;
	transform-origin: top left;
	background-repeat: no-repeat;
}

.p {
	width: calc(var(--psize) * var(--sc));
	height: calc(var(--psize) * var(--sc));
	cursor: pointer;
}

.p .img {
	width: var(--psize);
	height: var(--psize);
	transform: scale(calc(1 * var(--sc)));
}

.b {
	width: calc(var(--bsize) * var(--sc));
	height: calc(var(--bsize) * var(--sc));
}

.b .img {
	width: var(--bsize);
	height: var(--bsize);
	transform: scale(calc(1 * var(--sc)));
}

.c {
	cursor: pointer;
	width: calc(var(--csize) * var(--sc));
	height: calc(var(--csize) * var(--sc));
}

.c .img {
	width: var(--csize);
	height: var(--csize);
	transform: scale(calc(1 * var(--sc)));
}

.shake {
	animation: shakeAnimation 0.5s ease-in-out;
}

.flip {
	animation: flipAnimation 0.5s forwards;
	transform-style: preserve-3d;
}

.modal {
	color: #000;
	font-size: 16px;
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999999;
}

.modal-inner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	max-height: 95%;
	max-width: 95%;
	width: 800px;
	overflow-y: auto;
	border-radius: 5px;
	display: flex;
	flex-direction: column;
}

.modal-header {
	display: flex;
	justify-content: space-between;
}

.modal-content {
	padding: 0 16px 32px;
	flex-grow: 1;
	overflow: auto;
	line-height: 1.3;
	gap: 8px;
	display: flex;
	flex-direction: column;
}

.modal h2 {
	padding: 16px;
}

.modal-hide {
	font-size: 24px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 16px;
}

ol, ul {
	padding-left: 1.5em;
}

.t {
	position: fixed;
	width: 100vw;
	height: 100vh;
	opacity: .1;
	transition: background .2s linear;
}

@keyframes flipAnimation {
	from {
		transform: rotateX(0deg);
	}

	to {
		transform: rotateX(180deg);
	}

}

@keyframes shakeAnimation {
	0% {
		transform: translateX(0);
	}

	20% {
		transform: translateX(-5px);
	}

	40% {
		transform: translateX(5px);
	}

	60% {
		transform: translateX(-5px);
	}

	80% {
		transform: translateX(5px);
	}

	100% {
		transform: translateX(0);
	}

}

.portrait .table {
	flex-direction: column;
}

.portrait .holder[data-side="0"] {
	order: 3;
}

.portrait .board {
	order: 2;
}

.portrait .holder[data-side="1"] {
	order: 1;
}

@media (orientation:portrait) {
	#gameSelector {
		font-size: 32px;
	}

}