/* ─────────────────────────────────────────────
   style.css : 화면 꾸미기
   색은 맨 위 '색 변수'만 바꾸면 전체가 같이 바뀌어요.
   ───────────────────────────────────────────── */

/* ── 색 변수 : 한지 (기본, 낮의 한옥과 한지) ── */
:root,
[data-theme="hanji"] {
  --bg: #F4EFE6;          /* 전체 배경 : 한지 */
  --card: #FAF8F5;        /* 카드 배경 : 바랜 백색 */
  --ink: #2B2B28;         /* 기본 글자 : 먹색 */
  --ink-soft: #6E6A63;    /* 보조 글자 : 옅은 먹색 */
  --line: #D8D0C5;        /* 선 : 창호지 살 */
  --line-strong: #BFB4A5;
  --heal: #5C7A67;        /* 포인트1 : 쑥색 */
  --weird: #A84232;       /* 포인트2 : 인주색 */
  --heal-wash: rgba(92, 122, 103, .10);
  --weird-wash: rgba(168, 66, 50, .08);
  --warn-wash: rgba(196, 150, 40, .16);
  --shadow: 0 1px 0 rgba(43, 43, 40, .04);
  color-scheme: light;
}

/* ── 녹묵 (세이지 녹색 + 청록 강조) ──
   메인 #96B191 · 강조 #006D73 · 보조 #B2C4A9 (제작자 지정) */
[data-theme="nokmuk"] {
  --bg: #96B191;          /* 메인 : 세이지 녹색 */
  --card: #E6EDDF;        /* 글 읽는 종이 : 아주 옅은 녹색 한지 */
  --ink: #1C2A23;
  --ink-soft: #2F443A;
  --line: #A9BDA0;
  --line-strong: #7F9878;
  --heal: #3D6646;        /* 긍정 : 짙은 솔잎 */
  --weird: #006D73;       /* 강조 : 청록 (붉은색 대신) */
  --heal-wash: rgba(61, 102, 70, .12);
  --weird-wash: rgba(0, 109, 115, .10);
  --warn-wash: rgba(200, 160, 40, .20);
  color-scheme: light;
}

/* ── 먹 (여름밤의 마당과 그림자) ── */
[data-theme="meok"] {
  --bg: #181A1B;
  --card: #222526;
  --ink: #E2DDD5;
  --ink-soft: #9C978E;
  --line: #3A3E3F;
  --line-strong: #4F5455;
  --heal: #68A691;        /* 도깨비불 청록 */
  --weird: #D96B43;       /* 등롱 주홍 */
  --heal-wash: rgba(104, 166, 145, .12);
  --weird-wash: rgba(217, 107, 67, .10);
  --warn-wash: rgba(220, 170, 60, .14);
  --shadow: none;
  color-scheme: dark;
}

/* ── 글꼴 ── */
:root {
  --font-literary: 'Gowun Batang', 'Noto Serif KR', 'Batang', '바탕', serif;
  --font-ui: 'Pretendard', -apple-system, 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  --radius: 3px;
}

/* ── 기본 ── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  transition: background .4s, color .4s;
}
button, input, textarea, select { font: inherit; color: inherit; }
code {
  font-size: .9em;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
}
[hidden] { display: none !important; }

.literary { font-family: var(--font-literary); letter-spacing: -.01em; }
.muted { color: var(--ink-soft); margin: 0; font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* ── 머리 ── */
.site-head {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--font-literary);
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .04em;
}
.site-title::before, .site-title::after { color: var(--weird); font-weight: 400; }
.site-title::before { content: '『'; margin-right: 2px; }
.site-title::after { content: '』'; margin-left: 2px; }
.site-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; letter-spacing: .12em; }
.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.clock { margin: 0; color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }

.theme-switch { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.theme-switch button {
  border: 0;
  background: transparent;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
}
.theme-switch button + button { border-left: 1px solid var(--line-strong); }
.theme-switch button.on { background: var(--ink); color: var(--bg); }

/* ── 탭 (문살 느낌의 가로줄) ── */
.tabs {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 10px 16px 9px;
  cursor: pointer;
  color: var(--ink-soft);
  white-space: nowrap;
  font-size: 15px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--weird); font-weight: 600; }

