/********************************************************************************/
/* COLORS */
/********************************************************************************/

/* white */
/* #222222 */
/* black */

/* chocolate */
/* olive */
/* firebrick */
/* darkred */

/********************************************************************************/
/* PRESET TAGS */
/********************************************************************************/

* {
	padding: 0;
	margin: 0;
}

html {
	height: 100%;
	min-height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
}

body {
	display: flex;
	justify-content: flex-start;
	flex-direction: column;
	min-height: 100%;
	position: relative;
	overflow: hidden;
	
	color: white;
	background-color: black;

	font-family: 'Ubuntu', sans-serif;
	font-size: 16px;
	font-weight: lighter;
	line-height: 22px;
	align-items: center;
}

h1 {
	font-size: 36px;
	line-height: 42px;
	text-transform: uppercase;
}

h2 {
	font-size: 24px;
	line-height: 30px;
	text-transform: uppercase;
}

h1 + h2 {
	margin-top: 20px;
}

a {
	text-decoration: none;
	outline: medium none;
}

img {
	padding: 0;
	margin: 0;
	border: 0;
}

ul {
	margin-top: 20px;
	padding-left: 20px;
}


ul li b {
	font-size: 24px;
}

p {
	margin-top: 10px;
}

fieldset {
	padding: 0;
	border: 0;
	margin-top: 20px;
}

code {
	box-sizing: border-box;
	width: 480px;
	max-width: 100%;
	padding: 20px;
}

/********************************************************************************/
/* STRUCTURE */
/********************************************************************************/

.main-container {
	box-sizing: border-box;
	width: 480px;
	max-width: 100%;
	min-height: 100%;
}

header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	padding: 10px 20px 10px;
	border-bottom: 2px solid black;
	max-width: 100%;
	box-sizing: border-box;
}

header .admin-controls {
	display: flex;
	flex-wrap: wrap;
	margin-right: 20px;
}

header .button {
	display: inline-flex;
	height: auto;
	width: auto;
	padding: 10px 20px;
	color: white;
}

header .button + .button {
	margin-left: 10px;
}

header .select-container {
	display: flex;
	margin-top: 10px;
	align-items: center;
}

header .select-container select {
	background-color: #222222;
	border-color: black;
	padding: 0 10px;
	box-sizing: border-box;
	outline: none;
	align-self: stretch;
	color: white;
	width: 140px;
	border-bottom: 2px solid #000000;
	height: 37px;
}

header .noise-indicator {
	display: flex;
	align-items: center;
}

header .noise-indicator.updated .noise-value {
	animation-name: noise-blinking;
	animation-duration: 2s;
}

@keyframes noise-blinking {
	0% { background-color: transparent; border-color: white; }
	10% { background-color: red; border-color: darkred; }
	20% { background-color: transparent; border-color: white; }
	30% { background-color: red; border-color: darkred; }
	40% { background-color: transparent; border-color: white; }
	50% { background-color: red; border-color: darkred; }
	60% { background-color: transparent; border-color: white; }
	70% { background-color: red; border-color: darkred; }
	80% { background-color: transparent; border-color: white; }
	90% { background-color: red; border-color: darkred; }
	100% { background-color: transparent; border-color: white; }
}

header .noise-indicator img {
	display: flex;
	align-items: center;
}

header .noise-value {
	display: inline-block;
	border: 2px solid white;
	padding: 5px;
	margin-left: 10px;
	font-size: 24px;
	border-radius: 20px; 
	min-width: 32px;
	height: 25px;
	line-height: 25px;
	text-align: center;
	font-weight: bold;
}

.content {
	padding: 20px;
}

.content-background {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #282828;
	background-blend-mode: darken;
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: -1;
	justify-content: center;
	opacity: 0.4;
}
.content-background:after {
	content: '';
	display: block;
	position: absolute;
	box-sizing: border-box;
	width: 480px;
	height: 100%;
    max-width: 100%;
	opacity: 0.4;
	background-color: darkred;
}

.content.rest + .content-background,
.content.rest + .content-background:after {
	background-color: olive;
}

.content.fight + .content-background,
.content.fight + .content-background:after {
	background-color: firebrick;
}

.content.rest + .content-background:after,
.content.fight + .content-background:after {
	opacity: 0.6;
}

.content img {
	display: block;
	padding: 10px;
	margin: auto;
}

.notification {
	padding: 10px;
	box-sizing: border-box;
	border-bottom-left-radius: 8px;
	position: relative;
	z-index: 0;
	overflow: hidden;
	border-top-width: 4px;
	border-top-style: solid;
	border-top-color: chocolate;
}

p + .notification,
.notification + p {
	margin-top: 20px;
}

.notification + .notification {
	margin-top: 10px;
}

.notification:before {
	content: '';
	display: block;
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	background-color: white;
	opacity: 0.2;
	z-index: -1;
}

.notification.positive {
	border-top-color: olive;
	border-top-width: 4px;
}

.notification.negative {
	border-top-color:  firebrick;
	border-top-width: 4px;
}

