/* =========================================================================
 * Linh vật 小強 Tiểu Cường (src/app/mascot.js, ảnh assets/mascot/) và phòng nuôi #/pet (src/features/pet/).
 * Chuyển động chỉ chạy khi không bật "ít hiệu ứng" (html[data-fx="less"]). Chữ và khung dùng token màu của giao diện;
 * riêng phông nền phòng (.tc-bg-*) là tranh cảnh nên có màu cố định, chữ trên tranh nằm trên dải tối riêng.
 * ========================================================================= */

/* ---------- hình (ảnh WebP vuông nền trong suốt, mọi tư thế cùng khung nên đổi tư thế không bị giật) ---------- */
.tc { position: relative; flex: 0 0 auto; line-height: 0; user-select: none; -webkit-user-select: none; }
.tc .tc-img { position: relative; width: 100%; height: auto; display: block; transform-origin: 50% 100%; -webkit-user-drag: none; }
.tc-xs { width: 40px; } .tc-sm { width: 64px; } .tc-md { width: 120px; } .tc-lg { width: min(230px, 62vw); }
/* râu phát sáng: quầng vàng phía sau (có cả khi ít hiệu ứng, chỉ không nhấp nháy) */
.tc-s-glow::before, .tc[class*="tc-s-streak-"]::before { content: ''; position: absolute; inset: -8% -8% 10%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 214, 90, .55), rgba(255, 214, 90, 0)); }

:root:not([data-fx="less"]) .tc .tc-img { animation: tc-bob 2.6s ease-in-out infinite; }
:root:not([data-fx="less"]) .tc-s-smug .tc-img { animation: tc-tilt 2.4s ease-in-out infinite; }
:root:not([data-fx="less"]) .tc-s-side .tc-img { animation: tc-lean .5s ease-out both; }
:root:not([data-fx="less"]) .tc-s-fly .tc-img, :root:not([data-fx="less"]) .tc-s-glow .tc-img { animation: tc-fly 1.6s ease-in-out infinite; }
:root:not([data-fx="less"]) .tc-s-glow::before, :root:not([data-fx="less"]) .tc[class*="tc-s-streak-"]::before { animation: tc-halo 1.1s ease-in-out infinite alternate; }
:root:not([data-fx="less"]) .tc-s-sleepy .tc-img, :root:not([data-fx="less"]) .tc-s-hungry .tc-img { animation: tc-breathe 3.4s ease-in-out infinite; }
:root:not([data-fx="less"]) .tc-s-dead .tc-img { animation: none; }
/* phản ứng: bật lên một cái rồi nhún như thường */
:root:not([data-fx="less"]) .tc-s-wow .tc-img, :root:not([data-fx="less"]) .tc-s-correct .tc-img, :root:not([data-fx="less"]) .tc-s-revive .tc-img,
:root:not([data-fx="less"]) .tc[class*="tc-s-eat"] .tc-img { animation: tc-jump .45s cubic-bezier(.3, 1.6, .5, 1), tc-bob 2.6s ease-in-out .45s infinite; }
:root:not([data-fx="less"]) .tc-s-blush .tc-img { animation: tc-wiggle .5s ease-in-out 2; }
/* gật gù trong lúc đọc câu */
:root:not([data-fx="less"]) .tc.is-talking .tc-img { animation: tc-nod .26s ease-in-out infinite alternate; }

@keyframes tc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3%); } }
@keyframes tc-tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg) translateY(-2%); } }
@keyframes tc-lean { to { transform: rotate(-5deg) translateX(-2%); } }
@keyframes tc-fly { 0%, 100% { transform: translateY(-2%); } 50% { transform: translateY(-8%) rotate(-2deg); } }
@keyframes tc-halo { from { opacity: .5; transform: scale(.9); } to { opacity: 1; transform: scale(1.12); } }
@keyframes tc-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes tc-jump { 0% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-12%) scale(.96, 1.05); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes tc-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes tc-nod { from { transform: translateY(0); } to { transform: translateY(-2%); } }

/* ---------- bong bóng câu nói ---------- */
.tc-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tc-bubble { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 320px; padding: 8px 14px; border-radius: 18px;
  background: var(--surface); color: var(--text); border: 2px solid color-mix(in srgb, var(--gold) 55%, var(--border)); box-shadow: var(--print-shadow); cursor: pointer; font: inherit; text-align: center; }
