/* KGame – kg-app.homes | Game info portal */
:root {
  --bg: #eef3fa;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --ink: #0f1a2e;
  --ink-soft: #3d4f6a;
  --muted: #6b7c94;
  --line: #d5e0ef;
  --brand: #1a6fe5;
  --brand-deep: #0d4fb0;
  --brand-soft: #e8f1fc;
  --accent: #00a3a3;
  --warn: #c45c26;
  --shadow: 0 12px 40px rgba(15, 40, 80, 0.08);
  --radius: 14px;
  --nav-h: 72px;
  --max: 1120px;
  --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d6e7ff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #c9f0ef 0%, transparent 50%),
    linear-gradient(180deg, #eef3fa 0%, #f7f9fc 40%, #eef3fa 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

ul {
  padding-left: 1.2rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(213, 224, 239, 0.9);
  box-shadow: 0 4px 24px rgba(15, 40, 80, 0.04);
}

#site-header {
  position: relative;
  z-index: 1000;
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
}

.brand-link img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}

.nav-desktop a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(26, 111, 229, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(26, 111, 229, 0.38);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft) !important;
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep) !important;
  background: var(--brand-soft);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  color: var(--brand-deep);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 0 1.25rem;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-panel a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid #f0f4fa;
}

.mobile-panel a:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.mobile-auth {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.25rem 0.25rem;
}

.mobile-auth .btn {
  flex: 1;
}

/* ===== 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;
  animation: heroZoom 18s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 22, 48, 0.35) 0%, rgba(8, 22, 48, 0.72) 55%, rgba(8, 22, 48, 0.9) 100%),
    linear-gradient(90deg, rgba(8, 22, 48, 0.55) 0%, transparent 60%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  color: #fff;
  max-width: 640px;
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn-ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
}

.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}

/* ===== Sections ===== */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

/* Intro */
.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.intro-visual {
  position: relative;
}

.intro-visual img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin-inline: auto;
  filter: drop-shadow(0 20px 40px rgba(15, 40, 80, 0.15));
  animation: floatY 5s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.intro-points {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.intro-points li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

.intro-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cat-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  transition: transform 0.25s;
}

.cat-item:hover {
  transform: translateX(4px);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.cat-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.cat-item p {
  margin: 0;
  font-size: 0.9rem;
}

/* Article grids */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.article-item {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.25s;
}

.article-item:hover {
  transform: translateY(-4px);
}

.article-thumb {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand-soft);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-item:hover .article-thumb img {
  transform: scale(1.04);
}

.article-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.article-item h3 {
  font-size: 1.05rem;
  margin: 0;
}

.article-item h3 a {
  color: var(--ink);
}

.article-item h3 a:hover {
  color: var(--brand);
}

.article-item > p {
  margin: 0;
  font-size: 0.92rem;
  flex: 1;
}

.read-more {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-deep);
}

/* Guide list */
.guide-list {
  display: grid;
  gap: 1.5rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.guide-row img {
  width: 140px;
  height: 105px;
  object-fit: cover;
  border-radius: 10px;
}

.guide-row h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.guide-row h3 a {
  color: var(--ink);
}

.guide-row p {
  margin: 0;
  font-size: 0.92rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 0.25rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 0;
  list-style: none;
  color: var(--ink);
  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.3rem;
  color: var(--brand);
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  padding-bottom: 1rem;
  margin: 0;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  padding: 1.5rem 0;
  opacity: 0.85;
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(0.3);
  transition: filter 0.2s, opacity 0.2s;
}

.brand-strip img:hover {
  filter: none;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
  list-style: none;
  padding: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--line);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 3rem;
}

.article-body {
  background: rgba(255, 255, 255, 0.7);
  padding: 1.75rem 1.75rem 2rem;
  border-radius: var(--radius);
}

.article-cover {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 420px;
}

.article-cover img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  margin-top: 1.35rem;
}

.article-body p,
.article-body li {
  color: var(--ink-soft);
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-block {
  margin-bottom: 1.75rem;
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.related-list li a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
}

.related-list img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

/* Category page tiles */
.cat-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.cat-page-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.cat-page-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

/* Legal / about */
.prose {
  max-width: 760px;
  padding-bottom: 3rem;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.3rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

/* Footer */
.site-footer {
  background: #0c1628;
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.72);
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
  filter: brightness(1.1);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* List page featured */
.news-list {
  display: grid;
  gap: 1.75rem;
  padding-bottom: 3rem;
}

.news-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.news-row img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
}

.news-row h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.news-row h2 a {
  color: var(--ink);
}

.news-row h2 a:hover {
  color: var(--brand);
}

/* Promo band */
.promo-band {
  display: flex;
  justify-content: center;
  padding: 1rem 0 0;
}

.promo-band img {
  max-width: min(100%, 594px);
  height: auto;
}

/* Utilities */
.ext-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 2rem; }

/* Responsive */
@media (max-width: 960px) {
  .intro-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guide-row {
    grid-template-columns: 100px 1fr;
  }

  .guide-row .btn {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  .nav-desktop,
  .nav-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand-link img {
    height: 34px;
    max-width: 140px;
  }

  .hero {
    min-height: min(70vh, 520px);
  }

  .hero-content {
    margin-bottom: 2.5rem;
  }

  .article-grid,
  .cat-grid,
  .cat-page-grid {
    grid-template-columns: 1fr;
  }

  .news-row {
    grid-template-columns: 1fr;
  }

  .news-row img {
    width: 100%;
    height: 200px;
  }

  .cat-item {
    grid-template-columns: 72px 1fr;
  }

  .cat-item img {
    width: 72px;
    height: 72px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-body {
    padding: 1.25rem;
  }

  .guide-row {
    grid-template-columns: 80px 1fr;
  }

  .guide-row img {
    width: 80px;
    height: 80px;
  }

  .cat-page-item {
    grid-template-columns: 80px 1fr;
  }

  .cat-page-item img {
    width: 80px;
    height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
