/* KGame – kgamee.quest */
:root {
  --bg: #08101c;
  --bg-2: #0e1828;
  --surface: #132033;
  --surface-2: #1a2b42;
  --line: rgba(125, 168, 210, 0.18);
  --text: #edf3fb;
  --muted: #9fb0c6;
  --accent: #3db8f5;
  --accent-deep: #1f8fd0;
  --gold: #e2b653;
  --danger: #e45858;
  --ok: #3ecf8e;
  --radius: 14px;
  --header-h: 68px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Outfit", "Be Vietnam Pro", sans-serif;
  --max: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 184, 245, 0.16), transparent 55%),
    radial-gradient(900px 500px at 95% 5%, rgba(226, 182, 83, 0.08), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 40%, #07101a 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7ad3ff;
}

ul,
ol {
  padding-left: 1.2rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(8, 16, 28, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.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.65rem;
  flex-shrink: 0;
  max-width: 48%;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  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: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.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.62rem 1.05rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #041018;
}

.btn-primary:hover {
  color: #041018;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  right: 0;
  left: 0;
  background: rgba(10, 18, 32, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.35rem;
  z-index: 999;
  transform-origin: top;
  animation: dropIn 0.22s ease;
}

.mobile-panel.open {
  display: block;
}

.mobile-panel a {
  display: block;
  padding: 0.7rem 0;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-panel .mobile-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
  border: 0;
  padding: 0;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(8, 16, 28, 0.25) 0%, rgba(8, 16, 28, 0.72) 55%, var(--bg) 100%),
    url("banner.3dd2.webp") center/cover no-repeat;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 40%, rgba(61, 184, 245, 0.18), transparent 40%),
    linear-gradient(90deg, rgba(8, 16, 28, 0.85) 0%, rgba(8, 16, 28, 0.35) 55%, rgba(8, 16, 28, 0.55) 100%);
}

.hero-content {
  padding: 4.5rem 0 3.5rem;
  max-width: 680px;
  animation: rise 0.7s ease both;
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 0 0.8rem;
  background: linear-gradient(180deg, #fff 20%, #9fd8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 650;
  margin-bottom: 0.85rem;
}

.hero p {
  font-size: 1.05rem;
  max-width: 36rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.section-alt {
  background: linear-gradient(180deg, rgba(19, 32, 51, 0.55), rgba(19, 32, 51, 0.15));
  border-block: 1px solid var(--line);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  display: grid;
  place-items: center;
}

.intro-visual img {
  width: min(100%, 360px);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  animation: floaty 4.5s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.category-item {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.85rem;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(26, 43, 66, 0.9), rgba(14, 24, 40, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
  color: inherit;
}

.category-item:hover {
  border-color: rgba(61, 184, 245, 0.45);
  transform: translateY(-3px);
  color: inherit;
}

.category-item img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: radial-gradient(circle at center, rgba(61, 184, 245, 0.12), transparent 65%);
  border-radius: 10px;
}

.category-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.category-item p {
  margin: 0;
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  color: inherit;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 184, 245, 0.4);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a1422;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.tag {
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0;
}

.article-card p {
  margin: 0;
  font-size: 0.9rem;
  flex: 1;
}

.read-more {
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(19, 32, 51, 0.7);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.1rem 1.1rem;
  color: var(--muted);
  margin: 0;
}

/* Page hero / breadcrumb */
.page-hero {
  padding: 2.4rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(61, 184, 245, 0.08), transparent),
    var(--bg-2);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  opacity: 0.5;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.55rem;
}

.content-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.prose {
  background: rgba(19, 32, 51, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
}

.prose h2 {
  margin-top: 1.6rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.25rem;
  font-size: 1.1rem;
}

.prose img.cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0.5rem 0 1.2rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.side-block h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.side-list a {
  color: var(--text);
  font-size: 0.92rem;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  align-items: center;
}

.side-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #0a1422;
}

.side-list span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.list-page .card-grid {
  padding: 2.5rem 0 4rem;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.1);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  background: linear-gradient(180deg, var(--accent), #7ad3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #060d17;
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 38px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-grid h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-item {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(19, 32, 51, 0.55);
}

.feature-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.feature-item h3 {
  font-size: 1rem;
}

.guide-steps {
  display: grid;
  gap: 0.9rem;
  counter-reset: step;
}

.guide-steps li {
  list-style: none;
  position: relative;
  padding: 1rem 1rem 1rem 3.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(19, 32, 51, 0.5);
}

.guide-steps {
  padding: 0;
  margin: 0;
}

.guide-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #041018;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  text-align: left;
}

th {
  background: rgba(61, 184, 245, 0.1);
  color: var(--text);
}

td {
  color: var(--muted);
}

@media (max-width: 980px) {
  .nav-desktop,
  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .intro-grid,
  .content-wrap,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .card-grid,
  .feature-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: 72vh;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .category-grid,
  .card-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 3rem 0 2.4rem;
  }

  .section {
    padding: 3rem 0;
  }

  .prose {
    padding: 1.15rem 1rem;
  }

  .mobile-panel .mobile-cta {
    grid-template-columns: 1fr;
  }
}