.tc-bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: var(--surface); border-right: 2px solid color-mix(in srgb, var(--gold) 55%, var(--border)); border-bottom: 2px solid color-mix(in srgb, var(--gold) 55%, var(--border)); }
.tc-bubble small { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.tc-bubble:hover { border-color: var(--gold); }

/* trong màn học: hình nhỏ cạnh nút Kiểm tra, bong bóng nổi phía trên để không đẩy bố cục */
.ses-bar .ses-mascot { position: relative; width: 64px; }
.ses-bar .ses-mascot .tc-wrap { position: relative; }
.ses-bar .ses-mascot .tc-bubble { position: absolute; bottom: calc(100% + 10px); left: 0; transform: none; white-space: nowrap; max-width: none; z-index: 3; padding: 6px 12px; }
.ses-bar .ses-mascot .tc-bubble::after { left: 28px; }
@media (max-width: 560px) { .ses-bar .ses-mascot { width: 48px; } .ses-bar .ses-mascot .tc-sm { width: 48px; } }
.ses-fin.has-tc .ses-fin-icon { display: none; }
.ses-fin .ses-mascot.big { display: flex; justify-content: center; }
.ses-card.has-tc .tc-bubble { margin: 0 auto 8px; }

/* ---------- thẻ trang chủ ---------- */
.tc-home { display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.tc-home::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 132px; opacity: .22; pointer-events: none; }
.tc-home-fig { position: relative; z-index: 1; flex: 0 0 auto; text-decoration: none; padding-top: 6px; }
.tc-home-fig .tc-backdrop { opacity: .38; border-radius: 12px; }
.tc-home-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.tc-home .tc-bubble { align-self: flex-start; align-items: flex-start; text-align: left; max-width: 100%; }
.tc-home .tc-bubble::after { left: -7px; bottom: auto; top: 18px; transform: rotate(135deg); }
.tc-home-btns { gap: 6px; }
.tc-note { margin: 0; font-size: .85rem; }
.tc-meter small { display: block; margin-top: 4px; font-size: .8rem; }
.tc-lv { font-size: .8rem; }
@media (max-width: 420px) { .tc-home .tc-md { width: 92px; } }

/* ---------- phông nền (tranh cảnh, màu cố định) ---------- */
.tc-bg-chachaan { --tc-bg: linear-gradient(180deg, #2F6B4F 0 62%, #EDE2C4 62% 64%, #C9B48A 64%); --tc-pat: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 22px, transparent 22px 44px); }
.tc-bg-ferry { --tc-bg: linear-gradient(180deg, #A9D8F2 0 48%, #6FB3DA 48% 56%, #1F5E8C 56%); --tc-pat: repeating-linear-gradient(170deg, rgba(255,255,255,.12) 0 3px, transparent 3px 26px); }
.tc-bg-neon { --tc-bg: radial-gradient(240px 160px at 18% 22%, rgba(255,60,140,.55), transparent 70%), radial-gradient(240px 160px at 84% 30%, rgba(0,220,200,.45), transparent 70%), linear-gradient(180deg, #24102E, #3A1846 70%, #1A0C20); --tc-pat: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 2px, transparent 2px 60px); }
.tc-bg-cinema { --tc-bg: radial-gradient(300px 180px at 50% 30%, rgba(255,220,150,.35), transparent 70%), linear-gradient(180deg, #5E0F1C, #8A1F2E 60%, #3A0A12); --tc-pat: repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 10px, transparent 10px 34px); }
.tc-bg-peak { --tc-bg: radial-gradient(160px 160px at 80% 18%, rgba(255,214,140,.9), transparent 70%), linear-gradient(180deg, #F6B88A 0, #E58E8E 40%, #4F7A55 66%, #2D5D3A); --tc-pat: none; }
.tc-bg-fireworks { --tc-bg: radial-gradient(90px 90px at 20% 24%, rgba(255,200,80,.75), transparent 70%), radial-gradient(110px 110px at 78% 18%, rgba(255,90,140,.7), transparent 70%), radial-gradient(80px 80px at 55% 40%, rgba(120,220,255,.6), transparent 70%), linear-gradient(180deg, #0D1330, #1B2452 70%, #0A0F26); --tc-pat: none; }
.tc-home[class*="tc-bg-"]::before { background: var(--tc-pat), var(--tc-bg); }

/* ---------- phòng #/pet ---------- */
.tc-room { position: relative; border-radius: 22px; overflow: hidden; border: 3px solid var(--ink-line); box-shadow: var(--print-shadow); background: var(--tc-pat), var(--tc-bg, var(--surface-2)); }
.tc-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; pointer-events: none; }
.tc-backdrop[hidden] { display: none; }
.tc-stage { min-height: 340px; display: flex; align-items: flex-end; justify-content: center; padding: 18px 12px 48px; cursor: pointer; }
.tc-room.tc-mini .tc-stage { min-height: 280px; cursor: default; padding-bottom: 20px; }
.tc-stage .tc-bubble { max-width: min(340px, 86vw); }
.tc-room-bar { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px; font-size: .82rem; background: rgba(10, 8, 6, .82); color: #F7EED8; }
.tc-room-bar svg { width: 1em; height: 1em; vertical-align: -2px; }
.tc-full.low > i { background: var(--bad); }
.tc-how { font-size: .82rem; margin: 10px 0 0; }

/* ---------- 士多 ---------- */
.tc-sub { margin: -6px 0 8px; font-size: .86rem; }
.tc-ask-who { margin: 0 0 6px; font-weight: 700; }
.tc-ask-say { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); margin-bottom: 10px; }
.tc-ask-ch { display: grid; gap: 8px; }
.tc-ask-fb { margin-top: 10px; }

/* ---------- tủ đồ ---------- */
.tc-closet { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 14px; align-items: start; }
.tc-closet .tc-room { position: sticky; top: 12px; }
@media (max-width: 720px) { .tc-closet { grid-template-columns: 1fr; } .tc-closet .tc-room { position: relative; top: 0; } }
.tc-bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tc-bgpick { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 92px; padding: 8px; border-radius: 14px; border: 3px solid transparent; cursor: pointer; font: inherit; text-align: left;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 8, 6, .7)), var(--tc-pat), var(--tc-bg); color: #F7EED8; }
.tc-bgpick .tc-backdrop { filter: brightness(.53); }
.tc-bgpick b, .tc-bgpick small { position: relative; }
.tc-bgpick small { opacity: .85; font-size: .76rem; }
.tc-bgpick small svg { width: 1em; height: 1em; vertical-align: -2px; }
.tc-bgpick.on { border-color: var(--gold); }
.tc-bgpick:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.7); }

/* ---------- thành tích ---------- */
.tc-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tc-badges.mini { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); text-align: left; margin: 8px 0; }
.tc-badge { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 10px; border-radius: 16px; text-align: center; border: 2px dashed var(--border); background: var(--surface); }
.tc-badge .tc-medal { font-size: 2rem; filter: grayscale(1); opacity: .5; }
.tc-badge small { font-size: .78rem; color: var(--muted); }
.tc-badge .progress { width: 100%; height: 6px; margin-top: 4px; }
.tc-badge.got { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.tc-badge.got .tc-medal { filter: none; opacity: 1; }
.tc-date { color: var(--gold) !important; font-weight: 700; }
.tc-badge-art { position: relative; display: flex; justify-content: center; }
.tc-badge-art .tc-medal { position: absolute; right: -6px; bottom: 0; font-size: 2.6rem; }

/* ---------- thông báo nổi (thành tích, lên cấp) ---------- */
.tc-toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 210; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px);
  padding: 8px 16px 8px 10px; border-radius: 18px; background: var(--surface); color: var(--text); border: 2px solid var(--gold); box-shadow: var(--shadow); text-decoration: none !important; font-weight: 600; transition: opacity .35s, transform .35s; }
.tc-toast.out { opacity: 0; transform: translate(-50%, 14px); }
.tc-toast svg.ic, .tc-toast > span > svg { width: 1.1em; height: 1.1em; vertical-align: -2px; }

/* ---------- nhà của Tiểu Cường (App.petHouse) ----------
 * Hình CSS tạm cho 8 nấc nhà; có ảnh thật (YY_MASCOT.homes[i].img) thì .has-img chỉ dùng ảnh làm nền. */
.tc-house { position: relative; z-index: 1; width: min(560px, calc(100% - 28px)); min-height: 300px; margin: 14px auto; border-radius: 12px; overflow: hidden; }
.tc-house .tc-stage { position: relative; z-index: 2; min-height: 300px; padding: 36px 12px 14px; }
.tc-mini .tc-house, .tc-mini .tc-house .tc-stage { min-height: 230px; }
.tc-house.has-img { background-size: cover; background-position: center bottom; border: 0; box-shadow: none; }
.tc-house.has-img::before, .tc-house.has-img::after { display: none; }

/* 1 膠盒: hộp nhựa trong suốt có nắp đục lỗ thở */
.tc-house-box { border: 3px solid rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .14), 0 10px 0 rgba(0, 0, 0, .22);
  background: linear-gradient(115deg, rgba(255, 255, 255, .4) 0 5%, transparent 5% 62%, rgba(255, 255, 255, .2) 62% 65%, transparent 65%), linear-gradient(180deg, transparent 81%, rgba(235, 204, 158, .82) 81%), rgba(205, 232, 255, .15); }
.tc-house-box::before { content: ''; position: absolute; left: -3px; right: -3px; top: -3px; height: 22px; z-index: 3; background: radial-gradient(circle, rgba(40, 60, 80, .55) 2.5px, transparent 3px) 0 50% / 22px 22px repeat-x, rgba(230, 244, 255, .85); border-bottom: 2px solid rgba(255, 255, 255, .9); }
/* 2 鞋盒: hộp giày các-tông */
.tc-house-shoebox { background: linear-gradient(180deg, #B5844F, #C99C68 30%, #B98955); border: 5px solid #8B5E32; box-shadow: inset 0 18px 0 rgba(0, 0, 0, .12), 0 10px 0 rgba(0, 0, 0, .22); }
.tc-house-shoebox::after { content: '鞋'; position: absolute; right: 14px; bottom: 10px; font: 900 2.4rem/1 var(--font-zh-serif); color: rgba(90, 50, 20, .35); }
/* 3 籠屋: nhà lồng, song sắt phía trước */
.tc-house-cage { background: linear-gradient(180deg, #D8CFBF, #BFB4A0); border: 4px solid #555; }
.tc-house-cage::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(60, 60, 60, .75) 0 3px, transparent 3px 30px), repeating-linear-gradient(180deg, rgba(60, 60, 60, .75) 0 3px, transparent 3px 30px); opacity: .55; }
/* 4 劏房: tường vàng ố, cửa sổ nhỏ, sàn gạch */
.tc-house-subdiv { background: radial-gradient(60px 40px at 78% 30%, rgba(140, 110, 60, .25), transparent 70%), linear-gradient(180deg, #DCD3BF 0 72%, #9C8F78 72%); border: 4px solid #6F6553; }
.tc-house-subdiv::before { content: ''; position: absolute; right: 26px; top: 34px; width: 62px; height: 48px; background: linear-gradient(#9FD0EE, #CFE7F5); border: 4px solid #6F6553; box-shadow: inset 0 0 0 2px #fff; }
/* 5 唐樓: gạch men xanh, sàn ô cờ */
.tc-house-tonglau { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 28px) 0 0 / 100% 70% no-repeat, repeating-linear-gradient(180deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 28px) 0 0 / 100% 70% no-repeat,
  repeating-conic-gradient(#EDE4D0 0 25%, #3D4A44 0 50%) 0 100% / 28px 28px, linear-gradient(180deg, #5E8F7B 0 70%, transparent 70%); border: 4px solid #2F4A3F; }
/* 6 公屋: tường màu kem, cửa sắt kéo */
.tc-house-public { background: linear-gradient(180deg, #F2D7A6 0 70%, #C9B08A 70%); border: 4px solid #8A6F45; }
.tc-house-public::before { content: ''; position: absolute; left: 18px; top: 30px; width: 70px; height: 150px; background: repeating-linear-gradient(90deg, #6B7A86 0 4px, transparent 4px 12px), #E9DCC0; border: 4px solid #6B7A86; }
/* 7 村屋: trời xanh, mái đỏ */
.tc-house-village { background: linear-gradient(180deg, #BFE3F7 0 30%, #F6EEDC 30% 76%, #8DBB6A 76%); border: 4px solid #8A5A3C; }
.tc-house-village::before { content: ''; position: absolute; left: -4px; right: -4px; top: 0; height: 34%; background: #B5372E; clip-path: polygon(0 100%, 50% 0, 100% 100%); opacity: .9; }
/* 8 豪宅: cửa kính lớn nhìn ra cảng đêm, viền vàng, sàn đá */
.tc-house-mansion { background: radial-gradient(4px 4px at 20% 26%, #FFE27A, transparent), radial-gradient(4px 4px at 60% 22%, #FF9FC4, transparent), radial-gradient(4px 4px at 82% 30%, #9FE3FF, transparent),
  linear-gradient(180deg, #121A3D 0 44%, #23305E 44% 64%, #E9E4DA 64%); border: 5px solid #C9A24A; box-shadow: inset 0 0 0 3px rgba(255, 230, 160, .5), 0 10px 0 rgba(0, 0, 0, .22); }
.tc-house-mansion::before { content: ''; position: absolute; left: 0; right: 0; top: 40%; height: 10px; background: repeating-linear-gradient(90deg, #FFD36A 0 14px, transparent 14px 22px); opacity: .5; }

/* ---------- việc hôm nay, tab 屋企 ---------- */
.tc-care .task { margin-top: 6px; }
.tc-care .task-ic { font-size: 1.1rem; }
.tc-home-chips { gap: 6px; }
.tc-home-chips .chip { text-decoration: none; }
.tc-home-chips svg { width: 1em; height: 1em; }

/* Phòng, danh mục tiệm và ảnh vật phẩm */
.tc-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tc-page-head h1 { font-size: clamp(1.25rem, 4vw, 1.8rem); margin: 2px 0 0; }
.tc-page-zh { color: var(--muted); font-size: .84rem; }
.tc-page-stats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-room-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .44fr); gap: 14px; align-items: start; }
.tc-room-details { min-width: 0; display: grid; gap: 10px; }
.tc-play { min-width: 0; }
.tc-play .tc-house { width: calc(100% - 28px); max-width: 660px; }
.tc-play .tc-stage { padding: 22px 8px 10px; }
.tc-play .tc-stage .tc-wrap { max-width: 100%; }
.tc-play .tc-stage .tc-bubble { max-width: min(100%, 340px); }
.tc-play .tc-lg { width: clamp(190px, 28vw, 266px); }
.tc-prop { display: grid; place-items: center; width: 100%; height: 100%; font-size: 1.8rem; line-height: 1; }
.tc-prop img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.tc-prop img[hidden], .tc-prop img:not([hidden]) + span { display: none; }


@media (max-width: 1000px) {
  .tc-room-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tc-play .tc-house { width: calc(100% - 16px); margin: 8px auto; }
  .tc-play .tc-stage, .tc-play .tc-house { min-height: 250px; }
  .tc-play .tc-lg { width: min(205px, 58vw); }
  .tc-room-bar { padding: 6px 8px; font-size: .74rem; }
}

/* Nhà ghép lớp: khung sau → đồ → Tiểu Cường → viền kính → nút đặt. */
.tc-room .tc-layout { isolation: isolate; }
.tc-room .tc-layout.has-img { min-height: 0; width: min(520px, calc(100% - 20px)); overflow: visible; background: none; }
.tc-room .tc-layout.tc-geo-box.has-img { width: min(235px, 61%); }
.tc-shell { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.tc-room .tc-layout .tc-stage { position: absolute; inset: 0; min-height: 0; padding: 0; display: block; z-index: 3; pointer-events: none; }
.tc-layout .tc-wrap { position: absolute; inset: 0; display: block; }
.tc-layout .tc-wrap > .tc, .tc-layout > .tc-stage > .tc { position: absolute; left: var(--x); bottom: var(--y); transform: translateX(-50%); width: var(--friend); pointer-events: auto; }
.tc-layout .tc-wrap > .tc-s-room-rest { left: var(--rest-x); bottom: var(--rest-y); }
.tc-layout .tc-s-room-rest .tc-img { aspect-ratio: auto; }
:root:not([data-fx="less"]) .tc-layout .tc-s-room-rest .tc-img { animation: tc-breathe 4s ease-in-out infinite; }
.tc-layout .tc-stage .tc-bubble { position: absolute; z-index: 1; top: 8%; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(310px, 105%); pointer-events: auto; cursor: pointer; }
.tc-layout .tc-stage .tc-bubble small { max-width: 34ch; }
.tc-room-object, .tc-room-target { position: absolute; left: var(--x); bottom: var(--y); transform: translateX(-50%); }
.tc-room-object { width: var(--object); z-index: 2; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.tc-room-object.on-wall { z-index: 1; }
.tc-room-object .tc-prop { display: flex; width: 100%; height: auto; font-size: clamp(1.2rem, 4vw, 2.4rem); }
.tc-room-object .tc-prop img { display: block; width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 2px 1px #31241948); }
.tc-glazing { position: absolute; z-index: 4; inset: 18% 5% 5%; pointer-events: none; border-radius: 5% 5% 12% 12%;
  background: linear-gradient(95deg, #fff3 0 2%, transparent 7% 89%, #fff2 97%); }
.tc-room-target { z-index: 5; bottom: calc(var(--y) - 7px); display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  color: #fff8e9; background: #21170fd9; border: 1px solid #f5e7c4; border-radius: 50%; font: 700 1.1rem/1 var(--font-ui, sans-serif); cursor: pointer; }
.tc-room-target:disabled { opacity: .4; cursor: default; }
.tc-room-target.can-place { color: #2a2116; background: #fff1ba; box-shadow: 0 0 0 3px #5f420f63; }
.tc-room-target.can-place:hover, .tc-room-target.can-place:focus-visible { background: #ffdc7e; }
.tc-house-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 14px; align-items: start; }
.tc-house-editor h2 { font-size: 1.18rem; margin: 0; }
.tc-editor-card .row { gap: 8px; }
.tc-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tc-editor-actions .btn { min-height: 40px; }
.tc-editor-save { border-top: 1px solid var(--border); padding-top: 9px; }
.tc-editor-message { margin: 8px 0 0; font-size: .84rem; min-height: 1.2em; }
.tc-modal-scene { max-width: 360px; margin: 8px auto; }
.tc-modal-scene .tc-layout.tc-geo-box.has-img { width: min(130px, 54%); margin-block: 8px; }
.tc-modal-scene .tc-layout:not(.has-img) { min-height: 135px; margin-block: 8px; }
.tc-modal-scene .tc-room-bar { font-size: .72rem; padding: 5px 8px; }
@media (max-width: 740px) {
  .tc-house-editor { grid-template-columns: minmax(0, 1fr); }
  .tc-room .tc-layout.tc-geo-box.has-img { width: min(190px, 60%); }
  .tc-modal-scene .tc-layout.tc-geo-box.has-img { width: min(116px, 48%); }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-fx="less"]) .tc-layout .tc-img { animation: none; }
}
.tc-move-modes { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.tc-move-modes label { cursor: pointer; font-size: .88rem; }

/* =========================================================================
 * Thiết kế lại 12/2026 theo mẫu Finch, Duolingo, Forest, Tolan, BitePal trên Mobbin.
 * Quy tắc chữ (pet-kit.js): ô, tab, chip chỉ tiếng Việt; chữ Hán + Jyutping chỉ ở khối từ (.tc-word) và câu để học.
 * Cỡ chữ dùng 5 bậc: .75rem · .875rem · 1rem · 1.25rem · 1.75rem. Bo góc: ô 18px, viên 999px.
 * "Sân khấu" sau món (tường kem + sàn gỗ) lấy từ thẻ cây của Forest Store; màu trộn từ token nên tự đổi sáng / tối.
 * ========================================================================= */
.tc-page-head, .tc-shop, .tc-closet, .tc-house-editor, .tc-room-grid, .tc-sheet {
  --tc-wall: color-mix(in srgb, var(--gold) 15%, var(--surface-2));
  --tc-floor: color-mix(in srgb, #9a6a3f 34%, var(--surface-2));
  --tc-floor-edge: color-mix(in srgb, #9a6a3f 55%, var(--surface-2));
  --tc-stage: linear-gradient(180deg, var(--tc-wall) 0 68%, var(--tc-floor-edge) 68% 70.5%, var(--tc-floor) 70.5%);
}

/* ---------- đầu trang: tên, cấp, ví; tab dạng viên (Forest) ---------- */
.tc-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tc-page-head h1 { font-size: 1.75rem; line-height: 1.1; margin: 0; }
.tc-page-stats { display: flex; gap: 8px; align-items: center; }
.tc-lvpill, .tc-wallet { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px; font-size: .875rem; font-weight: 800;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; white-space: nowrap; }
.tc-lvpill svg, .tc-wallet svg { width: 20px; height: 20px; color: var(--gold); }
.tc-wallet { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.tc-coin { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; white-space: nowrap; }
.tc-coin svg { width: 1.1em; height: 1.1em; color: var(--gold); }

.tc-page-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tc-page-tabs::-webkit-scrollbar { display: none; }
.tc-page-tabs .tab { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin: 0; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 700; }
.tc-page-tabs .tab svg { width: 20px; height: 20px; flex: 0 0 auto; }
.tc-page-tabs .tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), inset 0 0 0 1px var(--border); }
.tc-page-tabs .tab.active svg { color: var(--gold); }

/* viên chuyển mục trong một khung (Forest "Planting Settings / My Favorite") */
.tc-seg, .tc-filters { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.tc-seg { margin-bottom: 12px; }
.tc-seg-btn, .tc-filter { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: inherit; font-size: .875rem; font-weight: 700; text-decoration: none !important; cursor: pointer; white-space: nowrap; }
.tc-filter { min-height: 34px; font-size: .75rem; padding: 0 10px; }
.tc-seg-btn svg { width: 18px; height: 18px; }
.tc-seg-btn.on, .tc-filter[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), inset 0 0 0 1px var(--border); }
.tc-filters { grid-auto-columns: auto; }

/* ---------- ô món (dùng chung: tiệm, kho nội thất, kiểu nhà, đồ ăn, tủ đồ) ---------- */
.tc-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tc-shelf.dense, .tc-gear-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.tc-tile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; padding: 8px 8px 10px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 0 var(--border); color: var(--text); font: inherit; text-align: center; cursor: pointer; text-decoration: none !important; }
.tc-tile:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); }
.tc-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
:root:not([data-fx="less"]) .tc-tile:active { transform: translateY(2px); box-shadow: none; }
.tc-tile-art { display: grid; place-items: end center; aspect-ratio: 1; padding: 12% 14% 14%; border-radius: 12px; background: var(--tc-stage); overflow: hidden; }
.tc-tile-art .tc-prop { width: 100%; height: 100%; font-size: 2rem; }
.tc-tile-art .tc-prop img { object-fit: contain; object-position: center bottom; filter: drop-shadow(0 3px 2px rgba(40, 24, 10, .22)); }
.tc-tile-name { font-size: .875rem; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-tile-foot { font-size: .875rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.tc-tile-foot.price { color: var(--text); }
.tc-tile-foot.ok { color: var(--ok); }
.tc-tile.is-short .tc-tile-foot.price { color: var(--muted); }
.tc-tile.is-lock .tc-tile-art > * { filter: grayscale(.9); opacity: .45; }
.tc-tile.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.tc-tile-badge { position: absolute; top: 12px; right: 12px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .75rem; font-weight: 800; }
.tc-tile-badge svg { width: 14px; height: 14px; }
.tc-tile-badge.ok { background: var(--ok); border-color: transparent; color: #fff; }
.tc-tile-badge.n { background: var(--gold); border-color: transparent; color: #2a1d05; }
.tc-tile-theme .tc-tile-art, .tc-tile-theme .tc-home-ph { padding: 4%; background: var(--surface-2); place-items: center; }
.tc-tile-theme .tc-tile-art img { width: 100%; height: 100%; object-fit: contain; }
.tc-tile-theme.on { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 55%, transparent); }
.tc-tile-wear .tc-tile-art, .tc-look .tc-tile-art { padding: 4% 6% 6%; }
.tc-tile-add { border-style: dashed; box-shadow: none; justify-content: center; color: var(--muted); }
.tc-tile-add .tc-tile-art { background: none; place-items: center; }
.tc-tile-add .tc-tile-art svg { width: 30px; height: 30px; }
.tc-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 18px; border: 1px dashed var(--border); }
.tc-empty p { flex: 1 1 160px; margin: 0; font-size: .875rem; }

/* ---------- tiệm: biển hiệu + bà chủ, món hôm nay, viên danh mục ---------- */
.tc-shop-hero { display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px 0; margin-bottom: 12px; border-radius: 22px; border: 1px solid var(--border); background: var(--tc-stage); overflow: hidden; }
.tc-shop-hero .tc-keeper { flex: 0 0 auto; }
.tc-shop-hero .tc-keeper .tc-md { width: 104px; }
.tc-shop-intro { flex: 1; min-width: 0; padding-bottom: 18px; }
.tc-sign { display: inline-block; padding: 2px 10px 2px 14px; border-radius: 8px; letter-spacing: .25em; font: 900 1.5rem/1.3 var(--font-zh-serif);
  background: var(--tram-green); color: var(--cream); border: 2px solid var(--sign-gold); box-shadow: 0 0 0 2px var(--tram-green); }
.tc-shop-intro h2 { margin: 10px 0 2px; font-size: 1.25rem; }
.tc-shop-intro p { margin: 0; font-size: .875rem; }
.tc-spot { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 14px; padding: 8px 16px 8px 8px; border-radius: 18px; cursor: pointer; font: inherit; text-align: left;
  color: var(--text); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--border)); }
.tc-spot-art { flex: 0 0 56px; height: 56px; padding: 4px; border-radius: 12px; background: var(--surface); }
.tc-spot-art .tc-prop img { object-fit: contain; }
.tc-spot-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-spot-t small { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 800; color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
.tc-spot-t small svg { width: 14px; height: 14px; }
.tc-spot-t b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-spot-price { font-size: 1rem; }
.tc-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px 6px; scrollbar-width: none; }
.tc-pills::-webkit-scrollbar { display: none; }
.tc-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: .875rem; font-weight: 700; }
.tc-pill svg { width: 18px; height: 18px; }
.tc-pill[aria-pressed="true"] { background: var(--tram-green); border-color: var(--tram-green); color: #fff; }
.tc-shelf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 4px 0 12px; }
.tc-shelf-head p { flex: 1 1 220px; margin: 0; font-size: .875rem; }

/* ---------- bảng mua (trượt lên): xem trước, khối từ, câu hỏi ---------- */
.modal-wrap.tc-sheet-wrap .modal { text-align: left; border-top: 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 641px) { .modal-wrap.tc-sheet-wrap .modal { width: min(460px, 100%); } }
.tc-sheet { display: flex; flex-direction: column; gap: 12px; }
.tc-sheet > :first-child { margin-top: 26px; }
.tc-sheet-art { display: grid; place-items: end center; height: 160px; padding: 14px 0 26px; border-radius: 18px; background: var(--tc-stage); }
.tc-sheet-art .tc-prop { width: 116px; height: 116px; font-size: 3rem; }
.tc-sheet-art .tc-prop img { object-fit: contain; object-position: center bottom; filter: drop-shadow(0 4px 3px rgba(40, 24, 10, .25)); }
.tc-sheet-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 210px; border-radius: 18px; overflow: hidden; background: var(--tc-pat), var(--tc-bg, var(--surface-2)); }
.tc-sheet-stage .tc { position: relative; z-index: 1; margin-bottom: 6px; }
.tc-sheet .tc-modal-scene { margin: 0 auto; width: 100%; }
.tc-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tc-sheet-price { flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--gold); font-size: 1rem; }
.tc-sheet-facts, .tc-sheet-note { margin: -4px 0 0; font-size: .875rem; }

/* khối từ: chữ Hán to → Jyutping trong viên có loa → nghĩa nhạt (mẫu thẻ từ của Vocabulary, Babbel, Preply) */
.tc-word { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.tc-word-zh { font-family: var(--font-zh); font-size: 1.75rem; line-height: 1.15; font-weight: 700; }
.tc-word-jp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .875rem; }
.tc-word-jp svg { width: 16px; height: 16px; color: var(--muted); }
.tc-word-jp:hover svg { color: var(--gold); }
.tc-word-vi { font-size: 1rem; color: var(--muted); }
.tc-word.sm { align-items: center; margin: 0 auto 10px; }
.tc-word.sm .tc-word-zh { font-size: 1.25rem; }

.tc-ask { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.tc-ask-keeper { display: flex; align-items: flex-end; gap: 8px; }
.tc-ask-keeper .tc-xs { width: 44px; }
.tc-ask .tc-ask-say { flex: 1; margin: 0; padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.tc-ask-q { margin: 0; font-weight: 700; font-size: 1rem; }
.tc-short { color: var(--bad); font-weight: 600; font-size: .875rem; }
.tc-modal-title { font-size: 1.25rem; margin: 0 40px 8px 0; }

/* ---------- phòng: chỉ số, nút hành động tròn (Abode), khay đồ ăn ---------- */
.tc-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.tc-stat { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.tc-stat-ic { flex: 0 0 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.tc-stat-ic svg { width: 18px; height: 18px; }
.tc-stat-ic.lv { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); }
.tc-stat-ic.full { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tc-stat-ic.full.low { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.tc-stat-ic.comfy { background: color-mix(in srgb, var(--l-sky) 18%, transparent); color: var(--l-sky); }
.tc-stat-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tc-stat-b small { display: flex; justify-content: space-between; gap: 6px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.tc-stat-b small b { color: var(--text); }
.tc-stat-b .progress { height: 6px; }
.tc-stat-n { font-size: 1.25rem; line-height: 1; }
.tc-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.tc-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; }
.tc-act > span { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.tc-act > span svg { width: 26px; height: 26px; }
.tc-act.feed > span { background: var(--l-orange); } .tc-act.talk > span { background: var(--l-sky); }
.tc-act.poke > span { background: var(--l-pink); } .tc-act.snap > span { background: var(--l-teal); }
:root:not([data-fx="less"]) .tc-act:active > span { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.tc-act:focus-visible { outline: none; } .tc-act:focus-visible > span { outline: 3px solid var(--gold); outline-offset: 2px; }
.tc-learn { margin-top: 16px; min-height: 48px; justify-content: center; }
.tc-care-bar { height: 6px; margin: 10px 0 4px; }
.tc-tray { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 10px; overflow-x: auto; margin-top: 10px; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.tc-tray .tc-tile { scroll-snap-align: start; }
.tc-room-details .card { padding: 16px; }

/* ---------- tủ đồ: Tiểu Cường mặc thử ở trên (dính khi cuộn), lưới ảnh ở dưới (Finch, Duolingo) ---------- */
.tc-closet { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.tc-closet .tc-room { position: relative; top: auto; }
.tc-closet-prev { position: sticky; top: 12px; z-index: 3; }
.tc-closet-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; margin-top: 8px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.tc-closet-name { display: flex; flex-direction: column; min-width: 0; }
.tc-closet-name b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-closet-name small { font-size: .75rem; color: var(--muted); }
.tc-closet-cta { display: flex; gap: 6px; flex: 0 0 auto; }
.tc-closet-panel { padding: 14px; }
.tc-looks { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.tc-look { gap: 4px; padding: 4px 4px 6px; border-radius: 14px; }
.tc-look .tc-tile-badge { top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 4px; }
.tc-look .tc-tile-foot { font-size: .75rem; }
.tc-look.is-on { border-color: var(--ok); }
.tc-look.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.tc-look .tc-thumb { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.tc-thumb-ic { font-size: 1.8rem; line-height: 1; }
.tc-bgpick b { font-size: .875rem; }

/* ---------- tab Nhà: cảnh + thẻ điều khiển; thẻ nhà có ảnh từng bậc ---------- */
.tc-house-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 16px; align-items: start; }
.tc-editor-card { padding: 14px; }
.tc-sub { margin: 0 0 12px; font-size: .875rem; }
.tc-slot-picks { margin: 0 0 12px; }
.tc-homes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tc-home-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px 8px 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); text-align: center; }
.tc-home-card.cur { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 45%, transparent); }
.tc-home-card.next { border-color: color-mix(in srgb, var(--gold) 70%, var(--border)); }
.tc-home-card.later .tc-home-thumb img { filter: grayscale(.7); opacity: .55; }
.tc-home-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.tc-home-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tc-home-ph svg { width: 40px; height: 40px; color: var(--muted); }
.tc-home-n { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--surface); border: 1px solid var(--border); }
.tc-home-t { display: flex; flex-direction: column; gap: 2px; }
.tc-home-t b { font-size: .875rem; line-height: 1.25; }
.tc-home-t small, .tc-home-why { font-size: .75rem; color: var(--muted); }
.tc-home-why svg { width: 12px; height: 12px; vertical-align: -1px; }
.tc-home-act { display: flex; justify-content: center; margin-top: auto; }
.tc-home-act .btn, .tc-home-act .chip { width: 100%; justify-content: center; }
.tc-home-act .chip { min-height: 34px; }

@media (max-width: 740px) {
  .tc-house-editor, .tc-closet { grid-template-columns: minmax(0, 1fr); }
  .tc-closet-prev { top: 0; margin: 0 -4px; padding: 4px 4px 8px; background: var(--bg); }
  .tc-closet-prev .tc-room .tc-layout.has-img { width: min(300px, 76%); }
  .tc-closet-prev .tc-room .tc-layout.tc-geo-box.has-img { width: min(150px, 42%); }
}
@media (max-width: 560px) {
  .tc-page-head h1 { font-size: 1.25rem; }
  .tc-page-tabs .tab { flex-direction: column; gap: 2px; min-height: 52px; padding: 0 8px; font-size: .75rem; }
  .tc-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tc-stat-link { grid-column: 1 / -1; }
  .tc-stat-link .tc-stat-b { flex-direction: row; align-items: center; justify-content: space-between; }
  .tc-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tc-shelf.dense, .tc-gear-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tc-looks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tc-homes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-shelf.dense .tc-tile, .tc-gear-grid .tc-tile { padding: 6px 6px 8px; border-radius: 16px; }
  .tc-shelf.dense .tc-tile-name, .tc-gear-grid .tc-tile-name { font-size: .75rem; }
  .tc-shelf.dense .tc-tile-badge, .tc-gear-grid .tc-tile-badge { top: 8px; right: 8px; }
}
.tc-modal-scene .tc-layout.tc-geo-glass.has-img { width: min(260px, 76%); margin-block: 6px; }
/* tủ đồ: sân khấu riêng (cảnh nền + Tiểu Cường to), không vẽ cả căn nhà */
.tc-closet-stage { height: 300px; border: 3px solid var(--ink-line); box-shadow: var(--print-shadow); border-radius: 22px; }
.tc-closet-stage #tcCloset { position: relative; z-index: 1; display: flex; justify-content: center; width: 100%; }
.tc-closet-stage .tc-lg { width: min(230px, 60vw); margin-bottom: -6px; }
.tc-sub svg { width: 1em; height: 1em; vertical-align: -2px; color: var(--ok); }
@media (max-width: 740px) { .tc-closet-stage { height: 240px; } .tc-closet-stage .tc-lg { width: min(190px, 50vw); } }
@media (max-width: 560px) {
  .tc-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tc-seg-btn svg { display: none; }
  .tc-pills { flex-wrap: wrap; overflow: visible; }
  .tc-pill { min-height: 36px; padding: 0 12px; }
}
/* bảng mua: chữ căn trái (thắng quy tắc căn giữa chung của .as-sheet), nút đổi ảnh món / cảnh nhà */
.modal-wrap.as-sheet.tc-sheet-wrap .modal { text-align: left; }
.tc-sheet { position: relative; }
.tc-view-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: -4px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .875rem; font-weight: 700; }
.tc-view-toggle svg { width: 18px; height: 18px; color: var(--muted); }
.tc-view-toggle[aria-pressed="true"] { border-color: var(--gold); }
.tc-sheet-view .tc-sheet-note { margin: 6px 0 0; text-align: center; }
.tc-learn { width: 100%; }
/* biển hiệu tiệm: sàn thấp hơn để chữ luôn nằm trên tường */
.tc-shop-hero { background: linear-gradient(180deg, var(--tc-wall) 0 84%, var(--tc-floor-edge) 84% 86.5%, var(--tc-floor) 86.5%); }

/* =========================================================================
 * Cảnh nhà đúng tỉ lệ (12/2026). Nhà là một hộp nhỏ (hộp nhựa, mô hình 唐樓, hộp kính), không phải căn phòng cỡ người:
 *   1. cảnh thật phía sau (quán trà, phà, phố…) vẽ mờ và phóng to như ảnh chụp cận cảnh đồ vật → mắt hiểu là ở xa;
 *   2. hộp ngồi trên một mặt phẳng phía trước (.tc-surface) hợp với chỗ đặt: bàn quán trà, ghế phà, bậu cửa, quầy vé…;
 *   3. bóng đổ dưới chân hộp cho cảm giác "đặt lên", hộp nhỏ lại để còn thấy mặt bàn.
 * Cùng cách với Forest (cây trong chậu đất giữa nền dịu) và Kit (bình đặt giữa nền) trên Mobbin.
 * ========================================================================= */
.tc-bg-chachaan { --tc-top: linear-gradient(180deg, #f1e8d4, #e0d0ad); --tc-edge: #2f6b57; }
.tc-bg-ferry { --tc-top: repeating-linear-gradient(180deg, #a56b3c 0 16px, #7f4f29 16px 18px); --tc-edge: #5a3418; }
.tc-bg-neon { --tc-top: repeating-linear-gradient(90deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 38px), linear-gradient(180deg, #dbe6de, #b7cabd); --tc-edge: #3f6e5c; }
.tc-bg-cinema { --tc-top: linear-gradient(180deg, #93303b, #6a1621); --tc-edge: #d3a64a; }
.tc-bg-peak { --tc-top: radial-gradient(2px 2px at 20% 30%, rgba(0, 0, 0, .12), transparent), radial-gradient(2px 2px at 70% 60%, rgba(0, 0, 0, .1), transparent), linear-gradient(180deg, #ece1c9, #cfbf9e); --tc-edge: #a89571; }
.tc-bg-fireworks { --tc-top: repeating-linear-gradient(90deg, #4f3322 0 44px, #3f281a 44px 46px); --tc-edge: #241509; }

/* 1. cảnh xa: mờ + phóng to (cả cảnh nhà, ảnh mặc thử và ô chọn chỗ đặt) */
.tc-room > .tc-backdrop, .tc-sheet-stage > .tc-backdrop, .tc-bgpick > .tc-backdrop { filter: blur(6px) saturate(.92) brightness(.93); transform: scale(1.2); object-position: center 42%; }
.tc-bgpick > .tc-backdrop { filter: blur(3px) brightness(.62); }
/* 2. mặt phẳng phía trước */
.tc-surface { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; height: calc(34px + 22%); pointer-events: none;
  background: var(--tc-top, var(--surface-2)); box-shadow: 0 -3px 0 var(--tc-edge, rgba(0, 0, 0, .25)), inset 0 4px 0 rgba(255, 255, 255, .28), inset 0 18px 22px -12px rgba(0, 0, 0, .25); }
.tc-sheet-stage > .tc-surface { height: 24%; }
.tc-bgpick > .tc-surface { height: 34%; }
.tc-bgpick > b, .tc-bgpick > small { z-index: 1; }
/* 3. hộp nhỏ lại, ngồi trên mặt phẳng, có bóng đổ */
.tc-room .tc-layout { margin: 40px auto 20px; }
.tc-room .tc-layout.has-img::before { content: ''; display: block; position: absolute; z-index: -1; left: 4%; right: 4%; bottom: -3%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(25, 14, 5, .55), rgba(25, 14, 5, 0)); }
.tc-room .tc-shell { filter: drop-shadow(0 6px 6px rgba(25, 14, 5, .28)); }
.tc-room .tc-layout.tc-geo-box.has-img { width: min(180px, 46%); }
.tc-room .tc-layout.tc-geo-glass.has-img { width: min(360px, 76%); }
.tc-room .tc-layout.tc-geo-tonglau.has-img { width: min(420px, 84%); }
.tc-modal-scene .tc-room .tc-layout { margin: 24px auto 14px; }
.tc-modal-scene .tc-layout.tc-geo-box.has-img { width: min(110px, 40%); }
.tc-modal-scene .tc-layout.tc-geo-glass.has-img { width: min(240px, 70%); }
.tc-modal-scene .tc-surface { height: calc(28px + 22%); }
/* bong bóng lời nói được rộng hơn hộp (hộp đã nhỏ lại) */
.tc-layout .tc-stage .tc-bubble { max-width: min(300px, 84vw); }
/* ảnh mặc thử / tủ đồ: Tiểu Cường đứng trên mặt phẳng, cảnh mờ phía sau */
.tc-sheet-stage .tc { margin-bottom: 9%; }
.tc-closet-stage .tc-lg { margin-bottom: 7%; }
.tc-closet-stage #tcCloset { align-self: flex-end; }
@media (max-width: 560px) {
  .tc-room .tc-layout { margin-top: 34px; }
  .tc-room .tc-layout.tc-geo-box.has-img { width: min(160px, 44%); }
  .tc-surface { height: calc(30px + 22%); }
}
/* ô chỗ đặt: chỉ tranh vẽ của nơi đó (ảnh bg-*), chữ nằm dưới ảnh như mọi ô khác */
.tc-place-art { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.tc-place-art > .tc-backdrop { object-position: center 55%; }
.tc-place.on { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 55%, transparent); }
.tc-place.is-lock .tc-place-art > * { filter: grayscale(.9) blur(3px); opacity: .55; }
.tc-place:disabled { cursor: not-allowed; }
.tc-places { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 560px) {
  .tc-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-seg-btn { padding: 0 4px; font-size: .8125rem; }
  .tc-room .tc-layout { margin-top: 56px; }
}
/* Độ mờ cảnh xa: chỉ 1,2px để vẫn thấy rõ tranh (quầy bánh, ghế, đèn). Mặt bàn phía trước + bóng đổ đã đủ cho
   mắt hiểu hộp ở gần; mờ mạnh làm mất tranh. Ô chọn chỗ đặt để nét hẳn cho dễ chọn. */
.tc-room > .tc-backdrop, .tc-sheet-stage > .tc-backdrop { filter: blur(1.2px) saturate(.96) brightness(.96); transform: scale(1.03); }
.tc-place-art > .tc-backdrop { filter: none; transform: none; }
/* chỗ đặt chưa mở: vẫn thấy rõ tranh (để biết mình đang học hướng tới gì), chỉ nhạt màu + ổ khoá */
.tc-place.is-lock .tc-place-art > * { filter: grayscale(.45) brightness(.92); opacity: .85; }

/* ---------- tiệm: mục Giữ chuỗi dạng hàng (mẫu Duolingo Shop) ---------- */
.tc-mine { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.tc-mine-art { flex: 0 0 48px; height: 48px; }
.tc-mine-art .tc-prop img { object-fit: contain; }
.tc-mine-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-mine-t b { font-size: 1rem; }
.tc-mine-t small { font-size: .875rem; color: var(--muted); }
.tc-mine-bar { display: flex; gap: 4px; }
.tc-mine-bar i { width: 10px; height: 26px; border-radius: 4px; background: var(--surface-3); }
.tc-mine-bar i.on { background: var(--l-sky); }
.tc-list-h { margin: 18px 0 8px; font-size: 1rem; }
.tc-rows { display: grid; gap: 10px; }
.tc-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 14px; border-radius: 18px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 0 var(--border); color: var(--text); font: inherit; text-align: left; text-decoration: none !important; }
.tc-row:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); }
.tc-row.is-off { opacity: .7; }
.tc-row-tag { position: absolute; top: -9px; left: 12px; padding: 2px 10px; border-radius: 999px; background: var(--l-sky); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.tc-row-art { position: relative; flex: 0 0 52px; height: 52px; border-radius: 12px; background: var(--tc-stage); display: grid; place-items: center; padding: 6px; }
.tc-row-art .tc-prop img { object-fit: contain; }
.tc-row-n { position: absolute; right: -6px; bottom: -6px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #2a1d05; font-size: .75rem; }
.tc-row-ic { background: color-mix(in srgb, var(--l-orange) 18%, var(--surface)); color: var(--l-orange); }
.tc-row-ic svg { width: 26px; height: 26px; }
.tc-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-row-t b { font-size: 1rem; }
.tc-row-t small { font-size: .875rem; color: var(--muted); line-height: 1.35; }
.tc-row-price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 1rem; }
.tc-row-price s { font-size: .75rem; color: var(--muted); }
.tc-row-price small { font-size: .875rem; color: var(--muted); font-weight: 700; }
.tc-row-price svg { width: 18px; height: 18px; color: var(--muted); }
.tc-row.is-fix { border-color: color-mix(in srgb, var(--l-orange) 55%, var(--border)); }

/* ---------- vật phẩm thưởng (không bán): nhãn độ hiếm, ô "Thưởng", bảng mục tiêu, màn nhận quà ---------- */
.tc-rare { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.tc-rare.r1 { background: var(--l-sky); }
.tc-rare.r2 { background: var(--l-purple); }
.tc-tile > .tc-rare { position: absolute; top: 12px; left: 12px; z-index: 1; }
.tc-tile-badge.gift { background: color-mix(in srgb, var(--l-purple) 85%, #000); border-color: transparent; color: #fff; }
.tc-tile-foot.gift { color: color-mix(in srgb, var(--l-purple) 75%, var(--text)); }
.tc-tile.is-reward .tc-tile-art > * { filter: saturate(.75); opacity: .85; }
.tc-sheet-rare { margin-bottom: -4px; }
.tc-goal { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--l-purple) 40%, var(--border));
  background: color-mix(in srgb, var(--l-purple) 7%, var(--surface)); }
.tc-goal > svg { flex: 0 0 24px; width: 24px; height: 24px; color: var(--l-purple); margin-top: 2px; }
.tc-goal > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tc-goal small { color: var(--muted); font-size: .875rem; }
.tc-goal .progress { height: 8px; margin-top: 4px; }
.tc-gift-art { display: grid; place-items: end center; width: 150px; height: 150px; margin: 0 auto; padding: 14px 0 22px; border-radius: 22px; background: var(--tc-stage,
  linear-gradient(180deg, color-mix(in srgb, var(--gold) 15%, var(--surface-2)) 0 68%, color-mix(in srgb, #9a6a3f 34%, var(--surface-2)) 68%)); }
.tc-gift-art .tc-prop { width: 110px; height: 110px; }
.tc-gift-art .tc-prop img { object-fit: contain; }
.tc-gift-art.wide { width: min(260px, 70vw); height: auto; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; }
.tc-gift-art.wide img { width: 100%; height: 100%; object-fit: cover; }
.tc-gift-rare { margin: 0 0 6px; }
