/* 買取!カーマッチ キャラクター演出（みゆちゃん・買取カーマッチマン）
   既存デザインの上に重ねる装飾レイヤー。class は kcx- で統一。 */

:root {
	--kcx-red: #e00000;
	--kcx-yellow: #ffd400;
	--kcx-cream: #fff8e4;
	--kcx-ink: #111111;
}

@keyframes kcx-bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-7px); }
}

@keyframes kcx-pop {
	0% { transform: scale(0.94); }
	60% { transform: scale(1.03); }
	100% { transform: scale(1); }
}

.kcx-fig {
	display: block;
	height: auto;
	animation: kcx-bob 3.6s ease-in-out infinite;
	filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.16));
}

.kcx-fig--slow { animation-duration: 4.6s; }
.kcx-fig--delay { animation-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
	.kcx-fig { animation: none; }
}

/* ---- 吹き出し ---- */
.kcx-bubble {
	position: relative;
	background: #fff;
	border: 3px solid var(--kcx-red);
	border-radius: 18px;
	padding: 14px 20px;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.7;
	color: var(--kcx-ink);
	box-shadow: 0 6px 0 rgba(224, 0, 0, 0.14);
	max-width: 30em;
}

.kcx-bubble b { color: var(--kcx-red); }
.kcx-bubble small {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #666;
	margin-top: 4px;
}

.kcx-bubble::before,
.kcx-bubble::after {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
}

.kcx-bubble--left::before {
	left: -18px;
	top: 26px;
	border-width: 9px 18px 9px 0;
	border-color: transparent var(--kcx-red) transparent transparent;
}
.kcx-bubble--left::after {
	left: -13px;
	top: 26px;
	border-width: 9px 14px 9px 0;
	border-color: transparent #fff transparent transparent;
}

.kcx-bubble--right::before {
	right: -18px;
	top: 26px;
	border-width: 9px 0 9px 18px;
	border-color: transparent transparent transparent var(--kcx-red);
}
.kcx-bubble--right::after {
	right: -13px;
	top: 26px;
	border-width: 9px 0 9px 14px;
	border-color: transparent transparent transparent #fff;
}

.kcx-bubble--down::before {
	bottom: -18px;
	left: 40px;
	border-width: 18px 9px 0 9px;
	border-color: var(--kcx-red) transparent transparent transparent;
}
.kcx-bubble--down::after {
	bottom: -13px;
	left: 45px;
	border-width: 14px 9px 0 9px;
	border-color: #fff transparent transparent transparent;
}

/* ---- ヒーロー直下のあいさつ帯 ---- */
.kcx-band {
	position: relative;
	overflow: hidden;
	background:
		repeating-linear-gradient(-45deg, rgba(255, 212, 0, 0.35) 0 14px, rgba(255, 255, 255, 0) 14px 28px),
		var(--kcx-cream);
	border-top: 4px solid var(--kcx-red);
	border-bottom: 4px solid var(--kcx-red);
	padding: 26px 16px;
}

.kcx-band__inner {
	max-width: 1120px;
	margin: 0 auto;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 18px;
}

.kcx-band__talk {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-bottom: 12px;
	min-width: 0;
}

.kcx-name {
	display: table;
	background: var(--kcx-red);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border-radius: 999px;
	padding: 3px 12px;
	margin-bottom: 6px;
}

.kcx-band__miyu { width: 165px; height: auto; flex: 0 0 auto; }
.kcx-band__kc { width: 132px; flex: 0 0 auto; }

/* Keep the two greeting characters still on every screen size. */
.kcx-band .kcx-fig { animation: none; }

/* ---- 見出しのまるバッジ ---- */
.kcx-badge {
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: var(--kcx-yellow);
	border: 3px solid var(--kcx-red);
	overflow: hidden;
	animation: kcx-pop 0.5s ease-out both;
}

.kcx-badge img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 42%;
	display: block;
}

.kdr-section-heading .kcx-badge { margin-left: 0; }

/* ---- セクションから覗くキャラ ---- */
.kcx-peek {
	position: absolute;
	left: 14px;
	top: 14px;
	width: 116px;
	z-index: 2;
	pointer-events: none;
}

.kcx-host { position: relative; }

@media (max-width: 1180px) {
	.kcx-peek { display: none; }
}

/* ---- 見出し下の掛け合いブロック ---- */
.kcx-talkrow {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 16px;
	margin: 0 0 28px;
}

.kcx-talkrow .kcx-fig { width: 132px; flex: 0 0 auto; }
.kcx-talkrow .kcx-bubble { margin-bottom: 18px; }

/* ---- 買取の流れ ---- */
.kcx-step {
	display: block;
	width: 76px;
	margin: 18px auto 0;
	pointer-events: none;
}

