/* KensScan FX. Accent colours can be re-themed with --ksfx-a / --ksfx-b in Additional CSS. */
:root { --ksfx-a: #38bdf8; --ksfx-b: #4f46e5; --ksfx-fire: #fb923c; }

/* ───────── canvases ───────── */
.ksfx-confetti, .ksfx-embers { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.ksfx-confetti { z-index: 100001; }
.ksfx-embers { z-index: 5; opacity: 0; transition: opacity 1.6s ease; mix-blend-mode: screen; }
.ksfx-embers.is-on { opacity: .9; }
.ksfx-flamebed {
	position: fixed; left: 0; right: 0; bottom: 0; height: 130px; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 2s ease;
	background:
		radial-gradient(60% 120% at 20% 120%, rgba(56, 189, 248, .34), transparent 70%),
		radial-gradient(50% 110% at 75% 125%, rgba(99, 102, 241, .32), transparent 70%),
		radial-gradient(35% 90% at 50% 130%, rgba(251, 146, 60, .16), transparent 70%);
	mix-blend-mode: screen; animation: ksfx-bed 5s ease-in-out infinite alternate;
}
.ksfx-flamebed.is-on { opacity: 1; }
@keyframes ksfx-bed { 0% { transform: scaleY(1); filter: hue-rotate(0deg); } 50% { transform: scaleY(1.25); } 100% { transform: scaleY(.9); filter: hue-rotate(-12deg); } }

/* ───────── logo: slow blue flame breathing ───────── */
.ksfx .site-logo .logo-img { animation: ksfx-logo 4.5s ease-in-out infinite; }
@keyframes ksfx-logo { 0%, 100% { filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0)); } 50% { filter: drop-shadow(0 0 10px rgba(56, 189, 248, .55)); } }

/* ───────── scroll reveal ───────── */
.ksfx-reveal .ksfx-rv { opacity: 0; transform: translateY(26px) scale(.97); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .9, .25, 1.05); }
.ksfx-reveal .ksfx-rv.is-in { opacity: 1; transform: none; }

/* ───────── card hover: lift, glow, zoom, shine ───────── */
.ksfx-hover .manga-item .manga-thumbnail, .ksfx-hover .related__thumb, .ksfx-hover .slider__thumb {
	position: relative; display: block; overflow: hidden; border-radius: 12px; isolation: isolate;
	transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), box-shadow .35s ease;
}
.ksfx-hover .manga-item .manga-thumbnail img, .ksfx-hover .related__thumb img, .ksfx-hover .slider__thumb img { transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .4s ease; }
.ksfx-hover .manga-item .manga-thumbnail::after, .ksfx-hover .related__thumb::after, .ksfx-hover .slider__thumb::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; z-index: 2; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent); transform: skewX(-18deg); opacity: 0;
}
@media (hover: hover) {
	.ksfx-hover .manga-item:hover .manga-thumbnail, .ksfx-hover .related__item:hover .related__thumb, .ksfx-hover .slider__item:hover .slider__thumb {
		transform: translateY(-6px);
		box-shadow: 0 0 0 1px rgba(125, 211, 252, .45), 0 18px 34px -14px rgba(56, 189, 248, .75), 0 6px 18px -8px rgba(0, 0, 0, .7);
	}
	.ksfx-hover .manga-item:hover .manga-thumbnail img, .ksfx-hover .related__item:hover .related__thumb img, .ksfx-hover .slider__item:hover .slider__thumb img { transform: scale(1.07); filter: saturate(1.15) brightness(1.05); }
	.ksfx-hover .manga-item:hover .manga-thumbnail::after, .ksfx-hover .related__item:hover .related__thumb::after, .ksfx-hover .slider__item:hover .slider__thumb::after { animation: ksfx-shine .8s ease forwards; }
	.ksfx-hover .manga-item:hover .manga-title a { color: var(--ksfx-a) !important; text-shadow: 0 0 18px rgba(56, 189, 248, .45); }
}
.ksfx-hover .manga-item .manga-title a { transition: color .25s ease, text-shadow .25s ease; }
@keyframes ksfx-shine { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }

