/* KGame — kgames.homes */
:root {
  --bg: #eef6f8;
  --bg-deep: #dcecf1;
  --surface: #ffffff;
  --ink: #132a33;
  --muted: #526872;
  --brand: #0c7d8f;
  --brand-deep: #065463;
  --brand-soft: #d4eef2;
  --accent: #e09220;
  --accent-deep: #b86f0c;
  --accent-soft: #fff3dd;
  --line: #c5d8e0;
  --header: #0a3642;
  --header-ink: #f4fafb;
  --ok: #1a8a5c;
  --shadow: 0 10px 30px rgba(10, 54, 66, 0.08);
  --radius: 14px;
  --max: 1120px;
  --nav-h: 68px;
  --font-display: "Sora", "Be Vietnam Pro", 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(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d7f0f5 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #ffe9c8 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #f7fbfd 40%, var(--bg-deep) 100%);
  line-height: 1.7;
  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(--accent-deep);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #111;
  padding: 0.6rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: linear-gradient(90deg, #08303a 0%, #0a4452 55%, #0c5868 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--header-ink);
  flex-shrink: 0;
  max-width: min(52vw, 220px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: calc(var(--nav-h) - 20px);
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #f0b14a 100%);
  color: #1a1408;
  box-shadow: 0 6px 16px rgba(224, 146, 32, 0.35);
}

.btn-primary:hover {
  color: #1a1408;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.btn-outline {
  background: transparent;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
}

.btn-outline:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.menu-toggle[aria-expanded="true"] .label-menu {
  display: none;
}

.menu-toggle .label-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .label-close {
  display: inline;
}

.mobile-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--nav-h);
  background: #0b3d4a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem 1.1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.mobile-panel.open,
.mobile-panel.open[hidden] {
  display: block !important;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-panel a {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: 0.7rem 0.55rem;
  border-radius: 8px;
  font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-actions .btn {
  width: 100%;
}

@media (min-width: 900px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .menu-toggle,
  .mobile-panel {
    display: none !important;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(420px, 78vh, 640px);
  display: grid;
  align-items: 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;
  transform: scale(1.02);
  animation: heroZoom 18s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(6, 36, 44, 0.88) 8%, rgba(6, 36, 44, 0.55) 48%, rgba(6, 36, 44, 0.28) 100%),
    linear-gradient(0deg, rgba(6, 36, 44, 0.75) 0%, transparent 45%);
}

.hero-content {
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
}

.hero-content .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.55rem;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.7s ease both;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.8rem;
  animation: fadeUp 0.7s ease 0.08s both;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  max-width: 34em;
  animation: fadeUp 0.7s ease 0.16s both;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
  animation: fadeUp 0.7s ease 0.24s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 3.4rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid rgba(197, 216, 224, 0.65);
}

.section-head {
  margin-bottom: 1.6rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.prose {
  max-width: 48rem;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.25em;
  font-size: 1.12rem;
}

.prose a.ext {
  font-weight: 600;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
  color: #fff;
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
}

.cat-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 0.85rem 0.85rem;
  background: linear-gradient(0deg, rgba(8, 35, 42, 0.92), transparent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 700px) {
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(10, 54, 66, 0.12);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-deep);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  color: var(--muted);
  font-size: 0.94rem;
  flex: 1;
}

.article-card .more {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--brand-deep);
  text-decoration: none;
}

/* Brand / intro band */
.intro-band {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .intro-band {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
  }
}

.intro-visual {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0a3642;
}

.intro-visual img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@media (min-width: 700px) {
  .brand-row {
    grid-template-columns: repeat(8, 1fr);
  }
}

.brand-row img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem;
  filter: grayscale(0.15);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--font-display);
  padding: 0.85rem 0;
  list-style: none;
}

.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 {
  color: var(--muted);
  padding-bottom: 0.85rem;
}

/* Page hero small */
.page-hero {
  padding: 2.4rem 0 1.4rem;
  border-bottom: 1px solid rgba(197, 216, 224, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-bottom: 0.45rem;
}

.page-hero p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--brand-deep);
  text-decoration: none;
}

.breadcrumb span {
  opacity: 0.55;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2rem 0 3rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.article-cover {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h2 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.related-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.related-list span {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 220px);
  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: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #0a3642 0%, #072830 100%);
  color: rgba(255, 255, 255, 0.86);
  padding: 2.6rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffd27a;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.tag {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.feature-list {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 760px) {
  .feature-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.feature-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.feature-item h3 {
  font-size: 1.02rem;
}

.feature-item p {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
}

.promo-strip {
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 800px) {
  .promo-strip {
    grid-template-columns: 1fr 1.1fr;
  }
}

.promo-strip img {
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
