/* KGame – kkgamec.autos | Design system */
:root {
  --bg: #0b1220;
  --bg-soft: #121a2b;
  --bg-elevated: #182338;
  --surface: #1c2a42;
  --line: rgba(148, 178, 220, 0.18);
  --text: #e8eef8;
  --text-muted: #9aadc8;
  --brand: #4f9cf0;
  --brand-deep: #2f7ad4;
  --accent: #d4af37;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1180px;
  --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79, 156, 240, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 175, 55, 0.08), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0d1524 100%);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #7eb6ff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; color: var(--text-muted); }

ul, ol { color: var(--text-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: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--nav-h);
  padding: 10px 0;
}

.logo img {
  height: 44px;
  width: auto;
  max-height: calc(var(--nav-h) - 20px);
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(79, 156, 240, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  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: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(14, 22, 38, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  box-shadow: var(--shadow);
}

.mobile-panel.open { display: block; }

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-panel a {
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* 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 top;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 26, 0.92) 0%, rgba(8, 14, 26, 0.55) 55%, rgba(8, 14, 26, 0.35) 100%),
    linear-gradient(0deg, rgba(11, 18, 32, 0.95) 0%, transparent 45%);
}

.hero-content {
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
  animation: rise 0.8s var(--ease) both;
}

.hero-brand {
  display: inline-block;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 20%, #9ec7ff 60%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.6rem;
}

.hero h1 {
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(24, 35, 56, 0.45), transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 720px;
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Intro / prose */
.prose {
  max-width: 760px;
}

.prose p,
.prose li {
  font-size: 1.02rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  transition: transform 0.25s var(--ease), border-color 0.25s;
  animation: rise 0.7s var(--ease) both;
}

.cat-item:nth-child(2) { animation-delay: 0.05s; }
.cat-item:nth-child(3) { animation-delay: 0.1s; }
.cat-item:nth-child(4) { animation-delay: 0.15s; }
.cat-item:nth-child(5) { animation-delay: 0.2s; }
.cat-item:nth-child(6) { animation-delay: 0.25s; }
.cat-item:nth-child(7) { animation-delay: 0.3s; }
.cat-item:nth-child(8) { animation-delay: 0.35s; }

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 156, 240, 0.45);
}

.cat-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #05080f;
  padding: 0.75rem;
}

.cat-item span {
  display: block;
  padding: 0.85rem 1rem 1rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 156, 240, 0.4);
}

.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #05080f;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  padding: 1.05rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.card-body h3 a {
  color: var(--text);
}

.card-body h3 a:hover {
  color: var(--brand);
}

.card-body p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.card-link {
  font-size: 0.88rem;
  font-weight: 600;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 0;
  font-weight: 600;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-size: 1.2rem;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item p {
  padding-bottom: 1rem;
  margin: 0;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(79, 156, 240, 0.08), transparent);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

/* Article */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  background: #05080f;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-inline: auto;
}

.article-content h2 {
  margin-top: 1.75rem;
}

.article-content h3 {
  margin-top: 1.35rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
}

.sidebar-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-list li {
  border-bottom: 1px solid var(--line);
}

.side-list a {
  display: block;
  padding: 0.7rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.side-list a:hover { color: var(--brand); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* About / legal */
.content-page {
  padding: 2.5rem 0 4rem;
  max-width: 820px;
}

.content-page h2 {
  margin-top: 2rem;
}

.notice {
  background: rgba(232, 93, 93, 0.1);
  border: 1px solid rgba(232, 93, 93, 0.35);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  color: #f0c4c4;
  margin: 1.25rem 0;
}

.notice strong { color: #ffd0d0; }

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: flex;
  align-items: center;
  text-align: center;
  padding: 4rem 0;
}

.error-page .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  background: #070c16;
  border-top: 1px solid var(--line);
  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;
}

.footer-brand img {
  height: 40px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.9rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.28rem 0;
}

.footer-col a:hover { color: var(--brand); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0;
  opacity: 0.75;
}

.brand-row img {
  height: 28px;
  width: auto;
  filter: grayscale(0.3);
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(79, 156, 240, 0.15);
  color: #9ec7ff;
  margin-bottom: 0.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.feature-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05080f;
}

.feature-visual img {
  width: 100%;
  object-fit: contain;
  max-height: 360px;
  margin-inline: auto;
}

.list-clean {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.list-clean li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
}

.list-clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* Responsive */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid,
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }

  .nav-desktop,
  .nav-actions { display: none; }

  .menu-toggle { display: inline-flex; margin-left: auto; }

  .logo img {
    height: 38px;
    max-height: calc(var(--nav-h) - 18px);
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content {
    padding: 3.5rem 0 2.5rem;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .section { padding: 3rem 0; }

  .card[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .cat-item span { font-size: 0.85rem; padding: 0.65rem 0.75rem 0.85rem; }
}
