:root {
	--color-dark-gray: #222222;
	--color-moderate-gray: #444444;
	--color-light-gray: #999999;
	--color-main: #f0f;
	--color-text-main: #c8c8c8;
	--height-nav-height: 40px;
}
::-webkit-scrollbar {
	width: 2px;
	transition: all 0.3s;
}
::-webkit-scrollbar-track {
	background: #222222;
}
::-webkit-scrollbar-thumb {
	background: var(--color-moderate-gray);
}
* {
	border-radius: 0;
}
a {
	color: var(--color-main);
	font-size: 1.2em;
	text-decoration: none;

	transition: color 0.3s;
}
a:focus {
	outline: none;
}
a:hover {
	color: var(--color-text-main);
}
body {
	margin: 0;

	color: var(--color-text-main);
	font-family: 'Glacial Indifference';

	background: var(--color-dark-gray);
	touch-action: manipulation;
}
body.dialogVisible {
	height: 50px;

	overflow: hidden;
}
button {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	margin: 10px 0;
	padding: 5px 10px;

	color: var(--color-main);
	font-size: 1.4em;
	text-align: center;

	-webkit-backface-visibility: none;
	background: none;
	border: 2px solid #666;
	box-sizing: border-box;
	cursor: pointer;
	transform: translateZ(0);
	transition: all 0.3s;
	user-select: none;
	-webkit-user-select: none;
}
button:focus {
	border-color: var(--color-main);
	outline: none;
}
button:hover {
	background: #666;
}
button[disabled] {
	filter: saturate(0);
	opacity: 0.5;
	pointer-events: none;
}
dialog {
	display: block;
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	height: 90vh;
	width: 500px;
	max-width: 75vw;
	margin: auto;
	padding: 5px;

	color: var(--color-text-main);

	background: #111111;
	background: var(--color-dark-gray);
	border: 4px solid #666666;
	box-shadow: 0 0 30px -20px black;
	opacity: 0;
	overflow-y: scroll;
	pointer-events: none;

	transition: all 0.3s;

	z-index: 10;
}
dialog.active {
	opacity: 1;
	pointer-events: all;
}
dialog a {
	font-size: 1em;
}
dialog h2 {
	margin-top: 0;
	font-size: 2em;
}
dialog input {
	margin-bottom: 0px;
}
dialog input[type='checkbox'] {
	margin-top: 20px;
}
dialog input[type='checkbox'] + label {
	margin-bottom: 0px;
}
dialog label {
	margin-top: 20px;
}
dialog p {
	font-size: 1em;
}
dialog p:first-of-type {
	margin-top: 30px;
}
dialog p:last-of-type {
	margin-bottom: 30px;
}
h1 {
	display: inline-block;
	margin: 0;
	margin-left: 10px;
	padding: 0 10px 0 0;

	color: var(--color-main);
	font-size: 35px;
	line-height: 40px;

	vertical-align: middle;
}
h2 {
	width: 100%;
	margin: 0 0 10px;

	font-size: 2em;

	user-select: none;
	-webkit-user-select: none;
}
h3 {
	height: 23px;
	margin: 0 5px 0 0;

	font-size: 18px;
	font-weight: normal;

	outline: 2px solid transparent;
	transition: all 0.3s;
	user-select: none;
	-webkit-user-select: none;
	vertical-align: top;
}
h3:focus {
	outline: 2px solid var(--color-light-gray);
}
hr {
	margin: 0;

	border: 2px solid var(--color-moderate-gray);
}
input {
	display: block;
	margin: 10px 0;
	height: 30px;
	width: 100%;
	padding: 2px 0 0 5px;

	color: var(--color-text-main);
	font-size: 20px;
	line-height: 25px;

	background: none;
	border: 2px solid #666666;
	box-sizing: border-box;
	appearance: none;
	-moz-appearance: none;
	-webkit-appearance: none;

	transition: all 0.3s;
}
input:focus {
	outline: none;
	border-color: var(--color-main);
}
input::placeholder {
	padding-left: 5px;

	color: var(--color-moderate-gray);
}
input[type='checkbox'] {
	display: inline-block;
	position: relative;
	width: 30px;

	cursor: pointer;
	pointer-events: all;
	vertical-align: middle;
}
input[type='checkbox']:before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	top: 3px;
	left: 3px;

	transition: all 0.3s;
}
input[type='checkbox']:checked:before {
	background: var(--color-main);
}
input[type='number'] {
	-moz-appearance: textfield;
}
input[type='number']::-webkit-outer-spin-button {
	-webkit-appearance: none;
}
input[type='number']::-webkit-inner-spin-button {
	-webkit-appearance: none;
}
label {
	display: inline-block;

	color: var(--color-text-main);
	font-size: 20px;

	user-select: none;
	-webkit-user-select: none;
	vertical-align: middle;
}
main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: calc(100vh - var(--height-nav-height));
}
nav {
	height: var(--height-nav-height);
	display: flex;
	justify-content: space-between;

	background: #111111;

	opacity: 1;
	transform: none;
	transition: all 0.5s;
}
nav.hidden {
	opacity: 0;
	transform: translateY(-100%);
}
nav div {
	display: inline-block;
	padding: 0 30px;

	font-size: 30px;
	line-height: 40px;
	text-align: right;

	cursor: pointer;
	vertical-align: middle;

	transition: color 0.3s;
}
nav div:hover {
	color: var(--color-main);
}
nav div:last-of-type {
	padding-right: 10px;
}
p {
	color: var(--color-text-main);
}
section {
	position: relative;
	height: 95%;
	margin: 0 10px;
	padding: 0 5px;
	flex-shrink: 1;
	flex-grow: 1;
	overflow-y: scroll;

	box-shadow: 0px 0px 30px -10px black;
	box-sizing: border-box;
	border: none;
	opacity: 1;
	transform: translateZ(0);
	transition:
		opacity 0.5s,
		transform 0.5s;

	z-index: 1;
}
section > h2 {
	display: none;
}
section.hidden {
	opacity: 0;
	transform: translateY(-5px);
}
svg text {
	font-family: 'Glacial Indifference';
	font-weight: bold;
}
table {
	width: 100%;
	margin: 5px 0;
	padding: 0px 0 30px;

	border-top: 2px solid var(--color-moderate-gray);
	border-bottom: 2px solid var(--color-moderate-gray);
}
textarea {
	height: 80px;
	margin: 0;
	padding-left: 5px;
	width: 100%;

	color: var(--color-text-main);
	font-family: 'Glacial Indifference';
	font-size: 20px;

	background: none;
	border: 2px solid #666666;
	box-sizing: border-box;
	resize: vertical;
	transition: border-color 0.3s;
}
textarea:focus {
	outline: none;
	border-color: var(--color-main);
}
textarea:focus::placeholder {
	color: transparent;
}
textarea::placeholder {
	color: var(--color-moderate-gray);
}
td {
	padding: 5px 0;

	text-align: center;
}
td:last-of-type {
	color: var(--color-moderate-gray);

	cursor: pointer;
	transition: color 0.3s;
}
td:last-of-type:hover {
	color: var(--color-text-main);
}
th {
	width: 50%;

	border-bottom: 2px solid var(--color-moderate-gray);
	color: #444444;
}
th:first-of-type {
	width: 30%;
}
th:last-of-type {
	width: 20%;
}
th:nth-of-type(2) {
	width: 50%;
}

