/* Toast ЛС: Steam / Discord — glassmorphism, акцент-полоска, кнопка закрытия */

.game-pm-toast-host {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 10000001;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	pointer-events: none;
	max-width: calc(100vw - 32px);
}

.game-pm-toast {
	--pm-accent: #6ea8ff;
	--pm-accent-glow: rgba(110, 168, 255, 0.55);
	pointer-events: auto;
	width: 100%;
	max-width: 380px;
	cursor: pointer;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-left: 3px solid #dc3545;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 12px 40px rgba(0, 0, 0, 0.55), -1px 0 18px #dc354573;
	background: #22222294;
	backdrop-filter: blur(22px) saturate(1.35);
	-webkit-backdrop-filter: blur(22px) saturate(1.35);
	color: #e8eaed;
	font-family: inherit;
	animation: gamePmToastIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.game-pm-toast--out {
	animation: gamePmToastOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Важное уведомление: «звонок» — палитра linear-gradient(23deg, #4d161b 0%, #dc3545 55%) */
.game-pm-toast--emphasis {
	overflow: hidden;
	border-left-color: #dc3545;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.06) inset,
		0 12px 40px rgba(0, 0, 0, 0.55),
		-1px 0 18px rgba(220, 53, 69, 0.3);
	animation:
		gamePmToastIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards,
		gamePmToastRingingGlow 2.85s ease-in-out 0.35s 1;
	position: relative;
	z-index: 2;
}

.game-pm-toast--emphasis::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		105deg,
		transparent 0%,
		transparent 32%,
		rgba(255, 255, 255, 0.28) 42%,
		rgba(220, 53, 69, 0.18) 50%,
		rgba(255, 255, 255, 0.22) 58%,
		transparent 68%,
		transparent 100%
	);
	transform: translateX(-130%);
	opacity: 0;
	animation: gamePmToastShine 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.06s 1 forwards;
	pointer-events: none;
	z-index: 1;
}

.game-pm-toast--emphasis .game-pm-toast__motion {
	position: relative;
	z-index: 2;
	will-change: transform;
	animation: gamePmPhoneVibrate 0.11s ease-in-out 0.46s 16;
	transform-origin: 50% 90%;
}

@keyframes gamePmPhoneVibrate {
	0%,
	100% {
		transform: translate3d(0, 0, 0) rotate(0deg);
	}
	20% {
		transform: translate3d(-8px, 0, 0) rotate(-1.1deg);
	}
	40% {
		transform: translate3d(8px, 0, 0) rotate(1.1deg);
	}
	60% {
		transform: translate3d(-5px, 0, 0) rotate(-0.7deg);
	}
	80% {
		transform: translate3d(5px, 0, 0) rotate(0.7deg);
	}
}

@keyframes gamePmToastRingingGlow {
	0%,
	100% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.06) inset,
			0 12px 40px rgba(0, 0, 0, 0.55),
			-1px 0 18px rgba(220, 53, 69, 0.3);
	}
	10% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.08) inset,
			0 16px 48px rgba(0, 0, 0, 0.48),
			-4px 0 36px rgba(220, 53, 69, 0.4),
			0 0 40px rgba(77, 22, 27, 0.22);
	}
	22% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.06) inset,
			0 12px 40px rgba(0, 0, 0, 0.55),
			-1px 0 20px rgba(220, 53, 69, 0.32);
	}
	38% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.07) inset,
			0 14px 44px rgba(0, 0, 0, 0.5),
			0 0 48px rgba(220, 53, 69, 0.28),
			0 0 56px rgba(77, 22, 27, 0.18);
	}
	55% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.06) inset,
			0 12px 40px rgba(0, 0, 0, 0.55),
			-1px 0 18px rgba(220, 53, 69, 0.28);
	}
	72% {
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, 0.08) inset,
			0 13px 42px rgba(0, 0, 0, 0.52),
			0 0 44px rgba(220, 53, 69, 0.26),
			0 0 52px rgba(77, 22, 27, 0.16);
	}
}

@keyframes gamePmToastShine {
	0% {
		transform: translateX(-130%);
		opacity: 0;
	}
	15% {
		opacity: 1;
	}
	100% {
		transform: translateX(130%);
		opacity: 0;
	}
}

@keyframes gamePmToastIn {
	from {
		opacity: 0;
		transform: translateY(calc(100% + 24px));
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes gamePmToastOut {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(calc(100% + 20px)) scale(0.97);
	}
}

.game-pm-toast__inner {
	display: flex;
	gap: 14px;
	padding: 16px 14px 14px 14px;
	align-items: flex-start;
}

.game-pm-toast__avatar {
	flex-shrink: 0;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.4);
	box-shadow:
		0 0 0 2px rgba(255, 255, 255, 0.12),
		0 4px 14px rgba(0, 0, 0, 0.45);
}

