/* Интерактивный аватар в hero + bottom-sheet / modal */

/* ─── Hero: кликабельный аватар ─── */
.iqmo-hero.v3 .av--editable .av-hit {
	position: relative;
	z-index: 3;
	width: 172px;
	height: 172px;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	display: block;
	font: inherit;
	-webkit-tap-highlight-color: transparent;
}

.iqmo-hero.v3 .av--editable .av-hit .av-img {
	width: 100%;
	height: 100%;
}

.iqmo-hero.v3 .av--editable .av-hover {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 18, 38, 0);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -0.02em;
	pointer-events: none;
	transition: background 0.22s ease;
}

.iqmo-hero.v3 .av--editable .av-hit:hover .av-hover,
.iqmo-hero.v3 .av--editable .av-hit:focus-visible .av-hover {
	background: rgba(15, 18, 38, 0.42);
}

.iqmo-hero.v3 .av--editable .av-hover-txt {
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.iqmo-hero.v3 .av--editable .av-hit:hover .av-hover-txt,
.iqmo-hero.v3 .av--editable .av-hit:focus-visible .av-hover-txt {
	opacity: 1;
	transform: translateY(0);
}

.iqmo-hero.v3 .av-cam-badge {
	position: absolute;
	right: 8px;
	bottom: 8px;
	left: auto;
	top: auto;
	z-index: 4;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, #7c3aed, #6366f1);
	color: #fff;
	border: 2.5px solid #fff;
	box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
	pointer-events: none;
	transform: none;
}

.iqmo-hero.v3 .av-cam-badge svg {
	width: 16px;
	height: 16px;
}

.iqmo-hero.v3 .av-cam-badge.is-hint {
	animation: iqmoAvCamPulse 2.4s ease-in-out infinite;
}

@keyframes iqmoAvCamPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45), 0 0 0 0 rgba(124, 58, 237, 0.35);
	}
	50% {
		transform: scale(1.07);
		box-shadow: 0 8px 20px rgba(124, 58, 237, 0.55), 0 0 0 6px rgba(124, 58, 237, 0);
	}
}

@media (max-width: 720px) {
	.iqmo-hero.v3 .av--editable .av-hit {
		width: 148px;
		height: 148px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.iqmo-hero.v3 .av-cam-badge.is-hint {
		animation: none;
	}
}

/* ─── Sheet / modal ─── */
#iqmo-avatar-sheet {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
}

#iqmo-avatar-sheet[hidden] {
	display: none !important;
}

.av-sheet-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 38, 0.38);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: avSheetFadeIn 0.22s ease;
}

.av-sheet-panel {
	position: relative;
	z-index: 1;
	width: min(400px, calc(100% - 24px));
	max-height: min(88vh, 520px);
	margin: 0 auto 16px;
	padding: 12px 16px 20px;
	border-radius: 22px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(250, 251, 255, 0.98) 100%);
	border: 1px solid rgba(230, 232, 240, 0.9);
	box-shadow:
		0 24px 60px rgba(15, 18, 38, 0.18),
		0 0 0 1px rgba(124, 58, 237, 0.06);
	animation: avSheetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes avSheetFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes avSheetSlideUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

.av-sheet-handle {
	width: 40px;
	height: 4px;
	margin: 4px auto 12px;
	border-radius: 999px;
	background: #d8dcf0;
}

.av-sheet-title {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 800;
	color: #0f1226;
	letter-spacing: -0.02em;
	text-align: center;
}

.av-sheet-sub {
	margin: 0 0 14px;
	font-size: 13px;
	color: #6b7094;
	text-align: center;
	line-height: 1.4;
}

.av-sheet-menu {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.av-sheet-opt {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1.5px solid #e6e8f0;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.1s ease;
}

.av-sheet-opt:hover {
	border-color: #c4b5fd;
	background: #faf8ff;
	box-shadow: 0 6px 18px rgba(124, 58, 237, 0.1);
}

.av-sheet-opt:active {
	transform: scale(0.99);
}

.av-sheet-opt.is-selected {
	border-color: #7c3aed;
	background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.av-sheet-opt__thumb {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: #eef0f7;
	display: flex;
	align-items: center;
	justify-content: center;
}

.av-sheet-opt__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.av-sheet-opt__thumb--upload {
	font-size: 20px;
	font-weight: 800;
	color: #7c3aed;
	background: #f5f3ff;
}

.av-sheet-opt__txt {
	font-size: 15px;
	font-weight: 700;
	color: #2a2e4a;
	display: flex;
	align-items: center;
	gap: 8px;
}

.av-sheet-opt__em {
	font-size: 18px;
	line-height: 1;
}

.av-sheet-hint {
	margin: 12px 0 0;
	font-size: 11.5px;
	color: #9aa0bf;
	text-align: center;
}

.av-sheet-err {
	margin: 8px 0 0;
	min-height: 1.2em;
	font-size: 12px;
	color: #b45309;
	text-align: center;
}

body.iqmo-av-sheet-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.av-sheet-opt {
		min-height: 52px;
		padding: 14px 16px;
	}
	.iqmo-hero.v3 .av-cam-badge {
		width: 38px;
		height: 38px;
	}
}

/* Desktop: центрированное окно */
@media (min-width: 641px) {
	#iqmo-avatar-sheet {
		align-items: center;
		padding: 24px;
	}

	.av-sheet-panel {
		margin: 0;
		border-radius: 20px;
	}

	.av-sheet-handle {
		display: none;
	}
}

/* Достижения — мини-аватар в заголовке */
.sec-head-with-av {
	display: flex;
	align-items: center;
	gap: 14px;
}

.prof-ach-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid #fff;
	box-shadow: 0 4px 14px rgba(124, 58, 237, 0.22);
}
