/* Browser game pages only. Theme header/footer remain in control. */
body.single-browser_game #main_cont.tbg-main,
body.post-type-archive-browser_game #main_cont.tbg-main {
	box-sizing: border-box;
	float: none;
	width: auto;
	max-width: 1180px;
	margin: 0 auto 50px;
	padding: 28px;
}

.tbg-main *,
.tbg-main *::before,
.tbg-main *::after {
	box-sizing: border-box;
}

.tbg-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 18px;
	color: #777;
	font-size: 13px;
}

.tbg-breadcrumb a {
	color: #666;
	text-decoration: none;
}

.tbg-page-header {
	margin-bottom: 16px;
}

.tbg-page-title,
.tbg-archive-title {
	margin: 0 0 10px;
	font-size: clamp(24px, 4vw, 34px);
	line-height: 1.35;
}

.tbg-game-thumbnail {
	width: 100%;
	margin: 0 0 24px;
	overflow: hidden;
	border-radius: 12px;
	background: #ededed;
}

.tbg-game-thumbnail-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.tbg-game-wrapper {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto 24px;
	overflow: hidden;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	background: #f5f5f5;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: contain;
}

.tbg-game-container {
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	touch-action: manipulation;
}

.tbg-game-frame {
	display: block;
	width: 100%;
	height: min(820px, 82svh);
	min-height: 560px;
	border: 0;
	background: #0b0712;
}

.tbg-game-notice {
	display: grid;
	min-height: 320px;
	margin: 0;
	place-items: center;
	color: #555;
}

.tbg-game-summary {
	margin: 0 0 32px;
	padding: 16px 18px;
	border-left: 4px solid #333;
	background: #f7f7f7;
	line-height: 1.8;
}

.tbg-game-summary p:last-child,
.tbg-card-excerpt p:last-child {
	margin-bottom: 0;
}

.tbg-game-description {
	margin-top: 36px;
	line-height: 1.9;
}

/* Do not let automatically injected article TOCs interrupt game pages. */
.tbg-game-description #toc_container {
	display: none !important;
}

.tbg-related-games {
	margin-top: 56px;
	padding-top: 26px;
	border-top: 1px solid #ddd;
}

.tbg-related-games > h2 {
	margin: 0 0 20px;
	font-size: 22px;
}

.tbg-archive-header {
	margin-bottom: 30px;
}

.tbg-archive-header > p {
	color: #555;
}

.tbg-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.tbg-card {
	min-width: 0;
	overflow: hidden;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 5px 18px rgba(0, 0, 0, 0.07);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tbg-card:hover,
.tbg-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 9px 25px rgba(0, 0, 0, 0.12);
}

.tbg-card-link,
a.tbg-card {
	display: block;
	height: 100%;
	color: #222;
	text-decoration: none;
}

.tbg-card-image {
	display: grid;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	place-items: center;
	background: #ededed;
}

.tbg-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.tbg-card:hover .tbg-card-image img {
	transform: scale(1.025);
}

.tbg-card-placeholder {
	color: #777;
	font-size: 22px;
	font-weight: bold;
	letter-spacing: 0.16em;
}

.tbg-card-body {
	display: flex;
	min-height: 215px;
	padding: 18px;
	flex-direction: column;
}

.tbg-card h2,
.tbg-card h3 {
	margin: 0 0 10px;
	font-size: 19px;
	line-height: 1.5;
}

.tbg-card-grid-related .tbg-card h3 {
	padding: 14px 16px 16px;
	margin: 0;
}

.tbg-card-excerpt {
	margin-bottom: 18px;
	color: #555;
	font-size: 14px;
	line-height: 1.7;
}

.tbg-play-button {
	display: inline-block;
	align-self: flex-start;
	margin-top: auto;
	padding: 9px 24px;
	border-radius: 999px;
	background: #222;
	color: #fff;
	font-weight: bold;
}

.tbg-pagination {
	margin-top: 38px;
	text-align: center;
}

