:root {
  --bg: #060d12;
  --bg-2: #0a1620;
  --card: #0e1c27;
  --line: #1a2f3b;
  --text: #e8f2ef;
  --muted: #83a09e;
  --accent: #6a9fd0;
  --accent-2: #a8c8e6;
  --gold: #e3bd6a;
  --blue: #86b3dc;
  --blue-2: #c2d8ec;
  --radius: 14px;
  --serif: "Montserrat", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 12px; font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; transition: .2s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { background: #1e3440; color: #6f8585; cursor: not-allowed; }
.btn-ghost { border-color: #3a5866; background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); font-size: 16px;
}
.icon-btn:hover { border-color: var(--accent); }

/* ---------- Age gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #0d2238, #03080b 70%);
}
.gate-card {
  display: grid; grid-template-columns: 220px 1fr;
  max-width: 820px; width: 100%;
  background: #0f0f12; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.gate-left {
  background: var(--accent); display: grid; place-items: center;
  font: 800 76px/1 var(--serif); color: #fff;
}
.gate-right { padding: 36px; }
.gate-right h1 { font: 600 34px/1.15 var(--serif); margin: 0 0 14px; }
.gate-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  margin: 18px 0; font-size: 13px; color: var(--muted); background: #060d12;
}
.gate-box strong { color: var(--text); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.gate-box p { margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 2px; }
.gate-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(6, 13, 18, .92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.topbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--blue) 75%, transparent);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 72px; }

.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 50%, #0b5fae);
  font: 900 20px/1 var(--serif); color: #fff;
  box-shadow: 0 4px 14px rgba(106,159,208,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo-text { font: 900 24px/1 var(--serif); letter-spacing: .02em; }
.logo-text em {
  font-style: normal;
  background: linear-gradient(135deg, #b6d0ea, #8fb7dd 50%, #a6bfe0);
  -webkit-background-clip: text; background-clip: text; color: #9fcfff; -webkit-text-fill-color: transparent;
}

.nav {
  display: flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  margin-left: 8px;
}
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px;
  font: 600 13.5px/1 var(--sans); color: var(--muted);
  border: 1px solid transparent; transition: .18s; white-space: nowrap;
}
.nav a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { color: var(--text); background: #122733; }
.nav a.active {
  color: #fff; background: linear-gradient(180deg, #0f2236, #0c1c2d);
  border-color: #2f5f8f; box-shadow: inset 0 -2px 0 var(--accent);
}
.nav a.active svg { stroke: var(--accent-2); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 10px 0 14px; height: 44px; width: 280px; transition: .18s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106,159,208,.18); }
.search svg { width: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { background: none; border: 0; outline: 0; color: var(--text); width: 100%; font: inherit; font-size: 14px; }
.search kbd {
  font: 600 11px/1 var(--sans); color: var(--muted); padding: 4px 7px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.btn-sm { padding: 0 18px; height: 44px; border-radius: 12px; }
.menu-btn {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-btn span { width: 18px; height: 2px; background: var(--text); display: block; }

.social {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); transition: .18s;
}
.social svg { width: 20px; height: 20px; fill: currentColor; }
.social.discord { color: #8f98ff; }
.social.facebook { color: #4d8dff; }
.social.discord:hover { background: #5865f2; border-color: #5865f2; color: #fff; }
.social.facebook:hover { background: #1877f2; border-color: #1877f2; color: #fff; }

/* ---------- Cộng đồng ---------- */
.community { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.comm-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--radius);
  border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform .2s, border-color .2s;
}
.comm-card.discord { background: linear-gradient(120deg, rgba(88,101,242,.28), rgba(88,101,242,.06) 60%), var(--bg-2); }
.comm-card.facebook { background: linear-gradient(120deg, rgba(24,119,242,.28), rgba(24,119,242,.06) 60%), var(--bg-2); }
.comm-card:hover { transform: translateY(-3px); }
.comm-card.discord:hover { border-color: #5865f2; }
.comm-card.facebook:hover { border-color: #1877f2; }
.comm-ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.discord .comm-ico { background: #5865f2; }
.facebook .comm-ico { background: #1877f2; }
.comm-ico svg { width: 28px; height: 28px; fill: currentColor; }
.comm-text { flex: 1; min-width: 0; }
.comm-text b { display: block; font: 800 18px/1.2 var(--serif); }
.comm-text small { display: block; color: #b4c6c4; font-size: 13px; margin-top: 4px; }
.comm-cta {
  flex: none; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
}
.comm-card:hover .comm-cta { background: #fff; color: #111; }
.footer-links a { display: inline-flex; align-items: center; gap: 7px; }
.footer-links svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Trending (khung ngang) ---------- */
.fire { width: 26px; height: 26px; fill: var(--accent-2); vertical-align: -3px; margin-right: 8px; }
.trend {
  list-style: none; margin: 0; padding: 0 0 8px;
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.trend::-webkit-scrollbar { display: none; }
.trend li { scroll-snap-align: start; }
.t-card {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--card); transition: transform .25s, border-color .25s;
}
.t-card:hover { transform: translateY(-4px); border-color: #2f5f8f; }
.t-media { position: absolute; inset: 0; background-size: cover; background-position: center; }
.t-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.t-card:hover .t-media img { transform: scale(1.05); }
.t-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(3,9,12,.95) 0%, rgba(3,9,12,.55) 38%, transparent 70%);
}
.t-rank {
  position: absolute; left: 14px; bottom: 6px; z-index: 2;
  font: 900 82px/1 var(--serif); color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.75);
  letter-spacing: -.05em; text-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.trend li:nth-child(1) .t-rank { -webkit-text-stroke-color: var(--accent-2); }
.trend li:nth-child(2) .t-rank { -webkit-text-stroke-color: var(--gold); }
.trend li:nth-child(3) .t-rank { -webkit-text-stroke-color: #c9946a; }
.t-info { position: absolute; left: 88px; right: 14px; bottom: 14px; z-index: 2; }
.t-info b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 800 15px/1.3 var(--serif);
}
.t-info span { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 12px; color: #c3d3d0; }
.t-info span em { font-style: normal; color: var(--gold); font-weight: 700; font-size: 13px; }
.t-hot {
  position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px;
  font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 8px; background: rgba(106,159,208,.9);
}
.t-hot svg { width: 12px; height: 12px; fill: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 520px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: background .8s ease;
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(6,13,18,.97) 0%, rgba(6,13,18,.88) 40%, rgba(6,13,18,.35) 72%, rgba(6,13,18,.1) 100%),
              linear-gradient(0deg, var(--bg) 0%, transparent 40%);
}
.hero-inner { position: relative; padding: 90px 0 56px; max-width: 1240px; }
.hero-title {
  font: 800 clamp(34px, 6vw, 68px)/1.02 var(--serif); margin: 0; max-width: 760px;
  text-transform: uppercase; letter-spacing: -.01em;
}
.hero-sub { font: italic 700 20px/1.3 var(--serif); color: var(--gold); margin: 10px 0 0; }
.hero-desc { max-width: 560px; color: #c3d3d0; margin: 16px 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-dots { display: flex; gap: 8px; margin-top: 34px; }
.hero-dots button {
  width: 28px; height: 4px; border-radius: 2px; border: 0; background: #3a3a42; padding: 0;
}
.hero-dots button.on { background: var(--accent); width: 46px; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-top: 8px;
}
.stat { background: var(--bg-2); padding: 20px 22px; }
.stat b { display: block; font: 800 30px/1 var(--serif); }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 64px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h3 { font: 700 30px/1.1 var(--serif); margin: 0 0 4px; }
.section-head p { margin: 0; font-size: 14px; }
.arrows { display: flex; gap: 8px; }
.select {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px;
}

/* ---------- Cards ---------- */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 230px; gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }

.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: #2a5580; }
.cover {
  aspect-ratio: 3 / 4; position: relative; overflow: hidden;
  background-size: cover; background-position: center;
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .cover img { transform: scale(1.05); }
.cover-gen {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px; font: 800 24px/1.05 var(--serif); text-transform: uppercase;
}
.cover-gen small { font: 600 10px var(--sans); letter-spacing: .2em; opacity: .7; margin-bottom: 8px; }
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 45%);
  pointer-events: none;
}
.fav {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); font-size: 16px; line-height: 1;
}
.fav.on { color: var(--accent-2); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.cover .badges { position: absolute; top: 10px; left: 10px; z-index: 2; right: 50px; }
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12);
}
.badge.vh { background: var(--accent); border-color: var(--accent); }
.badge.cheat { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.badge.wip { background: #2d4a7a; border-color: #2d4a7a; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title {
  font-weight: 700; font-size: 15px; line-height: 1.3; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 12px; color: var(--muted); margin: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; font-size: 13px; }
.card-foot .p { font-weight: 700; color: var(--gold); }
.card-foot .p.free { color: #93bfe4; }
.card-foot .d { color: var(--muted); font-size: 12px; }

/* ---------- Filters ---------- */
.filters {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 26px; display: grid; gap: 10px;
}
.filter-row { display: flex; gap: 14px; align-items: baseline; }
.filter-label { width: 82px; flex: none; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
  background: transparent; border: 1px solid var(--line); color: #c3d3d0;
}
.chip:hover { border-color: #3a5866; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps b { font: 800 34px/1 var(--serif); color: var(--accent); }
.steps h4 { margin: 12px 0 6px; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 40px 0 26px; background: #040a0e; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-inner p { max-width: 380px; font-size: 14px; }
.footer-links { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.copy { font-size: 12px; color: #5b7272; margin-top: 26px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
  display: grid; grid-template-columns: 340px 1fr;
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); font-size: 22px;
}
.m-cover { position: relative; min-height: 100%; }
.m-cover .cover { aspect-ratio: auto; height: 100%; min-height: 420px; }
.m-body { padding: 30px 32px; }
.m-body h2 { font: 800 30px/1.1 var(--serif); margin: 14px 0 4px; text-transform: uppercase; }
.m-orig { color: var(--gold); font-style: italic; margin: 0 0 18px; }
.m-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; margin: 0 0 18px; font-size: 14px; }
.m-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.m-meta dd { margin: 2px 0 0; }
.m-desc { color: #c3d3d0; margin: 0 0 18px; }
.m-shots { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 10px; overflow-x: auto; margin-bottom: 18px; }
.m-shots img { border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; }
.m-buy {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.price { font: 800 28px/1 var(--serif); color: var(--gold); }
.price.free { color: #93bfe4; }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.share { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 14px 0 0; text-decoration: underline; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
}

/* ---------- Trang chi tiết game ---------- */
.btn-block { width: 100%; height: 50px; border-radius: 12px; font-size: 15px; }
.g-hero { position: relative; overflow: hidden; }
.g-hero-bg { display: none; }
.g-banner { position: relative; width: 100%; height: clamp(360px, 42vw, 720px); }
.g-banner > img, .g-banner-gen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.g-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,13,18,.55) 0%, rgba(6,13,18,0) 18%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6,13,18,.92) 14%, rgba(6,13,18,.55) 34%, rgba(6,13,18,0) 62%);
}
.g-banner::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(6,13,18,.6) 7%, rgba(6,13,18,0) 20%, rgba(6,13,18,0) 80%, rgba(6,13,18,.6) 93%, var(--bg) 100%); }
.g-hero-inner { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 0 28px; }
.g-hero-inner .crumbs { margin: 0; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: rgba(6,13,18,.62); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px); color: #b9c8cf; }
.g-hero-text .g-title { margin: 12px 0 0; text-shadow: 0 2px 18px rgba(0,0,0,.65); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; }
.g-title { font: 900 clamp(28px, 4.6vw, 52px)/1.05 var(--serif); text-transform: uppercase; margin: 14px 0 6px; letter-spacing: -.01em; }
.g-orig { font: italic 700 18px/1.3 var(--serif); color: var(--gold); margin: 0; }

.g-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; padding-top: 28px; align-items: start; }
.g-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); aspect-ratio: 16 / 9; }
.g-media img { width: 100%; height: 100%; object-fit: cover; }
.g-media-gen { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 20px; }
.g-media-gen span { font: 900 clamp(24px, 4vw, 44px)/1.05 var(--serif); text-transform: uppercase; }
.g-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.g-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; opacity: .6; transition: .2s; }
.g-thumbs button.on, .g-thumbs button:hover { opacity: 1; border-color: var(--accent); }
.g-thumbs img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.g-block { margin-top: 28px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.g-main > .g-block:first-child { margin-top: 0; }
.g-viewer { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.g-viewer-main { display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; cursor: zoom-in; }
.g-viewer-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.g-viewer-main:hover img { transform: scale(1.02); }
.g-viewer-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.g-viewer-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; aspect-ratio: 16 / 10; opacity: .55; transition: .2s; }
.g-viewer-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-viewer-thumbs button.on, .g-viewer-thumbs button:hover { opacity: 1; border-color: var(--accent); }
@media (max-width: 640px) { .g-viewer-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-block h2 { font: 800 19px/1.2 var(--serif); margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--accent); }
.g-desc { margin: 0; color: #c3d3d0; white-space: pre-line; }
.g-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.g-steps li { display: flex; gap: 14px; align-items: flex-start; }
.g-steps b {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #0f2236; border: 1px solid #2f5f8f; color: var(--accent-2); font: 800 15px/1 var(--serif);
}
.g-steps h4 { margin: 4px 0 2px; font-size: 15px; }
.g-steps p { margin: 0; color: var(--muted); font-size: 14px; }
.g-steps em { font-style: normal; color: var(--text); font-weight: 600; }

.g-side { position: sticky; top: 92px; }
.g-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; }
.g-price { font: 900 34px/1 var(--serif); color: var(--gold); }
.g-price.free { color: #93bfe4; }
.g-price-note { margin: -2px 0 8px; font-size: 13px; color: var(--muted); }
.g-mini { display: grid; grid-template-columns: 1fr; gap: 8px; }
.g-mini button {
  height: 40px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600;
}
.g-mini button:hover { border-color: #3a5866; }
.g-fav.on { color: var(--accent-2); border-color: #2f5f8f; }
.g-meta { margin: 8px 0 0; border-top: 1px solid var(--line); }
.g-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.g-meta div:last-child { border-bottom: 0; }
.g-meta dt { color: var(--muted); }
.g-meta dd { margin: 0; text-align: right; font-weight: 600; }
.notfound { text-align: center; padding: 120px 0 60px; }
.notfound h1 { font: 900 34px/1.1 var(--serif); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {

  .search { width: 220px; }
  .trend { grid-auto-columns: calc((100% - 16px) / 2); }
}
@media (max-width: 1240px) {
  .nav {
    position: absolute; top: 80px; left: 16px; right: 16px; margin: 0;
    flex-direction: column; gap: 4px; padding: 6px;
    background: var(--bg-2); box-shadow: 0 16px 40px rgba(0,0,0,.6); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; font-size: 14px; }
  .menu-btn { display: flex; }
  .top-right { flex: 1; }
  .search { width: auto; flex: 1; }
  .topbar-inner { gap: 12px; }
}
@media (max-width: 960px) {
  .g-layout { grid-template-columns: 1fr; }
  .g-side { position: static; order: -1; }
  .modal-card { grid-template-columns: 1fr; }
  .m-cover .cover { min-height: 0; height: auto; width: 100%; aspect-ratio: 16 / 9; }
  .hero-bg::after {
    background: linear-gradient(0deg, rgba(6,13,18,.98) 0%, rgba(6,13,18,.85) 45%, rgba(6,13,18,.45) 100%);
  }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .gate-card { grid-template-columns: 1fr; }
  .gate-left { padding: 26px; font-size: 54px; }
  .gate-right { padding: 24px; }
  .gate-right h1 { font-size: 26px; }
  .hero { min-height: 460px; }
  .filter-row { flex-direction: column; gap: 6px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .rail { grid-auto-columns: 46%; gap: 12px; }
  .cover-gen { font-size: 17px; padding: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 13px; }
  .m-body { padding: 22px 18px; }
  .m-body h2 { font-size: 24px; }
  .section-head h3 { font-size: 24px; }
  .logo-text { font-size: 19px; }
  .community { grid-template-columns: 1fr; }
  .comm-cta { display: none; }
  .social { width: 40px; height: 40px; }
  .search kbd, .top-right .btn-sm { display: none; }
  .trend { grid-auto-columns: 86%; }
  .t-rank { font-size: 64px; }
  .t-info { left: 70px; }
}

/* Tên gốc đi kèm trong tiêu đề trang game */
.g-title .g-orig {
  display: inline; text-transform: none; font-size: .5em; letter-spacing: 0;
  color: var(--gold); font-style: italic; font-weight: 700; vertical-align: .15em;
}

/* ---------- Khung QR lấy mật khẩu ---------- */
.pass-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.pass-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.pass-card {
  position: relative; width: min(1080px, 100%); height: min(860px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-2); border: 1px solid #1d3f60; border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(106,159,208,.15);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.pass-modal.show .pass-backdrop { opacity: 1; }
.pass-modal.show .pass-card { transform: none; opacity: 1; }
.pass-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--accent));
}
.pass-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--line); background: #08141b;
}
.pass-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pass-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.pass-ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.pass-title b { display: block; font: 800 17px/1.2 var(--serif); }
.pass-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.pass-open { font-size: 13px; color: var(--muted); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pass-open:hover { color: var(--text); border-color: #3a5866; }
.pass-close { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 24px; line-height: 1; }
.pass-close:hover { border-color: var(--accent); }
.pass-body { position: relative; flex: 1; background: #000; }
.pass-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .3s; }
.pass-modal.ready .pass-body iframe { opacity: 1; }
.pass-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.pass-modal.ready .pass-loading { display: none; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #24404d; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pass-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: #08141b; font-size: 13px; color: var(--muted);
}
.pass-foot b { color: var(--gold); }
.pass-foot a { flex: none; color: #8f98ff; font-weight: 600; }
@media (max-width: 640px) {
  .pass-modal { padding: 0; }
  .pass-card { height: 100%; width: 100%; border-radius: 0; border: 0; }
  .pass-open { display: none; }
  .pass-foot { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 12px; }
}

/* ---------- Khối TAG GAME ---------- */
.g-tags { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.g-tags h4 {
  margin: 0 0 12px; font: 700 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.g-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.g-tag {
  display: inline-flex; align-items: center; padding: 9px 12px; border-radius: 4px;
  border: 1px solid #24404d; background: #0a1820;
  font: 700 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: #e2efec;
  transition: .15s;
}
a.g-tag:hover { border-color: var(--accent); color: #fff; background: #0c1c2d; }

/* ---------- Ảnh trong game + xem phóng to ---------- */
.g-block h2 small { font: 500 12px/1 var(--sans); color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.g-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g-shot {
  padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000;
  aspect-ratio: 16 / 9; cursor: zoom-in; position: relative;
}
.g-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .2s; }
.g-shot:hover img { transform: scale(1.06); }
.g-shot:hover { border-color: var(--accent); }
.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.94);
  display: grid; place-items: center; padding: 50px 70px; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-width: 100%; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox figcaption { color: var(--muted); font-size: 13px; }
.lb-close, .lb-nav {
  position: absolute; border: 1px solid #24404d; background: rgba(8,20,27,.85); color: #fff; border-radius: 12px;
}
.lb-close { top: 14px; right: 14px; width: 44px; height: 44px; font-size: 26px; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; font-size: 34px; line-height: 1; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-close:hover, .lb-nav:hover { border-color: var(--accent); }
@media (max-width: 640px) {
  .g-gallery { grid-template-columns: repeat(2, 1fr); }
  .lightbox { padding: 60px 8px; }
  .lb-nav { width: 40px; height: 52px; font-size: 28px; top: auto; bottom: 14px; transform: none; }
}

/* ---------- Tag A-Z ---------- */
.tag-search { width: 260px; }
.tz-alpha {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; padding: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  position: sticky; top: 80px; z-index: 5;
}
.tz-letter {
  min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  font: 800 13px/1 var(--serif); color: var(--text); border: 1px solid transparent;
}
a.tz-letter:hover { background: #0f2236; border-color: #2f5f8f; color: #fff; }
.tz-letter.off { color: #3d3d46; }
.tz-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tz-group {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; scroll-margin-top: 150px;
}
.tz-head {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); font: 900 18px/1 var(--serif); color: #fff;
}
.tz-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tz-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 4px;
  border: 1px solid #24404d; background: #0a1820;
  font: 700 12px/1 var(--sans); letter-spacing: .03em; text-transform: uppercase; color: #e2efec; transition: .15s;
}
.tz-tag small { font-weight: 600; color: var(--muted); font-size: 11px; }
.tz-tag:hover { border-color: var(--accent); background: #0c1c2d; }
.tz-tag.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tz-tag.on small { color: #dde9f4; }
.chip-link { color: var(--gold); border-style: dashed; }
.tag-active { text-transform: uppercase; font-weight: 700; }
@media (max-width: 640px) {
  .tag-search { width: 100%; }
  #tags .section-head { flex-direction: column; align-items: stretch; }
  .tz-alpha { top: 72px; gap: 2px; padding: 6px; }
  .tz-letter { min-width: 26px; height: 28px; font-size: 12px; }
}

/* ---------- Nút Lấy Pass + nhãn trạng thái ---------- */
.btn-gold {
  background: linear-gradient(135deg, #f0cf8e, var(--gold) 55%, #b8894a); color: #1a1205; border: 0;
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-gold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.g-tag.done { border-color: #4a7aa8; color: #a8c8e6; background: #0c1a2a; }
.g-tag.wip { border-color: #7a5a2f; color: #f0c27b; background: #1f170d; }

/* ---------- Chữ tối trên nền xanh nhạt ---------- */
.btn-primary, .badge.vh, .tz-tag.on, .tz-head, .t-hot, .gate-left, .chip.on.tag-active { color: #06121d; }
.btn-primary:hover { color: #06121d; }
.btn-primary:disabled { color: #6f8585; }
.t-hot svg { fill: #06121d; }
.pass-ico svg { stroke: #06121d; }
.tz-tag.on small { color: #1d3f60; }
.nav a.active { color: #dde9f4; }
