/* =========================================================
   두뇌 건강 게임 – 공통 스타일
   ========================================================= */

:root {
  --cream: #fbf5ec;
  --cream-2: #f5ecdf;
  --paper: #fffdf9;
  --ink: #322a24;
  --ink-2: #57493e;
  --muted: #85766a;
  --line: #eadfd1;
  --line-2: #f3e9dc;

  --terra: #c0603a;
  --terra-dark: #9e4b2b;
  --terra-soft: #f7e2d6;
  --sage: #6c8f6a;
  --sage-soft: #e5eee2;
  --butter: #f4e0ae;
  --butter-soft: #fbf1d8;
  --sky: #d9e7ef;
  --berry: #a44e63;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(74, 55, 40, .05), 0 14px 30px -18px rgba(74, 55, 40, .35);
  --shadow-soft: 0 1px 2px rgba(74, 55, 40, .05), 0 6px 18px -12px rgba(74, 55, 40, .3);

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

img { max-width: 100%; display: block; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: -.02em; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 245, 236, .94);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.03em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--terra);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  flex: 0 0 auto;
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--cream-2); text-decoration: none; }
.site-nav a.is-active {
  background: var(--terra);
  color: #fff;
}

/* ---------- Page parts ---------- */
.page-main { padding: 28px 0 8px; }

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 14px;
}
.crumb a { color: var(--muted); }
.crumb span { color: var(--line); }

.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-size: clamp(28px, 4.6vw, 38px);
  font-weight: 800;
  margin-bottom: 10px;
}
.page-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 18px;
}

.section { padding: 34px 0; }
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: clamp(23px, 3.4vw, 28px); font-weight: 800; }
.section-head p { margin: 8px 0 0; color: var(--muted); font-size: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
  transition: transform .06s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); color: #fff; }
.btn-soft { background: var(--terra-soft); color: var(--terra-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-sage { background: var(--sage); color: #fff; }
.btn-lg { min-height: 60px; font-size: 19px; padding: 14px 30px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Home hero ---------- */
.hero {
  padding: 26px 0 8px;
}
.hero-inner {
  display: grid;
  gap: 12px;
}
.hero h1 {
  font-size: clamp(31px, 5.4vw, 46px);
  font-weight: 800;
  letter-spacing: -.035em;
}
.hero p {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 20px);
  color: var(--ink-2);
  max-width: 640px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.hero-tags span {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 16px;
  color: var(--ink-2);
}

/* ---------- 오늘의 추천 ---------- */
.today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 26px;
  margin-top: 26px;
  border-radius: var(--radius);
  background: var(--butter-soft);
  border: 1px solid #f0e2bd;
}
.today-icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--paper);
  font-size: 30px;
}
.today-body { flex: 1 1 260px; min-width: 0; }
.today-label {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: #8a6a26;
  margin-bottom: 4px;
}
.today-body h2 { font-size: 24px; font-weight: 800; }
.today-body p { margin: 6px 0 0; color: var(--gain, #5d5147); font-size: 17px; }
.today .btn { flex: 0 0 auto; }

/* ---------- 게임 카드 ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.game-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.game-card-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  font-size: 27px;
  background: var(--cream-2);
}
.game-card h3 { font-size: 23px; font-weight: 800; }
.game-card p { margin: 0; color: var(--ink-2); font-size: 17px; }
.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.game-card-meta span {
  font-size: 15px;
  color: var(--muted);
  background: var(--cream);
  border-radius: 999px;
  padding: 4px 11px;
}
.game-card .go {
  margin-top: 6px;
  font-weight: 700;
  color: var(--terra-dark);
  font-size: 17px;
}
.game-card.c-chosung .game-card-icon { background: #f7e2d6; }
.game-card.c-word .game-card-icon { background: var(--sage-soft); }
.game-card.c-memory .game-card-icon { background: #fbf1d8; }
.game-card.c-mine .game-card-icon { background: var(--sky); }
.game-card.c-sudoku .game-card-icon { background: #f2e3e8; }

/* ---------- 효과 안내 ---------- */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  font-size: 17px;
}
.guide-table th, .guide-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.guide-table th {
  background: var(--cream-2);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
.guide-table tr:last-child td { border-bottom: 0; }
.guide-table td:first-child { font-weight: 700; white-space: nowrap; }

.tip-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.tip-list li {
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 17px;
}
.tip-list strong { color: var(--ink); }

/* ---------- 광고 ---------- */
.ad-slot {
  margin: 26px auto;
  text-align: center;
  overflow: hidden;
  min-height: 0;
}
.ad-slot ins { display: block; }

/* ---------- 다른 게임 이동 ---------- */
.other-games { padding: 12px 0 40px; }
.other-games h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 14px;
}
.other-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.other-grid a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
}
.other-grid a:hover { border-color: var(--terra); text-decoration: none; }
.other-grid a small { color: var(--muted); font-weight: 500; font-size: 15px; }
.other-grid .ico { font-size: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
  margin-top: 20px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.footer-title { font-weight: 800; font-size: 19px; margin: 0 0 4px; }
.footer-desc { margin: 0; color: var(--muted); font-size: 16px; }
.footer-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 18px;
}
.footer-nav a { color: var(--ink-2); font-size: 16px; }
.copyright { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .header-inner { gap: 12px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .site-nav a { padding: 10px 12px; font-size: 16px; }
  .game-grid { grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .container { padding: 0 16px; }
  .header-inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 6px;
    min-height: 0;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin: 0 -16px;
    padding: 2px 16px 8px;
  }
  .today { padding: 20px; }
  .today-primary { width: 100%; }
  .game-card { padding: 20px; }
  .guide-table { font-size: 16px; }
  .guide-table th, .guide-table td { padding: 12px 13px; }
  .guide-table td:first-child, .guide-table th { white-space: normal; }
  .footer-top { flex-direction: column; }
}
