/* Профиль - попап поверх главного экрана */

.profile_box {
	z-index: 10000;
	position: absolute;
	top: 0;
	left: 0;
	width: 2000px;
	height: 1000px;
	pointer-events: none;
}

.profile_box > .book {
	pointer-events: auto;
	position: absolute;
	top: 100px;
	left: 160px;
	width: 1500px;
	height: 781px;
	background: url( 'img/Profile/book.png' ) no-repeat center / 1500px 781px;
}

.profile_box > .book > .cross {
	z-index: 100;
	position: absolute;
	top: -10px;
	right: -10px;
	width: 60px;
	height: 60px;
	background: url( 'img/interface/cross.png' ) no-repeat;
	background-size: 60px 60px;
	cursor: pointer;
	pointer-events: auto;
}

/* Левая страница */

.profile_box > .book > .page_left {
	position: absolute;
	top: 0;
	left: 0;
	width: 750px;
	height: 781px;
}

.profile_box .page_left > .title {
	position: absolute;
	top: 80px;
	right: 60px;
	width: 300px;
	height: 60px;
	font-size: 46px;
	font-weight: 600;
	line-height: 60px;
	text-align: center;
	text-transform: uppercase;
	text-shadow: 2px 2px 4px rgba( 0, 0, 0, 0.6 );
	color: #fff;
}

.profile_box .page_left > .avatar_card {
	position: absolute;
	top: 160px;
	left: 235px;
	width: 300px;
	height: 300px;
	overflow: visible;
}

.profile_box .avatar_scale {
	position: absolute;
	top: 0;
	left: 0;
	width: 150px;
	height: 150px;
	transform: scale( 2 );
	transform-origin: 0 0;
}

/* Нейтрализуем внешние стили .top / .profile внутри попапа,
   чтобы сработали сеттеры .top > .profile > .avatar и спрайты. */
.profile_box .avatar_scale .top {
	position: static;
	width: 150px;
	height: 150px;
	padding: 0;
	margin: 0;
	display: block;
	text-shadow: none;
	pointer-events: auto;
}
.profile_box .avatar_scale .top > .profile {
	position: relative;
	width: 150px;
	height: 150px;
}
.profile_box .avatar_scale .top > .profile > .avatar {
	float: none;
	margin: 0;
}

/* Ник + карандаш */

.profile_box .page_left > .name_row {
	position: absolute;
	top: 490px;
	left: 60px;
	width: 630px;
	height: 140px;
}
.profile_box .name_row > .name_line {
	position: absolute;
	top: 0;
	left: calc( 50% - 223px );
	width: 300px;
	height: 140px;
	background: url( 'img/Profile/name_line.png' ) repeat-x center;
	background-size: auto 140px;
}
.profile_box .name_row > .name_line::before,
.profile_box .name_row > .name_line::after {
	position: absolute;
	top: 0;
	width: 73.12px;
	height: 140px;
	background: url( 'img/Profile/name_edge.png' ) no-repeat center;
	background-size: 73.12px 140px;
	content: '';
}
.profile_box .name_row > .name_line::before {
	left: -73.12px;
}
.profile_box .name_row > .name_line::after {
	right: -73.12px;
	transform: scaleX( -1 );
}
.profile_box .name_row > .name_line > .txt {
	position: relative;
	width: 100%;
	height: 140px;
	font-size: 24px;
	font-weight: 500;
	line-height: 140px;
	text-align: center;
	text-shadow: 1px 1px 4px #000;
	color: #fff;
	overflow: hidden;
}
.profile_box .name_row > .pencil {
	position: absolute;
	top: calc( 50% - 25px );
	left: calc( 50% + 170px );
	width: 36px;
	height: 36px;
	padding: 7px;
	border-radius: 14px;
	background: #d9a97c;
	box-shadow: 0 0 4px #000;
	cursor: pointer;
}
.profile_box .name_row > .pencil::before,
.profile_box .name_row > .pencil::after {
	position: absolute;
	bottom: 5px;
	left: 5px;
	width: inherit;
	height: inherit;
	border: 2px solid #fff;
	border-radius: 12px;
	background: #574736;
	box-shadow: inset 0 0 4px #000;
	content: '';
}
.profile_box .name_row > .pencil::after {
	background-color: #fff;
	-webkit-mask: url( 'img/Profile/pencil.svg' ) no-repeat center / 22px;
	mask: url( 'img/Profile/pencil.svg' ) no-repeat center / 22px;
}

