html,body{height:auto;margin:0;background:transparent;overflow:visible}

#stage{
  position:fixed;
  inset:0;
  width:auto;
  height:auto;
  pointer-events:none;
}

.pet{
	position:fixed;
	left:0;
	top:0;
	user-select:none;
	cursor:grab;
	display:flex;
	align-items:flex-end;
	justify-content:center;
	pointer-events:auto
}
.pet:active{
	cursor:grabbing;
}
.pet img{
	display:block;
	max-width:none;
	image-rendering:auto;
}
.pet.sleep{
	filter:grayscale(.2) brightness(.92);
}
.pet.flip{
	transform:scaleX(-1);
}

.bubble{
	position:absolute;
	bottom:110%;
	left:50%;
	transform:translateX(-50%);
	padding:10px 12px;
	border-radius:14px;
	border:1px solid;
	font:600 14px/1.4 ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial;
	opacity:0;
	white-space:pre-line;
	max-width:200px;
	min-width:150px;
	text-align:center;
	pointer-events:none;
}
.bubble.show{
	opacity:1;
	transition:opacity .18s ease-in-out;
}

.pet.vuong .bubble{
	background:#e8f6ec;
	color:#0d3d1f;
	border-color:#a9d7b7;
}
.pet.ga .bubble{
	background:#f2f2f2;
	color:#1f1f1f;
	border-color:#c9c9c9;
}
.pet.du .bubble{
	background:#eaf2ff;
	color:#0d2e5c;
	border-color:#a7c1ea;
}

.ctx{
	padding:4px;
	position:fixed;
	background:#0f1220;
	color:#e9edf7;
	border:1px solid #2a3142;
	border-radius:10px;
	padding:10px;
	min-width:150px;
	max-width:180px;
	width:max-content;
	z-index:99999;
	gap:5px;
}

.ctx button{
	display:block;
	width:100%;
	text-align:left;
	background:transparent;
	border:0;
	padding:5px 5px;
	color:inherit;
	font:600 13px/1.35 ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial;
	white-space:normal;
	word-break:break-word;
	border-radius:9px;
	touch-action:manipulation;
}
.ctx button:hover{
	background:#161b2a;
}
.ctx input{
	display:block;
	width:95%;
	box-sizing:border-box;
	margin:3px;
	padding:3px;
	border-radius:5px;
	border:1px solid #3a4157;
	background:#0a0d18;
	color:#e9edf7;
	outline:none;
	font:600 13px/1.3 ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial;
}

.ctx.vuong{
	background:#2f7e38;
	color:#e7f4ea;
	border-color:#204a2f;
}
.ctx.vuong button:hover{background:#326c38}

.ctx.ga{
	background:#121418;
	color:#e6e7eb;
	border-color:#2a2f3a;
}
.ctx.ga button:hover{background:#1a1d25}

.ctx.du{
	background:#18427a;
	color:#e9f1ff;
	border-color:#0f2b52;
}
.ctx.du button:hover{background:#183a6b}

#yt-player{
	position:fixed;
	right:16px;
	bottom:16px;
	width:360px;
	height:202px;
	background:#000;
	border-radius:12px;
	overflow:hidden;
	z-index:99999;
	border:1px solid #2a3142;
}
#yt-player iframe{
	width:100%;
	height:100%;
}
#yt-player #yt-close{
	position:absolute;
	top:6px;
	right:8px;
	border:0;
	background:#000;
	color:#fff;
	width:28px;
	height:28px;
	border-radius:50%;
	font:700 16px/28px ui-sans-serif,system-ui;
	cursor:pointer;
}