.collapseDiceGroupButton,
.editDiceGroupButton,
.removeDiceGroupButton {
	display: inline-block;
	padding: 0 10px;

	font-size: 1.2em;

	cursor: pointer;
	transition: color 0.3s;
}
.collapseDiceGroupButton:before {
	content: 'COLLAPSE';
}
.collapseDiceGroupButton.collapsed:before {
	content: 'SHOW';
}
.collapseDiceGroupButton:hover,
.editDiceGroupButton:hover {
	color: var(--color-main);
}
.dialog_settings_setting:last-of-type {
	margin-bottom: 40px;
}
.diceGroup {
	position: relative;
	width: 100%;
	margin: 10px 0;
	padding: 0 0 5px;

	background: var(--color-dark-gray);
	box-sizing: border-box;
	border: 4px solid var(--color-moderate-gray);
	border-top-width: 0px;
	cursor: pointer;
	-webkit-font-smoothing: subpixel-antialiased;
	overflow: hidden;
	transition:
		border 0.3s,
		box-shadow 0.3s,
		opacity 0.3s;
	user-select: none;
	-webkit-user-select: none;
}
.diceGroup:focus {
	border-color: var(--color-light-gray);
	outline: none;
}
.diceGroup:focus h3 {
	background: var(--color-light-gray);
	color: var(--color-dark-gray);
}
.diceGroup:hover {
	box-shadow: 0 0 20px -10px black;
}
.diceGroup:hover > .diceGroupButtonContainer,
.diceGroup:hover > .diceGroupButtonContainer {
	opacity: 1;
}
.diceGroup.collapsed {
	height: 27px;
}
.diceGroup.transitioning {
	transition: all 0.3s;
}
.diceGroup h3 {
	display: inline-block;
	width: 50%;
	margin: 0;
	margin-bottom: 5px;
	padding: 0;

	background: var(--color-moderate-gray);
	overflow-x: hidden;
}
.diceGroupButtonContainer {
	position: absolute;
	top: 0;
	right: 0;
	padding: 0 10px;
	margin: 0;

	opacity: 0;

	transition: opacity 0.3s;
}
.die {
	height: 60px;
	width: 60px;
	padding: 10px 0;

	cursor: pointer;
}
.die.glitch rect {
	fill: #111;
	stroke: #111;
}
.die.hit rect {
	fill: var(--color-main);
	stroke: var(--color-main);
}
.die.hit text {
	fill: var(--color-dark-gray);
}
.die > * {
	pointer-events: none;
}
.die rect {
	fill: var(--color-moderate-gray);
	stroke: var(--color-moderate-gray);
}
.dieGraphicContainer {
	display: grid;
	width: 100%;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	margin: 10px;

	transition: max-height 0.3s;
}
.dieSelectButton {
	display: inline-block;
	margin: 0;

	transition:
		background 0.3s,
		color 0.3s;
}
.dieSelectButton:active {
	background: var(--color-light-gray);
	color: var(--color-text-main);
}
.dieHitIndicator {
	font-size: 20px;
	text-anchor: end;

	fill: var(--color-main);

	opacity: 0;
	z-index: 10;
}
.dieSides {
	font-size: 20px;
	text-anchor: start;

	fill: var(--color-main);

	z-index: 10;
}
.dieValue {
	fill: var(--color-main);
	font-family: 'Glacial Indifference';
	font-size: 35px;
	text-anchor: middle;
}
.groupExtendedInfoList {
	width: calc(100% - 20px);
	margin-left: 10px;
	padding-left: 0;

	list-style-type: none;
}
.groupTotalModifier,
.groupTotalValue {
	display: inline-block;

	vertical-align: middle;
}
.releaseVersion {
	margin-bottom: 0;

	font-weight: bold;
}
.releaseNote {
	margin: 0;
}
.removeDiceGroupButton {
	padding-right: 0;
}
.removeDiceGroupButton:hover {
	color: #ff0000;
}
.unrolled > .dieValue {
	/*Unrolled die color*/
	fill: var(--color-light-gray);
}