/* VIP */

.profile_box .page_left > .vip_row {
	position: absolute;
	top: 650px;
	left: 60px;
	width: 630px;
	height: 70px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
}
.profile_box .vip_row > .vip_tape {
	width: 143.5px;
	height: 70px;
	background: url( 'img/donate/vip.png' ) no-repeat center;
	background-size: 143.5px 70px;
	filter: drop-shadow( 0px 0px 2px rgba( 0, 0, 0, 0.7 ) );
}
.profile_box .vip_row > .vip_medal {
	height: 59.5px;
	line-height: 59.5px;
	font-size: 38px;
	font-weight: 600;
	text-align: center;
	color: #a16327;
	text-shadow: none;
	filter: drop-shadow( 0px 0px 2px rgba( 0, 0, 0, 0.7 ) );
}
.profile_box .vip_row > .vip_medal.type_0 {
	width: 96.25px;
	padding: 0 7px;
	background: url( 'img/donate/vip_1.png' ) no-repeat center;
	background-size: 96.25px 59.5px;
}
.profile_box .vip_row > .vip_medal.type_1 {
	width: 106.75px;
	padding: 0 2px;
	background: url( 'img/donate/vip_2.png' ) no-repeat center;
	background-size: 106.75px 59.5px;
}
.profile_box .vip_row > .vip_medal.type_2 {
	width: 110.25px;
	background: url( 'img/donate/vip_3.png' ) no-repeat center;
	background-size: 110.25px 59.5px;
}

/* Правая страница */

.profile_box > .book > .page_right {
	position: absolute;
	top: 80px;
	left: 790px;
	width: 650px;
	height: 640px;
}

.profile_box .page_right > .grid {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0 5px;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-content: flex-start;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-mask: linear-gradient( to bottom, transparent 0, #000 50px, #000 calc( 100% - 50px ), transparent 100% );
	mask: linear-gradient( to bottom, transparent 0, #000 50px, #000 calc( 100% - 50px ), transparent 100% );
}

.profile_box .grid > .cell {
	position: relative;
	width: 200px;
	height: 200px;
	box-sizing: border-box;
	border: 2px solid #eeb26f;
	border-radius: 18px;
	background: linear-gradient( to bottom, rgba( 238, 178, 111, 0.15 ), rgba( 238, 178, 111, 0.4 ) );
	overflow: hidden;
	cursor: pointer;
}

.profile_box .grid > .cell.cell_active {
	border-color: #fdc30b;
	box-shadow: 0 0 8px #fdc30b inset;
}

.profile_box .grid > .cell.cell_locked {
	cursor: default;
	filter: grayscale( 1 );
	opacity: 0.35;
}

/* Внутри ячейки ставим avatar_scale так, чтобы 150px визуально вписалось в 196px */
.profile_box .grid > .cell > .avatar_scale {
	position: absolute;
	top: 0;
	left: 0;
	transform: scale( 1.3 );
	transform-origin: 0 0;
}

/* Вкладки справа от книги */

.profile_box > .tabs {
	pointer-events: auto;
	position: absolute;
	top: 350px;
	left: 1680px;
	width: 140px;
	height: 260px;
}
.profile_box > .tabs > .tab {
	position: relative;
	width: 140px;
	height: 113px;
	background: url( 'img/Profile/mark.png' ) no-repeat center / 140px 113px;
	opacity: 0.55;
	filter: grayscale( 0.3 );
	cursor: pointer;
}
.profile_box > .tabs > .tab + .tab {
	margin-top: 16px;
}
.profile_box > .tabs > .tab.tab_active {
	opacity: 1;
	filter: none;
}
.profile_box > .tabs > .tab > .icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -58% );
}
.profile_box > .tabs > .tab > .icon_avatar {
	width: 72px;
	height: 72px;
	background: url( 'img/Profile/avatar.png' ) no-repeat center / contain;
}
.profile_box > .tabs > .tab > .icon_frame {
	width: 72px;
	height: 78px;
	background: url( 'img/Profile/frame.png' ) no-repeat center / contain;
}