/* ───────── headings: flickering flame underline ───────── */
.ksfx-headings .widget-title, .ksfx-headings .c-blog__heading h1, .ksfx-headings .c-blog__heading h2, .ksfx-headings .c-blog__heading .h4 {
	background-image: linear-gradient(90deg, var(--ksfx-fire), var(--ksfx-a) 35%, var(--ksfx-b) 70%, transparent);
	background-repeat: no-repeat; background-position: 0 100%; background-size: 64px 3px;
	padding-bottom: 8px; animation: ksfx-under 3.2s ease-in-out infinite;
}
@keyframes ksfx-under { 0%, 100% { background-size: 56px 3px; } 40% { background-size: 92px 3px; } 70% { background-size: 70px 3px; } }

/* ───────── read more ───────── */
.ksfx-rm { position: relative; }
.ksfx-rm__inner { overflow: hidden; transition: max-height .5s cubic-bezier(.3, .8, .3, 1); }
.ksfx-rm:not(.is-open) .ksfx-rm__inner { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.ksfx-rm__btn {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 14px 7px 16px; border: 0; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 13.5px; font-weight: 700; color: #bae6fd; background: rgba(56, 189, 248, .12);
	box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .3); transition: background .2s ease, transform .15s ease;
}
.ksfx-rm__btn:hover { background: rgba(56, 189, 248, .22); }
.ksfx-rm__btn svg { width: 16px; height: 16px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.ksfx-rm.is-open .ksfx-rm__btn svg { transform: rotate(180deg); }
.ksfx-rm:not(.is-open) .ksfx-rm__btn svg { animation: ksfx-nudge 2.4s ease-in-out infinite; }
@keyframes ksfx-nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(3px); } 90% { transform: translateY(0); } }

/* ───────── ripple ───────── */
.ksfx-ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .35); transform: scale(0); opacity: .9; animation: ksfx-ripple .6s ease-out forwards; }
@keyframes ksfx-ripple { to { transform: scale(1); opacity: 0; } }

