/* KGame – kgamee.lol */
:root {
  --bg: #0a0e17;
  --bg-2: #101726;
  --bg-3: #162033;
  --surface: rgba(22, 32, 51, 0.72);
  --text: #eef2f7;
  --muted: #9aa6b8;
  --accent: #2f8fff;
  --accent-deep: #1a6fd4;
  --accent-soft: rgba(47, 143, 255, 0.14);
  --line: rgba(255, 255, 255, 0.08);
  --gold: #d4a84b;
  --ok: #3ecf8e;
  --danger: #ff6b6b;
  --header-h: 72px;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font-display: "Outfit", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --max: 1160px;
  --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(47, 143, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 168, 75, 0.08), transparent 45%),
    linear-gradient(180deg, #0a0e17 0%, #0d1320 40%, #0a0e17 100%);
  background-attachment: fixed;
  line-height: 1.7;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #7cb8ff;
}

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.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; color: var(--muted); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--header-h);
  backdrop-filter: blur(16px);
  background: rgba(10, 14, 23, 0.82);
  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;
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 24px);
}

.brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.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: var(--accent-soft);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.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;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(47, 143, 255, 0.28);
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: rgba(47, 143, 255, 0.45);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
}

.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 .menu-label::after { content: "Menu"; }
.menu-toggle.is-open .menu-label::after { content: "Đóng"; }

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  right: 0;
  left: 0;
  z-index: 999;
  background: rgba(12, 17, 28, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.3s;
}

.nav-mobile.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-mobile a {
  color: var(--text);
  padding: 0.75rem 0;
  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; }

@media (min-width: 960px) {
  .nav-desktop,
  .header-actions { display: flex; }
  .menu-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

main { padding-top: var(--header-h); }

/* Hero */
.hero {
  position: relative;
  min-height: clamp(380px, 72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 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(180deg, rgba(10, 14, 23, 0.35) 0%, rgba(10, 14, 23, 0.55) 40%, rgba(10, 14, 23, 0.96) 100%),
    linear-gradient(90deg, rgba(10, 14, 23, 0.75) 0%, rgba(10, 14, 23, 0.2) 55%, rgba(10, 14, 23, 0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 3rem;
  max-width: 680px;
  animation: rise 0.8s var(--ease) both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  background: linear-gradient(90deg, #fff, #9ec8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.02rem;
  max-width: 52ch;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 640px;
}

.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.45rem;
}

/* Intro / brand */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
  animation: fadeIn 1s var(--ease) both;
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.feature-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.feature-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.75rem;
  align-items: start;
  color: var(--muted);
}

.feature-list .dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 700px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  .cat-grid { grid-template-columns: repeat(6, 1fr); }
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  padding: 1rem 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  border: 1px solid transparent;
  color: var(--text);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}

.cat-item:hover {
  border-color: rgba(47, 143, 255, 0.35);
  background: var(--accent-soft);
  color: #fff;
  transform: translateY(-4px);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}

.cat-item span {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Article grids */
.article-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .article-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .article-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}

.article-item {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: inherit;
  transition: transform 0.25s var(--ease);
}

.article-item:hover { transform: translateY(-3px); color: inherit; }

.article-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.article-item:hover .article-thumb img {
  transform: scale(1.04);
}

.article-meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-item h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.article-item p {
  margin: 0;
  font-size: 0.92rem;
}

/* Guide list */
.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-row {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  transition: border-color 0.25s, background 0.25s;
}

.guide-row:hover {
  border-color: rgba(47, 143, 255, 0.4);
  background: var(--accent-soft);
  color: inherit;
}

@media (min-width: 700px) {
  .guide-row {
    grid-template-columns: 140px 1fr auto;
  }
}

.guide-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-3);
}

.guide-row h3 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1.05rem;
}

.guide-row p { margin: 0; font-size: 0.9rem; }

.guide-row .more {
  font-weight: 600;
  color: var(--accent);
  white-space:nowrap;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2) brightness(1.1);
  transition: opacity 0.2s;
}

.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: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Promo band */
.promo-band {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(47, 143, 255, 0.12), transparent 50%),
    var(--bg-3);
}

@media (min-width: 800px) {
  .promo-band {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.promo-band img {
  max-width: 320px;
  margin-inline: auto;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { opacity: 0.5; }

/* Article body */
.article-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prose h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose ul, .prose ol {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose a { text-decoration: underline; text-underline-offset: 3px; }

.sidebar {
  display: grid;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.side-block {
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.side-block h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.side-links a {
  color: var(--text);
  font-size: 0.92rem;
  display: block;
  line-height: 1.4;
}

.side-links a:hover { color: var(--accent); }

/* Category detail blocks */
.cat-detail-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .cat-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cat-detail {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

@media (min-width: 560px) {
  .cat-detail {
    grid-template-columns: 120px 1fr;
    align-items: center;
  }
}

.cat-detail img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-inline: auto;
}

.cat-detail h3 { margin-bottom: 0.4rem; }
.cat-detail p { margin: 0; font-size: 0.92rem; }

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 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(--accent), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.9);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 36ch;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: #fff;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--accent); }

.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;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