.notification.chance {
	text-align: center;
}

.notification.chance b {
	display: block;
	text-transform: uppercase;
}

.noise-icon {
	display: inline-block;
	width: 40px;
	height: 40px;
	background-image: url('../img/ui/noise.png');
	background-size: contain;
	background-repeat: no-repeat;
}

.fight h3 {
	display: block;
	text-align: center;
	padding: 10px;
	box-sizing: border-box;
	color: chocolate;
}

.fight-dices {
	display: flex;
	flex-wrap: wrap;
	display: grid;
	grid-gap: 10px;
	grid-template-columns: repeat(auto-fit, 50px);
	padding-left: 0;
	justify-content: center;
	margin-top: 10px;
}

.interactive-element:not(:first-child) {
	margin-top: 10px;
}

.admin-help {
	margin: 20px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	color: rgba(255, 255, 255, 0.4);
	padding: 10px;
	box-sizing: border-box;
	font-size: 12px;
	line-height: 16px;
}

#currentGameData {
	width: 100%;
	resize: none;
}

/********************************************************************************/
/* INTERACTIVE ELEMENTS */
/********************************************************************************/

/* Button */

.button {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 52px;
	box-sizing: border-box;
	padding: 10px 65px;
	cursor: pointer;
	background-color: #222222;
	justify-content: center;
	position: relative;
	border-bottom: 2px solid black;
	font-size: 12px;
	line-height: 14px;
	text-align: center;
	text-transform: uppercase;
	color: white;
	letter-spacing: 1px;
}

.button.disabled {
	opacity: 0.6;
	pointer-events: none;
}

.button.invalid {
	color: red !important;
}

.button.solo-action:before,
.button.divided-action:before,
.button.group-action:before {
	content: '';
	display: block;
	width: 50px;
	height: 26px;
	position: absolute;
	top: 12px;
	left: 15px;
	background-image: url('../img/ui/group-action.png');
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0.6;
}

.button.solo-action:before {
	background-image: url('../img/ui/solo-action.png');
}

.button.divided-action:before {
	background-image: url('../img/ui/divided-action.png');
}

.button.group-action:before {
	background-image: url('../img/ui/group-action.png');
}

.legend {
	display: block;
	width: 100%;
	font-size: 10px;
	line-height: 12px;
	letter-spacing: 1px;
	text-align: center;
	font-weight: bold;
}

.legend-highlight {
	font-weight: bold;
	color: chocolate;
}

/* Input Text */

.input-container {
	display: flex;
}

.input-container input {
	display: block;
	width: 100%;
	padding: 0 10px;
	box-sizing: border-box;
	font-size: 24px;
}

.input-container .button {
	padding: 10px 40px;
}

.input-container input,
.input-container .button {
	width: 50%;
}

/* Switch */

.switch {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 44px;
}

.switch .label {
	display: flex;
	flex-wrap: wrap;
	height: 44px;
	width: calc(100% - 130px);
	position: relative;
	align-items: center;
	padding-left: 65px;
	font-size: 12px;
	text-transform: uppercase;
}

.switch.invalid .label {
	color: red;
}

.switch .label .legend {
	margin-top: -10px;
	text-align: left;
}

.switch input {
	display: none;
}

.switch-slider {
	display: inline-block;
	position: relative;
	cursor: pointer;
	width: 50px;
	height: 24px;
	border-radius: 25px;
	background-color: black;
	-webkit-transition: .4s;
	transition: .4s;
	box-sizing: border-box;
	left: -2px;
}

.switch:before {
	position: absolute;
	content: "";
	width: 50px;
	height: 28px;
	position: absolute;
	top: 8px;
	left: 15px;
	background-image: url('../img/ui/solo-action.png');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: left top;
	opacity: 0.6;
}

.switch .label:before {
	content: '+';
	display: flex;
	position: absolute;
	opacity: 0.6;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-size: 26px;
	font-weight: bold;
	left: 30px;
	color: white;
}

.switch.solo-action .label:before {
	content: none;
}

.switch-slider:before {
	position: absolute;
	content: "";
	height: 30px;
    width: 30px;
	left: -1px;
	top: 50%;
	margin-top: -15px;
	border-radius: 50%;
	background-color: #ffffff;
	-webkit-transition: .4s;
	transition: .4s;
	box-sizing: border-box;
	border-bottom: 2px solid black;
}

input:checked + .switch-slider {
	background-color: chocolate;
}

input:checked + .switch-slider:before {
	-webkit-transform: translateX(24px);
	-ms-transform: translateX(24px);
	transform: translateX(24px);
}

/* SLIDER */

.range-slider-container {
	width: 100%;
	box-sizing: border-box;
}

.range-slider-container + .button {
	margin-top: 20px;
}

.range-slider {
	-webkit-appearance: none;
	width: 100%;
	height: 5px;
	background-color: black;
	outline: none;
	border-radius: 2px;
	margin-top: 18px;
	margin-bottom: 16px;
}

