/* KGame – kg-app.autos | Design system */
:root {
  --bg: #0a0e17;
  --bg-elev: #121826;
  --bg-soft: #1a2235;
  --line: rgba(120, 160, 220, 0.16);
  --text: #e8eef8;
  --muted: #9aabc4;
  --blue: #2f9dff;
  --blue-deep: #1570c7;
  --gold: #d4a84b;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --radius: 14px;
  --header-h: 68px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
  --max: 1160px;
}

*,
*::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 500px at 10% -10%, rgba(47, 157, 255, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(212, 168, 75, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, var(--bg) 40%, #080b12 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7bc4ff;
}

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;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.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(8, 12, 20, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--header-h);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: calc(var(--header-h) - 20px);
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  opacity: 0.88;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--blue);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-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(--blue);
  color: var(--blue);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-soft);
  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: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.35rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.nav-mobile.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-mobile a {
  display: block;
  padding: 0.7rem 0.2rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.nav-mobile .mobile-auth {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.nav-mobile .mobile-auth .btn {
  flex: 1;
}

main {
  padding-top: var(--header-h);
}

/* 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;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.35) 0%, rgba(8, 12, 20, 0.72) 45%, rgba(8, 12, 20, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 12, 20, 0.75) 0%, rgba(8, 12, 20, 0.25) 55%, rgba(8, 12, 20, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 680px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  color: #f3f7ff;
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.05rem;
  color: #c5d3e8;
  max-width: 36rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.reveal {
  animation: fadeUp 0.7s ease both;
}

.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 24, 38, 0.55), transparent);
  border-block: 1px solid var(--line);
}

/* Intro / prose */
.prose {
  max-width: 720px;
}

.prose p {
  font-size: 1.02rem;
}

.prose a.ext {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.intro-visual img {
  max-height: 360px;
  width: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  animation: floaty 4.5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.1rem 0.8rem 1.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cat-item:hover {
  border-color: rgba(47, 157, 255, 0.45);
  transform: translateY(-3px);
  color: #fff;
}

.cat-item img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.cat-item span {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 157, 255, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .tag {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.8rem;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
}

/* Guides row */
.guide-list {
  display: grid;
  gap: 0.9rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  transition: border-color 0.2s ease;
}

.guide-row:hover {
  border-color: rgba(47, 157, 255, 0.4);
  color: inherit;
}

.guide-row img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
}

.guide-row h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.guide-row p {
  margin: 0;
  font-size: 0.9rem;
}

.guide-row .arrow {
  color: var(--blue);
  font-weight: 700;
  padding-right: 0.4rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2) brightness(1.05);
}

/* Promo banners */
.promo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.promo-row a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.promo-row img {
  width: 100%;
  height: auto;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 2.5rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 1.25rem;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
}

.faq-item .faq-body p {
  margin: 0;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 157, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--blue);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body h2 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
}

.article-body h3 {
  margin-top: 1.35rem;
  font-size: 1.1rem;
  color: #dce7f7;
}

.article-body ul,
.article-body ol {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: start;
}

.sidebar-block {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.related-link {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.75rem;
  color: inherit;
}

.related-link:last-child {
  margin-bottom: 0;
}

.related-link img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-soft);
}

.related-link span {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
}

.related-link:hover span {
  color: var(--blue);
}

/* Category showcase on the-loai */
.cat-showcase {
  display: grid;
  gap: 1.25rem;
}

.cat-panel {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.15rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cat-panel img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin: 0 auto;
}

.cat-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.cat-panel p {
  margin-bottom: 0.6rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--blue);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page h1 {
  font-size: 1.5rem;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #070a10;
  padding: 2.75rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 38px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 28rem;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: #fff;
}

.footer-col a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--blue);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Utilities */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.text-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.check-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.note-box {
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--blue);
  background: rgba(47, 157, 255, 0.08);
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

.note-box p {
  margin: 0;
  color: #c9d7eb;
}

/* Responsive */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid,
  .article-layout,
  .footer-grid,
  .cat-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .promo-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .brand img {
    height: 34px;
  }

  .nav-desktop,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-mobile {
    display: block;
  }

  .hero {
    min-height: 68vh;
  }

  .hero-content {
    margin-bottom: 2.2rem;
  }

  .guide-row {
    grid-template-columns: 88px 1fr;
  }

  .guide-row .arrow {
    display: none;
  }

  .guide-row img {
    width: 88px;
    height: 66px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2.5rem 0;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .cat-item {
    padding: 0.85rem 0.5rem;
  }

  .cat-item img {
    width: 78px;
    height: 78px;
  }
}
