/* KGame – kgweb.homes | vi-VN game portal */
:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --bg-3: #162238;
  --surface: rgba(22, 34, 56, 0.88);
  --line: rgba(120, 160, 220, 0.18);
  --text: #e8eef8;
  --muted: #9aadc8;
  --blue: #2f9bff;
  --blue-2: #1a6fd4;
  --gold: #c9a227;
  --white: #ffffff;
  --danger: #e85d5d;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --max: 1180px;
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Sora", "Be Vietnam Pro", sans-serif;
}

*,
*::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(47, 155, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 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(--blue);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7cc4ff;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; color: var(--muted); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(8, 14, 26, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: 44px;
  overflow: hidden;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  max-width: 180px;
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--blue);
  background: rgba(47, 155, 255, 0.1);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.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: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(47, 155, 255, 0.28);
}

.btn-primary:hover { color: var(--white); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(47, 155, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  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 {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(320px, 100%);
  height: calc(100vh - var(--header-h));
  background: #0c1424;
  border-left: 1px solid var(--line);
  padding: 1.25rem;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  overflow-y: auto;
}

.mobile-panel.open { transform: translateX(0); }

.mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.mobile-panel nav a {
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-weight: 500;
}

.mobile-panel nav a:hover,
.mobile-panel nav a.active {
  background: rgba(47, 155, 255, 0.12);
  color: var(--blue);
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.menu-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.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.55) 48%, rgba(8, 14, 26, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 14, 26, 0.95) 0%, transparent 45%);
}

.hero-content {
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: rise 0.7s ease both;
}

.hero-content .brand-mark {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.hero-content p {
  font-size: 1.05rem;
  color: #c5d3e8;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 720px;
}

.section-head p { margin-bottom: 0; }

.section-alt {
  background:
    linear-gradient(180deg, rgba(22, 34, 56, 0.35), rgba(22, 34, 56, 0.1));
  border-block: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .nav-desktop,
  .header-actions { display: flex; }
  .menu-toggle { display: none; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .about-split { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
}

/* Category tiles – interaction containers, not decorative cards */
.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(30, 48, 78, 0.65), rgba(16, 26, 44, 0.9));
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.cat-tile:hover {
  border-color: rgba(47, 155, 255, 0.45);
  transform: translateY(-4px);
  color: var(--white);
}

.cat-tile img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.85rem;
}

.cat-tile strong {
  font-family: var(--display);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.cat-tile span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Article / news items */
.article-list {
  display: grid;
  gap: 1.15rem;
}

@media (min-width: 768px) {
  .article-list.cols-2 { grid-template-columns: 1fr 1fr; }
  .article-list.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.article-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.95rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: rgba(17, 26, 46, 0.72);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
  color: inherit;
}

.article-item:hover {
  border-color: rgba(47, 155, 255, 0.35);
  background: rgba(24, 38, 64, 0.9);
  color: inherit;
}

.article-item.vertical {
  grid-template-columns: 1fr;
}

.article-item .thumb {
  border-radius: 10px;
  overflow: hidden;
  background: #0a101c;
  aspect-ratio: 3 / 4;
}

.article-item.vertical .thumb {
  aspect-ratio: 16 / 10;
}

.article-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-item .meta {
  font-size: 0.78rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.article-item h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--white);
}

.article-item p {
  font-size: 0.9rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* About / prose */
.prose {
  max-width: 760px;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 1.02rem;
}

.prose a { font-weight: 600; }

.prose ul {
  padding-left: 1.2rem;
  margin: 0 0 1.2rem;
}

.prose li { margin-bottom: 0.45rem; }

.about-split {
  display: grid;
  gap: 2rem;
}

.about-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-visual img {
  max-height: 420px;
  width: auto;
  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); }
}

.feature-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .feature-row { grid-template-columns: repeat(3, 1fr); }
}

.feature {
  padding: 1.35rem 1.2rem;
  border-top: 2px solid var(--blue);
  background: linear-gradient(180deg, rgba(47, 155, 255, 0.08), transparent);
}

.feature h3 {
  color: var(--white);
  margin-bottom: 0.45rem;
}

.feature p { margin: 0; font-size: 0.95rem; }

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 22, 38, 0.75);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--white);
  list-style: none;
  font-family: var(--display);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--blue);
  font-weight: 700;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  opacity: 0.85;
}

.brand-strip img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.1);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(47, 155, 255, 0.15), transparent 70%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { opacity: 0.5; }

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  max-height: 420px;
  background: #0a101c;
}

.article-cover img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}

.article-body h2 {
  margin-top: 1.75rem;
  color: var(--white);
}

.article-body h3 {
  margin-top: 1.35rem;
  color: #d7e4f7;
}

.sidebar-block {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  color: var(--white);
}

.side-link {
  display: block;
  padding: 0.55rem 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(120, 160, 220, 0.1);
  font-size: 0.92rem;
}

.side-link:hover { color: var(--blue); }

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1rem;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #7cc4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #070d18;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  max-width: 34ch;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  padding: 0.28rem 0;
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--blue); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  font-size: 0.82rem;
  color: #6f829e;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* Misc */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(47, 155, 255, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}

.cta-band {
  padding: 2.5rem 0;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(47, 155, 255, 0.12), rgba(201, 162, 39, 0.08));
  border-block: 1px solid var(--line);
}

.cta-band h2 { color: var(--white); }
.cta-band p { max-width: 36rem; margin: 0 auto 1.25rem; }

.promo-img {
  margin: 1.5rem auto 0;
  max-width: 520px;
}

.phone-visual img {
  max-height: 360px;
  margin-inline: auto;
}

.text-white { color: var(--white); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
