/* KGame - k-game.baby | Portal styles */
:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-card: #162033;
  --bg-soft: #1b2740;
  --line: rgba(140, 170, 220, 0.18);
  --text: #eef2f8;
  --muted: #9aa8c0;
  --primary: #4a89f3;
  --primary-2: #7bb3ff;
  --accent: #2dd4bf;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --container: 1160px;
  --header-h: 72px;
  --font-display: "Be Vietnam Pro", "Segoe UI", 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(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(74, 137, 243, 0.22), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(45, 212, 191, 0.12), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0a1322 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-2);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.86);
  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: inline-flex;
  align-items: center;
  color: var(--text);
}

.brand img {
  width: auto;
  max-width: 148px;
  height: auto;
}

.site-header .brand {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 168px;
  height: 36px;
  max-height: 36px;
  overflow: hidden;
  line-height: 0;
}

.site-header .brand img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 36px;
  max-height: 36px;
  object-fit: contain;
  object-position: left center;
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Mobile top bar: only SVG + Menu/Đóng; auth stays inside drawer */
@media (max-width: 959px) {
  .header-actions > .btn {
    display: none !important;
  }

  .site-header .brand {
    max-width: min(128px, 52vw);
    height: 30px;
    max-height: 30px;
  }

  .site-header .brand img {
    height: 30px;
    max-height: 30px;
  }

  .header-actions {
    gap: 0;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.2rem;
}

.nav-desktop a {
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(74, 137, 243, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2f6fe0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(74, 137, 243, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-toggle [hidden] {
  display: none !important;
}

.mobile-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  background: rgba(12, 18, 30, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0 1rem;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--text);
  border-radius: 10px;
  font-weight: 600;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(74, 137, 243, 0.14);
}

.mobile-nav .mobile-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0.5rem 1rem 0.25rem;
}

@media (min-width: 960px) {
  .nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-nav,
  .mobile-nav.open {
    display: none !important;
  }
}

/* Hero */
.hero {
  position: relative;
  padding: 2rem 0 1rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-copy p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-visual {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: #08101d;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(8, 16, 29, 0.78);
  border: 1px solid var(--line);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
  }
}

/* Sections */
.section {
  padding: 2.75rem 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.section-link {
  color: var(--primary-2);
  font-weight: 700;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.intro-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 880px) {
  .intro-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

.intro-points {
  display: grid;
  gap: 0.85rem;
}

.intro-points article {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.intro-points h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.intro-points p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.phone-shot {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.phone-shot img {
  width: min(100%, 280px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@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-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #070d18;
  min-height: 180px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(74, 137, 243, 0.45);
}

.cat-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.cat-card .cat-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.85rem 0.9rem;
  background: linear-gradient(transparent, rgba(5, 10, 20, 0.92));
  font-weight: 800;
}

.cat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(74, 137, 243, 0.4);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0a1220;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(74, 137, 243, 0.14);
  color: var(--primary-2);
  font-size: 0.75rem;
  font-weight: 700;
}

.article-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: var(--text);
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  flex: 1;
}

.article-card .more {
  font-weight: 700;
  color: var(--primary-2);
  margin-top: 0.35rem;
}

/* Promo strip */
.promo-strip {
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 820px) {
  .promo-strip {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.promo-strip img {
  width: 100%;
  border-radius: 12px;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.95rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--primary-2);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Page hero / breadcrumb */
.page-hero {
  padding: 2rem 0 0.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: #fff;
}

.page-hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

/* Content layout */
.content-layout {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
}

@media (min-width: 980px) {
  .content-layout.has-sidebar {
    grid-template-columns: 1fr 320px;
  }
}

.prose {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
}

.prose h2 {
  margin: 1.6rem 0 0.7rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin: 1.25rem 0 0.55rem;
  font-size: 1.1rem;
}

.prose p,
.prose li {
  color: #c6d0e2;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose img.cover {
  width: 100%;
  border-radius: 12px;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--line);
}

.prose .note {
  background: rgba(74, 137, 243, 0.1);
  border-left: 3px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.side-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.side-list {
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  color: var(--text);
  align-items: center;
}

.side-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.side-list strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.35;
}

.related-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

@media (min-width: 720px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Filters / list */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.filter-bar a,
.filter-bar span {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.filter-bar a.active,
.filter-bar a:hover {
  background: rgba(74, 137, 243, 0.16);
  color: #fff;
  border-color: transparent;
}

/* Brands row */
.brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}

@media (min-width: 720px) {
  .brand-row {
    grid-template-columns: repeat(8, 1fr);
  }
}

.brand-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #0a1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem;
}

/* Error pages */
.error-wrap {
  min-height: calc(100vh - var(--header-h) - 220px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-wrap h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  letter-spacing: -0.04em;
}

.error-wrap p {
  color: var(--muted);
  max-width: 28rem;
  margin: 0 auto 1.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080e19;
  padding: 2.5rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.93rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.7s ease forwards;
  }

  .reveal.d1 { animation-delay: 0.08s; }
  .reveal.d2 { animation-delay: 0.16s; }
  .reveal.d3 { animation-delay: 0.24s; }

  @keyframes rise {
    to {
      opacity: 1;
      transform: none;
    }
  }

  .cat-card img,
  .article-card .thumb img {
    transition: transform 0.45s ease;
  }

  .cat-card:hover img,
  .article-card:hover .thumb img {
    transform: scale(1.04);
  }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
