/* KGame – Game news portal (vi-VN) */
:root {
  --bg: #f3f6fb;
  --bg-deep: #0a1628;
  --bg-panel: #101f36;
  --surface: #ffffff;
  --text: #152033;
  --text-soft: #5a6b82;
  --muted: #8a97ab;
  --line: #d7e0ee;
  --brand: #1f7aef;
  --brand-2: #39b7ff;
  --accent: #00c2a8;
  --danger: #e23d4a;
  --shadow: 0 18px 40px rgba(10, 22, 40, 0.12);
  --radius: 18px;
  --header-h: 72px;
  --max: 1180px;
  --font-display: "Sora", "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 500px at 10% -10%, rgba(57, 183, 255, 0.18), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(31, 122, 239, 0.12), transparent 55%),
    linear-gradient(180deg, #eaf1fb 0%, var(--bg) 28%, #eef3f9 100%);
  line-height: 1.7;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

button,
.btn {
  font: inherit;
  cursor: pointer;
  border: 0;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
#site-header {
  height: var(--header-h);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  min-width: 0;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  font-size: 1.05rem;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.82);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.auth-desktop {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 122, 239, 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.16);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.btn-light {
  background: #fff;
  color: var(--bg-deep);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  margin-left: auto;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-toggle .label-close {
  display: none;
}

.menu-toggle.is-open .label-open {
  display: none;
}

.menu-toggle.is-open .label-close {
  display: inline;
}

.menu-toggle.is-open .icon-open {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.menu-toggle .icon-close {
  display: none;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: rgba(8, 16, 30, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem 1.4rem;
  z-index: 999;
}

.mobile-panel.is-open {
  display: block;
  animation: slideDown 0.25s ease;
}

.mobile-panel a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: var(--bg-deep);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  animation: heroZoom 14s ease-in-out infinite alternate;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 14, 28, 0.88) 0%, rgba(7, 14, 28, 0.55) 48%, rgba(7, 14, 28, 0.35) 100%),
    linear-gradient(180deg, rgba(7, 14, 28, 0.25) 0%, rgba(7, 14, 28, 0.82) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 5rem;
  max-width: 720px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1rem;
  background: linear-gradient(120deg, #fff 20%, #9ad8ff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.8s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.9rem;
  color: #fff;
  animation: fadeUp 0.8s ease 0.1s both;
}

.hero p {
  margin: 0 0 1.6rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  max-width: 36rem;
  animation: fadeUp 0.8s ease 0.18s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fadeUp 0.8s ease 0.26s both;
}

@keyframes heroZoom {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 4.2rem 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
  max-width: 42rem;
}

.section-link {
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.intro-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.intro-copy p {
  color: var(--text-soft);
  margin: 0 0 1rem;
}

.intro-visual {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-deep);
  min-height: 320px;
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

.intro-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(8, 16, 30, 0.75));
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.category-item {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-panel);
  min-height: 210px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.category-item:hover {
  transform: translateY(-4px);
}

.category-item img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center;
}

.category-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1rem;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  background: linear-gradient(transparent, rgba(6, 12, 24, 0.88));
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d1a2e;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.article-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.article-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.tag {
  display: inline-flex;
  width: fit-content;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(31, 122, 239, 0.1);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.85rem;
  max-width: 860px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.15rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0.75rem 0 0;
  color: var(--text-soft);
}

/* Page hero (inner) */
.page-hero {
  padding: 3.2rem 0 2rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

.page-hero .lead {
  margin: 0;
  color: var(--text-soft);
  max-width: 46rem;
  font-size: 1.05rem;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  box-shadow: 0 12px 30px rgba(21, 32, 51, 0.04);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 1.8rem 0 0.7rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.4rem 0 0.55rem;
}

.prose p,
.prose li {
  color: var(--text-soft);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-cover {
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #0d1a2e;
}

.article-cover img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}

.brand-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-row img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: grayscale(0.2);
  opacity: 0.9;
  transition: opacity 0.2s, filter 0.2s;
}

.brand-row img:hover {
  filter: none;
  opacity: 1;
}

.cta-band {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, #0d1c33, #14335c 55%, #0f6fbf);
  color: #fff;
  border-radius: 28px;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  overflow: hidden;
}

.cta-band h2 {
  font-family: var(--font-display);
  margin: 0 0 0.7rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.cta-band p {
  margin: 0 0 1.2rem;
  color: rgba(255, 255, 255, 0.84);
}

.cta-band img {
  justify-self: end;
  max-height: 180px;
  width: auto;
}

.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.5rem);
  margin: 0;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page p {
  color: var(--text-soft);
  max-width: 32rem;
  margin: 0.8rem auto 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 3.2rem 0 1.6rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  font-family: var(--font-display);
  color: #fff;
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.site-footer p {
  margin: 0 0 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  display: grid;
  gap: 0.55rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 980px) {
  .nav-desktop,
  .auth-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .intro-grid,
  .cta-band,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid,
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .cta-band img {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }

  .brand img {
    height: 34px;
    max-width: 130px;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-content {
    padding: 3rem 0 3.2rem;
  }

  .section {
    padding: 3rem 0;
  }

  .category-grid,
  .card-grid,
  .related-grid,
  .brand-row {
    grid-template-columns: 1fr;
  }

  .category-item,
  .category-item img {
    min-height: 180px;
    height: 180px;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}
