/* KGame – kgame-k.online | Game portal styles */
:root {
  --bg: #f4f7fb;
  --bg-soft: #e8eef7;
  --surface: #ffffff;
  --ink: #142033;
  --ink-soft: #3d4f6a;
  --muted: #6b7c94;
  --line: #d5dee9;
  --brand: #2f7dff;
  --brand-deep: #1a5fd4;
  --brand-soft: #e8f1ff;
  --accent: #00b4d8;
  --nav: #0d1728;
  --nav-text: #e8eef8;
  --danger: #c62828;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.08);
  --header-h: 72px;
  --max: 1160px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(47, 125, 255, 0.12), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(0, 180, 216, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3fa 0%, var(--bg) 28%, #f7f9fc 100%);
  line-height: 1.65;
  min-height: 100vh;
}

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;
  color: var(--ink);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  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: rgba(13, 23, 40, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
  max-height: 42px;
  overflow: hidden;
}

.brand img {
  height: 42px;
  width: auto;
  max-height: 42px;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #f3f7ff;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--nav-text);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  opacity: 0.9;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(47, 125, 255, 0.18);
  color: #fff;
  opacity: 1;
  text-decoration: none;
}

.header-actions {
  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.55rem 1.05rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  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), var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 125, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  color: var(--brand-deep);
  border-color: #c9d9f5;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: #101c31;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0 1.1rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav a {
  color: #e8eef8;
  padding: 0.7rem 0.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.mobile-nav a:hover {
  background: rgba(47, 125, 255, 0.15);
  text-decoration: none;
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-auth .btn {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(360px, 68vh, 560px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  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;
  animation: heroZoom 18s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 28, 0.88) 0%, rgba(8, 14, 28, 0.55) 48%, rgba(8, 14, 28, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 14, 28, 0.75) 0%, transparent 45%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
  margin-left: max(1rem, calc((100% - var(--max)) / 2));
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.55rem;
  background: linear-gradient(90deg, #fff, #9fd0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  animation: fadeUp 0.7s ease 0.08s both;
}

.hero p {
  color: rgba(232, 238, 248, 0.9);
  font-size: 1.02rem;
  max-width: 34rem;
  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(213, 222, 233, 0.7);
}

.section-head {
  margin-bottom: 1.6rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  margin-bottom: 0.4rem;
}

.section-head p {
  margin: 0;
}

.prose {
  max-width: 48rem;
}

.prose h2 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.35rem;
  font-size: 1.12rem;
}

.prose a {
  font-weight: 600;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0d1728;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 260px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d1728;
  text-decoration: none;
  min-height: 180px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(20, 32, 51, 0.16);
  text-decoration: none;
}

.cat-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(8, 14, 28, 0.92));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
}

/* Cards / articles */
.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.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 4px 14px rgba(20, 32, 51, 0.04);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card a {
  text-decoration: none;
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfe7f2;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
  flex: 1;
}

.article-card .more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-deep);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  padding: 0.95rem 0;
  list-style: none;
  color: var(--ink);
}

.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: 0 0 1rem;
  padding-bottom: 0.2rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.4rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 125, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.45rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 3rem;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.8rem;
  box-shadow: 0 4px 18px rgba(20, 32, 51, 0.04);
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 1.3rem;
  background: #dfe7f2;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.15rem;
  margin-bottom: 1rem;
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.65rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.related-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.related-list span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

.related-list a:hover span {
  color: var(--brand-deep);
}

.promo-banner {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.promo-banner img {
  width: 100%;
}

/* Lists */
.list-stack {
  display: grid;
  gap: 1rem;
}

.list-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}

.list-item .thumb {
  min-height: 140px;
  background: #dfe7f2;
}

.list-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 140px;
}

.list-item .body {
  padding: 1rem 1rem 1rem 0;
}

.list-item h2 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.list-item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.list-item h2 a:hover {
  color: var(--brand-deep);
}

/* Brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-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;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
  background: #0d1728;
  color: #c9d4e6;
  padding: 2.8rem 0 1.4rem;
  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: 1rem;
  margin-bottom: 0.8rem;
}

.site-footer p,
.site-footer a {
  color: #aebbd0;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #fff;
}

.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.08);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.84rem;
  color: #8ea0ba;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 0.75rem;
}

/* Utilities */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-deep);
  background: var(--brand-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Responsive */
@media (max-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 160px 1fr;
  }
}

@media (max-width: 820px) {
  .nav-desktop,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand img {
    height: 36px;
    max-height: 36px;
  }

  :root {
    --header-h: 64px;
  }
}

@media (max-width: 640px) {
  .cat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .list-item .body {
    padding: 0 1rem 1rem;
  }

  .hero-content {
    padding: 3.2rem 0 2.4rem;
  }

  .article-main {
    padding: 1.1rem;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
