/* ==========================================================================
   PlayHub — giao diện tối cho cổng game miễn phí (Flatsome child theme)
   Mọi quy tắc nằm dưới body.playhub để không ảnh hưởng theme cha.
   ========================================================================== */

.playhub {
	--ph-bg: #16171b;
	--ph-surface: #222329;
	--ph-surface-2: #2b2c33;
	--ph-line: rgba(255, 255, 255, .08);
	--ph-text: #e7e7ea;
	--ph-muted: #9a9ba3;
	--ph-accent: #7c3aed;
	--ph-accent-2: #a21caf;
	--ph-gold: #fbbf24;
	--ph-radius: 6px;
	--ph-font: "Roboto", system-ui, sans-serif;

	background: var(--ph-bg);
	color: var(--ph-text);
	font-family: var(--ph-font);
}

.playhub #wrapper,
.playhub #main,
.playhub .page-wrapper { background: var(--ph-bg); }

.playhub h1, .playhub h2, .playhub h3, .playhub h4,
.playhub .nav > li > a { font-family: var(--ph-font); color: #fff; }

.playhub a { color: #c4b5fd; text-decoration: none; }
.playhub a:hover { color: #fff; }
.playhub p, .playhub li { color: var(--ph-muted); }
.playhub strong, .playhub b { color: #fff; }

/* ---------- Header ---------- */
.playhub .header-main,
.playhub .header-bg-color { background: #111215 !important; }
.playhub .header-main .nav > li > a { color: #fff; white-space: nowrap; font-size: 17px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.playhub .header-main .nav > li > a:hover,
.playhub .header-main .nav > li.active > a { color: #c4b5fd; }
.playhub .header-main .nav > li { position: relative; }

/* Nhãn nhỏ trên mục menu: thêm class ph-badge-new / ph-badge-top / ph-badge-hot
   ở Giao diện → Menu → (bật "CSS Classes" trong Screen Options) */
.playhub .nav > li[class*="ph-badge-"] > a::before {
	position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
	padding: 1px 6px; border-radius: 4px;
	background: #3b2468; color: #e9d5ff;
	font-size: 9px; font-weight: 500; line-height: 1.5;
}
.playhub .nav > li.ph-badge-new > a::before { content: "Mới"; }
.playhub .nav > li.ph-badge-top > a::before { content: "Top"; }
.playhub .nav > li.ph-badge-hot > a::before { content: "Hot"; background: #5b1a5e; }

.playhub .nav-dropdown { background: var(--ph-surface); border: 1px solid var(--ph-line); }
.playhub .nav-dropdown li a { color: var(--ph-text); }
.playhub .nav-dropdown li a:hover { background: var(--ph-surface-2); color: #fff; }

/* ---------- Nút ---------- */
.ph-btn,
.playhub .button.primary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 28px; border: 0; border-radius: 12px;
	background: var(--ph-accent); color: #fff !important;
	font: 500 16px/1 var(--ph-font); text-decoration: none; text-transform: none; letter-spacing: 0;
	box-shadow: 0 8px 22px -10px rgba(124, 58, 237, .9);
	transition: background .2s, transform .2s;
}
.ph-btn:hover,
.playhub .button.primary:hover { background: #6d28d9; transform: translateY(-1px); }
.ph-btn::before {
	content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%237c3aed'/%3E%3C/svg%3E") center/14px no-repeat;
}
.ph-btn--sm { min-height: 34px; padding: 0 20px; font-size: 13px; border-radius: 10px; }
.ph-btn--sm::before { display: none; }

/* ---------- Nhãn chuyên mục & meta ---------- */
.ph-label {
	display: inline-block; padding: 5px 15px; border-radius: 3px;
	background: var(--ph-accent-2); color: #fff !important;
	font-size: 12px; line-height: 1.4; text-decoration: none;
}
.ph-meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12px; color: #fff; }
.ph-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ph-meta span::before {
	content: ""; width: 13px; height: 13px; background: currentColor;
	-webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat;
}
.ph-meta__time { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ph-meta__comments { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E"); }
.ph-meta__views { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5C6 5 2 12 2 12s4 7 10 7 10-7 10-7-4-7-10-7zm0 11a4 4 0 110-8 4 4 0 010 8z'/%3E%3C/svg%3E"); }

/* ---------- Hero slider ---------- */
.ph-hero { position: relative; overflow: hidden; padding: 45px 0 78px; isolation: isolate; }
.ph-hero__backdrop {
	position: absolute; inset: -40px; z-index: -1;
	background: center/cover no-repeat; filter: blur(22px) brightness(.55); transform: scale(1.1);
	transition: background-image .6s;
}
.ph-hero__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, var(--ph-bg)); }
.ph-hero__inner { width: min(1170px, 100% - 30px); margin: 0 auto; }
.ph-hero__stage { position: relative; aspect-ratio: 1170 / 505; min-height: 340px; border-radius: var(--ph-radius); overflow: hidden; box-shadow: 0 30px 60px -30px #000; }
.ph-hero__slide {
	position: absolute; inset: 0; display: flex; align-items: center;
	background: center/cover no-repeat;
	opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s;
}
.ph-hero__slide.is-active { opacity: 1; visibility: visible; }
.ph-hero__slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 6, 20, .6), transparent 75%); }
.ph-hero__text { position: relative; max-width: 820px; padding: 0 90px; }
.ph-hero__title { margin: 22px 0 18px; font-size: clamp(28px, 4.2vw, 50px); font-weight: 700; line-height: 1.12; text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.ph-hero__title a { color: #fff; }
.ph-hero__nav {
	position: absolute; right: 30px; bottom: 22px; display: flex; gap: 6px;
	padding: 5px; border-radius: 30px; background: rgba(0, 0, 0, .75);
}
.ph-hero__nav button {
	width: 44px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 20px; cursor: pointer;
	background: transparent center/16px no-repeat; transition: background-color .2s;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M15 4l-8 8 8 8'/%3E%3C/svg%3E");
}
.ph-hero__nav .ph-hero__next { transform: scaleX(-1); }
.ph-hero__nav button:hover { background-color: rgba(255, 255, 255, .12); }

/* ---------- Chú thích ---------- */
.ph-notice { max-width: 1170px; margin: 20px auto; padding: 0 15px; text-align: center; font-size: 13px; line-height: 1.8; color: var(--ph-muted); }

/* ---------- Danh sách game ---------- */
.ph-list { display: grid; gap: 30px; }
.ph-list__item { padding: 20px 15px 18px; border-radius: var(--ph-radius); background: var(--ph-surface); }
.ph-list__row { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr 1fr; align-items: center; }
.ph-list__row > * { padding: 0 25px; text-align: center; }
.ph-list__row > * + * { border-left: 1px solid var(--ph-line); }
.ph-list__game { border: 0 !important; }
.ph-list__thumb { display: block; overflow: hidden; border-radius: 4px; }
.ph-list__thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.ph-list__item:hover .ph-list__thumb img { transform: scale(1.05); }
.ph-list__game h3 { margin: 10px 0 0; font-size: 17px; }
.ph-list__game h3 a, .ph-card h3, .ph-studio h3 a { color: #fff; }
.ph-list__label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--ph-text); }
.ph-list__studio { display: inline-grid; place-items: center; width: 125px; height: 70px; border-radius: 4px; background: #000; overflow: hidden; }
.ph-list__studio img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ph-list__studio b { padding: 0 8px; font-size: 14px; }
.ph-list__offer strong { display: block; font-size: 28px; font-weight: 700; line-height: 1.15; }
.ph-list__offer span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--ph-muted); }
.ph-list__cta small, .ph-card small { display: block; margin-top: 10px; font-size: 11px; color: var(--ph-muted); }
.ph-list__desc { margin: 16px 0 0; font-size: 12px; line-height: 1.6; }

/* ---------- Tiêu đề khối ---------- */
.ph-title { margin-bottom: 35px; }
.ph-title--center { text-align: center; }
.ph-title__icon { display: block; width: 60px; height: 60px; margin: 0 auto 18px; object-fit: contain; }
.ph-title h2 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.2; }
.ph-title p { margin: 12px 0 0; font-size: 13px; }

/* ---------- Lưới nhà phát triển ---------- */
.ph-studios { display: grid; grid-template-columns: repeat(var(--ph-cols, 4), 1fr); gap: 30px; }
.ph-studio { padding: 0 0 20px; border-radius: var(--ph-radius); background: rgba(34, 35, 41, .82); text-align: center; overflow: hidden; transition: transform .25s; }
.ph-studio:hover { transform: translateY(-4px); }
.ph-studio__logo { display: grid; place-items: center; height: 120px; padding: 18px; }
.ph-studio__logo img { max-height: 84px; width: auto; object-fit: contain; }
.ph-studio__logo span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: var(--ph-surface-2); font-size: 28px; font-weight: 900; color: #c4b5fd; }
.ph-studio h3 { margin: 16px 0 0; font-size: 17px; font-weight: 500; }

/* ---------- Thẻ game ---------- */
.ph-cards { display: grid; grid-template-columns: repeat(var(--ph-cols, 3), 1fr); gap: 30px; }
.ph-card { padding: 20px 20px 18px; border-radius: var(--ph-radius); background: var(--ph-surface); }
.ph-card__top { display: grid; grid-template-columns: 105px 1fr; gap: 20px; }
.ph-card__logo { display: block; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--ph-surface-2); }
.ph-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.ph-card__info { text-align: center; }
.ph-card__studio { display: block; font-size: 11px; color: var(--ph-muted); }
.ph-card h3 { margin: 6px 0 16px; font-size: 21px; font-weight: 500; line-height: 1.3; }
.ph-card .ph-btn { background: var(--ph-accent-2); box-shadow: 0 8px 22px -10px rgba(162, 28, 175, .9); padding: 0 22px; }
.ph-card .ph-btn:hover { background: #86198f; }
.ph-card .ph-btn::before { display: none; }
.ph-card__desc { margin: 18px 0 0; font-size: 12px; line-height: 1.6; }

/* ---------- Khối tin ---------- */
.ph-news__lead {
	position: relative; display: flex; align-items: flex-end; min-height: 460px;
	border-radius: var(--ph-radius); overflow: hidden; background: #000 center/cover no-repeat;
}
.ph-news__lead::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(0, 0, 0, .88)); }
.ph-news__lead-text { position: relative; max-width: 760px; padding: 40px; }
.ph-news__lead h2 { margin: 18px 0 10px; font-size: clamp(24px, 3.4vw, 40px); line-height: 1.15; }
.ph-news__lead h2 a { color: #fff; }
.ph-news__lead p { margin: 0 0 16px; color: #d4d4d8; }
.ph-news__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 30px; }
.ph-news__thumb { display: block; margin-bottom: 14px; border-radius: var(--ph-radius); overflow: hidden; }
.ph-news__thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.ph-news__item:hover .ph-news__thumb img { transform: scale(1.05); }
.ph-news__item h3 { margin: 12px 0 10px; font-size: 18px; line-height: 1.3; }
.ph-news__item h3 a { color: #fff; }
.ph-news__item .ph-meta { color: var(--ph-muted); }

/* ---------- Danh sách đánh dấu (thêm class ph-mark cho khối List) ---------- */
.playhub ul.ph-mark { margin-left: 0; list-style: none; }
.playhub ul.ph-mark li { position: relative; margin: 0 0 10px; padding-left: 32px; }
.playhub ul.ph-mark li::before {
	content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%;
	background: var(--ph-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center/12px no-repeat;
}
.playhub ol li::marker { color: #c4b5fd; font-weight: 700; }
.ph-small { font-size: 12px; }

/* ---------- Footer: xếp hạng ---------- */
.ph-top__title { display: flex; align-items: center; gap: 10px; margin: 0 0 25px; font-size: 20px; }
.ph-top__title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--ph-accent); }
.ph-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.ph-top__item { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: start; }
.ph-top__logo { display: block; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--ph-surface-2); }
.ph-top__logo img { width: 100%; height: 100%; object-fit: cover; }
.ph-top h4 { margin: 0 0 4px; font-size: 15px; line-height: 1.25; }
.ph-top h4 a { color: #fff; }
.ph-top p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; }
.ph-stars {
	display: block; width: 80px; height: 15px;
	background: linear-gradient(90deg, var(--ph-gold) calc(var(--ph-rating) * 1%), #4b4c55 0);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16'%3E%3Cg id='s'%3E%3Cpath d='M8 0l2.4 5 5.6.6-4.2 3.8 1.2 5.6L8 12.2 3 15l1.2-5.6L0 5.6 5.6 5z'/%3E%3C/g%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/svg%3E") 0 0/80px 15px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16'%3E%3Cg id='s'%3E%3Cpath d='M8 0l2.4 5 5.6.6-4.2 3.8 1.2 5.6L8 12.2 3 15l1.2-5.6L0 5.6 5.6 5z'/%3E%3C/g%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/svg%3E") 0 0/80px 15px no-repeat;
}

.playhub .footer-wrapper,
.playhub .footer-widgets,
.playhub .footer-1, .playhub .footer-2 { background: #111215 !important; }
.playhub .absolute-footer { background: #0c0d0f !important; color: var(--ph-muted); text-align: center; font-size: 12px; }
.playhub .absolute-footer a { color: #c4b5fd; text-decoration: underline; }

/* Section nền ảnh tối (đặt class ph-cover cho Section trong UX Builder) */
.playhub .ph-cover .section-bg::after { content: ""; position: absolute; inset: 0; background: rgba(14, 14, 18, .82); }

.ph-empty { padding: 14px; border: 1px dashed var(--ph-line); border-radius: var(--ph-radius); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.ph-list__offer strong { font-size: 22px; }
	.ph-top { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 849px) {
	.ph-studios { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.ph-cards { grid-template-columns: 1fr; }
	.ph-list__row { grid-template-columns: 1fr 1fr; row-gap: 20px; }
	.ph-list__row > * { padding: 0 12px; }
	.ph-list__row > :nth-child(3) { border-left: 0; }
	.ph-news__grid { grid-template-columns: 1fr 1fr; }
	.ph-hero__text { padding: 0 30px; }
	.ph-hero__nav { right: 16px; bottom: 16px; }
}
@media (max-width: 549px) {
	.ph-hero { padding: 20px 0 50px; }
	.ph-hero__stage { aspect-ratio: auto; min-height: 380px; }
	.ph-hero__slide { align-items: flex-end; padding-bottom: 84px; }
	.ph-hero__text { padding: 0 20px; }
	.ph-list__row { grid-template-columns: 1fr; }
	.ph-list__row > * { border-left: 0 !important; padding: 0; }
	.ph-list__row > * + * { padding-top: 16px; border-top: 1px solid var(--ph-line); }
	.ph-news__grid, .ph-top { grid-template-columns: 1fr; }
	.ph-news__lead { min-height: 380px; }
	.ph-news__lead-text { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.ph-hero__slide, .ph-hero__backdrop, .ph-studio, .ph-list__thumb img, .ph-news__thumb img { transition: none; }
}
