/* Common */
body {
	background-color: #e9e9e9;
	display: flex;
	font-family: Arial, Helvetica, sans-serif;
	height: 100vh;
	margin: 0;
}
a {
	text-decoration: none;
}
h1 {
	text-align: center;
}
article {
	box-sizing: border-box;
	flex-grow: 1;
	padding: 20px;
	overflow-y: scroll;
}
.error {
	text-align: center;
}
.error img {
	max-width: 100%;
}
.error h1 {
	margin: 0;
}

/* Menu */
nav {
	background-color: white;
	border-right: 1px solid #ccc;
	min-width: 300px;
}
nav ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
}
nav li {
	display: flex;
	align-items: center;
}
nav a {
	color: black;
	display: inline-block;
	padding: 8px 16px;
	width: 100%;
}
nav a:hover:not(.active) {
	background-color: #555;
	color: white;
}
nav a.active {
	color: white;
}
nav a.active.green {
	background-color: #4caf50;
}
nav a.active.red {
	background-color: Tomato;
}
nav a.active.blue {
	background-color: DodgerBlue;
}
nav a.active.yellow {
	background-color: #ffd800;
}
nav a.active.black {
	background-color: Black;
}
nav a.active.purple {
	background-color: BlueViolet;
}
nav a.active.gray {
	background-color: Gray;
}
nav .lang {
	font-size: 200%;
	padding: 5px 15px;
	width: min-content;
}
.ee {
	cursor: default;
	opacity: 0;
	-webkit-transition: opacity 10s; /* For Safari 3.1 to 6.0 */
	transition: opacity 10s;
}
.ee:hover {
	opacity: 50;
}

/* Forms */
form {
	text-align: center;
	width: 100%;
}
input.field,
select.field {
	border-radius: 4px;
	border: 1px solid #ccc;
	box-sizing: border-box;
	display: inline-block;
	margin: 8px 0;
	padding: 12px 20px;
	text-align: center;
	width: 200px;
}
input.field[type="submit"] {
	background-color: #4caf50;
	border: none;
	color: white;
	cursor: pointer;
	font-weight: 500;
	padding: 14px 20px;
	width: 300px;
}
input.field[type="submit"]:hover {
	background-color: #45a049;
}
.alert {
	background-color: #f8d7da;
	border-radius: 0.25rem;
	color: #721c24;
	margin: auto;
	padding: 0.75rem 1.25rem;
	width: fit-content;
}
.alert.success {
	background-color: #d4edda;
	color: #155724;
}
textarea {
	resize: vertical;
	width: 95%;
}

/* Home page (Play) */
.button {
	border-radius: 15px;
	border: none;
	box-shadow: 0 9px #999;
	color: #fff;
	cursor: pointer;
	display: inline-block;
	font-size: 24px;
	padding: 15px 25px;
}
.button:active {
	box-shadow: 0 5px #666;
	transform: translateY(4px);
}
.button:hover {
	filter: brightness(0.9);
}
.button-green {
	background-color: #4caf50;
}
.button-red {
	background-color: #f4511e;
}
.button-purple {
	background-color: #8a2be2;
	-ms-animation: rotation 3.6s infinite linear;
	-moz-animation: rotation 3.6s infinite linear;
	-webkit-animation: rotation 3.6s infinite linear;
	animation: rotation 3.6s infinite linear;
}
.button-sayan {
	background-color: #008cba;
}
.button-black {
	background-color: #000;
	font-family: pixel;
}
.button-pink {
	background-color: #ee82ee;
}
@font-face {
	font-family: pixel;
	src: url("SF Pixelate.ttf");
}
@keyframes rotation {
	from {
		-ms-transform: rotate(0deg);
		-moz-transform: rotate(0deg);
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
		box-shadow: 0 9px #999;
	}
	25% {
		box-shadow: 9px 0 #999;
	}
	50% {
		box-shadow: 0 -9px #999;
	}
	75% {
		box-shadow: -9px 0 #999;
	}
	to {
		-ms-transform: rotate(360deg);
		-moz-transform: rotate(360deg);
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
		box-shadow: 0 9px #999;
	}
}

/* Canvas */
.draw {
	text-align: center;
	width: 100%;
}
#canvas,
#model {
	border: 10px solid #999;
	border-radius: 20px;
	margin: 0 auto 20px;
	display: inline-block;
	background: #fff;
}
#canvas {
	cursor: crosshair;
}
#colors {
	list-style: none;
	text-align: center;
	margin: 0 auto 20px;
	padding: 0;
}
#colors li {
	display: inline-block;
	margin-right: 10px;
}
#colors li:last-child {
	margin-right: 0;
}
#colors a {
	border-radius: 50%;
	display: inline-block;
	height: 30px;
	overflow: hidden;
	text-indent: 100%;
	width: 30px;
}
#colors a.active {
	border: 2px solid #000;
	width: 26px;
	height: 26px;
}
.rotation-canvas {
	z-index: 1;
	-ms-animation: rotation 10s infinite linear;
	-moz-animation: rotation 10s infinite linear;
	-webkit-animation: rotation 10s infinite linear;
	animation: rotation 10s infinite linear;
}
.rotation-model {
	-ms-animation: rotation 10s infinite linear;
	-moz-animation: rotation 10s infinite linear;
	-webkit-animation: rotation 10s infinite linear;
	animation: rotation 10s infinite linear;
	animation-direction: reverse;
}

/* Gallery Grid */
.gallery {
	display: grid;
	grid-gap: 10px;
	grid-template-columns: repeat(auto-fill, 300px);
	height: min-content;
	justify-content: center;
	max-height: 100%;
	width: 100%;
	scroll-snap-type: y proximity;
}
.top-bar {
	background-color: white;
	border: 1px solid #ccc;
	grid-column: 1 / -1;
	padding: 15px;
	text-align: center;
}
.case {
	background-color: white;
	border: 1px solid #ccc;
}
.case:hover {
	border-color: #777;
}
.case img {
	width: 100%;
	height: auto;
}
.desc {
	overflow: hidden;
	padding: 15px;
	text-align: center;
	white-space: nowrap;
}
hr.arrow {
	margin: 10px;
	overflow: visible;
	position: relative;
}
hr.arrow::after {
	content: "";
	border: solid black;
	border-width: 0 1px 1px 0;
	bottom: -5px;
	height: 10px;
	position: absolute;
	right: 0;
	width: 10px;
	transform: rotate(-45deg);
	-webkit-transform: rotate(-45deg);
}

/* Gallery Detail */
article #model {
	display: block;
}
.comments {
	margin: 0 auto 15px;
	width: 50%;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.comments > div,
.comments > form {
	background-color: white;
	border: 1px solid #ccc;
	box-sizing: border-box;
	padding: 5px;
}
.comments > div:hover {
	border-color: #777;
}
.comments > div.deleted {
	opacity: 0.5;
}
.comments > hr {
	width: 100%;
	margin: 0;
}
.comments h5 {
	float: right;
}
table {
	width: 100%;
}
th {
	text-align: start;
}
.text-green {
	color: green;
}
.text-red {
	color: red;
}

/* Misc. */
img.fork {
	position: absolute;
	top: 0;
	right: 0;
	width: 200px;
}

/* Responsive */
@media only screen and (max-width: 650px) {
	body {
		flex-direction: column;
		height: auto;
	}
	#canvas,
	#model {
		width: 300px;
		height: 300px;
	}
	.comments {
		width: 100%;
	}
}
