/* 멍냥이의 카페 - 화면 꾸미기 (멍냥이의 버스여행과 같은 색·글꼴) */
:root {
  --ink: #4a3b2c; --muted: #8a7660; --accent: #eb9a68; --accent-dark: #c47548;
  --green: #93b97b; --green-dark: #6f945a; --cream: #fff8ec; --locked: #cdbfae; --line: #a8a097;
  --pink: #f28ba4; --pink-dark: #d0708a;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; font-size: 16px; }
html, body { height: 100%; overflow: hidden; color: var(--ink); background: #f3e6cf;
  font-family: 'MaruBuri', "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif; font-weight: 600; }
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
* { touch-action: manipulation; }   /* 어디를 두 번 눌러도 확대되지 않게 (캔버스는 아래에서 none) */
html, body { overscroll-behavior: none; }   /* 크롬 당겨서 새로고침 · 아이폰 튕김 막기 */

#app { position: relative; height: 100%; height: 100dvh; max-width: 560px; margin: 0 auto; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- 위 ---------- */
#hud { position: absolute; left: 10px; right: 10px; top: calc(8px + env(safe-area-inset-top, 0px)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#prof { display: flex; align-items: center; gap: 6px; background: rgba(255,248,236,.94); border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px 3px 3px; box-shadow: 0 2px 0 rgba(120,95,70,.15); }
#face { width: 40px; height: 40px; border-radius: 50%; background: #f9e7d2; border: 1.5px solid #e0b98c; }
#prof b { font-size: 14px; }
.lv { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.bar { width: 58px; height: 6px; border-radius: 3px; background: #eadcc8; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
#hud .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pill { display: flex; align-items: center; gap: 6px; background: rgba(255,248,236,.94); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 6px; font-size: 15px; box-shadow: 0 2px 0 rgba(120,95,70,.15); transition: transform .15s; min-width: 84px; }
.pill.bump { transform: scale(1.08); }
.coin, .hrt { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.coin { background: #f4d27c; border: 1.5px solid #cba54e; color: #a07a2c; }
.hrt { background: #fde0e7; border: 1.5px solid #f2a3b6; color: var(--pink); font-size: 12px; }

#toast { position: absolute; left: 50%; top: 90px; transform: translate(-50%, -10px); background: rgba(74,59,44,.86); color: #fff8ec; font-size: 14px; padding: 8px 16px; border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 30; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#tutBar { position: absolute; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); background: rgba(255,248,236,.97); border: 1.5px solid #f2a3b6; color: var(--ink); font-size: 14px; line-height: 1.45; padding: 10px 14px; border-radius: 14px; text-align: center; box-shadow: 0 3px 0 rgba(208,112,138,.25); display: none; pointer-events: none; }
#tutBar.on { display: block; }

/* ---------- 아래 버튼 ---------- */
#bar { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; }
#bar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 16px; background: rgba(255,248,236,.95); border: 1px solid var(--line); font-size: 12px; box-shadow: 0 3px 0 rgba(120,95,70,.18); }
#bar button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120,95,70,.18); }
#bar svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#bar button.off { color: var(--locked); } #bar button.off svg { stroke: var(--locked); }
#btnQuest.locked { opacity: .55; }

/* ---------- 아래에서 올라오는 창 ---------- */
#sheet { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#sheetBg { position: absolute; inset: 0; background: rgba(60,45,30,.35); opacity: 0; transition: opacity .25s; }
#sheet .panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72%; display: flex; flex-direction: column; background: var(--cream); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.9,.3,1.1); padding-bottom: env(safe-area-inset-bottom, 0px); }
#sheet.on { pointer-events: auto; } #sheet.on #sheetBg { opacity: 1; } #sheet.on .panel { transform: none; }
.head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; font-size: 18px; }
#sheetX { width: 34px; height: 34px; border-radius: 50%; background: #f3e6cf; font-size: 15px; }
#sheetTabs { display: flex; gap: 6px; padding: 0 12px; }
#sheetTabs:empty { display: none; }
.tab { flex: 1; padding: 8px 0; border-radius: 12px; font-size: 14px; background: #f3e6cf; color: var(--muted); border: 1px solid transparent; }
.tab.on { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 700; }
#sheetBody { overflow-y: auto; padding: 10px 12px 16px; -webkit-overflow-scrolling: touch; }
.row, .status { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fff; border: 1px solid #e6d8c3; border-radius: 14px; }
.status { background: #fff7e3; border-color: #f0cf8e; }
.row canvas, .status canvas { flex: 0 0 auto; border-radius: 10px; background: #fbf1e1; }
.info { flex: 1; min-width: 0; }
.name { font-size: 15px; font-weight: 700; } .name small { font-size: 12px; color: var(--muted); margin-left: 3px; }
.desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; } .desc b { color: var(--accent-dark); }
.row.locked { background: #f8f1e6; } .row.locked canvas { opacity: .45; filter: grayscale(.6); }
.note { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0 8px; }
.buy { flex: 0 0 auto; min-width: 80px; padding: 8px 10px; border-radius: 12px; font-size: 14px; font-weight: 700; background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); line-height: 1.15; }
.buy small { display: block; font-size: 11px; font-weight: 600; opacity: .92; }
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-dark); }
.buy.unlock { background: var(--accent); box-shadow: 0 3px 0 var(--accent-dark); }
.buy.heart { background: var(--pink); box-shadow: 0 3px 0 var(--pink-dark); }
.buy:disabled { background: var(--locked); box-shadow: 0 3px 0 #b3a491; color: #fff8ec; }
.buy.max { background: #e9dcc8; box-shadow: none; color: var(--muted); }

/* ---------- 할아버지 대화 ---------- */
#talk { position: absolute; inset: 0; z-index: 40; background: rgba(60,45,30,.25); display: none; }
#talk.on { display: block; }
#talk .box { position: absolute; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--cream); border: 1.5px solid var(--line); border-radius: 20px; padding: 16px 16px 14px 112px; min-height: 120px; box-shadow: 0 5px 0 rgba(120,95,70,.2); }
#talkFace { position: absolute; left: 10px; bottom: 14px; border-radius: 16px; background: #f9e7d2; border: 1.5px solid #e0b98c; }
.who { font-size: 13px; color: var(--accent-dark); margin-bottom: 4px; }
.text { font-size: 16px; line-height: 1.55; min-height: 50px; word-break: keep-all; }
.next { position: absolute; right: 14px; bottom: 8px; font-size: 11px; color: var(--muted); animation: nudge 1s infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.ask { display: none; margin-top: 10px; } .ask.on { display: block; }
#askName.on { display: flex; gap: 8px; }
#nameIn { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-family: inherit; color: var(--ink); }
#askLook { text-align: center; }
#talk.looking .box { padding-left: 16px; } #talk.looking #talkFace { display: none; }
#lookPrev { display: block; margin: 0 auto 6px; border-radius: 18px; background: #f9e7d2; }
#kindPick { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
#kindPick button { padding: 6px 18px; border-radius: 999px; background: #f3e6cf; font-size: 14px; color: var(--muted); border: 1.5px solid transparent; }
#kindPick button.on { background: #fff; color: var(--ink); border-color: var(--accent); font-weight: 700; }
#swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-bottom: 10px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(96,90,84,.5); }
.sw.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.big { padding: 11px 22px; border-radius: 14px; font-size: 16px; font-weight: 700; background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dark); white-space: nowrap; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dark); }

/* ---------- 알림 창 ---------- */
#modal { position: absolute; inset: 0; background: rgba(60,45,30,.45); display: none; place-items: center; z-index: 50; }
#modal.on { display: grid; }
.card { width: min(86%, 340px); background: var(--cream); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 20px; text-align: center; box-shadow: 0 6px 0 rgba(120,95,70,.2); }
.card h2 { font-size: 20px; margin: 6px 0 8px; }
.card p { font-size: 15px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.card p b { color: var(--accent-dark); }

/* ---------- 꾸미기(편집) 모드 ---------- */
#editBar { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: none; flex-direction: column; gap: 6px; z-index: 15; }
#editBar.on { display: flex; }
#editBar .tip { align-self: center; background: rgba(74,59,44,.8); color: #fff8ec; font-size: 13px; padding: 5px 14px; border-radius: 999px; }
#editBar .row2 { display: flex; align-items: center; gap: 8px; background: rgba(255,248,236,.97); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(120,95,70,.18); }
#editBar b { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; word-break: keep-all; }
#editBar #editAgain { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
body.editing #bar, body.editing #tutBar { display: none; }
#bar button { font-size: 11px; }

/* ---------- 기록 이어하기 ---------- */
#linkBox { position: absolute; inset: 0; background: rgba(60,45,30,.45); display: none; place-items: center; z-index: 60; padding: 16px; }
#linkBox.on { display: grid; }
#linkBox .card { width: min(340px, 100%); background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 14px; box-shadow: 0 4px 0 rgba(120,95,70,.18); }
#linkBox h2 { margin: 0 0 4px; font-size: 18px; text-align: center; }
#linkBox .sub { margin: 0 0 12px; font-size: 13px; text-align: center; opacity: .75; }
#linkBox .lbl { font-size: 12px; opacity: .7; margin: 10px 0 4px; }
#linkBox .code { font-size: 26px; font-weight: 700; letter-spacing: 3px; text-align: center; background: #f1e1c4; border-radius: 12px; padding: 8px 0; }
#linkBox .row { display: flex; gap: 8px; margin-top: 6px; }
#linkBox .row button, #linkBox .close { flex: 1; border: 1px solid var(--line); background: #fffdf8; border-radius: 12px; padding: 9px 0; font: inherit; font-size: 14px; }
#linkBox input { flex: 1.4; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; font: inherit; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; background: #fff; }
#linkBox .tip { font-size: 11px; opacity: .6; margin: 6px 0 0; text-align: center; }
#linkBox .msg { min-height: 18px; font-size: 13px; color: #c0605a; text-align: center; margin: 8px 0 4px; }
#linkBox .close { width: 100%; margin-top: 4px; }
#resumeBtn { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 40; display: none; border: 1px solid var(--line); background: rgba(255,248,236,.96); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; box-shadow: 0 2px 0 rgba(120,95,70,.15); }
#resumeBtn.on { display: block; }
#prof { cursor: pointer; }
#linkBox .row { border: 0; background: none; padding: 0; box-shadow: none; }
#linkBox #linkGo { background: #8fc27a; border-color: #7aae66; color: #fff; font-weight: 700; }
#resumeBtn { top: calc(84px + env(safe-area-inset-top, 0px)); }

/* 윈도우 PC 글자 부드럽게 (멍냥이의 버스여행과 같아요) */
html.winText body, html.winText input, html.winText button, html.winText textarea { text-shadow: 0 0 1px rgba(0, 0, 0, .01); }

/* 이름·카페 이름 정하기: 넓은 팝업 (좁고 불편하다는 의견) */
#askName.on { position: fixed; left: 50%; top: 34%; transform: translate(-50%, -50%); width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; margin: 0;
  background: var(--cream); border: 1.5px solid var(--line); border-radius: 22px; padding: 20px 18px 18px; box-shadow: 0 6px 0 rgba(120,95,70,.22), 0 10px 30px rgba(60,45,30,.25); z-index: 46; }
#askTitle { text-align: center; font-size: 18px; font-weight: 700; }
#askName.on #nameIn { flex: none; width: 100%; font-size: 20px; padding: 14px 14px; text-align: center; border-radius: 14px; }
#askName.on #nameOk { width: 100%; font-size: 17px; padding: 13px 0; }

/* 그림 아이콘: 하트 · 닫기 (이모지·기호 대신) */
.ico-heart { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.ico-heart path { fill: #f28ba4; stroke: #d0708a; stroke-width: 1.2; stroke-linejoin: round; }
.ico-heart path.hl { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 1.6; stroke-linecap: round; }
.hrt .ico-heart { width: 13px; height: 13px; vertical-align: 0; }
.buy .ico-heart { width: 14px; height: 14px; margin-right: 1px; }
.ico-x { width: 16px; height: 16px; display: block; margin: auto; }
.ico-x path { fill: none; stroke: #8a6d55; stroke-width: 2.4; stroke-linecap: round; }
.ico-clock { width: 12px; height: 12px; display: inline-block; vertical-align: -1.5px; margin-right: 2px; }
.ico-clock circle, .ico-clock path { fill: none; stroke: #9b7d63; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ico-next { width: 16px; height: 16px; display: block; }
.ico-next path { fill: #c9a27e; }

.secTitle { font-size: 13px; font-weight: 700; opacity: .7; margin: 10px 4px 2px; }

/* 아래 버튼 그림: 색 있는 그림 아이콘 (선 아이콘 스타일을 덮어써요) */
#bar svg.pic { width: 30px; height: 30px; stroke: none; fill: initial; stroke-width: initial; }
#bar button.off svg.pic { opacity: .45; }

/* 아직 안 열린 버튼: 작은 자물쇠 */
#bar button.locked { position: relative; }
#bar svg.lockBadge { position: absolute; top: 4px; right: 10px; width: 16px; height: 16px; stroke: none; fill: initial; }

/* ---------- 계정 삭제 ---------- */
#delBox { position: absolute; inset: 0; background: rgba(60,45,30,.5); display: none; place-items: center; z-index: 61; padding: 16px; }
#delBox.on { display: grid; }
#delBox .card { width: min(340px, 100%); background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 14px; box-shadow: 0 4px 0 rgba(120,95,70,.18); }
#delBox h2 { margin: 0 0 6px; font-size: 18px; text-align: center; }
#delBox .sub { font-size: 13px; line-height: 1.55; margin: 0 0 10px; opacity: .85; }
#delBox .lbl { font-size: 12px; opacity: .75; margin-bottom: 6px; }
#delBox input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: inherit; font-size: 16px; text-align: center; background: #fff; }
#delBox .msg { min-height: 18px; font-size: 13px; color: #c0605a; text-align: center; margin: 8px 0 4px; }
#delBox .row { display: flex; gap: 8px; }
#delBox .row button { flex: 1; border: 1px solid var(--line); background: #fffdf8; border-radius: 12px; padding: 10px 0; font: inherit; font-size: 14px; }
#delBox #delGo { background: #e9978f; border-color: #d27f77; color: #fff; font-weight: 700; }
#delBox #delGo:disabled { opacity: .6; }
.buy.danger { background: #e9978f !important; border-color: #d27f77 !important; color: #fff !important; }
#delBox .row { border: 0; background: none; padding: 0; box-shadow: none; margin-top: 4px; }

/* ---------- 퀘스트 ---------- */
#bar button.dot::after { content: ''; position: absolute; top: 5px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: #f07a8e; border: 1.5px solid #fff8ec; }
#bar button { position: relative; }
#bar button:not(.locked) svg.lockBadge { display: none; }
.attend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 4px 0 8px; }
.aday { background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 6px 0 5px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; }
.aday small { font-size: 9.5px; opacity: .7; }
.aday b { font-size: 11.5px; display: flex; align-items: center; gap: 1px; }
.aday .ico-heart { width: 11px; height: 11px; }
.aday.best { background: #fff1f4; border-color: #f2a3b6; }
.aday.got { opacity: .45; background: #f3ead9; }
.aday.cur { border: 2px solid #f2a3b6; box-shadow: 0 0 0 3px rgba(242,163,182,.25); cursor: pointer; animation: aglow 1.4s ease-in-out infinite; }
@keyframes aglow { 50% { box-shadow: 0 0 0 5px rgba(242,163,182,.12); } }
.qbar { height: 6px; border-radius: 3px; background: #efe4d3; margin-top: 4px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: #9cc884; border-radius: 3px; }

/* 퀘스트 보상 버튼: 동전·하트 그림 + 숫자 */
.buy.reward { min-width: 74px; }
.buy.reward .rw { display: inline-flex; align-items: center; gap: 3px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.buy.reward .rw + .rw { margin-left: 6px; }
.buy.reward .ico-coin, .buy.reward .ico-heart { width: 16px; height: 16px; }
.ico-coin { display: inline-block; vertical-align: -3px; }

/* 여러 문장은 문장마다 줄바꿈 */
#toast { white-space: pre-line; text-align: center; border-radius: 16px; max-width: calc(100vw - 32px); }
#tutBar, #talkText { white-space: pre-line; }
.qnum { font-size: 12px; font-weight: 600; color: #8a6d55; margin-left: 4px; white-space: nowrap; }

/* ---------- 친구 ---------- */
#friendBtn { display: flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink); position: relative; }
#friendBtn svg { width: 24px; height: 18px; }
#friendBtn.dot::after { content: ''; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: #f07a8e; border: 1.5px solid #fff8ec; }
.btns { display: flex; gap: 6px; flex: none; }
.btns .buy { min-width: 58px; }
.findBox { display: flex; gap: 8px; margin: 4px 0 8px; }
.findBox input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: #fff; }
.findBox .buy { flex: none; min-width: 70px; }
#visitBar { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: none; align-items: center; gap: 8px; z-index: 15;
  background: rgba(255,248,236,.97); border: 1.5px solid #f2a3b6; border-radius: 18px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(208,112,138,.2); }
#visitBar b { flex: 1; font-size: 14px; line-height: 1.3; }
#visitBar .vbtns { display: flex; gap: 6px; }
#visitBar .buy { min-width: 0; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
#visitBar .ico-heart { width: 14px; height: 14px; vertical-align: -2px; }
body.visiting #visitBar { display: flex; }
body.visiting #bar, body.visiting #tutBar, body.visiting #coinPill, body.visiting #heartPill, body.visiting #friendBtn { display: none; }

/* 친구 팝업 */
.row.tappable { cursor: pointer; }
.row.tappable:active { transform: scale(.99); }
#friendPop { position: absolute; inset: 0; background: rgba(60,45,30,.45); display: none; place-items: center; z-index: 62; padding: 16px; }
#friendPop.on { display: grid; }
#friendPop .card { width: min(320px, 100%); background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px 12px; text-align: center; box-shadow: 0 4px 0 rgba(120,95,70,.18); }
#fpFace { display: block; margin: 0 auto; background: #fbefdc; border-radius: 18px; }
#friendPop h2 { margin: 8px 0 2px; font-size: 19px; }
#friendPop h2 small { font-size: 13px; opacity: .7; }
#friendPop .cafe { margin: 0; font-size: 14px; }
#friendPop .seen { margin: 2px 0 12px; font-size: 12px; opacity: .6; }
#friendPop .row { display: flex; gap: 8px; }
#friendPop .row .buy { flex: 1; padding: 11px 0; font-size: 14px; min-width: 0; }
#friendPop .row .ico-heart { width: 14px; height: 14px; vertical-align: -2px; }
#friendPop .row2 { display: flex; justify-content: space-between; margin-top: 10px; }
#friendPop .row2 button { font: inherit; font-size: 12px; background: none; border: none; color: #a58d78; padding: 6px 4px; }
#friendPop #fpUnfriend { color: #c0807a; }
#friendPop .row { border: 0; background: none; padding: 0; box-shadow: none; }

/* ---------- 버튼 파스텔톤 (초록이 촌스럽다는 의견) ---------- */
.buy { background: #bfe4d0; color: #3f6a55; box-shadow: 0 3px 0 #9ccab3; }
.buy:active { box-shadow: 0 1px 0 #9ccab3; }
.buy small { opacity: .85; }
.buy.unlock { background: #f9d9a6; color: #7a5530; box-shadow: 0 3px 0 #e8be7f; }
.buy.heart { background: #f9cfdb; color: #9a4c63; box-shadow: 0 3px 0 #eaa9bc; }
.buy:disabled { background: #e8dfd2; color: #a8998a; box-shadow: 0 3px 0 #d6cab9; }
.buy.danger { background: #f6c4bd !important; border-color: #e7a59c !important; color: #8f4a43 !important; box-shadow: 0 3px 0 #e7a59c !important; }
#linkBox #linkGo, #delBox #delGo { box-shadow: 0 3px 0 rgba(0,0,0,.08); }
#linkBox #linkGo { background: #bfe4d0; border-color: #9ccab3; color: #3f6a55; }
#delBox #delGo { background: #f6c4bd; border-color: #e7a59c; color: #8f4a43; }
#askName.on #nameOk { background: #f9d9a6; color: #7a5530; box-shadow: 0 3px 0 #e8be7f; }
.big { background: #f9d0a4; color: #7a5530; box-shadow: 0 4px 0 #e8b987; }
.qbar i { background: #a9d8bf; }
.bar i { background: #a9d8bf; }
/* 기본 버튼: 파스텔 노랑 (버터색) */
.buy { background: #fae5a6; color: #7a5a2a; box-shadow: 0 3px 0 #e8cb7e; }
.buy:active { box-shadow: 0 1px 0 #e8cb7e; }
#linkBox #linkGo { background: #fae5a6; border-color: #e8cb7e; color: #7a5a2a; }

/* 새 레시피 표시 */
.newTag { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; width: 16px; height: 16px; border-radius: 50%; background: #f48fa8; color: #fff; font-size: 10px; font-weight: 800; font-family: Arial, sans-serif; line-height: 1; vertical-align: 2px; box-shadow: 0 1px 0 #d9718c; }

/* 팝업이 좁은 폰 화면 밖으로 밀려나지 않게: 가로는 화면 안, 가운데 정렬 */
#linkBox, #delBox, #friendPop, #modal { grid-template-columns: minmax(0, 1fr); justify-items: center; }
#linkBox .card, #delBox .card, #friendPop .card { width: 100%; max-width: 340px; min-width: 0; box-sizing: border-box; }
#linkBox .sub, #linkBox .tip { word-break: keep-all; overflow-wrap: anywhere; }
#linkBox .code { font-size: clamp(20px, 7vw, 26px); letter-spacing: 2px; }
#linkBox input { min-width: 0; width: 100%; }
#linkBox .row button { min-width: 0; }

/* 처음 시작 물어보기 */
#startBox { position: absolute; inset: 0; background: rgba(60,45,30,.4); display: none; place-items: center; z-index: 58; padding: 16px; grid-template-columns: minmax(0, 1fr); justify-items: center; }
#startBox.on { display: grid; }
#startBox .card { width: 100%; max-width: 330px; background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 18px; text-align: center; box-shadow: 0 4px 0 rgba(120,95,70,.18); display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
#startArt { align-self: center; }
#startBox h2 { margin: 0; font-size: 20px; }
#startBox .sub { margin: 0 0 4px; font-size: 14px; opacity: .8; }
#startBox .buy { width: 100%; padding: 13px 0; font-size: 15px; }
#startBox .buy.ghost { background: #fffdf8; color: #7a6450; box-shadow: 0 3px 0 #e3d6c3; border: 1px solid #e3d6c3; }
#resumeBtn { display: none !important; }
.aday .ico-coin { width: 11px; height: 11px; vertical-align: 0; }
.aday b { gap: 2px; }
#toast { white-space: pre; width: max-content; max-width: calc(100vw - 24px); }   /* 문장 안에서는 줄을 안 바꿔요 (문장 사이에서만) */

/* 탭 빨간 점 · 탭 4개도 한 줄에 */
.tab { position: relative; }
.tab.tdot::after { content: ''; position: absolute; top: 4px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #f07a8e; }
#sheetTabs .tab { white-space: nowrap; font-size: 13px; padding-left: 4px; padding-right: 4px; min-width: 0; }

/* 아래 버튼 6개 */
#bar { gap: 6px; }
#bar button { font-size: 11px; padding-left: 0; padding-right: 0; min-width: 0; }
#bar svg.pic { width: 28px; height: 28px; }

/* 꾸미기: 프로필 아래 작은 버튼 (선으로 그린 배치도 그림) */
#hud .left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#btnEdit { pointer-events: auto; display: flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 999px; background: rgba(255,248,236,.94); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(120,95,70,.15); font: inherit; font-size: 12px; font-weight: 700; color: var(--ink); }
#btnEdit svg { width: 18px; height: 18px; fill: none; stroke: #8a6d55; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#btnEdit:active { transform: translateY(1px); }
body.editing #btnEdit, body.visiting #btnEdit { display: none; }

/* 꾸미기: 글자 없이 방 모서리 그림만 (동그란 버튼) */
#btnEdit { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
#btnEdit svg { width: 22px; height: 22px; stroke-width: 1.5; }

/* 꾸미기: 배경 없이 깔끔한 선 그림만 */
#btnEdit { width: 40px; height: 40px; background: none; border: none; box-shadow: none; border-radius: 0; margin-left: 4px; }
#btnEdit svg { width: 30px; height: 30px; stroke: #7a5e48; stroke-width: 1.7; filter: drop-shadow(0 1px 0 rgba(255,250,240,.9)); }

/* 위 칸: 프로필 · 친구 버튼은 눌려야 해요 (위 칸 전체는 화면 터치를 통과시켜요) */
#prof, #friendBtn { pointer-events: auto; }

/* 정산표 */
#modal.report #modalArt { display: none; }
#modal.report #modalMsg { text-align: left; color: var(--ink); line-height: 1.4; margin-bottom: 12px; }
.rpTime { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.rpList { max-height: 40vh; overflow-y: auto; background: #fffdf8; border: 1px dashed #d9c8b0; border-radius: 12px; padding: 4px 10px; }
.rpRow { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; border-bottom: 1px dotted #eadcc8; }
.rpRow:last-child { border-bottom: none; }
.rpRow span { flex: 1; }
.rpRow b { font-size: 15px; }
.rpIcon { width: 30px; height: 30px; }
.rpLine { border-top: 2px dashed #cdb89c; margin: 10px 0 6px; }
.rpSum { display: flex; justify-content: space-between; align-items: center; font-size: 15px; padding: 2px 4px; }
.rpSum b { font-size: 18px; display: flex; align-items: center; gap: 4px; }
.rpSum .ico-coin, .rpSum .ico-heart { width: 18px; height: 18px; }
.rpNote { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }

/* 알림 창: 아래 버튼 대신 위 닫기 */
#modal .card { position: relative; padding-bottom: 18px; }
#modalBtn { display: none; }
#modalX { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: #f3e6cf; border: none; }
#modal.report #modalMsg { margin-bottom: 0; }

.rpSnack { padding: 6px 10px 0; border-bottom: none; font-size: 13px; color: #b0716a; }
.rpSnack b { font-size: 14px; color: #b0716a; }

/* 동전 그림 + 숫자 */
.cn { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.cn .ico-coin { width: 1.05em; height: 1.05em; vertical-align: 0; }
.buy small .cn { justify-content: center; }

/* 물음표 설명 */
.qmark { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 5px; border-radius: 50%; border: 1px solid #cdb89c; background: #fffaf2; color: #9a7a60; font: inherit; font-size: 11px; font-weight: 700; vertical-align: 2px; padding: 0; }
.helpTxt { margin-top: 5px; padding: 7px 9px; border-radius: 10px; background: #fbf1e1; font-size: 12px; line-height: 1.45; color: #7a6450; }
/* 상점: 값만 보이는 버튼 */
.buy.price { font-size: 15px; }
.buy.price .coin, .buy.price svg { width: 16px; height: 16px; vertical-align: -3px; }

/* 아늑함 */
.ico-cozy { vertical-align: -3px; }
.row.cozyRow { background: #fff6ea; }
.row.cozyRow .name b { color: #d9708c; }

/* 상점: 바둑판 카드 */
.shopGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 8px; }
.row.shopCard { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 6px; margin: 0; text-align: center; min-width: 0; }
.row.shopCard canvas { align-self: center; width: 52px; height: 52px; }
.row.shopCard .info { min-width: 0; flex: 1 1 auto; }
.row.shopCard .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.shopCard .name small { font-size: 10.5px; }
.row.shopCard .desc { font-size: 11px; white-space: nowrap; }
.row.shopCard .buy { width: 100%; min-width: 0; padding: 6px 0; font-size: 12.5px; }
/* 칸 사이 틈 없이, 연한 선 하나로 나눠요 */
.shopGrid { gap: 0; border-top: 1px solid #f1e7d8; border-left: 1px solid #f1e7d8; background: #fff; border-radius: 12px; overflow: hidden; }
.row.shopCard { border: 0; border-right: 1px solid #f1e7d8; border-bottom: 1px solid #f1e7d8; border-radius: 0; box-shadow: none; width: auto; background: #fff; }
.row.shopCard::before, .row.shopCard::after { display: none; }

.limTag { display: inline-block; margin-left: 3px; padding: 0 4px; border-radius: 6px; background: #f07a7a; color: #fff; font-size: 9.5px; line-height: 14px; vertical-align: 1px; font-weight: 700; }

/* 출석 달력: 칸 사이 틈 없이 연한 선 · 출석한 날엔 발바닥 도장 */
.cal { background: #fff; border: 1px solid #f1e7d8; border-radius: 14px; overflow: hidden; margin: 2px 0 8px; }
.calHead { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 12px 6px; }
.calHead b { font-size: 16px; }
.calHead span { font-size: 12px; color: #d9708c; font-weight: 700; }
.calGrid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid #f1e7d8; }
.calW { text-align: center; font-size: 11px; padding: 3px 0; color: #9a8673; background: #fffaf2; border-bottom: 1px solid #f1e7d8; }
.calW.sun, .calD.sun i { color: #e07a7a; } .calW.sat, .calD.sat i { color: #6f9fcf; }
.calD { position: relative; aspect-ratio: 1; border-right: 1px solid #f6efe4; border-bottom: 1px solid #f6efe4; }
.calD:nth-child(7n) { border-right: 0; }
.calD i { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: 10.5px; color: #8a7663; }
.calD.miss i { opacity: .4; }
.calD.empty { background: #fdfaf5; }
.calD .stamp { position: absolute; left: 12%; top: 14%; width: 76%; height: 76%; }
.calD.today { background: #fff4f6; box-shadow: inset 0 0 0 2px #f2a3b6; }
.calD.today:not(.got) { cursor: pointer; animation: aglow2 1.4s ease-in-out infinite; }
@keyframes aglow2 { 50% { box-shadow: inset 0 0 0 2px #f2a3b6, inset 0 0 0 5px rgba(242,163,182,.25); } }
.calRw { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 9.5px; display: flex; align-items: center; justify-content: center; gap: 1px; white-space: nowrap; }
.calRw svg { width: 10px; height: 10px; }
.stampIn { animation: stampIn .6s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes stampIn { 0% { opacity: 0; scale: 2.2; } 55% { opacity: 1; scale: .9; } 100% { opacity: 1; scale: 1; } }
.calD.bigRw { background: #fff6f8; }
.calD.got .calRw { opacity: .45; }
.calRw .rw { display: inline-flex; align-items: center; gap: 1px; }
.calD .stamp { z-index: 1; }
.calD.today { box-shadow: inset 0 0 0 2px #f6c3cf; }
/* 보상 그림은 칸 가운데 크게, 도장은 그 위에 꾹 */
.calRw { top: 14px; bottom: 2px; flex-direction: column; gap: 0; font-size: 10px; font-weight: 700; color: #8a6f58; }
.calRw .rw { flex-direction: column; gap: 0; line-height: 1.1; }
.calRw svg { width: 18px !important; height: 18px !important; }
.calD .stamp { left: 10%; top: 12%; width: 80%; height: 80%; }
.calD.got .calRw { opacity: .55; }

.row.shopCard .newTag { margin-left: 3px; width: 13px; height: 13px; font-size: 8.5px; vertical-align: 1px; }
.row.qrow .name { font-size: 13.5px; white-space: nowrap; }
.row.qrow .qnum { font-size: 11px; }
.row.qrow .buy { min-width: 68px; padding: 7px 8px; font-size: 13px; }
.calD.got .calRw { display: none; }   /* 도장 밑 보상 그림이 비쳐서 발바닥이 뭉개 보이지 않게 */

/* 모든 버튼: 글씨·동전·하트를 한 덩어리로 딱 가운데에 (아래 그림자 턱만큼 1px 내려서 눈으로 보기에 가운데) */
.buy { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px; text-align: center; line-height: 1.1; padding-top: 8px; padding-bottom: 8px; }
.buy:has(> small) { flex-direction: column; gap: 0; }
.buy .bl { display: inline-flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.buy .bl .cn, .buy .bl .rw { display: inline-flex; align-items: center; gap: 2px; }
.buy .ico-coin, .buy .ico-heart { vertical-align: 0; flex: none; }
.buy small { margin-top: 1px; }
.tab { display: inline-flex; align-items: center; justify-content: center; line-height: 1.1; padding-top: 9px; padding-bottom: 8px; }
#bar button { justify-content: center; }
/* 출석 달력 하트·동전 크게 */
.calRw svg.ico-heart { width: 24px !important; height: 24px !important; }
.calRw svg.ico-coin { width: 21px !important; height: 21px !important; }
.calRw { font-size: 11px; }

.rpFace { width: 34px; height: 26px; flex: none; margin: -2px 0 -2px -4px; animation: rpPop .5s cubic-bezier(.3,1.6,.5,1) .35s both; transform-origin: 50% 100%; }
@keyframes rpPop { 0% { transform: scale(.2) translateY(6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rpSnack { align-items: center; }

#sheetBack { display: none; width: 34px; height: 34px; border-radius: 50%; background: #f3e6cf; margin-right: 8px; flex: none; }
#sheetBack.on { display: block; }
#sheetTitle { flex: 1; }

/* 오늘 칸 테두리: 달력 모서리에 잘리지 않게 칸 안쪽에 둥근 테두리로 */
.calD.today, .calD.today:not(.got) { box-shadow: none; animation: none; }
.calD.today::after { content: ''; position: absolute; inset: 2px; border: 2px solid #f6c3cf; border-radius: 9px; pointer-events: none; }
.calD.today:not(.got)::after { animation: todayGlow 1.4s ease-in-out infinite; }
@keyframes todayGlow { 50% { border-color: #f2a3b6; box-shadow: 0 0 0 2px rgba(242,163,182,.2); } }

.calD.miss .calRw { opacity: .4; filter: grayscale(.7); }   /* 놓친 날: 받을 수 있었던 보상을 흐리게 */
.calD.miss.bigRw { background: #fbf8f4; }

/* 내 가게 통계 */
.row.statLv .name { font-size: 17px; }
.row.statLv .info { flex: 1; }
.row.statLv .qnum { display: block; margin: 4px 0 0; font-size: 11.5px; }
.statGrid { margin-top: 2px; grid-template-columns: repeat(3, 1fr); }
.row.statCard { padding: 12px 6px 10px; gap: 2px; }
.statV { font-size: 18px; font-weight: 700; color: #7a5a2a; display: flex; justify-content: center; align-items: baseline; gap: 1px; white-space: nowrap; }
.statV small { font-size: 11px; color: #a8998a; }
.statV .cn { font-size: 16px; }
.statL { font-size: 11.5px; color: #9a8673; }

#starTxt { display: inline-flex; align-items: center; gap: 1px; margin-left: 6px; font-size: 11.5px; color: #a07a2c; font-weight: 700; vertical-align: 1px; }
.ico-star { width: 12px; height: 12px; }
.statV .ico-star { width: 16px; height: 16px; }

.ico-check { width: 18px; height: 18px; display: block; }
.buy.learnedOk { background: #eef6e8; box-shadow: 0 3px 0 #d6e8cc; }

/* 내 가게 통계 팝업 */
#modal.stats #modalArt { display: none; }
#modal.stats #modalMsg { margin: 4px 0 0; }
.stLv { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.stLv b { font-size: 18px; color: var(--ink); white-space: nowrap; }
.stBar { position: relative; flex: 1; height: 18px; border-radius: 9px; background: #efe4d3; overflow: hidden; }
.stBar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#bfe6cf, #9fd3b6); border-radius: 9px; }
.stBar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; font-weight: 700; color: #5d7f6c; }
.stGrid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #f1e7d8; border-radius: 12px; overflow: hidden; background: #fff; }
.stGrid > div { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 2px 8px; border-right: 1px solid #f1e7d8; border-bottom: 1px solid #f1e7d8; }
.stGrid > div:nth-child(3n) { border-right: 0; } .stGrid > div:nth-last-child(-n+3) { border-bottom: 0; }
.stGrid b { font-size: 16px; color: #7a5a2a; display: inline-flex; align-items: baseline; gap: 1px; white-space: nowrap; }
.stGrid b small { font-size: 10.5px; color: #a8998a; }
.stGrid b .ico-star { width: 14px; height: 14px; align-self: center; }
.stGrid > div > small { font-size: 11px; color: #9a8673; }
/* 돈 · 하트 말풍선 */
#pillTip { position: fixed; z-index: 60; max-width: 220px; padding: 7px 12px; border-radius: 12px; background: rgba(74,59,44,.88); color: #fff8ec; font-size: 12.5px; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none; word-break: keep-all; }
#pillTip.on { opacity: 1; transform: none; }
#pillTip::before { content: ''; position: absolute; top: -5px; right: 18px; border: 5px solid transparent; border-top: 0; border-bottom-color: rgba(74,59,44,.88); }
#coinPill, #heartPill { cursor: pointer; pointer-events: auto; }

.buy.stCloset { width: 100%; margin-top: 12px; padding: 10px 0; font-size: 14px; }

/* 광고 버튼 (앱에서만 보여요) */
.ico-ad { width: 18px; height: 18px; }
.buy.adBtn { background: #e8f1fb; color: #4f6f8f; box-shadow: 0 3px 0 #c6d8ec; }
.buy.adBtn small { color: #6f8fae; }
.buy.rpAd { width: 100%; margin-top: 12px; padding: 10px 0; font-size: 14px; gap: 4px; }

.spRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 15px; }
.spRow small { font-size: 12px; color: #a08b77; margin-left: 4px; }
.spRow .buy { min-width: 64px; padding: 7px 12px; font-size: 13.5px; }
.spSw { position: relative; flex: none; width: 52px; height: 30px; border-radius: 15px; border: 1px solid #cdbfae; background: #e8dfd2; transition: background .2s; }
.spSw i { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .2s; }
.spSw.on { background: #93b97b; border-color: #7aa465; }
.spSw.on i { left: 24px; }
.spRange { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 2px 0 10px; border-radius: 4px; background: linear-gradient(90deg, #c99a6a var(--p), #e8dfd2 var(--p)); outline: none; }
.spRange::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #c99a6a; border: 2px solid #fff8ec; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.spRange::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #c99a6a; border: 2px solid #fff8ec; }
.spVer { margin: 10px 0 0; text-align: center; font-size: 12px; color: #a08b77; }

/* 친구: 접속 점 · 친구 버튼 얼굴 */
.frFace { position: relative; flex: none; display: inline-block; line-height: 0; }
.frFace i { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #c9c2b8; border: 2px solid #fff; }
.frFace i.on { background: #7cc46a; }
#friendBtn { min-width: 0; padding: 2px 10px; }
#friendBtn .frIco { display: block; }
/* 프로필 팝업: 가로 줄 */
.stList { border: 1px solid #f1e7d8; border-radius: 12px; background: #fff; overflow: hidden; }
.stList > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f6efe4; }
.stList > div:last-child { border-bottom: 0; }
.stList small { font-size: 12.5px; color: #9a8673; }
.stList b { font-size: 15px; color: #7a5a2a; display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.stList b small { font-size: 11px; color: #a8998a; }
.stList b .ico-star { width: 14px; height: 14px; align-self: center; }
/* 아래 창: 화면 절반쯤 · 넘치면 안에서 스크롤 · 부드럽게 올라와요 */
#sheet .panel { max-height: 56%; transition: transform .38s cubic-bezier(.22,1,.36,1); }
#sheetBg { transition: opacity .3s; }
#sheet.on #sheetBody { animation: sheetIn .4s ease-out both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* 팝업: 톡 튀어나와요 */
#modal.on .card, #linkBox.on .card, #delBox.on .card, #friendPop.on .card { animation: popIn .32s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.9) translateY(8px); } to { opacity: 1; transform: none; } }

/* 페인트 */
.paintRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 10px 4px 14px; }
.paintDot { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fffaf2; box-shadow: 0 0 0 1px #d9c7ae, 0 3px 0 rgba(120,95,70,.18); display: grid; place-items: center; }
.paintDot svg { width: 26px; height: 26px; }
.paintDot.on { box-shadow: 0 0 0 3px #f2a3b6, 0 3px 0 rgba(120,95,70,.18); }
#sheetTitle small.cn { font-size: 13px; color: #a07a2c; margin-left: 6px; vertical-align: 2px; }
#editPaint { min-width: 46px; padding: 7px 10px; }

#toast svg { width: 16px; height: 16px; vertical-align: -3px; }
#toast .cn svg { width: 15px; height: 15px; }
.rpTime svg { width: 14px; height: 14px; vertical-align: -2px; }
.rpMade { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; font-size: 13px; color: #8a6d55; }
.rpMade span { display: inline-flex; align-items: center; gap: 1px; }
.rpMade .rpIcon { width: 22px; height: 22px; }

.row.shopCard.locked canvas { opacity: .45; filter: grayscale(.6); }
.buy .ico-check { width: 15px; height: 15px; }

/* 프로필 팝업 */
.pfFace { display: block; width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff8ee, #fbe3d6); border: 3px solid #fff; box-shadow: 0 0 0 1px #ecd9c4, 0 3px 0 rgba(120,95,70,.15); }
.pfName { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 10px; }
.pfName b { font-size: 18px; color: var(--ink); }
.pfName input { width: 130px; font: inherit; font-size: 16px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); text-align: center; }
.pfName .buy { min-width: 0; padding: 7px 10px; font-size: 13px; }
.pfIco { width: 30px; height: 30px; border-radius: 50%; border: none; background: #f3e6cf; display: grid; place-items: center; }
.pfIco svg { width: 17px; height: 17px; }
.pfBtns { display: flex; justify-content: center; gap: 12px; margin: 4px 0 10px; }
.pfBtns .buy { min-width: 0; width: 52px; height: 44px; padding: 0; }
.pfBtns .buy svg { width: 26px; height: 26px; }
.pfBtns .buy.on { background: #f9d9a6; box-shadow: 0 3px 0 #e8be7f; }
#modal.stats h2#modalTitle { font-size: 14px; color: #a08b77; font-weight: 600; margin-top: 0; }

.row.shopCard .desc .sIco { width: 20px; height: 20px; vertical-align: -6px; margin-right: 2px; }

.pfBack { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; }
.pfTrophy { display: grid; place-items: center; margin: -2px 0 10px; }
.pfTrophy svg { width: 44px; height: 44px; }
/* 프로필 그림 버튼: 하단 버튼처럼 크림 바탕 · 얇은 테두리 */
.pfBtns .buy { width: 58px; height: 52px; background: rgba(255,248,236,.95); border: 1px solid var(--line); box-shadow: 0 3px 0 rgba(120,95,70,.18); border-radius: 16px; }
.pfBtns .buy svg { width: 38px; height: 38px; }
.pfTrophy svg { width: 52px; height: 52px; }

.seenDot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c9c2b8; }
.seenDot.on { background: #7cc46a; }

/* 아래 창 스크롤 막대 (넘칠 때만) */
#sheet .panel { position: absolute; }
#sheetScroll { position: absolute; right: 3px; width: 4px; border-radius: 2px; background: rgba(200,180,150,.25); display: none; pointer-events: none; }
#sheetScroll.on { display: block; }
#sheetScroll i { display: block; width: 4px; border-radius: 2px; background: rgba(160,125,90,.55); }

.upIco { align-self: center; width: 52px; height: 52px; border-radius: 10px; background: #fbf1e1; display: grid; place-items: center; }
.upIco svg { width: 40px; height: 40px; }
.row.shopCard .desc b { color: #c47548; }

/* 친구 랭킹 */
.rankNo { flex: none; min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #8a6d55; background: #f3e6cf; }
.rankNo.medal { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.15); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.row.rankMe { background: #fff6ea; border-color: #f2c48a; }

.lack { color: #d0605a; }

.row.qNext { opacity: .62; }
.row.qNext .desc { display: flex; align-items: center; gap: 3px; }
.row.qNext canvas { width: 40px; height: 40px; }

/* 상점 꾹 누르기 설명 */
.shopCard { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#cardTip { position: fixed; z-index: 60; padding: 9px 12px; border-radius: 14px; background: #fffaf2; border: 1px solid #ead9c2; box-shadow: 0 6px 18px rgba(120,85,55,.18); color: #6e5446; font-size: 13px; line-height: 1.45; opacity: 0; transform: translateY(4px) scale(.97); transition: opacity .15s, transform .15s; pointer-events: none; }
#cardTip.on { opacity: 1; transform: none; }
#cardTip b { display: block; font-size: 14px; margin-bottom: 2px; color: #5a4234; }

/* 설정: 카페 이름 바꾸기 */
.spRow .pfIco { flex: none; }
.cafeEdit { display: flex; align-items: center; gap: 6px; }
.cafeEdit input { width: 140px; font: inherit; font-size: 16px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.spRow .cafeEdit .buy { min-width: 0; padding: 7px 10px; }
.buy.free { background: #d9efe2; color: #4f8a68; box-shadow: 0 3px 0 #b5d9c3; }

/* 글자 입력 팝업: 화면 위쪽 (키보드에 안 가려요) */
#askPop { position: fixed; inset: 0; z-index: 90; background: rgba(60,45,30,.42); display: none; justify-content: center; align-items: flex-start; padding: max(12vh, 60px) 16px 0; }
#askPop.on { display: flex; }
#askPop .card { position: relative; width: min(320px, 100%); background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 16px; box-shadow: 0 6px 20px rgba(80,55,35,.22); display: flex; flex-direction: column; gap: 12px; }
#askPop .t { text-align: center; font-size: 16px; color: var(--ink); }
#askPop input { font: inherit; font-size: 17px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); text-align: center; outline: none; }
#askPop input:focus { border-color: #e0b884; }
#askPop .yes { align-self: stretch; padding: 10px; font-size: 15px; }
#askPop .x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: none; border-radius: 50%; background: #f3e6cf; display: grid; place-items: center; }
.findQ { flex: 1; min-width: 0; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.findQ.ph { color: #b9a58f; }
/* 이어하기 · 삭제 창: 입력할 땐 위쪽으로 */
#linkBox:focus-within, #delBox:focus-within { place-items: start center; padding-top: max(8vh, 40px); }

.nextSeat { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 12px; color: #a08b77; font-weight: 400; }
.nextSeat svg { width: 13px; height: 13px; }
.cozyRow .name small { font-size: 12px; color: #a08b77; }

/* 랭킹 트로피 · 메달 */
.rankNo.medal { background: none !important; box-shadow: none; width: 40px; height: 40px; }
.rankNo.medal svg { width: 40px; height: 40px; filter: drop-shadow(0 1.5px 0 rgba(120,90,60,.18)); }
#editDel { min-width: 0; padding: 6px 9px; }

.doneAt { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; color: #b08a3c; font-size: 11px; }
.row.shopCard .desc .doneAt { display: flex; justify-content: center; margin: 1px 0 0; }

.pfCafe { margin: -6px 0 10px; }
.pfCafe span { font-size: 14px; color: #a08b77; font-weight: 600; }
.pfCafe .pfIco { width: 26px; height: 26px; }
.pfCafe .pfIco svg { width: 13px; height: 13px; }
#modal.stats h2#modalTitle:empty { display: none; }
.pfName .pfIco { background: none; width: 22px; height: 22px; margin-left: -2px; }
.pfName .pfIco svg { width: 16px; height: 16px; }
.pfCafe .pfIco svg { width: 13px; height: 13px; }

.shopGrid .tutPick { position: relative; animation: tutPick 1.1s ease-in-out infinite; border-color: #f2a3b6 !important; }
@keyframes tutPick { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,139,164,.55); transform: scale(1); } 50% { box-shadow: 0 0 0 6px rgba(242,139,164,0); transform: scale(1.04); } }

#prevPop { position: fixed; inset: 0; z-index: 88; background: rgba(60,45,30,.42); display: none; justify-content: center; align-items: center; padding: 16px; }
#prevPop.on { display: flex; }
#prevPop .card { position: relative; width: min(300px, 100%); background: #fff8ec; border: 1px solid var(--line); border-radius: 22px; padding: 14px 14px 16px; box-shadow: 0 6px 20px rgba(80,55,35,.22); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#prevPop canvas { border-radius: 16px; background: radial-gradient(ellipse at 50% 60%, #fff3e2 0%, #f6e6d0 70%); }
#prevPop .t { font-size: 17px; color: var(--ink); }
#prevPop .t small { font-size: 12px; color: #a08b77; }
#prevPop .d { font-size: 13px; color: #a08b77; display: flex; align-items: center; gap: 3px; }
#prevPop .d svg { width: 15px; height: 15px; }
#prevPop .btns { align-self: stretch; display: flex; justify-content: center; margin-top: 4px; }
#prevPop .btns .buy { min-width: 140px; padding: 10px 16px; font-size: 15px; }
#prevPop .x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: none; border-radius: 50%; background: #f3e6cf; display: grid; place-items: center; z-index: 1; }

#lookBar { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: none; flex-direction: column; gap: 6px; z-index: 15; }
#lookBar.on { display: flex; }
#lookBar .tip { align-self: center; background: rgba(74,59,44,.8); color: #fff8ec; font-size: 13px; padding: 5px 14px; border-radius: 999px; }
#lookBar .row2 { display: flex; align-items: center; gap: 8px; background: rgba(255,248,236,.97); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(120,95,70,.18); }
#lookBar b { flex: 1; min-width: 0; font-size: 15px; }
#lookBar .btns { display: flex; gap: 8px; }
body.lookTry #bar, body.lookTry #tutBar { display: none; }

.streakRow .stDots { display: flex; gap: 5px; margin-top: 4px; }
.streakRow .stDots i { width: 14px; height: 14px; border-radius: 50%; background: #efe2cf; box-shadow: inset 0 1px 2px rgba(120,90,60,.2); }
.streakRow .stDots i.on { background: radial-gradient(circle at 35% 35%, #fff2b8, #f2c94c); box-shadow: 0 1px 2px rgba(200,150,40,.4); }

.seriesHd { margin-top: 10px; }
.seriesHd .buy { padding: 7px 12px; font-size: 13px; }
.seriesBuy { margin-bottom: 4px; }
.seriesBuy .name small { font-size: 12px; color: #d9768c; margin-left: 4px; }

#prof > div { visibility: hidden; }
#prof.on > div { visibility: visible; }

#diagBox { position: fixed; left: 6px; top: 70px; z-index: 9999; margin: 0; padding: 6px 8px; background: rgba(40,30,25,.78); color: #fff; font: 10px/1.45 monospace; border-radius: 8px; pointer-events: none; white-space: pre; }

/* 우편함: 보낸 하트 개수 */
.mailHeart { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; padding: 4px 12px; border-radius: 999px; background: #fde4ec; color: #b25a6c; font-weight: 700; font-size: 14px; }
.mailHeart .ico-heart { width: 15px; height: 15px; }

/* 꾸미기: 버튼은 모두 같은 크기 (그림 + 글씨 두 줄까지) */
#editBar .row2 { gap: 5px; padding: 8px 8px 9px; }
#editBar b { flex: 1 1 auto; min-width: 42px; font-size: 14px; }
#editBar .row2 > button { flex: 0 1 56px; min-width: 0; height: 48px; padding: 0 3px 4px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; line-height: 1.1; white-space: nowrap; overflow: hidden; }
#editBar .row2 > button svg { width: 18px; height: 18px; flex: none; }
#editBar .row2 > button small { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; opacity: .9; }
#editBar .row2 > button small svg { width: 11px; height: 11px; }
#editBar #editSell.sure { background: #f9cfdb; }
#editBar #editInv small { margin-left: 0; padding: 0 5px; border-radius: 999px; background: #f9cfdb; color: #9a4c63; font-weight: 700; }
.ico-box { width: 18px; height: 18px; flex: none; }

/* 설정: 알림 세부 (접었다 폈다) */
.spFold { margin-left: auto; margin-right: 8px; display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px 4px 10px; border-radius: 999px; background: #f3e6cf; color: var(--muted); font-size: 12px; font-weight: 700; }
.spFold svg { width: 12px; height: 12px; transition: transform .15s; }
.spFold.on svg { transform: rotate(180deg); }
.spSub { margin: -2px 0 6px 10px; padding: 2px 0 2px 12px; border-left: 2px solid #eadbc4; }
.spSub .spRow { padding-top: 7px; padding-bottom: 7px; }
.spSub .spRow span { font-size: 14px; }

/* 꾸미기 중 왼쪽 위 보관함 */
#editInv { display: none; pointer-events: auto; position: relative; align-items: center; gap: 4px; padding: 6px 12px 6px 9px; border-radius: 999px; background: rgba(255,248,236,.96); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(120,95,70,.15); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); }
body.editing #editInv { display: inline-flex; }
body.visiting #editInv { display: none !important; }
#editInv svg { width: 20px; height: 20px; }
#editInv i { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f28ba4; color: #fff; font-style: normal; font-size: 11px; line-height: 18px; text-align: center; box-shadow: 0 1px 0 rgba(150,60,80,.3); }

/* 스페셜 메뉴 (4시간 넘게) */
.spTag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: linear-gradient(#fbe3a0, #f3cb6a); color: #8a5c18; font-size: 10.5px; font-weight: 800; line-height: 16px; vertical-align: 1px; box-shadow: 0 1px 0 #d9a94a; }
.row.shopCard .spTag { margin-left: 3px; padding: 0 5px; font-size: 9.5px; line-height: 14px; }
/* 만드는 중 버리기 */
.buy.dropBtn { min-width: 0; padding-left: 8px; padding-right: 8px; }
.buy.dropBtn .ico-trash { width: 17px; height: 17px; }
.buy.dropBtn.sure { background: #f9cfdb; color: #9a4c63; box-shadow: 0 3px 0 #e3a9ba; }

.icoWrap { position: relative; display: inline-flex; flex: 0 0 auto; align-self: center; }
.spBand { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); padding: 0 4px; border-radius: 4px; background: #f6c84e; color: #fff; font-size: 7px; font-weight: 800; letter-spacing: .4px; line-height: 10px; white-space: nowrap; box-shadow: 0 1px 0 #c99a3a; font-family: Arial, sans-serif; }

.status.again { background: #f3f8ee; border-color: #cfe3c3; }
#editBar #editUndo svg { width: 18px; height: 18px; }
/* 카드 안 버튼 두 개 (보관함: 놓기 · 팔기) */
.row.shopCard .btns { width: 100%; gap: 4px; }
.row.shopCard .btns .buy { flex: 1 1 0; width: auto; min-width: 0; padding: 4px 0; font-size: 12px; }
.row.shopCard .btns .buy small { font-size: 10px; }
.row.shopCard .btns .buy { min-height: 38px; }

/* 웹 기다리기 (광고 대신) */
#waitPop { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(60,45,35,.45); }
#waitPop.on { display: flex; }
#waitPop .card { width: 230px; padding: 22px 18px 16px; border-radius: 22px; background: #fffaf2; border: 1px solid var(--line); text-align: center; position: relative; }
#waitPop .ring { width: 110px; height: 110px; transform: rotate(-90deg); }
#waitPop .ring circle { fill: none; stroke-width: 7; }
#waitPop .ring .bg { stroke: #f1e6d4; }
#waitPop .ring .fg { stroke: #8fcf9b; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
#waitPop .n { position: absolute; left: 0; right: 0; top: 62px; font-size: 30px; color: var(--ink); }
#waitPop p { margin: 10px 0 12px; color: var(--muted); font-size: 14px; }
.grantMsg { margin: 4px 0 10px; color: var(--ink); font-size: 14px; line-height: 1.5; }

/* 돋보기 (크게 미리 보기) */
.icoWrap .zoomBtn { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; padding: 2px; border-radius: 50%; background: #fffaf2; border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(120,95,70,.18); display: flex; align-items: center; justify-content: center; }
.icoWrap .zoomBtn svg { width: 15px; height: 15px; }

/* 기계 창 위 '만드는 중' 카드: 버튼이 여럿이어도 이름이 쪼개지지 않게 */
.status .info { min-width: 0; flex: 1 1 auto; }
.status .info .name { word-break: keep-all; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status .buy { min-width: 0; padding-left: 8px; padding-right: 8px; flex: none; }
.status .buy.adBtn, .status .buy.dropBtn, .status .buy.heart { min-width: 46px; }

/* 돈 · 하트 옆 + (광고 보고 받기) */
.pill .plusBtn { margin-left: auto; margin-right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #8fcf9b; box-shadow: 0 2px 0 #6fae7b; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.pill .plusBtn svg { width: 12px; height: 12px; }
.adRw .rwIco { width: 44px; height: 44px; border-radius: 12px; background: #fbf1e1; display: flex; align-items: center; justify-content: center; flex: none; }
.adRw .rwIco svg { width: 28px; height: 28px; }

.upAll { display: inline-block; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: #f3e6cf; color: var(--muted); font-size: 9.5px; }

#modal.must #modalX { display: none; }

.inqBox { display: flex; flex-direction: column; gap: 10px; }
.inqBox textarea { width: 100%; min-height: 150px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; -webkit-user-select: text; user-select: text; }
.inqBox .buy { align-self: flex-end; min-width: 110px; }
