/* End-layer actions — memeda CSS scheme, framed to Cocos canvas (JS sync) */
#game-end {
	position: fixed;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	z-index: 100;
	pointer-events: none;
	display: none;
	overflow: visible;
	font-family: Tahoma, "Microsoft YaHei", "Heiti SC", sans-serif;
	-webkit-user-select: none;
	user-select: none;
}
#game-end.is-show {
	display: block;
}

/* Design space 720×1280 — scaled to match canvas via --end-scale */
#game-end .game-end-stage {
	position: absolute;
	left: 0;
	top: 0;
	width: 720px;
	height: 1280px;
	transform-origin: 0 0;
	transform: scale(var(--end-scale, 1));
	pointer-events: none;
}

#game-end .again,
#game-end #shareBtn,
#game-end .more-games-fixed {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	top: auto;
	width: 260px;
	height: 72px;
	line-height: 72px;
	border-radius: 36px;
	font-size: 28px;
	text-align: center;
	text-indent: 0;
	padding: 0;
	box-sizing: border-box;
	text-decoration: none;
	pointer-events: auto;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	transition: transform 120ms ease, background-color 120ms ease, border-bottom-color 120ms ease, filter 120ms ease;
	opacity: 0;
}

/* Unified hover / press: slight scale + brightness */
@media (hover: hover) {
	#game-end .again:hover:not(.tap-pressed),
	#game-end .again.is-hover:not(.tap-pressed),
	#game-end #shareBtn:hover:not(.tap-pressed):not(.is-confirm):not(.is-copy-feedback),
	#game-end #shareBtn.is-hover:not(.tap-pressed):not(.is-confirm):not(.is-copy-feedback),
	#game-end .more-games-fixed:hover:not(.tap-pressed),
	#game-end .more-games-fixed.is-hover:not(.tap-pressed) {
		transform: translateX(-50%) scale(1.05);
		filter: brightness(1.1);
	}
	#game-end #shareBtn .gr-btn-shareTo:hover,
	#game-end #shareBtn .gr-btn-shareTo.is-hover {
		filter: brightness(1.12);
		transform: scale(1.06);
	}
	#game-end #btnShareCancel:hover:not(.tap-pressed),
	#game-end #btnShareCancel.is-hover:not(.tap-pressed) {
		transform: scale(1.05);
		filter: brightness(1.1);
	}
}

/* Staggered slide-up when end UI opens (after hex pop) */
@keyframes endBtnIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(22px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}
#game-end.end-enter .again,
#game-end.end-enter #shareBtn,
#game-end.end-enter .more-games-fixed {
	animation: endBtnIn 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#game-end.end-enter .again { animation-delay: 0ms; }
#game-end.end-enter #shareBtn { animation-delay: 90ms; }
#game-end.end-enter .more-games-fixed { animation-delay: 180ms; }

/* Manual colors preserved: rgba + white text */
#game-end .again {
	background: rgba(162, 130, 249, 0.8);
	color: #fff;
	border-bottom: 4px solid rgba(0, 0, 0, 0.12);
}
#game-end #shareBtn {
	background: rgba(255, 136, 178, 0.8);
	color: #fff;
	border-bottom: 4px solid rgba(0, 0, 0, 0.15);
}
#game-end .more-games-fixed {
	background: rgba(74, 230, 97, 0.8);
	color: #fff;
	border-bottom: 4px solid rgba(0, 0, 0, 0.12);
}

/* Higher stack in design space (clear bottom, not cramped) */
#game-end .again { bottom: 340px; }
#game-end #shareBtn { bottom: 248px; }
#game-end .more-games-fixed { bottom: 156px; }

#game-end #shareBtn {
	overflow: visible;
	z-index: 6;
	padding: 0;
}
#game-end #shareBtn .gr-default,
#game-end #shareBtn .gr-feedback,
#game-end #shareBtn .gr-confirm {
	display: block;
	width: 100%;
	height: 72px;
	border-radius: 36px;
	background: rgba(255, 136, 178, 0.8);
	color: #fff;
	border-bottom: 4px solid rgba(0, 0, 0, 0.15);
	box-sizing: border-box;
}
#game-end #shareBtn .gr-default { line-height: 72px; color: #fff; }
#game-end #shareBtn .gr-feedback {
	display: none;
	position: absolute;
	left: 0;
	top: 0;
	padding: 0 18px;
	line-height: normal;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
}
#game-end #shareBtn .gr-confirm {
	display: none;
	position: absolute;
	left: 0;
	top: 0;
	padding: 0 10px;
	line-height: normal;
	white-space: nowrap;
}
#game-end #shareBtn.is-confirm .gr-confirm {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 72px;
	padding: 0 10px;
	position: relative;
	left: auto;
	top: auto;
	width: auto;
	min-width: 0;
}
#game-end #shareBtn.is-confirm .gr-default { display: none; }
#game-end #shareBtn.is-confirm {
	width: auto;
	min-width: 0;
}
#game-end #shareBtn.is-copy-feedback .gr-default,
#game-end #shareBtn.is-copy-feedback .gr-confirm { display: none !important; }
#game-end #shareBtn.is-copy-feedback .gr-feedback {
	display: flex;
	position: relative;
	left: auto;
	top: auto;
	width: 100%;
	min-width: 0;
	height: 72px;
	padding: 0;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}
