/* Бейджи как второй ряд в levels-preview.html (класс .lvx) */

.lv-badge,
.lvx {
	--hex: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
	--lv: #9CA3AF;
	--cut: 11px;
	position: relative;
	display: block;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	isolation: isolate;
	box-sizing: border-box;
	overflow: visible;
}
.lvx--squircle,
.lv-badge--shape-squircle { --cut: 11px; }
.lvx--circle,
.lvx--beyond,
.lv-badge--shape-circle,
.lv-badge--shape-beyond { --cut: 50%; }
.lvx--hex,
.lv-badge--shape-hex { --cut: 0; }

.lvx__glow {
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lv) 65%, transparent) 0%, transparent 68%);
	opacity: .42;
	filter: blur(4px);
	pointer-events: none;
	z-index: 0;
}
.lvx__rim {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		160deg,
		#fff 0%,
		color-mix(in srgb, var(--lv) 80%, #fff) 25%,
		var(--lv) 52%,
		color-mix(in srgb, var(--lv) 45%, #080808) 100%
	);
	border-radius: var(--cut);
	box-shadow:
		0 6px 14px color-mix(in srgb, var(--lv) 35%, transparent),
		0 1px 0 rgba(255,255,255,.45) inset;
}
.lvx--hex .lvx__rim {
	border-radius: 0;
	clip-path: var(--hex);
	box-shadow: none;
	filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--lv) 40%, transparent));
}
.lvx__core {
	position: absolute;
	inset: 2px;
	z-index: 2;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--cut);
	background:
		radial-gradient(120% 80% at 30% 18%, rgba(255,255,255,.25), transparent 42%),
		linear-gradient(180deg, color-mix(in srgb, var(--lv) 35%, #14161c) 0%, #07080c 100%);
	color: #fff;
}
.lvx--hex .lvx__core {
	border-radius: 0;
	clip-path: var(--hex);
	inset: 2.5px;
}
.lvx--beyond .lvx__core {
	background:
		radial-gradient(120% 80% at 30% 18%, rgba(255,255,255,.4), transparent 42%),
		linear-gradient(180deg, #6d5514 0%, #0c0a06 100%);
}
.lvx__foil {
	position: absolute;
	inset: -40%;
	background: conic-gradient(
		from var(--spin, 0deg),
		color-mix(in srgb, var(--lv) 15%, transparent),
		#67e8f9 10%,
		color-mix(in srgb, var(--lv) 75%, #fff) 22%,
		#a78bfa 34%,
		#f0abfc 46%,
		#f9a8d4 55%,
		#fde68a 65%,
		#86efac 75%,
		#67e8f9 87%,
		color-mix(in srgb, var(--lv) 15%, transparent)
	);
	mix-blend-mode: overlay;
	opacity: .34;
	animation: lvx-spin 7s linear infinite;
	pointer-events: none;
}
.lvx--beyond .lvx__foil { opacity: .55; }
.lvx__shine {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.6) 48%, transparent 60%);
	background-size: 220% 100%;
	background-position: 120% 0;
	animation: lvx-shine 3.6s ease-in-out infinite;
	mix-blend-mode: screen;
	opacity: .72;
}
.lvx__num {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-family: "Arial Black", "Arial Bold", Impact, system-ui, sans-serif;
	font-weight: 900;
	font-size: 15px;
	letter-spacing: -0.05em;
	line-height: 1;
	color: #fff;
	text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 8px color-mix(in srgb, var(--lv) 80%, transparent);
	transform: translateY(-1px);
}
.lvx--d4 .lvx__num { font-size: 11px; }
.lvx--d1 .lvx__num { font-size: 18px; }
.lvx__floor {
	position: absolute;
	left: 22%;
	right: 22%;
	bottom: 7px;
	height: 2px;
	border-radius: 2px;
	background: #fff;
	box-shadow: 0 0 8px var(--lv), 0 0 14px color-mix(in srgb, var(--lv) 60%, transparent);
	opacity: .9;
	z-index: 3;
}

@keyframes lvx-spin {
	to {
		--spin: 360deg;
		transform: rotate(360deg);
	}
}
@keyframes lvx-shine {
	0%, 28% { background-position: 140% 0; }
	58%, 100% { background-position: -40% 0; }
}
@property --spin {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

.lvx--rank-15 .lvx__glow,
.lvx--rank-16 .lvx__glow,
.lvx--rank-17 .lvx__glow,
.lvx--rank-18 .lvx__glow,
.lvx--rank-19 .lvx__glow,
.lvx--rank-20 .lvx__glow {
	opacity: .55;
	filter: blur(5px);
}
.lvx--rank-21 .lvx__glow,
.lvx--rank-22 .lvx__glow,
.lvx--rank-23 .lvx__glow,
.lvx--rank-24 .lvx__glow,
.lvx--rank-25 .lvx__glow,
.lvx--rank-26 .lvx__glow,
.lvx--rank-27 .lvx__glow,
.lvx--rank-28 .lvx__glow,
.lvx--rank-29 .lvx__glow,
.lvx--rank-30 .lvx__glow {
	opacity: .7;
	filter: blur(6px);
}
.lvx--rank-29 .lvx__rim {
	box-shadow:
		0 0 8px rgba(255,215,80,.7),
		0 0 18px rgba(255,190,40,.45),
		0 6px 14px rgba(255,190,40,.4);
}
.lvx--rank-30 .lvx__rim {
	box-shadow:
		0 0 8px rgba(255,255,255,.9),
		0 0 18px rgba(255,220,120,.85),
		0 0 32px rgba(255,190,50,.65),
		0 6px 20px rgba(255,190,50,.5);
}
.lvx--rank-30 .lvx__num {
	text-shadow: 0 1px 0 #000, 0 0 8px #fff, 0 0 18px #ffd76a;
}

.lv-badge {
	margin: 6px auto 0;
	cursor: pointer;
	outline: none;
	z-index: 4;
	min-width: 0;
	vertical-align: middle;
}
.lv-badge--size-sm {
	display: inline-block;
	width: 35px;
	height: 35px;
	margin: 0 0 0 8px;
}
.lv-badge--size-sm .lvx__num,
.lv-badge--size-sm .lv-badge__num { font-size: 13px; }
.lv-badge--size-sm .lvx__floor,
.lv-badge--size-sm .lv-badge__floor { bottom: 5px; }
.lv-badge--size-lg {
	width: 52px;
	height: 52px;
	margin: 0;
}
.lv-badge--size-lg .lvx__num,
.lv-badge--size-lg .lv-badge__num { font-size: 16px; }
.lvx--tip {
	width: 56px;
	height: 56px;
	margin: 0 auto 8px;
	cursor: default;
}
.lvx--tip .lvx__num { font-size: 18px; }

/* Старый HTML (.lv-badge__face): рисуем фольгу псевдоэлементами, если нет .lvx__core */
.lv-badge:not(:has(.lvx__core))::before {
	content: "";
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lv) 65%, transparent) 0%, transparent 68%);
	opacity: .42;
	filter: blur(4px);
	pointer-events: none;
	z-index: 0;
}
.lv-badge:not(:has(.lvx__core))::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--cut);
	background: linear-gradient(
		160deg,
		#fff 0%,
		color-mix(in srgb, var(--lv) 80%, #fff) 25%,
		var(--lv) 52%,
		color-mix(in srgb, var(--lv) 45%, #080808) 100%
	);
	box-shadow:
		0 6px 14px color-mix(in srgb, var(--lv) 35%, transparent),
		0 1px 0 rgba(255,255,255,.45) inset;
	pointer-events: none;
}
.lv-badge--shape-hex:not(:has(.lvx__core))::after {
	border-radius: 0;
	clip-path: var(--hex);
	box-shadow: none;
	filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--lv) 40%, transparent));
}
.lv-badge__face {
	position: absolute;
	inset: 2px;
	z-index: 2;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--cut);
	background:
		radial-gradient(120% 80% at 30% 18%, rgba(255,255,255,.25), transparent 42%),
		linear-gradient(180deg, color-mix(in srgb, var(--lv) 35%, #14161c) 0%, #07080c 100%);
	color: #fff;
}
.lv-badge--shape-hex .lv-badge__face {
	border-radius: 0;
	clip-path: var(--hex);
	inset: 2.5px;
}
.lv-badge--shape-beyond .lv-badge__face {
	background:
		radial-gradient(120% 80% at 30% 18%, rgba(255,255,255,.4), transparent 42%),
		linear-gradient(180deg, #6d5514 0%, #0c0a06 100%);
}
.lv-badge__face::before {
	content: "";
	position: absolute;
	inset: -40%;
	background: conic-gradient(
		from var(--spin, 0deg),
		color-mix(in srgb, var(--lv) 15%, transparent),
		#67e8f9 10%,
		color-mix(in srgb, var(--lv) 75%, #fff) 22%,
		#a78bfa 34%,
		#f0abfc 46%,
		#f9a8d4 55%,
		#fde68a 65%,
		#86efac 75%,
		#67e8f9 87%,
		color-mix(in srgb, var(--lv) 15%, transparent)
	);
	mix-blend-mode: overlay;
	opacity: .34;
	animation: lvx-spin 7s linear infinite;
	pointer-events: none;
}
.lv-badge__face::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.6) 48%, transparent 60%);
	background-size: 220% 100%;
	background-position: 120% 0;
	animation: lvx-shine 3.6s ease-in-out infinite;
	mix-blend-mode: screen;
	opacity: .72;
}
.lv-badge__num {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-family: "Arial Black", "Arial Bold", Impact, system-ui, sans-serif;
	font-weight: 900;
	font-size: 15px;
	letter-spacing: -0.05em;
	line-height: 1;
	color: #fff;
	text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 8px color-mix(in srgb, var(--lv) 80%, transparent);
	transform: translateY(-1px);
}
.lv-badge--digits-1 .lv-badge__num { font-size: 18px; }
.lv-badge--digits-4 .lv-badge__num { font-size: 11px; }
.lv-badge__floor {
	position: absolute;
	left: 22%;
	right: 22%;
	bottom: 7px;
	height: 2px;
	border-radius: 2px;
	background: #fff;
	box-shadow: 0 0 8px var(--lv), 0 0 14px color-mix(in srgb, var(--lv) 60%, transparent);
	opacity: .9;
	z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
	.lvx__foil,
	.lvx__shine { animation: none; }
}

