/* 보물 탭(24판, 2026-11-19 네 칸): 숫자 칩 줄 + 작은 탭 네 칸(친구 집 / 가방 / 배지 조끼 / 성장 일기). 색·크기는 tokens.css 이름만 쓴다. 누르는 곳 44px 이상, 가로 넘침 없음. */
.screen.treasure { display: flex; flex-direction: column; gap: var(--sp-3); min-height: 100dvh; }
.treasure-top { justify-content: space-between; }
.treasure-title { margin: 0; font-family: var(--f-head); font-size: var(--fs-title); line-height: 1.25; }

.tt-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tt-tab { min-height: 48px; padding: 0 2px; border-radius: var(--radius); border: 1.5px solid var(--line-strong); background: var(--panel2); color: var(--ink); font-size: 15px; cursor: pointer; text-wrap: balance; }
.tt-tab[aria-selected="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); font-weight: 600; }

.treasure-host { flex: none; min-width: 0; }
.treasure-panel { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.tt-line { margin: 0; color: var(--mute); font-size: var(--fs-small); text-align: center; }

/* 남는 자리의 보물 그림(채움 H12·H40): 자리가 모자라면 그림을 접는다(화면을 늘리지 않는다) */
.screen.treasure .fill-scene[data-scene="treasure"] { flex: 1 1 0; min-height: 0; }
@container (max-height: 149px) { .screen.treasure .fill-box { display: none; } }

/* 가방: 전투 가방 시트와 같은 줄(parts.css .ui-bag), 쓰기 단추는 없다 */
.tt-item { min-height: 64px; }

/* 배지 조끼 */
.tv-name { display: grid; gap: 2px; justify-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); text-align: center; }
.tv-name__label { color: var(--mute); font-size: var(--fs-small); }
.tv-name__text { font-family: var(--f-head); font-size: 20px; line-height: 1.3; color: var(--lamp); overflow-wrap: anywhere; }
.tv-section { display: grid; gap: 8px; }
.tv-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-family: var(--f-head); font-size: 17px; }
.tv-h__n { color: var(--mute); font-family: var(--f-body); font-size: var(--fs-small); font-weight: 400; font-variant-numeric: tabular-nums; }
.tv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tb { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; width: 100%; min-height: 44px; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); text-align: center; cursor: pointer; }
.tb[data-got="false"] { border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--off-ink); }
/* 25판 N5: 못 받은 배지 이름은 바탕(하늘 아래쪽 #22346E)과 4.5:1 이상이 되게 본문 흐린 글색을 쓴다(그림 선은 그대로 점선) */
.tb[data-got="false"] .tb__name { color: var(--text-mute); }
.tb[data-worn] { border: 2px solid var(--lamp); padding: 9px 3px 7px; }
.tb__name { font-size: 14px; line-height: 1.3; text-wrap: balance; }
.tb__tag { display: none; padding: 0 9px; border-radius: var(--radius-pill); background: var(--lamp); color: var(--lamp-ink); font-size: 12px; font-weight: 700; line-height: 1.5; }
.tb[data-worn] .tb__tag { display: inline-block; }

