/* KGame — kg-app.lol */
:root {
  --bg-deep: #0a1220;
  --bg-base: #0f1a2e;
  --bg-elevated: #162338;
  --bg-card: #1a2942;
  --line: rgba(140, 180, 255, 0.14);
  --text: #e8eef8;
  --text-muted: #9aadc8;
  --brand: #2f7bff;
  --brand-soft: #5a9bff;
  --gold: #d4a84b;
  --gold-soft: #e8c878;
  --ok: #3ecf8e;
  --danger: #ff6b7a;
  --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(1100px 520px at 8% -10%, rgba(47, 123, 255, 0.22), transparent 55%),
    radial-gradient(900px 480px at 92% 0%, rgba(212, 168, 75, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 40%, #0c1626 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-soft);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--gold-soft);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.7em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3.4vw, 2.55rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; 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);
  display: flex;
  align-items: center;
  background: rgba(10, 18, 32, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 1.25rem, var(--max));
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  min-width: 0;
  max-width: min(160px, 42vw);
  overflow: hidden;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: center;
}

.nav-desktop a {
  color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(47, 123, 255, 0.12);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #1a5de0);
  color: #fff;
  box-shadow: 0 8px 22px rgba(47, 123, 255, 0.35);
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand-soft);
  color: var(--brand-soft);
}

.btn-gold {
  background: linear-gradient(135deg, #c9952f, #e8c878);
  color: #1a1205;
}

.btn-gold:hover { color: #1a1205; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(47, 123, 255, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  margin-left: auto;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(12, 20, 36, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.35rem;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 999;
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.mobile-panel.open { display: flex !important; }

.mobile-panel a {
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-weight: 500;
}

.mobile-panel a:hover {
  background: rgba(47, 123, 255, 0.12);
}

.mobile-auth {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.mobile-auth .btn { flex: 1; }

body.menu-open { overflow: hidden; }

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  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-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 18, 32, 0.35) 0%, rgba(10, 18, 32, 0.72) 48%, rgba(10, 18, 32, 0.96) 100%),
    linear-gradient(90deg, rgba(10, 18, 32, 0.75) 0%, rgba(10, 18, 32, 0.25) 55%, rgba(10, 18, 32, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 640px;
  animation: rise 0.85s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
  background: linear-gradient(135deg, #fff 20%, var(--brand-soft) 70%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 650;
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
  max-width: 36em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@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: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(22, 35, 56, 0.55), transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head p { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro / brand */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.intro-visual img {
  max-height: 420px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}

.checklist li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.7rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.18);
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.15rem 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(26, 41, 66, 0.9), rgba(15, 26, 46, 0.7));
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 123, 255, 0.45);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.cat-item img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.cat-item strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.cat-item span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: rgba(22, 35, 56, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 123, 255, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s 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(--text-muted);
  margin-bottom: 0.55rem;
}

.tag {
  color: var(--gold-soft);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-soft);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 35, 56, 0.55);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  color: var(--brand-soft);
  font-size: 1.25rem;
  font-weight: 400;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .answer {
  padding: 0 1.15rem 1.1rem;
  color: var(--text-muted);
}

.faq-item .answer p:last-child { margin-bottom: 0; }

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(47, 123, 255, 0.12), transparent 50%),
    rgba(15, 26, 46, 0.4);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-soft); }
.breadcrumb span[aria-hidden="true"] { opacity: 0.5; }

.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero p { max-width: 42rem; margin-bottom: 0; }

/* Content */
.prose {
  max-width: 46rem;
}

.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.4rem; color: var(--text); }
.prose ul, .prose ol {
  color: var(--text-muted);
  padding-left: 1.25rem;
  margin: 0 0 1.1rem;
}
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--text); }

.content-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: rgba(22, 35, 56, 0.55);
  height: fit-content;
}

.side-panel h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-links li {
  border-bottom: 1px solid var(--line);
}

.side-links a {
  display: block;
  padding: 0.7rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.side-links a:hover { color: var(--brand-soft); }

.cover-wide {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}

.cover-wide img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
}

.related-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

/* Promo strip */
.promo-strip {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.promo-strip img {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080f1a;
  padding: 3rem 0 1.75rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 28rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.28rem 0;
}

.footer-col a:hover { color: var(--brand-soft); }

.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(--text-muted);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 3rem 0;
  text-align: center;
}

.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(--brand-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.cta-banner {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(47, 123, 255, 0.3);
  background:
    linear-gradient(120deg, rgba(47, 123, 255, 0.18), rgba(212, 168, 75, 0.08));
}

.cta-banner h2 { margin-bottom: 0.4rem; }
.cta-banner p { margin-bottom: 0; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (min-width: 640px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .promo-strip {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .header-actions { display: flex; }
  .mobile-panel { display: none !important; }

  .intro-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .content-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .cta-banner {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 899px) {
  :root { --header-h: 64px; }
  .brand img {
    height: 34px;
    max-width: 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