/* Keep same width as 分享好友 / sibling pills */
#game-end #shareBtn.is-copy-feedback {
	width: 260px;
	min-width: 260px;
}

#game-end #shareBtn .gr-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	white-space: nowrap;
	gap: 8px;
	padding: 0 2px;
	height: 100%;
}
#game-end #shareBtn #btnShareTo {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 8px;
}
#game-end #shareBtn .gr-btn-shareTo {
	display: inline-block;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	margin: 0;
	border-radius: 21px;
	background-color: rgba(255, 255, 255, 0.65);
	border: 2px solid rgba(255, 255, 255, 0.8);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 62% 62%;
	font-size: 0;
	line-height: 0;
	color: transparent;
	text-indent: -9999px;
	overflow: hidden;
	transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, filter 120ms ease;
}
#game-end #shareBtn #btnShareCopy {
	background-image: url("/assets/icons/link.svg");
}
#game-end #shareBtn #btnShareWeibo {
	background-image: var(--share-weibo-icon, none);
}
#game-end #shareBtn #btnShareTwitter {
	background-image: var(--share-twitter-icon, none);
}
#game-end #shareBtn #btnShareFacebook {
	background-image: var(--share-facebook-icon, none);
}
#game-end #shareBtn #btnShareWechat {
	background-image: var(--share-wechat-icon, none);
}
#game-end #shareBtn .gr-feedback-icon {
	display: block;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
}
#game-end #shareBtn .gr-feedback-text {
	display: block;
	font-size: 28px;
	line-height: 1;
	color: #fff;
}
#game-end #shareBtn.copy-success .gr-feedback-icon {
	background-image: url("/assets/icons/done.svg");
}
#game-end #shareBtn.copy-fail .gr-feedback-icon {
	background-image: url("/assets/icons/wrong.svg");
}
#game-end #shareBtn #btnShareCancel {
	display: block;
	height: 46px;
	line-height: 46px;
	padding: 0 16px;
	box-sizing: border-box;
	border-radius: 23px;
	background: rgba(255, 255, 255, 0.25);
	font-size: 20px;
	color: #fff;
	text-align: center;
	border-bottom: 4px solid rgba(0, 0, 0, 0.2);
	transition: transform 120ms ease, background-color 120ms ease, border-bottom-color 120ms ease;
}

#game-end .again.tap-pressed {
	transform: translateX(-50%) translateY(1px) scale(0.96);
	filter: brightness(1.14);
	background: rgba(162, 130, 249, 0.95);
	border-bottom-color: rgba(0, 0, 0, 0.2);
}
#game-end #shareBtn.tap-pressed {
	transform: translateX(-50%) translateY(1px) scale(0.96);
	filter: brightness(1.14);
	background: rgba(255, 136, 178, 0.95);
	border-bottom-color: rgba(0, 0, 0, 0.22);
}
#game-end #shareBtn.tap-pressed .gr-default {
	background: rgba(255, 136, 178, 0.95);
	border-bottom-color: rgba(0, 0, 0, 0.22);
}
#game-end .more-games-fixed.tap-pressed {
	transform: translateX(-50%) translateY(1px) scale(0.96);
	filter: brightness(1.14);
	background: rgba(58, 209, 85, 0.95);
	border-bottom-color: rgba(0, 0, 0, 0.2);
}
#game-end #btnShareCancel.tap-pressed {
	transform: translateY(1px) scale(0.96);
	filter: brightness(1.12);
	background: rgba(255, 255, 255, 0.35);
	border-bottom-color: rgba(0, 0, 0, 0.28);
}
#game-end #shareBtn .gr-btn-shareTo.tap-pressed,
#game-end #shareBtn .gr-btn-shareTo:active {
	transform: scale(0.94);
	filter: brightness(1.12);
}
