/* KGame – kgamee.lat | vi-VN portal */
:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-soft: #182338;
  --surface: #1c2740;
  --line: rgba(148, 176, 214, 0.18);
  --text: #e8eef8;
  --muted: #9db0c9;
  --faint: #7a8fa8;
  --brand: #2f86ff;
  --brand-2: #56a4ff;
  --accent: #3dd6c6;
  --warn: #f0b429;
  --danger: #ef6b6b;
  --ok: #4ade80;
  --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(47, 134, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(61, 214, 198, 0.08), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0d1524 100%);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-2);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #8fc2ff;
}

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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 200;
  backdrop-filter: blur(16px);
  background: rgba(11, 18, 32, 0.88);
  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;
  color: var(--text);
  flex-shrink: 0;
  max-width: min(220px, 48vw);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--text);
  background: rgba(47, 134, 255, 0.12);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(47, 134, 255, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(86, 164, 255, 0.5);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(86, 164, 255, 0.35);
  color: var(--text);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="false"] .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .label-menu { display: none; }
.menu-toggle[aria-expanded="false"] .label-close { display: none; }

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 190;
  background: rgba(12, 19, 34, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
}

.mobile-panel.is-open,
.mobile-panel:not([hidden]) {
  display: block;
}

.mobile-panel[hidden] {
  display: none !important;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav a {
  color: var(--text);
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(148, 176, 214, 0.1);
  font-weight: 500;
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.mobile-auth .btn {
  width: 100%;
}

body.menu-open {
  overflow: hidden;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 680px);
  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(180deg, rgba(8, 14, 26, 0.35) 0%, rgba(8, 14, 26, 0.55) 40%, rgba(8, 14, 26, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 14, 26, 0.85) 0%, rgba(8, 14, 26, 0.35) 55%, rgba(8, 14, 26, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 720px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.hero-brand img {
  height: 48px;
  width: auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  margin-bottom: 0.85rem;
  color: #fff;
}

.hero .lead {
  font-size: 1.08rem;
  color: #c9d7ea;
  max-width: 560px;
  margin-bottom: 1.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(24, 35, 56, 0.35), transparent);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 680px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.45rem;
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.risk-box {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--warn);
  background: rgba(240, 180, 41, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #f5e6c0;
}

.risk-box strong {
  color: #ffe7a3;
}

/* Cards / grids */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.category-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  min-height: 140px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-item:hover {
  transform: translateY(-3px);
  border-color: rgba(86, 164, 255, 0.45);
}

.category-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.category-item span {
  display: block;
  padding: 0.75rem 0.85rem 0.95rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 39, 64, 0.85), rgba(18, 26, 43, 0.95));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(86, 164, 255, 0.4);
  box-shadow: var(--shadow);
}

.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.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.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(--faint);
  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(--brand-2);
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-2);
}

.feature-row {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.feature-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.feature-visual img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.brand-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-strip img {
  width: 100%;
  max-height: 48px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(24, 35, 56, 0.55);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand-2);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(47, 134, 255, 0.12), transparent 50%),
    rgba(18, 26, 43, 0.4);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--faint);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-main img.cover {
  width: 100%;
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(24, 35, 56, 0.45);
}

.related-item img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.related-item h3 {
  font-size: 0.95rem;
  margin: 0;
}

.related-item a {
  color: var(--text);
}

.sidebar-box {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(24, 35, 56, 0.5);
  margin-bottom: 1rem;
}

.sidebar-box h2 {
  font-size: 1.05rem;
}

.error-page {
  min-height: calc(100vh - var(--header-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);
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080e18;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  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 a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--brand-2);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(47, 134, 255, 0.15);
  color: var(--brand-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.list-page .article-card {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .brand-strip { grid-template-columns: repeat(8, 1fr); }
  .list-page .article-card {
    grid-template-columns: 240px 1fr;
  }
  .list-page .article-card .thumb {
    aspect-ratio: auto;
    height: 100%;
    min-height: 160px;
  }
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .header-actions { display: flex; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .feature-row { grid-template-columns: 1.05fr 0.95fr; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .hero-content { margin-bottom: 4.5rem; }
}

@media (max-width: 899px) {
  :root { --header-h: 64px; }
  .brand img { height: 34px; max-height: 34px; }
  .brand-text { font-size: 1rem; }
}
