/* Dùng chung cho index.html và kho-game.html. Một thế giới duy nhất: sân khấu LIVE tối, đỏ TikTok làm điểm nhấn, aqua chỉ để nhãn nhỏ. */
:root {
    --ground: #0B0B10; --surface: #15151D; --surface-2: #1D1D27;
    --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.16);
    --text: #F2F2F6; --muted: #9C9CAA; --dim: #6B6B78;
    --red: #FE2C55; --red-deep: #D91E46; --aqua: #25F4EE; --gold: #FFC94A;
    --display: "Unbounded", "Be Vietnam Pro", system-ui, sans-serif;
    --body: "Be Vietnam Pro", -apple-system, "Segoe UI", system-ui, sans-serif;
    --radius: 14px;
}
/* Giao diện sáng: cùng bảng màu với site.css (account/kho-game); bật bằng data-theme="light" (site.js nhớ lựa chọn). */
:root[data-theme="light"] {
    --ground: #F6F6F8; --surface: #FFFFFF; --surface-2: #EEEEF3; --line: rgba(22,24,35,.1); --line-strong: rgba(22,24,35,.2);
    --text: #161823; --muted: #5C5C6B; --dim: #8A8A98;
    --aqua: #0D9C97; --gold: #9A6B00;
    color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font: 16px/1.6 var(--body); padding-inline: 20px; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; line-height: 1.15; }
.wrap { max-width: 1120px; margin-inline: auto; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); }
.eyebrow + h1, .eyebrow + h2 { margin-top: 12px; }
h2 + .muted, h1 + .muted { margin-top: 12px; max-width: 44em; }
.muted { color: var(--muted); }
section { padding-block: 80px; }
section + section { border-top: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }

/* ---- nav: thanh mảnh dính đầu trang, nền mờ (mẫu Linear / Coda / Frontify trên Mobbin) ----
   Desktop: logo · link dạng viên · ngôn ngữ gọn "🇺🇸 EN" + sáng/tối · Tải về ngoài cùng. ≤900px: logo · Tải về · ☰ mở bảng menu. */
