/* KGame – kgame-app.xyz */
:root {
  --bg: #f3f6fb;
  --bg-alt: #e8eef7;
  --surface: #ffffff;
  --ink: #152033;
  --ink-soft: #4a5a72;
  --line: #d7e0ec;
  --brand: #1f6feb;
  --brand-deep: #0d4bb8;
  --accent: #c9a227;
  --nav: #0c1424;
  --nav-text: #e8eef7;
  --ok: #1a7f5a;
  --warn: #b45309;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(15, 30, 60, 0.08);
  --max: 1120px;
  --nav-h: 68px;
  --font-display: "Manrope", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Manrope", 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%, rgba(31, 111, 235, 0.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(201, 162, 39, 0.1), transparent 55%),
    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: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(12, 20, 36, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-link img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.nav-desktop a {
  color: var(--nav-text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.92;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  opacity: 1;
  text-decoration: none;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.28);
}

.btn-ghost {
  background: transparent;
  color: var(--nav-text) !important;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-light {
  background: #fff;
  color: var(--brand-deep) !important;
  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.14);
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #101a2c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem 1.1rem;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

.mobile-panel a {
  display: block;
  color: #e8eef7;
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 500;
}

.mobile-panel .mobile-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
  border: none;
  padding: 0;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 900px) {
  .nav-desktop,
  .nav-actions {
    display: flex;
  }
  .menu-toggle,
  .mobile-panel {
    display: none !important;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  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;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 14, 28, 0.35) 0%, rgba(8, 14, 28, 0.72) 55%, rgba(8, 14, 28, 0.92) 100%),
    linear-gradient(90deg, rgba(8, 14, 28, 0.75) 0%, rgba(8, 14, 28, 0.25) 55%, rgba(8, 14, 28, 0.55) 100%);
}

.hero-content {
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.85rem;
  background: linear-gradient(90deg, #fff 0%, #cfe0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.85rem;
  color: #f2f6ff;
}

.hero-lead {
  margin: 0 0 1.4rem;
  color: rgba(232, 238, 247, 0.88);
  font-size: 1.02rem;
  max-width: 36rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 238, 247, 0.7));
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.prose {
  max-width: 46rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.prose ul,
.prose ol {
  color: var(--ink-soft);
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.ext-link {
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Brand intro */
.brand-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .brand-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.brand-visual {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background: #0c1424;
  min-height: 280px;
  box-shadow: var(--shadow);
}

.brand-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.brand-visual.phone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(31, 111, 235, 0.35), transparent 50%),
    #0c1424;
}

.brand-visual.phone img {
  width: min(220px, 55%);
  height: auto;
  min-height: 0;
  object-fit: contain;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 720px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0c1424;
  text-decoration: none !important;
  aspect-ratio: 1 / 1;
  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;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.04);
}

.cat-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 0.9rem 0.85rem;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
}

/* 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: 0 6px 24px rgba(15, 30, 60, 0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  background: #0c1424;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.article-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--brand-deep);
}

.article-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-deep);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.15rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--font-display);
  padding: 0.9rem 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 {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.4rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0.4rem 0 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-hero p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.breadcrumb a {
  color: var(--ink-soft);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.2rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0c1424;
  margin-bottom: 1.4rem;
  max-height: 420px;
}

.article-cover img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.8rem;
}

.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.7rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.related-list img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #0c1424;
}

.related-list span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Legal / about */
.content-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  box-shadow: 0 6px 24px rgba(15, 30, 60, 0.04);
}

.notice {
  border-left: 3px solid var(--warn);
  background: #fff8ef;
  padding: 0.9rem 1rem;
  border-radius: 0 10px 10px 0;
  color: #6b4a16;
  margin: 1rem 0;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  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), #0c1424);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.error-page h1 {
  font-family: var(--font-display);
  margin: 0.4rem 0 0.7rem;
}

.error-page p {
  color: var(--ink-soft);
  margin: 0 0 1.3rem;
}

/* Footer */
.site-footer {
  background: #0c1424;
  color: rgba(232, 238, 247, 0.82);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.6rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.site-footer a {
  color: rgba(232, 238, 247, 0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.8rem;
}

.footer-copy {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  opacity: 0.75;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: #0c1424;
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  opacity: 0.85;
  filter: brightness(1.05);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: none;
  }
  .hero-content {
    animation: fadeUp 0.7s ease both;
  }
  .hero-brand {
    animation: fadeUp 0.75s ease 0.05s both;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
