/* KGame – web đánh bài online portal */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap');

:root {
  --bg: #eef2f7;
  --bg-soft: #f7f9fc;
  --ink: #0f1b2d;
  --ink-soft: #3d4f66;
  --muted: #6b7c91;
  --line: #d5dee9;
  --navy: #0c1a2e;
  --navy-2: #13233c;
  --accent: #1f7ae0;
  --accent-deep: #155fb0;
  --accent-soft: #e8f2fc;
  --gold: #c4922a;
  --white: #ffffff;
  --shadow: 0 12px 40px rgba(15, 27, 45, 0.08);
  --radius: 14px;
  --header-h: 72px;
  --max: 1120px;
  --font: 'Be Vietnam Pro', 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(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1rem; color: var(--ink-soft); }

.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(12, 26, 46, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.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: calc(var(--header-h) - 20px);
}

.brand img {
  height: 42px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.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.7rem 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;
  text-decoration: none;
  font-family: var(--font);
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.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(--navy);
  border-color: var(--line);
}

.btn-light:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-toggle svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(320px, 88vw);
  height: calc(100vh - var(--header-h));
  background: var(--navy-2);
  padding: 1.25rem;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);
}

.nav-mobile.open { transform: translateX(0); }

.nav-mobile a {
  color: rgba(255, 255, 255, 0.88);
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  font-weight: 500;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-mobile .mobile-auth {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--header-h);
  min-height: 70vh;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  background: var(--navy) center/cover no-repeat;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(8, 18, 34, 0.92) 18%, rgba(8, 18, 34, 0.55) 55%, rgba(8, 18, 34, 0.35) 100%),
    linear-gradient(to top, rgba(8, 18, 34, 0.85), transparent 45%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 3.2rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  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.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-soft);
}

.section-dark {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(31, 122, 224, 0.18), transparent 50%),
    var(--navy);
  color: #fff;
}

.section-dark h2,
.section-dark h3 { color: #fff; }

.section-dark p { color: rgba(255, 255, 255, 0.78); }

.section-head {
  margin-bottom: 1.75rem;
  max-width: 640px;
}

.section-head p { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.section-dark .eyebrow { color: #7cbcff; }

/* Intro / prose */
.prose {
  max-width: 720px;
}

.prose a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  color: inherit;
  display: block;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #b7d4f5;
  color: inherit;
}

.cat-item img {
  width: 100%;
  max-width: 140px;
  margin: 0 auto 0.85rem;
  aspect-ratio: 1;
  object-fit: contain;
}

.cat-item h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.cat-item p {
  font-size: 0.88rem;
  margin: 0;
  color: var(--muted);
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.15rem;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}

.article-card .thumb {
  background: var(--navy);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.article-card .more {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  padding-right: 2.5rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.25rem;
}

.faq-item[open] summary::after { content: '–'; }

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Page hero / breadcrumb */
.page-hero {
  background:
    linear-gradient(135deg, #0c1a2e 0%, #16345c 100%);
  color: #fff;
  padding: 2.4rem 0 2.2rem;
}

.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero p { color: rgba(255, 255, 255, 0.8); margin: 0; max-width: 620px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.breadcrumb a { color: rgba(255, 255, 255, 0.85); }
.breadcrumb span { opacity: 0.5; }

.content-wrap {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

.article-body {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
}

.article-body h2 { margin-top: 1.75rem; }
.article-body h3 { margin-top: 1.35rem; }
.article-body ul, .article-body ol {
  padding-left: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.article-body li { margin-bottom: 0.4rem; }

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--navy);
}

.article-cover img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  margin: 0 auto;
}

.related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.side-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.side-box h3 { margin-bottom: 0.85rem; }

.side-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-links li {
  border-bottom: 1px solid var(--line);
}

.side-links li:last-child { border-bottom: 0; }

.side-links a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}

.side-links a:hover { color: var(--accent); }

/* Brand strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  opacity: 0.75;
  filter: grayscale(0.2);
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  padding: 0.3rem 0;
  font-size: 0.92rem;
}

.site-footer a:hover { color: #fff; }

.footer-brand img {
  height: 40px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
  background:
    radial-gradient(circle at 50% 20%, rgba(31, 122, 224, 0.12), transparent 45%),
    var(--bg);
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Utils */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-center { text-align: center; }

@media (min-width: 768px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .header-actions { display: flex; }
  .nav-mobile, .nav-overlay { display: none !important; }

  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .content-wrap.with-side {
    grid-template-columns: 1fr 280px;
  }

  .article-body {
    padding: 2rem 2.25rem;
  }
}

@media (min-width: 1024px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
