/* 캐릭터 반응 부품 — 2-H 몰입 (2026-10-07 · docs/PLAN-NEXT-STAGES-2026-10-07.md 5절 [4])
 * 짝 = js/char-talk.js. 근거 = ANALYSIS-UX-IMMERSION 3절 3 · 6절 / review-code C-03 · C-05 / review-pc P-06 · P-10 · P-31 / review-mobile-a MA-31.
 *
 * 말풍선은 중립(흰 바탕 · 옅은 테두리) — 캐릭터 색 정본(결정 2)이 아직 없어 캐릭터 색을 새로 쓰지 않는다.
 * 말풍선 · 겹층 단추 · '뿅' 입자는 모두 JS 가 만들고(data-bake-drop) absolute 로 얹는다 — 흔들림 0.
 * 움직임(튀어 오름 · 눌림 · 입자)은 JS 의 Web Animations 이고, 줄인 움직임 · html.lite 면 JS 가 아예 돌리지 않는다. */

/* ── 말풍선 ────────────────────────────────────────────────────────── */
.ct-bubble {
	position: absolute;
	z-index: 30;
	left: 0;
	top: 0;
	box-sizing: border-box;
	width: max-content;
	max-width: min(260px, calc(100vw - 32px));
	padding: 10px 14px 10px;
	border: 1.5px solid rgba(45, 42, 62, 0.12);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(45, 42, 62, 0.14);
	color: var(--wz-text-primary, #2d2a3e);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-align: start;
	white-space: normal;
	overflow-wrap: anywhere;
	opacity: 0;
	pointer-events: none;
	transform-origin: var(--ct-tail, 50%) 100%;
}
.ct-bubble[data-open],
.ct-bubble--sign {
	opacity: 1;
	pointer-events: auto;
}
/* 꼬리 — 말한 캐릭터 쪽을 가리킨다(--ct-tail = 왼쪽 끝에서 꼬리까지, JS 가 잰다) */
.ct-bubble::after {
	content: "";
	position: absolute;
	left: var(--ct-tail, 50%);
	bottom: -7px;
	width: 12px;
	height: 12px;
	margin-left: -6px;
	background: #fff;
	border-right: 1.5px solid rgba(45, 42, 62, 0.12);
	border-bottom: 1.5px solid rgba(45, 42, 62, 0.12);
	transform: rotate(45deg);
}
.ct-bubble[data-below] {
	transform-origin: var(--ct-tail, 50%) 0;
}
.ct-bubble[data-below]::after {
	top: -7px;
	bottom: auto;
	transform: rotate(225deg);
}
/* 닫힌 말풍선은 비어 있다(읽기 프로그램의 알림 자리만 남는다) — 꼬리도 안 보이게 */
.ct-bubble:not([data-open]):not(.ct-bubble--sign)::after {
	content: none;
}
.ct-bubble__name {
	display: block;
	margin-bottom: 2px;
	color: var(--wz-text-secondary, #6b6880);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.01em;
}
.ct-bubble__line {
	display: block;
}
.ct-bubble__more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 40px;
	margin-top: 2px;
	margin-bottom: -6px;
	color: var(--wz-purple-dark, #7e4fa6);
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
}
.ct-bubble__arrow {
	display: inline-block;
}
html[dir="rtl"] .ct-bubble__arrow {
	transform: scaleX(-1);
}
.ct-bubble__more:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ct-bubble__more:focus-visible {
	outline: 3px solid var(--wz-purple, #9e63cf);
	outline-offset: 2px;
	border-radius: 6px;
}
/* 혜택 구간의 서명 말풍선 — 늘 떠 있는 작은 판(누를 것 없음) */
.ct-bubble--sign {
	z-index: 2;
	max-width: min(220px, 70%);
	padding: 8px 12px;
	font-size: 14px;
	pointer-events: none;
}

/* ── '뿅' 입자 — 캐릭터 쪽 CharReveal 의 결(작은 빛 방울이 퍼졌다 사라짐) ── */
.ct-poof {
	position: absolute;
	z-index: 31;
	width: 0;
	height: 0;
	pointer-events: none;
}
.ct-poof > i {
	position: absolute;
	left: 0;
	top: 0;
	border-radius: 50%;
	opacity: 0;
}

/* ── 단체 그림 위 투명 단추 겹층(홈 히어로 · 홈 끝 CTA) ── */
.ct-stage,
.ct-sign {
	position: absolute;
	pointer-events: none;
}
.ct-stage {
	z-index: 3;
}
.ct-sign {
	z-index: 2;
}
.ct-stage__spot {
	position: absolute;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 42%;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
}
.ct-stage__spot:focus-visible {
	outline: 3px solid var(--wz-purple, #9e63cf);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.85);
}
@media (hover: hover) and (pointer: fine) {
	.ct-stage__spot:hover {
		background: radial-gradient(closest-side, rgba(158, 99, 207, 0.16), rgba(158, 99, 207, 0));
	}
}

/* ── <button data-char-talk> 로 바꾼 캐릭터 그림(점프 끝 CTA · 배웅 띠) — 단추 기본 꼴만 걷는다 ── */
button[data-char-talk]:not(.ct-stage__spot) {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
}
button[data-char-talk]:not(.ct-stage__spot):focus-visible {
	outline: 3px solid var(--wz-purple, #9e63cf);
	outline-offset: 4px;
	border-radius: 12px;
}
/* JS 가 없으면 눌러도 아무 일이 없다 — 누를 수 있는 척(손가락 커서)을 하지 않는다 */
html:not(.js) [data-char-talk] {
	cursor: default;
}

/* ── 쪽 끝 배웅 띠 (P-31) — 다섯 가족 + 그 쪽 단추 하나. 그림은 점프 끝 CTA 와 같은 파일 ── */
.ct-farewell {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	padding: 40px 16px 48px;
	text-align: center;
}
.ct-farewell__row {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: clamp(6px, 2.4vw, 24px);
	margin: 0;
	padding: 0;
}
.ct-farewell__char {
	display: flex;
	align-items: flex-end;
	cursor: pointer;
}
.ct-farewell__char img {
	display: block;
	width: auto;
	height: 84px;
	filter: drop-shadow(0 6px 14px rgba(158, 99, 207, 0.22));
	transition: translate 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ct-farewell__char--ppuri img {
	height: 96px;
}
.ct-farewell__char--halme img {
	height: 90px;
}
.ct-farewell__char--bobo img {
	height: 70px;
}
@media (max-width: 480px) {
	.ct-farewell__char img {
		height: 64px;
	}
	.ct-farewell__char--ppuri img {
		height: 74px;
	}
	.ct-farewell__char--halme img {
		height: 70px;
	}
	.ct-farewell__char--bobo img {
		height: 54px;
	}
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	:where(html:not(.lite)) .ct-farewell__char:hover img {
		translate: 0 -6px;
	}
}
@media (prefers-reduced-motion: no-preference) {
	:where(html:not(.lite)) .ct-farewell__char:active img {
		scale: 0.96;
	}
}
/* 쪽 안 단추 묶음 바로 위에 두는 꼴(소개 쪽) — 단추는 그 쪽 묶음이 맡는다 */
.ct-farewell--bare {
	padding: 24px 0 20px;
}