.notice {
  max-width: 1128px;
  margin: 14px auto 0;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-soft);
}
@media (max-width: 1160px) { .notice { margin-left: 16px; margin-right: 16px; } }

main { max-width: 1160px; margin: 0 auto; padding: 20px 16px 60px; }

/* ── 패널 (창호지 한 칸) ── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.panel-title {
  font-family: var(--font-literary);
  font-size: 19px;
  margin: 0 0 10px;
  font-weight: 700;
}
.panel-title small {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 6px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--heal); background: var(--heal-wash); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--heal); border-color: var(--heal); color: var(--card); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost-danger { color: var(--weird); border-color: transparent; background: transparent; }
.btn.ghost-danger:hover { border-color: var(--weird); background: var(--weird-wash); }
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ink-soft); font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.spacer { flex: 1; }

/* ── 마당 ── */
.yard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.yard-main, .yard-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.creature-list { display: flex; flex-direction: column; gap: 16px; }

.scenery { border-top: 3px double var(--line-strong); }
.scenery p { margin: 0; font-size: 16px; line-height: 1.9; }

.intro { text-align: center; padding: 36px 20px; }
.intro p { font-size: 17px; line-height: 2; margin: 0 0 20px; }

/* 영물 카드 */
.creature { padding: 0; }
.creature-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.seal {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--weird);
  color: var(--weird);
  font-family: var(--font-literary);
  font-weight: 700;
  font-size: 17px;
  border-radius: 2px;
  transform: rotate(-3deg);
}
.creature-title { flex: 1; min-width: 0; }
.creature-name { margin: 0; font-family: var(--font-literary); font-size: 19px; line-height: 1.3; }
.creature-tags { margin: 0; color: var(--ink-soft); font-size: 12px; letter-spacing: .04em; }
.bond { text-align: right; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.bond-dots { display: block; color: var(--heal); letter-spacing: 2px; font-size: 13px; }

.creature-desc { padding: 16px 20px 6px; }
.line { display: block; margin: 0 0 6px; font-size: 16px; line-height: 1.85; }
.line.inner { color: var(--ink-soft); transition: color .6s; }
/* 밤에는 틈새(본모습) 문장이 또렷해짐 */
body[data-night="true"] .line.inner { color: var(--weird); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px 4px; }
.reaction {
  min-height: 1.9em;
  margin: 8px 20px 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
  color: var(--heal);
  font-size: 15px;
  line-height: 1.8;
}
.reaction:empty { border-top-color: transparent; }
.typing::after { content: '▍'; color: var(--ink-soft); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.creature-foot { padding: 6px 20px 14px; display: flex; justify-content: flex-end; }

.slot-empty {
  border: 1px dashed var(--line-strong);
  background: transparent;
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: var(--ink-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.slot-empty:hover { border-color: var(--heal); color: var(--heal); background: var(--heal-wash); }
.slot-hint { font-size: 14px; }
.slot-note { color: var(--ink-soft); font-size: 13px; text-align: center; margin: 0; }

/* 보따리 */
.coins {
  display: flex; justify-content: space-between;
  margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.bundle-group h4 { margin: 10px 0 4px; font-size: 12px; color: var(--ink-soft); font-weight: 500; letter-spacing: .1em; }
.bundle-group ul { list-style: none; margin: 0; padding: 0; }
.bundle-group li { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; cursor: default; }

/* 일지 */
.log-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.log-list li {
  display: grid; grid-template-columns: 42px 1fr; gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.65;
  font-family: var(--font-literary);
}
.log-list li:last-child { border-bottom: 0; }
.log-list time { color: var(--ink-soft); font-family: var(--font-ui); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.log-gain span { color: var(--heal); }
.log-bond span { color: var(--weird); }
.log-system span { color: var(--ink-soft); }

/* ── 기척 살피기 창 ── */
.dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}
.dialog::backdrop { background: rgba(20, 20, 18, .45); }
.dialog-body { padding: 22px 22px 18px; }
.dialog-title { font-family: var(--font-literary); margin: 0 0 4px; font-size: 21px; }
.cand-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.cand {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
  cursor: pointer;
  position: relative;
}
.cand:hover { border-color: var(--line-strong); }
.cand.on { border-color: var(--heal); background: var(--heal-wash); }
.cand input { position: absolute; opacity: 0; pointer-events: none; }
.cand-tags { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; letter-spacing: .04em; }
.cand .line { font-size: 15px; margin-bottom: 4px; }
.name-field { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.name-field input {
  flex: 1; max-width: 240px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg); padding: 6px 10px;
  font-family: var(--font-literary); font-size: 16px;
}
.dialog-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ── 편집기 ── */
.editor { display: flex; flex-direction: column; gap: 12px; }
.file-tabs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.file-tab {
  flex: 1 1 120px;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  padding: 8px 10px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  color: var(--ink-soft);
  position: relative;
}
.file-tab:last-child { border-right: 0; }
.file-tab span { font-size: 14px; }
.file-tab small { font-size: 11px; opacity: .8; }
.file-tab.on { color: var(--ink); background: var(--heal-wash); box-shadow: inset 0 -2px 0 var(--heal); }
.file-tab.drafted::after { content: '✎'; position: absolute; top: 4px; right: 8px; font-size: 11px; color: var(--weird); }

.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.badge.ok { border-color: var(--heal); color: var(--heal); }
.badge.warn { border-color: var(--weird); color: var(--weird); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 8px; }
.filter {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 5px 10px;
  width: 160px;
  font-size: 14px;
}
.status { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.t-bad { color: var(--weird); font-weight: 600; }
.t-warn { color: #B08A1E; font-weight: 600; }
[data-theme="meok"] .t-warn { color: #D8B45A; }

.preview {
  border-left: 3px solid var(--heal);
  background: var(--heal-wash);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.preview p { margin: 0 0 4px; }

.grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  max-height: 68vh;
  overflow-y: auto;
}
.grid { width: 100%; min-width: 680px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.grid th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
}
.th-sort {
  all: unset;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  width: 100%; cursor: pointer;
}
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 1px solid var(--heal); outline-offset: 2px; }
.sort-mark { font-size: 10px; opacity: .45; }
.grid th.sorted { color: var(--heal); }
.grid th.sorted .sort-mark { opacity: 1; }
.sort-scope { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.sort-scope select {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg); padding: 4px 6px; font-size: 13px;
}
.grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; vertical-align: top; }
.grid td:last-child, .grid th:last-child { border-right: 0; }
.grid .ln { text-align: center; color: var(--ink-soft); font-size: 12px; padding-top: 8px; font-variant-numeric: tabular-nums; }
.grid .cell {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px 8px;
  line-height: 1.55;
  resize: none;
  overflow: hidden;
  outline: none;
}
.grid textarea.cell { font-family: var(--font-literary); font-size: 14.5px; }
.grid .cell:focus { background: var(--heal-wash); box-shadow: inset 0 0 0 1px var(--heal); }
.grid tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--weird); }
.grid tr.bad { background: var(--weird-wash); }
.grid tr.warn td:first-child { box-shadow: inset 3px 0 0 #C9A13A; }
.grid tr.warn { background: var(--warn-wash); }
.grid tr.comment-row .cell { color: var(--ink-soft); font-size: 13px; }
.grid tr.comment-row { background: var(--bg); }
.ops { white-space: nowrap; text-align: center; padding-top: 4px !important; }
.op {
  border: 1px solid transparent; background: none; cursor: pointer;
  width: 24px; height: 24px; line-height: 1; border-radius: 2px;
  color: var(--ink-soft); font-size: 14px;
}
.op:hover { border-color: var(--line-strong); color: var(--ink); }
.op[data-del]:hover { color: var(--weird); border-color: var(--weird); }

.help { margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); }
.help summary { cursor: pointer; color: var(--ink); }
.help ul { margin: 8px 0 0; padding-left: 20px; }
.help li { margin-bottom: 4px; }

/* ── 뒷산 마실 ── */
.stroll-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin: 0 auto; }
.sub-title { font-size: 13px; color: var(--ink-soft); font-weight: 500; letter-spacing: .1em; margin: 20px 0 8px; }
.pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-width: 120px;
  text-align: left;
}
.pick b { font-family: var(--font-literary); font-size: 16px; }
.pick small { color: var(--ink-soft); font-size: 12px; }
.pick:hover { border-color: var(--heal); }
.pick.on { border-color: var(--heal); background: var(--heal-wash); box-shadow: inset 0 0 0 1px var(--heal); }
.pick.duration { min-width: 96px; align-items: center; text-align: center; }
.pick.duration b { font-family: var(--font-ui); font-size: 20px; font-weight: 600; }
.pick.test { border-style: dashed; opacity: .8; }
.stroll-start { margin-top: 22px; }
.btn.big { padding: 9px 22px; font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.check input { accent-color: var(--heal); }

.stroll-result {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--heal);
  background: var(--heal-wash);
}
.stroll-result p { margin: 0 0 2px; }

.run-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.timer {
  font-size: 46px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: .02em;
  color: var(--ink);
}
.stroll-run.done .timer { color: var(--heal); }
.bar { height: 2px; background: var(--line); margin: 14px 0 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--heal); transition: width 1s linear; }
.stroll-run .diary, .stroll-history .diary { list-style: none; padding: 0; margin: 12px 0 0; }
.stroll-run .diary li, .stroll-history .diary li {
  display: grid; grid-template-columns: 46px 1fr; gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  margin: 0;
  font-size: 15.5px;
  line-height: 1.85;
}
.diary time { font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); padding-top: 4px; }
.diary-depart, .diary-return { color: var(--ink-soft); }
.diary-return span { color: var(--heal); }
.diary .gain { font-style: normal; color: var(--heal); font-family: var(--font-ui); font-size: 13px; }
.waiting { margin-top: 10px; font-family: var(--font-literary); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

.stroll-history details { border-top: 1px solid var(--line); padding: 8px 0; }
.stroll-history summary { cursor: pointer; font-size: 14px; }
.stroll-history summary .num { color: var(--ink-soft); font-size: 12.5px; margin-right: 6px; }
.stroll-history .diary li { font-size: 14.5px; }

/* 마당 카드 : 마실 나간 영물 */
.creature.is-away .creature-desc { opacity: .5; }
.away {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 20px 4px;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
}
.away .num { flex: 1; font-size: 13.5px; }
.log-stroll span { color: var(--ink-soft); }
@media (max-width: 560px) {
  .away, .mood, .mood-hit, .new-badge, .taste-note, .clue-line { margin-left: 14px; margin-right: 14px; }
  .kitchen .taste-note, .cook-result .mood-hit, .cook-result .clue-line, .cook-result .new-badge { margin-left: 0; margin-right: 0; }
  .taste-note { flex-direction: column; gap: 4px; }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .snack-grid { grid-template-columns: 1fr 1fr; }
  .mix-bars { grid-template-columns: 1fr; }
  .dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dialog-body { padding: 16px 14px 14px; }
  .t-long { display: none; }
  .dex-pct { font-size: 34px; }
  .dex-cats { grid-template-columns: 1fr 1fr; }
  .dex-list { padding-left: 4px; }
  .dex-list li.unseen { flex-direction: column; gap: 0; }
  .dex-list li.unseen small { text-align: left; }
  .durations { grid-template-columns: repeat(3, 1fr); }
  .timer { font-size: 38px; }
  .pick { flex: 1 1 calc(50% - 8px); min-width: 0; }
}

/* ── 기분 읽기 · 반응 ── */
.mood {
  display: flex; gap: 10px; align-items: baseline;
  margin: 4px 20px 0;
  padding: 8px 12px;
  background: var(--heal-wash);
  border-left: 2px solid var(--heal);
  font-size: 14.5px; line-height: 1.7;
}
.mood-label {
  flex: none;
  font-size: 11px; letter-spacing: .1em;
  color: var(--heal); font-weight: 600;
}
.reaction-box { position: relative; }
.mood-hit { margin: 4px 20px 0; color: var(--weird); font-size: 14.5px; line-height: 1.7; }
.new-badge {
  display: inline-block;
  margin: 6px 20px 0;
  padding: 1px 8px;
  border: 1px solid var(--weird);
  border-radius: 2px;
  color: var(--weird);
  font-size: 11.5px;
  animation: pop .5s ease-out;
}
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
.log-mood span { color: var(--weird); }
.tab-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px;
  border-radius: 9px; background: var(--weird); color: var(--card);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}

