body {
	margin: 0;
	padding: 20px;
	text-align: center;
	font-family: system-ui, sans-serif;
	background: #fff4e6;
	color: #3b2f2a;
	user-select: none;
}

h1 {
	margin: 0 0 6px;
}

.hint {
	margin: 0 0 12px;
	opacity: 0.75;
}

/* ===== 도구 선택 ===== */
#tools {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 14px;
}

.tool {
	padding: 8px 14px;
	border: 2px solid #3b2f2a33;
	border-radius: 99px;
	background: #fff;
	font-size: 15px;
	cursor: pointer;
}

.tool.selected {
	border-color: #3b2f2a;
	background: #3b2f2a;
	color: #fff;
}

/* ===== 만족도 게이지 ===== */
.gauge {
	width: min(400px, 90vw);
	height: 14px;
	margin: 0 auto;
	background: #00000014;
	border-radius: 99px;
	overflow: hidden;
}

#gaugeFill {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, #ffd36e, #f28db2);
	transition: width 0.15s;
}

#gaugeText {
	margin: 6px 0 4px;
	font-weight: 600;
}

/* ===== 무대 ===== */
#stage {
	position: relative;
	width: min(560px, 95vw);
	margin: 0 auto;
	touch-action: none; /* 폰에서 쓰다듬을 때 화면이 스크롤되지 않게 */
}

#cat {
	width: 100%;
	display: block;
	cursor: none; /* 기본 마우스 대신 도구 아이콘을 보여줌 */
}

/* 마우스를 따라다니는 도구 아이콘 */
#cursor {
	position: absolute;
	left: 0;
	top: 0;
	font-size: 40px;
	transform: translate(-30%, -70%);
	pointer-events: none;
	opacity: 0;
}

.deco,
.outline {
	pointer-events: none;
}

/* ===== 효과: 떠오르는 글자 ===== */
.float {
	position: absolute;
	transform: translate(-50%, -50%);
	pointer-events: none;
	font-weight: 800;
	animation: rise 1.2s ease-out forwards;
}

.purr {
	color: #e0679a;
	font-size: 22px;
	font-style: italic;
}

.punch {
	font-size: 56px;
	animation: punch 0.6s ease-out forwards;
}

.hint-text {
	font-size: 15px;
	color: #3b2f2a;
	background: #fff;
	padding: 4px 10px;
	border-radius: 99px;
	white-space: nowrap;
}

/* ===== 효과: 빠지는 털 ===== */
.fur {
	position: absolute;
	width: 14px;
	height: 8px;
	border-top: 3px solid;
	border-radius: 50%;
	pointer-events: none;
	animation: fall 1.5s ease-in forwards;
}

@keyframes fall {
	from { transform: translateY(0) rotate(0deg); opacity: 1; }
	to   { transform: translateY(90px) rotate(var(--spin)); opacity: 0; }
}

@keyframes rise {
	to { transform: translate(-50%, -160%); opacity: 0; }
}

@keyframes punch {
	0%   { transform: translate(-50%, -50%) scale(0.3); }
	40%  { transform: translate(-50%, -50%) scale(1.4); }
	100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===== 효과: 화면 흔들림 ===== */
.shake {
	animation: shake 0.4s;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-12px); }
	50% { transform: translateX(10px); }
	75% { transform: translateX(-6px); }
}

/* ===== 효과: 잠들기 ===== */
#zzz {
	display: none;
	position: absolute;
	left: 36%;
	top: 22%;
	font-size: 34px;
	font-weight: 800;
	color: #6b7fd7;
	pointer-events: none;
}

.asleep #zzz {
	display: block;
	animation: zzz 2s ease-in-out infinite;
}

.asleep #cat {
	filter: brightness(0.9);
}

/* 평소: 뜬 눈 + 세운 꼬리 / 잠들면: 감은 눈 + 말린 꼬리 */
#eyesClosed,
#tailSleep {
	display: none;
}

.asleep #eyesOpen,
.asleep #tail {
	display: none;
}

.asleep #eyesClosed,
.asleep #tailSleep {
	display: inline;
}

/* 잠들면 머리를 숙여 웅크림: 목(180, 210)을 축으로 아래로 내리고 살짝 기울임 */
#head {
	transform-origin: 180px 210px;
	transition: transform 0.8s ease;
}

.asleep #head {
	transform: translate(12px, 38px) rotate(-12deg);
}

@keyframes zzz {
	0%   { opacity: 0; transform: translate(0, 10px); }
	40%  { opacity: 1; }
	100% { opacity: 0; transform: translate(20px, -30px); }
}

#restart {
	display: none;
	margin-top: 12px;
	padding: 10px 20px;
	border: none;
	border-radius: 99px;
	background: #3b2f2a;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}
