/* KGame – k-game-web.blog */
:root {
  --bg: #f4f7fb;
  --bg-alt: #e8eef6;
  --surface: #ffffff;
  --ink: #0f1b2d;
  --ink-soft: #3d4f66;
  --muted: #6b7c93;
  --line: #d5deea;
  --brand: #1a6fe8;
  --brand-deep: #0d4bb8;
  --brand-soft: #e8f1fd;
  --accent: #00a3a3;
  --accent-soft: #e0f5f5;
  --nav-bg: #0b1626;
  --nav-ink: #f2f6fc;
  --warn: #c0392b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 27, 45, 0.08);
  --header-h: 72px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", system-ui, sans-serif;
  --max: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d7e7ff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #d8f3f1 0%, transparent 50%),
    var(--bg);
  line-height: 1.65;
  padding-top: var(--header-h);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.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: linear-gradient(180deg, #0d1a2d 0%, #0b1626 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 20px);
  text-decoration: none;
}

.logo img {
  height: 42px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--nav-ink);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  opacity: 0.92;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
  text-decoration: none;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26, 111, 232, 0.28);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-light {
  background: var(--surface);
  color: var(--brand-deep);
  border-color: var(--line);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(88vw, 320px);
  height: calc(100vh - var(--header-h));
  background: #101d31;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  padding: 1.25rem;
  overflow-y: auto;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.35);
}

.nav-mobile.open {
  transform: translateX(0);
}

.nav-mobile a {
  display: block;
  color: #eaf0f8;
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-weight: 500;
}

.nav-mobile .mobile-auth {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .nav-mobile,
  .nav-overlay {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(360px, 62vh, 560px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0b1626;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 16, 30, 0.92) 0%, rgba(8, 16, 30, 0.72) 42%, rgba(8, 16, 30, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 16, 30, 0.85) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 3rem;
  color: #fff;
  max-width: 640px;
  animation: rise 0.7s ease both;
}

.hero-content .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  background: linear-gradient(90deg, #ffffff, #9ec5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hero-content p {
  color: rgba(235, 242, 252, 0.88);
  font-size: 1.02rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(232, 241, 253, 0.55), transparent 70%);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.intro-grid {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 860px) {
  .intro-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1626;
  box-shadow: var(--shadow);
  animation: fadeIn 0.8s ease both;
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 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(4, 1fr);
  }
}

.cat-item {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.cat-item .thumb {
  background: #0b1626;
  aspect-ratio: 16/11;
  display: grid;
  place-items: center;
  padding: 0.75rem;
}

.cat-item .thumb img {
  max-height: 120px;
  width: auto;
  object-fit: contain;
}

.cat-item .label {
  padding: 0.85rem 0.9rem 1rem;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.98rem;
}

.cat-item .label span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

@media (min-width: 720px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.article-card .cover {
  background: #101d31;
  aspect-ratio: 16/10;
  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: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.article-card .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--ink);
}

.article-card p {
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  padding: 0.95rem 0;
  list-style: none;
  font-family: var(--font-display);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin-top: 0;
  padding-bottom: 0.95rem;
}

/* Page hero */
.page-hero {
  padding: 2.4rem 0 1.5rem;
  background:
    linear-gradient(135deg, rgba(26, 111, 232, 0.1), rgba(0, 163, 163, 0.08)),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  color: var(--ink-soft);
}

.page-hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  max-width: 46rem;
}

.page-hero .lead {
  max-width: 42rem;
  margin: 0;
}

/* Article */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
  }
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.8rem;
}

.prose h2 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.35rem;
  font-size: 1.12rem;
}

.prose ul,
.prose ol {
  color: var(--ink-soft);
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose figure {
  margin: 1.4rem 0;
}

.prose figure img {
  width: 100%;
  border-radius: 10px;
  background: #0b1626;
}

.prose figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.45rem;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar-box h3 {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  text-decoration: none;
  align-items: center;
}

.related-list a img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #0b1626;
}

.related-list a span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* 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);
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  background: #0b1626;
  color: rgba(234, 240, 248, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3,
.site-footer h4 {
  color: #fff;
}

.site-footer a {
  color: rgba(234, 240, 248, 0.82);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  color: rgba(234, 240, 248, 0.55);
}

.ext-link {
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-box {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  padding: 0.95rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.2rem 0;
}

.note-box p {
  margin: 0;
  color: var(--ink);
}

.list-page .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
}

.chip.active,
.chip:hover {
  background: var(--brand-soft);
  border-color: #b7d0f7;
  color: var(--brand-deep);
  text-decoration: none;
}

.cta-band {
  margin: 1rem 0 0;
  padding: 1.6rem;
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(26, 111, 232, 0.95), rgba(0, 140, 150, 0.92)),
    #0d4bb8;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0.35rem 0 0;
  max-width: 34rem;
}

.cta-band h2 {
  color: #fff;
  margin: 0;
  font-size: 1.35rem;
}

@media (max-width: 600px) {
  :root {
    --header-h: 64px;
  }

  .logo img {
    height: 36px;
  }

  .section {
    padding: 2.6rem 0;
  }

  .prose {
    padding: 1.1rem 1rem 1.4rem;
  }
}
