/* KGame – kg-web.sbs | Game info portal */
:root {
  --bg: #0b1220;
  --bg-2: #111b2e;
  --bg-3: #172338;
  --surface: rgba(22, 34, 56, 0.72);
  --line: rgba(140, 180, 255, 0.16);
  --text: #e8eef9;
  --muted: #9aa9c2;
  --brand: #3b8bff;
  --brand-2: #68b0ff;
  --accent: #20d3c2;
  --warm: #f0b35a;
  --danger: #ff6b7a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1160px;
  --font-display: "Oxanium", "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(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 139, 255, 0.22), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(32, 211, 194, 0.12), 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-2);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #fff;
}

ul,
ol {
  padding-left: 1.2rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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);
  display: flex;
  align-items: center;
  background: rgba(8, 14, 26, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  height: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  max-width: 160px;
}

.brand-link img {
  height: 40px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(59, 139, 255, 0.15);
}

.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.7rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(59, 139, 255, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: auto;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.menu-toggle .toggle-label::before {
  content: "Menu";
}

.menu-toggle.is-open .toggle-label::before {
  content: "Đóng";
}

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(10, 16, 28, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 999;
  box-shadow: var(--shadow);
}

.nav-mobile.is-open {
  display: flex;
  animation: slideDown 0.25s ease;
}

.nav-mobile a {
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 500;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(59, 139, 255, 0.16);
  color: #fff;
}

.nav-mobile .mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 960px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .nav-mobile {
    display: none !important;
  }
}

/* Main offset for fixed header */
main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  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(180deg, rgba(8, 14, 26, 0.35) 0%, rgba(8, 14, 26, 0.55) 40%, rgba(8, 14, 26, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 14, 26, 0.75) 0%, rgba(8, 14, 26, 0.2) 55%, rgba(8, 14, 26, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 680px;
  animation: fadeUp 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
  background: linear-gradient(135deg, #fff 20%, var(--brand-2) 70%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: #fff;
}

.hero .lead {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  max-width: 52ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(23, 35, 56, 0.45), transparent);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
}

.section-head p {
  margin: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Intro / prose */
.prose {
  max-width: 72ch;
}

.prose p {
  margin-bottom: 1.1rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 880px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.intro-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(8, 14, 26, 0.85));
  pointer-events: none;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 139, 255, 0.45);
}

.cat-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #000;
}

.cat-item span {
  display: block;
  padding: 0.85rem 0.9rem 1rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

/* Cards / article list */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 139, 255, 0.4);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent);
  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;
}

.article-card h3 a {
  color: #fff;
}

.article-card h3 a:hover {
  color: var(--brand-2);
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.9rem;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-2);
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(0.2) brightness(1.1);
  transition: opacity 0.2s ease;
}

.brand-strip img:hover {
  opacity: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: #fff;
  font-family: var(--font-display);
  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(--brand-2);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(59, 139, 255, 0.18), transparent 60%);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
  color: #fff;
}

.page-hero .lead {
  max-width: 60ch;
  margin: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand-2);
}

.breadcrumb span[aria-hidden="true"] {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

@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: var(--radius);
  padding: 1.5rem;
}

@media (min-width: 700px) {
  .article-main {
    padding: 2rem;
  }
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.article-main h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
  margin-bottom: 1.25rem;
}

.article-main h2 {
  font-size: 1.25rem;
  color: #fff;
  margin-top: 1.75rem;
}

.article-main h3 {
  font-size: 1.05rem;
  color: #dce7f8;
  margin-top: 1.35rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.side-box h3 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.85rem;
}

.side-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.side-links a {
  color: var(--muted);
  font-size: 0.92rem;
  display: block;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(140, 180, 255, 0.1);
}

.side-links a:hover {
  color: var(--brand-2);
}

.side-promo img {
  width: 100%;
  border-radius: 10px;
}

/* Category showcase on the-loai */
.cat-detail {
  display: grid;
  gap: 1.5rem;
}

.cat-row {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 720px) {
  .cat-row {
    grid-template-columns: 160px 1fr;
  }
}

.cat-row img {
  width: 100%;
  max-width: 160px;
  margin-inline: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.cat-row h2 {
  font-size: 1.2rem;
  color: #fff;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  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;
}

.error-page h1 {
  color: #fff;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #070c16;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 38px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 36ch;
}

.footer-col h3 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Utilities */
.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-2 {
  margin-top: 2rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* List page filters note */
.list-note {
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--brand);
  background: rgba(59, 139, 255, 0.08);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 0.95rem;
}