/* ── 취향 수첩 · 맛 단서 ── */
.taste-note { display: flex; gap: 10px; align-items: baseline; margin: 6px 20px 0; font-size: 13px; }
.taste-note .chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.taste-chip {
  padding: 0 6px; border: 1px solid var(--line); border-radius: 2px;
  font-size: 12px; line-height: 20px; white-space: nowrap; color: var(--ink-soft);
}
.taste-chip.unknown { border-style: dashed; color: var(--line-strong); }
.taste-chip.p2 { border-color: var(--weird); color: var(--weird); font-weight: 600; }
.taste-chip.p1 { border-color: var(--heal); color: var(--heal); }
.taste-chip.pm2 { background: var(--bg); color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--weird); }
.clue-line { margin: 4px 20px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.clue-line::before { content: '✎ '; color: var(--heal); }
.btn small { font-size: 11px; opacity: .8; }
.kitchen-btn { border-style: dashed; }
.log-taste span, .log-kitchen span { color: var(--heal); }

/* ── 할머니 부엌 창 ── */
.kitchen .dialog-title small { font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); font-weight: 400; margin-left: 6px; }
.kitchen .taste-note { margin: 12px 0; padding: 8px 10px; background: var(--bg); border-radius: var(--radius); }
.snack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.snack {
  display: grid; grid-template-columns: 1fr auto; gap: 0 6px; align-items: baseline;
  padding: 8px 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card);
  min-height: 52px;
}
.snack:hover:not(:disabled) { border-color: var(--heal); background: var(--heal-wash); }
.snack:disabled { opacity: .4; cursor: default; }
.snack-name { font-family: var(--font-literary); font-weight: 700; font-size: 15px; }
.snack-count { font-size: 12px; color: var(--ink-soft); }
.snack-taste { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); }
.empty-note { padding: 14px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 14px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.slot {
  min-height: 58px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 14px;
}
.slot.empty { border: 1px dashed var(--line-strong); color: var(--line-strong); font-size: 18px; }
.slot.filled { border: 1px solid var(--heal); background: var(--heal-wash); cursor: pointer; font-family: var(--font-literary); font-weight: 700; padding: 6px; text-align: center; }
.slot.filled small { font-family: var(--font-ui); font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.mix-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 4px; }
.mix-row { display: grid; grid-template-columns: 58px 1fr 18px; align-items: center; gap: 6px; font-size: 12.5px; }
.mix-label { color: var(--ink-soft); }
.mix-bar { height: 6px; background: var(--line); border-radius: 1px; overflow: hidden; }
.mix-bar span { display: block; height: 100%; background: var(--heal); transition: width .25s; }
.mix-num { text-align: right; font-size: 12px; }
.cook-result { text-align: center; padding: 8px 0 4px; }
.dish-name { font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.recipe-mark { display: block; font-family: var(--font-ui); font-size: 11px; letter-spacing: .2em; color: var(--weird); font-weight: 600; }
.dish-from { font-size: 13px; }
.tier-label { margin: 10px 0 8px; font-size: 15px; font-weight: 600; letter-spacing: .1em; color: var(--ink-soft); }
.tier-label small { font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.tier-대성공 .tier-label { color: var(--weird); font-size: 18px; }
.tier-성공 .tier-label { color: var(--heal); }
.cook-result .reaction-line { font-size: 16px; line-height: 1.85; margin: 0 0 6px; text-align: left; }
.cook-result .mood-hit, .cook-result .clue-line { margin: 4px 0; text-align: left; }
.cook-result .new-badge { margin: 8px 0 0; }

/* ── 마실 길이 버튼 · 이야기 이름 ── */
.durations { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.durations .pick { min-width: 0; }
.story-names { color: var(--heal); font-family: var(--font-literary); margin-left: 4px; }
.diary-story span[data-text] { color: var(--ink); }

/* ── 관찰 도감 ── */
.dex-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 860px; margin: 0 auto; }
.dex-total { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; }
.dex-pct { font-size: 40px; font-weight: 300; line-height: 1; }
.dex-pct small { font-size: 18px; margin-left: 2px; color: var(--ink-soft); }
.dex-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 14px 0 12px; }
.dex-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.dex-chip:hover { border-color: var(--heal); background: var(--heal-wash); }
.dex-chip b { color: var(--heal); font-weight: 600; }
.dex-cat { scroll-margin-top: 12px; }
.dex-cat-head .panel-title { margin-bottom: 2px; }
.dex-part { font-size: 13px; color: var(--ink-soft); font-weight: 500; letter-spacing: .08em; margin: 18px 0 4px; }
.dex-group { border-top: 1px solid var(--line); }
.dex-group summary {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 2px; cursor: pointer; list-style: none;
  font-size: 14.5px;
}
.dex-group summary::-webkit-details-marker { display: none; }
.dex-group summary::before { content: '▸'; color: var(--ink-soft); margin-right: 6px; transition: transform .15s; }
.dex-group[open] summary::before { transform: rotate(90deg); }
.dex-g-title { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dex-group.complete .dex-g-title { color: var(--heal); }
.new-dot { font-style: normal; font-size: 11px; color: var(--weird); border: 1px solid var(--weird); border-radius: 2px; padding: 0 5px; }
.dex-list { list-style: none; margin: 0 0 10px; padding: 0 0 0 16px; }
.dex-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; line-height: 1.75; }
.dex-list li:last-child { border-bottom: 0; }
.dex-list li.unseen { display: flex; justify-content: space-between; gap: 12px; color: var(--line-strong); letter-spacing: .1em; }
.dex-list li.unseen small { color: var(--ink-soft); letter-spacing: 0; font-size: 12px; text-align: right; }
.dex-list li.is-new { box-shadow: inset 2px 0 0 var(--weird); padding-left: 8px; }

/* ── 도깨비 만물상 ── */
.shop-wrap { display: flex; flex-direction: column; gap: 16px; }
.shop-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.coins-line { margin: 0; color: var(--ink-soft); }
.coins-line b { color: var(--ink); font-size: 20px; margin: 0 2px; }
.greeting { margin: 4px 0 0; font-size: 16px; line-height: 1.9; }
.trade { margin: 8px 0 0; min-height: 1.8em; color: var(--heal); font-size: 15px; }
.trade:empty { display: none; }
.seg { display: inline-flex; margin-top: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 22px; cursor: pointer; color: var(--ink-soft); font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--ink); color: var(--bg); }
.ware { flex-direction: column; flex-wrap: nowrap !important; }
.ware-top { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.ware .price { color: var(--ink-soft); font-size: 13.5px; white-space: nowrap; }
.ware .muted { flex: 1; margin: 2px 0 8px; }
.ware-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--ink-soft); margin-right: auto; }
.btn.small { padding: 3px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { border-color: var(--line-strong); background: var(--card); }

/* 마당 꾸미기 */
.furnish ul { list-style: none; margin: 0; padding: 0; }
.furnish li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-soft);
}
.furnish li:last-child { border-bottom: 0; }
.furnish li.on { color: var(--ink); }
.furnish li.on span::before { content: '◆ '; color: var(--heal); font-size: 10px; }
.log-shop span { color: var(--ink-soft); }