#addDieButton {
	display: inline-block;
	height: auto;
	width: auto;
	margin: 10px;
	margin-right: 0;
	padding: 5px 10px;
	flex-shrink: 0;
	flex-grow: 0;

	vertical-align: middle;
}
#dialog_settings_contrastWarning {
	max-height: 0px;
	padding: 0;

	font-size: 1.2em;

	opacity: 0;
	overflow: hidden;
	transition:
		opacity 0.3s,
		max-height 0.3s,
		padding 0.3s;
	transition-delay: 0s, 0.3s, 0.3s;
}
#dialog_settings_contrastWarning.visible {
	max-height: 500px;
	padding: 10px 0 20px;

	opacity: 1;
	overflow: hidden;
	transition-delay: 0.3s, 0s, 0s;
}
#diceGroupSetupOpenButton {
	display: none;
	position: absolute;
	height: 20px;
	width: 20px;
	left: 0;
	top: 0;
	padding: 10px 10px 10px 5px;

	cursor: pointer;
	fill: var(--color-text-main);
	line-height: 40px;
	pointer-events: none;

	transition: fill 0.3s;
}
#diceGroupSetupOpenButton.active {
	fill: var(--color-main);
}
#customSidesInputContainer {
	display: flex;
	justify-content: space-between;
	flex-shrink: 0;
	flex-grow: 1;
}
#dialogScreenMask {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;

	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;

	z-index: 9;
}
#dialogScreenMask.active {
	opacity: 1;
	pointer-events: all;
}
#dieSidesInput {
	display: inline-block;
	height: auto;
	width: auto;
	min-width: 0;
	padding: 5px 0;
	flex-shrink: 1;
	flex-grow: 1;

	font-size: 1.4em;

	box-sizing: content-box;
	vertical-align: middle;
}
#displayPane {
	justify-content: space-around;
	width: 75%;

	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
