/* KGame – k-game-app.baby | Game news portal */
:root {
  --bg: #eef3f9;
  --bg-deep: #dbe7f4;
  --surface: #ffffff;
  --ink: #0c1b2a;
  --ink-soft: #243447;
  --muted: #5a6b7d;
  --line: rgba(15, 40, 70, 0.1);
  --brand: #1494ff;
  --brand-2: #0a6fd0;
  --brand-soft: rgba(20, 148, 255, 0.12);
  --gold: #c9a227;
  --ok: #1f9d6a;
  --danger: #c62828;
  --nav-h: 72px;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(12, 35, 60, 0.08);
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
  --max: 1120px;
}

*,
*::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%, rgba(20, 148, 255, 0.18), transparent 60%),
    radial-gradient(900px 420px at 95% 5%, rgba(201, 162, 39, 0.12), transparent 55%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 40%, #e8f0f8 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; color: var(--ink-soft); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(12, 35, 60, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  text-decoration: none;
}

.logo-link img {
  height: 40px;
  width: auto;
  max-height: calc(var(--nav-h) - 24px);
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-desktop a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0;
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--brand-2);
  text-decoration: none;
}

.nav-desktop a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.auth-desktop {
  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: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(20, 148, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--ink) !important;
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-2) !important;
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-soft);
  border: 1px solid rgba(20, 148, 255, 0.25);
  color: var(--brand-2);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem 1.35rem;
  z-index: 999;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.nav-mobile.is-open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-mobile a {
  display: block;
  padding: 0.75rem 0.25rem;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.nav-mobile .auth-mobile {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.nav-mobile .auth-mobile .btn {
  flex: 1;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  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(100deg, rgba(6, 18, 32, 0.88) 0%, rgba(8, 28, 52, 0.55) 48%, rgba(8, 30, 55, 0.35) 100%),
    linear-gradient(0deg, rgba(6, 16, 28, 0.75) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3.5rem;
  max-width: 640px;
  margin-left: max(1rem, calc((100% - var(--max)) / 2));
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  max-width: 28ch;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.02rem;
  margin-bottom: 1.35rem;
  max-width: 42ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ========== Sections ========== */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 640px;
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 0.45rem;
}

.prose {
  max-width: 720px;
}

.prose a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.brand-intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.brand-intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a1220;
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s ease 0.1s both;
}

.brand-intro-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ========== Category grid ========== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a1220;
  text-decoration: none;
  min-height: 180px;
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(12, 35, 60, 0.18);
  text-decoration: none;
}

.cat-item img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1rem 0.95rem;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  z-index: 1;
}

/* ========== Article cards ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(12, 35, 60, 0.04);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.article-card .thumb {
  background: #0a1220;
  aspect-ratio: 16 / 10;
  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: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.02rem;
  margin: 0;
  color: var(--ink);
}

.article-card p {
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.article-card .more {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-2);
  margin-top: 0.35rem;
}

/* ========== FAQ ========== */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 700;
  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: "+";
  font-size: 1.25rem;
  color: var(--brand-2);
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
}

/* ========== Page chrome ========== */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 148, 255, 0.08), transparent);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
  align-items: start;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 2rem;
  box-shadow: 0 4px 20px rgba(12, 35, 60, 0.04);
}

.article-body .cover {
  margin: -1.5rem -1.6rem 1.4rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: #0a1220;
}

.article-body .cover img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.article-body .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  display: grid;
  gap: 1rem;
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.side-links a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.side-links a:hover {
  color: var(--brand-2);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ========== List page ========== */
.list-stack {
  display: grid;
  gap: 1rem;
}

.list-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
}

.list-item:hover {
  box-shadow: var(--shadow);
  text-decoration: none;
}

.list-item .thumb {
  background: #0a1220;
  min-height: 130px;
}

.list-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item .body {
  padding: 1rem 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.list-item h2 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.list-item p {
  margin: 0;
  font-size: 0.92rem;
}

/* ========== Legal / about ========== */
.legal-content {
  padding: 2.5rem 0 3.5rem;
  max-width: 760px;
}

.legal-content h2 {
  margin-top: 1.75rem;
}

.error-page {
  min-height: calc(100vh - var(--nav-h) - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* ========== Footer ========== */
.site-footer {
  background: #0b1624;
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.site-footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.55);
}

.footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
  object-fit: contain;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: var(--brand-soft);
  color: var(--brand-2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.cta-band {
  background: linear-gradient(120deg, #0b6fd0, #1494ff 55%, #3aa8ff);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 14px 36px rgba(20, 148, 255, 0.3);
}

.cta-band h2,
.cta-band p {
  color: #fff;
  margin: 0;
}

.cta-band p {
  opacity: 0.9;
  margin-top: 0.35rem;
}

.cta-band .btn-ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff !important;
}

.guide-steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

.guide-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.15rem 3.5rem;
  position: relative;
}

.guide-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-step h3 {
  margin-bottom: 0.35rem;
}

.guide-step p {
  margin: 0;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature h3 {
  font-size: 1.05rem;
}

.feature p {
  margin: 0;
  font-size: 0.92rem;
}

.feature .icon-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .brand-intro,
  .content-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .cat-grid,
  .card-grid,
  .feature-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  .nav-desktop,
  .auth-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .logo-link img {
    height: 34px;
  }

  .hero {
    min-height: 460px;
    align-items: flex-end;
  }

  .hero-content {
    margin-bottom: 2.25rem;
  }

  .cat-grid,
  .card-grid,
  .feature-row {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .list-item .thumb {
    aspect-ratio: 16 / 9;
  }

  .list-item .body {
    padding: 0 1rem 1.1rem;
  }

  .article-body {
    padding: 1.15rem;
  }

  .article-body .cover {
    margin: -1.15rem -1.15rem 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