#mini-player{position:fixed;right:20px;bottom:20px;width:380px;padding:12px 14px;border-radius:18px;box-shadow:0 12px 34px rgba(2,6,23,.6);z-index:120000;font:14px/1.35 ui-sans-serif,system-ui;backdrop-filter:blur(8px);background:linear-gradient(135deg,var(--mp-bg1),var(--mp-bg2));color:var(--mp-fg)}
#mini-player .mp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
#mini-player .mp-title{display:flex;flex-direction:column;gap:2px}
#mini-player .mp-title b{font-size:15px;color:#fff;letter-spacing:.2px}
#mini-player .mp-title .mp-artist{font-size:12px;color:var(--mp-sub)}
#mini-player #mp-close{width:28px;height:28px;border-radius:8px;border:0;background:rgba(255,255,255,.06);color:#fff;cursor:pointer}
#mini-player .mp-row{display:flex;align-items:center;justify-content:space-between;width:100%}
#mini-player .mp-progress{padding:4px 2px 8px}
#mini-player .mp-controls{margin-top:10px;gap:10px}
#mini-player .mp-time{font-size:12px;color:var(--mp-sub);width:48px;text-align:center}
#mini-player .mp-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;background:rgba(255,255,255,.06);border:0;color:#fff;cursor:pointer;transition:transform .12s ease,background .12s}
#mini-player .mp-btn:hover{transform:translateY(-2px);background:rgba(255,255,255,.12)}
#mini-player .mp-btn.play{width:54px;height:54px;border-radius:14px;background:linear-gradient(180deg,var(--mp-ac1),var(--mp-ac2));box-shadow:0 8px 22px var(--mp-acShadow);font-size:18px}
#mini-player .mp-loop.on{background:linear-gradient(90deg,var(--mp-ac1),var(--mp-ac2))}
#mini-player.vuong{--mp-bg1:#0f2c1a;--mp-bg2:#0a1e12;--mp-fg:#e7f4ea;--mp-sub:#9bd0a8;--mp-ac1:#34d399;--mp-ac2:#059669;--mp-acGlow:rgba(52,211,153,.18);--mp-acShadow:rgba(52,211,153,.28)}
#mini-player.du{--mp-bg1:#0b2a5b;--mp-bg2:#0a1f42;--mp-fg:#e9f1ff;--mp-sub:#9db7f0;--mp-ac1:#60a5fa;--mp-ac2:#2563eb;--mp-acGlow:rgba(96,165,250,.18);--mp-acShadow:rgba(37,99,235,.28)}
#mini-player.ga{--mp-bg1:#151922;--mp-bg2:#0f1218;--mp-fg:#e6e7eb;--mp-sub:#9aa4b2;--mp-ac1:#fbbf24;--mp-ac2:#f59e0b;--mp-acGlow:rgba(245,158,11,.18);--mp-acShadow:rgba(245,158,11,.28)}
#mini-player{--pct:0%;--mp-track:rgba(255,255,255,.14)}
#mini-player input[type=range]{width:100%;-webkit-appearance:none;background:transparent;height:8px}
#mini-player input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:10px;box-shadow:inset 0 0 0 2px rgba(255,255,255,.2);background:linear-gradient(90deg,var(--mp-ac1) 0,var(--mp-ac2) var(--pct),var(--mp-track) var(--pct),var(--mp-track) 100%)}
#mini-player input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.45);margin-top:-4px}

@media(max-width:480px){#mini-player{right:12px;bottom:12px;width:calc(100vw - 24px)}}

.hidden{
	display:none;
}

@media (max-width: 480px){
	.bubble{
		max-width:86vw;
		min-width:60vw;
		font-size:13px;
		padding:12px 14px;
	}
	.ctx{
		max-width:90vw;
		min-width:60vw;
		border-radius:12px;
		padding:10px;
	}
	.ctx button{
		font-size:14px;
		padding:12px 12px;
	}
	#yt-player{
		right:12px;
		bottom:12px;
		width:calc(100vw - 24px);
		height:calc((100vw - 24px) * 9 / 16);
	}
}

@supports(padding:max(0px)){
	#yt-player{
		right:max(12px, env(safe-area-inset-right));
		bottom:max(12px, env(safe-area-inset-bottom));
	}
}
