/* KGame – k-gamee.xyz */
:root {
  --bg: #eef3f5;
  --bg-deep: #0b1f2a;
  --surface: #ffffff;
  --ink: #102029;
  --muted: #5b6d78;
  --line: #d5e0e6;
  --accent: #0b8f7f;
  --accent-dark: #067266;
  --accent-soft: #d8f3ef;
  --warm: #f06a2c;
  --warm-dark: #d4551a;
  --nav-h: 68px;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(16, 32, 41, 0.08);
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  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%, #d7f1ec 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #ffe8d8 0%, transparent 50%),
    linear-gradient(180deg, #f7fafb 0%, var(--bg) 40%, #e9f0f3 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  color: var(--warm);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(213, 224, 230, 0.9);
  box-shadow: 0 4px 20px rgba(16, 32, 41, 0.04);
}

.nav-bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 1;
  min-width: 0;
  max-width: calc(100% - 7.5rem);
  height: 100%;
  overflow: hidden;
}

.brand img {
  height: 36px;
  width: auto;
  max-height: calc(var(--nav-h) - 24px);
  max-width: min(140px, 38vw);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.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: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 143, 127, 0.28);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #0ea392 0%, var(--accent) 100%);
}

.btn-outline {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-outline:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.btn-warm {
  background: linear-gradient(135deg, var(--warm) 0%, var(--warm-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(240, 106, 44, 0.28);
}

.btn-warm:hover {
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  background: var(--bg-deep);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font-body);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  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;
}

.menu-toggle .label-close {
  display: none;
}

.menu-toggle.is-open .label-open {
  display: none;
}

.menu-toggle.is-open .label-close {
  display: inline;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 0 1.25rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-panel a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.mobile-panel .mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
  border: none;
  padding: 0;
}

.mobile-panel .mobile-auth a {
  border: none;
  text-align: center;
  padding: 0.7rem;
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop,
  .nav-actions {
    display: flex;
  }

  .brand {
    max-width: none;
    flex-shrink: 0;
  }

  .brand-name {
    display: inline;
  }
}

/* ===== Hero ===== */
.page-main {
  padding-top: var(--nav-h);
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-deep);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 24, 32, 0.88) 0%, rgba(8, 24, 32, 0.55) 48%, rgba(8, 24, 32, 0.25) 100%),
    linear-gradient(0deg, rgba(8, 24, 32, 0.85) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 3rem;
  color: #fff;
  max-width: 640px;
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  margin-bottom: 0.75rem;
  color: #fff;
}

.hero-content p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ===== Sections ===== */
.section {
  padding: 4rem 0;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
}

.intro-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .intro-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-deep);
  animation: fadeUp 0.9s ease 0.1s both;
}

.intro-visual img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
}

.prose a.ext-link {
  color: var(--accent-dark);
  font-weight: 600;
  border-bottom: 1px dashed var(--accent);
}

/* ===== Category grid ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}

.cat-card .thumb {
  aspect-ratio: 1 / 1;
  background: #102029;
  overflow: hidden;
}

.cat-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cat-card:hover .thumb img {
  transform: scale(1.05);
}

.cat-card .body {
  padding: 0.9rem 1rem 1.1rem;
}

.cat-card h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.cat-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ===== Article cards ===== */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-card {
  background: var(--surface);
  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;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.article-card .cover {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #123;
}

.article-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .cover img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
  width: fit-content;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  color: var(--ink);
}

.article-card h3 a:hover {
  color: var(--accent-dark);
}

.article-card p {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.article-card .meta {
  font-size: 0.8rem;
  color: #7a8b95;
  margin-top: 0.75rem;
}

/* ===== FAQ ===== */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .answer {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}

.faq-item .answer p:last-child {
  margin-bottom: 0;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 3.5rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
}

.site-footer a:hover {
  color: #7fe0d2;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-brand img {
  height: 34px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* ===== Inner pages ===== */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin-bottom: 0.4rem;
}

.page-hero .lead {
  color: var(--muted);
  max-width: 640px;
  margin: 0;
}

.content-wrap {
  padding: 2.5rem 0 3.5rem;
}

.prose {
  max-width: 720px;
}

.prose h2 {
  margin-top: 1.8rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.4rem;
  font-size: 1.1rem;
}

.article-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #123;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.side-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  color: var(--ink);
  align-items: center;
}

.side-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.side-list span {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

/* ===== Error pages ===== */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 3rem 0;
}

.error-box {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.error-box .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 6.5rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-box h1 {
  font-size: 1.6rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ===== Brands strip ===== */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  opacity: 0.85;
}

.brand-strip img {
  height: 28px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  filter: grayscale(0.3);
}

/* ===== Misc ===== */
.list-rows {
  display: grid;
  gap: 1rem;
}

.list-row {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}

@media (min-width: 700px) {
  .list-row {
    grid-template-columns: 200px 1fr;
    align-items: stretch;
  }
}

.list-row .thumb {
  min-height: 140px;
  background: #123;
}

.list-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 140px;
}

.list-row .body {
  padding: 1.1rem 1.2rem;
}

.list-row h2 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.list-row h2 a {
  color: var(--ink);
}

.list-row p {
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}

.guide-grid .article-card .cover {
  aspect-ratio: 3 / 4;
}

.pill-note {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
