/* KGame – kg-web.baby */
:root {
  --bg: #0a0f1a;
  --bg-elevated: #121a2b;
  --bg-soft: #182235;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e8eef8;
  --muted: #9aa8bc;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --gold: #d4a84b;
  --danger: #ef4444;
  --radius: 14px;
  --header-h: 72px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-display: "Sora", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
  --max: 1180px;
}

*,
*::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(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 168, 75, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, var(--bg) 40%, #070b14 100%);
  min-height: 100vh;
  line-height: 1.65;
}

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: #93c5fd;
}

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);
}

.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, 26, 0.86);
  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;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  max-width: 46%;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.12);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: var(--text);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
}

.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, 32, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  z-index: 999;
  box-shadow: var(--shadow);
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav a {
  color: var(--text);
  padding: 0.85rem 0;
  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%;
}

body.menu-open {
  overflow: hidden;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 680px);
  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, 12, 22, 0.35) 0%, rgba(8, 12, 22, 0.72) 48%, rgba(8, 12, 22, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 12, 22, 0.75) 0%, rgba(8, 12, 22, 0.25) 55%, rgba(8, 12, 22, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 720px;
  animation: fadeUp 0.7s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.05rem;
  max-width: 36rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}

.section-alt {
  background: rgba(18, 26, 43, 0.55);
  border-block: 1px solid var(--line);
}

.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.prose a.ext-link {
  color: var(--gold);
  border-bottom: 1px dashed rgba(212, 168, 75, 0.45);
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .cat-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.cat-item {
  text-align: center;
  padding: 1.1rem 0.75rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  color: var(--text);
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--text);
}

.cat-item img {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.85rem;
  object-fit: contain;
}

.cat-item span {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
}

.cat-item small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .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-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
  color: inherit;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.35);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s 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(--gold);
  margin-bottom: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.85rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 26, 43, 0.7);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  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 .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), transparent);
}

.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: var(--accent-2);
}

.breadcrumb span {
  opacity: 0.5;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  max-width: 820px;
}

.page-hero .lead {
  max-width: 720px;
  font-size: 1.05rem;
}

/* Content layout */
.content-wrap {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

@media (min-width: 960px) {
  .content-wrap.has-aside {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.prose ul,
.prose ol {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose strong {
  color: var(--text);
}

.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;
}

.aside-box {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.aside-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.aside-links a {
  color: var(--muted);
  font-size: 0.92rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.aside-links a:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.aside-links a:hover {
  color: var(--accent-2);
}

.related-grid {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* Partners */
.partner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.partner-row img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s ease;
}

.partner-row img:hover {
  opacity: 1;
}

/* 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);
  background: linear-gradient(135deg, var(--accent), 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: #070b14;
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  color: var(--text);
}

.footer-col a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent-2);
}

.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.82rem;
}

.age-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (min-width: 960px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .brand {
    max-width: none;
  }

  .mobile-panel {
    display: none !important;
  }
}

@media (max-width: 959px) {
  :root {
    --header-h: 64px;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .brand-text {
    font-size: 1rem;
  }
}
