/* KGame – k-gm.homes | Game portal styles */
:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --surface: #ffffff;
  --ink: #122033;
  --muted: #5a6b7d;
  --line: rgba(18, 32, 51, 0.1);
  --brand: #1a7ae8;
  --brand-deep: #0d4fa8;
  --accent: #00a8e8;
  --navy: #0b1a2e;
  --navy-2: #132c4a;
  --hero-overlay: linear-gradient(120deg, rgba(8, 20, 40, 0.88) 0%, rgba(12, 40, 72, 0.72) 55%, rgba(8, 24, 48, 0.55) 100%);
  --radius: 14px;
  --shadow: 0 12px 32px rgba(11, 26, 46, 0.12);
  --nav-h: 72px;
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
}

* { 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(26, 122, 232, 0.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(0, 168, 232, 0.1), transparent 55%),
    linear-gradient(180deg, #e8eef6 0%, var(--bg) 40%, #e6edf5 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 { color: var(--brand); }
ul { padding-left: 1.2rem; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--navy);
}
p { margin: 0 0 1rem; color: var(--muted); }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

/* Fixed nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(11, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 16px);
}
.brand img {
  height: 44px;
  width: auto;
  max-height: calc(var(--nav-h) - 20px);
  object-fit: contain;
}
.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.nav-desktop a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}
.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: #fff;
  background: rgba(26, 122, 232, 0.25);
}
.nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: var(--font-body);
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(26, 122, 232, 0.28);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn-light {
  background: #fff;
  color: var(--brand-deep);
}
.btn-light:hover { color: var(--brand); }
.btn-outline {
  background: #fff;
  color: var(--brand-deep);
  border-color: rgba(18, 32, 51, 0.18);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
}
.menu-toggle svg { width: 22px; height: 22px; flex-shrink: 0; }
.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(320px, 92vw);
  height: calc(100vh - var(--nav-h));
  background: #0f2138;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  padding: 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}
.mobile-panel.is-open { transform: translateX(0); }
.mobile-panel a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
}
.mobile-panel .mobile-auth {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 998;
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

main { padding-top: var(--nav-h); }

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--navy);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  max-width: 680px;
  animation: rise 0.8s ease both;
}
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.85rem;
}
.hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
  max-width: 36rem;
}
.hero-cta { 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 fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section { padding: 3.5rem 0; }
.section-head {
  margin-bottom: 1.75rem;
  max-width: 640px;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-dark {
  background: linear-gradient(180deg, #0d1b2e 0%, #122744 100%);
  color: #fff;
}
.section-dark h2,
.section-dark h3 { color: #fff; }
.section-dark p { color: rgba(255, 255, 255, 0.78); }
.section-soft { background: rgba(255, 255, 255, 0.55); }

.intro-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
.intro-copy p { font-size: 1.02rem; }
.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1220;
  box-shadow: var(--shadow);
  animation: fadeIn 1s ease both;
}
.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1220;
  min-height: 180px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}
.cat-card:hover { transform: translateY(-4px); }
.cat-card img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  background: #000;
}
.cat-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
}

.card-grid {
  display: grid;
  gap: 1.15rem;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11, 26, 46, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.article-card .thumb {
  background: #0b1220;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card .body { padding: 1.1rem 1.15rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.article-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}
.article-card h3 a { color: var(--navy); }
.article-card h3 a:hover { color: var(--brand); }
.article-card p { font-size: 0.94rem; flex: 1; }
.article-card .more {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.faq-list { display: grid; gap: 0.75rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.faq-item h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}
.faq-item p { margin-bottom: 0; }

.page-hero {
  padding: 2.75rem 0 1.5rem;
  background: linear-gradient(135deg, #0d1b2e, #163a66);
  color: #fff;
}
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.page-hero p { color: rgba(255, 255, 255, 0.82); max-width: 40rem; margin-bottom: 0; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}
.breadcrumb a { color: rgba(255, 255, 255, 0.85); }
.breadcrumb span { opacity: 0.5; }

.content-wrap { padding: 2.5rem 0 3.5rem; }
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 24px rgba(11, 26, 46, 0.05);
}
.prose h2 { margin-top: 1.75rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.35rem; font-size: 1.1rem; }
.prose p, .prose li { color: var(--muted); }
.prose img {
  border-radius: 12px;
  margin: 1.25rem 0;
  background: #0b1220;
}
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.related {
  margin-top: 2rem;
}
.related h2 { margin-bottom: 1rem; }

.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;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.error-page h1 { font-size: 1.6rem; }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

.site-footer {
  background: #0a1626;
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2rem;
}
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  padding: 0.25rem 0;
  font-size: 0.92rem;
}
.site-footer a:hover { color: #fff; }
.footer-brand img {
  height: 42px;
  width: auto;
  margin-bottom: 0.75rem;
}
.footer-brand p { color: rgba(255, 255, 255, 0.68); font-size: 0.92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.promo-strip {
  display: grid;
  gap: 1rem;
  align-items: center;
}
.promo-strip img {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}
.brand-row img {
  height: 36px;
  width: auto;
  opacity: 0.85;
  filter: brightness(1.05);
}

@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-grid { grid-template-columns: 1.15fr 0.85fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .prose { padding: 2rem 2.25rem; }
  .promo-strip { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .nav-actions { display: flex; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 979px) {
  .nav-desktop,
  .nav-actions { display: none !important; }
}
