/* KGame — kkgame.click | Portal styles */
:root {
  --bg-deep: #070b14;
  --bg-base: #0c1220;
  --bg-elevated: #121a2c;
  --bg-soft: #182338;
  --line: rgba(120, 160, 220, 0.16);
  --text: #e8eef8;
  --text-muted: #9aadc8;
  --text-dim: #6f829e;
  --brand: #3d8ef0;
  --brand-bright: #6eb3ff;
  --brand-deep: #1e5fbf;
  --gold: #d4a84b;
  --danger: #e85d5d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --header-h: 72px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
  --max: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 142, 240, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 168, 75, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 40%, #0a101c 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-bright);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #9fd0ff;
}

ul,
ol {
  padding-left: 1.2rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--text-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);
  display: flex;
  align-items: center;
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--header-h);
  overflow: hidden;
}

.logo-link img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0;
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
}

.nav-desktop a.active::after,
.nav-desktop a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright));
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 8px 22px rgba(61, 142, 240, 0.28);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 10px 28px rgba(61, 142, 240, 0.4);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(110, 179, 255, 0.45);
  color: var(--brand-bright);
}

.btn-outline {
  background: rgba(61, 142, 240, 0.08);
  border-color: rgba(61, 142, 240, 0.35);
  color: var(--brand-bright);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  margin-left: auto;
}

.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 .menu-label-close {
  display: none;
}

.menu-toggle.is-open .menu-label-open {
  display: none;
}

.menu-toggle.is-open .menu-label-close {
  display: inline;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(10, 15, 26, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem 1.4rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.mobile-panel.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 0.85rem;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(61, 142, 240, 0.12);
  color: var(--brand-bright);
}

.mobile-actions {
  display: grid;
  gap: 0.6rem;
}

main {
  padding-top: var(--header-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  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-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.35) 0%, rgba(7, 11, 20, 0.72) 45%, rgba(7, 11, 20, 0.96) 100%),
    linear-gradient(90deg, rgba(7, 11, 20, 0.75) 0%, rgba(7, 11, 20, 0.25) 55%, rgba(7, 11, 20, 0.55) 100%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 4.5rem;
  max-width: 640px;
  animation: rise-in 0.9s var(--ease) both;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 20%, var(--brand-bright) 70%, #9fd0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.6rem;
  display: block;
}

.hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.hero-lead {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sections */
.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 26, 44, 0.55), rgba(12, 18, 32, 0.2));
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.section-head p {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--brand-bright);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Intro / prose */
.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.intro-visual img {
  width: min(100%, 280px);
  filter: drop-shadow(0 20px 40px rgba(61, 142, 240, 0.25));
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.prose {
  max-width: 720px;
}

.prose h2,
.prose h3 {
  margin-top: 1.75rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ext-link {
  color: var(--brand-bright);
  font-weight: 600;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.4rem 1rem 1.25rem;
  background: linear-gradient(160deg, rgba(24, 35, 56, 0.9), rgba(12, 18, 32, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  color: inherit;
}

.cat-item:hover {
  transform: translateY(-6px);
  border-color: rgba(110, 179, 255, 0.4);
  box-shadow: var(--shadow);
  color: inherit;
}

.cat-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.9rem;
}

.cat-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.cat-item p {
  font-size: 0.88rem;
  margin: 0;
}

/* Article cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  color: inherit;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: rgba(110, 179, 255, 0.35);
  box-shadow: var(--shadow);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}

.tag {
  color: var(--brand-bright);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.read-more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-bright);
}

/* Guide list */
.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(18, 26, 44, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s var(--ease);
  color: inherit;
}

.guide-row:hover {
  border-color: rgba(110, 179, 255, 0.4);
  transform: translateX(4px);
  color: inherit;
}

.guide-row img {
  width: 100px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.guide-row h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.guide-row p {
  margin: 0;
  font-size: 0.88rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 26, 44, 0.7);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  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: "+";
  color: var(--brand-bright);
  font-size: 1.25rem;
  font-weight: 500;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Promo strip */
.promo-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(30, 95, 191, 0.25), rgba(18, 26, 44, 0.9));
  border: 1px solid rgba(61, 142, 240, 0.3);
}

.promo-strip img {
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
  border-radius: var(--radius-sm);
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(61, 142, 240, 0.1), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  list-style: none;
  padding: 0;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-dim);
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
  align-items: start;
}

.article-main {
  background: rgba(18, 26, 44, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 2rem;
}

.article-cover {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.article-cover img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
}

.article-main .meta {
  margin-bottom: 1rem;
}

.sidebar {
  display: grid;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.side-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.7rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.related-list a:hover {
  color: var(--brand-bright);
}

.related-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-soft);
}

/* Brand row */
.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0;
  opacity: 0.85;
}

.brand-row img {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.3) brightness(1.1);
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #060a12;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.9rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--brand-bright);
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  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;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Misc */
.list-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.note-box {
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--brand);
  background: rgba(61, 142, 240, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.7rem 0.85rem;
  text-align: left;
}

th {
  background: rgba(61, 142, 240, 0.12);
  color: var(--text);
}

td {
  color: var(--text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .intro-grid,
  .article-layout,
  .promo-strip,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cat-grid,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: static;
  }

  .guide-row {
    grid-template-columns: 80px 1fr;
  }

  .guide-row .btn {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-desktop,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .logo-link img {
    height: 34px;
    max-height: 34px;
  }

  .hero {
    min-height: 72vh;
  }

  .hero-content {
    margin-bottom: 3rem;
  }

  .list-page-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3.25rem 0;
  }

  .article-main {
    padding: 1.25rem 1rem 1.5rem;
  }
}
