:root {
  --cream: #fbf6ec;
  --paper: rgba(252, 247, 238, 0.94);
  --ink: #3f2c20;
  --ink-soft: #7d6553;
  --wood: #a8744a;
  --wood-dark: #6d4630;
  --line: rgba(109, 70, 48, 0.18);
  --shadow: 0 10px 30px rgba(60, 38, 20, 0.2);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9dcc6; color: var(--ink); font-family: var(--sans); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; color: var(--wood-dark); z-index: 20; background: #e9dcc6; transition: opacity .5s; }
#loading.gone { opacity: 0; pointer-events: none; }

/* ---------- 입장 ---------- */
#entry { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; background: radial-gradient(ellipse at center, rgba(233, 220, 198, 0.12), rgba(40, 28, 18, 0.35)); transition: opacity .6s, visibility .6s; z-index: 10; }
#entry.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.panel { background: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
#enterForm { width: 100%; max-width: 390px; margin: auto; padding: 24px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 28px; letter-spacing: -0.5px; color: var(--wood-dark); line-height: 1.15; }
.logo { margin: 0; }
.brand-name i { font-style: normal; font-size: 0.7em; color: #d9822b; margin: 0 0.04em; position: relative; top: -0.06em; }
.tagline { margin: 2px 0 6px; font-family: var(--serif); font-size: 15px; color: var(--wood); }
.about { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.about summary { cursor: pointer; text-align: center; color: var(--wood); list-style: none; font-size: 12.5px; }
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: ' ▾'; }
.about[open] summary::after { content: ' ▴'; }
.about p { margin: 6px 0 0; }
.about a, .noscript a { color: var(--wood-dark); }
.noscript { position: fixed; inset: auto 16px 16px; z-index: 30; padding: 14px 16px; font-size: 14px; line-height: 1.6; }
.noscript p { margin: 0 0 6px; }
.sub { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.field { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.field > span { width: 46px; flex: none; color: var(--ink-soft); }
.field input, .field select, textarea { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf9; color: var(--ink); outline: none; }
.field input:focus, textarea:focus { border-color: var(--wood); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2.5px var(--wood-dark); }
.check { font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--wood); width: 17px; height: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 16px; font-size: 15px; cursor: pointer; text-decoration: none; background: #efe2cc; color: var(--ink); transition: transform .12s, filter .12s; white-space: nowrap; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(#b8845a, #9b663e); color: #fffaf2; box-shadow: 0 3px 0 #774626, 0 8px 18px rgba(100, 60, 25, 0.22); }
.btn.primary:active { box-shadow: 0 1px 0 #774626; transform: translateY(2px); }
.btn.big { font-size: 18px; padding: 14px; margin-top: 4px; font-family: var(--serif); font-weight: 700; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); padding: 7px 12px; font-size: 13.5px; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.tiny { margin: 0; font-size: 12px; color: var(--ink-soft); text-align: center; min-height: 1em; line-height: 1.5; }

/* ---------- 화면 위 UI ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.topbar { position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chip { pointer-events: auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; background: var(--paper); box-shadow: 0 4px 14px rgba(60, 38, 20, 0.12); font-size: 13px; color: var(--ink-soft); white-space: nowrap; min-width: 0; overflow: hidden; }
.chip b { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--wood-dark); }
.chip em { font-style: normal; font-size: 13px; color: var(--wood); margin-left: -3px; }
.chip em:empty { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9b8a6; display: inline-block; flex: none; }
.dot.online { background: #7fb37a; box-shadow: 0 0 0 3px rgba(127, 179, 122, 0.25); }
.dot.reconnecting { background: #e5b75b; }
.buttons { display: flex; gap: 6px; pointer-events: auto; flex: none; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: 0 4px 14px rgba(60, 38, 20, 0.14); font-size: 18px; cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .12s; }
.round:active { transform: scale(.9); }
@media (max-width: 430px) { .topbar .buttons { gap: 3px; } .round { width: 33px; height: 33px; font-size: 16px; } .chip.brand { gap: 5px; padding: 8px 8px 8px 10px; } .chip.brand em { margin-left: -2px; } .chip.brand b { font-size: 14px; } .chip.brand .long { display: none; } .chip.brand { min-width: 0; overflow: hidden; } .chip.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.round.off { opacity: .78; }
.round.pulse { animation: pulse 1s 3; }
@keyframes pulse { 50% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(168, 116, 74, 0.3); } }

.bottombar { position: absolute; left: 50%; bottom: calc(10px + var(--safe-bot)); transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 20px; background: var(--paper); box-shadow: 0 6px 20px rgba(60, 38, 20, 0.18); pointer-events: auto; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: transparent; border-radius: 15px; padding: 6px 10px 5px; min-width: 70px; white-space: nowrap; cursor: pointer; font-size: 12px; color: var(--ink-soft); }
.tab .ico { font-size: 20px; line-height: 1.1; }
.tab:active, .tab.on { background: #efe2cc; color: var(--ink); }
@media (max-width: 480px) { .tab { min-width: 0; flex: 1 1 0; padding: 6px 4px 5px; font-size: 11px; } .bottombar { width: calc(100vw - 16px); } .tab .ico { font-size: 19px; } }
.badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: #b65d4c; color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

.hint, .toast { position: absolute; left: 50%; transform: translate(-50%, -8px); opacity: 0; transition: opacity .4s, transform .4s; padding: 8px 15px; border-radius: 999px; background: rgba(55, 36, 22, 0.74); color: #fbf1e2; font-size: 13.5px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.hint { top: calc(60px + var(--safe-top)); }
.toast { top: calc(98px + var(--safe-top)); background: rgba(252, 247, 238, 0.96); color: var(--ink); box-shadow: 0 4px 14px rgba(60, 38, 20, 0.15); }
.hint.show, .toast.show { opacity: 1; transform: translate(-50%, 0); }

.card { position: absolute; top: calc(58px + var(--safe-top)); left: 50%; width: min(330px, calc(100vw - 24px)); transform: translate(-50%, -12px) scale(.97); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; background: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 15px 17px; }
.card.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.card-kicker { font-size: 12px; color: var(--wood); letter-spacing: .4px; }
.card-title { font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--wood-dark); margin: 2px 0 3px; }
.card-desc { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 11px; line-height: 1.5; }
.card .row { display: flex; gap: 7px; flex-wrap: wrap; }
.card .row .btn { flex: 1; }
.purr { font-family: var(--sans); font-size: 13px; color: #d97c8a; font-weight: 400; }
.x { position: absolute; top: 8px; right: 9px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; font-size: 23px; color: var(--ink-soft); cursor: pointer; line-height: 1; z-index: 2; }

.pet-bubble { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(252, 247, 238, 0.96); color: var(--ink); font-size: 14px; box-shadow: 0 4px 14px rgba(60, 38, 20, 0.2); cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; white-space: nowrap; }
.pet-bubble.show { opacity: 1; visibility: visible; }
/* ---------- 모닥불 곁: 장작 넣기 · 불멍 ---------- */
.fire-bar { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: flex; gap: 6px; pointer-events: auto; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.fire-bar.show { opacity: 1; visibility: visible; }
.fire-bar button, .gaze-bar button { border: 0; border-radius: 999px; padding: 9px 14px; background: rgba(252, 247, 238, 0.96); color: var(--ink); font: inherit; font-size: 14px; box-shadow: 0 4px 14px rgba(60, 38, 20, 0.22); cursor: pointer; white-space: nowrap; }
.fire-bar button:active, .gaze-bar button:active { transform: scale(0.96); }
.gaze-veil { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s; background: radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, 0) 35%, rgba(20, 8, 2, 0.55) 100%); z-index: 1; }
.gaze-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-bot)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; pointer-events: auto; opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s; z-index: 2; }
.gaze-info { color: #fff3e2; font-family: var(--serif); font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); padding: 0 6px; white-space: nowrap; }
body.gazing .gaze-veil { opacity: 1; }
body.gazing .gaze-bar { opacity: 1; visibility: visible; }
body.gazing .topbar, body.gazing .bottombar, body.gazing .chat-log, body.gazing .fire-bar, body.gazing .pet-bubble, body.gazing .toast { opacity: 0 !important; visibility: hidden !important; transition: opacity .8s, visibility .8s; }

/* ---------- 채팅 ---------- */
.chat-log { position: absolute; left: 10px; bottom: calc(92px + var(--safe-bot)); width: min(380px, calc(100vw - 20px)); display: flex; flex-direction: column; gap: 5px; pointer-events: none; transition: bottom .2s; }
/* 말하기 창을 열면 그 위로 올라감 (창에 가리지 않게) */
body.chatting .chat-log { bottom: calc(150px + var(--safe-bot)); }
.chat-log div { align-self: flex-start; max-width: 100%; background: rgba(255, 251, 244, 0.97); padding: 7px 13px; border-radius: 15px; font-size: 15px; line-height: 1.45; color: var(--ink); box-shadow: 0 3px 12px rgba(60, 38, 20, 0.18); transition: opacity 1s; overflow-wrap: anywhere; }
.chat-log div b { color: var(--wood-dark); font-weight: 700; margin-right: 6px; }
.chat-log div.me { background: rgba(243, 231, 210, 0.97); }
.chat-log div.sys { background: rgba(55, 36, 22, 0.72); color: #fbf1e2; font-size: 13.5px; }
.chat-log div.old { opacity: 0; }
.chat-bar { position: absolute; left: 50%; bottom: calc(80px + var(--safe-bot)); transform: translateX(-50%); width: min(440px, calc(100vw - 20px)); display: flex; gap: 6px; padding: 6px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); pointer-events: auto; }
.chat-bar input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 13px; border-radius: 13px; border: 1.5px solid var(--line); background: #fffdf9; outline: none; color: var(--ink); }

/* ---------- 아래에서 올라오는 판 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 12; display: flex; align-items: flex-end; justify-content: center; background: rgba(40, 28, 18, 0.32); padding: 0; }
/* 판(.sheet)은 움직이지 않는 틀이고, 스크롤은 안쪽 #sheetBody 에서만 — 아이폰 사파리에서 흐림 효과가 걸린 판은 손가락 스크롤이 먹통이 되는 일이 있어서
   틀에는 흐림을 쓰지 않고, 닫기 단추는 틀에 붙어 있어 내려도 늘 보인다. 높이는 실제로 보이는 화면(dvh) 안에 맞춘다. */
.sheet { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); max-height: 86vh; max-height: min(calc(100dvh - var(--safe-top) - 10px), 860px); overflow: hidden; border-radius: 22px 22px 0 0; padding: 0; animation: up .28s ease-out; }
.sheet.panel { background: #fbf6ec; backdrop-filter: none; -webkit-backdrop-filter: none; }
#sheetBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: 18px 18px calc(22px + var(--safe-bot)); }
.sheet > .x { top: 8px; right: 8px; width: 40px; height: 40px; z-index: 3; background: rgba(251, 246, 236, 0.92); box-shadow: 0 1px 6px rgba(60, 38, 20, 0.12); }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }
.sheet h2 { font-family: var(--serif); font-size: 21px; margin: 2px 0 10px; color: var(--wood-dark); }
.sheet h3 { font-family: var(--serif); font-size: 16px; margin: 16px 0 8px; color: var(--wood-dark); }
.tabs { display: flex; gap: 6px; margin: 2px 40px 12px 0; flex-wrap: wrap; }
.tabs button { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--wood-dark); color: #fbf1e2; border-color: var(--wood-dark); }

/* 펼친 책 */
.book { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
@media (max-width: 560px) { .book { grid-template-columns: 1fr; } .book .cover.big { width: 170px; margin: 0 auto; } }
.book-meta { font-size: 12.5px; color: var(--wood); letter-spacing: .3px; }
.book-title { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.3; margin: 3px 0 2px; color: var(--ink); }
.book-sub { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; }
.first { font-family: var(--serif); font-size: 15px; line-height: 1.7; color: var(--ink); border-left: 3px solid var(--wood); padding: 2px 0 2px 12px; margin: 10px 0; }
.first small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--ink-soft); margin-bottom: 2px; }
.blurb { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 12px; }
.book .row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.toc { list-style: none; padding: 0; margin: 6px 0 0; counter-reset: toc; border-top: 1px solid var(--line); }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--line); }
.toc a { display: flex; gap: 10px; padding: 9px 2px; text-decoration: none; font-size: 14px; line-height: 1.45; }
.toc a::before { content: counter(toc); flex: none; width: 24px; color: var(--wood); font-family: var(--serif); text-align: right; }
.toc a:hover { background: rgba(168, 116, 74, 0.08); }
.toc a .done { margin-left: auto; color: #7fa36d; flex: none; font-size: 12px; }
.credit { font-size: 11px; color: var(--ink-soft); margin-top: 6px; line-height: 1.4; }

/* 표지 (독립출판물 느낌) */
.cover { position: relative; width: 200px; aspect-ratio: 2 / 3; background: var(--paper); color: var(--ink); border-radius: 3px 6px 6px 3px; box-shadow: inset 7px 0 0 var(--spine), inset 9px 0 0 rgba(0, 0, 0, 0.12), 0 8px 20px rgba(40, 25, 12, 0.25); padding: 9% 9% 8% 13%; display: flex; flex-direction: column; overflow: hidden; font-family: var(--serif); }
.cover.mini { width: 54px; padding: 5px 4px 5px 8px; box-shadow: inset 4px 0 0 var(--spine), 0 3px 8px rgba(40, 25, 12, 0.2); }
.cover .cv-top, .cover .cv-foot { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 9.5px; letter-spacing: .6px; opacity: .8; }
.cover .cv-foot { margin-top: auto; }
.cover .cv-pic { margin: 9% 0 7%; aspect-ratio: 4 / 3; border: 1px solid var(--ink); overflow: hidden; background: #ddd; }
.cover .cv-pic img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) contrast(1.02); }
.cover .cv-title { font-weight: 700; font-size: 17px; line-height: 1.3; word-break: keep-all; }
.cover .cv-title.big { font-size: 25px; line-height: 1.25; margin-top: 8%; }
.cover .cv-sub { font-size: 10.5px; margin-top: 5px; opacity: .75; line-height: 1.4; word-break: keep-all; font-family: var(--sans); }
.cover .cv-mark { height: 28%; position: relative; margin-top: 10%; }
.cover .cv-mark i { position: absolute; border: 1.5px solid var(--spine); border-radius: 50%; }
.cover .cv-mark i:nth-child(1) { width: 46%; aspect-ratio: 1; right: 6%; top: 0; }
.cover .cv-mark i:nth-child(2) { width: 22%; aspect-ratio: 1; right: 30%; top: 34%; background: var(--spine); opacity: .85; }
.cover .cv-mark i:nth-child(3) { width: 55%; height: 0; border-radius: 0; border-width: 1.5px 0 0; left: 0; top: 45%; }
.cover.mini > * { display: none; }
.cover.mini::after { content: attr(data-t); display: block; font-size: 7px; line-height: 1.2; font-weight: 700; word-break: keep-all; }