.range-slider::-moz-range-thumb {
	width: 25px;
	height: 40px;
	background: #ffffff;
	cursor: pointer;
	position: relative;
	z-index: 1;
	border-radius: 8px;
	border-bottom: 2px solid black;
}

.range-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 25px;
	height: 40px;
	background: #ffffff;
	cursor: pointer;
	position: relative;
	z-index: 1;
	border-radius: 8px;
	border-bottom: 2px solid black;
}

.range-slider-levels {
	width: 100% ;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
	margin-top: 6px;
}

.range-slider-levels .legend {
	width: 25px;
	position: relative;
	white-space: nowrap;
}

.range-slider-levels span:before {
	content: '';
	display: block;
	height: 10px;
	width: 4px;
	position: absolute;
	left: 50%;
	margin-left: -2px;
	top: -30px;
	background-color: #222222;
	border-radius: 2px;
}

.range-slider-levels .legend:first-child:before {
	left: 0;
	margin-left: 0;
}

.range-slider-levels .legend:last-child:before {
	left: 100%;
	margin-left: -4px;
}

/* Dice */

.dice {
	display: block;
	width: 100%;
	height: 0;
	padding-bottom: 100%;
	background-color: #222222;
	position: relative;
	cursor: pointer;
	position: relative;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	font-weight: bold;
	font-size: 24px;
	color: white;
}

.dice:before {
	display: block;
	content: '';
	background-color: white;
	position: absolute;
	width: 8px;
	height: 8px;
	top: 50%;
	left: 50%;
	margin-top: -4px;
	margin-left: -4px;
	border-radius: 50%;
}

.dice-2:before,
.dice-3:before,
.dice-4:before,
.dice-5:before,
.dice-6:before,
.dice-7:before,
.dice-8:before,
.dice-9:before {
	top: 8px;
	left: 8px;
	margin-top: 0;
	margin-left: 0;
}

.dice-2:before {
	box-shadow: 26px 26px white;
}

.dice-3:before {
	box-shadow: 13px 13px white, 
				26px 26px white;
}

.dice-4:before {
	box-shadow: 26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice-5:before {
	box-shadow: 13px 13px white, 
				26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice-6:before {
	box-shadow: 0 13px white, 
				26px 13px white,
				26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice-7:before {
	box-shadow: 13px 13px white, 
				0 13px white, 
				26px 13px white, 
				26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice-8:before {
	box-shadow: 13px 6px white, 
				0 13px white, 
				13px 20px white, 
				26px 13px white, 
				26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice-9:before {
	box-shadow: 13px 13px white, 
				13px 0 white, 
				0 13px white, 
				13px 26px white, 
				26px 13px white, 
				26px 26px white, 
				0 26px white, 
				26px 0 white;
}

.dice.crossed {
	opacity: 0.6;
}

.dice.crossed:after {
	content: '';
	display: block;
	position: absolute;
	background-color: darkred;
	width: 16px;
	height: calc(100% + 16px);
	top: 0;
	left: 50%;
	margin-top: -8px;
	margin-left: -10px;
	transform: skewX(-25deg);
	border-top-left-radius: 100%;
	border-bottom-right-radius: 100%;
	border-top: 2px solid firebrick;
	border-left: 2px solid firebrick;
}

/* Noise */

.noise-buttons-container {
	display: flex;
	align-items: stretch;
	height: 50px;
}

.noise-buttons-container .noise-value {
	width: 50px;
	height: 52px;
	box-sizing: border-box;
	text-align: center;
	border: none;
	border-bottom: 2px solid black;
	font-size: 24px;
	font-weight: bold;
	color: #222222;
}

.moreNoiseButton {
	font-size: 16px;
}

.moreNoiseButton,
.lessNoiseButton {
	display: inline-flex;
	flex-direction: row;
	width: 100%;
	padding: 10px 15px;
	align-items: center;
	justify-content: flex-start;
	text-transform: uppercase;
	cursor: pointer;
}

.moreNoiseButton:after {
	content: '';
	display: inline-block;
	background-color: white;
	width: 5px;
	height: 5px;
	position: relative;
	box-shadow: 0 5px white, -5px 0px white, 0 -5px white, 5px 0px white;
	margin-left: 15px;
}

.lessNoiseButton {
	width: 50px;
	min-width: 50px;
	padding: 10px 10px;
	margin-left: 5px;
	justify-content: center;
}

.lessNoiseButton:after {
	content: '';
	display: inline-block;
	background-color: white;
	width: 15px;
	height: 5px;
	position: relative;
}

.moreNoiseButton:before,
.lessNoiseButton:before {
	content: none;
}

/********************************************************************************/
/* MAIN SCREEN */
/********************************************************************************/

.main-screen {
	background-image: url('../img/ui/main-background.jpg');
	background-size: cover;
	background-repeat: no-repeat;
	background-position: top center;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-sizing: border-box;
}

.main-screen h1 {
	font-size: 0;
	line-height: 0;
}

.main-screen h1 img {
	width: 100%;
	max-width: 320px;
	box-sizing: border-box;
}

.main-screen p {
	padding: 20px;
	background-color: #22222299;
}