/* KGame kgm.baby — shared styles */
:root {
  --bg: #07111f;
  --bg-elevated: #0d1a2e;
  --bg-soft: #12233a;
  --line: rgba(148, 178, 214, 0.18);
  --text: #e8eef7;
  --muted: #9bb0c9;
  --brand: #3b9eff;
  --brand-deep: #1a6fd4;
  --accent: #f0c14b;
  --ok: #3dcaa0;
  --danger: #ef6b6b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1140px;
  --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 600px at 80% -10%, rgba(59, 158, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(240, 193, 75, 0.08), transparent 55%),
    linear-gradient(180deg, #081426 0%, var(--bg) 40%, #050d18 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7ec2ff;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(7, 17, 31, 0.86);
  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: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  max-width: 46%;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: calc(var(--nav-h) - 24px);
  object-fit: contain;
}

.brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.05rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  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(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(26, 111, 212, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(59, 158, 255, 0.45);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  margin-left: auto;
}

.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";
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(8, 18, 32, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  z-index: 999;
}

.mobile-panel.is-open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav a {
  color: var(--text);
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mobile-actions .btn {
  width: 100%;
}

main {
  padding-top: var(--nav-h);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 12, 24, 0.92) 0%, rgba(5, 12, 24, 0.72) 42%, rgba(5, 12, 24, 0.35) 100%),
    linear-gradient(0deg, rgba(5, 12, 24, 0.95) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35em;
  background: linear-gradient(180deg, #fff 20%, #9ec8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.7em;
}

.hero p {
  font-size: 1.05rem;
  max-width: 34em;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Sections —— */
.section {
  padding: 4.25rem 0;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 35, 58, 0.45), transparent);
  border-block: 1px solid var(--line);
}

.prose {
  max-width: 46rem;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  margin: 0 0 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.lead-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.lead-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.lead-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.feature {
  padding: 1.25rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 26, 46, 0.65);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.feature:hover {
  border-color: rgba(59, 158, 255, 0.45);
  transform: translateY(-3px);
}

.feature img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-bottom: 0.85rem;
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.feature p {
  margin: 0;
  font-size: 0.94rem;
}

/* —— Categories —— */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  min-height: 180px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 158, 255, 0.5);
}

.cat-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  color: #fff;
  font-weight: 650;
  font-family: var(--display);
  font-size: 0.98rem;
}

/* —— Cards / articles —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(13, 26, 46, 0.72);
  transition: transform 0.25s ease, border-color 0.25s ease;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 158, 255, 0.5);
  color: inherit;
}

.article-card .thumb {
  background: #000;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.85rem;
  flex: 1;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
}

.list-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.list-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.1rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 26, 46, 0.55);
  color: inherit;
  transition: border-color 0.2s ease;
}

.list-item:hover {
  border-color: rgba(59, 158, 255, 0.45);
  color: inherit;
}

.list-item .thumb {
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 10;
}

.list-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 0;
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.15);
  transition: opacity 0.2s ease;
}

.brand-row img:hover {
  opacity: 1;
}

/* —— FAQ —— */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 26, 46, 0.6);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 650;
  color: var(--text);
  list-style: none;
  font-family: var(--display);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .answer {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Page chrome —— */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 35, 58, 0.55), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.45rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.5;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #000;
  box-shadow: var(--shadow);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.35rem;
  margin-top: 1.6rem;
}

.article-body h3 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(13, 26, 46, 0.7);
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.side-links a {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.side-links a:hover {
  color: var(--brand);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* —— Error pages —— */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #fff, var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.3rem;
}

.error-page h1 {
  font-size: 1.6rem;
}

.error-page p {
  max-width: 28rem;
  margin-inline: auto;
  margin-bottom: 1.4rem;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  background: #050d18;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  margin: 0;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid rgba(59, 158, 255, 0.35);
  background:
    linear-gradient(120deg, rgba(59, 158, 255, 0.16), rgba(240, 193, 75, 0.08));
}

.cta-band h2 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.cta-band p {
  margin: 0;
  font-size: 0.94rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}

.step {
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(13, 26, 46, 0.55);
  position: relative;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}

.step h3 {
  font-size: 1.02rem;
}

.step p {
  margin: 0;
  font-size: 0.92rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .nav-desktop,
  .nav-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .lead-block,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .card-grid,
  .related-grid,
  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .cat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }

  .brand img {
    height: 34px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .hero {
    min-height: 72vh;
  }

  .hero-content {
    margin-bottom: 3rem;
  }

  .feature-grid,
  .card-grid,
  .related-grid,
  .cat-grid,
  .steps,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3rem 0;
  }
}