.game-pm-toast__avatar img {
	width: 50px;
	height: 50px;
	object-fit: cover;
	display: block;
}

.game-pm-toast__body {
	position: relative;
	min-width: 0;
	flex: 1;
	padding-right: 36px;
}

.game-pm-toast__close {
	position: absolute;
	top: -2px;
	right: -4px;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.06);
	transition:
		color 0.15s ease,
		background 0.15s ease,
		transform 0.12s ease;
}

.game-pm-toast__close:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
}

.game-pm-toast__close:active {
	transform: scale(0.94);
}

.game-pm-toast__label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #828282;
	margin: 0 0 6px 0;
	line-height: 1.2;
}

.game-pm-toast__name {
	font-family: 'Unbounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	margin: 0 0 8px 0;
	line-height: 1.3;
	word-break: break-word;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.game-pm-toast__text {
	font-size: 13px;
	line-height: 1.45;
	color: #d1d1d1;
	margin: 0;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	word-break: break-word;
}

.game-pm-toast__text--html {
	color: #828282;
}

.game-pm-toast__progress {
	height: 3px;
	background: rgba(255, 255, 255, 0.07);
	overflow: hidden;
}

.game-pm-toast__progress-bar {
	display: block;
	height: 100%;
	width: 100%;
	background: linear-gradient(90deg, var(--pm-accent), #59c3a4);
	transform-origin: left center;
	animation-name: gamePmToastProgress;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.game-pm-toast--emphasis .game-pm-toast__progress-bar {
	background: linear-gradient(23deg, #4d161b 0%, #dc3545 55%);
}

@keyframes gamePmToastProgress {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

.game-pm-toast:focus {
	outline: 2px solid var(--pm-accent);
	outline-offset: 2px;
}

.game-pm-toast--emphasis:focus {
	outline: none;
}

.game-pm-toast__close:focus-visible {
	outline: 2px solid var(--pm-accent);
	outline-offset: 1px;
}

@media (max-width: 480px) {
	.game-pm-toast-host {
		right: 8px;
		bottom: 8px;
		left: 8px;
		align-items: stretch;
	}

	.game-pm-toast {
		max-width: none;
	}
}

/* Мобилка (≤991px): в primary/style_three скрыты 1–3-й пункты user-menu — возвращаем ЛС в шапку */
@media (max-width: 991.99px) {
    .wapper .header ul.user-menu {
        width: auto !important;
        max-width: none;
    }

    .wapper .header ul.user-menu > li.gamecms-user-menu-messages {
        display: block !important;
        float: left;
        top: -17px;
        position: relative;
    }

    /* Добавляем индикатор внутрь мобильной версии */
    .wapper .header ul.user-menu li.gamecms-user-menu-messages .gamecms-pm-nav-pulse {
        position: absolute !important;
		top: 11px !important;
		right: -2px !important;
    }
}

/* ПК: в style_one у .user-menu > li > a часто overflow по умолчанию режет абсолютную точку; поднимаем z-index */
@media (min-width: 992px) {
	.wapper .header ul.user-menu > li > a.gamecms-messages-nav-a {
		overflow: visible !important;
		position: relative;
		z-index: 2;
	}
	.wapper .header ul.user-menu .gamecms-messages-nav-inner {
		overflow: visible;
		position: relative;
		z-index: 1;
	}
	.wapper .header ul.user-menu .gamecms-pm-nav-pulse {
		z-index: 5;
	}
}

/* Иконки шапки: ЛС, жалобы, разбаны, тикеты — одна разметка, точка у иконки */
a.gamecms-messages-nav-a {
	overflow: visible;
	position: relative;
	z-index: 1;
}

.gamecms-messages-nav-inner {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

a.gamecms-messages-nav-a .gamecms-messages-nav-inner {
	width: 100%;
	height: 100%;
	min-width: 1em;
	min-height: 1em;
}

.gamecms-pm-nav-pulse {
	position: absolute;
	top: 18px;
    right: 4px;
    width: 8px;
    height: 8px;
	border-radius: 50%;
	background: #5bb3ff;
	box-shadow: 0 0 0 0 rgba(91, 179, 255, 0.55);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 2;
}

.gamecms-pm-nav-pulse--on {
	opacity: 1;
	animation: gamecmsPmNavPulse 1.6s ease-in-out infinite;
}

@keyframes gamecmsPmNavPulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 0 0 0 rgba(91, 179, 255, 0.5);
	}
	50% {
		transform: scale(1.2);
		box-shadow: 0 0 0 6px rgba(91, 179, 255, 0);
	}
}

@keyframes gamecmsPmNavPulseTint {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 0 0 0 var(--gamecms-pulse-glow);
	}
	50% {
		transform: scale(1.2);
		box-shadow: 0 0 0 6px transparent;
	}
}

/* Те же top/right, что у точки ЛС (см. .gamecms-pm-nav-pulse) — симметрия */
.gamecms-pm-nav-pulse--complaints {
	opacity: 1;
	background: #f87171;
	--gamecms-pulse-glow: rgba(248, 113, 113, 0.55);
	animation: gamecmsPmNavPulseTint 1.6s ease-in-out infinite;
}

.gamecms-pm-nav-pulse--bans {
	opacity: 1;
	background: #4ade80;
	--gamecms-pulse-glow: rgba(74, 222, 128, 0.55);
	animation: gamecmsPmNavPulseTint 1.6s ease-in-out infinite;
}

.gamecms-pm-nav-pulse--tickets {
	opacity: 1;
	background: #818cf8;
	--gamecms-pulse-glow: rgba(129, 140, 248, 0.55);
	animation: gamecmsPmNavPulseTint 1.6s ease-in-out infinite;
}

/* Колокольчик: только оранжевая точка. #notifications_line скрыт визуально, но остаётся для скриптов getdata / hide_notifications */
.show_user > #notifications_line.circleuved {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	white-space: nowrap !important;
	opacity: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

.show_user .gamecms-bell-nav-inner {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: visible;
}

.gamecms-pm-nav-pulse--notifications {
	opacity: 0;
	background: #ff9800;
	--gamecms-pulse-glow: rgba(255, 152, 0, 0.55);
	top: 5px;
	right: 8px;
	z-index: 6;
}

.gamecms-pm-nav-pulse--notifications.gamecms-pm-nav-pulse--on {
	opacity: 1;
	animation: gamecmsPmNavPulseTint 1.6s ease-in-out infinite;
}

/* Профиль: плашка онлайн/оффлайн (ТЗ — стекломорфизм, пульс точки) */
.flex_profile_top .activity_name.gcms-profile-status-slot,
.personal_card .activity_last_card.gcms-profile-status-slot {
	background: transparent !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0;
	color: inherit;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
}

@media (max-width: 991.99px) {
	/* Только онлайн: оффлайн-плашка на мобильных скрыта */
	.flex_profile_top .activity_name.gcms-profile-status-slot--hide-mobile,
	.personal_card .activity_last_card.gcms-profile-status-slot--hide-mobile {
		display: none !important;
	}
	.flex_profile_top .activity_name.gcms-profile-status-slot:not(.gcms-profile-status-slot--hide-mobile) {
		display: inline-flex !important;
	}
}

.gcms-user-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	height: 45px;
	padding: 6px 12px;
	font-size: 12px;
	line-height: 1.25;
	border-radius: 9px;
	white-space: nowrap;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
	backdrop-filter: blur(12px) saturate(1.2);
	-webkit-backdrop-filter: blur(12px) saturate(1.2);
	min-width: 0;
}

.gcms-user-status__text {
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.gcms-user-status--online {
	background: linear-gradient(135deg, rgba(94, 182, 141, 0.22) 0%, rgba(94, 182, 141, 0.1) 100%);
	color: #5eb68d;
	border-color: rgba(94, 182, 141, 0.35);
}

.gcms-user-status__dot {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #5eb68d;
	box-shadow: 0 0 0 0 rgba(94, 182, 141, 0.55);
	animation: gcms-user-status-pulse 1.6s ease-out infinite;
}

.gcms-user-status--offline {
	background: rgba(255, 255, 255, 0.05);
	color: #888;
	border-color: rgba(255, 255, 255, 0.08);
}

.gcms-user-status--offline .gcms-user-status__icon {
	flex-shrink: 0;
	font-size: 11px;
	opacity: 0.85;
	color: #888;
}

@keyframes gcms-user-status-pulse {
	0% {
		transform: scale(1);
		box-shadow: 0 0 0 0 rgba(94, 182, 141, 0.55);
	}
	55% {
		transform: scale(1.05);
		box-shadow: 0 0 0 6px rgba(94, 182, 141, 0);
	}
	100% {
		transform: scale(1);
		box-shadow: 0 0 0 0 rgba(94, 182, 141, 0);
	}
}
