/* KGame — kgweb.lol | vi-VN gaming info portal */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg: #0a0e17;
  --bg-2: #101828;
  --bg-3: #162033;
  --surface: #1a2438;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8eef8;
  --muted: #9aa8bc;
  --blue: #3d8bfd;
  --blue-2: #1e6fe8;
  --cyan: #5ec8ff;
  --gold: #e0b84a;
  --danger: #ef6b6b;
  --ok: #3ecf8e;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1180px;
  --font: 'Be Vietnam Pro', sans-serif;
  --display: 'Outfit', 'Be Vietnam Pro', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 139, 253, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 5%, rgba(94, 200, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #0a0e17 0%, #0d1320 40%, #0a0e17 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { color: #9adfff; }
ul { padding-left: 1.2rem; }
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 .6em;
  letter-spacing: -0.02em;
}
p { margin: 0 0 1rem; color: var(--muted); }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ========== HEADER ========== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 20px);
}
.brand img {
  height: 42px;
  width: auto;
  max-height: 42px;
  object-fit: contain;
}
.brand-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.04em;
}
.nav-desktop {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-left: auto;
}
.nav-desktop a {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
  padding: .55rem .75rem;
  border-radius: 8px;
}
.nav-desktop a:hover,
.nav-desktop a.active { color: var(--text); background: rgba(61, 139, 253, 0.12); }
.header-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-left: .5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .62rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(30, 111, 232, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(30, 111, 232, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--line);
}
.btn-ghost:hover { border-color: rgba(94, 200, 255, 0.45); background: rgba(255,255,255,0.03); }
.menu-toggle {
  display: none;
  align-items: center;
  gap: .45rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: .88rem;
  margin-left: auto;
}
.menu-toggle svg { width: 22px; height: 22px; flex-shrink: 0; }
.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }
.menu-toggle.is-open .label-menu { display: none; }
.menu-toggle .label-close { display: none; }
.menu-toggle.is-open .label-close { display: inline; }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(12, 18, 30, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  z-index: 999;
  flex-direction: column;
  gap: .35rem;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  color: var(--text);
  padding: .85rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  background: rgba(255,255,255,0.02);
}
.nav-mobile a:hover { background: rgba(61, 139, 253, 0.15); }
.nav-mobile .mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.nav-mobile .mobile-auth .btn { width: 100%; }

body { padding-top: var(--header-h); }

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.72) 48%, rgba(8, 12, 22, 0.35) 100%),
    linear-gradient(0deg, rgba(10, 14, 23, 0.95) 0%, transparent 45%);
}
.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 640px;
  margin-right: auto;
  margin-left: max(1rem, calc((100% - var(--max)) / 2));
  animation: rise .8s ease both;
}
.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 .4rem;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 30px rgba(0,0,0,.5);
}
.hero h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: .75rem;
}
.hero-lead {
  font-size: 1.05rem;
  color: rgba(232, 238, 248, 0.88);
  margin-bottom: 1.4rem;
  max-width: 36rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== SECTIONS ========== */
.section { padding: 4rem 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.55), rgba(16, 24, 40, 0.35));
  border-block: 1px solid var(--line);
}
.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}
.section-head h2 {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  margin-bottom: .45rem;
}
.section-head p { margin-bottom: 0; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .5rem;
}

