@keyframes popup-swing {
	from { transform: translateX(-50%) rotate(6deg); }
	10%  { transform: translateX(-50%) rotate(-5deg); }
	30%  { transform: translateX(-50%) rotate(4deg); }
	50%  { transform: translateX(-50%) rotate(-3deg); }
	70%  { transform: translateX(-50%) rotate(2deg); }
	90%  { transform: translateX(-50%) rotate(-1deg); }
	to   { transform: translateX(-50%) rotate(0deg); }
}
@keyframes popup-scale {
	from { transform: translateX(-50%) scale(0.60); opacity: 0; }
	to   { transform: translateX(-50%) scale(1.00); opacity: 1; }
}

.lock {
	overflow: hidden;
}
.popup {
	max-width: 500px;
	max-height: 500px;
	position: absolute;
	left: 50%;
	text-align: center;
	transform: translateX(-50%);
	background-color: #bbb;
	border: 7px solid #555;
	border-radius: 10px;
/*	box-shadow: 0px 0px 10px 15px rgba(0,0,0,0.1);*/
	animation: popup-scale 300ms ease-out 400ms normal;
	animation-fill-mode: backwards;
	z-index: 999;
}
.popup-button {
	padding: 0.7rem 2rem;
	margin: 0 2rem 1rem;
	font-size: 1.6rem;
	color: #000;
	background-color: #ddd;
	border: 1px solid #aaa;
	border-radius: 5px;
}
.popup-button:hover {
	background-color: #ccc;
}
.popup-button:active {
	background-color: #bbb;
}
.popup-close {
	width: 40px;
	height: 40px;
	position: absolute;
	top: -20px;
	right: -20px;
	border-radius: 5rem;
	background-color: rgba(40,40,40,0.7);
	box-shadow: 0px 0px 5px 5px rgba(0,0,0,0.1);
	transition: all 200ms linear;
	cursor: pointer;
}
.popup-close:hover {
	background-color: rgba(15,15,15,0.8);
}
.popup-close:active {
	background-color: rgba(0,0,0,0.9);
}
.popup-close-cross {
	height: 20px;
	width: 20px;
	position: relative;
	top: 50%;
	left: 50%;
	background-image: linear-gradient(to bottom, transparent 40%, #999 40%, #999 60%, transparent 60%),
										linear-gradient(to right, transparent 40%, #999 40%, #999 60%, transparent 60%);
	transform: translate(-50%, -50%) rotate(45deg);
	border-radius: 20px;
	pointer-events: none;
}
.popup-content {
	padding: 3rem 1.5rem;
	font-size: 1.6rem;
	color: #000;
	max-height: 400px;
	overflow: auto;
	text-align: left;
}
.popup-cover {
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 998;
	cursor: default;
	background-color: rgba(0,0,0,0.4);
	transition: opacity 300ms linear;	/* При изменении времени исправить так же в hidePopup() */
}
.popup-header {
	display: inline-block;
	min-height: 15px;
	margin: -1px 20px 0; /* При изменении размера страницы иногда появляется отступ, поэтому -1 */
	padding: 3px 50px 10px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	background-color: #555;
	font-size: 2rem;
}