/* KGame – cổng thông tin game nổ hũ (vi-VN) */
:root {
  --bg: #f0f4f8;
  --bg-alt: #e4ecf4;
  --surface: #ffffff;
  --ink: #142033;
  --ink-soft: #3d4f66;
  --muted: #6b7c90;
  --brand: #2b6fd6;
  --brand-deep: #1a4fa8;
  --brand-soft: #5baaff;
  --accent: #c9a227;
  --line: rgba(20, 32, 51, 0.1);
  --shadow: 0 12px 40px rgba(20, 40, 80, 0.1);
  --radius: 14px;
  --nav-h: 68px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 170, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 0.12), transparent 50%),
    linear-gradient(180deg, #e8eef6 0%, var(--bg) 35%, #f7f9fc 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

ul, ol {
  color: var(--ink-soft);
}

.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(--nav-h);
  background: rgba(15, 28, 48, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  max-height: calc(var(--nav-h) - 20px);
  overflow: hidden;
}

.brand-link img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(91, 170, 255, 0.15);
  color: #fff;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
}

.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;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-soft), var(--brand));
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 111, 214, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.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;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #12233a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem 1.5rem;
  z-index: 999;
  animation: slideDown 0.25s ease;
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
}

.nav-mobile .mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
  .nav-desktop,
  .nav-actions {
    display: flex;
  }
  .nav-mobile {
    display: none !important;
  }
}

/* ===== Main offset ===== */
.site-main {
  padding-top: var(--nav-h);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0d1a2e;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 18, 36, 0.88) 0%, rgba(8, 18, 36, 0.55) 48%, rgba(8, 18, 36, 0.25) 100%),
    linear-gradient(0deg, rgba(8, 18, 36, 0.92) 0%, transparent 55%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

.hero-content .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 0.35em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-content h1 {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.75em;
}

.hero-content p {
  color: rgba(230, 238, 248, 0.85);
  font-size: 1.02rem;
  max-width: 36em;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@keyframes fadeUp {
  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: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-bottom: 0.4em;
}

.section-head p {
  margin: 0;
  font-size: 1.02rem;
}

.section-muted {
  background: rgba(255, 255, 255, 0.45);
}

.section-dark {
  background: linear-gradient(145deg, #12233a 0%, #1a3355 100%);
  color: #fff;
}

.section-dark h2,
.section-dark h3 {
  color: #fff;
}

.section-dark p,
.section-dark li {
  color: rgba(230, 238, 248, 0.82);
}

/* Intro split */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 800px) {
  .intro-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d1a2e;
  min-height: 280px;
  animation: fadeUp 0.8s ease 0.1s both;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.5rem;
}

/* Categories */
.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 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(43, 111, 214, 0.35);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.cat-item h3 {
  font-size: 1rem;
  margin: 0 0 0.35em;
  color: var(--ink);
}

.cat-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Article cards */
.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;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0d1a2e;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .thumb.contain img {
  object-fit: contain;
  padding: 1rem;
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5em;
  color: var(--ink);
}

.article-card p {
  margin: 0;
  font-size: 0.92rem;
  flex: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--brand);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  background: linear-gradient(135deg, #12233a 0%, #1e3a5f 100%);
  color: #fff;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.4em;
}

.page-hero p {
  color: rgba(230, 238, 248, 0.85);
  margin: 0;
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.65);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
  }
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}

@media (min-width: 700px) {
  .prose {
    padding: 2.25rem 2.5rem;
  }
}

.prose .cover {
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 1.5rem;
  background: #0d1a2e;
}

.prose .cover img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
}

.prose .cover.contain img {
  object-fit: contain;
  max-height: 280px;
  margin: 1rem auto;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.35rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin-bottom: 1em;
}

.prose li {
  margin-bottom: 0.4em;
}

.aside-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.aside-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.aside-box a {
  display: block;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.aside-box a:last-child {
  border-bottom: none;
}

.aside-box a:hover {
  color: var(--brand);
}

/* Brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s;
}

.brand-strip img:hover {
  opacity: 1;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-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);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.3em;
}

/* Footer */
.site-footer {
  background: #0d1a2e;
  color: rgba(230, 238, 248, 0.8);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.site-footer a {
  color: rgba(230, 238, 248, 0.78);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #fff;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  color: rgba(230, 238, 248, 0.7);
  font-size: 0.92rem;
  margin: 0;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(230, 238, 248, 0.55);
  text-align: center;
}

.disclaimer {
  font-size: 0.88rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 0 10px 10px 0;
  margin: 1.5rem 0;
}

.ext-link {
  font-weight: 600;
}

/* Utils */
.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-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
