/* Ghép hình */

.ghephinh-page {
	--accent: #e83e8c;
	--ink: #3d3340;
	color: var(--ink);
	max-width: 820px;
	margin: 0 auto;
	padding: 10px 16px 40px;
}

.ghephinh-page [hidden] {
	display: none !important;
}



/* Chọn tranh: một hàng ô vuông nhỏ */
.gh-scenes {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 2px 6px;
	-webkit-overflow-scrolling: touch;
}

.gh-thumb {
	flex: 0 0 auto;
	width: 82px;
	padding: 4px;
	border-radius: 12px;
	border: 2px solid #eadde4;
	background: #fff;
	color: var(--ink);
	font-size: 0.75rem;
	line-height: 1.2;
}

.gh-thumb img,
.gh-thumb i {
	display: block;
	width: 70px;
	height: 70px;
	margin: 0 auto 4px;
	border-radius: 8px;
	object-fit: cover;
	background: #f7eef2;
}

.gh-thumb i {
	line-height: 70px;
	font-size: 26px;
	color: var(--accent);
	text-align: center;
}

.gh-thumb[aria-pressed="true"] {
	border-color: var(--accent);
	font-weight: bold;
	color: #b0246a;
}

.gh-own {
	border-style: dashed;
	border-color: var(--accent);
	background: #fff4f9;
	color: #b0246a;
	font-weight: bold;
}

.gh-own[aria-pressed="true"] {
	border-style: solid;
}

.gh-thumb:disabled {
	opacity: 0.5;
}

/* Độ khó: một thanh chia ba ô đều nhau */
.gh-levels {
	display: flex;
	margin: 4px 0 8px;
	padding: 3px;
	border-radius: 999px;
	background: #f3e7ee;
}

.gh-levels button {
	flex: 1 1 0;
	min-height: 36px;
	padding: 4px 6px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #6c6070;
	font-size: 0.85rem;
	white-space: nowrap;
}

.gh-levels button[aria-pressed="true"] {
	background: #fff;
	color: #b0246a;
	box-shadow: 0 1px 4px rgba(176, 36, 106, 0.18);
}

/* Thanh công cụ ngay trên bàn ghép */
.gh-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
}

.gh-stat {
	font-variant-numeric: tabular-nums;
	color: #8a7b8f;
	font-size: 0.9rem;
	white-space: nowrap;
}

.gh-stat + .gh-stat {
	margin-left: 6px;
}

.gh-stat + .gh-tool {
	margin-left: auto;
}

.gh-tool {
	min-height: 36px;
	padding: 4px 12px;
	border-radius: 999px;
	border: 1.5px solid #dccfd6;
	background: #fff;
	color: var(--ink);
	font-size: 0.85rem;
	white-space: nowrap;
}

.gh-tool[aria-pressed="true"] {
	border-color: var(--accent);
	background: #fde7f1;
	color: #b0246a;
}

/* Bàn ghép và lớp thông báo hoàn thành đè lên trên */
.gh-stage {
	position: relative;
}

.gh-board {
	width: 100%;
	line-height: 0;
	min-height: 200px;
}

.gh-error {
	line-height: 1.4;
	padding: 40px 16px;
	text-align: center;
}

/* Vị trí và kích thước đặt bằng JS, trùng với vùng khay. */
.gh-done {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	pointer-events: none;
}

.gh-done-card {
	pointer-events: auto;
	max-width: 300px;
	padding: 16px 18px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 8px 30px rgba(120, 20, 70, 0.25);
	text-align: center;
}

.gh-done-title {
	font-size: 1.3rem;
	font-weight: bold;
	color: #b0246a;
	margin-bottom: 4px;
}

.gh-done-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 12px;
}

.gh-done-actions button {
	min-height: 42px;
	padding: 6px 18px;
	border-radius: 999px;
	border: 2px solid var(--accent);
	background: var(--accent);
	color: #fff;
	font-weight: bold;
}

.gh-done-actions button.ghost {
	background: #fff;
	color: var(--accent);
}

.ghephinh-page .note {
	font-size: 0.85rem;
	color: #8a7b8f;
}

/* Điện thoại: thu nhỏ ô tranh để cả năm ô, gồm "Ảnh của mẹ", nằm gọn một hàng. */
@media (max-width: 420px) {
	.gh-thumb {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
		padding: 3px;
		font-size: 0.7rem;
	}

	/* Tranh luôn vuông nên height: auto giữ được ô vuông. */
	.gh-thumb img {
		width: 100%;
		height: auto;
	}

	.gh-thumb i {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 54px;
		line-height: normal;
	}

	.gh-tool {
		padding: 4px 9px;
	}
}