.lv-tip {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: absolute;
	left: 50%;
	top: calc(100% + 8px);
	bottom: auto;
	transform: translateX(-50%) translateY(-6px);
	min-width: 140px;
	width: max-content;
	max-width: 220px;
	padding: 12px 14px 13px;
	border-radius: 12px;
	background: var(--ui-bg, #fff);
	border: 1px solid var(--bdc, rgba(0,0,0,.08));
	box-shadow: 0 12px 32px rgba(0,0,0,.28);
	color: var(--tt, #161616);
	text-align: center;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	z-index: 80;
}
.lv-tip::after {
	content: "";
	position: absolute;
	bottom: 100%;
	top: auto;
	left: 50%;
	margin-left: -6px;
	border: 6px solid transparent;
	border-bottom-color: var(--ui-bg, #fff);
}
.lv-tip__title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--tt);
	margin: 0 0 8px;
}
.lv-tip__pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--lv);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .02em;
	line-height: 1.35;
}
.lv-tip__pill--dark { color: #1a1408; }
.lv-tip--bar {
	min-width: 200px;
	max-width: 260px;
	white-space: normal;
}
.lv-tip__bar {
	display: block;
	height: 7px;
	margin: 10px 0 6px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--lv) 16%, var(--bg-2, #eee));
	overflow: hidden;
}
.lv-tip__bar-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--lv);
	box-shadow: 0 0 8px color-mix(in srgb, var(--lv) 50%, transparent);
}
.lv-tip__xp,
.lv-tip__next {
	display: block;
	font-size: 11px;
	line-height: 1.35;
	color: var(--tt-2);
	white-space: normal;
}
.lv-tip__next {
	margin-top: 4px;
	font-weight: 600;
	color: var(--tt);
}
.lv-badge:hover .lv-tip,
.lv-badge:focus-visible .lv-tip {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.lv-badge.is-open { z-index: 100000; }
.lv-badge.is-open .lv-tip {
	opacity: 1;
	visibility: visible;
	position: fixed;
	transform: none;
	z-index: 100001;
	top: auto;
	bottom: auto;
	white-space: normal;
	pointer-events: none;
}
.lv-badge.is-open .lv-tip::after { display: none; }

.commenty,
.comment-item,
.comment-item__main,
.header__avatar-wrap {
	overflow: visible;
}
/* Пузырь не через margin-left (на стене при ≤760px он 50px при колонке 70px — наезд на ранг/бейдж). */
.comment-item,
.profile-wall-comment,
#profile-wall .comment-item,
.js-comm,
.ac-comments .comment-item,
.clans-wall.ac-comments .comment-item,
.diary-layout-root #ac-comments .comment-item {
	display: flex !important;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 10px;
}
#profile-wall .comments-tree-item,
#profile-wall .profile-wall-tree-item {
	display: flow-root;
}
.comment-item:has(.lv-badge.is-open),
.comment-item:has(.js-rank-tip.is-open),
.js-comm:has(.lv-badge.is-open),
.js-comm:has(.js-rank-tip.is-open),
.header__avatar-wrap:has(.lv-badge.is-open) {
	position: relative;
	z-index: 100000;
}
.commenty,
.ac-comments .commenty,
.clans-wall.ac-comments .commenty,
.diary-layout-root #ac-comments .commenty {
	float: none !important;
	flex: 0 0 70px;
	width: 70px;
	max-width: 70px;
	position: relative;
	z-index: 1;
	overflow: visible;
	box-sizing: border-box;
}
.comment-item__main,
.comment-item__main.full-text-com,
#profile-wall .comment-item__main,
#profile-wall .comment-item__main.full-text-com,
.ac-comments .comment-item__main,
.clans-wall.ac-comments .comment-item__main,
.diary-layout-root #ac-comments .comment-item__main {
	float: none;
	margin-left: 0 !important;
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	max-width: 100%;
	position: relative;
	z-index: 0;
}
.commenty > .lv-badge {
	display: block;
	width: 46px;
	height: 46px;
	margin: 6px auto 0;
}
.commenty .lv-badge.is-open,
.usp__name-row .lv-badge.is-open,
.header__avatar-wrap .lv-badge.is-open {
	z-index: 100000;
}
.header__avatar-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-left: 10px;
	flex-shrink: 0;
}
.header__avatar-btn {
	position: relative;
	display: inline-flex;
	flex-shrink: 0;
}
.header__avatar-wrap .header__btn-login {
	margin-left: 0;
}
.header .alert_module {
	margin-left: 10px;
	max-width: none;
	flex-shrink: 0;
}
.header .alert_module-icon {
	float: none;
	margin-left: 0;
}
.usp__name-row .lv-badge,
.usp__name-row .lvx {
	display: inline-block;
	width: 28px;
	height: 28px;
	margin: 0 0 0 8px;
	vertical-align: middle;
}
.usp__name-row .lv-badge .lvx__num,
.usp__name-row .lv-badge .lv-badge__num { font-size: 12px; }
.usp__name-row .lv-badge .lvx__floor,
.usp__name-row .lv-badge .lv-badge__floor { bottom: 4px; }
.header__avatar-wrap .lv-badge {
	display: inline-block;
	width: 35px;
	height: 35px;
	margin: 0;
}

