/* KikiZip 공통 스타일 — 홈, 카테고리, 게임 소개 페이지 공용 */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --card: #ffffff;
  --fg: #1a1d24;
  --muted: #5b6472;
  --border: #e3e7ef;
  --accent: #3b6fe0;
  --accent-ink: #ffffff;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.08), 0 8px 24px rgba(20, 30, 60, 0.06);
  --radius: 14px;
  --maxw: 1040px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1115;
    --bg-soft: #151922;
    --card: #1a1d24;
    --fg: #f2f4f8;
    --muted: #9aa3b2;
    --border: #272b34;
    --accent: #6ea8fe;
    --accent-ink: #0f1115;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme='dark'] {
  --bg: #0f1115;
  --bg-soft: #151922;
  --card: #1a1d24;
  --fg: #f2f4f8;
  --muted: #9aa3b2;
  --border: #272b34;
  --accent: #6ea8fe;
  --accent-ink: #0f1115;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.nav-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; }
.nav-cats a {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 5px 10px;
  border-radius: 999px;
}
.nav-cats a:hover { background: var(--bg-soft); text-decoration: none; color: var(--fg); }
.search { margin-left: auto; }
.search input {
  width: 190px;
  max-width: 44vw;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg);
  font-size: 0.9rem;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 레이아웃 ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 64px; }
.hero { text-align: center; padding: 56px 0 36px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.hero .tagline { color: var(--accent); font-weight: 700; margin: 0 0 8px; letter-spacing: 0.02em; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 36rem; }

.section { margin-top: 40px; }
.section > h2 { font-size: 1.3rem; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.section > h2 .count { color: var(--muted); font-weight: 500; font-size: 0.9rem; }

/* ---------- 카드 그리드 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--fg);
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); text-decoration: none; }
.card .thumb { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; background: var(--bg-soft); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-size: 1.15rem; font-weight: 700; }
.card .desc { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}
.tag.ai { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.secondary { background: var(--bg-soft); color: var(--fg); border: 1px solid var(--border); }

/* ---------- 게임 소개(SEO) 페이지 ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding: 20px 0 0; }
.breadcrumb a { color: var(--muted); }
.game-head { padding: 12px 0 8px; }
.game-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 6px 0 8px; }
.game-head .lede { color: var(--muted); font-size: 1.05rem; margin: 0; }
.game-head .meta { margin-top: 14px; }

.play-embed {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.play-embed .frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 11; }
.play-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.play-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); }
.play-actions .hint { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

article.content { max-width: 760px; }
article.content h2 { font-size: 1.35rem; margin: 34px 0 10px; }
article.content h3 { font-size: 1.08rem; margin: 20px 0 6px; }
article.content p { margin: 8px 0; }
article.content ul { margin: 8px 0; padding-left: 20px; }
article.content li { margin: 4px 0; }
article.content table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 0.92rem; }
article.content th, article.content td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
article.content th { background: var(--bg-soft); }

details.faq {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  margin: 8px 0;
  background: var(--card);
}
details.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: '＋ '; color: var(--accent); }
details.faq[open] summary::before { content: '－ '; }
details.faq .answer { padding: 0 0 12px; color: var(--muted); }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 16px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer a { color: var(--muted); }
.site-footer .links { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer .copy { margin-left: auto; }

@media (max-width: 560px) {
  .nav-cats { order: 3; width: 100%; }
  .search { margin-left: 0; order: 2; }
  .search input { width: 100%; max-width: none; }
  .site-footer .copy { margin-left: 0; width: 100%; }
}
