/* KGame – kgweb.beauty */
:root {
  --bg: #070b14;
  --bg-elevated: #0f1628;
  --bg-soft: #141e33;
  --surface: #1a2438;
  --line: rgba(148, 176, 220, 0.16);
  --text: #e8eef8;
  --text-muted: #9aabc4;
  --brand: #3d8bfd;
  --brand-soft: rgba(61, 139, 253, 0.16);
  --accent: #f0c14b;
  --success: #3dd68c;
  --danger: #ff6b7a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1180px;
  --font-display: "Sora", 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 500px at 10% -10%, rgba(61, 139, 253, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(240, 193, 75, 0.08), transparent 50%),
    linear-gradient(180deg, #090e1a 0%, var(--bg) 40%, #05080f 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

ul {
  padding-left: 1.15rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(7, 11, 20, 0.88);
  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.65rem;
  flex-shrink: 0;
  max-width: min(52vw, 220px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: 0.2s ease;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: var(--brand-soft);
}

.header-actions {
  display: flex;
  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;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #4a95ff, #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-toggle {
  display: none;
  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;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(10, 15, 28, 0.97);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
}

.mobile-panel a {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel a.active {
  background: var(--brand-soft);
  color: var(--text);
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.mobile-auth .btn {
  width: 100%;
}

/* Layout */
main {
  padding-top: var(--header-h);
}

.hero {
  position: relative;
  min-height: clamp(420px, 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;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 8, 15, 0.88) 0%, rgba(5, 8, 15, 0.55) 48%, rgba(5, 8, 15, 0.35) 100%),
    linear-gradient(0deg, rgba(5, 8, 15, 0.95) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 680px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #fff, #a8c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  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.7rem;
}

section {
  padding: 4.2rem 0;
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}

.section-alt {
  background: rgba(15, 22, 40, 0.55);
  border-block: 1px solid var(--line);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.category-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 139, 253, 0.45);
}

.category-card .thumb {
  aspect-ratio: 1 / 1;
  background: #000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.category-card .thumb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.category-card .body {
  padding: 0.95rem 1rem 1.15rem;
}

.category-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.category-card p {
  font-size: 0.9rem;
  margin: 0;
}

.article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 139, 253, 0.4);
}

.article-card .cover {
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}

.article-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .cover 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.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #9ec1ff;
  font-size: 0.75rem;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
}

.read-more {
  margin-top: 0.85rem;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
}

.intro-block {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.faq-item h3 {
  font-size: 1.02rem;
  margin-bottom: 0.45rem;
}

.faq-item p {
  margin: 0;
  font-size: 0.95rem;
}

.page-hero {
  padding: 2.8rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(61, 139, 253, 0.08), transparent);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.55;
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.4rem;
  font-size: 1.1rem;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--line);
  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 {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-links {
  display: grid;
  gap: 0.65rem;
}

.side-links a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.side-links a:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--brand-soft);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.brand-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-row img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.05);
  opacity: 0.9;
}

.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-size: clamp(3rem, 10vw, 5rem);
  margin-bottom: 0.4rem;
}

.error-page p {
  max-width: 28rem;
  margin: 0 auto 1.4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #05080f;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-grid h3 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-grid a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}

.footer-grid a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.promo-strip {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0;
}

.promo-strip img {
  width: min(100%, 420px);
  height: auto;
}

.feature-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.2rem 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.feature-list strong {
  color: var(--text);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3,
  .related-grid,
  .intro-block,
  .content-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .brand-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions .desktop-only {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 520px;
  }

  .hero-content {
    margin-bottom: 2.4rem;
  }

  section {
    padding: 3rem 0;
  }

  .brand-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 769px) {
  .mobile-panel {
    display: none !important;
  }
}
