/* anmimations */
@keyframes fading {
	0% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@keyframes fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes slowfadein {
	0% {
		opacity: 0;
	}
	50% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes fromtop {
	from {
		top: -1000px;
		opacity: 0;
	}
	to {
		top: 0;
		opacity: 1;
	}
}

/* general style */
* {
	margin: 0;
	padding: 0;
}

*:focus {
	outline: 0;
}

*::-moz-focus-inner {
	border: 0;
}

html, body {
	height: 100vh;
}

body {
	text-align: center;
	color: #cccccc;
	font-family: "Segoe UI", "Verdana", "Arial", "Helvetica", sans-serif;
	background-color: #333333;
	overflow-x: hidden;
}

input {
	color: #cccccc;
	font-family: "Segoe UI", "Verdana", "Arial", "Helvetica", sans-serif;
}

h1 {
	margin-bottom: 10px;
	display: block;
	color: #cccccc;
	font-size: 18px;
	font-style: italic;
	font-weight: normal;
}

div.center h1 {
	font-size: 25px;
}

h1.waiting {
	font-size: 25px;
	animation: fading 4s infinite;
}

h1 a {
	color: #999999;
	text-decoration: none;
}

h1 a:hover {
	color: #cccccc;
	text-decoration: underline;
}

/* tutorial */
div.tutorial {
	position: relative;
	margin: 0 auto;
	padding: 15px;
	width: 100%;
	max-width: 900px;
	text-align: left;
}

div.tutorial div {
	position: relative;
}

div.tutorial a {
	position: relative;
	display: block;
	max-width: 30%;
	padding: 8px;
	color: #cccccc;
	font-size: 18px;
	font-style: normal;
	font-weight: bold;
}

div.tutorial a:hover {
	border-top: 1px dashed #cccccc;
	border-bottom: 1px dashed #cccccc;
	border-left: 1px dashed #cccccc;
	margin-top: -1px;
	margin-bottom: -1px;
	margin-left: -1px;
}

div.tutorial a.active {
	background-color: #2c2c2c;
	margin-top: 1px;
}

div.tutorial a.active:hover {
	margin-top: -1px;
	margin-bottom: 0;
}

div.tutorial a.active::after {
	border-top: 20px solid transparent;
	border-bottom: 20px solid transparent;
	border-left: 15px solid #2c2c2c;
	content: " ";
	height: 0;
	margin-top: -20px;
	position: absolute;
	right: -15px;
	top: 50%;
	width: 0;
}

div.tutorial a:hover::after {
	border-top: 20px solid transparent;
	border-bottom: 20px solid transparent;
	border-left: 15px dashed #cccccc;
	content: " ";
	height: 0;
	margin-top: -20px;
	position: absolute;
	right: -15px;
	top: 50%;
	width: 0;
}

div.tutorial span#summary {
	margin: 20px 0;
	padding: 10px;
	display: block;
	color: #cccccc;
	font-size: 16px;
	font-style: italic;
	font-weight: normal;
}

/* frame for vertical centered images */
div.frame {
	position: absolute !important;
	top: 0;
	right: 0;
	height: 100%;
}

div.frame *.helper {
	display: inline-block;
	height: 100%;
	vertical-align: middle;
}

div.frame img {
	vertical-align: middle;
}

/* table style */
div.wrapper {
	display: table;
	width: 100%;
	height: 100%;
}

div.row {
	display: table-row;
}

div.cell {
	display: table-cell;
	height: 100%;
}

/* footer */
div.footer {
	position: fixed;
	bottom: 0;
	width: 100%;
	overflow: hidden;
}

div.footer div.left {
	text-align: left;
}

div.footer div.right {
	text-align: right;
}

div.footer a, div.footer span {
	display: inline-block;
	padding: 15px 15px;
	text-decoration: none;
	color: #cccccc;
	animation: slowfadein 8s;
}

div.footer a:hover {
	background-color: #2c2c2c;
}

div.footer div.left a:first-child:hover {
	border-right: 1px dashed #cccccc;
	border-top: 1px dashed #cccccc;
}

div.footer div.right a:last-child:hover {
	border-left: 1px dashed #cccccc;
	border-top: 1px dashed #cccccc;
}

/* statusbar */
div.status {
	width: 200px;
	background-color: #2c2c2c;
}

div.status a {
	display: block;
	text-decoration: none;
}

div.status a:hover {
	text-decoration: none;
}

div.status img {
	width: 18px;
}

/* statusbar form */
div.status form input {
	width: 100%;
	border: none;
	padding: 10px 15px;
	font-size: 16px;
	background-color: #2c2c2c;
	border-top: 1px dashed #cccccc;
	border-bottom: 1px dashed #cccccc;
}

div.status form input:hover {
	background-color: #333333;
}

div.status form input.finished {
	background-color: #333333;
}

/* statusbar table */
div.status table.players {
	padding: 0 5px;
	width: 100%;
	margin-bottom: 20px;
}

div.status table.players th {
	text-align: left;
}

div.status table.players td {
	text-align: right;
}

div.status table.players td:first-child {
	width: 80%;
}

/* countdown timer */
div.status div#countdown {
	margin-top: 15px;
}