/* 책바구니 · 서가 목록 */
.blist { display: flex; flex-direction: column; gap: 2px; }
.bitem { display: flex; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.bitem .minicover { flex: none; width: 46px; height: 64px; border-radius: 2px 4px 4px 2px; background-size: cover; background-position: center; box-shadow: inset 4px 0 0 var(--spine), 0 2px 6px rgba(40, 25, 12, 0.2); display: grid; place-items: center; font-family: var(--serif); font-size: 9px; font-weight: 700; text-align: center; padding: 3px 3px 3px 7px; line-height: 1.15; word-break: keep-all; overflow: hidden; }
.bitem .bt { flex: 1; min-width: 0; }
.bitem .bt b { display: block; font-family: var(--serif); font-size: 15.5px; font-weight: 700; }
.bitem .bt span { font-size: 12.5px; color: var(--ink-soft); }
.bitem .prog { flex: none; font-size: 12px; color: var(--wood); }
.empty { padding: 26px 8px; text-align: center; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.shelf-h { font-family: var(--serif); font-size: 14px; color: var(--wood-dark); margin: 14px 0 2px; padding-bottom: 4px; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between; }
.shelf-h small { font-family: var(--sans); color: var(--ink-soft); font-size: 12px; }

/* 음료 */
.drinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.drink { border: 1.5px solid var(--line); background: #fffdf9; border-radius: 14px; padding: 10px 11px; text-align: left; cursor: pointer; }
.drink.on { border-color: var(--wood-dark); background: #f4e9d6; }
.drink b { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 15px; }
.drink b i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--line); }
.drink span { font-size: 12px; color: var(--ink-soft); }
.guests { display: flex; flex-wrap: wrap; gap: 6px; }
.guests button { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.guests button.on { background: var(--wood-dark); color: #fbf1e2; }
.note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
textarea { width: 100%; min-height: 130px; resize: vertical; line-height: 1.6; }

/* ---------- 영화관 플레이어 ---------- */
.player { position: absolute; top: calc(58px + var(--safe-top)); right: 10px; width: min(380px, calc(100vw - 20px)); background: #141216; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); pointer-events: auto; z-index: 6; }
.player.big { width: min(760px, calc(100vw - 20px)); left: 50%; right: auto; transform: translateX(-50%); }
.player-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; color: #e9dfcf; font-size: 13px; }
.player-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar button { border: 0; background: rgba(255, 255, 255, 0.1); color: #e9dfcf; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.player iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
@media (max-width: 560px) { .player { top: auto; bottom: calc(84px + var(--safe-bot)); right: 10px; } .player.big { bottom: calc(84px + var(--safe-bot)); } }

/* ---------- 가볼 곳 ---------- */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.places button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1.5px solid var(--line); background: #fffdf9; border-radius: 14px; padding: 10px 12px; text-align: left; cursor: pointer; }
.places button .ico { font-size: 22px; }
.places button b { font-family: var(--serif); font-size: 15px; }
.places button span:not(.ico) { font-size: 12px; color: var(--ink-soft); }

/* ---------- 서가 목록 · 도구 ---------- */
.tabs.sub { margin: 0 0 8px; gap: 5px; }
.tabs.sub button { padding: 5px 11px; font-size: 13px; }
.tabs.sub button.on { color: #fbf1e2; }
.tabs.grades button.on { background: var(--wood); border-color: var(--wood); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 7px; margin-bottom: 6px; }
.tool { display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--line); background: #fffdf9; border-radius: 13px; padding: 9px 11px; text-decoration: none; }
.tool .ico { font-size: 20px; }
.tool b { font-family: var(--serif); font-size: 14.5px; }
.tool span:not(.ico) { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }

/* ---------- 별멍 단추 · 숨은 아깽이 찾기 막대 · 카운터 탭 ---------- */
.star-chip { position: absolute; right: 12px; bottom: calc(86px + var(--safe-bot)); border: 0; border-radius: 999px; padding: 10px 15px; background: rgba(28, 34, 60, 0.88); color: #e9eeff; font: inherit; font-size: 14px; box-shadow: 0 4px 16px rgba(10, 12, 30, 0.35); pointer-events: auto; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.star-chip.show { opacity: 1; visibility: visible; }
.game-bar { position: absolute; left: 50%; top: calc(62px + var(--safe-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 20px); padding: 7px 8px 7px 14px; border-radius: 999px; background: rgba(252, 247, 238, 0.96); box-shadow: 0 4px 14px rgba(60, 38, 20, 0.2); font-size: 13.5px; pointer-events: auto; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.game-bar.show { opacity: 1; visibility: visible; }
.game-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-bar button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--wood); color: #fff; font: inherit; font-size: 13px; cursor: pointer; flex: none; }
body.gazing .star-chip, body.gazing .game-bar { opacity: 0 !important; visibility: hidden !important; }
.tab2 { border: 1.5px solid var(--line); background: #fffdf9; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 14px; cursor: pointer; margin: 0 6px 6px 0; }
.tab2.on { background: var(--wood-dark); color: #fff; border-color: var(--wood-dark); }
.store-line { margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.store-line a { color: var(--wood-dark); }

.tab2.support-tab { display: inline-block; text-decoration: none; color: #fff; background: #d9607a; border-color: #d9607a; font-weight: 700; box-shadow: 0 3px 10px rgba(217, 96, 122, 0.35); }
.tab2.store-tab { display: inline-block; text-decoration: none; color: var(--wood-dark); background: #f6ead6; border-color: #d8b88c; }

/* ---------- 필사 ---------- */
.copy-chip { position: absolute; right: 12px; bottom: calc(136px + var(--safe-bot)); border: 0; border-radius: 999px; padding: 10px 15px; background: rgba(252, 247, 238, 0.97); color: var(--wood-dark); font: inherit; font-size: 14px; box-shadow: 0 4px 16px rgba(60, 38, 20, 0.25); pointer-events: auto; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.copy-chip.show { opacity: 1; visibility: visible; }
/* 판은 움직이지 않는 틀, 스크롤은 안쪽 .cp-scroll 에서만 (바깥 판이 스크롤되면 휴대폰에서 3D 화면 위에 빈 판이 번지는 일이 있음) */
.cp-scroll { max-height: min(56dvh, 520px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 12px; }
.copy-panel { position: fixed; left: 50%; bottom: calc(10px + var(--safe-bot)); transform: translateX(-50%); width: min(640px, calc(100vw - 16px)); overflow: hidden; padding: 0; z-index: 11; pointer-events: auto; display: none; background: #fbf6ec; backdrop-filter: none; -webkit-backdrop-filter: none; }
.copy-panel.show { display: block; animation: up .28s ease-out; }
body.copying .bottombar, body.copying .chat-log, body.copying .star-chip, body.copying .copy-chip, body.copying .fire-bar, body.copying .pet-bubble, body.copying .game-bar { opacity: 0 !important; visibility: hidden !important; }
.cp-kicker { font-size: 12.5px; color: var(--ink-soft); margin: 0 36px 6px 0; }
.cp-origin { font-family: var(--serif); color: #5a4636; font-size: 15px; }
.cp-ko { font-family: var(--serif); font-weight: 700; color: var(--wood-dark); font-size: 17px; line-height: 1.5; margin: 2px 0; }
.cp-src { font-size: 12.5px; color: var(--ink-soft); }
.cp-src a { color: var(--wood-dark); }
.cp-prog { height: 4px; border-radius: 4px; background: rgba(109, 70, 48, 0.12); margin: 10px 0 6px; overflow: hidden; }
.cp-prog i { display: block; height: 100%; width: 0; background: var(--wood); transition: width .2s; }
.cp-step { font-size: 12px; color: var(--ink-soft); }
.cp-para { font-family: var(--serif); font-size: 16px; line-height: 1.85; margin: 4px 0 8px; letter-spacing: 0.2px; }
.cp-para .todo { color: #b9aa98; }
.cp-para .ok { color: #2c3550; }
.cp-para .bad { color: #b4462e; text-decoration: underline wavy rgba(180, 70, 46, 0.6); }
.cp-input { width: 100%; font-family: 'Nanum Pen Script', var(--sans); font-size: 22px; line-height: 1.5; color: #1f2a55; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: repeating-linear-gradient(#fffdf8, #fffdf8 31px, rgba(110, 140, 190, 0.25) 32px); resize: vertical; outline: none; min-height: 84px; }
.copy-panel.auto .cp-input { display: none; }
.cp-q { font-family: var(--serif); color: var(--wood-dark); font-size: 14px; margin: 6px 0; }
.cp-q:empty { display: none; }
.cp-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cp-row button { border: 1.5px solid var(--line); background: #fffdf9; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.cp-row #cpMode { background: var(--wood-dark); color: #fff; border-color: var(--wood-dark); }
/* 필사 중엔 흐림 효과를 끔 — 휴대폰에서 3D 화면 위에 흐림 판이 크게 번져 공책을 가리는 일이 있음 */
body.copying #hud *, body.copying .panel { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* ---------- 목공 멍 단추 (필사 단추와 같은 자리) · 미술관 ---------- */
#woodChip { bottom: calc(136px + var(--safe-bot)); }
/* 나무 다듬기 판 (아래쪽) */
.craft-panel { position: fixed; left: 50%; bottom: calc(10px + var(--safe-bot)); transform: translateX(-50%); width: min(460px, calc(100vw - 20px)); padding: 12px 14px 10px; display: none; z-index: 11; pointer-events: auto; background: #fbf6ec; }
.craft-panel.show { display: block; animation: up .28s ease-out; }
body.crafting .bottombar, body.crafting .chat-log, body.crafting .star-chip, body.crafting .copy-chip, body.crafting .fire-bar, body.crafting .pet-bubble, body.crafting .game-bar { opacity: 0 !important; visibility: hidden !important; }
.cr-tools { display: flex; gap: 6px; margin: 0 34px 8px 0; flex-wrap: wrap; }
.cr-tools button { border: 1.5px solid var(--line); background: #fffdf9; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.cr-tools button.on { background: var(--wood-dark); border-color: var(--wood-dark); color: #fff; }
.cr-title { font-family: var(--serif); color: var(--wood-dark); font-size: 15.5px; margin-bottom: 6px; }
.cr-count { font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); margin-left: 4px; }
.cr-meter { position: relative; height: 14px; border-radius: 8px; background: rgba(109, 70, 48, 0.12); overflow: hidden; }
.cr-meter .zone { position: absolute; left: 37%; width: 26%; top: 0; bottom: 0; background: rgba(95, 150, 90, 0.45); }
.cr-meter .needle { position: absolute; top: 1px; bottom: 1px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--wood-dark); left: 0; }
.cr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.cr-combo { font-size: 12.5px; color: var(--ink-soft); }
.cr-combo.good { color: #3f7a3a; font-weight: 700; }
.cr-hit { min-width: 128px; font-size: 17px; padding: 12px 16px; touch-action: manipulation; }
.cr-hit:active { transform: scale(0.96); }
.cr-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.cr-link { border: none; background: none; color: var(--wood-dark); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; white-space: nowrap; }
.art-img { display: block; width: 100%; max-height: 46vh; object-fit: contain; background: #1e2126; border-radius: 10px; margin: 6px 0 8px; }
.art-rules { margin: 6px 0 4px; padding-left: 18px; display: grid; gap: 2px; }
.au-prev img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin: 4px 0 8px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- 머리 위 이름표 · 말풍선 (화면 위 글자) ---------- */
.tag-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.av-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; transform-origin: 50% 100%; will-change: transform; }
.av-name { font-size: 13px; font-weight: 600; color: #5a3d2b; background: rgba(255, 250, 242, 0.92); padding: 2px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 1px 4px rgba(60, 38, 20, 0.15); }
.av-bubble { display: none; position: relative; max-width: min(240px, 62vw); width: max-content; font-size: 16px; line-height: 1.45; color: #3f2c20; background: #fffbf4; border: 1.5px solid rgba(141, 90, 53, 0.35); padding: 8px 13px; border-radius: 16px; box-shadow: 0 4px 14px rgba(60, 38, 20, 0.2); overflow-wrap: anywhere; word-break: keep-all; text-align: center; margin-bottom: 6px; }
.av-bubble.show { display: block; animation: pop .22s ease-out; }
.av-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #fffbf4; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
body.gazing .tag-layer, body.copying .tag-layer, body.starring .tag-layer { opacity: 0; }

/* ---------- 독서 모임 방 단체 채팅 ---------- */
.club-panel { position: fixed; left: 50%; bottom: calc(8px + var(--safe-bot)); transform: translateX(-50%); width: min(560px, calc(100vw - 16px)); height: min(58dvh, 540px); display: none; flex-direction: column; padding: 0; overflow: hidden; z-index: 11; pointer-events: auto; background: #fbf6ec; }
.club-panel.show { display: flex; animation: up .28s ease-out; }
body.clubbing .bottombar, body.clubbing .chat-log, body.clubbing .chat-bar, body.clubbing .copy-chip, body.clubbing .star-chip, body.clubbing .fire-bar, body.clubbing .pet-bubble, body.clubbing .game-bar { opacity: 0 !important; visibility: hidden !important; }
body.clubbing #hud *, body.clubbing .panel { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.cl-head { display: flex; align-items: center; gap: 8px; padding: 10px 44px 8px 14px; border-bottom: 1px solid var(--line); position: relative; }
.cl-head b { font-family: var(--serif); color: var(--wood-dark); font-size: 16px; }
.cl-count { font-size: 12.5px; color: #3f7a3a; font-weight: 700; margin-left: 4px; }
.cl-who { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-btn { border: 0; background: transparent; font-size: 17px; cursor: pointer; padding: 4px; }
.cl-head .x { top: 6px; right: 8px; }
.cl-topic { font-size: 12.5px; color: #4f5c4a; background: #eef1e6; padding: 6px 14px; line-height: 1.45; }
.cl-topic:empty { display: none; }
.cl-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #f6efe3; }
.cl-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.cl-msg .n { font-size: 12px; color: var(--wood-dark); font-weight: 700; margin: 0 0 2px 4px; }
.cl-msg .row { display: flex; align-items: flex-end; gap: 5px; }
.cl-msg .b { background: #fff; color: var(--ink); font-size: 15.5px; line-height: 1.45; padding: 8px 12px; border-radius: 4px 16px 16px 16px; box-shadow: 0 1px 3px rgba(60, 38, 20, 0.12); overflow-wrap: anywhere; }
.cl-msg .t { font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; }
.cl-msg.me { align-self: flex-end; align-items: flex-end; }
.cl-msg.me .row { flex-direction: row-reverse; }
.cl-msg.me .b { background: #f3d48a; border-radius: 16px 4px 16px 16px; }
.cl-sys { align-self: center; font-size: 12px; color: #fbf1e2; background: rgba(90, 64, 44, 0.55); padding: 3px 11px; border-radius: 999px; }
.cl-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: #fbf6ec; }
.cl-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 13px; border-radius: 13px; border: 1.5px solid var(--line); background: #fffdf9; outline: none; color: var(--ink); }
body.clubbing .av-bubble { display: none !important; }   /* 모임 방에선 말이 채팅창에 쌓이니 머리 위 말풍선은 숨김 */

/* ---------- 같이 산책하기 ---------- */
.pair-ask { position: absolute; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); width: min(340px, calc(100vw - 24px)); padding: 14px 16px; display: none; pointer-events: auto; z-index: 12; background: #fbf6ec; }
.pair-ask.show { display: block; animation: up .25s ease-out; }
.pa-text { font-size: 15px; color: var(--ink); margin-bottom: 10px; line-height: 1.45; }
.pa-text b { color: var(--wood-dark); }
.pair-chip { position: absolute; left: 50%; bottom: calc(84px + var(--safe-bot)); transform: translateX(-50%); display: none; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 8px 8px 8px 15px; border-radius: 999px; background: rgba(55, 36, 22, 0.82); color: #fbf1e2; font-size: 13.5px; pointer-events: auto; white-space: nowrap; }
.pair-chip.show { display: flex; }
.pair-chip span { overflow: hidden; text-overflow: ellipsis; }
.pair-chip button { border: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 17px; cursor: pointer; flex: none; }

/* ---------- 공간 채팅 (목공방 작업 테이블 · 미술관 안) ---------- */
.space-tag { position: absolute; left: 10px; top: calc(60px + var(--safe-top)); padding: 5px 12px; border-radius: 999px; background: rgba(55, 36, 22, 0.78); color: #fbf1e2; font-size: 12.5px; pointer-events: none; display: none; }
.space-tag.show { display: block; }
body.clubbing .space-tag, body.copying .space-tag, body.gazing .space-tag { display: none; }
.cr-chat { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; max-height: 76px; overflow: hidden; justify-content: flex-end; }
.cr-chat:empty { display: none; }
.cr-chat div { font-size: 13px; line-height: 1.35; color: var(--ink); }
.cr-chat div b { color: var(--wood-dark); margin-right: 5px; }
.cr-chat div.me b { color: #3f7a3a; }
.cr-form { display: flex; gap: 6px; margin-top: 6px; }
.cr-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 7px 11px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf9; outline: none; color: var(--ink); }
.cr-form .btn { padding: 7px 12px; }

/* ---------- 들어가기: 내 모습 고르기 ---------- */
#enterForm { max-height: calc(100dvh - 20px); overflow-y: auto; overscroll-behavior: contain; }
.look-box { display: flex; gap: 10px; align-items: center; }
.look-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.look-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.look-note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.look-box.closed .look-fields, .look-box.closed + .look-more { display: none; }
.look-box.closed .look-preview { width: 52px; height: 66px; border-radius: 12px; }
.look-box:not(.closed) .look-note { display: none; }
.look-box:not(.closed) .look-head { justify-content: flex-end; }
.look-more { display: flex; flex-direction: column; gap: 10px; }
.look-preview { width: 90px; height: 115px; flex: none; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #fbf3e4, #ead9bf); }
.look-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.look-fields .field > span { width: 40px; }
.look-fields .sw { width: 22px; height: 22px; }
.look-fields .swatches { gap: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { border: 1.5px solid var(--line); background: #fffdf9; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.chips button.on { background: var(--wood-dark); border-color: var(--wood-dark); color: #fff; }
.field > span { line-height: 1.2; }

/* ---------- 히어로 그림 (들어가기 · 불러오기) ---------- */
#loading { background: #e9dcc6 url(../assets/hero/hero-small.webp) center 58% / cover no-repeat; }
#loading span { padding: 10px 18px; border-radius: 999px; background: rgba(251, 246, 236, 0.9); box-shadow: 0 4px 16px rgba(60, 38, 20, 0.2); }
.hero-band { display: block; width: calc(100% + 2px); aspect-ratio: 16 / 8.2; object-fit: cover; object-position: center 62%; border-radius: 16px; margin: -4px -1px 12px; box-shadow: 0 2px 10px rgba(60, 38, 20, 0.15); }
@media (max-height: 700px) and (max-width: 819px) { .hero-band { aspect-ratio: 16 / 6; } }
/* 넓은 화면: 그림을 화면 가득, 들어가기 판은 오른쪽에 */
@media (min-width: 820px) {
  #loading { background-image: url(../assets/hero/hero.webp); }
  #entry { background: linear-gradient(90deg, rgba(40, 28, 18, 0) 45%, rgba(40, 28, 18, 0.35)), url(../assets/hero/hero.webp) 30% 60% / cover no-repeat, #e9dcc6; justify-content: flex-end; padding: 16px max(16px, 5vw); }
  #enterForm { background: rgba(251, 246, 236, 0.94); margin-right: 2vw; }
  /* 그림 전체가 보이게(가로를 화면 왼쪽 2/3 에 맞춤), 남는 곳은 그림 가장자리 색으로 */
  /* 그림을 왼쪽으로 조금 밀어 현관 계단의 고양이와 문이 판에 가리지 않게 (화면보다 260px 넓게, 높이는 화면 가득) */
  #entry { background: linear-gradient(90deg, rgba(40, 28, 18, 0) 55%, rgba(40, 28, 18, 0.28)), url(../assets/hero/hero.webp) -200px 55% / max(calc(100vw + 260px), 178vh) auto no-repeat, #6f7a52; }
  .hero-band { display: none; }
}

/* ---------- 첫 방문 길잡이 (그림 위, 위쪽 가운데 · 아래 단추 줄과 겹치지 않게) ---------- */
.guide { position: absolute; top: calc(58px + var(--safe-top)); left: 50%; width: min(340px, calc(100vw - 24px)); transform: translate(-50%, -10px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, transform .3s, visibility .3s; padding: 12px 14px 12px; border-radius: 18px; z-index: 2; }
.guide.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; }
.g-head { display: flex; align-items: baseline; gap: 8px; }
.g-step { flex: none; font-size: 12px; color: #fff; background: #d9822b; border-radius: 999px; padding: 1px 8px; }
.g-head b { font-family: var(--serif); font-size: 16px; color: var(--wood-dark); }
.g-line { margin: 6px 0 9px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.g-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.g-btns .btn { padding: 6px 11px; font-size: 13px; }
.guide.done .g-btns #gGo, .guide.done .g-btns #gSkip { display: none; }
.guide-again { position: absolute; right: 10px; top: calc(98px + var(--safe-top)); border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(252, 247, 238, 0.82); color: var(--wood-dark); font: inherit; font-size: 11.5px; box-shadow: 0 2px 8px rgba(60, 38, 20, 0.15); pointer-events: auto; cursor: pointer; }
@media (min-width: 760px) { .guide-again { top: calc(64px + var(--safe-top)); } }
body.guiding .hint, body.guiding .guide-again, .card.show ~ .guide { opacity: 0 !important; visibility: hidden !important; }
body.copying .guide, body.copying .guide-again, body.gazing .guide, body.gazing .guide-again, body.clubbing .guide, body.clubbing .guide-again, body.crafting .guide, body.crafting .guide-again, body.starring .guide-again { opacity: 0 !important; visibility: hidden !important; }

/* ---------- 내 필사 공책 ---------- */
.cb-keep { margin: 4px 0 10px; padding: 9px 12px; border-radius: 12px; background: #fbefd9; border: 1px solid #ecd3a8; color: #6b4a2a; font-size: 13px; line-height: 1.55; }
.cb-stats { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 2px 0 8px; }
.cb-streak { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--wood-dark); }
.cb-total { font-size: 13px; color: var(--ink-soft); }
.cb-total b { color: var(--wood-dark); }
.cb-cal { padding: 10px 10px 8px; border-radius: 14px; background: #fffaf1; border: 1px solid var(--line); }
.cb-cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cb-cal-head b { font-family: var(--serif); font-size: 15px; color: var(--wood-dark); }
.cb-cal-head small { flex: 1; font-size: 12px; color: var(--ink-soft); }
.cb-nav { border: 1px solid var(--line); background: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--wood-dark); cursor: pointer; }
.cb-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cb-grid span { position: relative; display: grid; place-items: center; height: 32px; font-size: 12.5px; color: var(--ink-soft); border-radius: 8px; }
.cb-week span { height: 20px; font-size: 11.5px; color: var(--wood); }
.cb-grid span.today { outline: 1.5px dashed #d9822b; outline-offset: -2px; }
/* 쓴 날: 만년필 잉크 도장 */
.cb-grid span.ink { color: #fdf8ee; font-weight: 700; }
.cb-grid span.ink::before { content: ''; position: absolute; inset: 3px 4px; z-index: 0; border-radius: 47% 53% 44% 56% / 55% 45% 55% 45%; background: radial-gradient(circle at 38% 35%, #3f5a8a, #23345a 70%); opacity: 0.88; transform: rotate(var(--r, 0deg)); box-shadow: 0 0 0 1px rgba(35, 52, 90, 0.2); }
.cb-grid span.ink { z-index: 0; }
.cb-grid span.ink > i { position: absolute; right: -2px; top: -3px; z-index: 1; min-width: 15px; height: 15px; line-height: 15px; border-radius: 999px; background: #d9822b; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; }
.cb-grid span.ink { isolation: isolate; }
.cb-grid span.ink::before { z-index: -1; }
.cb-text { width: 100%; height: 160px; font: inherit; font-size: 13px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.tiny.legal a { color: var(--ink-soft); font-size: 11.5px; }