/* ── 마실 · 만물상 미리보기 ── */
.diary { margin: 14px 0 0; padding-left: 22px; }
.diary li { margin-bottom: 10px; line-height: 1.85; font-size: 15.5px; }
.diary .gain { color: var(--heal); font-family: var(--font-ui); font-size: 13px; }
.shop-group { font-size: 13px; color: var(--ink-soft); font-weight: 500; letter-spacing: .1em; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.shop-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.shop-name { font-family: var(--font-literary); font-weight: 700; }
.shop-list .muted { flex-basis: 100%; font-size: 13px; }

/* ── 알림 ── */
#toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg);
  padding: 9px 16px; border-radius: var(--radius);
  font-size: 14px; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 좁은 화면 (모바일) ── */
@media (max-width: 860px) {
  .yard-grid { grid-template-columns: minmax(0, 1fr); }
  .log-list { max-height: 300px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .site-head { padding-top: 18px; }
  .site-title { font-size: 24px; }
  .panel { padding: 14px 14px; }
  .creature { padding: 0; }
  .creature-head, .creature-desc, .actions, .creature-foot { padding-left: 14px; padding-right: 14px; }
  .reaction { margin-left: 14px; margin-right: 14px; }
  .line { font-size: 15px; }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .tab { padding: 10px 12px 9px; font-size: 14px; }
  .filter { width: 100%; }
  .toolbar .spacer { display: none; }
}

/* ═════════════════════════════════════════════
   평상 (온기 · 차 · 간편 우쭈쭈)
   ═════════════════════════════════════════════ */
.pyeong { padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.pyeong-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.warmth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warmth-cells { display: inline-flex; gap: 4px; }
.warmth-cells i {
  width: 16px; height: 16px; display: block;
  border: 1px solid var(--line-strong); border-radius: 1px;
  background: var(--bg);
}
.warmth-cells i.on { background: var(--weird); border-color: var(--weird); box-shadow: inset 0 0 0 2px var(--card); }
.warmth-num { font-size: 13px; }
.warmth-next { font-size: 12.5px; }
.tea-row { justify-content: flex-start; }
.tea-select {
  border: 1px solid var(--line-strong); border-radius: 2px; background: var(--card);
  padding: 4px 8px; font-size: 13.5px; min-height: 30px;
}
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; position: relative; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui {
  width: 34px; height: 18px; border-radius: 9px; position: relative;
  background: var(--line); border: 1px solid var(--line-strong); transition: background .2s;
}
.switch-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); box-shadow: 0 0 0 1px var(--line-strong); transition: transform .2s;
}
.switch input:checked + .switch-ui { background: var(--heal); border-color: var(--heal); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--weird); outline-offset: 2px; }
.brew-box { padding: 10px 12px; border: 1px dashed var(--line-strong); background: var(--bg); font-size: 15px; line-height: 1.8; position: relative; }
.brew-box p { margin: 0; min-height: 1.8em; }
.steam { display: block; color: var(--ink-soft); letter-spacing: .3em; animation: steam 1.6s ease-in-out infinite; }
@keyframes steam { 0% { opacity: .2; transform: translateY(4px); } 50% { opacity: .8; } 100% { opacity: 0; transform: translateY(-8px); } }
.pyeong.nudge { animation: nudge .5s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ═════════════════════════════════════════════
   우쭈쭈 손길 미니게임
   ═════════════════════════════════════════════ */
.touch-game {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; margin: 10px 20px 4px;
  border: 1px solid var(--weird); border-radius: 2px;
  background: var(--weird-wash);
  -webkit-user-select: none; user-select: none;
}
.touch-head { display: flex; justify-content: space-between; align-items: center; }
.touch-hint { margin: 0; font-size: 15px; line-height: 1.7; min-height: 1.7em; }
.tension-2 { color: var(--weird); }
.tension-3 { color: var(--weird); font-weight: 700; animation: tremble .25s linear infinite; }
@keyframes tremble { 0%, 100% { transform: none; } 50% { transform: translateX(1px); } }

/* 쓰다듬기 : 먹물 번지는 한지 막대 */
.ink-bar {
  position: relative; height: 26px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 1px; overflow: hidden;
}
.ink-zone {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, var(--heal-wash) 0 6px, transparent 6px 10px);
  border-left: 1px dashed var(--heal); border-right: 1px dashed var(--heal);
}
.ink {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, var(--ink) 0, var(--ink) 82%, transparent);
  opacity: .78; filter: blur(.6px);
}
.touch-game > .btn, .touch-game .hold-btn { flex: none; width: 100%; }
.hold-btn { min-height: 52px; font-size: 16px; touch-action: none; -webkit-touch-callout: none; }
.hold-btn.pressing { transform: scale(.97); }

