.fcv-root {
	pointer-events: none;
}

.fcv-float {
	pointer-events: auto;
	position: fixed;
	box-sizing: border-box;
	z-index: 99990;
}

.fcv-float--br {
	right: var(--fcv-off-x, 16px);
	bottom: calc(var(--fcv-off-y, 16px) + env(safe-area-inset-bottom, 0px));
}

.fcv-float--bl {
	left: var(--fcv-off-x, 16px);
	bottom: calc(var(--fcv-off-y, 16px) + env(safe-area-inset-bottom, 0px));
}

/* PC 想定で画面下端の中央（余白 X は左右の微調整 px） */
.fcv-float--bc {
	left: 50%;
	bottom: calc(var(--fcv-off-y, 16px) + env(safe-area-inset-bottom, 0px));
	/* translateX より 3d の方が一部環境でサブピクセルにじみが出にくい */
	transform: translate3d(calc(-50% + var(--fcv-off-x, 0px)), 0, 0);
}

.fcv-float--tr {
	right: var(--fcv-off-x, 16px);
	top: var(--fcv-off-y, 16px);
}

.fcv-float--tl {
	left: var(--fcv-off-x, 16px);
	top: var(--fcv-off-y, 16px);
}

.fcv-float__inner {
	display: inline-block;
	/* translate3d(0,0,0) は合成レイヤを強制し、子の img の縮小表示がにじむことがあるため付けない */
}

.fcv-float__link {
	display: block;
	position: relative;
	line-height: 0;
	border-radius: 0;
	overflow: visible;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
	isolation: isolate;
	box-sizing: border-box;
	/* 管理画面の幅は「上限」。ビューポートに追従して縮み、左右に最低限の余白を残す */
	width: max(48px, min(var(--fcv-w, 220px), calc(100vw - 32px)));
}

.fcv-float__link[href=""],
.fcv-float__link:not([href]) {
	cursor: default;
}

.fcv-float__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.fcv--pukapuka .fcv-float__inner {
	animation-name: fcv-pukapuka;
	animation-duration: var(--fcv-puka-dur, 2.5s);
	animation-timing-function: ease-in-out;
	animation-iteration-count: infinite;
	animation-direction: alternate;
}

@keyframes fcv-pukapuka {
	from {
		transform: translate3d(0, var(--fcv-puka-dist, -10px), 0);
	}
	to {
		transform: translate3d(0, 0, 0);
	}
}

.fcv-sparkle-layer {
	position: absolute;
	inset: -10%;
	pointer-events: none;
	overflow: visible;
}

/* きらりん：少数の十字が短く点滅（玉／カビ状の発光は使わない） */
.fcv-sparkle {
	position: absolute;
	width: 12px;
	height: 12px;
	margin-left: -6px;
	margin-top: -6px;
	pointer-events: none;
	opacity: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
	animation: fcv-kirarin 2.8s ease-in-out infinite;
}

.fcv-sparkle::before,
.fcv-sparkle::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 1.5px;
	height: 12px;
	margin-left: -0.75px;
	margin-top: -6px;
	border-radius: 1px;
	background: linear-gradient(
		to bottom,
		transparent 0%,
		rgba(255, 255, 255, 0.92) 32%,
		var(--fcv-kira, #ffd700) 52%,
		transparent 100%
	);
	transform-origin: center center;
}

.fcv-sparkle::after {
	transform: rotate(90deg);
}

@keyframes fcv-kirarin {
	0%,
	7%,
	100% {
		opacity: 0;
		transform: scale(0.12) rotate(0deg);
	}
	10% {
		opacity: 1;
		transform: scale(1) rotate(10deg);
	}
	14% {
		opacity: 0.75;
		transform: scale(0.88) rotate(-6deg);
	}
	20% {
		opacity: 0;
		transform: scale(0.25) rotate(0deg);
	}
}

.fcv-popup-overlay {
	pointer-events: auto;
	position: fixed;
	inset: 0;
	background: rgba(15, 18, 28, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.fcv-popup {
	pointer-events: auto;
	position: relative;
	max-width: min(560px, calc(100vw - 32px));
	width: 100%;
	background: #fff;
	border-radius: 0;
	padding: 1.25rem 1.35rem 1.5rem;
	padding-top: calc(1.25rem + var(--fcv-close-hit, 44px) * 0.15);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
}

.fcv-popup--pukapuka .fcv-popup__motion {
	animation-name: fcv-pukapuka;
	animation-duration: var(--fcv-puka-dur, 2.5s);
	animation-timing-function: ease-in-out;
	animation-iteration-count: infinite;
	animation-direction: alternate;
}

.fcv-popup__title {
	margin: 0 0 0.5rem;
	padding-right: calc(var(--fcv-close-hit, 44px) + 4px);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
}

.fcv-popup__title a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fcv-popup__title a:hover {
	opacity: 0.85;
}

.fcv-popup__body {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	line-height: 1.6;
}

.fcv-popup__body p:first-child {
	margin-top: 0;
}

.fcv-popup__img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 0 0.75rem;
	border-radius: 0;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.fcv-popup__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
}

.fcv-popup__cta {
	display: inline-block;
	padding: 0.45em 1em;
	background: #ff6b2c;
	color: #fff !important;
	border-radius: 0;
	text-decoration: none;
	font-weight: 700;
	border: none;
	cursor: pointer;
	font-size: 0.95rem;
}

.fcv-popup__close-text {
	background: transparent;
	border: 0;
	color: #555;
	cursor: pointer;
	font-size: 0.9rem;
	text-decoration: underline;
	padding: 0.35em 0.5em;
}

.fcv-popup__x {
	position: absolute;
	top: var(--fcv-close-top, 8px);
	right: var(--fcv-close-right, 8px);
	width: var(--fcv-close-hit, 44px);
	height: var(--fcv-close-hit, 44px);
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	box-sizing: border-box;
}

.fcv-popup__x:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fcv-popup__x-icon {
	position: relative;
	width: var(--fcv-close-icon, 20px);
	height: var(--fcv-close-icon, 20px);
	flex-shrink: 0;
}

.fcv-popup__x-icon::before,
.fcv-popup__x-icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	height: var(--fcv-close-stroke, 2px);
	background: var(--fcv-close-color, #333);
	border-radius: 1px;
	transform-origin: center;
}

.fcv-popup__x-icon::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.fcv-popup__x-icon::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.fcv-popup__motion {
	position: relative;
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.fcv--pukapuka .fcv-float__inner,
	.fcv-popup--pukapuka .fcv-popup__motion {
		animation: none !important;
	}

	.fcv-sparkle {
		animation: none !important;
		opacity: 0 !important;
	}
}
