:root {
	--global-scale: calc(1vh * (9/16));
	--padding-bottom-ios: 5%; /* or 5%? */
}

html,
body {
	height: 100%;
	height: 100vh;
	height: -webkit-fill-available;
}

/* https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/ */
@media not all and (min-resolution: .001dpcm) {
	@supports (-webkit-appearance:none) and (stroke-color: transparent) {

		html,
		body {
			position: fixed;
		}
	}
}

body {
	margin: 0;
	overflow: hidden;
	background: var(--color-background-darkest);
	color: var(--color-font-dark);
	scrollbar-color: dark;
	overscroll-behavior: none;
	-webkit-touch-callout: none;
	/* iOS Safari */
	-webkit-user-select: none;
	/* Safari */
	-khtml-user-select: none;
	/* Konqueror HTML */
	-moz-user-select: none;
	/* Old versions of Firefox */
	-ms-user-select: none;
	/* Internet Explorer/Edge */
	user-select: none;
	/* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
	min-width: 100vw;
	min-height: -webkit-fill-available;
	display: flex;
}

#app {
	max-width: calc(100vh * (9/16));
	max-width: calc(100dvh * (9/16));
	/* max-height: calc(100vw * (16/9)); */
	max-height: 100%;
	/* max-height: calc(100vh - env(safe-area-inset-bottom)); */
	width: 100%;
	height: 100vh;
	height: --webkit-fill-available;
	height: 100dvh;
	/* To move screen up when typing */
	/* height: calc(100vh - env(keyboard-inset-height)); */
	position: relative;
	margin: 0 auto;
	box-shadow: 0 0 1em rgb(0 0 0, 20%);
	background: var(--color-game-background);
}

#main {
	height: 100%;
	display: flex;
	justify-content: space-between;
	flex-direction: column;
	overscroll-behavior: none;
	position: relative;
	background: black;
	animation: 1s fade-in ease-out 1 forwards;
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.view-container {
	display: flex;
	flex-direction: column;
	flex: 1;
	height: calc(100% - 3.6em);
	width: 100%;
	overflow-y: hidden;
	overflow-x: hidden;
	overscroll-behavior: none;
	/* position: relative; */
	/* background: black; */
}

.view-menu {
	display: flex;
	flex-direction: column;
	height: 100%;
	z-index: 2;
	/* background: var(--color-background-dark); */
	backdrop-filter: blur(3.15em) brightness(0.65);
	animation: slide-in 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards, fade-in 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards;
	overflow: hidden;
	will-change: transform;
}

.view-menu.closed {
	animation: slide-out 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards, fade-out 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1 forwards;
}

.view-detail {
	flex: 1;
	/* overflow-y: auto; */
	/* height: 50vh; */
	/* display: flex; */
	justify-content: center;
	align-items: center;
	/* text-align: center; */
	width: 100%;
}

.view-detail-gold {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	text-align: center;
	width: 100%;
	/* height: -webkit-fill-available; */
	flex: 1;
	gap: 2em;
	font-size: 1.5em;
}

.view-detail-gold-icon {
	background: url('../res/img/ui/gold_icon.svg') no-repeat;
	background-size: contain;
	padding: 0.7em;
	/* height: 1.5em; */
	margin: 0 0.5em;
	display: inline-block;
}

.view-detail-gold-count {
	display: flex;
	flex-direction: row;
	font-weight: bold;
}

.view-detail-contents {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	width: 100%;
	/* height: -webkit-fill-available; */
	flex: 1;
}

.scene {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 100%;
	/* padding: 0 1.35em; */
	justify-content: start;
	/* background: var(--color-game-background); */
	color: var(--color-font-light);
}

.scene-encounter {
	display: flex;
	flex-direction: column;
	position: relative;
	width: 100%;
	height: 100%;
	background: var(--color-background-dark);
	color: var(--color-font-light);
	z-index: 1;
}

.scene-encounter.onyx {
	background: none;

	pointer-events: none;
}

.scene-encounter-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	/* justify-content: space-between; */
	/* padding: 1em; */
	pointer-events: none;
	z-index: 1;
	color: var(--color-font-light);
}

.scene-encounter-title {
	position: absolute;
	top: 22%;
	width: 90%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	padding: 0.5em 1em;
	background: rgba(0, 0, 0, 0.1);
	color: var(--color-font-light);
	font-size: 2em;
	font-weight: bold;
	transition: opacity 0.35s ease;
}

.scene-encounter-actions.list {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: end;
	width: 20%;
	height: 88%;
	padding: 0.5em;
	position: absolute;
	bottom: 0;
	top: 0;
	/* left: 0; */
	/* right: 0; */
}

.list-container {
	display: flex;
	height: 100%;
	flex: 0 1 45vh;
	overflow-y: auto;
	z-index: 2;
	background: var(--color-section-list);
	pointer-events: all;
	/* box-shadow: 0.1em 0.25em 1em rgba(0,0,0,0.4); */
	/* box-shadow: inset 0em -0.7em 0.5em -0.4em rgb(0 0 0 / 40%); */
}

.list-container.one-line {
	flex: 0 1 21vh;
}

.hr {
	position: relative;
	width: 100%;
	height: var(--border-width);
	border: none;
	/* border-radius: calc(var(--global-scale) * 1); */
	display: flex;
	align-items: center;
	justify-content: center;
}

.hr::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: var(--hr-linear-neutral-light);

	/* A rectangle cut-out in the center (horizontally) about 6-characters wide */
	/* clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 100% 50%, 100% 100%, 0 100%); */
}

.hr .label {
	position: relative;
	/* background: white; */
	/* mix-blend-mode: difference; */
	padding: 0 1.1em;
	width: fit-content;
}

.loading-encounter {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	/* background: var(--color-background-darkest); */
	font-size: 2em;
	text-align: center;
	color: var(--color-font-light);
	/* animation: fadein 2s; */
}

table.debug-log {
	z-index: 100000;
	position: absolute;
	background: var(--color-blue);
	width: 100%;
	left: 0;
	padding: 0.5em;
}