@font-face {
	font-family: "Martel";
	src: url(/res/cipsoft/fonts/martel.ttf) format(truetype);
	font-weight: normal;
	font-style: normal;
}

body {
	background-color: #000;
	display: grid;
	grid-template:
		"header  header"  60px
		"topnav  topnav"  31px
		"sidebar content" 1fr
		/ 130px 1fr;
	max-width: 960px;
	margin: 32px auto;
	color: #fff;
	font-family: Verdana, sans-serif;
}

body > header {
	grid-area: header;
	display: flex;
	flex-flow: row;
	margin-bottom: 1px;

	> *:nth-child(2) {
		background-image: url(/res/cipsoft/images/header_middle.jpg);
		background-repeat: repeat;
		width: 100%;
	}
}

body > nav {
	grid-area: topnav;
	display: flex;
	background-image: url(/res/cipsoft/images/topic_background.jpg);
	background-repeat: repeat-x;
	font-family: Martel;
	text-shadow: 3px 3px 4px #000;
	font-size: 14px;
	letter-spacing: 1px;

	/* Current page */
	> *:nth-child(1) {
		background-image: url(/res/cipsoft/images/panel_top.jpg);
		width: 130px;
		height: 31px;
		flex: 0 0 130px;

		> * {
			text-align: center;
			margin-left: -8px;
			color: #efda73;
			margin-top: 2px;
		}
	}

	/* Navigation */
	> *:nth-child(2) {
		display: flex;
		justify-content: center;
		width: 100%;

		> * {
			width: 100%;
			text-align: center;
			margin-top: 2px;
			color: inherit;
			text-decoration: none;
		}

		> *:hover {
			text-shadow:
				-2px -2px navy,
				 2px  2px navy,
				-2px  2px navy,
				 2px -2px navy,
				3px 3px 4px #000;
			cursor: pointer;
		}
	}
}

