/* KGame – kg-app.baby */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
  --bg: #0a1018;
  --bg-2: #0f1824;
  --surface: #142033;
  --surface-2: #1a2a42;
  --line: rgba(180, 210, 255, 0.12);
  --text: #edf3ff;
  --muted: #9eb0c9;
  --accent: #2f8cff;
  --accent-deep: #1a6fd0;
  --gold: #d4a84b;
  --radius: 14px;
  --header-h: 72px;
  --max: 1120px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  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(212, 168, 75, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 40%, #0b121c 100%);
  background-attachment: fixed;
  line-height: 1.7;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #7cbcff;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Be Vietnam Pro', sans-serif;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  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);
  display: flex;
  align-items: center;
  background: rgba(10, 16, 24, 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;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  flex-shrink: 0;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  object-fit: contain;
}

.brand-text {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 1.35rem;
}

.desktop-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--text);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.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.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(47, 140, 255, 0.45);
  color: var(--text);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: rgba(10, 16, 24, 0.97);
  border-bottom: 1px solid var(--line);
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.25s;
  z-index: 999;
  padding: 1.25rem 0 1.5rem;
}

.mobile-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav a {
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.mobile-auth .btn {
  width: 100%;
}

body.menu-open {
  overflow: hidden;
}

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;
  animation: heroZoom 18s var(--ease) infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 16, 24, 0.35) 0%, rgba(10, 16, 24, 0.55) 40%, rgba(10, 16, 24, 0.96) 100%),
    linear-gradient(90deg, rgba(10, 16, 24, 0.75), transparent 55%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 640px;
  animation: riseIn 0.9s var(--ease) both;
}

.hero-brand {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 0.65rem;
  background: linear-gradient(90deg, #fff 20%, #8ec5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.02rem;
  max-width: 34rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Sections */
.section {
  padding: 4.2rem 0;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.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.12em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 280px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.intro-copy h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}

.intro-copy a.ext {
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px dashed rgba(212, 168, 75, 0.5);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 160px;
  isolation: isolate;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 140, 255, 0.45);
}

.cat-item img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(5, 10, 18, 0.92));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 1;
}

/* Article cards – interaction containers */
.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: transform 0.3s var(--ease), border-color 0.3s;
  color: inherit;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 140, 255, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.05rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
  flex: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 32, 51, 0.7);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  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);
  font-size: 1.25rem;
  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;
}

/* Partners */
.partner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
}

.partner-row img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s;
}

.partner-row img:hover {
  opacity: 1;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.8rem 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.6rem, 3.5vw, 2.2rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: 1.8rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.4rem;
}

.prose ul, .prose ol {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose a {
  font-weight: 600;
}

.related-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.sidebar-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.15rem;
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.sidebar-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-box li {
  margin-bottom: 0.65rem;
}

.sidebar-box a {
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar-box a:hover {
  color: var(--accent);
}

/* Category detail blocks */
.cat-detail {
  display: grid;
  gap: 1.25rem;
}

.cat-detail-item {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 32, 51, 0.55);
}

.cat-detail-item img {
  width: 100%;
  max-width: 180px;
  margin-inline: auto;
  object-fit: contain;
}

/* 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: 'Sora', sans-serif;
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  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: #070b12;
  padding: 3rem 0 2rem;
  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.9rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* Responsive */
@media (min-width: 720px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid {
    grid-template-columns: 1.05fr 1fr;
  }

  .cat-detail-item {
    grid-template-columns: 160px 1fr;
  }

  .cat-detail-item img {
    margin-inline: 0;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .desktop-nav,
  .header-actions {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 979px) {
  .mobile-panel {
    /* always available on tablet/mobile */
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