.tbg-pagination .page-numbers {
	display: inline-block;
	margin: 3px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	color: #333;
	text-decoration: none;
}

.tbg-pagination .current {
	border-color: #222;
	background: #222;
	color: #fff;
}

/* TOP-page shortcode: hero image, three game cards and archive link. */
.tbg-top-games,
.tbg-top-games *,
.tbg-top-games *::before,
.tbg-top-games *::after {
	box-sizing: border-box;
}

.tbg-top-games {
	width: 100%;
	margin: 24px auto;
}

.tbg-top-hero {
	display: block;
	width: 100%;
	margin-bottom: 18px;
	overflow: hidden;
	border-radius: 8px;
	background: #ededed;
}

.tbg-top-hero-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	transition: transform 0.25s ease;
}

.tbg-top-hero:hover .tbg-top-hero-image {
	transform: scale(1.01);
}

.tbg-top-games-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.tbg-top-game-card {
	display: flex;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	flex-direction: column;
}

.tbg-top-card-image {
	display: grid;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	place-items: center;
	background: #ededed;
}

.tbg-top-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.tbg-top-game-card:hover .tbg-top-card-image img {
	transform: scale(1.025);
}

.tbg-top-card-body {
	display: flex;
	padding: 14px;
	flex: 1;
	flex-direction: column;
}

.tbg-top-card-body h3 {
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 1.5;
}

.tbg-top-card-body h3 a {
	color: #222;
	text-decoration: none;
}

.tbg-top-card-description {
	margin-bottom: 14px;
	color: #555;
	font-size: 13px;
	line-height: 1.7;
}

.tbg-top-card-description p {
	margin: 0 0 8px;
}

.tbg-top-card-description p:last-child {
	margin-bottom: 0;
}

.tbg-top-play-button {
	display: inline-flex;
	align-self: flex-start;
	margin-top: auto;
	padding: 7px 18px;
	border-radius: 999px;
	background: #222;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.tbg-top-play-button:hover,
.tbg-top-play-button:focus {
	background: #444;
	color: #fff;
}

.tbg-top-more {
	margin-top: 34px;
	text-align: center;
}

.tbg-top-more-link {
	display: inline-flex;
	min-width: 230px;
	min-height: 66px;
	padding: 16px 28px;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: #1f2d4d;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
}

.tbg-top-more-link:hover,
.tbg-top-more-link:focus {
	background: #2b3d65;
	color: #fff;
}

@media (max-width: 900px) {
	.tbg-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	body.single-browser_game #main_cont.tbg-main,
	body.post-type-archive-browser_game #main_cont.tbg-main {
		width: 100%;
		margin: 0 0 30px;
		padding: 18px 10px 26px;
	}

	.tbg-game-wrapper {
		border-right: 0;
		border-left: 0;
		border-radius: 0;
	}

	.tbg-game-container {
		min-height: 0;
	}

	.tbg-game-frame {
		height: min(780px, 82svh);
		min-height: 520px;
	}

	.tbg-card-grid {
		gap: 14px;
	}

	.tbg-card-body {
		min-height: 0;
		padding: 14px;
	}

	.tbg-card h2,
	.tbg-card h3 {
		font-size: 16px;
	}

	.tbg-card-excerpt {
		display: none;
	}

	.tbg-play-button {
		padding: 7px 18px;
		font-size: 14px;
	}

	.tbg-top-games-grid {
		gap: 7px;
	}

	.tbg-top-card-body {
		padding: 10px;
	}

	.tbg-top-card-body h3 {
		font-size: 14px;
	}

	.tbg-top-card-description {
		font-size: 12px;
		line-height: 1.55;
	}

	.tbg-top-play-button {
		padding: 6px 14px;
		font-size: 12px;
	}
}

@media (max-width: 390px) {
	.tbg-game-frame {
		min-height: 480px;
	}

	.tbg-card-grid {
		grid-template-columns: 1fr;
	}

	.tbg-top-games-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}
}
