/* KGame – kg-app.cfd */
:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --ink: #121a26;
  --muted: #5a6a7c;
  --line: #d5dee8;
  --brand: #1a8cff;
  --brand-deep: #0a6fd4;
  --navy: #0b1220;
  --navy-2: #141e30;
  --gold: #c9a227;
  --ok: #1f8a5b;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(11, 18, 32, 0.08);
  --header-h: 68px;
  --max: 1120px;
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Sora", "Be Vietnam Pro", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(26, 140, 255, 0.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 40%, #e8eef5 100%);
  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 {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  text-decoration: none;
  max-width: 48%;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

.brand-text {
  font-family: var(--display);
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(26, 140, 255, 0.18);
  text-decoration: none;
}

.header-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.55rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-light {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-light:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--navy-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem 1.1rem;
  z-index: 999;
  box-shadow: var(--shadow);
}

.nav-mobile.open {
  display: block;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-mobile a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 500;
}

.nav-mobile .mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.nav-mobile .mobile-auth .btn {
  width: 100%;
}

main {
  padding-top: var(--header-h);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--navy);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 14, 26, 0.88) 0%, rgba(8, 14, 26, 0.55) 48%, rgba(8, 14, 26, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 14, 26, 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  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(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  margin: 0 0 0.35em;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75em;
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  max-width: 36rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

/* ===== Sections ===== */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.lead-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.lead-block img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.prose {
  color: var(--ink);
}

.prose a.ext-link {
  color: var(--brand-deep);
  font-weight: 600;
  border-bottom: 1px solid rgba(26, 140, 255, 0.35);
}

/* ===== Cards / grids ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.6s ease both;
}

.cat-card:nth-child(2) { animation-delay: 0.05s; }
.cat-card:nth-child(3) { animation-delay: 0.1s; }
.cat-card:nth-child(4) { animation-delay: 0.15s; }
.cat-card:nth-child(5) { animation-delay: 0.2s; }
.cat-card:nth-child(6) { animation-delay: 0.25s; }
.cat-card:nth-child(7) { animation-delay: 0.3s; }
.cat-card:nth-child(8) { animation-delay: 0.35s; }

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.cat-card .thumb {
  aspect-ratio: 1 / 1;
  background: #0b1220;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cat-card .thumb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.cat-card .body {
  padding: 0.9rem 1rem 1.1rem;
}

.cat-card h3 {
  font-size: 1rem;
  margin: 0 0 0.35em;
}

.cat-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .cover {
  aspect-ratio: 16 / 10;
  background: var(--navy);
  overflow: hidden;
}

.article-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .body {
  padding: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5em;
}

.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--brand-deep);
}

.article-card p {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-deep);
  margin-top: 0.4rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.faq-item h3 {
  font-size: 1.02rem;
  margin: 0 0 0.4em;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.4rem 0 1.6rem;
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.96), rgba(20, 40, 70, 0.92)),
    url("banner.3dd2.webp") center/cover;
  color: #fff;
}

.page-hero h1 {
  margin: 0.2em 0 0.4em;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.page-hero p {
  margin: 0;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.82);
}

.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
}

.content-wrap {
  padding: 2.4rem 0 3.5rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem 2rem;
}

.article-body .cover-xl {
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 1.3rem;
  background: var(--navy);
}

.article-body .cover-xl img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.3rem;
  margin-top: 1.6rem;
}

.article-body h3 {
  font-size: 1.08rem;
  margin-top: 1.2rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
  color: var(--muted);
}

.article-body li {
  margin-bottom: 0.4rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.side-box h3 {
  font-size: 0.98rem;
  margin: 0 0 0.7em;
}

.side-box a {
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
}

.side-box a:last-child {
  border-bottom: 0;
}

.side-box a:hover {
  color: var(--brand-deep);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Feature split */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.feature-row img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

.feature-row.reverse .text { order: 2; }
.feature-row.reverse .media { order: 1; }

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin: 0;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.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: 0.8rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #fff;
}

.footer-brand img {
  height: 38px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  margin-bottom: 0.8rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  justify-content: space-between;
}

.list-page .article-card {
  height: 100%;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
  background: rgba(26, 140, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lead-block,
  .feature-row,
  .feature-row.reverse .text,
  .feature-row.reverse .media,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .text,
  .feature-row.reverse .media {
    order: initial;
  }
}

@media (max-width: 820px) {
  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand {
    max-width: 70%;
  }

  .brand img {
    height: 36px;
    max-width: 140px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }

  .cat-grid,
  .card-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content {
    padding: 2.4rem 0 2.2rem;
  }

  .article-body {
    padding: 1.15rem 1rem 1.5rem;
  }

  .brand-strip img {
    height: 28px;
  }
}
