/* KGame – k-gm.baby | Game news portal */
@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: #0b1220;
  --bg-elevated: #121a2b;
  --bg-soft: #162033;
  --surface: #1a2438;
  --line: rgba(148, 176, 220, 0.18);
  --text: #e8eef8;
  --muted: #9aacc4;
  --brand: #3d8bfd;
  --brand-deep: #1e5bb8;
  --accent: #f0c14b;
  --accent-soft: rgba(240, 193, 75, 0.15);
  --success: #3ecf8e;
  --danger: #ef6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1120px;
  --font: 'Be Vietnam Pro', sans-serif;
  --display: 'Sora', 'Be Vietnam Pro', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 139, 253, 0.22), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(240, 193, 75, 0.1), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0d1524 100%);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

a:hover {
  color: var(--brand);
}

ul {
  list-style: none;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.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(11, 18, 32, 0.92);
  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;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--header-h);
  padding: 10px 0;
}

.logo img {
  height: 44px;
  width: auto;
  max-height: calc(var(--header-h) - 20px);
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(61, 139, 253, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(61, 139, 253, 0.35);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(61, 139, 253, 0.45);
  background: rgba(61, 139, 253, 0.1);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(12, 18, 30, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.mobile-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-panel a {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel a.active {
  background: rgba(61, 139, 253, 0.12);
  color: var(--text);
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.mobile-actions .btn {
  width: 100%;
}

/* ========== Main ========== */
main {
  padding-top: var(--header-h);
}

.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;
  animation: heroZoom 18s var(--ease) infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.55) 48%, rgba(8, 12, 22, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 12, 22, 0.95) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
  margin-left: max(1rem, calc((100% - var(--max)) / 2));
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #fff 20%, #9ec5ff 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.85rem;
  color: var(--text);
  animation: fadeUp 0.8s 0.08s var(--ease) both;
}

.hero p {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 1.4rem;
  max-width: 34rem;
  animation: fadeUp 0.8s 0.16s var(--ease) both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fadeUp 0.8s 0.24s var(--ease) both;
}

/* ========== Sections ========== */
.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.55), transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-head .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.section-head p {
  color: var(--muted);
}

.prose {
  color: var(--muted);
  font-size: 1.02rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose a {
  color: #7eb6ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--accent);
}

.prose h2,
.prose h3 {
  color: var(--text);
  font-family: var(--display);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}

.prose ul,
.prose ol {
  margin: 0.85rem 0 0.85rem 1.2rem;
  color: var(--muted);
}

.prose li {
  margin: 0.35rem 0;
  list-style: disc;
}

.prose ol li {
  list-style: decimal;
}

/* Brand intro */
.brand-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.brand-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 280px;
  background: var(--surface);
}

.brand-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 190px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 139, 253, 0.45);
  color: inherit;
}

.cat-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #000;
}

.cat-card .cat-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.1rem;
  background: linear-gradient(0deg, rgba(8, 12, 22, 0.95), transparent);
}

.cat-card h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.cat-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 139, 253, 0.4);
  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.5s var(--ease);
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(61, 139, 253, 0.15);
  color: #9ec5ff;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  font-family: var(--display);
}

.article-card p {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  margin-top: 0.9rem;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(18, 26, 43, 0.8);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  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(--brand);
  font-size: 1.25rem;
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: '–';
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  border-top: 1px solid transparent;
}

.faq-item[open] .faq-a {
  border-top-color: var(--line);
  padding-top: 0.85rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(700px 240px at 20% 0%, rgba(61, 139, 253, 0.18), transparent 60%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.page-hero .lead {
  color: var(--muted);
  max-width: 640px;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  background: #000;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: grid;
  gap: 1rem;
}

.side-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 1.1rem;
}

.side-box h3 {
  font-family: var(--display);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-link {
  display: block;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.side-link:last-child {
  border-bottom: 0;
}

.side-link:hover {
  color: var(--brand);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

/* Brands strip */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-strip img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.05);
  opacity: 0.85;
  transition: opacity 0.2s;
}

.brand-strip img:hover {
  opacity: 1;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080d18;
  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: 42px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-col h4 {
  font-family: var(--display);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.3rem 0;
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* 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(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.error-page h1 {
  font-family: var(--display);
  margin-bottom: 0.65rem;
}

.error-page p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 420px;
}

/* Utils */
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .brand-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .cat-grid,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar {
    position: static;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-panel {
    display: block;
  }

  .logo img {
    height: 38px;
  }

  .hero {
    min-height: min(70vh, 520px);
  }

  .hero-content {
    margin-left: auto;
    margin-right: auto;
  }

  .cat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
