/* KGame – kg-app.sbs | vi-VN gaming portal */
:root {
  --bg: #071018;
  --bg-2: #0c1a24;
  --bg-3: #122633;
  --surface: #143040;
  --line: rgba(120, 190, 220, 0.18);
  --text: #e8f4fa;
  --muted: #9bb4c4;
  --brand: #2ec4ff;
  --brand-2: #0ea5e9;
  --accent: #f0c14b;
  --ok: #3dd68c;
  --danger: #ff6b7a;
  --radius: 14px;
  --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(1200px 600px at 10% -10%, rgba(46, 196, 255, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(14, 165, 233, 0.12), transparent 50%),
    linear-gradient(180deg, #061018 0%, #0a1720 40%, #071018 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: #7adfff;
}

ul {
  padding-left: 1.2rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-h);
  backdrop-filter: blur(14px);
  background: rgba(7, 16, 24, 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;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 24px);
}

.logo-link img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(46, 196, 255, 0.1);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  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-2));
  color: #041018;
}

.btn-primary:hover {
  color: #041018;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(46, 196, 255, 0.45);
  color: var(--text);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: rgba(46, 196, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(8, 18, 26, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  box-shadow: var(--shadow);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav nav {
  display: grid;
  gap: 0.35rem;
}

.mobile-nav a {
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(120, 190, 220, 0.08);
  font-weight: 500;
}

.mobile-nav .mobile-auth {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

@media (min-width: 960px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .menu-toggle,
  .mobile-nav {
    display: none !important;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(420px, 78vh, 640px);
  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(180deg, rgba(7, 16, 24, 0.35) 0%, rgba(7, 16, 24, 0.72) 48%, rgba(7, 16, 24, 0.96) 100%),
    linear-gradient(90deg, rgba(7, 16, 24, 0.75), transparent 55%);
}

.hero-content {
  padding: 5.5rem 0 3.2rem;
  max-width: 680px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  background: linear-gradient(90deg, #fff, #9de7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.25;
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.hero p {
  color: var(--muted);
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.6rem;
  max-width: 680px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.prose {
  color: var(--muted);
  max-width: 70ch;
}

.prose p {
  margin: 0 0 1rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose h2,
.prose h3 {
  color: var(--text);
  font-family: var(--font-display);
}

.brand-block {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .brand-block {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.brand-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  animation: floaty 5s ease-in-out infinite;
}

.brand-visual img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 0 auto;
  padding: 1rem;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  min-height: 180px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 196, 255, 0.45);
}

.cat-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.cat-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 0.9rem;
  background: linear-gradient(transparent, rgba(4, 12, 18, 0.92));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 48, 64, 0.55), rgba(12, 26, 36, 0.9));
  transition: transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(46, 196, 255, 0.4);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}

.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.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .tag {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-family: var(--font-display);
}

.article-card h3 a {
  color: var(--text);
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .meta {
  color: #7f98a8;
  font-size: 0.8rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 38, 51, 0.65);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.1rem 1.05rem;
  color: var(--muted);
  margin: 0;
}

/* Page hero / breadcrumb */
.page-hero {
  padding: 2.4rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(46, 196, 255, 0.08), transparent);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

.page-hero h1 {
  font-family: var(--font-display);
  margin: 0 0 0.55rem;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.2rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 1.8rem 0 0.7rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 1.4rem 0 0.55rem;
}

.article-body p,
.article-body li {
  color: var(--muted);
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.side-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(18, 38, 51, 0.55);
}

.side-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-family: var(--font-display);
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.side-list a {
  color: var(--text);
  font-size: 0.92rem;
}

.side-list a:hover {
  color: var(--brand);
}

.related-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 700px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Legal / about */
.content-page {
  padding: 2rem 0 3.5rem;
}

.content-page .prose {
  max-width: 760px;
}

/* 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 h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 0.4rem;
  background: linear-gradient(90deg, var(--brand), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page p {
  color: var(--muted);
  margin: 0 0 1.3rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #050d13;
  padding: 2.6rem 0 1.6rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.8rem;
}

.footer-brand p,
.footer-col p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.footer-col h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(120, 190, 220, 0.1);
  color: #6f8796;
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

/* Misc */
.partners {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.partners img {
  height: 28px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
}

.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.split-list {
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 720px) {
  .split-list {
    grid-template-columns: 1fr 1fr;
  }
}

.info-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  background: rgba(18, 38, 51, 0.45);
}

.info-tile h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.info-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
