/* Nuôi thú cưng – toàn bộ CSS của trò (tiền tố tc-). Nạp sau style.css.
   Khung cảnh: căn nhà quê, vách tre, nền gạch; bạn thú vẽ bằng SVG. Không dùng cqw (iOS cũ). */
body[data-scene="thucung"] {
  background-color: #f6e7c8;
  background-image: radial-gradient(rgba(150, 100, 40, .08) 1px, transparent 1.5px), linear-gradient(180deg, #fbefd6, #f0dcb4);
  background-size: 7px 7px, auto; background-attachment: scroll, fixed;
}
body[data-scene="thucung"] .tc-backlink, .tc-back { color: #6b3f1d; }
/* ảnh thẻ trò: sinh từ chính hàm vẽ thú (petSVG) bằng $NG2/thucung/test/mkart.js */
.art-thucung { background: #ffe9b8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Crect width='96' height='96' fill='%23ecd08e'/%3E%3Crect x='18' width='2' height='66' fill='%23cfa75c'/%3E%3Crect x='38' width='2' height='66' fill='%23cfa75c'/%3E%3Crect x='58' width='2' height='66' fill='%23cfa75c'/%3E%3Crect x='78' width='2' height='66' fill='%23cfa75c'/%3E%3Crect x='98' width='2' height='66' fill='%23cfa75c'/%3E%3Crect y='66' width='96' height='30' fill='%23b5773e'/%3E%3Crect y='66' width='96' height='3' fill='%238a5a2c'/%3E%3Cg transform='translate(-4 8) scale(.42)'%3E%3Cg transform='translate(100 190) scale(0.88) translate(-100 -190)'%3E%3Cg class='tc-bob'%3E%3Cpath d='M84 178v8l-6 3M84 186l5 3M116 178v8l-6 3M116 186l5 3' stroke='%23e98a00' stroke-width='3.5' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='100' cy='142' rx='46' ry='40' fill='%23ffd84d' stroke='%23e0a800' stroke-width='2.5'/%3E%3Cellipse class='tc-wing' cx='57' cy='140' rx='12' ry='21' transform='rotate(20 57 140)' fill='%23ffc928' stroke='%23e0a800' stroke-width='2.5'/%3E%3Cellipse class='tc-wing tc-wing-r' cx='143' cy='140' rx='12' ry='21' transform='rotate(-20 143 140)' fill='%23ffc928' stroke='%23e0a800' stroke-width='2.5'/%3E%3Cpath d='M95 54q-2-14 6-12q-2 8 3 12' fill='%23ffd84d' stroke='%23e0a800' stroke-width='2.5' stroke-linejoin='round'/%3E%3Ccircle cx='100' cy='90' r='40' fill='%23ffd84d' stroke='%23e0a800' stroke-width='2.5'/%3E%3Cg class='tc-face'%3E%3Cpath d='M75 93q7-10 14 0M111 93q7-10 14 0' fill='none' stroke='%233a2418' stroke-width='3.6' stroke-linecap='round'/%3E%3Cpath d='M90 100l10 6 10-6z' fill='%23f39a1e' stroke='%23c76d00' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M92 109l8 6 8-6z' fill='%23e67e00' stroke='%23c76d00' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cellipse cx='68' cy='105' rx='8' ry='5' fill='%23ff8fa3' opacity='.6'/%3E%3Cellipse cx='132' cy='105' rx='8' ry='5' fill='%23ff8fa3' opacity='.6'/%3E%3C/g%3E%3Cg transform='translate(132 60) rotate(18)'%3E%3Cpath d='M0 0l-15-10v20zM0 0l15-10v20z' fill='%23e53945' stroke='%23a81d2a' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle r='4.5' fill='%23b81f2c'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg transform='translate(52 50) scale(.23)'%3E%3Cg transform='translate(100 190) scale(1) translate(-100 -190)'%3E%3Cg class='tc-bob'%3E%3Cpath d='M144 150q14-2 10 10q-8 2-4-6' stroke='%23c44a5a' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Crect x='64' y='168' width='16' height='18' rx='6' fill='%23ee6f7d' stroke='%23c44a5a' stroke-width='2.5'/%3E%3Crect x='120' y='168' width='16' height='18' rx='6' fill='%23ee6f7d' stroke='%23c44a5a' stroke-width='2.5'/%3E%3Cellipse cx='100' cy='145' rx='47' ry='38' fill='%23ee6f7d' stroke='%23c44a5a' stroke-width='2.5'/%3E%3Cg%3E%3Cellipse cx='88' cy='160' rx='8' ry='3.5' transform='rotate(-30 88 160)' fill='%233fa35a'/%3E%3Cellipse cx='113' cy='161' rx='8' ry='3.5' transform='rotate(30 113 161)' fill='%233fa35a'/%3E%3Ccircle cx='107.0' cy='150.0' r='5.5' fill='%23ffd35c'/%3E%3Ccircle cx='102.2' cy='156.7' r='5.5' fill='%23ffd35c'/%3E%3Ccircle cx='94.3' cy='154.1' r='5.5' fill='%23ffd35c'/%3E%3Ccircle cx='94.3' cy='145.9' r='5.5' fill='%23ffd35c'/%3E%3Ccircle cx='102.2' cy='143.3' r='5.5' fill='%23ffd35c'/%3E%3Ccircle cx='100' cy='150' r='4' fill='%23ff9a3c'/%3E%3C/g%3E%3Cellipse cx='72' cy='128' rx='9' ry='5' fill='%23fff' opacity='.35' transform='rotate(-30 72 128)'/%3E%3Cpath d='M64 70L70 42L92 58zM136 70L130 42L108 58z' fill='%23d9566a' stroke='%23c44a5a' stroke-width='2.5' stroke-linejoin='round'/%3E%3Ccircle cx='100' cy='90' r='42' fill='%23ee6f7d' stroke='%23c44a5a' stroke-width='2.5'/%3E%3Crect x='88' y='52' width='24' height='5.5' rx='2.7' fill='%235a1f28'/%3E%3Cellipse cx='76' cy='68' rx='9' ry='5' fill='%23fff' opacity='.45' transform='rotate(-30 76 68)'/%3E%3Cg class='tc-face'%3E%3Cpath d='M75 93q7-10 14 0M111 93q7-10 14 0' fill='none' stroke='%233a2418' stroke-width='3.6' stroke-linecap='round'/%3E%3Cellipse cx='100' cy='106' rx='15' ry='11' fill='%23d9566a' stroke='%23c44a5a' stroke-width='2.2'/%3E%3Cellipse cx='94' cy='106' rx='2.6' ry='4' fill='%237a2532'/%3E%3Cellipse cx='106' cy='106' rx='2.6' ry='4' fill='%237a2532'/%3E%3Cpath d='M89 120q11 14 22 0z' fill='%239b2f37' stroke='%233a2418' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M95 126q5 4 10 0' fill='%23ff8a96'/%3E%3Cellipse cx='68' cy='105' rx='8' ry='5' fill='%23ff8fa3' opacity='.6'/%3E%3Cellipse cx='132' cy='105' rx='8' ry='5' fill='%23ff8fa3' opacity='.6'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat; }
.tc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tc-seed { width: 18px; height: 18px; flex: none; }

/* ================= Nhận nuôi ================= */
.tc-adopt { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 680px; }
.tc-head { display: flex; gap: 14px; align-items: center; color: #5a3416; }
.tc-headart { display: block; width: 76px; height: 76px; flex: none; border-radius: 14px; border: 3px solid #a8692a; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); background-size: cover; }
.tc-h1 { margin: 0; font: 700 2.4rem/1.25 "Mali", var(--f-hand); color: #5a3416; padding-top: .08em; }
.tc-head p { margin: 4px 0 0; color: #6b4421; font-size: .95rem; }
.tc-box { background: #fffaf0; border: 2px solid #c08a4a; border-radius: 16px; padding: 14px 16px 16px; display: grid; gap: 12px; box-shadow: 0 5px 0 rgba(140, 90, 40, .22); min-width: 0; }
.tc-box h2 { font: 400 1.45rem/1.3 var(--f-hand); color: #7a4515; margin: 0; }
.tc-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tc-pickb { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; min-height: 44px; background: #fff; border: 2px solid #e6cfa6; border-radius: 14px; cursor: pointer; font: 600 .88rem/1.25 var(--f-body); color: #5a3416; }
.tc-pickb .tc-svg { width: 100%; max-width: 104px; }
.tc-pickb[aria-checked="true"] { border-color: #d0701c; background: #fff1d6; box-shadow: 0 0 0 3px rgba(208, 112, 28, .25); }
.tc-pickb span { text-align: center; }
.tc-lab { font: 400 1.25rem var(--f-hand); color: #7a4515; }
.tc-namerow { display: flex; gap: 8px; min-width: 0; }
.tc-namerow input, .tc-box textarea, .tc-so textarea { flex: 1; min-width: 0; font: 600 1.05rem var(--f-body); padding: .6em .8em; border: 2px solid #d6b483; border-radius: 12px; background: #fff; color: var(--text); min-height: 44px; }
.tc-box textarea, .tc-so textarea { width: 100%; font: 500 .85rem/1.4 ui-monospace, Menlo, Consolas, monospace; resize: vertical; word-break: break-all; }
.tc-box .btn.ink, .tc-grew .btn.ink { background: #c0601a; border-color: #8c4210; }
.tc-note { color: #7a5a3a; margin: 0; }
.tc-import-box summary, .tc-rules summary, .tc-so summary { font: 400 1.2rem/1.4 var(--f-hand); color: #7a4515; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.tc-import-box details { display: grid; gap: 8px; }
.tc-import-box details[open] > * + * { margin-top: 8px; }
.tc-rules { background: #fffaf0; border: 1.5px dashed #c08a4a; border-radius: 14px; padding: 10px 16px; }
.tc-rules ul, .tc-so ul { padding-left: 1.2em; margin: 6px 0; display: grid; gap: 6px; font-size: .93rem; }

/* ================= Màn chơi ================= */
.tc-play { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.tc-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tc-back { font: 1.7rem/1 var(--f-hand); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.tc-bt { flex: 1; min-width: 0; display: grid; }
.tc-name { font: 700 1.45rem/1.3 "Mali", var(--f-hand); color: #5a3416; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-sub { font-size: .8rem; color: #7a5a3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-wallet { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; background: #fff6dc; border: 2px solid #e0b45a; border-radius: 999px; font: 700 1rem var(--f-body); color: #7a4c00; min-height: 36px; }
.tc-icon { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px; min-width: 44px; min-height: 44px; }
.tc-main { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.tc-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
@media (min-width: 760px) {
  .tc-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .tc-room { position: sticky; top: 12px; }
}

/* ---- Phòng ---- */
.tc-room { position: relative; height: clamp(250px, 74vw, 380px); border-radius: 18px; overflow: hidden; border: 3px solid #8a5a32; box-shadow: 0 5px 0 rgba(90, 52, 22, .25); isolation: isolate; }
.tc-wall { position: absolute; inset: 0 0 28% 0; }
.tc-floor { position: absolute; inset: 72% 0 0 0; }
/* nền: vách tre (mặc định) */
.tc-nen-tre .tc-wall, .tc-swatch.tc-nen-tre { background: repeating-linear-gradient(90deg, #e7c98a 0 22px, #d9b66f 22px 24px, #efd59c 24px 44px, #cfa75c 44px 46px); }
.tc-nen-tre .tc-floor { background: repeating-linear-gradient(90deg, #b5773e 0 38px, #a86b34 38px 40px); border-top: 5px solid #8a5a2c; }
.tc-nen-san .tc-wall, .tc-swatch.tc-nen-san { background: linear-gradient(180deg, #f3d37a, #eac25a); }
.tc-nen-san .tc-floor { background-color: #c8553a; background-image: linear-gradient(45deg, #b84a31 25%, transparent 25%, transparent 75%, #b84a31 75%), linear-gradient(45deg, #b84a31 25%, transparent 25%, transparent 75%, #b84a31 75%); background-size: 36px 36px; background-position: 0 0, 18px 18px; border-top: 5px solid #e9e2d0; }
.tc-nen-vuon .tc-wall, .tc-swatch.tc-nen-vuon { background: radial-gradient(ellipse 30% 60% at 12% 100%, #4f9e3a 60%, transparent 62%), radial-gradient(ellipse 26% 50% at 88% 100%, #5fb046 60%, transparent 62%), radial-gradient(circle at 80% 22%, #fff3a8 0 8%, transparent 9%), linear-gradient(180deg, #9fd8f5, #d8f1fb); }
.tc-nen-vuon .tc-floor { background: linear-gradient(180deg, #7cc45a, #5fa844); border-top: 5px solid #4e8f35; }
.tc-nen-lop .tc-wall, .tc-swatch.tc-nen-lop { background: linear-gradient(#2f5240, #2f5240) 50% 26% / 62% 46% no-repeat, linear-gradient(#8a5a32, #8a5a32) 50% 26% / 66% 52% no-repeat, linear-gradient(180deg, #f1d47b, #e8c362); }
.tc-nen-lop .tc-wall::after { content: "a b c  1 + 1 = 2"; position: absolute; left: 50%; top: 14%; transform: translateX(-50%); font: 600 1rem var(--f-chalk); color: #f4f1e6; white-space: nowrap; opacity: .9; }
.tc-nen-lop .tc-floor { background: repeating-linear-gradient(90deg, #9a7a52 0 30px, #8d6e48 30px 32px); border-top: 5px solid #6e5230; }
.tc-nen-ao .tc-wall, .tc-swatch.tc-nen-ao { background: radial-gradient(ellipse 9% 5% at 20% 92%, #3f9a4a 90%, transparent 95%), radial-gradient(ellipse 7% 4% at 78% 88%, #3f9a4a 90%, transparent 95%), radial-gradient(circle at 78% 82%, #ff9fc0 0 2.4%, transparent 2.8%), linear-gradient(180deg, #bfe6f2 0 55%, #6fb7c9 55% 100%); }
.tc-nen-ao .tc-floor { background: linear-gradient(180deg, #b9d98a, #96c46a); border-top: 5px solid #78a64e; }
.tc-nen-dem .tc-wall, .tc-swatch.tc-nen-dem { background: radial-gradient(circle at 78% 26%, #fff6c8 0 9%, transparent 10%), radial-gradient(circle at 20% 20%, #fff 0 .6%, transparent 1%), radial-gradient(circle at 40% 36%, #fff 0 .5%, transparent .9%), radial-gradient(circle at 60% 14%, #fff 0 .6%, transparent 1%), radial-gradient(circle at 12% 46%, #fff 0 .5%, transparent .9%), linear-gradient(180deg, #1d2a5a, #3b4c8a); }
.tc-nen-dem .tc-floor { background: repeating-linear-gradient(90deg, #6b4a2c 0 34px, #5e4126 34px 36px); border-top: 5px solid #4a321c; }
.tc-swatch { display: block; width: 100%; height: 100%; border-radius: 8px; }

.tc-petbtn { position: absolute; left: 50%; bottom: 3%; width: min(60%, 250px); transform: translateX(-50%); background: none; border: 0; padding: 0; cursor: pointer; z-index: 3; -webkit-tap-highlight-color: transparent; border-radius: 50%; }
.tc-petbtn:focus-visible { outline: 3px dashed #c0601a; outline-offset: 2px; }
.tc-toys { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tc-toy { position: absolute; width: 15%; max-width: 62px; }
.tc-toy svg { display: block; width: 100%; height: auto; }
.tc-toy-bong { left: 5%; bottom: 5%; }
.tc-toy-quay { right: 6%; bottom: 6%; width: 11%; }
.tc-toy-dieu { left: 6%; top: 8%; transform: rotate(-12deg); }
.tc-toy-gau { right: 4%; bottom: 30%; width: 14%; }
.tc-poops { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.tc-poop { position: absolute; width: 11%; max-width: 44px; bottom: 4%; }
.tc-poop svg { display: block; width: 100%; height: auto; }
.tc-poop0 { left: 20%; } .tc-poop1 { right: 18%; bottom: 9%; } .tc-poop2 { left: 30%; bottom: 13%; width: 9%; }
.tc-poop::after { content: "〰"; position: absolute; left: 10%; top: -60%; color: #8a7a4a; font-size: 14px; opacity: .7; animation: tc-stink 2s ease-in-out infinite; }
.tc-dark { position: absolute; inset: 0; background: rgba(14, 18, 52, .5); opacity: 0; transition: opacity .8s; z-index: 5; pointer-events: none; }
.tc-toi .tc-dark { opacity: 1; }
.tc-fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tc-say { position: absolute; left: 4%; right: 4%; top: 4%; margin: 0; z-index: 7; justify-self: center; width: fit-content; max-width: 92%; margin-inline: auto; background: #fff; color: #4a2c12; border: 2px solid #4a2c12; border-radius: 16px; padding: 6px 12px; font: 600 .95rem/1.35 var(--f-body); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); text-align: center; }
.tc-say:empty { display: none; }
.tc-say::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: #fff; border-right: 2px solid #4a2c12; border-bottom: 2px solid #4a2c12; transform: translateX(-50%) rotate(45deg); }
.tc-say.pop { animation: tc-pop .35s ease-out; }
.tc-zzz { position: absolute; left: 60%; top: 30%; z-index: 7; font: 700 1.3rem var(--f-hand); color: #fff; pointer-events: none; }
.tc-zzz i { position: absolute; font-style: normal; animation: tc-zzz 3s ease-in infinite; opacity: 0; }
.tc-zzz i:nth-child(2) { animation-delay: 1s; font-size: 1.1em; } .tc-zzz i:nth-child(3) { animation-delay: 2s; font-size: 1.35em; }

/* Hoạt ảnh thú */
.tc-bob { transform-box: view-box; transform-origin: 100px 190px; animation: tc-breathe 2.8s ease-in-out infinite; }
.tc-eye { transform-box: fill-box; transform-origin: center; animation: tc-blink 5s infinite; }
.tc-tail { transform-box: view-box; transform-origin: 136px 160px; animation: tc-wag 2.4s ease-in-out infinite; }
.tc-m-vui .tc-wag { animation-duration: .5s; }
.tc-tear { animation: tc-drip 2.2s ease-in infinite; }
.tc-nhai { transform-box: fill-box; transform-origin: center; animation: tc-chew .3s ease-in-out infinite alternate; }
.tc-m-ngu .tc-bob { animation-duration: 4.5s; }
.tc-m-vui .tc-bob { animation: tc-hop 1.6s ease-in-out infinite; }
.tc-m-om .tc-bob { animation: tc-shiver 3s ease-in-out infinite; }
.tc-a-nhay .tc-bob, .tc-a-khoai .tc-bob { animation: tc-jump .5s ease-out 3; }
.tc-a-tam .tc-bob { animation: tc-wash .25s ease-in-out 7; }
.tc-a-lacdau .tc-bob { animation: tc-no .22s ease-in-out 3; }
.tc-a-don .tc-poops { animation: tc-sweep .7s ease-in forwards; }
.tc-a-tim .tc-bob { animation: tc-squish .45s ease-out 2; }
.tc-heart { position: absolute; bottom: 45%; font-style: normal; color: #ff4f7a; font-size: 1.6rem; animation: tc-float 1.6s ease-out forwards; opacity: 0; }
.tc-star { position: absolute; top: -8%; font-style: normal; font-size: 1.2rem; animation: tc-fall 1.8s ease-in forwards; }
.tc-bub { position: absolute; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, rgba(190, 230, 255, .55) 50%, rgba(120, 190, 240, .35)); border: 1.5px solid rgba(255, 255, 255, .9); animation: tc-bubble 1.6s ease-out forwards; opacity: 0; }
.tc-flyfood { position: absolute; left: 44%; bottom: 0; width: 13%; max-width: 56px; animation: tc-feed 1.1s ease-in forwards; }
.tc-flyfood svg { display: block; width: 100%; height: auto; }
.tc-ballfx { animation: tc-ball 1.2s ease-out forwards; }

@keyframes tc-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .975); } }
@keyframes tc-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px) scale(1.01, .99); } 60% { transform: translateY(0) scale(1.03, .96); } }
@keyframes tc-jump { 0% { transform: translateY(0) scale(1.06, .9); } 45% { transform: translateY(-26px) scale(.96, 1.05); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes tc-wash { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes tc-no { 0%, 100% { transform: translateX(0); } 33% { transform: translateX(-6px); } 66% { transform: translateX(6px); } }
@keyframes tc-squish { 0% { transform: scale(1); } 40% { transform: scale(1.06, .92); } 100% { transform: scale(1); } }
@keyframes tc-shiver { 0%, 100% { transform: translateX(0); } 10%, 30% { transform: translateX(-1.5px); } 20%, 40% { transform: translateX(1.5px); } 50% { transform: translateX(0); } }
@keyframes tc-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes tc-wag { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
@keyframes tc-drip { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(8px); opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes tc-chew { from { transform: scaleY(.45); } to { transform: scaleY(1.1); } }
@keyframes tc-float { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-90px) scale(1.2); opacity: 0; } }
@keyframes tc-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(330px) rotate(300deg); opacity: 0; } }
@keyframes tc-bubble { 0% { transform: scale(.3); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-40px) scale(1.2); opacity: 0; } }
@keyframes tc-feed { 0% { transform: translateY(0) scale(1); opacity: 1; } 70% { transform: translateY(-150px) scale(.9); opacity: 1; } 100% { transform: translateY(-160px) scale(.2); opacity: 0; } }
@keyframes tc-ball { 0% { transform: translate(-80px, 0); } 50% { transform: translate(0, -120px); } 100% { transform: translate(80px, 0); opacity: 0; } }
@keyframes tc-sweep { to { transform: translateX(120%); opacity: 0; } }
@keyframes tc-stink { 0%, 100% { transform: translateY(0); opacity: .2; } 50% { transform: translateY(-5px); opacity: .8; } }
@keyframes tc-zzz { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(30px, -60px); opacity: 0; } }
@keyframes tc-pop { 0% { transform: scale(.85); } 70% { transform: scale(1.04); } 100% { transform: scale(1); } }

.tc-banner { margin: 0; padding: 8px 12px; border-radius: 12px; background: #e8f0ff; border: 2px solid #7f9be0; color: #22397a; font-size: .92rem; }
/* ---- Chỉ số ---- */
.tc-meters { display: grid; gap: 6px; background: #fffaf0; border: 2px solid #d6b483; border-radius: 14px; padding: 10px 12px; }
.tc-m { display: grid; grid-template-columns: 22px 92px minmax(0, 1fr) 30px; align-items: center; gap: 6px; font-size: .9rem; color: #5a3416; }
.tc-mi { font-size: 1rem; text-align: center; }
.tc-ml { white-space: nowrap; }
.tc-mbar { height: 12px; border-radius: 999px; background: #f0e2c8; overflow: hidden; border: 1.5px solid #d6b483; }
.tc-mbar i { display: block; height: 100%; border-radius: 999px; transition: width .6s; }
.tc-m-ok .tc-mbar i { background: linear-gradient(90deg, #6cc04a, #3fa35a); }
.tc-m-mid .tc-mbar i { background: linear-gradient(90deg, #ffd23f, #f0a92a); }
.tc-m-low .tc-mbar i { background: linear-gradient(90deg, #ff7a6b, #e0403a); }
.tc-m b { text-align: right; font-variant-numeric: tabular-nums; font-size: .85rem; }
/* ---- Hành động ---- */
.tc-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tc-act { display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 8px 4px; background: #fff; border: 2px solid #c08a4a; border-radius: 14px; box-shadow: 0 3px 0 #c08a4a; font: 600 .9rem/1.2 var(--f-body); color: #5a3416; cursor: pointer; position: relative; }
.tc-act span { font-size: 1.45rem; line-height: 1.1; }
.tc-act i { font-style: normal; }
.tc-act:active { transform: translateY(2px); box-shadow: 0 1px 0 #c08a4a; }
.tc-act.need { border-color: #e0403a; box-shadow: 0 3px 0 #e0403a; }
.tc-act.need::after { content: "!"; position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #e0403a; color: #fff; font: 700 .85rem/22px var(--f-body); animation: tc-pop 1.4s ease-in-out infinite; }
.tc-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tc-more .btn { min-height: 46px; }
.tc-so .btn, .tc-box .btn, .tc-namerow .btn { min-height: 44px; }
.tc-grow { margin: 0; color: #6b4421; text-align: center; }

/* ================= Bảng trượt ================= */
.tc-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(40, 24, 10, .45); display: flex; align-items: flex-end; justify-content: center; animation: tc-fade .2s; }
.tc-sheet-in { width: min(100%, 560px); max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; background: #fffaf0; border-radius: 20px 20px 0 0; padding: 12px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border: 2px solid #c08a4a; border-bottom: 0; animation: tc-up .25s ease-out; }
@media (min-width: 760px) { .tc-sheet { align-items: center; } .tc-sheet-in { border-radius: 20px; border-bottom: 2px solid #c08a4a; } }
.tc-sh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -12px; background: #fffaf0; padding-top: 4px; z-index: 1; }
.tc-sh-head h2 { font: 700 1.35rem/1.3 "Mali", var(--f-hand); color: #5a3416; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tc-x { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: #f3e3c4; color: #5a3416; font: 600 1.6rem/1 var(--f-body); cursor: pointer; }
.tc-shnote { color: #6b4421; margin: 6px 0 10px; }
@keyframes tc-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tc-fade { from { opacity: 0; } to { opacity: 1; } }
/* món ăn */
.tc-foods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-fbtn { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 8px; min-height: 72px; background: #fff; border: 2px solid #e6cfa6; border-radius: 14px; cursor: pointer; color: #4a2c12; font: 500 .85rem/1.3 var(--f-body); }
.tc-fbtn .tc-food { grid-row: 1 / 4; width: 44px; height: 44px; }
.tc-fname { font-weight: 700; font-size: .92rem; }
.tc-fname em { display: block; font-style: normal; font-size: .72rem; color: #c0601a; font-weight: 700; }
.tc-feff { color: #3f7d2b; font-size: .78rem; }
.tc-fprice { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #7a4c00; font-size: .8rem; }
.tc-fprice .tc-seed { width: 14px; height: 14px; }
.tc-fbtn.fav { border-color: #f0a92a; background: #fff6dc; }
.tc-fbtn.poor { opacity: .55; }
/* trò mini */
.tc-minis { display: grid; gap: 8px; }
.tc-mini { display: grid; gap: 2px; text-align: left; padding: 12px 14px; min-height: 64px; background: #fff; border: 2px solid #e6cfa6; border-radius: 14px; cursor: pointer; color: #4a2c12; font: 500 .88rem/1.35 var(--f-body); }
.tc-mini b { font: 700 1.1rem/1.3 "Mali", var(--f-hand); color: #7a4515; }
.tc-game { display: grid; gap: 10px; }
.tc-gstat { margin: 0; font: 600 1rem var(--f-body); color: #4a2c12; text-align: center; min-height: 1.5em; }
.tc-field { position: relative; height: 270px; border-radius: 16px; background: radial-gradient(circle at 50% 120%, #8fd06a 0 40%, transparent 41%), linear-gradient(180deg, #bde6fa, #e6f6fd); border: 2px solid #7fb5d6; overflow: hidden; touch-action: manipulation; }
.tc-ball { position: absolute; width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer; animation: tc-pop .25s ease-out; -webkit-tap-highlight-color: transparent; }
.tc-ball svg { width: 100%; height: 100%; display: block; }
.tc-ball.caught { animation: tc-caught .3s ease-in forwards; pointer-events: none; }
.tc-ball.miss { animation: tc-fadeout .25s forwards; pointer-events: none; }
@keyframes tc-caught { to { transform: scale(1.6); opacity: 0; } }
@keyframes tc-fadeout { to { opacity: 0; transform: translateY(20px); } }
.tc-hands-pet { width: 150px; margin: 0 auto; }
.tc-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tc-hand { display: grid; justify-items: center; gap: 4px; min-height: 96px; font-size: 2.6rem; line-height: 1; background: #fff; border: 2px solid #c08a4a; border-radius: 16px; box-shadow: 0 3px 0 #c08a4a; cursor: pointer; padding: 10px; }
.tc-hand span { font: 600 .9rem var(--f-body); color: #5a3416; }
.tc-hand.shuf { animation: tc-no .3s ease-in-out 3; }
.tc-hand.yes { border-color: #3fa35a; box-shadow: 0 3px 0 #3fa35a; background: #effbe9; }
.tc-hand.no { border-color: #e0403a; box-shadow: 0 3px 0 #e0403a; }
.tc-ott { display: flex; align-items: center; justify-content: center; gap: 18px; }
.tc-ott > div { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.tc-ott small { font-size: .85rem; color: #6b4421; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-ott-h { font-size: 3.4rem; line-height: 1.1; display: block; }
.tc-ott-h.shake { animation: tc-shake .3s ease-in-out 3; }
@keyframes tc-shake { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.tc-ott-vs { font: 700 1.2rem var(--f-hand); color: #c0601a; }
.tc-ott-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tc-ottb { display: grid; justify-items: center; gap: 2px; min-height: 72px; background: #fff; border: 2px solid #c08a4a; border-radius: 14px; box-shadow: 0 3px 0 #c08a4a; font: 600 .9rem var(--f-body); color: #5a3416; cursor: pointer; }
.tc-ottb span { font-size: 1.9rem; line-height: 1.2; }
.tc-ott-sc { text-align: center; margin: 0; color: #6b4421; }
/* tủ đồ */
.tc-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.tc-tabs button { min-height: 44px; border-radius: 999px; border: 1.5px solid #c08a4a; background: #fff; color: #7a4515; font: 600 .88rem var(--f-body); cursor: pointer; padding: 0 6px; }
.tc-tabs button[aria-selected="true"] { background: #c0601a; border-color: #8c4210; color: #fff; }
.tc-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 420px) { .tc-items { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tc-item { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; min-height: 44px; background: #fff; border: 2px solid #e6cfa6; border-radius: 14px; cursor: pointer; color: #4a2c12; font: 500 .8rem/1.3 var(--f-body); text-align: center; }
.tc-item b { font-size: .9rem; }
.tc-iprev { display: block; width: 78px; height: 78px; }
.tc-iprev .tc-svg, .tc-iprev .tc-toy-svg { width: 100%; height: 100%; display: block; }
.tc-item.on { border-color: #3fa35a; background: #effbe9; }
.tc-item.tc-locked { opacity: .6; }
/* sổ tay */
.tc-so { display: grid; gap: 14px; }
.tc-so section { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1.5px dashed #e0c79c; }
.tc-so section:last-child { border-bottom: 0; }
.tc-so h3 { margin: 0; font: 700 1.15rem/1.3 "Mali", var(--f-hand); color: #7a4515; overflow-wrap: anywhere; }
.tc-so p { margin: 0; }
.tc-so details > * + * { margin-top: 8px; }
.tc-prog { height: 14px; border-radius: 999px; background: #f0e2c8; border: 1.5px solid #d6b483; overflow: hidden; }
.tc-prog i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #f0a92a); }
/* lớn lên */
.tc-grew { position: fixed; inset: 0; z-index: 70; background: rgba(40, 24, 10, .55); display: grid; place-items: center; padding: 16px; animation: tc-fade .25s; }
.tc-grew-card { width: min(100%, 360px); background: #fffaf0; border: 3px solid #c08a4a; border-radius: 20px; padding: 18px; display: grid; gap: 8px; justify-items: center; text-align: center; animation: tc-pop .4s ease-out; }
.tc-grew-card .tc-svg { width: 170px; }
.tc-grew-eye { margin: 0; font: 600 1.1rem var(--f-hand); color: #c0601a; }
.tc-grew-card h2 { font: 700 1.5rem/1.3 "Mali", var(--f-hand); color: #5a3416; overflow-wrap: anywhere; }
.tc-grew-txt { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .tc-bob, .tc-eye, .tc-tail, .tc-tear, .tc-nhai, .tc-zzz i, .tc-poop::after, .tc-act.need::after, .tc-say.pop, .tc-hand.shuf, .tc-ott-h.shake, .tc-sheet, .tc-sheet-in, .tc-grew, .tc-grew-card, .tc-ball { animation: none !important; }
  .tc-heart, .tc-star, .tc-bub, .tc-flyfood { animation-duration: .01s !important; }
  .tc-zzz i { opacity: 1; position: static; }
}
