:root {
	--zlarge-font-size: 24px;
	--zbody-font-size: 20px;
	--zsmall-font-size: 15px;
	--large-font-size: 28px;
	--body-font-size: 24px;
	--small-font-size: 18px;
	--game-width: 960px; /*960px;*/
	--game-height: 960px; /*960px;*/
	--button-font-family: "Merriweather", serif;

}

* {
	box-sizing: border-box;
}

body {
	font-family: serif;
	font-size: var( --body-font-size );
	color: white;
	display: grid;
	align-items: center;
	justify-items: center;
	background-color: #333;
	overflow: hidden;
	margin: 0px;
	padding: 0px;
	width: 100vw;
	height: 100vh;
}

#APP {
	background-color: gray;
	transform-origin: 0% 0%;
	width: var( --game-width );
	height: var( --game-height );
	isolation: isolate;
	position: absolute;
	overflow: hidden;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	
	#CONTROLLER-ROOT {
		position: absolute;
		left: 0px;
		top: 0px;
		width: var( --game-width );
		height: var( --game-height );
	}
	
	.app-state {
		position: absolute;
		left: 0px;
		top: 0px;
		width: var( --game-width );
		height: var( --game-height );
		width: 100%;
		height: 100%;
		transition: opacity 0.5s, filter 0.5s;
		isolation: isolate;
		display:flex;
		justify-content: center;
		align-items: center;
	}
	
}

.safearea {
	position: absolute;
	left: 200px;
	top: 30px;
	width: 560px;
	height: 900px;
	border-radius: 20px;
	zborder: 2px dashed white;
	padding: 20px;
	font-size: 18px;
	pointer-events: none;
	& > * {
		pointer-events: all;
	}
}

.tab-highlighted {
	outline-offset: 0px;
	outline: 4px dashed white;
	cursor: pointer;
}

ul {
	margin: 10px 0px;
}

/*	Helper class to center something vertically and horizontally
	inside its parent. */
.centerer {
	display: flex;
	align-items: center;
	justify-content: center;
	align-content: center;
}
.fullscreen {
	position: absolute;
	left: 0px;
	top: 0px;
	width: var( --game-width );
	height: var( --game-height );
	width:100%;
	height:100%;
}

/*
	Safe area for gameplay
*/

/*	Used by APP.bonk() to convey a bonk.	*/
.bonk {
	transform-origin: center center;
	transform: scale( 0.9925 );
}

/*
	Sound menu
*/
#option-container {
    position: fixed;
    right: 0px;
    top: 0px;
}

/*	Standard button styling	*/

button {
	border-radius: 10px;
	padding: 5px 20px;
	background-color: #653f42;
	color: white;
	font-weight: bold;
	font-family: "Merriweather", serif;
	font-size: var( --body-font-size );
	box-shadow: 0px 5px 0px rgba(0,0,0,0.5);
	transform: translate( 0px, 0px );
	margin: 0px;
	border: 5px solid black;
	outline: 3px solid transparent;
	outline-offset: -4px;
	
	/*	b is used for keyboard shortcuts */
	b {
		text-decoration: underline;
		color: #6f6;
	}
	
	&:hover {
		background-color: #ab7a54;
		color: white;
	}
	&:active {
		box-shadow: 0px 0px 0px rgba(0,0,0,0.5);
		transform: translate( 0px, 5px );
		outline: 3px solid white;
		outline-offset: -4px;
	}
	&.disabled, &[disabled] {
		opacity: 0.5;
		pointer-events: none;
	}
	&.tab-highlighted {
		outline: 3px dashed yellow;
		outline-offset: -4px;
		filter: brightness( 120% );
	}
}

.fade-in {
	animation-duration: 0.5s;
	animation-fill-mode: forwards;
	animation-name: fade-in;
	transform-origin: 50% 100%;
}
@keyframes fade-in {
	0% {
		transform: translateY( 50px );
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform:  translateY( 0px );
		opacity: 1;
	}
}

.drop-in {
	animation-duration: 0.5s;
	animation-fill-mode: forwards;
	animation-name: drop-in;
	transform-origin: 50% 100%;
}
@keyframes drop-in {
	0% {
		transform: translateY( -50px );
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform:  translateY( 0px );
		opacity: 1;
	}
}

.float {
	animation: animate-float 2s ease-in-out infinite alternate;
	transform-origin: 50% 50%;
}
.throb {
	animation: animate-throb 2s ease-in-out infinite alternate;
	transform-origin: 50% 50%;
}
.wave {
	animation: animate-wave 2s ease-in-out infinite alternate;
	transform-origin: 50% 50%;
}
@keyframes animate-float {
	0% {
		transform: translateY( -10px );
	}
	100% {
		transform: translateY( 10px );
	}
}
@keyframes animate-throb {
	0% {
		transform: scale( 0.95 );
	}
	100% {
		transform: scale( 1.05 );
	}
}
@keyframes animate-wave {
	0% {
		transform: rotate( -5deg );
	}
	100% {
		transform: rotate( 5deg )
	}
}

.rotate-in {
	animation-duration: 0.25s;
	animation-fill-mode: forwards;
	animation-name: rotate-in;
	transform-origin: 50% 100%;
}
@keyframes rotate-in {
	0% {
		transform: perspective( 1000px ) rotateX(-90deg) translateY( 50px );
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform: perspective( 1000px ) rotateX(0deg) translateY( 0px );
		opacity: 1;
	}
}

/*
	A close button that appears in the upper right of its container.
	Used by CLOSE_BUTTON.
*/
.close-button {
	position: absolute;
	right: 10px;
	top: 10px;
	width: 40px;
	height: 40px;
	border-radius: 20px;
	display: grid;
	align-items: center;
	justify-items: center;
	background-color: #900;
	color: white;
	font-weight: bold;
	border: 3px solid black;
	z-index: 1000;
	font-size: 18px;
	
	&.tab-highlighted {
		color: #900;
		background-color: white;
	}
}

/*
	Blocker of clicks, overlaid over a leaving controller that
	should not receive any more clicks on its elements.
	Used by CLICK_BLOCKER.
*/
.click-blocker {
	position: absolute;
	left: 0px;
	top: 0px;
	width: var( --game-width );
	height: var( --game-height );
	background-color: transparent;
}

/*	A black bar that shows up along the top of the screen with
	instructions in it. */
.top-instructions {
	position: absolute;
	left: 100px;
	right: 100px;
	top: -3px;
	padding: 10px;
	background-color: #222;
	color: #eee;
	border-radius: 0px 0px 20px 20px;
	display: flex;
	gap: 10px;
	align-items: center;
	.water-amount {
		font-size: 20px;
	}
}

/*
	Listifications - Show up as lists of modifiers in UI, like
	the +50% bonus from a wildcard event.
*/
.listification {
	text-align: center;
	span {
		font-weight: bold;
		font-size: var( --small-font-size );
		font-family: sans-serif;
		white-space: nowrap;
	}
}

.zbutton {
	width: 100%;
	padding: 10px;
	border: 3px solid black;
	background-color: white;
	color: black;
	font-family: monospace;
	font-weight: bold;
	font-size: 16px;
}


#loading-panel {

	background-color: white;
	padding: 20px;
	border-radius: 20px;
	width: 600px;
	
	& .gauge-and-ok {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 10px;
		gap: 20px;
		
		& progress {
			flex-grow: 1;
		}
	}
	
	& #loading-errors p {
		font-family: monospace;
		font-size: 16px;
	}
	
}