/* KGame – game nổ hủ portal */
:root {
  --bg: #0a1628;
  --bg-soft: #102038;
  --bg-elev: #152848;
  --surface: #1a3050;
  --text: #e8eef7;
  --text-muted: #9aadc4;
  --accent: #2f9bff;
  --accent-2: #1ec8a5;
  --accent-warm: #f0a14a;
  --line: rgba(255, 255, 255, 0.1);
  --danger: #ff6b6b;
  --radius: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --font-display: "Space Grotesk", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --max: 1140px;
}

*,
*::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, 155, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 5%, rgba(30, 200, 165, 0.12), transparent 55%),
    linear-gradient(180deg, #07111f 0%, var(--bg) 40%, #0c1a30 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7bc4ff;
}

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;
}

p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

ul, ol {
  color: var(--text-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(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(8, 16, 30, 0.88);
  backdrop-filter: blur(14px);
  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 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  color: var(--text);
  max-height: calc(var(--nav-h) - 20px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: flex-end;
  margin-right: 0.75rem;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  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(--accent), #1a6fd4);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
}

.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(10, 20, 38, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.25rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-panel a {
  display: block;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-panel a:hover {
  color: var(--text);
}

.mobile-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.mobile-actions .btn {
  flex: 1;
}

/* ===== Main ===== */
main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  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 top;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.35) 0%, rgba(7, 17, 31, 0.55) 45%, rgba(7, 17, 31, 0.95) 100%),
    linear-gradient(90deg, rgba(7, 17, 31, 0.75) 0%, rgba(7, 17, 31, 0.25) 55%, rgba(7, 17, 31, 0.5) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 4rem 0 3.5rem;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(90deg, #fff 20%, #8ec8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  max-width: 36rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.hero-lead {
  max-width: 34rem;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: #c5d4e8;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(21, 40, 72, 0.45), rgba(16, 32, 56, 0.2));
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}

/* Intro */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.intro-visual img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-copy .ext-link {
  color: var(--accent-warm);
  font-weight: 600;
  border-bottom: 1px solid rgba(240, 161, 74, 0.4);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.cat-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  color: #fff;
}

.cat-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.cat-item:hover img {
  transform: scale(1.06);
}

.cat-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(5, 12, 24, 0.92) 100%);
}

.cat-label {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

/* Article lists */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.article-item {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: inherit;
}

.article-item:hover .article-title {
  color: var(--accent);
}

.article-thumb {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-item:hover .article-thumb img {
  transform: scale(1.04);
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.article-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  transition: color 0.2s ease;
}

.article-excerpt {
  font-size: 0.92rem;
  margin: 0;
  color: var(--text-muted);
}

.list-layout {
  display: grid;
  gap: 1.25rem;
}

.list-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
}

.list-row:hover .article-title {
  color: var(--accent);
}

.list-row .article-thumb {
  aspect-ratio: 4 / 3;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 32, 56, 0.5);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--text-muted);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 155, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-hidden="true"] {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
}

.article-body {
  max-width: 720px;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.article-body h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.article-body p,
.article-body li {
  color: var(--text-muted);
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
}

.sidebar h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.related-list {
  display: grid;
  gap: 1rem;
}

.related-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  color: inherit;
}

.related-item img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.related-item span {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.related-item:hover span {
  color: var(--accent);
}

/* Brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  opacity: 0.85;
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.1);
}

/* Prose pages */
.prose {
  max-width: 740px;
  padding: 2.5rem 0 4rem;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.4rem;
  font-size: 1.1rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  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;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #060e1a;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 0.3rem 0;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notice-box {
  border-left: 3px solid var(--accent-warm);
  padding: 0.85rem 1rem;
  background: rgba(240, 161, 74, 0.08);
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(47, 155, 255, 0.15);
  color: #9fd0ff;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

.cat-detail {
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cat-detail img {
  border-radius: 12px;
  border: 1px solid var(--line);
  width: 100%;
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  .cat-detail {
    grid-template-columns: 1fr;
  }

  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-panel {
    display: block;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content {
    padding: 3rem 0 2.5rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .list-row .article-thumb {
    aspect-ratio: 16 / 9;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .cat-label {
    font-size: 0.9rem;
    left: 0.65rem;
    right: 0.65rem;
    bottom: 0.65rem;
  }

  .mobile-actions {
    flex-direction: column;
  }
}