/* ========== GRID / CARDS ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: fadeIn .6s ease both;
}
.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 139, 253, 0.45);
  box-shadow: var(--shadow);
}
.cat-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #05080f;
  padding: .75rem;
}
.cat-item span {
  display: block;
  padding: .85rem 1rem 1.05rem;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
  transition: opacity .2s;
}
.article-card:hover { opacity: 0.92; }
.article-card .thumb {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: .9rem;
  background: #05080f;
  border: 1px solid var(--line);
}
.article-card .thumb img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.article-card .meta {
  font-size: .78rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: .35rem;
}
.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: .4rem;
}
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--cyan); }
.article-card p { font-size: .92rem; margin-bottom: .5rem; }
.article-card .more {
  font-size: .86rem;
  font-weight: 600;
  color: var(--blue);
}

.guide-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.guide-row img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #05080f;
}
.guide-row h3 { font-size: 1rem; margin-bottom: .25rem; }
.guide-row h3 a { color: var(--text); }
.guide-row h3 a:hover { color: var(--cyan); }
.guide-row p { font-size: .88rem; margin: 0; }

/* ========== INTRO / CONTENT ========== */
.intro-block {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
.intro-visual {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05080f;
  min-height: 280px;
}
.intro-visual img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}
.prose { max-width: 760px; }
.prose h2 { margin-top: 2rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.15rem; color: #d7e4f7; }
.prose a.ext {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose ul li { margin-bottom: .45rem; color: var(--muted); }
.warning-box {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--danger);
  background: rgba(239, 107, 107, 0.08);
  border-radius: 0 10px 10px 0;
}
.warning-box p { margin: 0; color: #f0c4c4; font-size: .95rem; }
.info-box {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--blue);
  background: rgba(61, 139, 253, 0.08);
  border-radius: 0 10px 10px 0;
}
.info-box p { margin: 0; color: #c5d8f5; }

/* ========== FAQ ========== */
.faq-list { display: flex; flex-direction: column; gap: .75rem; max-width: 800px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(26, 36, 56, 0.55);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--blue);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: .95rem;
}

/* ========== PAGE HERO (inner) ========== */
.page-hero {
  padding: 2.75rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(61, 139, 253, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(22, 32, 51, 0.6), transparent);
}
.page-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  margin-bottom: .5rem;
}
.page-hero p { max-width: 640px; margin-bottom: 0; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb span { opacity: .5; }

/* ========== ARTICLE PAGE ========== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}
.article-cover {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  border: 1px solid var(--line);
  background: #05080f;
}
.article-cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.sidebar-box {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem;
  background: rgba(26, 36, 56, 0.5);
}
.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { margin-bottom: .75rem; }
.related-list a {
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  display: block;
  line-height: 1.4;
}
.related-list a:hover { color: var(--cyan); }

/* ========== BRANDS ========== */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}
.brand-strip img {
  height: 36px;
  width: auto;
  opacity: .7;
  filter: grayscale(0.2);
  transition: opacity .2s;
}
.brand-strip img:hover { opacity: 1; }

/* ========== ERROR PAGES ========== */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}
.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: .5rem;
}
.error-page h1 { font-size: 1.6rem; }
.error-page p { max-width: 420px; margin: 0 auto 1.5rem; }

/* ========== FOOTER ========== */
.site-footer {
  border-top: 1px solid var(--line);
  background: #070b13;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand img {
  height: 40px;
  width: auto;
  margin-bottom: .85rem;
}
.footer-brand p { font-size: .9rem; }
.footer-col h4 {
  font-size: .92rem;
  margin-bottom: .9rem;
  color: #fff;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: var(--muted); font-size: .9rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  font-size: .84rem;
  color: var(--muted);
}
.disclaimer {
  font-size: .82rem;
  color: #7f8ea3;
  max-width: 720px;
  margin-top: 1rem;
}

/* ========== MISC ========== */
.cta-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem 1.75rem;
  border-radius: 16px;
  border: 1px solid rgba(61, 139, 253, 0.35);
  background:
    linear-gradient(120deg, rgba(61, 139, 253, 0.16), rgba(16, 24, 40, 0.5)),
    url('promo-vi.1ee9.png') right center / contain no-repeat;
  background-color: var(--bg-3);
}
.cta-banner h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.cta-banner p { margin: 0; max-width: 480px; }
.list-page .article-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(26, 36, 56, 0.35);
}
.list-page .article-card .thumb { margin: 0; }
.list-page .article-card .thumb img { aspect-ratio: 16/11; }

.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 6px;
  background: rgba(61, 139, 253, 0.15);
  color: var(--cyan);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .intro-block { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar-box { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-banner { grid-template-columns: 1fr; background-image: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .nav-desktop, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .brand img { height: 36px; max-height: 36px; }
  .hero { min-height: min(70vh, 520px); }
  .hero-content { margin-bottom: 2.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .guide-row { grid-template-columns: 88px 1fr; }
  .guide-row img { width: 88px; height: 64px; }
  .list-page .article-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section { padding: 3rem 0; }
  .cat-detail,
  .prose article[id] {
    grid-template-columns: 1fr !important;
  }
  .prose article[id] img {
    width: 140px;
    height: 140px;
    margin-inline: auto;
  }
}

@media (min-width: 769px) {
  .nav-mobile { display: none !important; }
}