/* ---- CTA帯 ---- */
.kcx-cta-guide {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 16px;
	margin-top: 26px;
}

.kcx-cta-guide .kcx-fig { width: 200px; flex: 0 0 auto; animation: none; }
.kcx-cta-guide .kcx-bubble { margin-bottom: 16px; }

/* ---- ページ上部へ戻る（キャラクター） ---- */
.kcx-totop {
	position: fixed;
	right: 18px;
	bottom: 24px;
	z-index: 90;
	width: 86px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.kcx-totop.is-on {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.kcx-totop img {
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
	animation: kcx-bob 3.2s ease-in-out infinite;
}

.kcx-totop__label {
	display: block;
	background: var(--kcx-red);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	padding: 6px 14px;
	border-radius: 999px;
	border: 2px solid #fff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.kcx-totop__label::before {
	content: "▲";
	font-size: 9px;
	margin-right: 4px;
	vertical-align: 1px;
}

.kcx-totop:hover img { transform: translateY(-4px); }
.kcx-totop:focus-visible { outline: 3px solid var(--kcx-red); outline-offset: 4px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
	.kcx-totop img { animation: none; }
	.kcx-totop { transition: none; }
}

/* ---- スマホ固定バーの顔 ---- */
.ap-mobile-cta { position: fixed; }

.kcx-mobile-face {
	position: absolute;
	top: -36px;
	left: 12px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--kcx-yellow);
	border: 3px solid var(--kcx-red);
	overflow: hidden;
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
	z-index: 1;
	pointer-events: none;
}

.kcx-mobile-face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 42%;
	display: block;
}

/* ---- スマートフォン ---- */
@media (max-width: 767px) {
	.kcx-band { padding: 20px 12px; }
	.kcx-band__inner {
		display: grid;
		grid-template-columns: 106px 1fr;
		grid-template-areas: "miyu talk" "kc talk";
		align-items: center;
		gap: 10px 12px;
	}
	.kcx-band__miyu { grid-area: miyu; width: 102px; height: auto; }
	.kcx-band__kc { grid-area: kc; width: 86px; justify-self: center; }
	.kcx-band__talk { grid-area: talk; padding-bottom: 0; gap: 10px; }
	.kcx-bubble { font-size: 14px; padding: 11px 14px; border-width: 2px; border-radius: 14px; }
	.kcx-bubble--left::before, .kcx-bubble--left::after,
	.kcx-bubble--right::before, .kcx-bubble--right::after { top: 18px; }

	/* 帯はキャラが左に並ぶので、しっぽも左向きにそろえる */
	.kcx-band .kcx-bubble--right::before {
		right: auto;
		left: -16px;
		border-width: 8px 16px 8px 0;
		border-color: transparent var(--kcx-red) transparent transparent;
	}
	.kcx-band .kcx-bubble--right::after {
		right: auto;
		left: -11px;
		border-width: 8px 12px 8px 0;
		border-color: transparent #fff transparent transparent;
	}

	.kcx-badge { width: 54px; height: 54px; }

	.kcx-talkrow { gap: 10px; margin-bottom: 20px; }
	.kcx-talkrow .kcx-fig { width: 92px; }
	.kcx-talkrow .kcx-bubble { margin-bottom: 10px; }

	.kcx-step { width: 64px; margin-top: 14px; }

	.kcx-cta-guide {
		display: grid;
		grid-template-columns: 1fr;
		grid-template-areas: "bubble" "miyu";
		justify-items: center;
		align-items: end;
		gap: 0;
		margin-top: 20px;
	}
	.kcx-cta-guide > :nth-child(1) { grid-area: miyu; }
	.kcx-cta-guide > :nth-child(2) { grid-area: bubble; }
	.kcx-cta-guide .kcx-fig { width: 180px; max-width: 100%; }
	.kcx-cta-guide .kcx-bubble { margin-bottom: 16px; max-width: 100%; }
	.kcx-cta-guide .kcx-bubble::before {
		top: auto; bottom: -18px; left: calc(50% - 9px);
		border-width: 18px 9px 0; border-color: var(--kcx-red) transparent transparent;
	}
	.kcx-cta-guide .kcx-bubble::after {
		top: auto; bottom: -13px; left: calc(50% - 9px);
		border-width: 14px 9px 0; border-color: #fff transparent transparent;
	}

	.kcx-mobile-face { width: 48px; height: 48px; top: -46px; left: 10px; }

	/* スマホ固定CTAの上に出す */
	.kcx-totop { width: 66px; right: 10px; bottom: 82px; }
	.kcx-totop__label { font-size: 11px; padding: 5px 11px; }
}

/* Static alternating characters replace the process pictograms. */
.kdr-home #kdr-flow .kcx-step{width:112px;height:132px;object-fit:contain;margin:0 auto 20px;animation:none;transition:none}
