/* KGame – kgameweb.live | vi-VN portal styles */
:root {
  --bg: #0a1628;
  --bg-soft: #0f2137;
  --bg-card: #12253d;
  --surface: #16304c;
  --text: #e8eef6;
  --text-muted: #9db0c7;
  --accent: #1aa6a0;
  --accent-hover: #22c4bd;
  --cta: #e4a016;
  --cta-hover: #f0b53a;
  --line: rgba(255, 255, 255, 0.08);
  --danger: #e35d6a;
  --radius: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", 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(ellipse 80% 50% at 10% -10%, rgba(26, 166, 160, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(228, 160, 22, 0.08), transparent 50%),
    linear-gradient(180deg, #07101c 0%, var(--bg) 40%, #0c1a2e 100%);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cta);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; 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(--header-h);
  background: rgba(7, 16, 28, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  color: var(--text);
  max-width: 42%;
}

.brand:hover { color: var(--text); }

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  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.05);
}

.auth-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--cta);
  color: #1a1200;
}

.btn-primary:hover {
  background: var(--cta-hover);
  color: #1a1200;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn-accent {
  background: var(--accent);
  color: #041414;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: #041414;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  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;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }
.menu-toggle .label-close { display: none; }
.menu-toggle.is-open .label-open { display: none; }
.menu-toggle.is-open .label-close { display: inline; }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(8, 18, 32, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.5rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.nav-mobile.is-open { display: flex; }

.nav-mobile a {
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(26, 166, 160, 0.12);
  color: var(--accent-hover);
}

.nav-mobile .auth-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.nav-mobile .auth-mobile .btn { width: 100%; }

@media (min-width: 960px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .auth-desktop { display: flex; }
  .nav-mobile { display: none !important; }
  .brand { max-width: none; }
}

/* Main offset for fixed header */
.site-main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(72vh, 560px);
  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-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 16, 28, 0.92) 0%, rgba(7, 16, 28, 0.55) 55%, rgba(7, 16, 28, 0.35) 100%),
    linear-gradient(0deg, rgba(7, 16, 28, 0.95) 0%, transparent 45%);
}

.hero-content {
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hero-brand span { color: var(--accent); }

.hero h1 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1rem;
  max-width: 34rem;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: rgba(15, 33, 55, 0.45);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.section-head p { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Intro / prose */
.prose {
  max-width: 68ch;
}

.prose p + p { margin-top: 0.15rem; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lead {
  font-size: 1.05rem;
  color: var(--text);
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

.cat-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.25s ease, border-color 0.25s;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(26, 166, 160, 0.4);
}

.cat-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.3s, transform 0.4s;
}

.cat-item:hover img {
  opacity: 0.72;
  transform: scale(1.04);
}

.cat-item span {
  position: relative;
  z-index: 1;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  background: linear-gradient(transparent, rgba(7, 16, 28, 0.92));
  color: var(--text);
}

/* Article cards */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  height: 100%;
}

.article-card:hover {
  border-color: rgba(26, 166, 160, 0.35);
  transform: translateY(-3px);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--accent-hover);
}

.article-card .excerpt {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.article-card .read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  padding: 1.5rem 0;
  opacity: 0.75;
}

.brand-strip img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.95);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 720px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 166, 160, 0.08), transparent);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-hover); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero .desc { max-width: 60ch; margin: 0; }

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

@media (min-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-content {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 2rem;
}

@media (min-width: 700px) {
  .article-content { padding: 2rem 2.25rem 2.5rem; }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-content h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

.article-content h3 {
  margin-top: 1.35rem;
}

.article-content ul,
.article-content ol {
  color: var(--text-muted);
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.article-content li { margin-bottom: 0.4rem; }

.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-list a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  display: block;
}

.related-list a:hover { color: var(--accent-hover); }

.related-list .tag {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-weight: 400;
}

/* Two-col feature */
.feature-row {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 800px) {
  .feature-row {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .feature-row.reverse {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .feature-row.reverse .feature-media { order: -1; }
}

.feature-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
}

.feature-media img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Legal / about */
.legal-content {
  padding: 2.5rem 0 3.5rem;
  max-width: 72ch;
}

.legal-content h2 {
  margin-top: 2rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-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: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page h1 {
  margin-bottom: 0.75rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Footer */
.site-footer {
  background: #060e18;
  border-top: 1px solid var(--line);
  padding: 3rem 0 1.75rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 32ch;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 0.45rem; }

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--accent-hover); }

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }

.cta-band {
  padding: 2.5rem 0;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(26, 166, 160, 0.15), rgba(228, 160, 22, 0.08));
  border-block: 1px solid var(--line);
}

.cta-band h2 { margin-bottom: 0.5rem; }
.cta-band p {
  max-width: 40ch;
  margin: 0 auto 1.25rem;
}

.list-check {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.list-check li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Motion for scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
