/* 토미네 집 — 모바일 우선 */
:root {
  --cream: #f7efe6; --paper: #fffaf4; --ink: #5b4b45; --soft: #9a8a82;
  --lav: #c9b8e8; --lav-deep: #8f7cc8; --sky: #a9bfe6; --radius: 18px;
  --bar: calc(64px + env(safe-area-inset-bottom)); /* 구역 버튼 바 높이 */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #efe3f0; overscroll-behavior: none; }
body { color: var(--ink); font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; -webkit-tap-highlight-color: transparent;
  word-break: keep-all; overflow-wrap: anywhere; } /* 한글은 단어 중간에서 줄이 바뀌지 않게 (아주 긴 영화 제목 등만 예외) */
/* 작은 글씨: 문장이 끝나면 다음 줄로 (ui.js의 h가 줄바꿈을 넣어요), 줄 길이는 고르게 */
.tiny, .notice, .name-sub, .sheet-greet { white-space: pre-line; text-wrap: balance; }
.bubble p, .modal-text, .jar-msg, .entry-bubble, .crisis-msg { text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
#app { position: relative; width: 100%; max-width: 520px; height: 100dvh; margin: 0 auto; overflow: clip; background: #f1e6ef; box-shadow: 0 0 40px rgba(120, 90, 140, .15); }
#room { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none;
  background: radial-gradient(ellipse at 50% 40%, #fbf3ec 0%, #f2e6f0 55%, #e6d8ea 100%); }
/* 사진 같은 부드러운 가장자리 (비네팅) */
#app::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 90, 120, .12) 100%); }

/* 버튼 */
.btn { border: 0; border-radius: 999px; padding: 12px 18px; min-height: 46px; background: #efe6f5; font-size: 15px; cursor: pointer; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lav-deep); color: #fff; font-weight: 600; }
.btn.big { padding: 14px 44px; font-size: 17px; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.btn.ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.55); }
.btn.link { background: none; color: var(--soft); text-decoration: underline; min-height: 44px; }
.btn.danger { color: #b45c5c; }
.btn:disabled { opacity: .35; cursor: default; }
/* '그냥 들어갈래'는 항상 시트 맨 아래 같은 자리, 눈에 띄게 */
.btn.skip-main { width: 100%; background: #fff; border: 2px solid var(--lav-deep); color: var(--lav-deep); font-weight: 700; font-size: 16px; margin-top: 10px; position: sticky; bottom: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .btn { flex: 1; }
.row.between { justify-content: space-between; }
.row.between > .btn { flex: none; }
.row.wrap { flex-wrap: wrap; justify-content: center; }
.row.wrap > .btn { flex: none; }

/* 구역 이름표 (작아 보여도 손가락 영역은 44px 이상) */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.zone-label {
  position: absolute; left: 0; top: 0; border: 0; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 250, 244, .92); font-size: 12.5px; box-shadow: 0 2px 8px rgba(90, 70, 60, .15);
  transition: opacity .25s; cursor: pointer; white-space: nowrap;
}
.zone-label::before { content: ""; position: absolute; inset: -12px -6px; }

/* 말풍선: 화면 아래쪽 고정. 구역 버튼 바와 16px, 좌우 16px. 아이폰 홈 바를 피해요 */
#dialog {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--bar) + var(--kb, 0px) + 16px); z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; pointer-events: none;
}
#dialog.show { opacity: 1; transform: none; pointer-events: auto; }
.bubble {
  position: relative; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--paper); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 6px 18px rgba(90, 70, 60, .16);
  max-height: 35vh; overflow-y: auto;
}
.bubble::before { /* 꼬리: 위쪽의 토미를 향해요 */
  content: ""; position: absolute; top: -9px; left: 50%; margin-left: -9px;
  border: 9px solid transparent; border-top: 0; border-bottom-color: var(--paper);
}
.bubble.tappable { cursor: pointer; }
.bubble p { margin: 0; flex: 1 1 60%; font-size: 15.5px; line-height: 1.55; }
.b-face { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.b-image { width: 100%; max-height: 150px; object-fit: contain; order: 3; }
#choices { display: flex; flex-direction: column; gap: 6px; }
#choices:empty { display: none; }
#choices.grid-2, #choices.grid-3 { display: grid; }
#choices.grid-2 { grid-template-columns: repeat(2, 1fr); }
#choices.grid-3 { grid-template-columns: repeat(3, 1fr); }
#choices .lunch { grid-column: 1 / -1; width: 100%; }
.talk-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 1.5px solid #e6dcef; border-radius: 14px; background: rgba(255,255,255,.96); font-size: 14.5px; cursor: pointer; box-shadow: 0 2px 8px rgba(90,70,60,.08); }
.talk-btn.primary { background: var(--lav-deep); border-color: var(--lav-deep); color: #fff; font-weight: 600; }
.talk-btn img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.talk-btn:active { transform: scale(.97); }
.sheet-greet { margin: 0; font-size: 14.5px; line-height: 1.5; text-align: center; color: var(--soft); }

/* 전체 보기: 왼쪽 위 */
.overview-btn { position: absolute; left: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 4; opacity: 0; pointer-events: none; transition: .3s; background: rgba(255,250,244,.92); }
.overview-btn.show { opacity: 1; pointer-events: auto; }

/* 소리 켜기/끄기: 오른쪽 위 항상 같은 자리 */
.sound-btn { position: absolute; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 11; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,250,244,.92); font-size: 19px; cursor: pointer; box-shadow: 0 2px 8px rgba(90,70,60,.14); }
.sound-btn img { width: 30px; height: 30px; object-fit: contain; display: block; margin: auto; }
.sound-toggle img { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 4px; }
/* 선택지가 3개면 첫 버튼을 넓게 */
#choices.grid-2 .talk-btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
/* 첫 화면 아래 소리 안내 */
.sound-row { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--soft); }
.sound-toggle { border: 1.5px solid var(--lav); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 13px; color: var(--lav-deep); cursor: pointer; }
.sound-toggle.on { background: #f3ecfa; }
.name-sub { margin: 0; max-width: 320px; text-align: center; font-size: 14px; line-height: 1.55; }
.tiny.left { text-align: left; }
.diary-info { display: block; color: var(--soft) !important; font-size: 12px; }
.calendar-big { max-width: 100%; max-height: 72vh; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(90,70,60,.22)); }
.rest-hint { color: rgba(255,255,255,.65); margin-top: 18px; }
/* 구역 버튼 바 */
#zonebar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); scrollbar-width: none;
  background: linear-gradient(transparent, rgba(241, 230, 239, .95) 35%);
}
#zonebar::-webkit-scrollbar { display: none; }
#zonebar button { flex: none; min-width: 56px; min-height: 44px; border: 0; border-radius: 14px; background: rgba(255,250,244,.92); font-size: 14px; cursor: pointer; }
#zonebar button.on { background: var(--lav-deep); color: #fff; font-weight: 600; }

/* 알림 */
#toasts { position: absolute; left: 0; right: 0; top: calc(66px + env(safe-area-inset-top)); z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(70, 58, 80, .88); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; opacity: 0; transform: translateY(6px); transition: .3s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: none; }

/* 아래 시트 */
.sheet {
  position: absolute; left: 0; right: 0; bottom: calc(var(--bar) + var(--kb, 0px)); z-index: 7; max-height: 66%; overflow-y: auto;
  background: var(--paper); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 26px rgba(90, 70, 60, .14);
  padding: 18px 16px 12px; transform: translateY(calc(105% + var(--bar))); transition: transform .35s ease; border-radius: 24px;
}
.sheet.open { transform: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #e4d9d0; margin: -6px auto 12px; }
#sheet-body { display: flex; flex-direction: column; gap: 10px; }
.ask { margin: 0; font-size: 16px; font-weight: 600; text-align: center; }
.ask.left { text-align: left; }
.tiny { font-size: 12px; color: var(--soft); text-align: center; margin: 0; line-height: 1.5; }
.notice { font-size: 12px; color: var(--soft); text-align: center; margin: 6px 0 0; line-height: 1.5; }

.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chips.small { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid #e6dcef; background: #fff; border-radius: 14px; padding: 10px 8px; min-height: 44px; font-size: 15px; cursor: pointer; }
.chips.small .chip { padding: 8px 12px; font-size: 14px; }
.chip.on { border-color: var(--lav-deep); background: #f3ecfa; color: var(--lav-deep); font-weight: 600; }

/* 한 줄 쓰기 */
.paper { background: repeating-linear-gradient(#fffdf8 0 34px, #eee3d6 34px 35px); border-radius: 12px; padding: 12px 14px; box-shadow: inset 0 0 0 1px #efe4d6; }
.sentence { margin: 0; font-size: 17px; line-height: 1.9; }
.sentence b { color: var(--lav-deep); border-bottom: 2px solid var(--lav); padding: 0 2px; }
.sentence b.empty { border-bottom-style: dashed; }
.counter { margin: -4px 4px 0; text-align: right; font-size: 12px; color: var(--soft); }
.count.over { color: #c46a6a; }
.blank-label { margin: 4px 0 0; font-size: 13px; color: var(--soft); }
.direct { border: 1.5px solid var(--lav); border-radius: 12px; padding: 10px 12px; font-size: 16px; outline: none; background: #fff; }

/* 처방 차 */
.brewing { text-align: center; padding: 20px 0; }
.pot { position: relative; width: 70px; height: 50px; margin: 30px auto 10px; background: var(--sky); border-radius: 0 0 26px 26px; }
.pot span { position: absolute; bottom: 52px; width: 10px; height: 26px; border-radius: 10px; background: rgba(200, 190, 220, .7); animation: steam 1.4s ease-in-out infinite; }
.pot span:nth-child(1) { left: 14px; } .pot span:nth-child(2) { left: 30px; animation-delay: .3s; } .pot span:nth-child(3) { left: 46px; animation-delay: .6s; }
@keyframes steam { 0% { transform: translateY(8px) scaleY(.6); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-14px) scaleY(1.1); opacity: 0; } }
.rx-card { background: linear-gradient(160deg, #fff, #f6effc); border-radius: 18px; padding: 18px; text-align: center; border: 1.5px dashed #d9cbef; }
.rx-label { margin: 0; font-size: 12.5px; color: var(--lav-deep); font-weight: 700; }
.rx-title { margin: 6px 0; font-size: 18px; font-weight: 700; }
.rx-text { margin: 0; font-size: 16px; line-height: 1.5; }
.tommy-line, .prop-line { margin: 0; font-size: 14.5px; line-height: 1.55; background: #f8f2fb; padding: 10px 12px; border-radius: 12px; }

/* 용기 병 */
.jar-canvas { width: 64%; max-width: 280px; margin: 0 auto; display: block; border-radius: 20px; }
.jar-canvas.big { width: 78%; max-width: 340px; }
.jar-count { margin: 0; text-align: center; font-weight: 700; }
.jar-msg { min-height: 3em; margin: 0; text-align: center; font-size: 15.5px; line-height: 1.55; color: var(--ink); }

/* 모달 (전체 화면 위) */
.modal { position: absolute; inset: 0; z-index: 9; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: calc(62px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); background: rgba(250, 244, 238, .97); }
.modal.open { display: flex; }
.modal .scroll { width: 100%; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .scroll.center { align-items: center; text-align: center; }
.modal-text { margin: 0; text-align: center; font-size: 16px; line-height: 1.6; }
.modal.sheetlike { justify-content: flex-start; }

/* 입장 */
.modal.entry { background: #f6ede6; }
.door { width: 82%; max-width: 330px; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 28px rgba(90, 70, 60, .16); animation: peek 1.2s ease both; }
.door img { width: 100%; height: 100%; object-fit: cover; }
@keyframes peek { from { clip-path: inset(0 0 0 70%); transform: translateX(6%); } to { clip-path: inset(0 0 0 0); transform: none; } }
.entry-bubble { background: var(--paper); border-radius: var(--radius); padding: 12px 16px; font-size: 15.5px; line-height: 1.55; box-shadow: 0 6px 18px rgba(90, 70, 60, .12); max-width: 340px; text-align: center; animation: fadeUp .5s .9s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.name-tommy { width: 120px; height: 120px; border-radius: 50%; }
.name-input { width: 100%; max-width: 300px; border: 1.5px solid var(--lav); border-radius: 14px; padding: 12px 14px; font-size: 16px; text-align: center; background: #fff; outline: none; }
.modal.entry .btn { min-width: 240px; }

/* 그냥 있기 */
.modal.rest { background: #3d3446; color: #fff; }
.rest-tommy { width: 150px; height: 150px; border-radius: 50%; opacity: .85; filter: brightness(.85); }
.breath { width: 140px; height: 140px; margin-top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,236,200,.45), transparent 70%); animation: breath 6s ease-in-out infinite; pointer-events: none; }
@keyframes breath { 0%, 100% { transform: scale(.8); opacity: .4; } 50% { transform: scale(1.6); opacity: .9; } }
.modal.rest .btn.link { color: rgba(255,255,255,.6); }
/* 같이 있기 화면: 그림 + 테마 (담요 / 쉬기 / 책 / 영화) */
.together-pic { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; flex: none; }
.together-pic img { width: 100%; height: 100%; object-fit: cover; opacity: .88; filter: brightness(.88); }
.modal.rest.book { background: radial-gradient(circle at 50% 35%, #6e5a4c, #3a3038 70%); }
.modal.rest.book .together-pic { width: 190px; height: 238px; border-radius: 24px; }
.modal.rest.book .together-pic img { object-position: center 30%; filter: none; opacity: 1; }
.modal.rest.book .breath { background: radial-gradient(circle, rgba(255,214,150,.45), transparent 70%); }
.modal.rest.movie { background: #262130; }
.modal.rest.movie .together-pic { box-shadow: 0 0 40px rgba(170, 200, 255, .45); animation: screen 3.2s ease-in-out infinite; }
.modal.rest.movie .breath { background: radial-gradient(circle, rgba(170,200,255,.4), transparent 70%); }
@keyframes screen { 0%, 100% { box-shadow: 0 0 30px rgba(170,200,255,.35); } 40% { box-shadow: 0 0 55px rgba(255,210,230,.55); } 70% { box-shadow: 0 0 40px rgba(190,240,210,.45); } }
/* 책 읽기: 그림 + 타임타이머 나란히 */
.together-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.modal.rest.book .together-row .together-pic { width: 150px; height: 188px; }
.modal.rest.book .together-pic img { object-fit: contain; }
.time-timer { position: relative; width: 136px; height: 136px; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.time-timer img { width: 100%; height: 100%; display: block; }
.timer-hand { position: absolute; inset: 0; width: 100%; height: 100%; }
.modal.rest.study { background: radial-gradient(circle at 50% 35%, #6a5f76, #3a3442 72%); }
.modal.rest.study .together-pic { width: 112px; height: 190px; border-radius: 0; overflow: visible; }
.modal.rest.study .together-pic img { object-fit: contain; opacity: 1; filter: none; }
.read-info { margin: 2px 0 0; font-size: 13.5px; color: #f1e3d2; text-align: center; }
.pages { font-weight: 600; }
.btn.ghost.ready { background: rgba(255,235,200,.3); border-color: #ffe6b8; animation: bob 1.6s ease-in-out infinite; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.chip.wide { width: 100%; font-size: 16px; padding: 13px; }
.rest-line { min-height: 3.2em; max-width: 300px; margin: 6px 0 4px; text-align: center; font-size: 16px; line-height: 1.6; color: #f6ecdf; opacity: 0; transform: translateY(6px); transition: opacity 1.2s ease, transform 1.2s ease; }
.rest-line.show { opacity: 1; transform: none; }
.door img { object-position: center 30%; }

/* 욕실 거울 외치기 */
.modal.mirror { background: linear-gradient(#f6f0f4, #eef1f8); }
.mirror-frame { position: relative; width: 210px; height: 210px; border-radius: 50%; overflow: hidden; border: 14px solid #ecd2ad; box-shadow: 0 10px 26px rgba(90, 70, 60, .18), inset 0 0 0 2px rgba(255,255,255,.6); background: #dfe8f5; }
.mirror-frame img { width: 100%; height: 100%; transform: scaleX(-1); opacity: .9; }
.mirror-shine { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.55) 0 18%, transparent 18% 30%, rgba(255,255,255,.3) 30% 36%, transparent 36%); }
.mirror-count { margin: 4px 0 0; min-height: 1.4em; font-size: 18px; color: var(--lav-deep); font-weight: 700; }
.mirror-word { margin: 0; font-size: 26px; font-weight: 800; text-align: center; line-height: 1.35; }
.mirror-word.pop { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.7); opacity: .4; } to { transform: none; opacity: 1; } }

.chip.span-all { grid-column: 1 / -1; }
/* 거울 보며 같이 웃기: 얼굴만, 좌우 뒤집기, 옅은 반사광 */
.mirror-frame.smile { width: min(72vw, 300px); height: min(72vw, 300px); background: linear-gradient(160deg, #eef3fb, #dfe7f4); }
.smile-face { position: absolute; inset: 0; animation: smileIn .5s ease both, smileBreath 3.4s ease-in-out .5s infinite; }
.mirror-frame .smile-face img { position: absolute; width: 112%; height: auto; left: -6%; top: 5%; opacity: 1; transform: scaleX(-1); }
.mirror-glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.26) 0 16%, transparent 16% 27%, rgba(255,255,255,.14) 27% 31%, transparent 31%); }
@keyframes smileIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes smileBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.mirror-after { min-height: 1.6em; margin: 6px 0 0; font-size: 17px; font-weight: 600; text-align: center; opacity: 0; transition: opacity .4s; }
.mirror-after.show { opacity: 1; }
/* 공부 타이머: 크게, 방은 뒤로 흐리게 */
.modal.study-big { background: rgba(70, 60, 82, .5); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); gap: 6px; overflow: hidden; }
.time-timer.big { margin: -44px 0 -40px; }
.study-row { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.study-side { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.study-tommy { height: 112px; width: auto; transform-origin: 50% 100%; filter: drop-shadow(0 3px 6px rgba(0,0,0,.2)); }
.study-tommy.nod { animation: nod 1.1s ease-in-out; }
@keyframes nod { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(3deg) translateY(1px); } 65% { transform: rotate(-1deg); } }
.study-digits { border: 0; background: none; color: #fff; font-size: 16px; min-width: 88px; min-height: 44px; cursor: pointer; font-variant-numeric: tabular-nums; }
.study-digits.hide span { opacity: 0; }
.modal.rest.blanket .together-pic { width: 200px; height: 217px; border-radius: 0; overflow: visible; }
.modal.rest.blanket .together-pic img { object-fit: contain; opacity: 1; filter: brightness(.92); }

/* 소파에 같이 앉기: 살짝 어둡게, 버튼 두 개만 */
.modal.sofa-sit { background: rgba(45, 35, 55, .36); justify-content: flex-end; padding-bottom: calc(var(--bar) + 16px); }
.modal.sofa-sit .btn { width: 100%; max-width: 320px; }
.modal.sofa-sit .sofa-hint { color: #fff; font-size: 14px; margin: 0 0 6px; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
.modal.sofa-sit .btn.ghost { background: rgba(255,255,255,.2); }
/* 방 안에 잠깐 뜨는 작은 안내 (창문, 용기 병) */
#floats { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.float-label { position: absolute; left: 0; top: 0; max-width: 220px; padding: 7px 12px; border-radius: 12px; background: #fffdf6; color: var(--ink); font-size: 13px; line-height: 1.4; border: 0; box-shadow: 0 3px 10px rgba(90,70,60,.2); opacity: 0; transition: opacity .4s; pointer-events: auto; cursor: pointer; }
.float-label.show { opacity: 1; }
/* 용기 병 진행도 라벨 */
.jar-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 12px; border-radius: 999px; background: #fffaf4; font-weight: 700; font-size: 15px; box-shadow: 0 2px 8px rgba(90,70,60,.12); }
.jar-label img { width: 24px; height: 24px; object-fit: contain; }
.gift-img.tappable { cursor: pointer; }
.modal.gift .flip { width: min(52vw, 210px); }
.chip-row-head { display: flex; align-items: center; justify-content: space-between; }
.chip-more { border: 0; background: none; color: var(--lav-deep); font-size: 12.5px; min-height: 32px; cursor: pointer; }

/* 오늘의 카드 */
.today-card { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 22px rgba(90, 70, 60, .12); }
.today-card img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 35%; display: block; }
.card-body { padding: 14px 18px 18px; }
.card-date { margin: 0; font-size: 12px; color: var(--soft); }
.card-mood { margin: 2px 0 8px; font-size: 13px; color: var(--lav-deep); font-weight: 700; }
.card-line { margin: 0 0 8px; font-size: 15.5px; line-height: 1.5; }
.card-reaction { margin: 0; font-size: 15.5px; line-height: 1.6; background: #f8f2fb; padding: 10px 12px; border-radius: 12px; }

/* 선물 상자, 쪽지 */
.gift-img { width: 180px; animation: bob 1.6s ease-in-out infinite; }
.gift-img.open { animation: openBox .7s ease forwards; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes openBox { 30% { transform: rotate(-8deg) scale(1.05); } 60% { transform: rotate(8deg) scale(1.1); } 100% { transform: scale(1.3); opacity: 0; } }
.note { background: #fffdf6; border-radius: 6px; padding: 18px; max-width: 320px; font-size: 15.5px; line-height: 1.7; box-shadow: 0 6px 18px rgba(0,0,0,.1); transform: rotate(-1.5deg); animation: fadeUp .5s both; }
.note p { margin: 0; }

/* 부적카드 (앞뒤 뒤집기, 5:9) */
.flip { width: min(62vw, 250px); aspect-ratio: 5 / 9; perspective: 1200px; cursor: pointer; flex: none; }
.flip.rise { animation: rise .9s cubic-bezier(.2,.8,.3,1) both; }
@keyframes rise { from { transform: translateY(60px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .7s; transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 8px 14px rgba(90, 70, 60, .2)); }
.face img { width: 100%; height: 100%; display: block; }
.face.back { transform: rotateY(180deg); }
.card-name { position: absolute; display: flex; align-items: center; justify-content: center; font-family: "Gaegu", "Nanum Pen Script", "Malgun Gothic", sans-serif; font-weight: 600; }
.card-name span { white-space: nowrap; line-height: 1; }

/* DREAM 책 */
.modal.book { justify-content: flex-start; }
.modal.book h2 { margin: 0; font-size: 19px; }
.modal.book h3 { margin: 10px 0 0; font-size: 15px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-card { border: 0; padding: 0; background: none; aspect-ratio: 5 / 9; cursor: pointer; }
.mini-card img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,.12)); }
.mini-card.locked { cursor: default; }
.mini-card.locked img { filter: brightness(0) opacity(.18); }
.records { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 14px; }
.records small { color: var(--lav-deep); }
.records-box { background: #fff; border-radius: 14px; padding: 10px 14px; }
.records-box summary { cursor: pointer; color: var(--soft); font-size: 14px; min-height: 30px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; min-height: 44px; }
.toggle input { width: 20px; height: 20px; }
.modal.book .name-input { text-align: left; }

/* 꿈 노트 */
.modal.dream { background: rgba(238, 243, 252, .98); }
.dream-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; line-height: 1.5; }
.dream-line img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.dream-input { width: 100%; box-sizing: border-box; }
.dream-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dream-list li { background: #fff; border-radius: 14px; padding: 10px 12px; }
.dream-list p { margin: 0 0 4px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.dream-list small { color: var(--soft); }
.dream-list li.done p { color: var(--lav-deep); }
.dream-list li.done p::before { content: '★ '; }
.dream-btns { display: flex; gap: 6px; }

/* 위기 안내 */
.modal.crisis { background: #faf7f3; }
.crisis-msg { font-size: 17px; line-height: 1.75; margin: 0 0 6px; max-width: 360px; }
.crisis-lead { margin: 6px 0 0; font-size: 15px; color: var(--soft); }
.contact { display: block; width: 100%; max-width: 340px; text-decoration: none; color: #fff; background: #7f9fd0; padding: 13px 15px; border-radius: 14px; font-size: 16px; font-weight: 700; }
.contact small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; opacity: .85; }

/* 로딩 */
#loading { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #f6ede6; transition: opacity .5s; }
#loading img { width: 96px; height: 96px; border-radius: 50%; animation: bob 1.4s ease-in-out infinite; }
#loading p { color: var(--soft); font-size: 14px; }
#loading.hide { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 달력 확대: 옆으로 넘겨 1~12월 (2026-11-06) ---------- */
.modal.calendar { background: rgba(60, 50, 66, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); gap: 10px; }
.cal-month { margin: 0; min-height: 22px; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.cal-view { position: relative; width: 100%; max-width: 420px; overflow: hidden; touch-action: pan-y; }
.cal-track { display: flex; transition: transform .35s ease; will-change: transform; }
.cal-slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 40vh; padding: 0 8px; box-sizing: border-box; user-select: none; }
.cal-slide .calendar-big { max-height: 52vh; pointer-events: none; }
.cal-line { margin: 0; color: #fff; font-size: 14px; text-align: center; line-height: 1.6; }
.cal-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,250,244,.85); font-size: 24px; line-height: 1; color: var(--lav-deep); cursor: pointer; }
.cal-arrow.prev { left: 4px; } .cal-arrow.next { right: 4px; }
.cal-arrow:disabled { opacity: 0; pointer-events: none; }
.cal-dots { display: flex; gap: 6px; justify-content: center; }
.cal-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.cal-dots span.on { background: #fff; }
/* 달력 아래 문구: 늘 보이는 작은 종이 카드 */
.modal.calendar .shop-blurb { background: #fffaf4; border-radius: 18px; padding: 12px 18px 4px; gap: 2px; width: min(340px, 90vw); box-sizing: border-box; box-shadow: 0 8px 20px rgba(60,40,60,.18); }
.modal.calendar .shop-lines { font-size: 13.5px; line-height: 1.6; }

/* ---------- 실물 굿즈 문구와 링크 ---------- */
.shop-blurb { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.shop-lines { margin: 0; white-space: pre-line; font-size: 15px; line-height: 1.75; text-wrap: pretty; }
.shop-link { border: 0; background: none; padding: 10px 6px; min-height: 44px; font-size: 13.5px; color: var(--soft); font-style: italic; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.shop-hint { color: var(--lav-deep); }
.modal.product { background: rgba(250, 244, 238, .97); }
/* 펠트 테두리 카드 안에 실물 사진 */
.product-card { width: min(300px, 86vw); padding: 14px; border-radius: 26px; background: #fffaf4;
  border: 6px dashed #d9c9ef; outline: 8px solid #e8dcf6; outline-offset: -2px; box-shadow: 0 12px 28px rgba(90,70,90,.18); }
.product-photos { display: flex; gap: 8px; justify-content: center; }
.product-photos img { flex: 1; min-width: 0; max-height: 46vh; object-fit: contain; border-radius: 14px; }
.product-line { margin: 12px 0 2px; font-size: 15px; text-align: center; }
.store-btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }

/* ---------- 2026-11-06 다음 작업 문서 ---------- */
/* 꿈 노트 탭, 도장, 별 100개, 앱 확인창 (쪽지함 탭도 같이 써요) */
.dream-tabs { display: flex; gap: 4px; background: #e8e6f4; border-radius: 14px; padding: 4px; flex: none; }
.dream-tab { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: none; font-size: 14px; color: var(--soft); cursor: pointer; }
.dream-tab.on { background: #fff; color: var(--lav-deep); font-weight: 700; box-shadow: 0 1px 4px rgba(90,70,110,.15); }
.modal.book .blank-label { margin: 0; font-size: 12.5px; }
.dream-list li { position: relative; }
.dream-list li > p { cursor: pointer; padding-right: 58px; min-height: 48px; }
.dream-list li.done p::before { content: none; }
.stamp { position: absolute; right: 10px; top: 6px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 3px double #d98b9d; color: #d98b9d; font-size: 12px; font-weight: 800; transform: rotate(-12deg); background: rgba(246, 203, 213, .28); pointer-events: none; }
.stamp.thud { animation: thud .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes thud { 0% { transform: rotate(-12deg) scale(2.4); opacity: 0; } 60% { transform: rotate(-12deg) scale(.92); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); opacity: 1; } }
.star-page { background: #3f3a5e; border-radius: 16px; padding: 10px 8px 12px; }
.star-count { margin: 0 0 6px; text-align: center; font-size: 14px; font-weight: 700; color: #ffe6a8; }
.star-grid { display: grid; grid-template-columns: repeat(10, 1fr); }
.star-dot { border: 0; background: none; padding: 0; aspect-ratio: 1; min-height: 28px; font-size: 16px; line-height: 1; color: rgba(255,255,255,.2); cursor: pointer; }
.star-dot.on { color: #ffe08a; text-shadow: 0 0 8px rgba(255, 224, 138, .9); }
.app-dialog { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(70, 60, 82, .4); }
.app-dialog-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; background: var(--paper); border-radius: 22px; padding: 18px 16px; box-shadow: 0 12px 30px rgba(60,40,60,.25); }
/* 쪽지함 */
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note-list li { background: #fffdf6; border-radius: 6px; padding: 12px 14px; box-shadow: 0 3px 10px rgba(90,70,60,.1); }
.note-list li:nth-child(odd) { transform: rotate(-.6deg); }
.note-list li:nth-child(even) { transform: rotate(.5deg); }
.note-list p { margin: 0 0 4px; font-size: 15px; line-height: 1.6; }
.note-list small { color: var(--soft); font-size: 12px; }
/* 다음 부적 실루엣 */
.next-charm { width: min(46vw, 180px); aspect-ratio: 5 / 9; }
.next-charm img { width: 100%; height: 100%; display: block; border-radius: 12px; filter: grayscale(1) brightness(0) opacity(.28); animation: fadeUp .6s both; }
/* 마음 세탁소 */
.modal.laundry { background: linear-gradient(#f4eff7, #e9eff8); gap: 14px; }
.wash-row { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 340px; background: var(--paper); border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 4px 14px rgba(90,70,60,.1); }
.wash-tommy { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; flex: none; }
.wash-line { margin: 0; font-size: 15px; line-height: 1.55; min-height: 3.1em; display: flex; align-items: center; text-wrap: pretty; }
.machine { width: min(68vw, 270px); padding: 12px 14px 20px; border-radius: 26px; background: #fffaf4; box-shadow: 0 10px 24px rgba(90,70,90,.16), inset 0 -8px 0 rgba(210,194,239,.25); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.machine.dryer { background: #f7ecdd; box-shadow: 0 10px 24px rgba(90,70,90,.16), inset 0 -8px 0 rgba(195,211,241,.4); }
.m-panel { width: 100%; height: 22px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; border-radius: 10px; background: #d2c2ef; }
.machine.dryer .m-panel { background: #c3d3f1; }
.m-knob { width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.m-light { width: 10px; height: 10px; border-radius: 50%; background: #e8e2f2; }
.machine.run .m-light { background: #8fd6a6; box-shadow: 0 0 8px #8fd6a6; }
.m-door { position: relative; flex: none; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 12px solid #d2c2ef; background: #dbe8f6; overflow: hidden; transition: transform .35s ease; transform-origin: 0 50%; }
.machine.dryer .m-door { border-color: #c3d3f1; background: #f2e8db; }
.m-door.open { transform: perspective(500px) rotateY(-34deg); }
.m-drum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.machine.run .m-drum { animation: spin 1.8s linear infinite; }
.machine.dryer.run .m-drum { animation-duration: 3s; }
@keyframes spin { to { transform: rotate(360deg); } }
.cloth { position: absolute; width: 38px; height: 28px; border-radius: 10px 14px 10px 12px; box-shadow: inset 0 -4px 0 rgba(255,255,255,.4); }
.m-bubbles { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.machine.washer.run .m-bubbles { opacity: 1; }
.m-bubbles i { position: absolute; bottom: -12px; width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: inset -2px -2px 0 rgba(180,200,235,.5); animation: suds 3s ease-in infinite; }
@keyframes suds { to { transform: translateY(-190px) scale(1.5); opacity: 0; } }
.m-glass { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.45) 0 16%, transparent 16% 28%, rgba(255,255,255,.2) 28% 33%, transparent 33%); pointer-events: none; }
.hanky { position: absolute; left: 13%; top: 20%; width: 74%; height: 60%; display: flex; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(90,70,90,.2); }
.machine.run .hanky { animation: hankyRock 2.4s ease-in-out infinite; }
@keyframes hankyRock { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.hanky p { margin: 0; font-size: 12.5px; line-height: 1.4; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.hanky p.fading { opacity: 0; filter: blur(3px); transition: opacity 18s linear, filter 18s linear; }
.hanky.clean { position: relative; left: auto; top: auto; width: 76px; height: 60px; flex: none; }
.fluffy { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; width: min(70vw, 280px); min-height: 130px; }
.cloth.puff { position: relative; width: 74px; height: 56px; border-radius: 26px 30px 24px 28px; animation: puff .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes puff { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
/* 빨래 개기 */
.modal.fold { gap: 10px; }
.fold-stage { width: 100%; max-width: 320px; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.fold-cloth { width: 210px; height: 210px; touch-action: none; cursor: pointer; filter: drop-shadow(0 6px 10px rgba(90,70,90,.18)); }
.fold-cloth.flop { animation: flop .4s ease; }
@keyframes flop { 0% { transform: scale(1.06, .92); } 60% { transform: scale(.97, 1.03); } 100% { transform: none; } }
.fold-stack { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 12px; }
.fold-stack span { display: block; width: 110px; height: 11px; border-radius: 5px; box-shadow: 0 1px 2px rgba(90,70,90,.2); }
.fold-stack.big { transform: scale(1.3); transition: transform .4s; }
.fold-count { margin: 0; font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.sock-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sock { width: 66px; height: 88px; padding: 4px; border: 2px solid transparent; border-radius: 14px; background: rgba(255,255,255,.7); cursor: pointer; }
.sock.on { border-color: var(--lav-deep); background: #f3ecfa; }

/* 주방 미니게임: 붕어빵 굽기 */
.modal.bung { background: linear-gradient(#fbf1e6, #f3e3d3); gap: 10px; }
.bung-stage { width: 100%; max-width: 440px; display: flex; justify-content: center; }
/* 팬 그림(940×660) 중 둥근 팬 부분(700×620)만 보여요. 손잡이는 오른쪽에 조금 */
.bung-pan { position: relative; width: min(94vw, 440px); aspect-ratio: 700 / 620; overflow: hidden; border-radius: 12px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bung-pan-img { position: absolute; left: -2.857%; top: -3.226%; width: 134.286%; height: 106.452%; pointer-events: none; }
.bung-fish { position: absolute; pointer-events: none; }
.bung-pic { width: 100%; height: 100%; display: block; transition: filter .6s; }
.bung-fish.empty .bung-pic { opacity: 0; }
.bung-fish.pour .bung-pic { animation: bung-pour .5s ease-out; }
@keyframes bung-pour { from { transform: scale(.3); opacity: .2; } to { transform: none; opacity: 1; } }
/* 팥: 반죽 가운데에 쏙. 반죽으로 덮이면 숨어요 */
.bung-bean { position: absolute; left: 50%; top: 50%; width: 36%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }
.bung-fish.bean .bung-bean { opacity: 1; animation: bung-bean .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bung-bean { from { transform: translate(-50%, -140%) scale(.5); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.bung-fish.covered .bung-pic { animation: bung-pour .35s ease-out; }
.bung-fish[data-step="2"]:not(.done) .bung-pic { filter: drop-shadow(0 0 6px rgba(255, 214, 120, .9)); }
.bung-fish.flip .bung-pic { animation: bung-flip .45s ease; }
.bung-fish.done .bung-pic { filter: drop-shadow(0 3px 4px rgba(40, 30, 20, .35)); }
@keyframes bung-flip { 0% { transform: none; } 45% { transform: scaleY(.05) translateY(-12%); } 100% { transform: none; } }
/* 눌러야 할 칸 (빈 칸, 팥 넣을 칸): 은은한 고리가 숨 쉬듯 */
.bung-slot.ready::after { content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 2px dashed rgba(255, 236, 200, .75); animation: bung-ready 1.6s ease-in-out infinite; pointer-events: none; }
.bung-slot.ready.need-bean::after { border-color: rgba(176, 108, 70, .85); }
@keyframes bung-ready { 0%, 100% { transform: scale(.92); opacity: .5; } 50% { transform: scale(1.04); opacity: 1; } }
/* 손가락으로 누르는 칸: 둥근 칸 (360px 화면에서 약 80px) */
.bung-slot { position: absolute; width: 24%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bung-slot:active:not(:disabled) { background: rgba(255, 240, 210, .18); }
.bung-slot:focus-visible { outline: 3px solid var(--lav-deep); }
.bung-slot:disabled { cursor: default; }
.bung-sparkle { position: absolute; width: 0; height: 0; pointer-events: none; }
.bung-sparkle i { position: absolute; left: -9px; top: -12px; font-style: normal; font-size: 20px; color: #fff3b0; text-shadow: 0 0 6px #ffd36b; animation: bung-spark 1s ease-out forwards; }
@keyframes bung-spark { from { transform: rotate(var(--a)) translateY(0) scale(.4); opacity: 1; } to { transform: rotate(var(--a)) translateY(-56px) scale(1.1); opacity: 0; } }
.bung-hint { margin: 0; text-align: center; }
.bung-buttons { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }
.bung-buttons:empty { display: none; }
/* 접시 */
.bung-plate { position: relative; width: min(88vw, 380px); aspect-ratio: 600 / 330; margin: 20px 0; }
.bung-plate-img { position: absolute; left: 0; bottom: 0; width: 100%; }
.bung-on-plate { position: absolute; width: 34%; transform: rotate(var(--r)); animation: bung-drop .5s cubic-bezier(.3, 1.4, .5, 1) both; filter: drop-shadow(0 3px 4px rgba(60,40,20,.25)); }
@keyframes bung-drop { from { transform: translateY(-40px) rotate(var(--r)); opacity: 0; } to { transform: rotate(var(--r)); opacity: 1; } }
/* '?' 안내 버튼 (소리 버튼 왼쪽) */
.guide-btn { position: absolute; right: 64px; top: calc(12px + env(safe-area-inset-top)); z-index: 4; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,250,244,.92); color: var(--lav-deep); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(90,70,60,.14); }
/* 아직 안 가본 구역 버튼: 오른쪽 위 작은 점 */
#zonebar button { position: relative; }
#zonebar button.new::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #f08aa6; box-shadow: 0 0 0 2px #fff; }
/* 안내 화면 */
.modal.guide { background: linear-gradient(#fbf4ee, #f1ebf8); }
.modal.guide .scroll > * { flex-shrink: 0; }
.modal.guide h2 { margin: 0; font-size: 19px; }
.modal.guide h3 { margin: 6px 0 0; font-size: 15px; }
.modal.guide .wash-row { max-width: none; }
.guide-rules, .guide-places, .guide-how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.guide-rules li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: #fff; }
.guide-rules img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.guide-rules b { font-size: 14.5px; }
.guide-rules p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.55; color: #6a5a62; }
.guide-place { padding: 10px 12px; border-radius: 16px; background: #fff; border: 1.5px solid #ece2ef; }
.guide-place.hidden { background: rgba(255,255,255,.55); border-style: dashed; }
.guide-place-head { display: flex; align-items: center; gap: 6px; }
.guide-place-head b { font-size: 15px; margin-right: 2px; }
.guide-place-head .btn { margin-left: auto; }
.guide-place ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: #6a5a62; }
.guide-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.guide-tag.star { background: #fff4cf; color: #a97b14; }
.guide-tag.yarn { background: #fdeef2; color: #b8667e; }
.guide-how li { font-size: 13.5px; line-height: 1.6; color: #6a5a62; padding-left: 14px; position: relative; }
.guide-how li::before { content: '·'; position: absolute; left: 4px; font-weight: 700; }

/* 구역 보기에서 옆으로 끌 때: 화면 가장자리에 옆 구역 이름 */
.swipe-peek { position: fixed; top: 42%; left: 10px; z-index: 6; padding: 8px 14px; border-radius: 999px; background: rgba(255, 250, 244, .95); color: var(--ink); font-size: 15px; font-weight: 600; box-shadow: 0 4px 14px rgba(90,70,90,.18); pointer-events: none; opacity: 0; transition: opacity .15s; }
.swipe-peek.right { left: auto; right: 10px; }
.swipe-peek:not(.show) { opacity: 0 !important; }

/* 미니게임 끝 화면: 털실 받았다는 한 줄 */
.mg-note { margin: 0; align-self: center; padding: 6px 14px; border-radius: 999px; background: #fdeef2; color: #b8667e; font-size: 13.5px; font-weight: 600; }

/* 털실 바구니 · 옷장 */
.modal.wardrobe { background: linear-gradient(#fbf3ea, #f3e8f3); }
.modal.wardrobe h3 { margin: 6px 0 0; font-size: 15px; }
.wd-head { display: flex; align-items: center; gap: 12px; }
.wd-head h2 { margin: 0; font-size: 19px; }
.wd-basket { width: 84px; height: auto; flex: none; }
.wd-count { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 15px; font-weight: 600; color: #b8667e; }
.wd-count img { width: 24px; height: 24px; }
.modal.wardrobe .wash-row { max-width: none; }
.wd-progress { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--paper); box-shadow: 0 4px 14px rgba(90,70,60,.08); }
.wd-progress img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.wd-progress > div { flex: 1; min-width: 0; }
.wd-progress p { margin: 0 0 6px; font-size: 14px; }
.wd-bar { display: block; height: 10px; border-radius: 5px; background: #f1e6ee; overflow: hidden; }
.wd-bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #f7c1cd, #f4a3b4); }
.wd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wd-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; min-height: 112px; border: 2px solid #ece2ef; border-radius: 16px; background: #fff; cursor: pointer; font: inherit; }
.wd-item img { width: 58px; height: 52px; object-fit: contain; }
.wd-item:not(.owned):not(.target) img { filter: saturate(.55) opacity(.75); }
.wd-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.wd-tag { font-size: 11.5px; color: var(--soft); }
.wd-item.target { border-color: #f4a3b4; background: #fff6f8; }
.wd-item.target .wd-tag { color: #b8667e; font-weight: 600; }
.wd-item.owned { border-color: #cfe6d2; background: #f6fbf6; }
.wd-item.owned .wd-tag { color: #6a9c76; font-weight: 600; }
.wd-item.owned .wd-tag::before { content: '✓ '; }
.wd-outfits { grid-template-columns: repeat(2, 1fr); }
/* 뜨개질 완성 */
.modal.wardrobe.knit { gap: 16px; }
.knit-stage { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
.knit-ball { width: 110px; animation: knit-roll 1s ease-in-out infinite; }
@keyframes knit-roll { 0%, 100% { transform: rotate(-12deg) translateY(0); } 50% { transform: rotate(12deg) translateY(-10px); } }
.knit-item { position: relative; z-index: 1; width: 170px; animation: knit-pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes knit-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.knit-shine { position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 190, .8), rgba(255, 236, 190, 0) 65%); animation: knit-shine 1.6s ease-out forwards; }
@keyframes knit-shine { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.2); opacity: .4; } }

/* 소파: 친구들한테 물어보기 (고민 우체통) */
.modal.askfriends { background: linear-gradient(#fbf4ee, #f1ebf8); }
.modal.askfriends .scroll > * { flex-shrink: 0; } /* 말풍선이 많아지면 줄어들지 않고 아래로 스크롤 */
.ask-title { margin: 0; font-size: 19px; text-align: center; }
.ask-warn { color: #c0607a; min-height: 0; }
.ask-warn:empty { display: none; }
.ask-heard { margin: 0; text-align: center; font-size: 14px; color: var(--soft); }
.ask-chat { display: flex; flex-direction: column; gap: 12px; min-height: 120px; cursor: pointer; }
.ask-row { display: flex; align-items: flex-start; gap: 10px; animation: ask-in .35s ease-out both; }
@keyframes ask-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.ask-avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: #6a5a62; box-shadow: 0 2px 6px rgba(90,70,90,.15); }
.ask-bubble { position: relative; flex: 1; min-width: 0; padding: 9px 13px 10px; border-radius: 4px 18px 18px 18px; background: #fff; border: 2px solid var(--c, #eee); box-shadow: 0 3px 10px rgba(90,70,90,.08); }
.ask-bubble b { display: block; font-size: 12.5px; color: #8a7a82; margin-bottom: 2px; }
.ask-bubble p { margin: 0; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.ask-row.typing { align-items: center; color: var(--soft); }
.ask-dots { display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: 14px; background: #fff; }
.ask-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c9bcd6; animation: ask-dot 1s ease-in-out infinite; }
.ask-dots i:nth-child(2) { animation-delay: .15s; } .ask-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-dot { 50% { transform: translateY(-4px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ask-row, .ask-dots i { animation: none !important; } }

/* 현관: 토미의 오늘의 운세 쪽지 */
.modal.fortune { background: linear-gradient(#fdf3e8, #f6ecf6); }
.modal.fortune .scroll > * { flex-shrink: 0; }
.ft-paper { position: relative; width: 100%; max-width: 360px; box-sizing: border-box; border-radius: 18px; background: #fffdf8; box-shadow: 0 6px 20px rgba(110,80,70,.13); cursor: pointer; overflow: hidden; }
.ft-paper.open { cursor: default; }
.ft-fold { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 190px; background: repeating-linear-gradient(135deg, #fff6ea 0 14px, #fdf0e2 14px 28px); }
.ft-seal { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f2a7ba; color: #fff; font-weight: 700; box-shadow: 0 3px 0 #d98aa0; animation: ft-wiggle 1.8s ease-in-out infinite; }
@keyframes ft-wiggle { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } }
.ft-paper.open .ft-fold { display: none; }
.ft-body { display: none; padding: 18px 16px 16px; flex-direction: column; gap: 12px; }
.ft-paper.open .ft-body { display: flex; animation: ft-open .5s cubic-bezier(.3, 1.3, .5, 1); transform-origin: top center; }
@keyframes ft-open { from { transform: scaleY(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.ft-date { margin: 0; font-size: 12.5px; color: var(--soft); text-align: center; }
.ft-main { margin: 0; font-size: 21px; text-align: center; color: #8f6cc0; text-wrap: balance; }
.ft-text { margin: 0; font-size: 15px; line-height: 1.6; text-align: center; text-wrap: pretty; }
.ft-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ft-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 14px; background: #faf3ec; text-align: center; }
.ft-cell b { font-size: 11.5px; color: var(--soft); font-weight: 600; }
.ft-cell span:last-child { font-size: 13.5px; line-height: 1.35; word-break: keep-all; }
.ft-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.ft-icon, .ft-num { height: 26px; display: flex; align-items: center; font-size: 20px; color: #e3a84a; font-weight: 700; }
.ft-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #faf3ec; }
.ft-row > div { flex: 1; min-width: 0; }
.ft-row b, .ft-luck > b { font-size: 13px; color: #8a6f64; }
.ft-row p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; }
.ft-luck { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #faf3ec; }
.ft-luck-row { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.ft-luck-label { font-size: 13.5px; font-weight: 600; }
.ft-hearts { color: #ef8fa8; letter-spacing: 1px; font-size: 14px; }
.ft-hearts i { font-style: normal; color: #ead9dd; }
.ft-luck-row p { grid-column: 1 / -1; margin: 1px 0 0; font-size: 14px; line-height: 1.5; color: #5b4b45; }
.modal.fortune .wash-row { max-width: none; box-shadow: none; background: #fdf0f3; }
@media (prefers-reduced-motion: reduce) { .ft-seal, .ft-paper.open .ft-body { animation: none !important; } }

/* 창문 미니게임: 별사탕 별똥별 잡기 */
#choices .wide { grid-column: 1 / -1; }
.modal.starcatch { background: #141c3d; justify-content: flex-start; gap: 0; overflow: hidden; }
.sc-field { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.sc-sky { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; pointer-events: none; }
.sc-row { position: relative; z-index: 2; background: rgba(255, 250, 244, .94); }
.sc-gap { flex: 1; }
.sc-bottom { position: relative; z-index: 2; width: 100%; max-width: 340px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 12px 4px; border-radius: 20px; background: rgba(28, 34, 74, .72); pointer-events: none; }
.sc-bottom button { pointer-events: auto; }
.sc-hint { margin: 0; font-size: 13px; color: #e9ecff; text-shadow: 0 1px 4px rgba(0,0,0,.5); text-align: center; }
.sc-count { margin: 0; font-size: 14px; font-weight: 600; color: #fff6cf; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sc-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 30px; max-width: 300px; padding: 4px 8px; border-radius: 16px; background: rgba(255,255,255,.14); }
.sc-tray:empty { visibility: hidden; }
.sc-tray img { width: 26px; height: 26px; object-fit: contain; animation: sc-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.sc-quit { color: rgba(255,255,255,.7); }
/* 떨어지는 것: 누르는 자리는 지름 76px (그림보다 넉넉하게) */
.sc-item { position: absolute; left: 0; top: 0; width: 76px; height: 76px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; will-change: transform; z-index: 1; }
.sc-item img { position: relative; width: 56%; height: 56%; margin: 22%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 0 8px rgba(255, 246, 200, .75)); }
.sc-item.star img { width: 64%; height: 64%; margin: 18%; }
.sc-item.gold img { width: 78%; height: 78%; margin: 11%; filter: drop-shadow(0 0 14px rgba(255, 214, 110, .95)); animation: sc-twinkle .8s ease-in-out infinite; }
.sc-trail { position: absolute; left: 50%; top: 50%; width: 90px; height: 6px; transform-origin: 0 50%; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 246, 210, .85), rgba(255, 246, 210, 0)); pointer-events: none; }
.sc-item.gold .sc-trail { width: 130px; height: 9px; background: linear-gradient(90deg, rgba(255, 214, 110, .95), rgba(255, 214, 110, 0)); }
.sc-item.snow img { opacity: .9; filter: none; }
.sc-item.caught img { animation: sc-catch .45s ease-out forwards; }
.sc-item.caught .sc-trail, .sc-item.fade { opacity: 0; transition: opacity .4s; }
.sc-item.melt img { animation: sc-melt .6s ease-out forwards; }
@keyframes sc-catch { to { transform: scale(1.8); opacity: 0; } }
@keyframes sc-melt { to { transform: scale(.4); opacity: 0; filter: blur(3px); } }
@keyframes sc-twinkle { 50% { transform: scale(1.12) rotate(12deg); } }
@keyframes sc-pop { from { transform: scale(.3); } to { transform: none; } }
/* 다 모은 별사탕 더미 */
.sc-heap { position: absolute; left: 50%; top: 42%; width: 220px; height: 180px; transform: translate(-50%, -50%); pointer-events: none; }
.sc-heap::before { content: ''; position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 240, 190, .35), transparent 65%); }
.sc-heap img { position: absolute; width: 54px; height: 54px; transform: translate(-50%, -50%) rotate(var(--r)); animation: sc-heap .5s cubic-bezier(.3, 1.5, .5, 1) both; filter: drop-shadow(0 0 6px rgba(255, 240, 190, .7)); }
@keyframes sc-heap { from { transform: translate(-50%, -260%) rotate(var(--r)); opacity: 0; } to { transform: translate(-50%, -50%) rotate(var(--r)); opacity: 1; } }

/* 소파 미니게임: 담요 속 토미 쓰다듬기 */
.modal.pet { background: radial-gradient(circle at 50% 45%, #f8e9df, #e6d3e6 75%); gap: 10px; }
.pet-stage { width: 100%; display: flex; justify-content: center; }
/* 토미 전체가 쓰다듬는 자리 (360px 화면에서 약 270px) */
.pet-pad { position: relative; width: min(76vw, 320px); aspect-ratio: 708 / 768; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.pet-tommy { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 10px 16px rgba(90, 70, 90, .18)); transition: filter 1.2s; transform-origin: 50% 90%; }
.pet-pad.drowsy .pet-tommy { animation: pet-sway 3.6s ease-in-out infinite; }
.pet-pad.asleep .pet-tommy { animation: pet-breathe 3.2s ease-in-out infinite; filter: brightness(.82) saturate(.9) drop-shadow(0 10px 16px rgba(90, 70, 90, .18)); }
@keyframes pet-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes pet-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015, .99); } }
/* 좋아하는 자리 */
.pet-spot { position: absolute; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.6); border-radius: 50%; border: 2.5px dashed rgba(240, 130, 160, .8); box-sizing: border-box; background: radial-gradient(circle, rgba(255, 170, 195, .5), rgba(255, 190, 210, .12) 70%); opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s; }
.pet-spot.show { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: pet-spot 1.6s ease-in-out infinite; }
@keyframes pet-spot { 50% { transform: translate(-50%, -50%) scale(1.12); } }
.pet-heart { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%); pointer-events: none; animation: pet-heart 1.2s ease-out forwards; }
.pet-heart.big { width: 46px; height: 46px; }
@keyframes pet-heart { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% - 90px)) scale(1); opacity: 0; } }
.pet-purr { position: absolute; right: -6%; top: -4%; width: 44%; opacity: 0; transform: scale(.6); transition: opacity .6s, transform .6s; pointer-events: none; }
.pet-purr.show { opacity: 1; transform: none; animation: pet-float 2.4s ease-in-out infinite; }
.pet-zzz { position: absolute; right: -2%; top: -8%; width: 34%; opacity: 0; pointer-events: none; transition: opacity 1s; }
.pet-zzz.show { opacity: 1; animation: pet-float 3s ease-in-out infinite; }
@keyframes pet-float { 50% { transform: translateY(-8px); } }
.pet-gauge { display: flex; align-items: center; gap: 8px; width: min(80vw, 300px); }
.pet-gauge img { width: 24px; height: 24px; flex: none; }
.pet-label { font-size: 13px; color: var(--soft); flex: none; }
.pet-bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(255,255,255,.75); overflow: hidden; box-shadow: inset 0 1px 3px rgba(90,70,90,.15); }
.pet-fill { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #f7c1cd, #f4a3b4); transition: width .25s; }

@media (prefers-reduced-motion: reduce) {
  .pet-pad .pet-tommy, .pet-spot.show, .pet-purr.show, .pet-zzz.show { animation: none !important; }
  .sc-item.gold img, .sc-tray img, .sc-heap img { animation: none !important; }
  .bung-fish .bung-pic, .bung-fish .bung-bean, .bung-slot.ready::after, .bung-on-plate, .bung-sparkle i { animation: none !important; }
}
