/* KGame Portal — kgame-m.live */
:root {
  --bg: #07111c;
  --bg-soft: #0c1a2b;
  --surface: #122338;
  --surface-2: #182c44;
  --line: rgba(232, 238, 245, 0.1);
  --text: #e9eef5;
  --muted: #93a6bb;
  --gold: #d9a441;
  --gold-soft: #f0c56d;
  --teal: #2bb39a;
  --danger: #e85d5d;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1160px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", 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 500px at 10% -10%, rgba(43, 179, 154, 0.16), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(217, 164, 65, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 45%, #081421 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #fff;
}

ul {
  padding-left: 1.2rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(7, 17, 28, 0.92);
  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: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 1;
}

.brand img {
  height: 36px;
  width: auto;
  max-height: calc(var(--nav-h) - 24px);
  max-width: 148px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.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: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.auth-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b8862b);
  color: #1a1205;
}

.btn-primary:hover {
  color: #1a1205;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: #fff;
  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;
  flex-shrink: 0;
}

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(320px, 88vw);
  height: calc(100vh - var(--nav-h));
  background: #0d1b2c;
  border-left: 1px solid var(--line);
  padding: 1.25rem;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.mobile-panel.open {
  transform: translateX(0);
}

.mobile-panel a {
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mobile-panel a:hover,
.mobile-panel a.active {
  background: rgba(43, 179, 154, 0.15);
  color: #fff;
}

.mobile-auth {
  margin-top: auto;
  display: grid;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--nav-h);
}

.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 640px);
  display: grid;
  align-items: 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;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 17, 28, 0.92) 0%, rgba(7, 17, 28, 0.7) 48%, rgba(7, 17, 28, 0.35) 100%),
    linear-gradient(180deg, rgba(7, 17, 28, 0.2) 0%, rgba(7, 17, 28, 0.92) 100%);
}

.hero-content {
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.hero-kicker {
  display: inline-block;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  color: #fff;
}

.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 720px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  margin: 0 0 0.6rem;
  color: #fff;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.prose {
  color: var(--muted);
}

.prose p {
  margin: 0 0 1rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brand-intro {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.brand-intro .visual {
  justify-self: center;
}

.brand-intro .visual img {
  width: min(280px, 70vw);
  height: auto;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 179, 154, 0.45);
}

.cat-card img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  margin: 0 auto 0.85rem;
}

.cat-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #fff;
}

.cat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0a1522;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.meta .tag {
  color: var(--teal);
  font-weight: 600;
}

.article-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: #fff;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.faq-item h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  color: #fff;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(43, 179, 154, 0.08), transparent);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0 0 0.7rem;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

.article-main {
  background: rgba(18, 35, 56, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #0a1522;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin: 0 auto;
}

.article-main h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  margin: 0 0 0.8rem;
  line-height: 1.25;
}

.article-main h2 {
  font-size: 1.25rem;
  margin: 1.8rem 0 0.7rem;
  color: #fff;
}

.article-main h3 {
  font-size: 1.05rem;
  margin: 1.3rem 0 0.55rem;
  color: var(--gold-soft);
}

.article-side h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0.5rem;
}

.related-item img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
}

.related-item strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.35;
}

.category-detail {
  display: grid;
  gap: 1.25rem;
}

.category-block {
  display: grid;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.category-block img {
  width: min(180px, 45vw);
  margin: 0 auto;
  object-fit: contain;
}

.category-block h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.category-block p {
  margin: 0;
  color: var(--muted);
}

.partners {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.partners img {
  width: 100%;
  max-height: 48px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

.cta-strip {
  display: grid;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(120deg, rgba(43, 179, 154, 0.18), rgba(217, 164, 65, 0.14));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.cta-strip img {
  width: min(320px, 100%);
  margin: 0 auto;
  object-fit: contain;
}

.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 0.5rem;
  color: var(--gold);
}

.error-page p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #060e18;
  padding: 2.5rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.footer-grid h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  color: #fff;
}

.footer-grid p,
.footer-grid a {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-grid a {
  display: block;
  margin-bottom: 0.35rem;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-block {
    grid-template-columns: 160px 1fr;
  }

  .category-block img {
    margin: 0;
  }
}

@media (min-width: 900px) {
  .nav-desktop,
  .auth-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .brand-intro {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-layout {
    grid-template-columns: 1.7fr 0.9fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .cta-strip {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .partners {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 899px) {
  .brand-text {
    font-size: 1rem;
  }

  .brand img {
    height: 34px;
    max-width: 130px;
  }
}
