/* KGame – k-game-web.lat */
:root {
  --bg: #070b14;
  --bg-2: #0d1422;
  --surface: #121a2b;
  --surface-2: #182234;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9eef7;
  --muted: #93a0b8;
  --blue: #2f86ff;
  --blue-2: #1a5fd4;
  --gold: #c9a24a;
  --gold-2: #e2c06a;
  --danger: #e25555;
  --radius: 14px;
  --nav-h: 68px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Rajdhani", "Be Vietnam Pro", sans-serif;
  --max: 1180px;
}

*,
*::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(47, 134, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(201, 162, 74, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 40%, var(--bg) 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--gold-2);
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 0.55em;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }

p { margin: 0 0 1em; color: var(--muted); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(14px);
  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);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.35rem;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.88;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--gold-2);
  opacity: 1;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.btn-ghost:hover { color: var(--gold-2); border-color: var(--gold); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(320px, 100%);
  height: calc(100vh - var(--nav-h));
  background: rgba(10, 15, 26, 0.98);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-panel.open { transform: translateX(0); }

.mobile-panel a {
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel a.active {
  background: rgba(47, 134, 255, 0.12);
  color: var(--gold-2);
}

.mobile-auth {
  margin-top: auto;
  display: grid;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.nav-overlay {
  position: fixed;
  inset: var(--nav-h) 0 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Hero */
.page-main { padding-top: var(--nav-h); }

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: 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;
  animation: heroZoom 14s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 11, 20, 0.92) 0%, rgba(7, 11, 20, 0.55) 48%, rgba(7, 11, 20, 0.35) 100%),
    linear-gradient(0deg, rgba(7, 11, 20, 0.95) 0%, transparent 42%);
}

.hero-content {
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
  animation: riseIn 0.8s ease both;
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.35em;
  background: linear-gradient(180deg, #fff 20%, #9ec2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.7em;
}

.hero p {
  font-size: 1.02rem;
  max-width: 34rem;
  color: #c5d0e4;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 1.8rem;
}

.section-head p {
  max-width: 46rem;
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 26, 43, 0.55), rgba(18, 26, 43, 0.15));
  border-block: 1px solid var(--line);
}

.prose {
  max-width: 760px;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ext-link {
  color: var(--gold-2);
  font-weight: 600;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 160px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 134, 255, 0.45);
}

.cat-item img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background:
    radial-gradient(circle at 50% 40%, rgba(47, 134, 255, 0.18), transparent 60%),
    #0a101c;
  padding: 0.75rem;
}

.cat-item span {
  display: block;
  padding: 0.85rem 1rem 1rem;
  color: var(--text);
  font-weight: 600;
  font-family: var(--display);
  letter-spacing: 0.03em;
  font-size: 1.15rem;
}

/* Article cards */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  display: grid;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  background: #0a101c;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 0 1rem 1.15rem;
}

.article-card .meta {
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.article-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.18rem;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--blue);
}

.article-card p {
  font-size: 0.94rem;
  margin: 0;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  list-style: none;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--gold);
  font-weight: 700;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  margin: 0;
}

/* Page hero compact */
.page-hero {
  padding: 2.8rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(47, 134, 255, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(18, 26, 43, 0.7), transparent);
}

.page-hero .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.page-hero .breadcrumb a { color: var(--muted); }
.page-hero .breadcrumb a:hover { color: var(--gold-2); }
.page-hero .breadcrumb span { opacity: 0.5; }

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a101c;
  margin-bottom: 1.5rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin: 0 auto;
}

.article-body h2,
.article-body h3 {
  margin-top: 1.6em;
}

.related {
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.side-box h3 { margin-bottom: 0.85rem; }

.side-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.side-box a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.side-box a:hover { color: var(--blue); }

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s ease;
}

.brand-strip img:hover { opacity: 1; }

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  background: linear-gradient(180deg, var(--blue), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.2em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #060910;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 28rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  color: var(--gold-2);
}

.footer-col a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.disclaimer {
  font-size: 0.82rem;
  color: #7d889c;
  max-width: 60rem;
}

/* Guides list */
.guide-row {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.85rem;
  transition: border-color 0.2s ease;
}

.guide-row:hover { border-color: rgba(47, 134, 255, 0.4); }

.guide-row img {
  width: 100%;
  max-width: 120px;
  height: 90px;
  object-fit: contain;
  background: #0a101c;
  border-radius: 10px;
}

.guide-row h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.guide-row h3 a { color: var(--text); }
.guide-row h3 a:hover { color: var(--blue); }
.guide-row p { margin: 0; font-size: 0.92rem; }

/* Split content blocks (category/about) */
.split-block {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.split-block img.thumb-cat {
  width: min(160px, 40vw);
  height: auto;
  object-fit: contain;
  background: #0a101c;
  border-radius: var(--radius);
  justify-self: start;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }

.mt-2 { margin-top: 2rem; }

@media (min-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .guide-row {
    grid-template-columns: 120px 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr 300px;
  }

  .split-block {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}

@media (min-width: 992px) {
  .nav-desktop,
  .nav-actions {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  .nav-desktop,
  .nav-actions {
    display: none !important;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}
