/**
 * UI app-like — solo html.ci-pwa-standalone (PWA / icona home).
 * Safari e browser normali: invisibile.
 */

:root {
	--ci-pwa-bg: #0c0c0c;
	--ci-pwa-surface: #121212;
	--ci-pwa-border: rgba(255, 255, 255, 0.08);
	--ci-pwa-accent: #6710c2;
	--ci-pwa-accent-soft: rgba(103, 16, 194, 0.22);
	--ci-pwa-text: #ffffff;
	--ci-pwa-muted: rgba(255, 255, 255, 0.62);
	--ci-pwa-tabbar-h: 64px;
}

.ci-pwa-topbar,
.ci-pwa-tabbar {
	display: none;
}

html.ci-pwa-standalone {
	-webkit-text-size-adjust: 100%;
}

html.ci-pwa-standalone body {
	background: var(--ci-pwa-bg);
	color: var(--ci-pwa-text);
	padding-top: calc(56px + env(safe-area-inset-top, 0px));
	padding-bottom: calc(var(--ci-pwa-tabbar-h) + env(safe-area-inset-bottom, 0px));
}

html.ci-pwa-standalone .jws_header,
html.ci-pwa-standalone .elementor-location-header,
html.ci-pwa-standalone header.site-header,
html.ci-pwa-standalone .site-footer,
html.ci-pwa-standalone footer.site-footer,
html.ci-pwa-standalone .jws-footer,
html.ci-pwa-standalone .jws-toolbar-wap,
html.ci-pwa-standalone #install-bar,
html.ci-pwa-standalone .jws_back_to_top,
html.ci-pwa-standalone #back-to-top {
	display: none !important;
}

html.ci-pwa-standalone .ci-pwa-topbar,
html.ci-pwa-standalone .ci-pwa-tabbar {
	display: block;
}

html.ci-pwa-standalone .ci-pwa-tabbar {
	display: flex;
}

html.ci-pwa-standalone .ci-pwa-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2147483000;
	padding-top: env(safe-area-inset-top, 0px);
	background: var(--ci-pwa-surface);
	border-bottom: 1px solid var(--ci-pwa-border);
}

html.ci-pwa-standalone .ci-pwa-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	padding: 8px 16px;
}

html.ci-pwa-standalone .ci-pwa-topbar-kicker {
	display: block;
	font-size: 11px;
	line-height: 1.2;
	color: var(--ci-pwa-muted);
}

html.ci-pwa-standalone .ci-pwa-topbar-title {
	display: block;
	font-size: 16px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--ci-pwa-text);
	max-width: 58vw;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html.ci-pwa-standalone .ci-pwa-topbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

html.ci-pwa-standalone .ci-pwa-topbar-login {
	border: 1px solid var(--ci-pwa-accent);
	background: var(--ci-pwa-accent-soft);
	color: var(--ci-pwa-text);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	padding: 8px 12px;
}

html.ci-pwa-standalone .ci-pwa-topbar-badge {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #3ecf8e;
	border: 2px solid var(--ci-pwa-surface);
}

html.ci-pwa-standalone .ci-pwa-topbar-logo {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	object-fit: cover;
}

html.ci-pwa-standalone .ci-pwa-tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2147483000;
	align-items: stretch;
	justify-content: space-around;
	min-height: var(--ci-pwa-tabbar-h);
	padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px));
	background: rgba(18, 18, 18, 0.98);
	border-top: 1px solid var(--ci-pwa-border);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

html.ci-pwa-standalone .ci-pwa-tabbar-item {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none;
	color: var(--ci-pwa-muted);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.1;
	padding: 4px 4px;
	border-radius: 12px;
	min-width: 0;
}

html.ci-pwa-standalone .ci-pwa-tabbar-item.is-active {
	color: var(--ci-pwa-text);
	background: var(--ci-pwa-accent-soft);
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon {
	width: 22px;
	height: 22px;
	background-color: currentColor;
	opacity: 0.88;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	-webkit-mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	mask-size: contain;
}

html.ci-pwa-standalone .ci-pwa-tabbar-item.is-active .ci-pwa-tabbar-icon {
	opacity: 1;
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon-home {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6h-4v6H5a1 1 0 0 1-1-1v-9.5Z' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6h-4v6H5a1 1 0 0 1-1-1v-9.5Z' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon-episodes,
html.ci-pwa-standalone .ci-pwa-tabbar-icon-streaming {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='14' rx='2' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m10 9.5 5 2.5-5 2.5v-5Z' fill='black'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='14' rx='2' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m10 9.5 5 2.5-5 2.5v-5Z' fill='black'/%3E%3C/svg%3E");
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon-search {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='6' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m16.5 16.5 4 4' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='6' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m16.5 16.5 4 4' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon-pulse {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 12h3l2-6 4 12 2-6h5' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 12h3l2-6 4 12 2-6h5' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html.ci-pwa-standalone .ci-pwa-tabbar-icon-profile {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='8' r='3.5' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5 20c1.8-3.5 4.6-5 7-5s5.2 1.5 7 5' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='8' r='3.5' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5 20c1.8-3.5 4.6-5 7-5s5.2 1.5 7 5' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

html.ci-pwa-standalone body.ci-pulse-standalone-page {
	padding-top: 0;
}

html.ci-pwa-standalone body.ci-pulse-standalone-page .ci-pwa-topbar {
	display: none;
}

html.ci-pwa-standalone .jws-form-login-popup {
	z-index: 2147483600;
}

html.ci-pwa-standalone.home body {
	padding-top: env(safe-area-inset-top, 0px);
}

html.ci-pwa-standalone .ci-pwa-search-panel {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2147483200;
	background: rgba(0, 0, 0, 0.72);
	padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 16px;
}

html.ci-pwa-standalone .ci-pwa-search-panel:not([hidden]) {
	display: block;
}

html.ci-pwa-standalone .ci-pwa-search-panel form {
	display: flex;
	gap: 8px;
}

html.ci-pwa-standalone .ci-pwa-search-panel input {
	flex: 1;
	border: 1px solid var(--ci-pwa-border);
	background: var(--ci-pwa-surface);
	color: var(--ci-pwa-text);
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 16px;
}

html.ci-pwa-standalone .ci-pwa-search-panel button {
	border: 0;
	border-radius: 12px;
	background: var(--ci-pwa-accent);
	color: #fff;
	padding: 0 16px;
	font-weight: 700;
}

html.ci-pwa-standalone.ci-pwa-navigating .ci-pwa-tabbar {
	opacity: 0.72;
	pointer-events: none;
}

html.ci-pwa-standalone.ci-pwa-navigating::before {
	content: '';
	position: fixed;
	top: env(safe-area-inset-top, 0px);
	left: 0;
	right: 0;
	height: 2px;
	z-index: 2147483100;
	background: var(--ci-pwa-accent);
	transform-origin: left center;
	animation: ci-pwa-nav-progress 1.1s ease-in-out infinite;
}

@keyframes ci-pwa-nav-progress {
	0% {
		transform: scaleX(0.08);
		opacity: 0.55;
	}

	50% {
		transform: scaleX(0.72);
		opacity: 1;
	}

	100% {
		transform: scaleX(0.95);
		opacity: 0.75;
	}
}
