@media (orientation:portrait) {
	#popup-content {
		width: 80%;
		margin: 0 calc((100% - 80%)/2 - 100vw + 100%) 0 calc((100% - 80%)/2)
	}
}

@media (orientation: landscape) {
	#popup-content {
		width: 50%;
		margin: 0 calc((100% - 50%)/2 - 100vw + 100%) 0 calc((100% - 50%)/2)
	}
}

@media (hover:hover) and (pointer:fine) {
	#popup #confirm:hover:not(:focus)+#no-js-confirm,
	#popup #buttons-wrap #no-js-confirm:hover,
	#popup #no-js-confirm:focus {
		display: block;
		z-index: 1;
	}

	#popup #no-js-confirm:focus:not(:active)+.no-js-loading-wrap {
		display: flex;
	}
}

@media (hover:none) and (pointer:coarse) {
	#popup #confirm:hover~.no-js-loading-wrap {
		display: flex;
		animation: enable-pointer-events 0.1s;
	}
}

#popup-wrap {
	position: fixed;
	width: 100%;
	height: 100%;
	overflow: auto;
	z-index: 50;
	top: 0;
	left: 0;
	pointer-events: none
}

#popup-wrap #popup-checkbox {
	display: block;
}

#popup-wrap #popup-checkbox:checked+#popup-content {
	opacity: 1;
	transform: scale(1);
}

#popup-wrap .heightfiller {
	height: calc(calc(100% - max(50%, 20em))/2);
	min-height: 1em
}

#popup-wrap .widthfiller {
	min-width: 1em
}

#popup .no-js-loading-wrap {
	position: absolute;
	top: calc(-50vh + 50%);
	left: calc(-50vw + 50%);
	width: 99vw;
}

#popup {
	display: flex;
	height: 50%;
	min-height: 20em;
}

#popup-content {
	font-family: Arial;
	height: 100%;
	min-height: 20em;
	min-width: 14em;
	box-shadow: 0 0.5em 2em 1em gray;
	opacity: 0;
	transform: scale(0);
	transform-origin: center;
	transition: transform 0.3s, opacity 0.5s;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	pointer-events: auto
}

#popup-content>div {
	padding: 0.5em;
}

#popup-content>label,
#popup-content>button {
	position: absolute;
	right: 0.5em;
	top: 0.5em;
}

#popup label {
	cursor: pointer;
}

#popup #x {
	font-weight: bold;
	font-size: 2em;
	cursor: pointer;
	width: 1em;
	text-align: center;
	height: 1em;
	border: none;
	padding: 0;
	background-color: inherit;
	text-shadow: 0 0 0.5em blue;
}

#popup #title {
	font-size: 2em;
	padding-bottom: 0.5em;
	font-weight: bold;
	text-align: center;
}

#popup #message {
	text-align: center;
	padding-bottom: 1em;
	min-width: 14em
}

#popup #buttons-wrap {
	width: 12em;
	display: flex;
	justify-content: space-between;
	margin: auto
}

#popup #buttons-wrap button,
#popup #buttons-wrap label {
	width: 5em;
	height: 2em;
	font-size: 1em;
	border: 2px solid darkslateblue;
	border-radius: 0.3em;
	font-weight: bold;
	color: navy;
	cursor: pointer;
}

#popup-checkbox:focus~#popup-content #x,
#popup-checkbox:focus~#popup-content #buttons-wrap #cancel,
#popup #x:focus,
#popup #confirm:focus,
#popup #cancel:focus {
	background-color: lightblue;
	border: 2px solid blue;
	outline: none;
	line-height: 1em;
}

#popup #buttons-wrap label {
	display: flex;
	justify-content: center;
	align-items: center
}

#popup #no-js-confirm,
#popup #confirm {
	background-color: lightgreen
}

#popup #no-js-confirm {
	margin-top: -2em;
	display: none;
	position: relative;
}

#popup #cancel {
	background-color: lightcoral;
}