/* KGame – kg-web.monster | Game info portal */
:root {
  --bg: #0a1220;
  --bg-elevated: #111b2e;
  --surface: #152238;
  --surface-2: #1a2a44;
  --line: rgba(148, 175, 220, 0.16);
  --text: #edf3fc;
  --muted: #9db0cc;
  --accent: #3d8bfd;
  --accent-soft: rgba(61, 139, 253, 0.16);
  --accent-2: #7eb6ff;
  --gold: #d4b45a;
  --danger: #ef6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1120px;
  --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(61, 139, 253, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 180, 90, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1424 0%, var(--bg) 40%, #080f1a 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #fff;
}

ul,
ol {
  padding-left: 1.2rem;
}

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;
}

h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 18, 32, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  max-width: 46%;
  max-height: calc(var(--header-h) - 16px);
  overflow: hidden;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  max-width: 160px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.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[aria-current="page"] {
  color: #fff;
  background: var(--accent-soft);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 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);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #3d8bfd, #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  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: 18px;
  height: 18px;
  flex-shrink: 0;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.mobile-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(100%, 320px);
  height: calc(100vh - var(--header-h));
  background: rgba(12, 20, 36, 0.98);
  border-left: 1px solid var(--line);
  padding: 1.25rem;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 190;
  overflow-y: auto;
}

.mobile-panel.is-open {
  transform: translateX(0);
}

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-panel a {
  color: var(--text);
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: transparent;
}

.mobile-panel a:hover,
.mobile-panel a[aria-current="page"] {
  background: var(--accent-soft);
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 180;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  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;
}

.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.75) 0%, rgba(8, 14, 26, 0.25) 60%, transparent 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.hero-content .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.hero-content h1 {
  margin-bottom: 0.85rem;
}

.hero-content p {
  font-size: 1.05rem;
  max-width: 36rem;
  color: #c7d4e8;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@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(21, 34, 56, 0.35), transparent);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.category-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 160px;
  isolation: isolate;
}

.category-item img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.category-item:hover img {
  transform: scale(1.05);
}

.category-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1rem 0.95rem;
  background: linear-gradient(transparent, rgba(5, 10, 20, 0.92));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  z-index: 1;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  height: 100%;
}

.article-card:hover {
  border-color: rgba(61, 139, 253, 0.45);
  transform: translateY(-3px);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}

.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: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  flex: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent-2);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .answer {
  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:
    radial-gradient(600px 240px at 20% 0%, rgba(61, 139, 253, 0.15), transparent 70%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: #fff;
}

.breadcrumb span[aria-hidden="true"] {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body h2 {
  margin-top: 1.75rem;
}

.article-body h3 {
  margin-top: 1.35rem;
}

.article-body ul li,
.article-body ol li {
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.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);
  background: var(--surface);
  border: 1px solid var(--line);
}

.related-item img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
}

.related-item strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.side-box h2,
.side-box h3 {
  font-size: 1.05rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s ease;
}

.brand-strip img:hover {
  opacity: 1;
}

/* Legal / content pages */
.content-page {
  padding: 2.5rem 0 4rem;
}

.content-page .prose {
  max-width: 720px;
}

/* 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);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), var(--gold));
  -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: #070d17;
  padding: 3rem 0 1.75rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 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;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.45rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.feature-row {
  display: grid;
  gap: 1rem;
}

.feature {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.feature img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.85rem;
}

.feature h3 {
  margin-bottom: 0.45rem;
}

.feature p {
  margin: 0;
  font-size: 0.92rem;
}

.list-page .card-grid {
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.cta-banner {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(61, 139, 253, 0.16), rgba(212, 180, 90, 0.08)),
    var(--surface);
}

.cta-banner img {
  width: min(100%, 280px);
  margin-inline: auto;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-panel,
  .overlay {
    display: none !important;
  }

  .brand {
    max-width: none;
  }

  .brand img {
    height: 44px;
    max-height: 44px;
  }

  .intro-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .cta-banner {
    grid-template-columns: 1fr auto;
  }

  .hero-content {
    margin-bottom: 5.5rem;
  }
}

@media (max-width: 899px) {
  :root {
    --header-h: 64px;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .brand-text {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