/* ───────── celebration card ───────── */
.ksfx-cele { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; background: rgba(6, 4, 18, 0); transition: background .4s ease; cursor: pointer; }
.ksfx-cele.is-in { background: rgba(6, 4, 18, .55); }
.ksfx-cele__card {
	max-width: 380px; padding: 28px 26px 24px; border-radius: 22px; text-align: center; color: #ecebf3;
	background: radial-gradient(120% 80% at 50% 0%, rgba(56, 189, 248, .28), transparent 70%), #120e28;
	box-shadow: 0 0 0 1px rgba(125, 211, 252, .35), 0 30px 80px -20px rgba(56, 189, 248, .6);
	transform: scale(.7) translateY(20px); opacity: 0; transition: transform .55s cubic-bezier(.2, 1.6, .4, 1), opacity .3s ease;
}
.ksfx-cele.is-in .ksfx-cele__card { transform: none; opacity: 1; }
.ksfx-cele__icon { font-size: 46px; line-height: 1; margin-bottom: 10px; animation: ksfx-bob 1.6s ease-in-out infinite; }
.ksfx-cele__card strong { display: block; font-size: 24px; line-height: 1.2; background: linear-gradient(90deg, #e0f2fe, var(--ksfx-a), #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ksfx-cele__card p { margin: 8px 0 0; font-size: 14.5px; opacity: .85; line-height: 1.45; }
@keyframes ksfx-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

/* ───────── comment popup ───────── */
.ksfx-end { height: 1px; }
.ksfx-pop { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990; display: flex; justify-content: center; padding: 0 12px 14px; pointer-events: none; }
.ksfx-pop__card {
	position: relative; width: 100%; max-width: 460px; padding: 18px 18px 16px; border-radius: 20px; pointer-events: auto; color: #ecebf3;
	background: radial-gradient(120% 60% at 50% 0%, rgba(56, 189, 248, .2), transparent 70%), rgba(18, 14, 40, .97);
	box-shadow: 0 0 0 1px rgba(125, 211, 252, .28), 0 24px 60px -18px rgba(0, 0, 0, .9);
	transform: translateY(120%); transition: transform .55s cubic-bezier(.2, 1.3, .35, 1);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ksfx-pop.is-in .ksfx-pop__card { transform: none; }
.ksfx-pop__card.is-shake { animation: ksfx-shake .45s ease; }
@keyframes ksfx-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ksfx-pop__x { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1; opacity: .6; cursor: pointer; }
.ksfx-pop__x:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.ksfx-pop__spark { font-size: 26px; line-height: 1; animation: ksfx-bob 1.8s ease-in-out infinite; display: inline-block; }
.ksfx-pop__title { display: block; margin: 6px 34px 2px 0; font-size: 18px; line-height: 1.25; }
.ksfx-pop__text { margin: 0 0 10px; font-size: 13.5px; opacity: .78; }
.ksfx-pop__chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.ksfx-pop__chips::-webkit-scrollbar { display: none; }
.ksfx-chip {
	flex: none; padding: 6px 11px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
	color: #e0f2fe; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: background .2s, transform .15s;
}
.ksfx-chip:hover { background: rgba(56, 189, 248, .18); }
.ksfx-chip.is-picked { background: rgba(56, 189, 248, .28); box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .6); animation: ksfx-pop .3s ease; }
@keyframes ksfx-pop { 50% { transform: scale(1.08); } }
.ksfx-pop__guest { display: flex; gap: 8px; margin-bottom: 8px; }
.ksfx-pop__guest input, .ksfx-pop__ta {
	width: 100%; box-sizing: border-box; padding: 10px 12px; border: 0; border-radius: 12px; font: inherit; font-size: 14.5px; color: #ecebf3;
	background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); outline: none; transition: box-shadow .2s;
}
.ksfx-pop__ta { resize: vertical; min-height: 72px; display: block; }
.ksfx-pop__guest input:focus, .ksfx-pop__ta:focus { box-shadow: inset 0 0 0 1.5px var(--ksfx-a), 0 0 0 4px rgba(56, 189, 248, .15); }
.ksfx-pop__err { margin: 8px 0 0; color: #fca5a5; font-size: 13px; }
.ksfx-pop__row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.ksfx-pop__later { padding: 9px 12px; border: 0; background: transparent; color: inherit; opacity: .65; font: inherit; font-size: 14px; cursor: pointer; }
.ksfx-pop__later:hover { opacity: 1; }
.ksfx-pop__post {
	position: relative; overflow: hidden; display: inline-flex; align-items: center; padding: 10px 18px; border: 0; border-radius: 12px; cursor: pointer;
	font: inherit; font-size: 14.5px; font-weight: 800; color: #fff !important; text-decoration: none !important;
	background: linear-gradient(135deg, var(--ksfx-a), var(--ksfx-b)); box-shadow: 0 10px 24px -10px rgba(56, 189, 248, .9);
}
.ksfx-pop__post:disabled { opacity: .7; cursor: progress; }
.ksfx-pop__hint { margin: 8px 0 0; text-align: right; font-size: 12px; opacity: .6; }
.ksfx-pop__card.is-thanks { text-align: center; }
.ksfx-pop__thanks { padding: 10px 6px 6px; animation: ksfx-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.ksfx-pop__thanks strong { display: block; font-size: 19px; line-height: 1.25; }
.ksfx-pop__thanks p { margin: 6px 0 0; font-size: 13.5px; opacity: .75; }
.ksfx-pop__heart { font-size: 40px; line-height: 1; margin-bottom: 8px; animation: ksfx-beat 1s ease-in-out infinite; }
@keyframes ksfx-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }
@keyframes ksfx-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* ───────── Discord ───────── */
.ksfx-discord {
	position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	max-width: 760px; margin: 26px auto; padding: 16px 18px; border-radius: 18px; color: #ecebf3; box-sizing: border-box;
	background: radial-gradient(120% 120% at 0% 0%, rgba(88, 101, 242, .35), transparent 60%), rgba(255, 255, 255, .04);
	box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .35), 0 18px 40px -20px rgba(88, 101, 242, .8);
	overflow: hidden; isolation: isolate;
}
.ksfx-discord::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(165, 180, 252, .14) 45%, transparent 60%); background-size: 250% 100%; animation: ksfx-sheen 6s ease-in-out infinite; }
@keyframes ksfx-sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }
.ksfx-discord__orb { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #5865f2; color: #fff; overflow: hidden; animation: ksfx-float 3.5s ease-in-out infinite; box-shadow: 0 8px 20px -6px rgba(88, 101, 242, .9); }
.ksfx-discord__orb img { width: 100%; height: 100%; object-fit: cover; }
.ksfx-dlogo { width: 30px; height: 30px; }
@keyframes ksfx-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
.ksfx-discord__body { flex: 1 1 240px; min-width: 0; }
.ksfx-discord__title { display: block; font-size: 17px; line-height: 1.25; }
.ksfx-discord__text { margin: 3px 0 0; font-size: 13.5px; opacity: .78; line-height: 1.45; }
.ksfx-discord__stats { display: flex; gap: 14px; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; opacity: .9; }
.ksfx-discord__stats span { display: inline-flex; align-items: center; gap: 6px; }
.ksfx-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.ksfx-dot--on { background: #23a55a; box-shadow: 0 0 0 0 rgba(35, 165, 90, .6); animation: ksfx-live 2s ease-out infinite; }
@keyframes ksfx-live { 0% { box-shadow: 0 0 0 0 rgba(35, 165, 90, .6); } 100% { box-shadow: 0 0 0 8px rgba(35, 165, 90, 0); } }
.ksfx-discord__btn {
	position: relative; overflow: hidden; flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
	background: #5865f2; color: #fff !important; font-weight: 800; font-size: 14.5px; text-decoration: none !important;
	box-shadow: 0 10px 24px -10px rgba(88, 101, 242, 1); transition: transform .15s ease, background .2s ease;
}
.ksfx-discord__btn:hover { background: #4752c4; transform: translateY(-1px); }
.ksfx-discord__btn .ksfx-dlogo { width: 20px; height: 20px; }
.ksfx-discord__x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; line-height: 1; opacity: .6; cursor: pointer; }
.ksfx-dtoast { position: fixed; left: 14px; bottom: 14px; z-index: 99980; width: min(380px, calc(100vw - 28px)); transform: translateX(-120%); transition: transform .6s cubic-bezier(.2, 1.3, .35, 1); }
.ksfx-dtoast.is-in { transform: none; }
.ksfx-dtoast .ksfx-discord { margin: 0; padding: 14px 14px 14px 14px; background: radial-gradient(120% 120% at 0% 0%, rgba(88, 101, 242, .45), transparent 60%), rgba(18, 14, 40, .97); }
.ksfx-dtoast .ksfx-discord__body { flex-basis: 180px; padding-right: 18px; }
.ksfx-dtoast .ksfx-discord__btn { width: 100%; justify-content: center; }
.ksfx-dtoast .ksfx-discord__orb { width: 46px; height: 46px; border-radius: 14px; }

@media (max-width: 560px) {
	.ksfx-discord { margin: 20px 12px; }
	.ksfx-discord__btn { width: 100%; justify-content: center; }
	.ksfx-pop__guest { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	[class*="ksfx-"], [class*="ksfx-"]::before, [class*="ksfx-"]::after, .ksfx .site-logo .logo-img { animation: none !important; }
	.ksfx-embers, .ksfx-flamebed { display: none !important; }
	.ksfx-reveal .ksfx-rv { opacity: 1; transform: none; }
}