.sidebar {
	grid-area: sidebar;
	display: flex;
	flex-flow: column;
	background-image: url(/res/cipsoft/images/panel_middle.jpg);
	background-repeat: repeat;
	font-family: Martel;
	font-size: 14px;

	img { object-fit: none; }

	> .paper {
		position: relative;
		display: flex;
		flex-flow: column;
		flex: 1 1 100%;

		> .content {
			position: absolute;
			width: calc(100% - 8px);
			display: flex;
			flex-flow: column;
			justify-content: center;
			text-align: center;

			.server-status {
				margin-top: 8px;
				font-family: sans-serif;
				font-weight: bold;
				font-size: 10px;
				color: #419aff;
			}

			.cipsoft-logo { opacity: 1; }
		}

		> .content + * {
			height: 100%;
			background-image: url(/res/cipsoft/images/paper_left.gif);
		}

		hr {
			background-image: url(/res/cipsoft/images/bar.gif);
			width: 96px;
			height: 5px;
			margin: 2px 0 4px 0;
			margin-left: 10px;
			border: none;
		}
	}

	> .links {
		display: flex;
		flex-flow: column;
		gap: 4px;
		margin: 8px 12px 8px 24px;
		text-shadow: 3px 3px 3px #000;

		> * {
			position: relative;
			color: inherit;
			text-decoration: none;
		}

		> *:hover {
			text-shadow:
				-2px -2px navy,
				 2px  2px navy,
				-2px  2px navy,
				 2px -2px navy,
				2px 2px 4px #000;
			cursor: pointer;

			&:before {
				text-shadow: 3px 3px 4px #000;
			}
		}

		> *:before {
			position: absolute;
			content: "";
			left: -14px;
			top: 4px;
			display: inline-block;
			box-shadow:
				3px 3px 3px #000;
			width: 7px;
			height: 7px;
			border-radius: 50%;
			background: radial-gradient(circle at top left, rgba(255,255,255, 1) 0%, #e7bd39 33%, #000 100%);
		}
	}

	hr {
		background-image: url(/res/cipsoft/images/seperator.gif);
		width: 120px;
		height: 8px;
		border: none;
		margin: 2px 0;
		flex: 0 0 auto;

		&.small {
			background-image: url(/res/cipsoft/images/small_seperator.gif);
			width: 100px;
			margin-left: 10px;
		}
	}

}

body > main {
	background-image: url(/res/cipsoft/images/paper_body.jpg);
	margin-top: -11px;
	display: grid;
	grid-template:
		"top     topright"  11px
		"content    right"  1fr
		"bottom  bottomright"  16px
		/ 1fr 11px;

	> .top {
		grid-area: top;
		background-image: url(/res/cipsoft/images/paper_top.gif);
		background-repeat: repeat;
		height: 11px;
	}

	> .top-right {
		grid-area: topright;
		background-image: url(/res/cipsoft/images/paper_topright.gif);
		width: 11px;
	}

	> .right {
		grid-area: right;
		background-image: url(/res/cipsoft/images/paper_right.gif);
	}

	> .bottom {
		grid-area: bottom;
		background-image: url(/res/cipsoft/images/paper_bottom.gif);
	}

	> .bottom-right {
		grid-area: bottomright;
		background-image: url(/res/cipsoft/images/paper_bottomright.gif);
	}

	> .content {
		grid-area: content;
		color: #5a2800;
		padding: 16px;
		font-size: 12px;
		line-height: 1.3;

		a {
			color: #0063dc;
			text-decoration: none;
			font-weight: bold;
		}

		.button {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			background-color: #505050;
			color: #fff;
			font-weight: bold;
			font-size: 9px;
			border: none;
			border-radius: 6px;
			width: 120px;
			height: 18px;
			margin: 8px 0 0 0;
			align-self: center;
			font-family: inherit;
			background-image: url(/res/cipsoft/images/topic_background.jpg);
			cursor: pointer;
			text-decoration: none;

			box-shadow:
				inset  0px  1px 0 rgba(255,255,255,0.08),
				inset  0px -1px 0 rgba(0,0,0,0.25);
		}

		hr {
			background-image: url(/res/cipsoft/images/line_body.gif);
			border: none;
			height: 7px;
			margin: 0;

			::before {
				content: "";
				display: block;
				background-image: url(/res/cipsoft/images/line_left.gif);
				height: 7px;
				width: 8px;
			}
			::after {
				content: "";
				display: block;
				background-image: url(/res/cipsoft/images/line_right.gif);
				height: 7px;
				width: 8px;
			}
		}

		h1 {
			font-family: Martel;
			font-size: 48px;
			margin: -8px 0;
			margin-left: 16px;
			font-weight: normal;
		}

		p {
			margin-left: 16px;
			margin-right: 16px;

			&.special&:first-letter {
				font-family: Martel;
				font-size: 40px;
				margin-right: 1px;
				line-height: 0;
			}
		}

		.dialog {
			display: flex;
			flex-flow: column;
			margin: 0 16px;

			> .title {
				background-color: rgb(80,80,80);
				color: #efefef;
				font-weight: bold;
				padding: 2px 6px;
				margin-bottom: 1px;

				&.center {
					text-align: center;
				}
			}

			> .content {
				background-color: rgb(212,192,162);
				padding: 2px;

				p { margin: 16px; }
			}
		}

		.maureske {
			position: relative;
			background-image: url(/res/cipsoft/images/maureske_red_body.gif);
			height: 31px;
			margin-left: 10px;
			color: #fff;
			display: flex;
			flex-flow: row;
			gap: 8px;
			align-items: flex-end;

			* + & {
				margin-top: 24px;
			}

			> .date {
				font-size: 10px;
				margin-left: 8px;
				margin-bottom: 10px;
			}

			> .title {
				font-weight: bold;
				font-size: 13px;
				margin-bottom: 9px;
			}

			&::before {
				content: "";
				position: absolute;
				left: -10px;
				background-image: url(/res/cipsoft/images/maureske_red_left.gif);
				width: 10px;
				height: 31px;
			}

			&::after {
				content: "";
				position: absolute;
				background-image: url(/res/cipsoft/images/maureske_red_right.gif);
				right: 0;
				width: 16px;
				height: 31px;
			}

			&.blue {
				background-image: url(/res/cipsoft/images/maureske_blue_body.gif);

				&::before {
					background-image: url(/res/cipsoft/images/maureske_blue_left.gif);
				}

				&::after {
					background-image: url(/res/cipsoft/images/maureske_blue_right.gif);
				}
			}

			&.green {
				background-image: url(/res/cipsoft/images/maureske_green_body.gif);

				&::before {
					background-image: url(/res/cipsoft/images/maureske_green_left.gif);
				}

				&::after {
					background-image: url(/res/cipsoft/images/maureske_green_right.gif);
				}
			}
		}

		> footer {
			display: flex;
			flex-flow: column;
			font-size: 10px;
			margin-top: 48px;
			text-align: center;

			> *:nth-child(2) {
				margin-top: 8px;
			}
		}
	}
}

body > main > .content.login > form {
	display: flex;
	flex-flow: column;

	> .dialog {
		> .content {
			display: grid;
			grid-template-columns: 140px 200px;
			row-gap: 4px;
			padding: 8px;

			label {
				display: flex;
				align-items: center;
				margin-left: 8px;
			}
		}
	}

	input[type="submit"] {
		grid-column: span 2;
		background-color: #505050;
		color: #fff;
		font-weight: bold;
		font-size: 9px;
		border: none;
		border-radius: 6px;
		width: 120px;
		height: 18px;
		margin: 8px 0 0 0;
		align-self: center;
		font-family: inherit;
		background-image: url(/res/cipsoft/images/topic_background.jpg);
		cursor: pointer;

		box-shadow:
			inset  0px  1px 0 rgba(255,255,255,0.08),
			inset  0px -1px 0 rgba(0,0,0,0.25);
	}
}

body > main > .content.account-summary {

	> .dialog > .content {
		display: grid;
		grid-template-columns: 120px 240px;
		padding: 8px;
		row-gap: 4px;
	}

	> .dialog.characters > .content {
		display: flex;
		flex-flow: column;
		padding: 0;
		background-color: transparent;
		row-gap: 1px;

		> .character {
			display: grid;
			grid-template-columns: 3fr 1fr 1fr;
			column-gap: 1px;
			text-decoration: none;
			color: inherit;
			font-weight: normal;

			> * {
				background-color: #d4c0a2;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			> .details {
				display: flex;
				flex-flow: column;
				align-items: initial;
				padding: 8px;

				> *:nth-child(2) {
					font-size: 11px;
				}
			}
		}
	}
}
