/* KGame – k-gg.autos */
:root {
  --bg: #0b1220;
  --bg-elev: #121a2b;
  --bg-soft: #182338;
  --line: rgba(148, 176, 220, 0.16);
  --text: #e8eef8;
  --muted: #9ab4d6;
  --brand: #3b9eff;
  --brand-2: #1e6fd6;
  --gold: #d4b06a;
  --danger: #ff6b6b;
  --ok: #3ecf8e;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --max: 1120px;
  --nav-h: 72px;
  --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;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 158, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 176, 106, 0.1), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, #0b1220 40%, #0d1526 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: #7cbcff;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(11, 18, 32, 0.86);
  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;
}

.logo {
  display: flex;
  align-items: center;
  height: 40px;
  flex-shrink: 0;
}

.logo img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(59, 158, 255, 0.12);
}

.nav-actions {
  display: none;
  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.7rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(30, 111, 214, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(59, 158, 255, 0.45);
  color: #fff;
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.86rem;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.menu-toggle .menu-label-close {
  display: none;
}

.menu-toggle.is-open .menu-label-open {
  display: none;
}

.menu-toggle.is-open .menu-label-close {
  display: inline;
}

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(320px, 100%);
  height: calc(100vh - var(--nav-h));
  background: #0f1728;
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  z-index: 999;
  padding: 1.25rem;
  overflow-y: auto;
}

.mobile-panel.open {
  transform: translateX(0);
}

.mobile-panel a {
  display: block;
  color: var(--text);
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.mobile-panel .mobile-cta {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.nav-overlay {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 998;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 980px) {
  .nav-desktop,
  .nav-actions {
    display: flex;
  }

  .menu-toggle,
  .mobile-panel,
  .nav-overlay {
    display: none !important;
  }
}

/* Hero */
.page-main {
  padding-top: var(--nav-h);
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  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.2) 0%, rgba(8, 14, 26, 0.88) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  background: linear-gradient(90deg, #fff 20%, #9fd0ff 70%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.85rem;
}

.hero-lead {
  color: var(--muted);
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: 0.55s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.02);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.prose {
  color: #c9d7ea;
}

.prose p {
  margin: 0 0 1rem;
}

.prose a.ext {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notice {
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: #ffd4d4;
  margin: 1.2rem 0;
}

.notice strong {
  color: #fff;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 720px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 158, 255, 0.45);
}

.cat-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
}

.cat-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

.cat-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.cat-item a {
  color: inherit;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 720px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.meta {
  font-size: 0.78rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.article-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.read-more {
  margin-top: auto;
  padding-top: 0.55rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.1rem 1.1rem;
  color: var(--muted);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(59, 158, 255, 0.08), transparent);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.2rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Article layout */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2rem 0 3.5rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin-inline: auto;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 1.8rem 0 0.7rem;
}

.article-body h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.55rem;
}

.article-body ul,
.article-body ol {
  color: #c9d7ea;
  padding-left: 1.2rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.sidebar-box {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h2 {
  font-size: 1rem;
  margin: 0 0 0.85rem;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

.side-list a:hover {
  color: var(--brand);
}

.side-list span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

/* Brand logos strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 28px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
}

/* Error pages */
.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);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080e1a;
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--brand);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: #7f93b0;
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(59, 158, 255, 0.12);
  color: #9fd0ff;
  font-weight: 600;
}

.dual {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .dual {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.visual-panel {
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: grid;
  place-items: center;
}

.visual-panel img {
  max-height: 280px;
  object-fit: contain;
}

.list-links {
  display: grid;
  gap: 0.65rem;
}

.list-links a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 500;
}

.list-links a:hover {
  border-color: rgba(59, 158, 255, 0.45);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: rgba(59, 158, 255, 0.08);
  color: #fff;
}

td {
  color: var(--muted);
}

@media (max-width: 480px) {
  :root {
    --nav-h: 64px;
  }

  .logo img {
    height: 34px;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 2.5rem 0 2rem;
  }
}
