/* Стили для Telegram Auth Widget и профиля */

.profile-btn {
	position: fixed;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--tg-theme-text-color, #000000) 14%, transparent);
	background: var(--tg-theme-secondary-bg-color, #f1f3f5);
	color: var(--tg-theme-text-color, #000000);
	z-index: 410;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

#auth-container {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 9999;
	background: rgba(255, 255, 255, 0.97);
	padding: 24px;
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.18);
	min-width: 260px;
	min-height: 120px;
	width: fit-content;
	max-width: calc(100vw - 32px);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

#auth-container.authenticated {
	display: none;
}

/* В темной теме */
body.theme-dark #auth-container {
	background: rgba(28, 28, 30, 0.95);
	box-shadow: 0 2px 10px rgba(255,255,255,0.1);
}

#telegram-auth-widget {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 58px;
	overflow: hidden;
}

#telegram-auth-widget iframe {
	display: block;
	max-width: 100%;
	margin: 0 auto;
}

#user-name {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.2px;
	color: var(--tg-theme-text-color, #000000);
	background: color-mix(in srgb, var(--tg-theme-bg-color, #ffffff) 82%, var(--tg-theme-text-color, #000000) 6%);
	border: 1px solid color-mix(in srgb, var(--tg-theme-text-color, #000000) 14%, transparent);
	border-radius: 999px;
	line-height: 30px;
	padding: 0 12px;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	box-sizing: border-box;
}

body.theme-dark .profile-btn {
	background: #2a2a2c;
	border-color: rgba(255, 255, 255, 0.14);
	color: #f5f5f5;
}

body.theme-dark #user-name {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.18);
	color: #f5f5f5;
}

body.theme-sepia .profile-btn {
	background: #ebe0c7;
	border-color: rgba(91, 70, 54, 0.18);
	color: #5b4636;
}

body.theme-sepia #user-name {
	background: rgba(91, 70, 54, 0.08);
	border-color: rgba(91, 70, 54, 0.22);
	color: #5b4636;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
	#auth-container {
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		padding: 16px;
		min-width: 260px;
		width: calc(100vw - 32px);
		max-width: 320px;
	}

	.profile-btn {
		top: 8px;
		right: 8px;
		width: 36px;
		height: 36px;
	}

	#user-name {
		font-size: 12px;
		line-height: 28px;
		padding: 0 10px;
	}
}
