/* KGame – kg-app.pics | shared styles */
:root {
  --bg: #070b14;
  --bg-elevated: #0f1524;
  --bg-soft: #151d30;
  --surface: #1a2438;
  --line: rgba(148, 176, 220, 0.14);
  --text: #e8eef8;
  --muted: #9aadc8;
  --accent: #2f8bff;
  --accent-2: #1e6fe0;
  --gold: #c9a227;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --radius: 14px;
  --header-h: 72px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
  --max: 1160px;
}

*,
*::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 500px at 10% -10%, rgba(47, 139, 255, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(180deg, #070b14 0%, #0a1020 45%, #070b14 100%);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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: #7bb6ff;
}

h1, h2, h3, h4 {
  font-family: var(--font-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;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 44px;
  flex-shrink: 0;
}

.logo-link img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  opacity: 0.9;
  padding: 0.35rem 0;
  position: relative;
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  opacity: 1;
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(47, 139, 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(47, 139, 255, 0.45);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, #d4b03a, #a8871d);
  color: #1a1400;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(10, 15, 28, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.35rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-panel a {
  color: var(--text);
  padding: 0.7rem 0.4rem;
  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 offset for fixed header */
main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg 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, 11, 20, 0.92) 0%, rgba(7, 11, 20, 0.72) 48%, rgba(7, 11, 20, 0.45) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.2) 0%, rgba(7, 11, 20, 0.85) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  padding: 3.5rem 0 4rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 0.85rem;
  background: linear-gradient(90deg, #fff 20%, #8ec5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 650;
  color: #f3f7ff;
  margin-bottom: 0.9rem;
}

.hero .lead {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.6rem;
}

.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; }
}

/* Sections */
.section {
  padding: 4.2rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(21, 29, 48, 0.45), transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro / prose */
.prose {
  max-width: 72ch;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong {
  color: #f0f5ff;
  font-weight: 650;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.split-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  min-height: 180px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 139, 255, 0.4);
}

.cat-item img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
  background: radial-gradient(circle at 50% 40%, rgba(47, 139, 255, 0.12), transparent 65%), #0a0f1a;
  padding: 0.75rem;
}

.cat-item span {
  display: block;
  padding: 0.85rem 1rem 1rem;
  color: #fff;
  font-weight: 650;
  font-size: 0.95rem;
  background: var(--bg-soft);
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 139, 255, 0.35);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0f1a;
}

.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;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.tag {
  color: var(--accent);
  font-weight: 650;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: #f4f7ff;
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card .excerpt {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.9rem;
}

.read-more {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--accent);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 650;
  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(--accent);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  margin: 0;
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.8rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(47, 139, 255, 0.12), transparent 60%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  opacity: 0.5;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  max-width: 20ch;
}

.page-hero .desc {
  max-width: 56ch;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

.article-main {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 2rem;
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.4rem;
  background: #0a0f1a;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-main h1 {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  margin-bottom: 0.75rem;
}

.article-body h2 {
  font-size: 1.25rem;
  margin-top: 1.8rem;
}

.article-body h3 {
  font-size: 1.08rem;
  margin-top: 1.35rem;
}

.article-body p,
.article-body li {
  font-size: 1rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  line-height: 1.4;
}

.side-list a:hover {
  color: var(--accent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.brand-strip img:hover {
  opacity: 1;
  filter: none;
}

/* Notice / warning */
.notice {
  border-left: 3px solid var(--gold);
  background: rgba(201, 162, 39, 0.08);
  padding: 1rem 1.15rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

.notice p {
  margin: 0;
  color: #e6d9a8;
  font-size: 0.94rem;
}

.risk-box {
  border: 1px solid rgba(232, 93, 93, 0.35);
  background: rgba(232, 93, 93, 0.08);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

.risk-box p {
  margin: 0;
  color: #f0b4b4;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  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;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #050810;
  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: 38px;
  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: #fff;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.28rem 0;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-panel {
    display: block;
  }

  .logo-link img {
    height: 34px;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 2.4rem 0 2.8rem;
  }

  .card-grid,
  .related-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3rem 0;
  }

  .article-main {
    padding: 1.15rem 1rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