/* game area */
div.game {
	margin: 0 auto;
	width: 900px;
}

div.center {
	position: relative;
	top: 40vh;
}

div.pagetitles, div.game div.toolbar {
	width: 900px;
}

div.game span.sentence {
	width: 900px;
}

div.game img, div.game span.sentence, div.game canvas {
	margin: 0 auto;
	display: block;
	text-align: left;
}

div.game img {
	max-width: 900px;
	max-height: 500px;
}

div.game canvas {
	width: 900px;
	height: 500px;
}

div.game span.sentence {
	margin: 20px 0;
}

div.game span.sentence:last-child {
	margin-bottom: 40px;
}

div.game img, div.game canvas {
	background-color: #cccccc;
}

/* game area form */
div.game form div.label-container {
	position: relative;
	margin: 35px auto 0;
}

div.game form.center div.label-container {
	width: 300px;
}

div.game form div.label-container label {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	border-bottom: 1px solid #cccccc;

	color: #cccccc;
	font-size: 16px;
	font-style: italic;
	font-weight: normal;
}

div.game form div.label-container label span {
	position: absolute;
	bottom: 5px;
	left: 0;
	transition: all 0.3s ease;
}

div.game form.center div.label-container label span {
	width: 100%;
}

div.game form div.label-container input:focus + label span, div.game form div.label-container input:valid + label span {
	transform: translateY(-150%);
	font-size: 14px;
}

div.game form div.label-container input[type=text] {
	padding: 3px 0;
	background-color: transparent;
	border: none;
	width: 100%;
	height: 100%;
	font-size: 16px;
}

div.game form input.center {
	text-align: center;
	animation: fadein 2.0s;
}

div.game form.center input {
	font-size: 16px;
	animation: fadein 2.0s;
}

div.game form.center input[type=submit] {
	float: none;
	padding: 15px 40px;
}

div.game form input[type=submit], div.game form input[type=button] {
	margin: 5px 0;
	padding: 3px 8px;
	float: right;
	border: 1px solid #cccccc;
	border-radius: 3px;
	background-color: #333333;
}

div.game form input[type=submit]:hover, div.game form input[type=button]:hover {
	background-color: #2c2c2c;
}

div.game form input:invalid {
	border: none;
	outline: none;
}

/* game area toolbar */
div.game div.toolbar {
	margin: 0 auto;
	color: #333333;
	background-color: #999999;
}

div.game div.toolbar img {
	display: inline-block;
	margin: 5px;
	width: 20px;
	vertical-align: middle;
	background-color: transparent;
}

div.game div.toolbar a {
	display: inline-block;
	margin: 10px 7px;
	width: 30px;
	height: 30px;
	border-radius: 15px;
	vertical-align: middle;
}