/* 배지 그림(badge-art.js): 받은 것은 색, 못 받은 것은 점선, 단계는 박음질 줄 */
[data-hue="math"] { --hue: var(--c-math); }
[data-hue="science"] { --hue: var(--c-science); }
[data-hue="moral"] { --hue: var(--c-moral); }
[data-hue="ghost"] { --hue: var(--c-ghost); }
[data-hue="rush"] { --hue: var(--c-rush); }
[data-hue="lamp"] { --hue: var(--lamp); }
.tb-art { display: block; width: 64px; height: 73px; overflow: visible; }
.tb-shield { fill: var(--hue, var(--lamp)); stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; stroke-linejoin: round; }
.tb-art[data-got="false"] .tb-shield { fill: none; stroke: var(--off-ink); stroke-width: 1.6; stroke-dasharray: 3.5 3.5; }
.tb-stitch { fill: none; stroke: var(--sky0); stroke-width: 1.2; stroke-dasharray: 2.4 2.4; stroke-linejoin: round; opacity: 0.85; }
.tb-star { fill: var(--sky0); }
.tb-glyph { fill: none; stroke: var(--sky0); color: var(--sky0); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tb-art[data-got="false"] .tb-glyph { stroke: var(--off-ink); color: var(--off-ink); opacity: 0.85; }

/* 배지 시트 */
.tv-sheet { display: grid; gap: var(--sp-3); }
.tv-sheet__top { display: flex; align-items: center; gap: 14px; }
.tv-sheet__pic { flex: none; }
.tv-sheet__pic .tb-art { width: 84px; height: 96px; }
.tv-sheet__txt { display: grid; gap: 4px; min-width: 0; }
.tv-sheet__state { justify-self: start; padding: 1px 10px; border: 1px solid currentColor; border-radius: var(--radius-pill); color: var(--lamp); font-size: var(--fs-small); }
.tv-sheet__how { margin: 0; font-size: 17px; line-height: 1.4; }
.tv-sheet__now { color: var(--mute); font-size: var(--fs-small); }

/* 성장 일기: 친구마다 한 장 */
.td-page { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.td-head { display: flex; align-items: center; gap: 14px; }
.td-pic { flex: none; width: 84px; height: 84px; display: grid; place-items: center; }
.td-head__txt { display: grid; gap: 2px; min-width: 0; }
.td-name { font-family: var(--f-head); font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.td-now { color: var(--lamp); font-size: 15px; }
.td-stages { list-style: none; margin: 0; padding: 0; }
.td-stage { position: relative; display: flex; gap: 12px; padding: 7px 0; }
.td-stage:not(:last-child)::after { content: ''; position: absolute; left: 6px; top: 26px; bottom: -6px; border-left: 2px solid var(--line); }
.td-dot { flex: none; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--lamp); background: var(--lamp); }
.td-stage[data-state="next"] .td-dot, .td-stage[data-state="later"] .td-dot { border: 2px dashed var(--line-strong); background: transparent; }
.td-stage__txt { display: grid; gap: 2px; min-width: 0; }
.td-stage__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; }
.td-stage__date { color: var(--mute); font-size: var(--fs-small); font-weight: 400; }
.td-stage__what { font-size: 15px; line-height: 1.4; }
.td-stage__now { color: var(--lamp); font-size: var(--fs-small); }
.td-stage[data-state="later"] .td-stage__name, .td-stage[data-state="later"] .td-stage__what { color: var(--off-ink); }
.td-stage[data-state="next"] .td-stage__what { color: var(--mute); }

/* ───────── 친구 집(2026-11-19): 지붕 + 집 몸(4칸 한 줄, 줄마다 바닥선) + 고른 친구 한 줄 + 성장 그릇 카드. 글자 13·15·17·19·24만, 숫자 없음 ───────── */
.fh-panel { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.fh-house { position: relative; margin-top: 2px; }
.fh-roof { display: block; width: 100%; height: 44px; }
.fh-roof__top { fill: var(--shade-roof-front); }
.fh-roof__lamp { fill: var(--lamp); }
.fh-body { margin-top: -1px; padding: 8px var(--sp-4) 12px; background: linear-gradient(180deg, var(--shade-front), var(--sheet)); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; flex-direction: column; min-width: 0; }
.fh-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding-bottom: 6px; border-bottom: 3px solid var(--shade-patch); margin-bottom: 6px; }
.fh-row:last-child { margin-bottom: 0; }
.fh-f { position: relative; display: grid; justify-items: center; align-content: start; gap: 0; min-width: 0; min-height: var(--touch); padding: 4px 0 6px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fh-f::before { content: ''; position: absolute; left: 50%; top: 8px; width: 80px; height: 76px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, var(--lamp-glow), transparent); opacity: 0; pointer-events: none; }
.fh-f[aria-pressed="true"]::before { opacity: 1; }
.fh-f:focus-visible { outline: var(--focus, 3px) solid var(--focus-color, var(--lamp)); outline-offset: -2px; border-radius: var(--radius); }
.fh-f__pic { position: relative; display: block; width: 72px; height: 72px; }
.fh-f__n { position: relative; max-width: 100%; font-size: 15px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.fh-f[aria-pressed="true"] .fh-f__n { box-shadow: inset 0 -3px 0 var(--lamp); }
.fh-f[data-rep] .fh-f__n { color: var(--lamp); }
.fh-f__tag { position: absolute; top: 2px; right: 0; padding: 0 8px; border-radius: var(--radius-pill); background: var(--lamp); color: var(--lamp-ink); font-size: 13px; font-weight: 700; line-height: 1.6; }
.fh-f:not([data-rep]) .fh-f__tag { display: none; }
.fh-sel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 2px; min-height: var(--touch); }
.fh-sel__t { display: grid; gap: 0; min-width: 0; }
.fh-sel__n { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fh-sel__d { color: var(--text-mute); font-size: 14px; line-height: 1.4; }
.fh-sel__btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); margin-left: auto; }
.fh-sel__btns .ui-btn--main { min-height: var(--touch); padding: 0 16px; font-size: var(--fs-btn-small); box-shadow: none; }
.fh-bowlcard { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 12px 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); min-width: 0; }
.fh-bowlcard__t { display: grid; justify-items: start; gap: 2px; min-width: 0; }
.fh-bowlcard__n { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fh-bowlcard__d { color: var(--text-mute); font-size: 14px; line-height: 1.4; }
.fh-bowlcard__t .ui-btn { margin-top: 6px; }
.fh-bowl { flex: none; width: 112px; height: 72px; overflow: visible; }
.fh-bowl__body { fill: var(--sheet); }
.fh-bowl__edge { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.fh-bowl__fill { fill: var(--lamp); }
.fh-bowl__rim { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.fh-bowl__drop { fill: var(--lamp); }
.fh-bowl__drop--b { opacity: .7; }
.fh-bowl__drop--c { opacity: .45; }

/* 옷장(바닥 시트): 위에 친구 + 조개 수, 아래에 소품 다섯 줄(그림 · 이름 · 단추 하나) */
.wr { display: grid; gap: var(--sp-3); min-width: 0; }
.wr-top { display: flex; align-items: center; gap: var(--sp-3); }
.wr-view { flex: none; width: 120px; height: 120px; }
.wr-who { display: grid; gap: 4px; min-width: 0; }
.wr-name { font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.wr-shells { font-size: 15px; font-weight: 600; color: var(--lamp); }
.wr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.wr-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.wr-item[data-worn="true"] { border-color: var(--lamp); }
.wr-item__pic { flex: none; display: block; width: 44px; height: 44px; }
.wr-item__pic svg { display: block; width: 100%; height: 100%; }
.wr-item__name { flex: 1 1 auto; min-width: 0; font-size: 17px; line-height: 1.3; }
.wr-item .ui-btn { flex: none; min-width: 84px; min-height: var(--touch); padding: 0 14px; font-size: var(--fs-btn-small); box-shadow: none; }
.wr-price { margin-left: 6px; padding-left: 8px; border-left: 1px solid currentColor; font-variant-numeric: tabular-nums; font-weight: 700; }

/* 깨어남 카드(하루 끝 화면 카드 .cl-card 모양): 깨진 알 조각 위에 막 태어난 친구 + 제목 + 한 줄 + [친구 집 보기] */
.cl-card.hatch { display: flex; align-items: center; gap: var(--sp-3); }
.hatch__fig { position: relative; flex: none; display: block; width: var(--hatch-size, 88px); height: calc(var(--hatch-size, 88px) * 1.18); }
.hatch__friend { position: absolute; left: 50%; top: 0; transform: translateX(-50%); display: block; }
.hatch__shell { position: absolute; left: 0; right: 0; bottom: 0; display: block; }
.hatch__shell svg { display: block; width: 100%; height: auto; }
.hatch__body { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.hatch__body .cl-card__t { overflow-wrap: anywhere; }
.hatch__sub { margin: 0; color: var(--text-mute); font-size: 15px; line-height: 1.4; }
.cl-card.hatch-note { padding: 12px 16px; }
.cl-card.hatch-note .hatch__sub { color: var(--text); }
