/* KGame – kgkgame.quest | vi-VN portal styles */
:root {
  --bg: #0b1220;
  --bg-elev: #121a2b;
  --bg-soft: #182338;
  --line: rgba(148, 176, 220, 0.16);
  --text: #e8eef8;
  --muted: #9aa8c2;
  --brand: #3b9eff;
  --brand-2: #1e6fd9;
  --gold: #d4a84b;
  --gold-soft: #f0d08a;
  --danger: #e35d6a;
  --ok: #3ecf8e;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1140px;
  --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", 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 600px at 10% -10%, rgba(59, 158, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 168, 75, 0.12), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, #0b1220 40%, #0e1626 100%);
  min-height: 100vh;
  line-height: 1.65;
}

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: var(--gold-soft);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.88);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.site-header .nav-inner {
  overflow: hidden;
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  height: 40px;
  max-height: calc(var(--nav-h) - 24px);
  flex-shrink: 0;
  overflow: hidden;
}

.logo img {
  height: 40px;
  max-height: 100%;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(59, 158, 255, 0.12);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(30, 111, 217, 0.35);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: rgba(59, 158, 255, 0.45);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, #e0b45a, #b8872e);
  color: #1a1205;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: rgba(10, 16, 28, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.25rem;
  z-index: 999;
}

.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 a {
  display: block;
  color: var(--text);
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 720px);
  display: grid;
  align-items: 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-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.72) 42%, rgba(8, 12, 22, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 12, 22, 0.95) 0%, transparent 45%);
}

.hero-content {
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.brand-mark span {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff, #a9c7ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  line-height: 1.25;
  font-weight: 800;
}

.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Sections —— */
section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 750;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.panel {
  background: linear-gradient(180deg, rgba(24, 35, 56, 0.85), rgba(18, 26, 43, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.prose {
  color: #c8d4e8;
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose h2,
.prose h3 {
  color: #fff;
  margin: 1.6rem 0 0.7rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  color: #c8d4e8;
}

.prose li {
  margin-bottom: 0.45rem;
}

/* brand intro */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  min-height: 280px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05080f;
  min-height: 210px;
  isolation: isolate;
}

.cat-item img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center;
  background: radial-gradient(circle at 50% 40%, #1a2740, #05080f 70%);
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item figcaption,
.cat-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

/* cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 158, 255, 0.35);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1a2740, #05080f 75%);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: #fff;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 26, 43, 0.75);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 650;
  color: #fff;
}

.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 p {
  margin: 0;
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

/* page hero small */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(59, 158, 255, 0.08), transparent);
}

.page-hero h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
}

.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 */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  padding: 2.5rem 0 4rem;
}

.article-main {
  background: rgba(18, 26, 43, 0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 2rem;
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  background: #000;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-inline: auto;
}

.sidebar .widget {
  background: rgba(18, 26, 43, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.sidebar h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.related-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border: 0;
}

.related-list a {
  color: #dce6f5;
  font-weight: 550;
  font-size: 0.92rem;
}

.promo-banner {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.promo-banner img {
  width: 100%;
}

/* list filters */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.chip {
  display: inline-flex;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.chip.active,
.chip:hover {
  color: #fff;
  border-color: rgba(59, 158, 255, 0.5);
  background: rgba(59, 158, 255, 0.12);
}

/* category showcase */
.cat-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.cat-block {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(18, 26, 43, 0.7);
}

.cat-block img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: radial-gradient(circle, #1a2740, #05080f);
  border-radius: 12px;
}

.cat-block h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.cat-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.85;
  filter: brightness(1.05);
}

/* error pages */
.error-wrap {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1rem;
}

.error-wrap h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
  margin: 0;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-wrap p {
  color: var(--muted);
  max-width: 42ch;
  margin: 0.8rem auto 1.5rem;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #070b14;
  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;
}

.site-footer h3 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: #fff;
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: #7f8da8;
  font-size: 0.82rem;
}

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-content {
    animation: fadeUp 0.7s ease both;
  }
  .cat-item,
  .article-card {
    animation: fadeUp 0.55s ease both;
  }
  .cat-item:nth-child(2),
  .article-card:nth-child(2) { animation-delay: 0.06s; }
  .cat-item:nth-child(3),
  .article-card:nth-child(3) { animation-delay: 0.12s; }
  .cat-item:nth-child(4),
  .article-card:nth-child(4) { animation-delay: 0.18s; }
  .cat-item:nth-child(5),
  .article-card:nth-child(5) { animation-delay: 0.24s; }
  .cat-item:nth-child(6),
  .article-card:nth-child(6) { animation-delay: 0.3s; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* responsive */
@media (max-width: 960px) {
  .intro-grid,
  .article-layout,
  .cat-showcase,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .card-grid,
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-desktop,
  .nav-actions {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .hero {
    min-height: auto;
  }
  .hero-content {
    padding: 3rem 0 2.5rem;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }
  .logo img {
    height: 34px;
    max-width: 130px;
  }
  .card-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .cat-block {
    grid-template-columns: 100px 1fr;
  }
  .cat-block img {
    width: 100px;
    height: 100px;
  }
  .article-main {
    padding: 1.1rem;
  }
  .hero-cta {
    width: 100%;
  }
  .hero-cta .btn {
    flex: 1;
  }
}
