/* TinGame – trang tin tức game. Mọi quy tắc nằm dưới body.tingame để không ảnh hưởng theme cha. */

.tingame {
	--tg-red: #db3b2f;
	--tg-red-dark: #b92a20;
	--tg-gray: #4a4a4a;
	--tg-soft: #f1f1f1;
	--tg-line: #e3e3e3;
	--tg-text: #222;
	--tg-muted: #777;
	--tg-w: 1100px;
	--tg-font: Roboto, -apple-system, "Segoe UI", Arial, sans-serif;
	--tg-cond: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
	background: #fff;
	color: var(--tg-text);
	font: 14px/1.5 var(--tg-font);
}
.tingame a { color: inherit; text-decoration: none; }
.tingame a:hover { color: var(--tg-red); }
.tingame img { display: block; max-width: 100%; height: auto; }
.tingame .tg-wrap { max-width: var(--tg-w); margin: 0 auto; padding: 0 12px; }

/* ---------- Header ---------- */
.tg-header { position: relative; z-index: 50; background: #fff; }
.tg-header__top { display: flex; align-items: stretch; }
.tg-logo {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 6px 14px 8px;
	background: var(--tg-red);
	color: #fff !important;
	min-width: 190px;
}
.tg-logo__name { font: 700 44px/1 var(--tg-cond); letter-spacing: -1px; }
.tg-logo__tag { margin-top: 3px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .2px; }
.tg-logo__img { max-height: 70px; width: auto; }
.tg-header__right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tg-social { display: flex; justify-content: flex-end; gap: 14px; height: 32px; align-items: center; padding-right: 4px; }
.tg-ico { width: 16px; height: 16px; background: var(--tg-red); -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.tg-ico--fb { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 8V6c0-1 .5-1.5 1.5-1.5H17V1h-3c-3 0-4 2-4 4.5V8H7v3.5h3V23h4V11.5h3l.5-3.5z'/%3E%3C/svg%3E"); }
.tg-ico--yt { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23 7.5s-.2-1.6-.9-2.3c-.9-.9-1.9-.9-2.3-1C16.5 4 12 4 12 4s-4.5 0-7.8.2c-.5.1-1.5.1-2.3 1C1.2 5.9 1 7.5 1 7.5S.8 9.4.8 11.2v1.7c0 1.8.2 3.7.2 3.7s.2 1.6.9 2.3c.9.9 2 .9 2.5 1 1.8.2 7.6.2 7.6.2s4.5 0 7.8-.3c.5-.1 1.5-.1 2.3-1 .7-.7.9-2.3.9-2.3s.2-1.9.2-3.7v-1.7c0-1.8-.2-3.7-.2-3.7zM9.7 15V8.7l6 3.2z'/%3E%3C/svg%3E"); }
.tg-ico--rss { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='19' r='2.5'/%3E%3Cpath d='M2.5 9.5v3.2a8.8 8.8 0 0 1 8.8 8.8h3.2A12 12 0 0 0 2.5 9.5zm0-6.5v3.2a15.3 15.3 0 0 1 15.3 15.3H21A18.5 18.5 0 0 0 2.5 3z'/%3E%3C/svg%3E"); }

.tg-mainbar { flex: 1; background: var(--tg-red); }
.tg-mainbar__in { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 46px; padding: 0 12px 0 6px; max-width: none; }
.tg-mini-logo { display: none; font: 700 22px/1 var(--tg-cond); color: #fff !important; margin-right: 6px; }
.tg-menu { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.tg-menu li { margin: 0; list-style: none; }
.tg-nav { flex: 1; min-width: 0; }
.tg-nav .tg-menu { flex-wrap: nowrap; overflow: hidden; }
.tg-nav a {
	display: block;
	padding: 12px 9px;
	color: #fff !important;
	font: 700 15px/22px var(--tg-cond);
	text-transform: uppercase;
	white-space: nowrap;
}
.tg-nav a:hover, .tg-nav .current-menu-item > a, .tg-nav .current-cat > a { background: var(--tg-red-dark); }
.tg-search { position: relative; flex: 0 0 200px; margin: 0; }
.tg-search input {
	width: 100%;
	height: 30px;
	margin: 0;
	padding: 0 34px 0 10px;
	border: 0;
	border-radius: 3px;
	background: #fff;
	box-shadow: none;
	font-size: 13px;
}
.tg-search button {
	position: absolute; top: 0; right: 0; width: 32px; height: 30px; margin: 0; padding: 0; min-height: 0;
	border: 0; background: #888;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 1 0 4.2 12.6l5.1 5.1 1.4-1.4-5.1-5.1A7 7 0 0 0 10 3zm0 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10z'/%3E%3C/svg%3E") center/18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 1 0 4.2 12.6l5.1 5.1 1.4-1.4-5.1-5.1A7 7 0 0 0 10 3zm0 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10z'/%3E%3C/svg%3E") center/18px no-repeat;
}
.tg-burger { display: none; }

.tg-subbar { background: var(--tg-gray); }
.tg-subbar__in { display: flex; align-items: center; }
.tg-home {
	flex: 0 0 auto; width: 40px; height: 40px; background: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 12h3v8h5v-6h4v6h5v-8h3z'/%3E%3C/svg%3E") center/22px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 12h3v8h5v-6h4v6h5v-8h3z'/%3E%3C/svg%3E") center/22px no-repeat;
}
.tg-subnav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tg-subnav::-webkit-scrollbar { display: none; }
.tg-subnav .tg-menu { flex-wrap: nowrap; }
.tg-subnav a {
	display: block; padding: 9px 12px; color: #fff !important;
	font: 700 14px/22px var(--tg-cond); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap;
}
.tg-subnav a:hover { background: rgba(255,255,255,.12); }

/* Thanh đỏ dính khi cuộn */
.tg-stuck .tg-mainbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.tg-stuck .tg-mainbar__in { max-width: var(--tg-w); margin: 0 auto; }
.tg-stuck .tg-mini-logo { display: block; }
.admin-bar.tg-stuck .tg-mainbar { top: 32px; }

.tg-panel { background: #fff; border-bottom: 3px solid var(--tg-red); }
.tg-panel[hidden] { display: none; }
.tg-panel .tg-menu { display: block; }
.tg-panel a { display: block; padding: 11px 16px; border-bottom: 1px solid var(--tg-line); font-weight: 700; text-transform: uppercase; }

/* ---------- Bố cục 2 cột ---------- */
.tg-main { padding-bottom: 30px; }
.tg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding-top: 22px; }

.tg-head { text-align: center; margin: 22px 0 14px; }
.tg-head__title { margin: 0 0 6px; font: 700 26px/1.3 var(--tg-font); color: #333; }
.tg-head__title span { color: var(--tg-red); }
.tg-head__update { margin: 0; font-size: 12px; color: var(--tg-muted); }
.tg-head__update b { color: var(--tg-red); font-size: 11px; }
.tg-invite p { margin: 0 0 4px; font-size: 13px; }
.tg-share {
	display: inline-block; margin-bottom: 14px; padding: 1px 8px 1px 22px; border-radius: 2px;
	background: #3b5998 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M14 8V6c0-1 .5-1.5 1.5-1.5H17V1h-3c-3 0-4 2-4 4.5V8H7v3.5h3V23h4V11.5h3l.5-3.5z'/%3E%3C/svg%3E") 5px center/12px no-repeat;
	color: #fff !important; font-size: 12px; font-weight: 700;
}
.tg-share:hover { opacity: .85; }

/* Dòng tin */
.tg-list { display: grid; gap: 10px; }
.tg-item { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 16px; padding: 6px; background: var(--tg-soft); }
.tg-item__thumb { display: block; aspect-ratio: 175 / 125; overflow: hidden; background: #ddd; }
.tg-item__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tg-item:hover .tg-item__thumb img { transform: scale(1.05); }
.tg-item__body { padding: 8px 10px 6px 0; }
.tg-item__title { margin: 0 0 8px; font: 500 19px/1.35 var(--tg-font); color: #222; }
.tg-item__date { display: block; margin-bottom: 8px; font-size: 11px; color: var(--tg-muted); }
.tg-item__sapo { margin: 0; font-size: 13px; color: #444; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tg-noimg { display: block; width: 100%; height: 100%; min-height: 90px; background: linear-gradient(135deg, #ccc, #eee); }

.tg-pager { margin-top: 22px; }
.tg-pager .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tg-pager .page-numbers { min-width: 34px; padding: 6px 10px; border: 1px solid var(--tg-line); text-align: center; font-weight: 700; }
.tg-pager .page-numbers.current, .tg-pager a.page-numbers:hover { background: var(--tg-red); border-color: var(--tg-red); color: #fff; }
.tg-empty { padding: 30px; background: var(--tg-soft); text-align: center; }

/* Cột phải */
.tg-side { min-width: 0; }
.tg-topic { margin-bottom: 14px; }
.tg-topic img { width: 100%; }
.tg-topic__desc { padding-top: 6px; font-size: 12px; color: #333; }
.tg-topic__desc p { margin: 0; }
.tg-boxtitle {
	margin: 0 0 10px; padding: 4px 8px; background: #ccc; color: #fff;
	font: 700 14px/22px var(--tg-font);
}
.tg-boxtitle--red { background: none; padding: 0 0 6px; border-bottom: 2px solid var(--tg-red); color: var(--tg-red); font-size: 18px; text-transform: uppercase; }
.tg-card { margin-bottom: 18px; background: var(--tg-soft); }
.tg-card__thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.tg-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tg-card__title { margin: 0; padding: 8px 8px 4px; font: 700 17px/1.3 var(--tg-font); }
.tg-card__sapo { margin: 0; padding: 0 8px 10px; font-size: 12.5px; color: #555; }
.tg-widget { margin-bottom: 20px; }

/* ---------- Bài viết ---------- */
.tg-article__cat { display: inline-block; margin: 6px 0 8px; color: var(--tg-red) !important; font-weight: 700; text-transform: uppercase; font-size: 13px; }
.tg-article__title { margin: 0 0 10px; font: 700 30px/1.3 var(--tg-font); color: #222; }
.tg-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--tg-muted); font-size: 12px; }
.tg-article__meta .tg-share { margin: 0; }
.tg-article__sapo { margin: 0 0 16px; font-weight: 700; font-size: 16px; line-height: 1.55; }
.tg-article__body { font-size: 16px; line-height: 1.7; }
.tg-article__body h2 { font-size: 21px; margin: 24px 0 10px; }
.tg-article__body img { margin: 12px auto; }
.tg-tags { margin: 18px 0 28px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.tg-tags a { padding: 3px 10px; background: var(--tg-soft); border-radius: 2px; }

/* ---------- Trang chủ ---------- */
.tg-hot { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto auto; gap: 6px; }
.tg-hot--1, .tg-hot--2, .tg-hot--3 { grid-template-columns: 2fr 1fr; }
.tg-hot__item { position: relative; overflow: hidden; background: #000; }
.tg-hot__item--big { grid-row: span 2; }
.tg-hot__item a { display: block; height: 100%; color: #fff !important; }
.tg-hot__item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; opacity: .9; transition: transform .3s; }
.tg-hot__item:hover img { transform: scale(1.04); }
.tg-hot__item h2 {
	position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 10px 8px;
	background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff;
	font: 700 14px/1.35 var(--tg-font);
}
.tg-hot__item--big h2 { font-size: 24px; padding: 40px 16px 14px; }
.tg-catblock { margin-top: 28px; }
.tg-list + .tg-catblock, .tg-catblock:first-child { margin-top: 0; }
.tg-list { margin-bottom: 28px; }
.tg-catblock__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tg-catblock .tg-card { margin: 0; }
.tg-catblock__list { display: grid; gap: 10px; align-content: start; }
.tg-mini { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-weight: 500; line-height: 1.35; }
.tg-mini img, .tg-mini .tg-noimg { aspect-ratio: 16 / 10; object-fit: cover; min-height: 0; }

/* ---------- Footer ---------- */
.tg-footer { margin-top: 20px; padding: 24px 0; border-top: 4px solid var(--tg-red); background: #2b2b2b; color: #bbb; font-size: 13px; }
.tg-footer__in { display: flex; gap: 24px; align-items: flex-start; }
.tg-footer .tg-logo { min-width: 0; }
.tg-footer .tg-logo__name { font-size: 32px; }
.tg-footer__body { flex: 1; }
.tg-footer .tg-menu { gap: 4px 18px; margin-bottom: 10px; }
.tg-footer .tg-menu a { color: #fff; font-weight: 700; text-transform: uppercase; font-size: 12px; }
.tg-footer__text p { margin: 0 0 4px; }
.tg-top {
	position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 38px; height: 38px; border-radius: 50%;
	background: var(--tg-red); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tg-top::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border: solid #fff; border-width: 3px 0 0 3px; transform: translateY(2px) rotate(45deg); }
.tg-stuck .tg-top { opacity: .9; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (min-width: 1001px) {
	.tg-panel { display: none !important; }
}
@media (max-width: 1180px) {
	.tg-logo { min-width: 0; }
	.tg-logo__name { font-size: 38px; }
	.tg-search { flex-basis: 150px; }
	.tg-nav a { padding: 12px 7px; font-size: 14px; }
}
/* Dưới 1000px: menu đỏ thu vào nút ☰ */
@media (max-width: 1000px) {
	.tg-nav { display: none; }
	.tg-burger {
		display: block; flex: 0 0 auto; width: 40px; height: 40px; margin: 0; padding: 0; min-height: 0;
		border: 0; background: none; cursor: pointer;
	}
	.tg-burger span, .tg-burger span::before, .tg-burger span::after { display: block; width: 22px; height: 3px; margin: 0 auto; background: #fff; position: relative; content: ""; }
	.tg-burger span::before { position: absolute; top: -7px; }
	.tg-burger span::after { position: absolute; top: 7px; }
	.tg-search { flex: 1; }
}
@media (max-width: 849px) {
	.tg-layout { grid-template-columns: 1fr; }
	.tg-header__top { padding: 0; }
	.tg-logo { min-width: 0; padding: 6px 10px; }
	.tg-logo__name { font-size: 30px; }
	.tg-logo__tag { font-size: 8px; }
	.tg-social { height: 26px; }
	.admin-bar.tg-stuck .tg-mainbar { top: 46px; }
	.tg-hot { grid-template-columns: 1fr 1fr; }
	.tg-hot__item--big { grid-column: span 2; grid-row: auto; }
	.tg-footer__in { flex-direction: column; }
}
@media (max-width: 549px) {
	.tg-wrap { padding: 0 10px; }
	.tg-head__title { font-size: 21px; }
	.tg-item { grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 5px; }
	.tg-item__body { padding: 0; }
	.tg-item__title { font-size: 15px; margin-bottom: 4px; }
	.tg-item__date { margin-bottom: 0; }
	.tg-item__sapo { display: none; }
	.tg-article__title { font-size: 23px; }
	.tg-hot__item--big h2 { font-size: 18px; }
	.tg-catblock__grid { grid-template-columns: 1fr; }
	.tg-stuck .tg-mini-logo { display: none; }
	.admin-bar.tg-stuck .tg-mainbar { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.tingame * { transition: none !important; }
}