.lv-widget {
	--lv: #9CA3AF;
	margin: 0 0 18px;
	max-width: none;
	padding: 14px 16px 15px;
	border-radius: 12px;
	background: var(--ui-bg, var(--bg));
	border: 1px solid var(--bdc);
}
.lv-widget__top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}
.lv-widget__level {
	font-size: 16px;
	font-weight: 800;
	color: var(--tt);
	line-height: 1.2;
}
.lv-widget__rank {
	margin-top: 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--lv);
}
.lv-widget__bar {
	height: 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--lv) 16%, var(--bg-2, #eee));
	overflow: hidden;
}
.lv-widget__bar-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--lv);
	box-shadow: 0 0 8px color-mix(in srgb, var(--lv) 50%, transparent);
}
.lv-widget__xp,
.lv-widget__next {
	margin-top: 6px;
	font-size: 12px;
	color: var(--tt-2);
}
.lv-widget__next {
	font-weight: 600;
	color: var(--tt);
}

.dt-is-active .lv-tip {
	background: linear-gradient(180deg, #222230 0%, #16161f 100%);
	border-color: rgba(255,255,255,.1);
	color: #f0f0f5;
	box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.dt-is-active .lv-tip::after {
	border-bottom-color: #16161f;
	border-top-color: transparent;
}
.dt-is-active .lv-tip__title { color: #f0f0f5; }
.dt-is-active .lv-widget {
	background: var(--ui-bg-darker, #1b2935);
	border-color: var(--bdc);
}
