/* KGame – kkgame.lat */
:root {
  --bg: #f4f7fb;
  --bg-alt: #e8eef6;
  --surface: #ffffff;
  --ink: #152033;
  --ink-soft: #3d4d66;
  --muted: #6b7a90;
  --line: #d5dee9;
  --brand: #1a5cff;
  --brand-deep: #0d3a9e;
  --brand-soft: #e8f0ff;
  --accent: #c9a227;
  --accent-soft: #f7efd4;
  --ok: #0f7a4c;
  --danger: #b42318;
  --header-h: 72px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.08);
  --shadow-sm: 0 4px 14px rgba(21, 32, 51, 0.06);
  --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(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dce8ff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #fff2cc 0%, transparent 45%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 40%, #eef3f9 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.7em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

ul,
ol {
  color: var(--ink-soft);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(213, 222, 233, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.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.55rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  max-height: calc(var(--header-h) - 20px);
}

.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.15rem;
  letter-spacing: 0.02em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn:hover {
  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, 92, 255, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.btn-accent {
  background: linear-gradient(135deg, #e3c35a 0%, var(--accent) 100%);
  color: #2a2108;
}

.btn-accent:hover {
  color: #2a2108;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-panel {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-panel a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.85rem 0.7rem;
  border-radius: 10px;
}

.mobile-panel a:hover {
  background: var(--brand-soft);
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 2.4rem 0 1.5rem;
}

.hero-panel {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: clamp(280px, 48vw, 460px);
  display: grid;
  align-items: end;
  background: #0b1b33;
  box-shadow: var(--shadow);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 16, 32, 0.88) 0%, rgba(7, 16, 32, 0.55) 48%, rgba(7, 16, 32, 0.25) 100%),
    linear-gradient(180deg, transparent 40%, rgba(7, 16, 32, 0.75) 100%);
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(1.4rem, 4vw, 2.8rem);
  max-width: 640px;
  color: #fff;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  margin-bottom: 0.7rem;
  animation: fadeUp 0.7s ease both;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.7s ease 0.08s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  animation: fadeUp 0.7s ease 0.16s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 2.8rem 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.section-head p {
  margin: 0.35rem 0 0;
  max-width: 54ch;
}

.section-link {
  flex-shrink: 0;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-deep);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.4rem;
  align-items: center;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1b33;
  display: grid;
  place-items: center;
  min-height: 280px;
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 70%;
  max-width: 280px;
  object-fit: contain;
}

.prose {
  max-width: 72ch;
}

.prose h2,
.prose h3 {
  margin-top: 1.5em;
}

.prose a.ext {
  font-weight: 600;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  text-decoration: none;
  background: #0d1728;
  border-radius: 16px;
  overflow: hidden;
  min-height: 210px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cat-item img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center;
  padding: 1rem;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 1rem;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  background: linear-gradient(180deg, transparent, rgba(5, 12, 24, 0.9));
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  background: #101a2b;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .tag {
  display: inline-block;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
  background: var(--brand-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.55rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.article-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.article-card h3 a:hover {
  color: var(--brand-deep);
}

.article-card p {
  font-size: 0.92rem;
  margin: 0 0 0.9rem;
  flex: 1;
}

.article-card .more {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--brand);
}

/* Guide list */
.guide-list {
  display: grid;
  gap: 0.9rem;
}

.guide-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-item:hover {
  border-color: #b9ccf5;
  box-shadow: var(--shadow-sm);
}

.guide-item img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #101a2b;
}

.guide-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.guide-item p {
  margin: 0;
  font-size: 0.9rem;
}

.guide-item .arrow {
  color: var(--brand);
  font-weight: 700;
  padding-right: 0.4rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.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: 600;
  font-family: var(--font-display);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--brand);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
}

/* Breadcrumb */
.breadcrumb {
  padding: 1.1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  margin: 0 0.35rem;
}

/* Page hero compact */
.page-hero {
  padding: 1.5rem 0 0.5rem;
}

.page-hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.page-hero p {
  max-width: 68ch;
  margin-bottom: 0;
}

/* Article */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 2.5rem;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
  box-shadow: var(--shadow-sm);
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  background: #101a2b;
  margin-bottom: 1.2rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-inline: auto;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.side-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-box li + li {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.side-box a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 550;
  font-size: 0.92rem;
}

.side-box a:hover {
  color: var(--brand-deep);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* Brands strip */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.brand-strip .brand-logo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 0.8rem;
}

.brand-strip img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

/* CTA band */
.cta-band {
  margin: 1rem 0 2.5rem;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(13, 58, 158, 0.92), rgba(26, 92, 255, 0.85)),
    #0d3a9e;
  color: #fff;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
  align-items: center;
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 0.4rem;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.cta-band img {
  max-height: 120px;
  margin-inline: auto;
  object-fit: contain;
}

/* Footer */
.site-footer {
  background: #0d1524;
  color: #c9d4e5;
  padding: 2.5rem 0 1.4rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.site-footer a {
  color: #c9d4e5;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 0.45rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #8fa0b8;
}

/* Error pages */
.error-wrap {
  min-height: calc(100vh - var(--header-h) - 180px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-wrap h1 {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  margin-bottom: 0.3rem;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mt-0 {
  margin-top: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.chip {
  background: var(--accent-soft);
  color: #6a5310;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.check-list {
  padding-left: 1.1rem;
}

.check-list li {
  margin-bottom: 0.45rem;
}

/* Responsive */
@media (max-width: 980px) {
  .intro-grid,
  .article-layout,
  .cta-band,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cat-grid,
  .card-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: static;
  }

  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-desktop,
  .header-actions .desktop-only {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-actions {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .cat-grid,
  .card-grid,
  .related-grid,
  .brand-strip {
    grid-template-columns: 1fr 1fr;
  }

  .guide-item {
    grid-template-columns: 88px 1fr;
  }

  .guide-item img {
    width: 88px;
    height: 66px;
  }

  .guide-item .arrow {
    display: none;
  }

  .hero-panel {
    min-height: 360px;
  }
}

@media (max-width: 420px) {
  .cat-grid,
  .card-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}