/* 발바닥 : 앞발 · 뒷발 */
.paw-row { display: flex; gap: 8px; flex-wrap: wrap; }
.paw-row .btn { flex: 1 1 90px; min-height: 48px; font-size: 15px; }
.paw.shake { animation: shake .35s ease-in-out; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px) rotate(-2deg); } 60% { transform: translateX(3px) rotate(2deg); } }
.paw-count { min-height: 1.2em; font-size: 12.5px; }

/* 빗질 : 털 결과 엉킨 글자 */
.fur {
  position: relative; height: 112px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 1px;
  display: flex; flex-direction: column; justify-content: space-around;
  color: var(--line-strong); font-size: 18px; letter-spacing: -.06em; white-space: nowrap;
}
.touch-game > * { min-width: 0; }  /* 긴 털 결 글자가 칸을 밀어내지 않게 */
.fur { min-width: 0; width: 100%; }
.fur-line { padding: 0 6px; overflow: hidden; }
.tangle {
  position: absolute; padding: 6px 8px; min-height: 36px;
  border: 1px solid var(--weird); border-radius: 2px;
  background: var(--card); color: var(--weird);
  font-family: var(--font-literary); font-size: 14px; letter-spacing: 0; cursor: pointer;
  transition: transform .35s, opacity .35s;
}
.tangle:hover { background: var(--weird-wash); }
.tangle.gone { opacity: 0; transform: translateY(26px) rotate(14deg); pointer-events: none; }
.brush-timer { height: 3px; background: var(--line); }
.brush-timer span { display: block; height: 100%; width: 100%; background: var(--weird); }

