/* KGame – k-gm.lat | Premium gaming info portal */
:root {
  --bg-deep: #0a0e17;
  --bg-base: #0f1520;
  --bg-elevated: #161d2c;
  --bg-card: #1a2335;
  --bg-hover: #222c42;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e8eef8;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-deep: #1d4ed8;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 72px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-display: "Sora", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
  --max: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 40%, #0c121c 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--gold-soft);
}

ul, ol {
  padding-left: 1.2rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

p { margin: 0 0 1rem; color: var(--text-muted); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== Header / Nav ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
  overflow: hidden;
}

.brand img {
  height: 44px;
  width: auto;
  max-height: 44px;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.12);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #a67c00 100%);
  color: #111;
}

.btn-gold:hover { color: #111; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
}

.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 .toggle-label::after { content: "Menu"; }
.menu-toggle.is-open .toggle-label::after { content: "Đóng"; }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.5rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.nav-mobile.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-mobile ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.nav-mobile a {
  display: block;
  padding: 0.85rem 0.5rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.nav-mobile-actions {
  display: grid;
  gap: 0.65rem;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.72) 45%, rgba(8, 12, 22, 0.45) 100%),
    linear-gradient(0deg, var(--bg-deep) 0%, transparent 35%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0 5rem;
  max-width: 640px;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #fff 20%, var(--accent-bright) 70%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.75rem;
}

.hero h1 {
  color: var(--text);
  margin-bottom: 1rem;
}

.hero .lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Sections ===== */
.section {
  padding: 4.5rem 0;
  position: relative;
}

.section-alt {
  background: linear-gradient(180deg, rgba(22, 29, 44, 0.55), rgba(15, 21, 32, 0.2));
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
  animation: fadeUp 0.6s var(--ease) both;
}

.section-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 0.6rem;
}

.section-head p {
  margin-bottom: 0;
}

.prose {
  max-width: 46rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.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.15rem;
}

/* Category tiles */
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.35rem 1rem 1.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  color: var(--text);
  animation: fadeUp 0.55s var(--ease) both;
}

.cat-tile:nth-child(2) { animation-delay: 0.06s; }
.cat-tile:nth-child(3) { animation-delay: 0.12s; }
.cat-tile:nth-child(4) { animation-delay: 0.18s; }
.cat-tile:nth-child(5) { animation-delay: 0.24s; }
.cat-tile:nth-child(6) { animation-delay: 0.3s; }
.cat-tile:nth-child(7) { animation-delay: 0.36s; }
.cat-tile:nth-child(8) { animation-delay: 0.42s; }

.cat-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--bg-hover);
  color: var(--text);
}

.cat-tile img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 0.85rem;
  transition: transform 0.35s var(--ease);
}

.cat-tile:hover img {
  transform: scale(1.06);
}

.cat-tile h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.cat-tile p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-soft);
}

/* Article cards */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s;
  height: 100%;
  color: inherit;
  animation: fadeUp 0.55s var(--ease) both;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.article-card .read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-bright);
}

/* Brand intro visual */
.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  min-height: 280px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  padding: 1.5rem 0 0;
  opacity: 0.75;
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.1);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Page hero (inner pages) */
.page-hero {
  margin-top: var(--nav-h);
  padding: 3.25rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(800px 300px at 20% 0%, rgba(59, 130, 246, 0.15), transparent 60%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--text-soft);
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

.article-main {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 2rem;
}

.article-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #000;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.article-main h1 {
  margin-bottom: 1.25rem;
}

.article-main h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-main h3 {
  margin-top: 1.35rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.side-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-links li {
  margin-bottom: 0.65rem;
}

.side-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  display: block;
  line-height: 1.4;
}

.side-links a:hover { color: var(--accent-bright); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  margin-top: 1.5rem;
}

/* Error pages */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 2rem) 2rem 2rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #070a11;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 40px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--accent-bright); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-bright);
  margin-bottom: 0.5rem;
}

.list-page .article-card .thumb img {
  object-fit: contain;
  background: #0a0a0a;
  padding: 0.5rem;
}

.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.15rem;
  align-items: center;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s;
  color: inherit;
}

.guide-item:hover {
  border-color: rgba(59, 130, 246, 0.45);
  color: inherit;
}

.guide-item img {
  width: 120px;
  height: 90px;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius-sm);
}

.guide-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.guide-item p {
  margin: 0;
  font-size: 0.9rem;
}

.cta-band {
  padding: 2.5rem;
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(29, 78, 216, 0.35), rgba(15, 21, 32, 0.9)),
    url("banner.3dd2.webp") center/cover;
  border: 1px solid var(--line-strong);
  text-align: center;
}

.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(232, 238, 248, 0.85); max-width: 36rem; margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; }

/* Responsive */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .nav-desktop,
  .nav-actions { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav-mobile { display: block; }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .brand img { height: 36px; max-height: 36px; }
  .grid-4,
  .grid-3,
  .related-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-content { padding: 2.5rem 0 3rem; }
  .section { padding: 3rem 0; }
  .guide-item { grid-template-columns: 88px 1fr; gap: 0.85rem; }
  .guide-item img { width: 88px; height: 70px; }
  .article-main { padding: 1.2rem; }
  .cta-band { padding: 1.75rem 1.25rem; }
}