div.game div.toolbar a.active {
	background-color: #cccccc;
}

div.game div.toolbar a input {
	border: none;
	background: #333333;
}

div.game div.toolbar a.small input {
	margin: 10px;
	width: 10px;
	height: 10px;
	border-radius: 5px;
}

div.game div.toolbar a.medium input {
	margin: 7px;
	width: 16px;
	height: 16px;
	border-radius: 8px;
}

div.game div.toolbar a.big input {
	margin: 5px;
	width: 20px;
	height: 20px;
	border-radius: 10px;
}

div.game div.toolbar a.red input {
	border: 1px solid #cc3333;
	background: #cc3333;
}

div.game div.toolbar a.green input {
	border: 1px solid #33cc33;
	background: #33cc33;
}

div.game div.toolbar a.blue input {
	border: 1px solid #3333cc;
	background: #3333cc;
}

div.game div.toolbar a.yellow input {
	border: 1px solid #cccc33;
	background: #cccc33;
}

div.game div.toolbar a.brown input {
	border: 1px solid #8b4513;
	background: #8b4513;
}

div.game div.toolbar a.white input {
	border: 1px solid #ffffff;
	background: #ffffff;
}

/* titlebar */
div.titlebar {
	position: fixed;
	width: 100%;
	height: 40px;
	z-index: 0;
	background-color: #2c2c2c;
}

/* pagetitles */
div.pagetitles {
	position: fixed;
	margin-bottom: 20px;
	height: 40px;
	z-index: 1;
	background-color: #2c2c2c;
	text-align: left;
}

div.pagetitles input.pagelink {
	height: 100%;
	border: none;
	padding: 10px 15px;
	background-color: #2c2c2c;
}

div.pagetitles input.pagelink:hover {
	background-color: #333333;
}

div.pagetitles input.active {
	background-color: #333333;
	border-left: 1px dashed #cccccc;
	border-right: 1px dashed #cccccc;
}

/* page */
div.page {
	padding-top: 40px;
	position: relative;
	z-index: 0;
	animation: fromtop 1.0s;
}

div.result > div.page {
	padding-top: 60px;
	text-align: left;
}

div.result > div.page ~ div.page {
	padding-top: 40px;
}

div.result > div.page img {
	margin: 0;
}

/* menu and toolbar for small screens */
div.menu-toggle {
	position: fixed;
	bottom: 0;
	left: 0;
	padding: 0 5px;
	display: none;
	z-index: 1;
}

div.toolbar-toggle {
	position: fixed;
	top: 0;
	left: 0;
	display: none;
	z-index: 3;
}

div.menu-toggle img, div.toolbar-toggle img {
	width: 36px !important;
	background: transparent !important;
}

/* screen size specific */
@media screen and (max-width: 1100px) {
	div.menu-toggle {
		display: block;
	}

	div.status {
		display: none;
	}

	div.status {
		position: fixed;
		top: 0;
		right: 0;
		z-index: 0;
	}

	div.pagetitles {
		overflow-x: auto;
		overflow-y: hidden;
		white-space: nowrap;
	}
}

@media screen and (max-width: 900px) {
	div.game, div.pagetitles {
		width: 100%;
	}

	div.game span.sentence {
		width: 100%;
	}

	div.game img {
		max-width: 100%;
	}

	div.toolbar-toggle {
		display: block;
	}

	div.game div.toolbar {
		display: none;
	}

	div.game div.toolbar {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100vw;
		height: 80vh;
		z-index: 2;
	}

	div.game div.toolbar div.cell {
		display: block;
		height: auto;
	}

	.drawing-sentence {
		position: relative;
		color: #333333;
		pointer-events: none;
		z-index: 2;
	}

	div.game canvas {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		z-index: 1;
	}

	div.game form input[type="button"] {
		position: fixed;
		bottom: 0;
		right: 0;
		z-index: 2;
	}
}
