/* KGame – kgame-web.cfd */
:root {
  --bg-deep: #0b1220;
  --bg-panel: #121a2b;
  --bg-elevated: #182234;
  --bg-soft: #1e2a3f;
  --line: rgba(148, 183, 255, 0.16);
  --text: #e8eef9;
  --text-muted: #9aa8c2;
  --brand: #5da8ff;
  --brand-strong: #3b8dff;
  --brand-soft: rgba(93, 168, 255, 0.14);
  --accent: #7dd3c0;
  --warn: #f0b429;
  --danger: #ef6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --nav-h: 68px;
  --max: 1180px;
  --font-display: "Rajdhani", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 141, 255, 0.22), transparent 55%),
    radial-gradient(900px 500px at 95% 5%, rgba(125, 211, 192, 0.12), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #0e1626 45%, #10182a 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #9cc8ff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
  font-weight: 700;
}

h1 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); }

p { margin: 0 0 1rem; color: var(--text-muted); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-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.55rem;
  flex-shrink: 0;
  max-height: calc(var(--nav-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.35rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0;
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
}

.nav-desktop a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-strong), #62b4ff);
  color: #04101f;
}

.btn-primary:hover { color: #04101f; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--brand); color: var(--text); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(12, 19, 34, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
  z-index: 999;
}

.mobile-panel.open { display: block; }

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-panel a {
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mobile-auth .btn { width: 100%; }

main {
  padding-top: var(--nav-h);
}

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  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 top;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 26, 0.92) 0%, rgba(8, 14, 26, 0.72) 42%, rgba(8, 14, 26, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 14, 26, 0.15) 0%, rgba(8, 14, 26, 0.88) 100%);
}

.hero-content {
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
  animation: rise 0.7s ease both;
}

.hero-content .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
}

.hero-content h1 {
  margin-bottom: 0.85rem;
  color: #fff;
}

.hero-content p {
  font-size: 1.05rem;
  color: #c7d3e8;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section {
  padding: 4rem 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head p {
  max-width: 36rem;
  margin: 0;
}

.section-link {
  font-weight: 600;
  white-space: nowrap;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-copy h2 { color: #fff; }

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(93, 168, 255, 0.12), transparent 50%),
    var(--bg-panel);
  border: 1px solid var(--line);
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.intro-visual img {
  max-height: 260px;
  width: auto;
  margin: 0 auto;
  animation: fade-in 0.8s ease both;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.1rem 0.85rem 1.2rem;
  background: linear-gradient(180deg, rgba(30, 42, 63, 0.7), rgba(18, 26, 43, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-item:hover {
  transform: translateY(-4px);
  border-color: rgba(93, 168, 255, 0.45);
  color: #fff;
}

.category-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.category-item span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(93, 168, 255, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0a101c;
  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: 1.05rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag {
  color: var(--brand);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.12rem;
  margin: 0;
  color: var(--text);
}

.article-card p {
  margin: 0;
  font-size: 0.92rem;
  flex: 1;
}

.guide-list {
  display: grid;
  gap: 0.85rem;
}

.guide-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.guide-item:hover {
  border-color: rgba(93, 168, 255, 0.4);
  background: var(--bg-elevated);
  color: inherit;
}

.guide-item img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #0a101c;
}

.guide-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--text);
}

.guide-item p {
  margin: 0;
  font-size: 0.9rem;
}

.guide-item .arrow {
  color: var(--brand);
  font-size: 1.25rem;
}

.brand-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-strip img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.05);
  opacity: 0.88;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.brand-strip img:hover {
  opacity: 1;
  filter: none;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--text);
  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(--text-muted);
}

.cta-band {
  margin: 1rem 0 0;
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(59, 141, 255, 0.18), rgba(125, 211, 192, 0.08)),
    var(--bg-panel);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cta-band h2,
.cta-band p { margin: 0; }
.cta-band h2 { color: #fff; margin-bottom: 0.35rem; }

.promo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.promo-row a img {
  max-height: 64px;
  width: auto;
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(93, 168, 255, 0.08), transparent);
}

.page-hero h1 { margin-bottom: 0.5rem; color: #fff; }
.page-hero p { max-width: 46rem; margin: 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-current="page"] { color: var(--text); }

.content-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.prose {
  background: rgba(18, 26, 43, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.prose h2, .prose h3 { color: #fff; margin-top: 1.6rem; }
.prose ul, .prose ol { color: var(--text-muted); padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose img {
  border-radius: var(--radius-sm);
  margin: 1.2rem auto;
}

.prose figure {
  margin: 1.4rem 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-box {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: #fff;
}

.side-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.side-box a {
  color: var(--text-muted);
  font-size: 0.92rem;
  display: block;
}

.side-box a:hover { color: var(--brand); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.error-page {
  min-height: calc(100vh - var(--nav-h));
  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);
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.92);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.site-footer p,
.site-footer a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer a:hover { color: var(--brand); }

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .nav-desktop,
  .nav-actions { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .intro-grid,
  .content-wrap,
  .footer-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .brand-strip { grid-template-columns: repeat(4, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .guide-item { grid-template-columns: 80px 1fr; }
  .guide-item .arrow { display: none; }
}

@media (max-width: 640px) {
  :root { --nav-h: 62px; }
  .brand img { height: 34px; max-height: 34px; }
  .hero { min-height: 70vh; }
  .hero-content { padding: 3.2rem 0 2.4rem; }
  .card-grid,
  .category-grid { grid-template-columns: 1fr; }
  .brand-strip { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 3rem 0; }
  .cta-band { text-align: left; }
}
