/* KGame – kgame-app.pics */
:root {
  --bg: #0e141b;
  --bg-elevated: #151d27;
  --bg-card: #1a2430;
  --bg-soft: #222e3c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eef5;
  --text-muted: #9aabbc;
  --brand: #3d9fff;
  --brand-2: #6eb6ff;
  --accent: #f0b429;
  --ok: #2ecc71;
  --danger: #e74c3c;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1180px;
  --font-display: "Sora", "Be Vietnam Pro", 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(61, 159, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(240, 180, 41, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1016 0%, var(--bg) 40%, #0c1218 100%);
  min-height: 100vh;
  line-height: 1.65;
}

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: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

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(10, 15, 22, 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;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 24px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--text-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: #fff;
  background: rgba(61, 159, 255, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  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), #1f7de0);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: #fff;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(12, 18, 26, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  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;
  padding: 0.85rem 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mobile-actions .btn {
  width: 100%;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  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::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 18, 0.92) 0%, rgba(8, 12, 18, 0.72) 48%, rgba(8, 12, 18, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 12, 18, 0.95) 0%, transparent 55%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 640px;
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  background: linear-gradient(90deg, #fff, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 0.9rem;
  color: #fff;
}

.hero p {
  font-size: 1.05rem;
  max-width: 52ch;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  color: #fff;
}

.section-head p {
  margin: 0;
  max-width: 48ch;
}

.eyebrow {
  display: inline-block;
  color: var(--brand-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro / prose */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.prose h2,
.prose h3 {
  color: #fff;
}

.prose p + h2,
.prose p + h3 {
  margin-top: 1.75rem;
}

.prose ul {
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose a.ext-link {
  color: var(--accent);
  border-bottom: 1px dotted rgba(240, 180, 41, 0.5);
}

.visual-panel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: floatY 5s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.visual-panel img {
  width: 100%;
  object-fit: contain;
  background: #05070a;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: #fff;
  overflow: hidden;
}

.cat-item:hover {
  transform: translateY(-6px);
  border-color: rgba(61, 159, 255, 0.45);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.cat-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.85rem;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.06);
}

.cat-item span {
  font-weight: 600;
  font-size: 0.98rem;
}

.cat-item small {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: rgba(61, 159, 255, 0.4);
}

.article-card .thumb {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #070a0e;
}

.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.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--brand-2);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: #fff;
}

.article-card h3 a:hover {
  color: var(--brand-2);
}

.article-card p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex: 1;
}

.article-card .more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.85rem;
  max-width: 820px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: #fff;
  position: relative;
  padding-right: 2.5rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-2);
  font-size: 1.2rem;
}

.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 compact */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(61, 159, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: #fff;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--brand-2);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-main {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #070a0e;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-inline: auto;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar-box h3 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.9rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  align-items: center;
  color: var(--text);
}

.related-list img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #070a0e;
}

.related-list span {
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s ease;
}

.brand-strip img:hover {
  opacity: 1;
}

/* CTA band */
.cta-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(61, 159, 255, 0.18), rgba(240, 180, 41, 0.08)),
    var(--bg-card);
  border: 1px solid rgba(61, 159, 255, 0.25);
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 0.35rem;
}

.cta-band p {
  margin: 0;
}

.cta-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.app-showcase {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: center;
}

.app-showcase .phone {
  justify-self: center;
}

.app-showcase .phone img {
  width: 160px;
  margin-inline: auto;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.45));
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #0a0f15;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.9rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.footer-col a:hover {
  color: var(--brand-2);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Error pages */
.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(--font-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;
}

/* Misc */
.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(61, 159, 255, 0.15);
  color: var(--brand-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.list-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.checklist li {
  position: relative;
  padding: 0.7rem 0.7rem 0.7rem 2.2rem;
  margin-bottom: 0.55rem;
  background: var(--bg-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.75rem;
  color: var(--ok);
  font-weight: 700;
}

.promo-inline {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.promo-inline img {
  max-width: min(100%, 420px);
}

/* Responsive */
@media (max-width: 980px) {
  .intro-grid,
  .article-layout,
  .app-showcase,
  .cta-band {
    grid-template-columns: 1fr;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-box {
    position: static;
  }

  .hero {
    min-height: 72vh;
    align-items: center;
  }

  .hero-content {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .card-grid,
  .list-page-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-main {
    padding: 1.15rem;
  }

  .section {
    padding: 3.25rem 0;
  }
}

@media (max-width: 480px) {
  .cat-item img {
    width: 96px;
    height: 96px;
  }

  .hero-cta .btn,
  .cta-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
