/* KGame – k-gm.quest | Game thông tin portal */
:root {
  --bg: #0b1220;
  --bg-2: #121b2e;
  --bg-3: #182338;
  --surface: #1a2740;
  --line: rgba(148, 175, 220, 0.18);
  --text: #e8eef8;
  --muted: #9aadc8;
  --brand: #3b9eff;
  --brand-2: #6ec8ff;
  --accent: #d4b26a;
  --accent-2: #f0d59a;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1120px;
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Sora", "Be Vietnam Pro", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(59, 158, 255, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(212, 178, 106, 0.12), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0d1524 100%);
  min-height: 100vh;
  line-height: 1.65;
}

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: var(--accent-2);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== NAV ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 16px);
  overflow: hidden;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(59, 158, 255, 0.12);
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2f8ff0, #56b7ff);
  color: #04101f;
}

.btn-primary:hover {
  color: #04101f;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-2);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(12, 19, 34, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.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 rgba(148, 175, 220, 0.1);
  font-weight: 500;
}

.mobile-auth {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.mobile-auth .btn {
  flex: 1;
}

@media (min-width: 992px) {
  .nav-desktop,
  .nav-actions {
    display: flex;
  }

  .menu-toggle,
  .mobile-panel {
    display: none !important;
  }
}

main {
  padding-top: var(--nav-h);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: clamp(420px, 78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg 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) 48%, rgba(8, 14, 26, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 14, 26, 0.95) 0%, transparent 45%);
}

.hero-content {
  padding: 3.5rem 0 3rem;
  max-width: 640px;
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  background: linear-gradient(120deg, #fff 20%, var(--brand-2) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 650;
  margin: 0 0 0.85rem;
  line-height: 1.35;
  animation: fadeUp 0.7s ease 0.08s both;
}

.hero p {
  color: var(--muted);
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
  max-width: 34rem;
  animation: fadeUp 0.7s ease 0.16s both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  animation: fadeUp 0.7s ease 0.24s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SECTIONS ===== */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 44rem;
}

.section-alt {
  background: linear-gradient(180deg, rgba(24, 35, 56, 0.55), rgba(18, 27, 46, 0.2));
  border-block: 1px solid var(--line);
}

.prose {
  color: var(--muted);
  font-size: 1.02rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose h2,
.prose h3 {
  color: var(--text);
  font-family: var(--display);
  margin: 1.8rem 0 0.7rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

/* ===== GRID / CARDS ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .cat-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.cat-item {
  text-align: center;
  color: var(--text);
  padding: 1rem 0.7rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.cat-item:hover {
  border-color: rgba(59, 158, 255, 0.45);
  background: rgba(59, 158, 255, 0.08);
  transform: translateY(-3px);
  color: var(--text);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 0.7rem;
}

.cat-item span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  gap: 1.15rem;
}

@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%;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 158, 255, 0.4);
  box-shadow: var(--shadow);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}

.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;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  font-family: var(--display);
  font-weight: 650;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2) brightness(1.05);
}

.intro-grid {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 900px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.intro-visual {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  min-height: 280px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.feature-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.feature-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.85rem;
  align-items: start;
}

.feature-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.feature-item strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.feature-item span {
  color: var(--muted);
  font-size: 0.94rem;
}

/* ===== FAQ ===== */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(26, 39, 64, 0.65);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-weight: 600;
  list-style: none;
  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(--brand-2);
  font-size: 1.2rem;
  font-weight: 500;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .answer {
  padding: 0 1.1rem 1.05rem;
  color: var(--muted);
  border-top: 1px solid rgba(148, 175, 220, 0.1);
  padding-top: 0.85rem;
  margin: 0 1.1rem 0;
}

/* ===== PAGE HERO (inner) ===== */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(59, 158, 255, 0.08), transparent),
    rgba(18, 27, 46, 0.4);
}

.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  margin: 0.35rem 0 0.55rem;
  line-height: 1.25;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand-2);
}

.breadcrumb span {
  opacity: 0.5;
}

/* ===== ARTICLE ===== */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.25rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.article-cover {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  background: var(--bg-2);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 39, 64, 0.7);
  padding: 1.1rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h3 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  color: var(--text);
  align-items: center;
}

.related-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.related-list span {
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 560;
}

/* ===== CATEGORY SHOWCASE ===== */
.cat-showcase {
  display: grid;
  gap: 1.25rem;
}

.cat-block {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(26, 39, 64, 0.45);
}

@media (min-width: 760px) {
  .cat-block {
    grid-template-columns: 140px 1fr;
    align-items: center;
  }
}

.cat-block img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
}

.cat-block h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.25rem;
}

.cat-block p {
  margin: 0;
  color: var(--muted);
}

/* ===== ERROR PAGES ===== */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}

.error-page .code {
  font-family: var(--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: 0;
}

.error-page h1 {
  margin: 0.5rem 0;
  font-family: var(--display);
}

.error-page p {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080e19;
  padding: 2.75rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.8rem;
}

.footer-brand p {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
}

.footer-col h3 {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  font-family: var(--display);
}

.footer-col a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--brand-2);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 175, 220, 0.12);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.promo-banner {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 1.5rem 0;
}

.promo-banner img {
  width: 100%;
  height: auto;
}

.pill-note {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent-2);
  border: 1px solid rgba(212, 178, 106, 0.35);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.cta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.5rem;
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(59, 158, 255, 0.16), rgba(212, 178, 106, 0.1)),
    var(--surface);
  border: 1px solid var(--line);
}

.cta-strip h2 {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 1.25rem;
}

.cta-strip p {
  margin: 0;
  color: var(--muted);
}

.cta-strip .actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}