/* 결과 한 줄 */
.touch-result { margin: 4px 20px 0; font-size: 14.5px; line-height: 1.7; }
.touch-result b { font-family: var(--font-ui); font-size: 12px; letter-spacing: .08em; margin-right: 4px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 1px; color: var(--ink-soft); }
.touch-result.tier-대성공 b { background: var(--weird); border-color: var(--weird); color: var(--card); }
.touch-result.tier-성공 b { border-color: var(--heal); color: var(--heal); }

/* ═════════════════════════════════════════════
   오늘의 소일거리 쪽지
   ═════════════════════════════════════════════ */
.quest-list { list-style: none; margin: 0; padding: 0; }
.quest { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); min-height: 52px; }
.quest:last-child { border-bottom: 0; }
.quest-text { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; line-height: 1.5; }
.quest-text small { font-size: 12px; }
.quest.claimed .quest-text .literary { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--weird); }
.quest-side { flex: none; min-width: 64px; display: flex; justify-content: flex-end; }
.quest-prog { font-size: 13px; color: var(--ink-soft); }
.dojang {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 2px solid var(--weird); color: var(--weird); border-radius: 3px;
  font-family: var(--font-literary); font-weight: 700; font-size: 20px;
  transform: rotate(-8deg); opacity: .85;
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--weird);
}
.dojang.stamping { animation: stamp .55s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes stamp {
  0% { transform: scale(2.6) rotate(-24deg); opacity: 0; }
  55% { transform: scale(.9) rotate(-6deg); opacity: 1; }
  75% { transform: scale(1.06) rotate(-9deg); }
  100% { transform: scale(1) rotate(-8deg); opacity: .85; }
}
.quest-foot { font-size: 12px; margin-top: 6px; }
.log-quest span, .log-tea span { color: var(--heal); }

/* 마실 보따리 고르기 */
.bundle-pick .pick { min-width: 110px; }
.sub-title small { font-weight: 400; letter-spacing: 0; margin-left: 4px; }

@media (max-width: 560px) {
  .pyeong { padding: 10px 12px; }
  .touch-game { margin-left: 14px; margin-right: 14px; padding: 10px; }
  .touch-result { margin-left: 14px; margin-right: 14px; }
  .fur { height: 124px; font-size: 16px; }
  .tangle { font-size: 13px; }
  .bundle-pick .pick { flex: 1 1 calc(50% - 8px); }
}
