/* ilsib.videowidget — плавающий видеовиджет. Все классы с префиксом ivw-. */

.ivw-root {
	--ivw-accent: #e30613;
	--ivw-size: 92px;
	--ivw-radius: 18px;
	--ivw-x: 24px;
	--ivw-y: 24px;
	position: fixed;
	bottom: var(--ivw-y);
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-tap-highlight-color: transparent;
}

/* Форма плашки в углу: вертикальное видео (по умолчанию) или классический кружок. */
.ivw-root.ivw-shape-vertical { --ivw-radius: 18px; }
.ivw-root.ivw-shape-circle   { --ivw-radius: 50%; }
.ivw-root.ivw-bottom-right { right: var(--ivw-x); }
.ivw-root.ivw-bottom-left  { left: var(--ivw-x); }

/* ---------- Кружок-превью ---------- */
.ivw-bubble-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
}
.ivw-root.ivw-bottom-left .ivw-bubble-wrap { flex-direction: row-reverse; }
/* Явный выбор стороны контента (плашки-подписи) — перекрывает авто-по-углу */
.ivw-root.ivw-content-right .ivw-bubble-wrap { flex-direction: row; }
.ivw-root.ivw-content-left .ivw-bubble-wrap { flex-direction: row-reverse; }

.ivw-bubble {
	position: relative;
	width: var(--ivw-size);
	height: var(--ivw-size);
	border-radius: var(--ivw-radius);
	border: 3px solid #fff;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	background: #111;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
	transition: transform .18s ease, box-shadow .18s ease;
	animation: ivw-bob 4s ease-in-out infinite;
}
/* Вертикальное видео — портретная плашка 9:16, как на «сторис». */
.ivw-shape-vertical .ivw-bubble { height: calc(var(--ivw-size) * 16 / 9); }
.ivw-bubble:hover { transform: scale(1.05); box-shadow: 0 12px 34px rgba(0, 0, 0, .34); }
.ivw-bubble:focus-visible { outline: 3px solid var(--ivw-accent); outline-offset: 2px; }

.ivw-bubble-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ivw-bubble-ring {
	position: absolute;
	inset: -3px;
	border-radius: var(--ivw-radius);
	box-shadow: 0 0 0 3px var(--ivw-accent);
	opacity: .0;
	animation: ivw-pulse 2.4s ease-out infinite;
	pointer-events: none;
}
.ivw-bubble-play {
	position: absolute;
	right: 6px;
	bottom: 6px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--ivw-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
	pointer-events: none;
}
.ivw-bubble-close {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: #444;
	font-size: 16px;
	line-height: 20px;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
	opacity: 0;
	transform: scale(.7);
	transition: opacity .15s ease, transform .15s ease;
	z-index: 2;
}
.ivw-root.ivw-bottom-left .ivw-bubble-close { right: auto; left: -6px; }
.ivw-bubble-wrap:hover .ivw-bubble-close { opacity: 1; transform: scale(1); }

.ivw-label {
	max-width: 190px;
	background: #fff;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	padding: 8px 12px;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

/* ---------- Оверлей и плеер ---------- */
.ivw-overlay {
	position: fixed;
	inset: 0;
	background: rgba(12, 14, 22, .72);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .22s ease, visibility .22s ease;
	z-index: 2147483001;
}
.ivw-root.ivw-open .ivw-overlay { opacity: 1; visibility: visible; }

.ivw-frame {
	position: relative;
	width: min(360px, 92vw);
	aspect-ratio: 9 / 16;
	max-height: 92vh;
	background: #000;
	border-radius: 30px;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
	transform: translateY(18px) scale(.98);
	transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.ivw-root.ivw-open .ivw-frame { transform: translateY(0) scale(1); }

.ivw-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
	display: block;
}

/* прогресс */
.ivw-progress {
	position: absolute;
	top: 10px;
	left: 12px;
	right: 12px;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .28);
	cursor: pointer;
	z-index: 3;
}
.ivw-progress-bar {
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--ivw-accent);
	transition: width .12s linear;
}

/* контролы */
.ivw-controls {
	position: absolute;
	top: 22px;
	right: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 4;
}
.ivw-ctrl {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: rgba(20, 22, 30, .55);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background .15s ease;
}
.ivw-ctrl:hover { background: rgba(20, 22, 30, .8); }

/* центральная кнопка play/pause */
.ivw-bigplay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 66px;
	height: 66px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, .4);
	color: #fff;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 4;
	backdrop-filter: blur(4px);
}
.ivw-root.ivw-paused .ivw-bigplay { display: flex; }

/* подпись поверх видео */
.ivw-caption {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 92px;
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
	z-index: 3;
	pointer-events: none;
}
.ivw-frame.ivw-has-cta .ivw-caption { bottom: 128px; }

/* кнопка действия */
.ivw-cta {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 52px;
	height: 46px;
	border-radius: 12px;
	background: var(--ivw-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
	z-index: 3;
	transition: filter .15s ease;
}
.ivw-cta:hover { filter: brightness(1.08); color: #fff; }

/* брендинг */
.ivw-brand {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 40px;
	background: rgba(8, 9, 14, .82);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
}
.ivw-brand-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: rgba(255, 255, 255, .82);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.ivw-brand-dot {
	width: 14px;
	height: 14px;
	border-radius: 4px;
	background: var(--ivw-accent);
	display: inline-block;
}

/* мобильные — плеер на весь экран */
@media (max-width: 480px) {
	.ivw-frame {
		width: 100vw;
		height: 100vh;
		max-height: none;
		border-radius: 0;
		aspect-ratio: auto;
	}
}

@keyframes ivw-bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}
@keyframes ivw-pulse {
	0% { opacity: .55; transform: scale(1); }
	100% { opacity: 0; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
	.ivw-bubble, .ivw-bubble-ring { animation: none; }
	.ivw-frame, .ivw-overlay { transition: none; }
}
