/* KGame – kgame-l.xyz | Game info portal */
:root {
  --bg: #eef3f7;
  --bg-alt: #e2ebf2;
  --surface: #ffffff;
  --ink: #122033;
  --ink-soft: #3d4f63;
  --muted: #6b7c8f;
  --line: #c9d6e3;
  --brand: #0a6e6b;
  --brand-deep: #084e4c;
  --accent: #c45a1a;
  --accent-hover: #a34812;
  --navy: #0d2137;
  --navy-mid: #16324f;
  --ok: #1a7a4c;
  --shadow: 0 10px 28px rgba(13, 33, 55, 0.08);
  --radius: 12px;
  --header-h: 72px;
  --max: 1120px;
  --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(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(10, 110, 107, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 90, 26, 0.08), transparent 50%),
    linear-gradient(180deg, #f4f8fb 0%, var(--bg) 40%, #e8f0f5 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.65rem, 3.2vw, 2.35rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(13, 33, 55, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  max-height: calc(var(--header-h) - 20px);
}

.logo-link img {
  height: 40px;
  width: auto;
  max-width: 160px;
  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.88);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
}

.btn-outline:hover {
  background: var(--brand);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
  z-index: 999;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.nav-mobile.open { display: block; }

.nav-mobile a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.nav-mobile-actions .btn { width: 100%; }

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: flex; }
  .header-actions { display: flex; }
  .nav-mobile { display: none !important; }
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(72vh, 560px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--navy);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 28, 48, 0.92) 0%, rgba(8, 28, 48, 0.7) 45%, rgba(8, 28, 48, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 28, 48, 0.85) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: riseIn 0.7s ease-out both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  margin-bottom: 1.4rem;
  max-width: 34em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@keyframes riseIn {
  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(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* —— Sections —— */
.section {
  padding: 3.25rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.section-head p {
  margin-bottom: 0;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.4rem;
}

/* —— Brand intro —— */
.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 800px) {
  .intro-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  min-height: 280px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.intro-visual.phone-wrap {
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
}

.intro-visual.phone-wrap img {
  width: min(200px, 55%);
  min-height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(13, 33, 55, 0.25));
  animation: floatY 4.5s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* —— Category grid —— */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  padding: 1rem 0.75rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.cat-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  color: var(--ink);
}

.cat-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.cat-item span {
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.cat-item small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* —— Cards / articles —— */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
  height: 100%;
}

.article-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  flex: 1;
}

/* Guide list —— */
.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-row:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  color: inherit;
}

.guide-row img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.guide-row h3 {
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
}

.guide-row p {
  margin: 0;
  font-size: 0.9rem;
}

@media (min-width: 700px) {
  .guide-row {
    grid-template-columns: 120px 1fr auto;
  }
  .guide-row .arrow {
    color: var(--brand);
    font-weight: 700;
    padding-right: 0.5rem;
  }
}

/* Brands strip —— */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
  transition: opacity 0.2s, filter 0.2s;
}

.brand-strip img:hover {
  opacity: 1;
  filter: none;
}

/* FAQ —— */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--navy);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--brand);
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Breadcrumb —— */
.breadcrumb {
  padding: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--line);
}

.breadcrumb a {
  color: var(--brand-deep);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb [aria-current="page"] {
  color: var(--ink-soft);
}

/* Page hero (inner) —— */
.page-hero {
  padding: 2rem 0 1.5rem;
}

.page-hero h1 { margin-bottom: 0.5rem; }

.page-hero .lead {
  max-width: 40rem;
  font-size: 1.05rem;
  margin: 0;
}

/* Content prose —— */
.prose {
  max-width: 720px;
}

.prose h2 { margin-top: 1.8rem; }
.prose h3 { margin-top: 1.4rem; }

.prose ul, .prose ol {
  color: var(--ink-soft);
  padding-left: 1.25rem;
  margin: 0 0 1.2em;
}

.prose li { margin-bottom: 0.4em; }

.prose a.ext-link {
  font-weight: 600;
}

.content-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 3rem;
}

@media (min-width: 960px) {
  .content-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-box li {
  margin-bottom: 0.65rem;
}

.sidebar-box a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.sidebar-box a:hover { color: var(--brand); }

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0 1.5rem;
  background: var(--bg-alt);
  max-height: 360px;
}

.article-cover img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.related-grid {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* Category showcase page —— */
.cat-detail-grid {
  display: grid;
  gap: 1.5rem;
}

.cat-detail {
  display: grid;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  align-items: center;
}

@media (min-width: 700px) {
  .cat-detail {
    grid-template-columns: 140px 1fr;
  }
}

.cat-detail img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-inline: auto;
}

.cat-detail h2 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.cat-detail p { margin-bottom: 0.75rem; }

/* Error pages —— */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page h1 {
  margin-bottom: 0.75rem;
}

.error-page p {
  max-width: 28rem;
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

/* Promo banner —— */
.promo-banner {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.promo-banner img {
  max-width: min(100%, 594px);
  height: auto;
}

/* Footer —— */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.site-footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
  object-fit: contain;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Utilities —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }

.mt-2 { margin-top: 2rem; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(10, 110, 107, 0.12);
  color: var(--brand-deep);
  margin-bottom: 0.5rem;
}

/* List page filters visual —— */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.list-toolbar a {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.list-toolbar a:hover,
.list-toolbar a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
