/* KGame – k-game-kg.autos */
:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --surface: #ffffff;
  --ink: #132033;
  --muted: #4a5b70;
  --line: #d5e0ec;
  --brand: #2b6cff;
  --brand-deep: #1a4fd6;
  --brand-soft: #e8f0ff;
  --navy: #0f1b2d;
  --navy-2: #16263d;
  --accent: #0ea5a0;
  --warn: #c2410c;
  --ok: #15803d;
  --shadow: 0 12px 40px rgba(15, 27, 45, 0.08);
  --radius: 14px;
  --nav-h: 72px;
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", 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(43, 108, 255, 0.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(14, 165, 160, 0.1), transparent 55%),
    linear-gradient(180deg, #e8eef6 0%, var(--bg) 40%, #e9f2f4 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(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
  color: var(--muted);
}

.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, rgba(15, 27, 45, 0.97), rgba(22, 38, 61, 0.96));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.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;
  text-decoration: none;
  max-width: min(48vw, 220px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  color: #e8eef8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: #c9d6e8;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(43, 108, 255, 0.22);
  text-decoration: none;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.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;
  text-decoration: none !important;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 108, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b78ff, #1f57e0);
}

.btn-ghost {
  background: transparent;
  color: #e8eef8;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-light {
  background: var(--surface);
  color: var(--brand-deep);
  border-color: var(--line);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eef3fa;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: rgba(15, 27, 45, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0 1.25rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav a {
  color: #d7e2f2;
  padding: 0.75rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 500;
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.mobile-auth .btn {
  width: 100%;
}

@media (min-width: 960px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }
  .menu-toggle,
  .mobile-panel {
    display: none !important;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  align-items: end;
  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-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 18, 32, 0.88) 0%, rgba(10, 18, 32, 0.55) 48%, rgba(10, 18, 32, 0.35) 100%),
    linear-gradient(180deg, rgba(10, 18, 32, 0.2) 0%, rgba(10, 18, 32, 0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
  animation: riseIn 0.7s ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  margin-bottom: 0.55rem;
}

.hero h1 {
  color: #f2f6fc;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hero p {
  color: #c5d2e4;
  font-size: 1.05rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
}

.section-head p {
  margin-bottom: 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2));
}

.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 1.8rem;
}

.prose a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead {
  font-size: 1.08rem;
  color: var(--ink);
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 720px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-item {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  aspect-ratio: 1 / 1.05;
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.cat-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.04);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.9rem 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(8, 14, 24, 0.92));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.98rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

@media (min-width: 700px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  height: 100%;
  text-decoration: none;
}

.article-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--navy-2);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .body {
  padding: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--ink);
}

.article-card p {
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

/* Brand intro */
.brand-panel {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .brand-panel {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.brand-visual {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #13233a, #1c3558);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.brand-visual img {
  max-height: 420px;
  width: auto;
  margin-inline: auto;
}

.brand-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
  align-items: center;
}

.brand-logos img {
  height: 28px;
  width: auto;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 650;
  font-family: var(--font-display);
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.4rem 0 1.5rem;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.3rem 1.8rem;
  box-shadow: var(--shadow);
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 1.25rem;
  background: var(--navy);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.side-links {
  display: grid;
  gap: 0.55rem;
}

.side-links a {
  color: var(--ink);
  font-weight: 550;
  font-size: 0.92rem;
}

/* Related */
.related-grid {
  display: grid;
  gap: 0.85rem;
}

.related-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
  text-decoration: none;
  align-items: center;
}

.related-item img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.related-item strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Promo strip */
.cta-strip {
  background: linear-gradient(120deg, #13233a, #1c3f78 55%, #146b73);
  color: #fff;
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 760px) {
  .cta-strip {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.cta-strip h2 {
  color: #fff;
  margin-bottom: 0.4rem;
}

.cta-strip p {
  color: #c9d7ea;
  margin: 0;
}

.cta-visual img {
  margin-inline: auto;
  max-height: 220px;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 6.5rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #b8c6d9;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.site-footer a {
  color: #b8c6d9;
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-brand img {
  height: 36px;
  margin-bottom: 0.8rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

/* Utilities */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
  background: var(--brand-soft);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.list-check {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
}

.list-check li {
  margin-bottom: 0.45rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.menu-open {
  overflow: hidden;
}