#loadingMask {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 11;

	background: var(--color-dark-gray);
	opacity: 0;
	transition: all 0.3s;
}
#mainColorInput {
	font-family: 'Lucida Console', 'Monaco', monospace;
}
#settingsOpenButton {
	width: 20px;
	height: 20px;
	padding: 10px;
}
#settingsOpenButton p {
	display: block;
	margin: 0;
}
#settingsOpenButton > .menuButton {
	display: block;
	width: 100%;
	height: 100%;

	fill: var(--color-text-main);
	transition: all 0.3s;
}
#settingsOpenButton > .menuButton > * {
	transition: y 0.3s;
}
#settingsOpenButton.active > rect {
	fill: var(--color-main);
}
#settingsOpenButton.active > .menuButton > * {
	fill: var(--color-main);
}
#settingsOpenButton.active > .menuButton > .topLine,
#settingsOpenButton.active > .menuButton > .bottomLine {
	y: 40;
}
#setup {
	width: 25%;
	flex-shrink: 1;
}
#singleDiceGroup.hidden {
	display: none;
}
#singleDieSelectButtonContainer {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
	grid-gap: 5px;
	justify-content: space-between;
	justify-items: center;

	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

:root.highContrast {
	--color-dark-gray: black;
	--color-text-main: white;
	--color-moderate-gray: #333;
	--color-light-gray: #ddd;
}
:root.highContrast button,
:root.highContrast input,
:root.highContrast textarea {
	border-color: #999;
}
:root.highContrast .die.glitch rect {
	fill: var(--color-light-gray);
	stroke: var(--color-light-gray);
}
:root.highContrast .die.glitch text {
	fill: var(--color-primary);
	stroke: var(--color-primary);
}
:root.highContrast .dieHitIndicator {
	opacity: 1;
}

@media screen and (max-width: 900px) {
	::webkit-scrollbar {
		width: 4px;
	}
	dialog {
		top: var(--height-nav-height);
		width: auto;
		height: auto;
		margin-top: 0;
		max-width: none;

		border: none;
		box-shadow: none;

		opacity: 0;
	}
	dialog.active {
		bottom: 0;
		margin-top: 0;

		opacity: 1;
	}
	h1 {
		width: 100%;
		padding: 0;
		margin: 0;

		text-align: center;
	}
	h2 {
		text-align: center;
	}
	main {
		height: calc(100% - var(--height-nav-height));
		margin-top: var(--height-nav-height);
	}
	nav {
		display: block;
		position: fixed;
		width: 100%;
		top: 0;

		z-index: 10;
	}
	td {
		font-size: 24px;
	}

	.diceGroup {
		padding-bottom: 40px;
	}
	.diceGroup.collapsed {
		height: 79px;
	}
	.diceGroup.collapsed h3 {
		height: 40px;
	}
	.diceGroup h3 {
		width: 100%;
	}
	.diceGroup:hover > .diceGroupButtonContainer {
		pointer-events: all;
	}
	.diceGroupButtonContainer {
		display: inline-block;
		height: 40px;
		position: relative;
		float: right;

		opacity: 0;
		pointer-events: none;
		vertical-align: middle;
	}
	.dieSelectButton {
		margin: 10px;
		min-width: 20%;
	}
	.groupTotalValue {
		padding-left: 10px;

		vertical-align: middle;
	}
	.setupOpenButton_verticalLine {
		transition: transform 0.3s;
		transform-origin: center;
	}

	#dialogScreenMask {
		display: none;
	}
	#dialog_settings {
		left: 100%;
		right: -100%;
	}
	#dialog_settings.active {
		left: 0;
		right: 0;
	}
	#diceGroupSetupOpenButton {
		display: block;

		pointer-events: all;
	}
	#diceGroupSetupOpenButton.active {
		fill: var(--color-main);
	}
	#diceGroupSetupOpenButton.active > .setupOpenButton_verticalLine {
		transform: rotate(90deg);
	}
	#displayPane {
		height: 100%;
		width: 100%;
		margin: 0;
	}
	#displayPane hr {
		display: none;
	}
	#displayPane > h2 {
		display: none;
	}
	#settingsOpenButton {
		position: absolute;
		right: 0;
		padding-right: 10px;
	}
	#setup {
		position: fixed;
		margin: 0;
		padding: 0 5px;
		width: auto;
		height: calc(100% - var(--height-nav-height));
		top: var(--height-nav-height);
		left: -100%;
		right: 100%;

		background: var(--color-dark-gray);
		border: none;
		opacity: 0;
		pointer-events: none;
		transition: all 0.3s;

		z-index: 2;
	}
	#setup.active {
		left: 0;
		right: 0;

		opacity: 1;
		pointer-events: all;
	}
}

@keyframes appear {
	to {
		opacity: 1;
		transform: none;
	}
}

/*Glacial Indifference font*/
@font-face {
	font-family: 'Glacial Indifference';
	src: url('/fonts/GlacialIndifference-Regular.otf');
	font-weight: normal;
	font-style: normal;
}
@font-face {
	font-family: 'Glacial Indifference';
	src: url('/fonts/GlacialIndifference-Bold.otf');
	font-weight: bold;
	font-style: normal;
}