html { overflow-x: clip; }   /* nền nav tràn 100vw không sinh thanh cuộn ngang */
:root { --ground-rgb: 11,11,16; }
:root[data-theme="light"] { --ground-rgb: 246,246,248; }
nav { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 24px; height: 68px; }
nav::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw); background: rgba(var(--ground-rgb), .8); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
nav.stuck::before, nav.open::before { border-bottom-color: var(--line); }
nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 19px; text-decoration: none; flex: none; }
nav .brand img { width: 34px; height: 34px; border-radius: 50%; }
/* Chữ TikGami: glitch TikTok (xanh + đỏ) dịu — dùng chung mọi trang landing. */
nav .brand span { text-shadow: -1.3px -0.8px 0 rgba(37,244,238,.78), 1.3px 0.8px 0 rgba(254,44,85,.78); }
nav .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
nav .menu { display: flex; align-items: center; gap: 12px; }
nav .links { display: flex; gap: 2px; font-size: 14px; font-weight: 500; }
nav .links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s, background .15s; }
nav .links a:hover { color: var(--text); background: var(--surface); }
nav .links a[aria-current] { color: var(--text); }
/* 08/10 (kiểu C, user chọn): mục Bảng giá giữ chữ thường, nhãn "Dùng thử 3 ngày" đỏ nhỏ nghiêng chéo góc trên phải — kiểu nhãn "Mới". */
nav .links a:has(.nb:not([hidden])) { position: relative; margin-right: 34px; }
nav .nb { position: absolute; top: -9px; right: -34px; padding: 2px 7px; border-radius: 6px 6px 6px 0; background: var(--red); color: #fff; font: 800 9.5px var(--body); letter-spacing: .02em; white-space: nowrap; transform: rotate(-6deg); box-shadow: 0 4px 10px rgba(254,44,85,.4); pointer-events: none; }
nav .nb[hidden] { display: none; }
@media (min-width: 901px) and (max-width: 1100px) { nav .nb { display: none; } nav .links a { padding: 8px 9px; } nav .links a:has(.nb:not([hidden])) { margin-right: 0; } }   /* 08/10: 5 mục menu + Tải về vừa một hàng trước khi gom vào ☰ */
nav .prefs { display: flex; align-items: center; gap: 2px; }
nav .lang { height: 36px; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; color: var(--text); font: 600 13px var(--body); cursor: pointer; }
nav .lang:hover { background: var(--surface); }
nav .lang.theme { width: 36px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
nav .lang.theme:hover { color: var(--text); }
/* Ngôn ngữ: chữ gọn "🇺🇸 EN ▾" đè lên <select> trong suốt — vẫn là danh sách gốc của trình duyệt (bàn phím, đọc màn hình). */
nav .lang-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 999px; font: 600 13px var(--body); color: var(--text); white-space: nowrap; }
nav .lang-pick:hover { background: var(--surface); }
nav .lang-pick::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
nav .lang-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
nav .lang-pick:focus-within { outline: 2px solid var(--aqua); outline-offset: 2px; }
nav .btn { padding: 9px 16px; font-size: 14px; white-space: nowrap; }
nav .btn.primary { box-shadow: 0 6px 18px rgba(254,44,85,.25); }
nav .menu-btn { display: none; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
nav .menu-btn svg { width: 20px; height: 20px; }
nav .menu-btn .x, nav.open .menu-btn .bars { display: none; }
nav.open .menu-btn .x { display: block; }

/* ---- nút ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); cursor: pointer; font-family: inherit; font-size: 15px; line-height: 1.2; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 10px 30px rgba(254,44,85,.28); }
.btn.primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn.lg { padding: 18px 30px; font-size: 17px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn small { font-weight: 400; opacity: .75; font-size: 12px; }

/* ---- thẻ game (kho + nổi bật) ---- */
.games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.game { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.game:hover { transform: translateY(-3px); border-color: var(--line-strong); }
/* Thẻ chưa có ảnh: ô gradient + chữ cái đầu, màu suy ra từ tên nên ổn định. */
.tile { position: relative; overflow: hidden; aspect-ratio: 16 / 10; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 40px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* 14/10: khung clip xem trước PHỦ ĐÚNG thẻ game đang rê (games.js hoverSide) — không đè lên thẻ bên cạnh; clip 9:16 giữa khung, nền ảnh bìa mờ. */
.side-clip { position: fixed; z-index: 60; overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 12px 30px rgba(0,0,0,.35); pointer-events: none; animation: side-in .15s ease-out; }
.side-clip .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); filter: blur(14px) brightness(.55); }
.side-clip video { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .2s; }
.side-clip.on video { opacity: 1; }
.side-clip .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; background: linear-gradient(to top, rgba(0,0,0,.8), transparent); color: #fff; font: 700 15px/1.3 var(--display, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-clip .nm:empty { display: none; }
.side-clip .spin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: side-spin .8s linear infinite; }
.side-clip.on .spin { display: none; }
@keyframes side-spin { to { transform: rotate(360deg); } }
@keyframes side-in { from { opacity: 0; } to { opacity: 1; } }
/* Nhãn loại game trên ảnh bìa (08/10): Miễn phí xanh · PRO đỏ · có giá vàng. */
.tier { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font: 700 11px/1.3 var(--body); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: none; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.tier-free { background: #10B981; }
.tier-pro { background: var(--red); }
.tier-paid { background: #FFC94A; color: #111; text-transform: none; }
/* Loại game (039): Dùng thử xanh dương · Hot cam · VIP tím. */
.tier-trial { background: #3B82F6; }
.tier-hot { background: #F97316; }
.tier-business { background: #6366F1; }
.game .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game h3 { font-size: 15px; font-weight: 700; }
.game .desc { font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.game .size { font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }   /* giá game: đủ to để đọc (01/10: 11px mờ, khách không thấy giá) */
.game .more { flex: none; white-space: nowrap; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--aqua); cursor: pointer; }
.game .more:hover { text-decoration: underline; }

/* ---- hộp thoại chi tiết game ---- */
.game-dlg { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); overflow-x: hidden; overflow-y: auto; }
.game-dlg::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.game-dlg .media .tile { aspect-ratio: 16 / 9; font-size: 0; }
.game-dlg .body { padding: 24px 28px 28px; display: grid; gap: 12px; }
.game-dlg h3 { font-size: 22px; }
.game-dlg .about { font-size: 15px; }
.game-dlg .rich { display: grid; gap: 8px; line-height: 1.6; }
.game-dlg .rich p { margin: 0; }
.game-dlg .rich h4 { margin: 10px 0 0; font: 700 15px var(--body); color: var(--gold); }
.game-dlg .rich ul { margin: 0; padding-left: 20px; }
.game-dlg .rich-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.game-dlg .rich table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.game-dlg .rich th, .game-dlg .rich td { padding: 8px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.game-dlg .rich tr:last-child td { border-bottom: 0; }
.game-dlg .rich th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.game-dlg .meta { font-size: 13px; color: var(--dim); }
.game-dlg .btn { justify-self: start; margin-top: 8px; }
.game-dlg [hidden] { display: none; }   /* .btn có display riêng: nút Mua ẩn (đã sở hữu / miễn phí / chưa có giá) phải ẩn thật */
.game-dlg .close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer; }
.game-dlg .close:hover { background: rgba(0,0,0,.85); }

/* ---- footer (02/10): thương hiệu + mạng xã hội · 3 cột link chữ hoa nhỏ · dải © / "dành cho nhà sáng tạo TikTok" · miễn trừ ---- */
footer { padding-block: 56px 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer .cols { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 40px; }
footer .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
footer .brand img { width: 30px; height: 30px; border-radius: 50%; }
footer .tag { margin-top: 14px; max-width: 26em; font-size: 13.5px; line-height: 1.6; }
footer .socials { display: flex; gap: 8px; margin-top: 18px; }
footer .socials a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); transition: color .15s, border-color .15s; }
footer .socials a:hover { color: var(--text); border-color: var(--line-strong); }
footer .socials svg { width: 17px; height: 17px; }
footer h4 { margin: 4px 0 16px; font: 600 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); display: grid; gap: 14px; }
footer .legal-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
footer .legal b { color: var(--muted); font-weight: 600; }
footer .built { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
footer .built svg { width: 14px; height: 14px; }
footer .legal p { margin: 0; }
@media (max-width: 900px) { footer .cols { grid-template-columns: 1fr 1fr; } footer .fbrand { grid-column: 1 / -1; } }
@media (max-width: 520px) { footer .cols { gap: 28px; } }

/* ---- trang văn bản (điều khoản, bảo mật, công ty) ---- */
.doc { max-width: 760px; padding-block: 40px 80px; }
.doc h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.doc h2 { font-size: 20px; margin-top: 36px; }
.doc p, .doc li { color: var(--muted); font-size: 15px; }
.doc p { margin-top: 12px; }
.doc ul { padding-left: 20px; margin: 10px 0 0; }
.doc .updated { font-size: 13px; color: var(--dim); }
.doc a { color: var(--text); }
.doc .lang { margin-bottom: 24px; }
html[lang="en"] .only-vi, html[lang="vi"] .only-en { display: none; }

@media (max-width: 900px) {
    .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    nav { height: 60px; gap: 12px; }
    nav .brand span { display: none; }
    nav .right { gap: 8px; }
    nav .menu-btn { display: inline-grid; }
    nav .menu { display: none; }
    nav.open .menu { display: grid; gap: 4px; position: absolute; top: 100%; left: calc(50% - 50vw); right: calc(50% - 50vw); padding: 8px 20px 20px; background: var(--ground); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px rgba(0,0,0,.35); max-height: calc(100dvh - 60px); overflow-y: auto; }
    nav.open .links { display: grid; gap: 0; font-size: 17px; }
    nav.open .links a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--text); }
    nav.open .links a:hover { background: transparent; }
    nav.open .links a:has(.nb:not([hidden])) { margin-right: 0; gap: 8px; }   /* menu điện thoại: nhãn nằm ngay sau chữ, không nghiêng */
    nav.open .nb { position: static; transform: none; }
    nav.open .prefs { padding-top: 12px; gap: 8px; }
    nav.open .lang-pick, nav.open .lang.theme { border: 1px solid var(--line-strong); }
    footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    section { padding-block: 56px; }
    .games { grid-template-columns: 1fr; }
    footer .cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; }   /* điện thoại: link 2 cột, cột thương hiệu trải hết (rule .fbrand ở trên) */
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .game, nav .links a { transition: none; }
}

/* Đồng xu (site.js coinEl) cạnh mọi giá coin: các trang dùng landing.css (trang chủ, kho game…) không nạp site.css nên thiếu
   luật này → SVG không cỡ phình to cả thẻ game (01/10). Giữ khớp với .coin trong site.css. */
.coin { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }

/* Dải "… giới thiệu bạn dùng TikGami" (site.js refBanner) — giữ khớp với .ref-banner trong site.css. */
.ref-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; padding: 10px 16px; border-radius: 12px; background: rgba(37,244,238,.08); border: 1px solid rgba(37,244,238,.28); font-size: 14px; text-align: center; overflow-wrap: anywhere; }
.ref-banner a { font-weight: 600; color: var(--text); }
