:root {
	--background: linear-gradient(30deg, #1360a4 30%, #3594e8);
	--primary: #1878cd;
	--primary-text: #fff;
	--secondary: #df123b;
	--secondary-text: #fff;
	--focus: #df123b;
	--border-width: 0.3rem;
	--border-radius-round: 100vmax;
}

html,
body,
button {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu,
		"Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

body {
	width: 100%;
	height: 100vh;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	background: var(--background);
	overscroll-behavior: none; /* prevent pull to refresh */
}

.loader {
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: url('../images/spinner.gif') 50% 50% no-repeat rgb(249,249,249);
    opacity: 0.5;
    display: none;
}

.loader.show {
    display: block;
}

.loader-text {
    position: absolute;
    top: 59%;
    margin-top: -50px;
    width: 100%;
    height: 100px;
	display: inline-block;
	white-space: nowrap;
	text-align: center;
}

.main {
	width: 100%;
	display: flex;
	flex: 1;
}

#preview {
	flex: 1;
	width: 100%;
	height: 100%;
	max-height: 100vh;
	object-fit: cover;
}

.actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
}

#take-photo {
	--border-offset: -0.6rem;
	--border: var(--border-width) solid #fff;
	display: block;
	background: #fff;
	border-radius: var(--border-radius-round);
	border: 0;
	width: 3rem;
	height: 3rem;
	font-weight: bold;
	font-size: 2rem;
	padding: 0;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
#take-photo::before {
	content: "";
	position: absolute;
	left: var(--border-offset);
	right: var(--border-offset);
	top: var(--border-offset);
	bottom: var(--border-offset);
	border: var(--border);
	border-radius: inherit;
}
#take-photo:focus {
	outline: none;
}
#take-photo:focus-visible {
	outline: none;
}
#take-photo:focus-visible::before {
	border-color: var(--focus);
}

.switch-camera {
	display: none;
	align-items: center;
	justify-content: center;
	color: var(--primary-text);
	background: var(--primary);
	border-radius: var(--border-radius-round);
	border: 0;
	width: 3rem;
	height: 3rem;
	font-weight: bold;
	font-size: 2rem;
	line-height: 1;
	padding: 0;
	margin: 0.5rem;
	position: relative;
}
.switch-camera:focus {
	outline: none;
}
.switch-camera:focus-visible {
	outline: none;
	box-shadow: 0 0 0 var(--border-width) var(--focus);
}
.switch-camera svg {
	fill: currentColor;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
.camera-number {
	position: absolute;
	top: -0.5rem;
	right: -0.5rem;
	font-size: 14px;
	color: var(--secondary-text);
	background-color: var(--secondary);
	height: 24px;
	width: 24px;
	border-radius: var(--border-radius-round);
	display: flex;
	align-items: center;
	justify-content: center;
}

#show-latest-photo {
	width: 4rem;
	height: 4rem;
	border-radius: 0.5rem;
	overflow: hidden;
	background: transparent;
	border: 0;
	padding: 0;
}
#show-latest-photo:focus {
	outline: none;
}
#show-latest-photo:focus-visible {
	outline: none;
	box-shadow: 0 0 0 var(--border-width) var(--focus);
}
#latest-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

footer{
	width: 100%;
	color: #fff;
	position: fixed;
	top: 1em;
	filter: drop-shadow(0 0 5px rgba(0,0,0,.5));
	text-align: center;
}
footer a{
	color: #fff;
}

@media (orientation: landscape) {
	.actions {
		right: 0;
		top: 0;
		bottom: 0;
		left: unset;
		flex-direction: column-reverse;
	}
}

.is-hidden {
	display: none !important;
}
