/* KGame – kgamee.xyz | vi-VN game info portal */
:root {
  --bg: #0b1018;
  --bg-2: #121925;
  --bg-3: #1a2433;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(148, 176, 214, 0.14);
  --text: #eaf0f8;
  --muted: #9aadc4;
  --accent: #3d9aef;
  --accent-2: #6bb6f7;
  --accent-deep: #1e6fbf;
  --silver: #c5d0de;
  --warn: #e8b86d;
  --danger: #e86d6d;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1180px;
  --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 10% -10%, rgba(61, 154, 239, 0.18), transparent 55%),
    radial-gradient(900px 500px at 95% 5%, rgba(30, 111, 191, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1018 0%, #0e1520 40%, #0b1018 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

ul, ol {
  color: var(--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(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 16, 24, 0.86);
  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;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--header-h);
  overflow: hidden;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}

.nav-desktop a {
  color: var(--silver);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: var(--surface-hover);
}

.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: 999px;
  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, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(61, 154, 239, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: #fff;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.menu-toggle .icon-close {
  display: none;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(12, 18, 28, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.35rem;
  z-index: 999;
  box-shadow: var(--shadow);
}

.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.85rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel a.active {
  background: var(--surface-hover);
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.mobile-auth .btn {
  width: 100%;
}

body.has-fixed-header {
  padding-top: var(--header-h);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 620px);
  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 top;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.92) 0%, rgba(8, 12, 20, 0.72) 45%, rgba(8, 12, 20, 0.35) 100%),
    linear-gradient(0deg, rgba(11, 16, 24, 0.95) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #fff 20%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
  max-width: 36rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ===== Sections ===== */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02), transparent);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  margin: 0;
}

.section-head p {
  margin: 0.35rem 0 0;
  max-width: 36rem;
}

.section-link {
  font-weight: 600;
  color: var(--accent-2);
}

.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.45rem;
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: var(--silver);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lead {
  font-size: 1.08rem;
  color: var(--silver);
}

/* ===== Intro / Brand ===== */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.intro-visual img {
  width: min(100%, 360px);
  filter: drop-shadow(0 20px 40px rgba(61, 154, 239, 0.25));
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== Category grid ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1rem 1.2rem;
  text-align: center;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: rgba(61, 154, 239, 0.35);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 0.85rem;
}

.cat-item h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.cat-item p {
  font-size: 0.88rem;
  margin: 0;
}

/* ===== Cards / Articles ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 154, 239, 0.4);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
  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: 1.05rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(61, 154, 239, 0.15);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.article-card h3 a {
  color: inherit;
}

.article-card h3 a:hover {
  color: var(--accent-2);
}

.article-card .excerpt {
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

/* ===== FAQ ===== */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  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(--accent-2);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  margin: 0;
  border-top: 1px solid transparent;
}

/* ===== Promo strip ===== */
.promo-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: stretch;
}

.promo-row a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.promo-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 120px;
}

/* ===== Brand strip ===== */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* ===== Page hero (inner) ===== */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
  background:
    linear-gradient(180deg, rgba(61, 154, 239, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.6rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent-2);
}

.breadcrumb span {
  opacity: 0.5;
}

/* ===== Article detail ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.7rem;
  align-items: center;
  color: var(--text);
}

.side-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-3);
}

.side-list span {
  font-size: 0.88rem;
  line-height: 1.35;
}

/* ===== Category showcase ===== */
.cat-showcase {
  display: grid;
  gap: 1.25rem;
}

.cat-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cat-row img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
}

.cat-row h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.cat-row p {
  margin-bottom: 0.6rem;
}

/* ===== Error pages ===== */
.error-page {
  min-height: calc(100vh - var(--header-h) - 220px);
  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(135deg, var(--accent), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: #080c13;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 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;
  color: #fff;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===== Utilities ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.list-articles {
  display: grid;
  gap: 1rem;
}

.list-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.15rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.list-item:hover {
  background: var(--surface-hover);
  border-color: rgba(61, 154, 239, 0.35);
}

.list-item .thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 16 / 11;
}

.list-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item h2,
.list-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.list-item h2 a,
.list-item h3 a {
  color: var(--text);
}

.list-item h2 a:hover,
.list-item h3 a:hover {
  color: var(--accent-2);
}

.phone-visual {
  max-width: 180px;
  margin: 0 auto;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid,
  .article-layout,
  .promo-row,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-layout .sidebar-box {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand img {
    height: 34px;
    max-width: 140px;
  }

  .hero {
    min-height: 480px;
    align-items: flex-end;
  }

  .hero-content {
    margin-bottom: 2.25rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .cat-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .card-grid,
  .cat-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta .btn,
  .mobile-auth {
    width: 100%;
  }

  .hero-cta {
    flex-direction: column;
  }
}
