/* KGame — kgames.monster */
:root {
  --bg: #0a1424;
  --bg-2: #0f1c32;
  --surface: #15233a;
  --surface-2: #1a2b46;
  --text: #eef3fa;
  --muted: #9db0c9;
  --accent: #2f8cff;
  --accent-2: #20c4a0;
  --accent-soft: rgba(47, 140, 255, 0.14);
  --line: rgba(180, 205, 235, 0.12);
  --danger: #ff5d6c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1180px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", 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(47, 140, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(32, 196, 160, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 45%, #09111f 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7cbcff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.65em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.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(16px);
  background: rgba(8, 16, 30, 0.86);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: var(--nav-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: 46%;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: calc(var(--nav-h) - 24px);
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.nav-desktop {
  display: flex;
  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: var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1a6fd4);
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 140, 255, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.auth-desktop {
  display: flex;
  gap: 0.5rem;
}

.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);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: rgba(8, 16, 30, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 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 nav {
  display: grid;
  gap: 0.25rem;
}

.mobile-panel a {
  color: var(--text);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-auth {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

body.menu-open {
  overflow: hidden;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 14, 26, 0.92) 0%, rgba(7, 14, 26, 0.72) 42%, rgba(7, 14, 26, 0.35) 100%),
    linear-gradient(180deg, rgba(7, 14, 26, 0.25) 0%, rgba(7, 14, 26, 0.88) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 4rem;
  max-width: 640px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  background: linear-gradient(90deg, #fff, #9fd0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
  animation: fadeUp 0.7s ease 0.08s both;
}

.hero p {
  font-size: 1.05rem;
  max-width: 34rem;
  animation: fadeUp 0.7s ease 0.16s both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  animation: fadeUp 0.7s ease 0.24s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 4.25rem 0;
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  margin-bottom: 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.prose a.ext {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Category grid */
.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);
  min-height: 180px;
  color: #fff;
}

.cat-item img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.cat-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(5, 12, 24, 0.88) 100%);
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
}

.article-card:hover {
  color: inherit;
}

.article-card .thumb {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
}

.article-card .thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .meta {
  font-size: 0.8rem;
  color: var(--accent-2);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  margin: 0;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(21, 35, 58, 0.55);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] summary {
  color: #9fd0ff;
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(47, 140, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.35rem;
  margin-top: 1.8rem;
}

.article-body h3 {
  font-size: 1.1rem;
  margin-top: 1.35rem;
}

.article-body ul,
.article-body ol {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
}

.sidebar-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  background: rgba(21, 35, 58, 0.6);
  margin-bottom: 1rem;
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  color: var(--text);
  align-items: center;
}

.related-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.related-list span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Category detail strips */
.feature-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.feature-row img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Brand strip */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
  opacity: 0.85;
}

.brand-strip img {
  width: 100%;
  height: 42px;
  object-fit: contain;
  filter: grayscale(0.2);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 11, 22, 0.92);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: var(--text);
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Utilities */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.list-page .card-grid {
  margin-top: 1.5rem;
}

.legal-body,
.about-body {
  max-width: 820px;
  padding: 2.5rem 0 4rem;
}

.phone-showcase {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: center;
}

.phone-showcase img {
  margin-inline: auto;
  max-width: 280px;
}

/* Responsive */
@media (max-width: 980px) {
  .intro-grid,
  .article-layout,
  .phone-showcase,
  .footer-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar {
    position: static;
  }

  .feature-row {
    grid-template-columns: 120px 1fr;
  }

  .feature-row img {
    width: 120px;
    height: 90px;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  .nav-desktop,
  .auth-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .brand img {
    height: 34px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-content {
    padding: 3rem 0 2.5rem;
  }

  .card-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }

  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .feature-row {
    grid-template-columns: 1fr;
  }

  .feature-row img {
    width: 100%;
    height: 160px;
  }

  .section {
    padding: 3rem 0;
  }
}
