/* KGame – k-game-web.cfd */
:root {
  --bg: #f3f6fb;
  --bg-alt: #e8eef7;
  --surface: #ffffff;
  --ink: #132033;
  --ink-soft: #3d4f66;
  --muted: #6b7c91;
  --line: #d5deea;
  --brand: #0b6bcb;
  --brand-deep: #084a8c;
  --accent: #c9a227;
  --header: #0c1524;
  --header-soft: #152238;
  --ok: #1a7a4c;
  --warn: #b45309;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(12, 21, 36, 0.08);
  --max: 1180px;
  --nav-h: 72px;
  --font-display: "Sora", "Be Vietnam Pro", 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%, rgba(11, 107, 203, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(201, 162, 39, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3fa 0%, var(--bg) 28%, #f7f9fc 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--brand-deep);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

ul, ol {
  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: linear-gradient(180deg, #0c1524 0%, #101c30 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 16px);
  overflow: hidden;
}

.brand img {
  height: 44px;
  width: auto;
  max-height: 44px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: center;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.78);
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  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: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0b6bcb, #0784e8);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #084a8c, #0b6bcb);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-outline {
  background: var(--surface);
  color: var(--brand-deep);
  border-color: var(--line);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--header-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem 1.1rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.mobile-nav.open {
  display: block;
  animation: dropIn 0.22s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
}

.mobile-nav a:hover {
  color: #fff;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.mobile-actions .btn {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0c1524;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
  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;
  background:
    linear-gradient(100deg, rgba(8, 16, 28, 0.92) 0%, rgba(8, 16, 28, 0.55) 48%, rgba(8, 16, 28, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 16, 28, 0.85) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4.5rem 0 3.5rem;
  max-width: 680px;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  max-width: 34em;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 238, 247, 0.7));
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.section-head p {
  margin: 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.45rem;
}

/* Intro / prose */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.intro-panel img {
  width: 100%;
  border-radius: 10px;
  background: #0c1524;
}

.prose h2,
.prose h3 {
  margin-top: 1.6em;
}

.prose a.ext {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-box {
  border-left: 4px solid var(--warn);
  background: #fff8eb;
  padding: 1rem 1.1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

.note-box p {
  margin: 0;
  color: #7a4a12;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-card {
  position: relative;
  display: block;
  background: #0c1524;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 190px;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
}

.cat-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 1.2rem;
  transition: transform 0.35s ease;
}

.cat-card:hover img {
  transform: scale(1.05);
}

.cat-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  background: #0c1524;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.75rem;
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: var(--ink);
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.9rem;
}

.read-more {
  font-weight: 700;
  font-size: 0.88rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.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;
}

/* 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: 650;
  font-family: var(--font-display);
  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.2rem;
  color: var(--brand);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.article-cover {
  background: #0c1524;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.article-cover img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin-inline: auto;
  padding: 1rem;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.side-list a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}

.side-list a:hover {
  color: var(--brand);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

/* Footer */
.site-footer {
  background: #0c1524;
  color: rgba(255, 255, 255, 0.75);
  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;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #fff;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  text-align: center;
  padding: 3rem 0;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Misc */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(11, 107, 203, 0.1);
  color: var(--brand-deep);
  margin-bottom: 0.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.feature-row img {
  background: #0c1524;
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  object-fit: contain;
  max-height: 320px;
}

.list-page .card-grid {
  margin-top: 0.5rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination span,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.pagination .current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

@media (max-width: 980px) {
  .nav-desktop,
  .header-actions .desktop-only {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid,
  .article-layout,
  .feature-row,
  .footer-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }

  .brand img {
    height: 36px;
    max-height: 36px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .card-grid,
  .related-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 3rem 0 2.5rem;
  }

  .section {
    padding: 3rem 0;
  }

  .article-main {
    padding: 1.15rem;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
