/* Nhà của Gấu Con (js/game-house.js) — tiền tố gh2-.
   Một căn phòng (.gh2-scene) và một bảng bên cạnh (.gh2-panel): màn dọc thì bảng nằm dưới, màn ngang thì nằm bên phải.
   Mọi kích thước trong phòng tính theo --b (bề rộng của Gấu Con), nên phòng to hay nhỏ thì bố cục vẫn giữ nguyên tỉ lệ.
   Căn phòng có chiều sâu: tường sau, hai tường bên, trần và sàn gỗ cùng chụm về một điểm tụ (50%, 46%); đồ vật là hình 3D,
   món nào cũng có bóng đổ mềm để "đứng" trong phòng. Phần 3D không dùng color-mix(), đơn vị cq mới hay translate/rotate/scale rời. */
body[data-scene="nha-gau"] { --sky1: #FFB648; --sky2: #FFEFC4; }
.gh2-room { position: relative; display: flex; flex-direction: column; gap: 8px; width: 100%; height: calc(var(--vh, 100vh) - var(--bar, 78px) - 44px); min-height: 250px;
  touch-action: none; -webkit-user-select: none; user-select: none;
  /* vân bề mặt (giấy dán tường, thảm) và vân gỗ dọc / ngang: nhiễu SVG nhỏ, lát lặp lại */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .2 0 0 0 0 .2 .28 0 0 0 -.07'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --woodv: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.6 .012' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .22 0 0 0 0 .05 .5 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --woodh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .6' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .22 0 0 0 0 .05 .5 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }
.gh2-room.gh2-wide { flex-direction: row; gap: 10px; }
.gh2-room button { -webkit-tap-highlight-color: transparent; }
.gh2-room.gh2-wide > .gh2-scene { --cx: 45%; }

/* ---------- căn phòng ---------- */
.gh2-scene { --b: min(78cqh, 84cqw); --cx: 50%; position: relative; z-index: 1; flex: 1 1 0; min-width: 0; min-height: 0; container-type: size; overflow: hidden; isolation: isolate;
  border: 5px solid #fff; border-radius: 28px; background: #BFE9E6; box-shadow: 0 8px 0 rgba(30, 42, 94, .18), 0 16px 22px rgba(30, 42, 94, .2); }
/* mép khung tối dần vào trong: nhìn vào phòng như nhìn vào một cái hộp có chiều sâu */
.gh2-scene::after { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; border-radius: 22px; box-shadow: inset 0 0 18px rgba(30, 42, 94, .3), inset 0 3px 5px rgba(30, 42, 94, .22); }
/* tường sau: giấy dán tường sọc mờ có vân giấy, gờ trần phía trên, nửa dưới ốp gỗ sơn kem (::after) */
.gh2-wall { position: absolute; inset: 0 0 23% 0;
  background: linear-gradient(#FFFEF8, #EDE5D3) 0 5.3% / 100% 2.3% no-repeat, linear-gradient(rgba(30, 50, 100, 0) 7.4%, rgba(30, 50, 100, .2) 7.5%, rgba(30, 50, 100, 0) 17%),
    var(--grain) 0 0 / 140px 140px, repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 20px, rgba(255, 255, 255, 0) 20px 40px), linear-gradient(#9FDCE6, #C4EEE4); }
.gh2-wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 31.2%;
  background: var(--grain) 0 0 / 140px 140px, repeating-linear-gradient(90deg, rgba(150, 118, 76, .2) 0 1.5px, rgba(255, 255, 255, .7) 1.5px 3px, rgba(255, 255, 255, 0) 3px 32px), linear-gradient(#FFF8EA, #F2E6CF);
  box-shadow: inset 0 4px 0 #fff, inset 0 7px 0 #E6D9BF, inset 0 16px 9px -8px rgba(110, 80, 40, .3), 0 -1px 0 rgba(255, 255, 255, .9), 0 -5px 6px -3px rgba(30, 50, 100, .25); }
/* hai tường bên (hình thang chụm về điểm tụ), tối hơn tường sau; ::before là phần ốp gỗ, ::after là chân tường */
.gh2-side { position: absolute; top: 0; bottom: 0; width: 5.5%; pointer-events: none; background: linear-gradient(90deg, rgba(20, 50, 95, .3), rgba(20, 50, 95, .14)), linear-gradient(#9FDCE6, #C4EEE4); }
.gh2-side::before, .gh2-side::after { content: ""; position: absolute; inset: 0; }
.gh2-side::before { background: linear-gradient(90deg, rgba(80, 60, 40, .3), rgba(80, 60, 40, .14)), #F7EDD9; }
.gh2-side::after { background: linear-gradient(90deg, #D9CDB6, #EFE6D4); }
.gh2-sl { left: 0; clip-path: polygon(0 0, 100% 4%, 100% 77%, 0 80.83%); }
.gh2-sl::before { clip-path: polygon(0 53.9%, 100% 53%, 100% 77%, 0 80.83%); }
.gh2-sl::after { clip-path: polygon(0 76.56%, 100% 73.2%, 100% 77%, 0 80.83%); }
.gh2-sr { right: 0; transform: scaleX(-1); clip-path: polygon(0 0, 100% 4%, 100% 77%, 0 80.83%); }
.gh2-sr::before { clip-path: polygon(0 53.9%, 100% 53%, 100% 77%, 0 80.83%); }
.gh2-sr::after { clip-path: polygon(0 76.56%, 100% 73.2%, 100% 77%, 0 80.83%); }
.gh2-ceil { position: absolute; left: 0; right: 0; top: 0; height: 4%; pointer-events: none; clip-path: polygon(1.3% 0, 98.7% 0, 94.5% 100%, 5.5% 100%); background: linear-gradient(#F4EFE3, #FFFDF6); }
.gh2-skirt { position: absolute; left: 5.5%; right: 5.5%; top: 73.2%; height: 3.8%; pointer-events: none; background: linear-gradient(#fff 0 14%, #F6F0E4 15% 74%, #DDD2BE 75%); box-shadow: 0 -1px 2px rgba(110, 80, 40, .25); }
/* sàn gỗ: các tấm ván vẽ theo phối cảnh (SVG kéo giãn theo khung), phủ vân gỗ; sát chân tường tối hơn */
.gh2-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 23%;
  background: var(--woodv) 0 0 / 140px 280px, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%236B3A12' stop-opacity='.42'/%3E%3Cstop offset='.22' stop-color='%236B3A12' stop-opacity='.12'/%3E%3Cstop offset='.6' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.16'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='%23EDBE82' d='M-4 0H3.2L-31.5 100H-44.1z'/%3E%3Cpath fill='%23DBA262' d='M3.2 0H10.4L-19 100H-31.5z'/%3E%3Cpath fill='%23E2AC6B' d='M10.4 0H17.6L-6.4 100H-19z'/%3E%3Cpath fill='%23DFA868' d='M17.6 0H24.8L6.1 100H-6.4z'/%3E%3Cpath fill='%23E8B577' d='M24.8 0H32L18.6 100H6.1z'/%3E%3Cpath fill='%23F0C68D' d='M32 0H39.2L31.2 100H18.6z'/%3E%3Cpath fill='%23EDBE82' d='M39.2 0H46.4L43.7 100H31.2z'/%3E%3Cpath fill='%23E8B577' d='M46.4 0H53.6L56.3 100H43.7z'/%3E%3Cpath fill='%23DFA868' d='M53.6 0H60.8L68.8 100H56.3z'/%3E%3Cpath fill='%23E2AC6B' d='M60.8 0H68L81.4 100H68.8z'/%3E%3Cpath fill='%23DBA262' d='M68 0H75.2L93.9 100H81.4z'/%3E%3Cpath fill='%23F0C68D' d='M75.2 0H82.4L106.4 100H93.9z'/%3E%3Cpath fill='%23E2AC6B' d='M82.4 0H89.6L119 100H106.4z'/%3E%3Cpath fill='%23EDBE82' d='M89.6 0H96.8L131.5 100H119z'/%3E%3Cpath fill='%23F0C68D' d='M96.8 0H104L144.1 100H131.5z'/%3E%3Cpath fill='%23E8B577' d='M104 0H111.2L156.6 100H144.1z'/%3E%3Cpath fill='%238A4F1C' fill-opacity='.5' d='M-4.2 0h.44L-43.7 100h-.8zM3 0h.44L-31.1 100h-.8zM10.2 0h.44L-18.6 100h-.8zM17.4 0h.44L-6 100h-.8zM24.6 0h.44L6.5 100h-.8zM31.8 0h.44L19 100h-.8zM39 0h.44L31.6 100h-.8zM46.2 0h.44L44.1 100h-.8zM53.4 0h.44L56.7 100h-.8zM60.6 0h.44L69.2 100h-.8zM67.8 0h.44L81.8 100h-.8zM75 0h.44L94.3 100h-.8zM82.2 0h.44L106.8 100h-.8zM89.4 0h.44L119.4 100h-.8zM96.6 0h.44L131.9 100h-.8zM103.8 0h.44L144.5 100h-.8z'/%3E%3Cpath fill='%238A4F1C' fill-opacity='.38' d='M-16.6 31.5H-7.7v1.1H-17zM-21.2 70.2H-10.2v1.5H-21.7zM-10.9 72.4H0.2v1.6H-11.3zM-1.1 77.9H10.2v1.6H-1.5zM12.2 67.4H23v1.5H11.9zM12.4 66.2H23.2v1.5H12.1zM29.8 16.8H37.9v0.9H29.6zM34.2 62.7H44.7v1.5H34.1zM45.4 38.8H54.6v1.2H45.3zM55.7 79.7H67.2v1.7H55.8zM54.1 19.4H62.4v0.9H54.1zM64.3 43.7H73.8v1.2H64.4zM67.9 88.5H79.8v1.8H68zM69.5 11.2H77.3v0.8H69.6zM85.5 55.3H95.7v1.4H85.8zM83.3 43.1H92.8v1.2H83.5zM103.1 86H114.9v1.7H103.5zM91.6 38.2H100.8v1.2H91.9zM104.7 51.3H114.6v1.3H105.1zM111.3 41.7H120.7v1.2H111.7zM110 38.1H119.3v1.2H110.4zM118.1 35.3H127.2v1.1H118.6zM128.1 60H138.5v1.4H128.6z'/%3E%3Crect width='100' height='100' fill='url(%23g)'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat, #E2AC6B; }
/* thảm tròn có độ dày: mặt thảm có vân sợi, vành thảm sẫm hơn ở dưới, bóng đổ xuống sàn */
.gh2-rug { position: absolute; left: var(--cx); bottom: 2.2%; width: min(calc(var(--b) * 1.22), 98%); height: 18%; transform: translateX(-50%); border-radius: 50%; font-size: calc(var(--b) * .05);
  background: var(--grain) 0 0 / 90px 90px, radial-gradient(ellipse 60% 55% at 62% 30%, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse, #FFC4DD 0 33%, #FFF6FA 34.5% 41%, #FF86BE 42.5% 66%, #FFF6FA 67.5% 73.5%, #FFA6CF 75%);
  box-shadow: inset 0 -.18em .3em rgba(170, 30, 100, .3), inset 0 .1em .12em rgba(255, 255, 255, .7), 0 .26em 0 #DB5C9C, 0 .34em 0 #B94480, 0 .6em .5em rgba(60, 25, 40, .4); }
/* ánh sáng trong phòng: nắng từ cửa sổ hắt lên tường, quầng đèn vàng, bốn góc phòng tối dần */
.gh2-amb { position: absolute; inset: 0; pointer-events: none; transition: opacity .6s;
  background: radial-gradient(ellipse 52% 58% at 84% 20%, rgba(255, 253, 228, .5), rgba(255, 253, 228, 0) 70%), radial-gradient(ellipse 46% 52% at 12% 22%, rgba(255, 230, 150, .4), rgba(255, 230, 150, 0) 70%),
    radial-gradient(ellipse 110% 105% at 50% 42%, rgba(30, 30, 80, 0) 58%, rgba(30, 30, 80, .34) 100%); }
.gh2-scene[data-sky="night"] .gh2-amb { background: radial-gradient(ellipse 62% 66% at 14% 20%, rgba(255, 222, 130, .5), rgba(255, 222, 130, 0) 72%), radial-gradient(ellipse 110% 105% at 42% 44%, rgba(24, 22, 76, .04) 46%, rgba(24, 22, 76, .36) 100%); }

/* cửa sổ: khung là hình 3D; bầu trời sau kính: ban ngày có mặt trời và mây, tối (hoặc lúc Gấu Con ngủ) có trăng sao */
.gh2-win { position: absolute; z-index: 1; right: 7.5%; top: 5.5%; width: clamp(74px, 22cqw, 168px); aspect-ratio: 1; }
.gh2-win > .emo { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.gh2-win > .gh2-wimg { filter: drop-shadow(-3px 5px 4px rgba(30, 42, 94, .32)); }
.gh2-win > .gh2-wbars { clip-path: polygon(46.4% 14%, 53.4% 14%, 53.4% 46.6%, 85% 46.6%, 85% 51.8%, 53.4% 51.8%, 53.4% 85%, 46.4% 85%, 46.4% 51.8%, 15% 51.8%, 15% 46.6%, 46.4% 46.6%); }
.gh2-sky { position: absolute; left: 15.2%; top: 14.6%; right: 15.4%; bottom: 15.2%; overflow: hidden; border-radius: 6%; background: linear-gradient(#2F9BF0, #8FD6FF 62%, #E2F7FF); transition: background .6s; }
.gh2-sky::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 2px 3px 6px rgba(15, 35, 90, .5);
  background: linear-gradient(118deg, rgba(255, 255, 255, .42) 0 13%, rgba(255, 255, 255, 0) 13.5% 31%, rgba(255, 255, 255, .2) 31.5% 39%, rgba(255, 255, 255, 0) 39.5%); }
.gh2-sky > .gh2-sun { position: absolute; left: -2%; top: -3%; width: 50%; height: 50%; }
.gh2-sky > .gh2-cloud { position: absolute; right: -5%; bottom: -6%; width: 58%; height: 58%; }
.gh2-sky > .gh2-moon { position: absolute; left: 0; top: -1%; width: 47%; height: 47%; display: none; filter: drop-shadow(0 0 5px rgba(255, 236, 150, .9)); }
.gh2-win .gh2-tw { display: none; font-size: clamp(9px, 3cqw, 16px); }
.gh2-tw { position: absolute; filter: drop-shadow(0 0 .22em rgba(255, 238, 140, .95)); animation: twinkle 2.4s ease-in-out infinite; }
.gh2-scene[data-sky="night"] .gh2-sky { background: linear-gradient(#141B55, #3A3F9C 70%, #6A5CC0); }
.gh2-scene[data-sky="night"] .gh2-sun, .gh2-scene[data-sky="night"] .gh2-cloud { display: none; }
.gh2-scene[data-sky="night"] .gh2-win .gh2-moon, .gh2-scene[data-sky="night"] .gh2-win .gh2-tw { display: block; }
/* luồng sáng từ cửa sổ rọi chéo xuống sàn: nắng ban ngày, ánh trăng lúc Gấu Con ngủ */
.gh2-beam { position: absolute; z-index: -1; right: 14%; top: 82%; width: 250%; height: 430%; pointer-events: none; opacity: 0; transition: opacity .7s;
  clip-path: polygon(71% 0, 100% 0, 44% 100%, 0 100%); background: linear-gradient(rgba(255, 250, 210, .6), rgba(255, 250, 210, 0) 82%); filter: blur(5px); }
.gh2-scene[data-sky="day"] .gh2-beam { opacity: .7; }
.gh2-room[data-mode="sleep"] .gh2-beam { opacity: 1; background: linear-gradient(rgba(176, 204, 255, .46), rgba(176, 204, 255, .1) 70%, rgba(176, 204, 255, 0) 92%); }
.gh2-room[data-mode="sleep"] .gh2-win > .gh2-wimg { filter: drop-shadow(0 0 10px rgba(170, 200, 255, .85)); }

/* đèn treo: chụp đèn hình nón có khối, bóng đèn là hình 3D. Chạm để tắt cho Gấu Con ngủ, chạm lần nữa để gọi dậy */
.gh2-lamp { position: absolute; z-index: 3; left: 6%; top: 0; width: clamp(66px, 18cqw, 128px); height: clamp(88px, 27cqh, 168px); transform-origin: 50% 0; }
.gh2-cord { position: absolute; left: 50%; top: 0; width: 5px; height: 32%; margin-left: -2.5px; border-radius: 0 0 2px 2px; background: linear-gradient(90deg, #5C4638, #B2957F 45%, #4A372C); }
.gh2-cord::before { content: ""; position: absolute; left: 50%; top: 0; width: 22px; height: 7px; margin-left: -11px; border-radius: 0 0 11px 11px; background: linear-gradient(#FFFDF6, #D8CDB8); box-shadow: 0 2px 2px rgba(30, 42, 94, .25); }
.gh2-shade { position: absolute; left: 7%; right: 7%; top: 27%; height: 36%; transition: filter .5s; filter: drop-shadow(-2px 4px 3px rgba(30, 42, 94, .25)); }
.gh2-shade::before { content: ""; position: absolute; inset: 0; clip-path: polygon(31% 0, 69% 0, 100% 100%, 0 100%);
  background: linear-gradient(rgba(255, 255, 235, 0) 35%, rgba(255, 255, 225, .5)), linear-gradient(90deg, #E07A1F, #FFAF3A 20%, #FFDC6E 44%, #FFC350 62%, #F08C22 84%, #CC6714); }
.gh2-shade::after { content: ""; position: absolute; left: 0; right: 0; bottom: -17%; height: 34%; border-radius: 50%; background: radial-gradient(ellipse at 50% 60%, #FFFBE0 0 30%, #FFE68A 62%, #F7B648 100%); box-shadow: inset 0 3px 4px rgba(190, 95, 10, .55); }
.gh2-bulb { position: absolute; left: 50%; top: 53%; width: 44%; margin-left: -22%; aspect-ratio: 1; }
.gh2-bulb::before { content: ""; position: absolute; left: -90%; top: -60%; width: 280%; height: 280%; border-radius: 50%; pointer-events: none; transition: opacity .5s;
  background: radial-gradient(circle, rgba(255, 248, 190, .95) 0 12%, rgba(255, 232, 130, .55) 28%, rgba(255, 226, 120, 0) 66%); }
.gh2-bulb > .emo { position: relative; display: block; width: 100%; height: 100%; transform: rotate(180deg); transition: filter .5s; filter: drop-shadow(0 0 6px rgba(255, 236, 140, .9)) brightness(1.08); }
.gh2-glow { position: absolute; left: 50%; top: 70%; width: 320%; height: 240%; transform: translateX(-50%); pointer-events: none; background: radial-gradient(ellipse at 50% 0, rgba(255, 238, 150, .5), rgba(255, 238, 150, 0) 68%); transition: opacity .5s; }
/* lúc ngủ, đèn và cửa sổ nổi lên trên lớp màn đêm để bé thấy và chạm được; đèn tắt: chụp và bóng đèn xám lại, hết quầng sáng */
.gh2-room[data-mode="sleep"] .gh2-lamp, .gh2-room[data-mode="sleep"] .gh2-win { z-index: 5; }
.gh2-room[data-mode="sleep"] .gh2-shade { filter: grayscale(.75) brightness(.6) drop-shadow(-2px 4px 3px rgba(0, 0, 0, .3)); }
.gh2-room[data-mode="sleep"] .gh2-bulb > .emo { filter: grayscale(.9) brightness(.72); }
.gh2-room[data-mode="sleep"] .gh2-bulb::before, .gh2-room[data-mode="sleep"] .gh2-glow { opacity: 0; }
.gh2-lamp.gh2-call { animation: gh2-swing 1s ease-in-out infinite; }

/* đồ trang trí chạm được và đồ chơi có từ hộp quà: món đứng trên sàn có bóng tiếp đất, món treo tường có bóng đổ lên tường */
.gh2-deco, .gh2-toy { position: absolute; z-index: 1; display: grid; place-items: center; width: 1.12em; height: 1.12em; font-size: clamp(34px, 11cqw, 72px); line-height: 1; }
.gh2-toy::after, .gh2-plant::after, .gh2-crate::after, .gh2-shelf > .gh2-deco::after { content: ""; position: absolute; z-index: -1; left: 4%; right: 4%; bottom: -1%; height: 22%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(60, 28, 16, .55), rgba(60, 28, 16, .24) 48%, rgba(60, 28, 16, 0) 72%); }
.gh2-frame { left: 50%; top: 5.5%; margin-left: -1.08em; width: 1.5em; height: 1.5em; font-size: clamp(34px, 10cqw, 64px); }
.gh2-frame > .gh2-fpic { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: drop-shadow(-2px 4px 3px rgba(30, 42, 94, .35)); }
.gh2-frame > .emo:last-child { position: relative; width: .92em; height: .92em; margin-top: .16em; }
/* đồng hồ báo thức đứng trên một cái kệ nhỏ gắn tường */
.gh2-clock { left: 50%; top: 4.5%; margin-left: .72em; font-size: clamp(30px, 8.5cqw, 56px); }
.gh2-clock::before { content: ""; position: absolute; left: -8%; right: -8%; bottom: -5%; height: 14%; border-radius: 3px; background: linear-gradient(#FFE6B8 0 36%, #DDA35C 37%, #C98A45); box-shadow: 0 4px 4px rgba(30, 42, 94, .32); }
.gh2-clock::after { content: ""; position: absolute; left: 36%; right: 36%; bottom: -19%; height: 15%; background: #B87A3A; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.gh2-clock > .emo { position: relative; }
.gh2-plant { display: none; right: 4.5%; bottom: 17%; font-size: clamp(54px, 15cqw, 110px); transform-origin: 50% 100%; }
.gh2-plant > .emo { transform-origin: 50% 100%; }
.gh2-toy { z-index: 2; }
.gh2-t0 { left: 2%; bottom: 3%; }
.gh2-t1 { right: 2%; bottom: 3.5%; }
.gh2-t2 { left: calc(var(--cx) - var(--b) * .5 - .1em); bottom: calc(4% + var(--b) * .56); transform: rotate(-12deg); }
.gh2-t3 { left: calc(var(--cx) + var(--b) * .5 - 1em); bottom: calc(4% + var(--b) * .5); transform: rotate(10deg); }
.gh2-t2, .gh2-t3 { filter: drop-shadow(-3px 5px 3px rgba(30, 42, 94, .3)); }
.gh2-t2::after, .gh2-t3::after { display: none; }
.gh2-t4 { left: 1.5%; bottom: calc(3% + 1.1em); }
/* kệ gỗ gắn tường: mặt kệ sáng, cạnh kệ sẫm, hai ke đỡ, bóng đổ lên tường */
.gh2-shelf { display: none; position: absolute; z-index: 1; left: 8.5%; top: 34%; width: 2.5em; padding-bottom: .2em; justify-content: space-around; align-items: flex-end; font-size: clamp(32px, 8.5cqw, 58px); line-height: 1; }
.gh2-shelf::after { content: ""; position: absolute; left: -7%; right: -7%; bottom: 0; height: .2em; border-radius: 3px; background: var(--woodh) 0 0 / 140px 140px, linear-gradient(#FFE6B8 0 36%, #DDA35C 37%, #C98A45); box-shadow: 0 .12em .12em rgba(30, 42, 94, .32); }
.gh2-shelf::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: -.22em; height: .24em; background: linear-gradient(#B87A3A, #9C6229) 0 0 / .13em 100% no-repeat, linear-gradient(#B87A3A, #9C6229) 100% 0 / .13em 100% no-repeat; }
.gh2-shelf > .gh2-deco { position: relative; font-size: 1em; transform-origin: 50% 100%; }
.gh2-shelf > .gh2-deco::after { bottom: -4%; height: 16%; }
/* giỏ đồ chơi: cái giỏ mây 3D, mảnh ghép và bút sáp thò ra phía sau */
.gh2-crate { display: none; position: absolute; z-index: 1; left: 3.5%; bottom: 16.5%; width: 2em; height: 1.9em; font-size: clamp(38px, 9.5cqw, 64px); line-height: 1; transform-origin: 50% 100%; }
.gh2-crate > .emo { position: absolute; bottom: .95em; width: .95em; height: .95em; }
.gh2-crate > .emo:first-child { left: 4%; rotate: -14deg; } .gh2-crate > .emo:last-child { right: 4%; rotate: 16deg; }
.gh2-crate > .gh2-bask { left: 50%; bottom: 0; z-index: 1; width: 1.66em; height: 1.66em; margin-left: -.83em; }
.gh2-crate::after { left: 10%; right: 10%; bottom: 0; height: 16%; }
.gh2-boing { animation: gh2-boing .6s ease-out; }
@container (min-aspect-ratio: 11 / 10) {
  .gh2-plant { display: grid; }
  .gh2-frame { left: 27%; margin-left: 0; top: 7%; }
  .gh2-clock { left: auto; right: 30%; margin-left: 0; top: 6%; }
  .gh2-t1 { right: calc(2.5% + 16cqw); }
  .gh2-shelf { display: flex; }
  .gh2-crate { display: block; }
  .gh2-t0 { left: 3%; bottom: 2%; }
  .gh2-t2 { left: auto; right: 4%; bottom: auto; top: 36%; }
  .gh2-t4 { left: calc(2% + .35em); bottom: calc(18.5% + .85em); rotate: 8deg; }
  .gh2-t4::after { display: none; }
}

/* ---------- Gấu Con ---------- */
.gh2-spot { position: absolute; z-index: 2; left: var(--cx); bottom: 4%; width: var(--b); height: var(--b); margin-left: calc(var(--b) / -2); transition: transform .35s cubic-bezier(.3, 1.3, .6, 1); pointer-events: none; }
/* bóng tiếp đất của Gấu Con trên thảm */
.gh2-spot::before { content: ""; position: absolute; left: 3%; right: 3%; bottom: -3.5%; height: 17%; border-radius: 50%; background: radial-gradient(ellipse, rgba(74, 22, 44, .62), rgba(74, 22, 44, .34) 42%, rgba(74, 22, 44, 0) 70%); }
.gh2-think, .gh2-duck { pointer-events: auto; }
.gh2-bear.buddy { position: absolute; inset: 0; touch-action: none; pointer-events: none; }
.gh2-hit { position: absolute; inset: 5% 1% 3% 1%; border-radius: 50%; pointer-events: auto; cursor: pointer; }
.gh2-bear .bd-fx { font-size: calc(var(--b) * .15) !important; }
.gh2-body { position: absolute; inset: 0; transform-origin: 50% 100%; animation: bd-breathe 3.6s ease-in-out infinite; }
.gh2-bear .gh2-body .mascot { width: 100%; height: 100%; animation: none; transform: none; filter: none; transition: filter .5s; }
.gh2-bear.hinted { outline: none !important; box-shadow: none !important; }
/* gấu to: bàn tay gợi ý của phần lõi đã chỉ đúng chỗ, gấu không cần nghiêng người chỉ theo */
.gh2-bear.buddy[data-mood="point"] { animation: none; }
.gh2-bear .bd-fx > .keep { display: none; }
.gh2-bear.hinted .mascot { filter: drop-shadow(0 0 14px #FFD23F) drop-shadow(0 0 6px #FFD23F); }
.gh2-body.gh2-chew { animation: gh2-chew .34s ease-in-out infinite; }
.gh2-body.gh2-shiny .mascot { filter: drop-shadow(0 0 16px #fff) brightness(1.08); }
/* vết bùn lấm lem khi Gấu Con cần tắm: mép nhoè, giữa sẫm, có chút bóng ướt */
.gh2-dirt { position: absolute; border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; opacity: 0; transition: opacity .7s; pointer-events: none;
  background: radial-gradient(ellipse at 36% 30%, rgba(150, 104, 66, .75), rgba(98, 62, 34, .78) 55%, rgba(98, 62, 34, .5) 100%); box-shadow: 0 0 3px 2px rgba(98, 62, 34, .28), inset 0 -2px 2px rgba(50, 28, 12, .35); }
.gh2-dirt::before, .gh2-dirt::after { content: ""; position: absolute; border-radius: 50%; background: rgba(98, 62, 34, .62); box-shadow: 0 0 2px 1px rgba(98, 62, 34, .25); }
.gh2-dirt::before { left: -34%; top: 58%; width: 34%; height: 40%; } .gh2-dirt::after { right: -26%; top: -14%; width: 24%; height: 30%; }
.gh2-d0 { left: 35%; top: 57%; width: 12%; height: 8%; transform: rotate(-12deg); } .gh2-d1 { left: 61%; top: 31%; width: 7%; height: 5%; transform: rotate(30deg); }
.gh2-d2 { left: 10%; top: 58%; width: 9%; height: 6%; transform: rotate(20deg); } .gh2-d3 { left: 66%; top: 74%; width: 9%; height: 6%; transform: rotate(-20deg); }
.gh2-scene[data-dirt="1"] .gh2-d0, .gh2-scene[data-dirt="1"] .gh2-d2, .gh2-scene[data-dirt="2"] .gh2-dirt { opacity: 1; }
/* mí mắt khép lại khi ngủ */
.gh2-lid { position: absolute; top: 23.4%; width: 7.4%; height: 6.2%; margin-left: -3.7%; border-radius: 50%; background: radial-gradient(ellipse at 40% 25%, #F3AB6C, #E08D4E); border-bottom: max(2px, calc(var(--b) * .011)) solid #5A3826; display: none; }
.gh2-l0 { left: 42.1%; } .gh2-l1 { left: 57.6%; }
.gh2-room[data-mode="sleep"] .gh2-lid { display: block; }
.gh2-room[data-mode="sleep"] .gh2-bear { animation: none !important; transform: rotate(-5deg); }
.gh2-room[data-mode="sleep"] .gh2-body { animation-duration: 5.2s; }
.gh2-room[data-mode="sleep"] .gh2-bear .bd-fx { display: none; }
/* đồ Gấu Con đang mặc */
.gh2-wear { position: absolute; inset: 0; pointer-events: none; }
.gh2-wear > .gh2-w { position: absolute; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); font-size: calc(var(--b) * var(--ws, .3) * .86); filter: drop-shadow(0 .03em .025em rgba(60, 25, 20, .45)); }
.gh2-room[data-mode="sleep"] .gh2-w-eyes, .gh2-room[data-mode="sleep"] .gh2-w-hand { display: none; }   /* đi ngủ thì bỏ kính, đặt đồ chơi xuống */
.gh2-wear > .gh2-w.gh2-popin { animation: gh2-wearin .45s cubic-bezier(.3, 1.6, .5, 1); }

/* ô suy nghĩ: Gấu Con đang muốn gì (hình và con số, không cần đọc chữ) — một đám mây trắng căng phồng, có bóng */
.gh2-think { position: absolute; z-index: 4; right: -4%; bottom: 72%; display: flex; align-items: center; justify-content: center; gap: .14em; min-width: 1.9em; padding: .2em .42em;
  font-size: calc(var(--b) * .15); line-height: 1; border-radius: 1em; background: radial-gradient(ellipse 90% 70% at 34% 20%, #fff 0 46%, #E6EFFD 100%);
  box-shadow: inset 0 -.13em .2em rgba(110, 145, 215, .5), inset 0 .08em .1em #fff, 0 0 0 max(2px, .035em) rgba(255, 255, 255, .9), 0 .12em .09em rgba(30, 42, 94, .22), 0 .26em .34em rgba(30, 42, 94, .34); }
.gh2-think[hidden], .gh2-back[hidden], .gh2-sponge[hidden] { display: none; }
.gh2-think::before, .gh2-think::after { content: ""; position: absolute; border-radius: 50%; background: radial-gradient(circle at 36% 28%, #fff 0 34%, #DCE7FA 100%); box-shadow: inset 0 -.03em .05em rgba(110, 145, 215, .6), 0 .05em .08em rgba(30, 42, 94, .35); }
.gh2-think::before { left: 6%; bottom: -.4em; width: .34em; height: .34em; }
.gh2-think::after { left: -4%; bottom: -.7em; width: .2em; height: .2em; }
.gh2-think .emo { width: 1.3em; height: 1.3em; font-size: 1em; filter: drop-shadow(0 .05em .04em rgba(30, 42, 94, .28)); }
.gh2-think span.emo { width: auto; height: auto; font-size: 1.15em; }
.gh2-num { font: 700 1.5em/1 var(--font-letter); color: var(--red); text-shadow: 0 .04em 0 #C22C3C, 0 .09em .07em rgba(30, 42, 94, .3); }
.gh2-x { font: 800 .8em/1 var(--font-ui); font-style: normal; color: var(--soft); }
.gh2-room[data-mode="room"] .gh2-think { animation: gh2-bob 1.6s ease-in-out infinite; }
.gh2-popin { animation: gh2-popin .4s cubic-bezier(.3, 1.6, .5, 1); }
.gh2-back { position: absolute; z-index: 6; left: 8px; bottom: 8px; }
.gh2-back svg { fill: #fff; stroke: var(--navy); stroke-width: 1.2; }

/* ---------- ăn: Gấu Con ngồi sau bàn gỗ, trên bàn có bát, cốc sữa và cái đĩa sứ ---------- */
.gh2-room[data-mode="eat"] .gh2-spot { transform: translate(-9%, -12%) scale(.84); }
.gh2-room[data-mode="eat"] .gh2-think { right: auto; left: 71%; bottom: 58%; }
.gh2-room.gh2-wide[data-mode="eat"] .gh2-spot { transform: translateY(-10%) scale(.94); }   /* phòng ngang còn rộng chỗ bên phải: không cần dịch gấu sang trái */
.gh2-room.gh2-wide[data-mode="eat"] .gh2-plate { margin-left: calc(var(--b) * -.45); }
.gh2-table { display: none; position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(var(--b) * .37); pointer-events: none; font-size: calc(var(--b) * .2); line-height: 1; }
.gh2-room[data-mode="eat"] .gh2-table { display: block; }
.gh2-table::before { content: ""; position: absolute; inset: 0; clip-path: polygon(4% 0, 96% 0, 100% 34%, 100% 100%, 0 100%, 0 34%);
  background: linear-gradient(rgba(255, 244, 214, .95) 0 2.5%, rgba(255, 244, 214, 0) 4%), linear-gradient(rgba(110, 58, 14, .22), rgba(110, 58, 14, 0) 26%, rgba(255, 255, 255, .12) 100%), var(--woodh) 0 0 / 220px 110px, linear-gradient(#EDBB7C, #E0A560); }
.gh2-table::after { content: ""; position: absolute; z-index: -1; left: 3%; right: 3%; top: -11%; height: 22%; background: radial-gradient(ellipse at 50% 60%, rgba(50, 24, 10, .5), rgba(50, 24, 10, 0) 70%); }
.gh2-table > .emo { position: absolute; top: -.62em; width: 1em; height: 1em; filter: drop-shadow(0 .05em .04em rgba(60, 28, 10, .5)); }
.gh2-table > .emo:first-child { left: 5.5%; } .gh2-table > .emo:last-child { right: 6%; top: -.72em; }
.gh2-plate { position: absolute; z-index: 3; left: var(--cx); bottom: 2.5%; width: calc(var(--b) * .9); height: calc(var(--b) * .3); margin-left: calc(var(--b) * -.54); display: none; place-items: center; border-radius: 50%; font-size: calc(var(--b) * .1);
  background: radial-gradient(ellipse 26% 12% at 26% 17%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 72%),
    radial-gradient(ellipse at 50% 47%, #FBFDFF 0 36%, #EDF2FA 49%, #D3DEEF 55%, #EEF3FB 58.5%, #FFFFFF 63%, #FDFEFF 67%, #E3EAF6 70.5%, #CDD8EA 71.5%);
  box-shadow: inset 0 -.08em .1em rgba(120, 145, 190, .45), 0 .12em 0 #C3CFE3, 0 .2em 0 #A9B8D1, 0 .34em .22em rgba(60, 28, 10, .5); }
.gh2-room[data-mode="eat"] .gh2-plate { display: grid; }
.gh2-pgrid { display: grid; grid-template-columns: repeat(var(--pc, 5), auto); justify-content: center; gap: 0 .06em; font-size: calc(var(--b) * var(--pf, .1)); line-height: 1; }
.gh2-on { position: relative; z-index: 0; display: grid; place-items: center; transition: transform .22s, opacity .22s; }
.gh2-on::after { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; bottom: -2%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse, rgba(60, 70, 110, .5), rgba(60, 70, 110, 0) 70%); }
.gh2-on.gh2-eaten { transform: scale(0) rotate(40deg); opacity: 0; }
.gh2-count { position: absolute; right: 0; top: -22%; display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: radial-gradient(circle at 36% 26%, #fff 0 40%, #FFEFD2 100%);
  font: 700 calc(var(--b) * .1) / 1 var(--font-letter); color: var(--navy); box-shadow: inset 0 -.1em .12em rgba(255, 150, 30, .35), 0 0 0 .13em #FFA629, 0 .16em 0 .13em #D97A0C, 0 .34em .3em rgba(30, 42, 94, .38); }
.gh2-fly { position: fixed; z-index: 30; display: grid; place-items: center; line-height: 1; pointer-events: none; filter: drop-shadow(0 10px 6px rgba(30, 42, 94, .3)); }
.gh2-fly .emo { width: 1.12em; height: 1.12em; }

/* ---------- tắm: bồn tắm 3D (hình sau lưng gấu + nửa thành bồn phía trước), bọt xà phòng bóng, giọt nước 3D ---------- */
.gh2-tubback, .gh2-tub, .gh2-duck, .gh2-rain { display: none; }
.gh2-room[data-mode="bath"] .gh2-tubback, .gh2-room[data-mode="bath"] .gh2-tub, .gh2-room[data-mode="bath"] .gh2-duck { display: block; }
.gh2-room[data-mode="bath"] .gh2-spot { transform: translateY(-13%); }
.gh2-room.gh2-wide[data-mode="bath"] .gh2-spot { transform: translateY(-8%); }   /* phòng ngang thấp: nhấc ít thôi để Gấu Con nhảy lên không chạm trần */
.gh2-room[data-mode="bath"] .gh2-spot::before { left: 4%; right: 4%; bottom: -19%; height: 11%; }
.gh2-spot > .gh2-tubback, .gh2-tub { position: absolute; left: -2%; top: 18.2%; width: 104%; height: 104%; pointer-events: none; }
.gh2-tub { z-index: 3; }
.gh2-tub > .emo { position: absolute; left: 0; top: 0; width: 100%; height: 100%; clip-path: inset(48.3% 0 0 0); }
/* bọt đầy miệng bồn: một hàng bọt tròn bóng, nằm trước Gấu Con và sau thành bồn */
.gh2-lather { position: absolute; left: 8%; right: 8%; top: 42%; height: 9.5%;
  background: radial-gradient(circle closest-side, #fff 0 34%, #EEF6FF 62%, #C4DEF9 94%, rgba(196, 222, 249, 0) 100%) 0 100% / 9.6% 84% repeat-x,
    radial-gradient(circle closest-side, #fff 0 38%, #F2F9FF 64%, #CFE5FB 94%, rgba(207, 229, 251, 0) 100%) 5% 0 / 13.4% 100% repeat-x; }
.gh2-duck { position: absolute; z-index: 2; left: 1%; bottom: 29%; width: 1.12em; height: 1.12em; font-size: calc(var(--b) * .19); line-height: 1; animation: gh2-bob 2s ease-in-out infinite; }
.gh2-foam { position: absolute; inset: 0; pointer-events: none; }
.gh2-suds { position: absolute; width: 20%; height: 20%; font-size: calc(var(--b) * .2); transform: scale(var(--k, 1)); animation: gh2-popin .3s cubic-bezier(.3, 1.6, .5, 1); transition: transform .3s, opacity .3s; }
.gh2-suds > i { position: absolute; border-radius: 50%; background: radial-gradient(circle at 30% 24%, #fff 0 20%, rgba(255, 255, 255, 0) 30%), radial-gradient(circle at 44% 40%, #FDFEFF 0 38%, #E4F1FF 62%, #BFDBF8 100%);
  box-shadow: inset -.03em -.05em .07em rgba(70, 130, 220, .4), inset .02em .03em .04em #fff, 0 .03em .05em rgba(30, 42, 94, .28); }
.gh2-suds > i:nth-child(1) { left: 4%; top: 22%; width: 62%; height: 62%; } .gh2-suds > i:nth-child(2) { left: 46%; top: 2%; width: 50%; height: 50%; } .gh2-suds > i:nth-child(3) { left: 44%; top: 46%; width: 44%; height: 44%; }
.gh2-suds > .emo { position: absolute; left: -14%; top: -20%; width: 56%; height: 56%; }
.gh2-suds.gh2-pop { transform: scale(1.5) translateY(30%); opacity: 0; }
.gh2-rain { position: absolute; z-index: 4; left: 12%; right: 12%; top: -6%; height: 96%; pointer-events: none; font-size: calc(var(--b) * .1); }
.gh2-scene.gh2-raining .gh2-rain { display: block; }
.gh2-rain > .gh2-drop { position: absolute; top: 0; width: 1em; height: 1em; opacity: 0; animation: gh2-drop .55s linear infinite; }
.gh2-sponge { position: absolute; z-index: 8; width: 0; height: 0; pointer-events: none; font-size: clamp(54px, 15vmin, 96px); line-height: 1; }
.gh2-sponge .emo { position: absolute; left: -.56em; top: -.7em; filter: drop-shadow(0 8px 5px rgba(30, 42, 94, .35)); }

/* ---------- ngủ: phòng tối xanh thẫm, ánh trăng rọi từ cửa sổ xuống sàn, sao lấp lánh phát sáng ---------- */
.gh2-night { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .7s;
  background: radial-gradient(ellipse 46% 20% at 40% 90%, rgba(150, 180, 255, .3), rgba(150, 180, 255, 0) 70%), radial-gradient(ellipse at 46% 70%, rgba(26, 32, 92, .5), rgba(10, 14, 54, .88)); }
.gh2-night .gh2-tw { font-size: clamp(12px, 4.2cqw, 28px); }
.gh2-room[data-mode="sleep"] .gh2-night { opacity: 1; }
.gh2-zzz { position: absolute; z-index: 5; left: calc(var(--cx) + var(--b) * .16); bottom: calc(4% + var(--b) * .7); display: none; font-size: calc(var(--b) * .2); line-height: 1; pointer-events: none; }
.gh2-zzz .emo { display: block; animation: gh2-zzz 2.8s ease-in-out infinite; filter: drop-shadow(0 0 .12em rgba(170, 200, 255, .8)); }
.gh2-room[data-mode="sleep"] .gh2-zzz { display: block; }

/* ---------- bảng bên cạnh: một tấm bảng dày, mép trên bắt sáng ---------- */
.gh2-panel { position: relative; z-index: 2; flex: none; height: 30%; min-height: 112px; padding: 8px; display: grid; container-type: size;
  border: 5px solid #fff; border-radius: 26px; background: linear-gradient(#FFF9E3, #FFE3A3); box-shadow: 0 8px 0 rgba(30, 42, 94, .18), 0 16px 22px rgba(30, 42, 94, .2), inset 0 3px 0 rgba(255, 255, 255, .95), inset 0 -12px 16px rgba(232, 150, 40, .22); }
/* khay gỗ đựng đồ ăn: thành khay sáng, lòng khay trũng xuống (bóng trong), vân gỗ */
.gh2-room[data-mode="eat"] > .gh2-panel { height: 38%; border-color: #FBDDAA; background: var(--woodh) 0 0 / 220px 140px, linear-gradient(#EBB978, #DCA25E);
  box-shadow: 0 8px 0 #B9772F, 0 16px 22px rgba(30, 42, 94, .24), inset 0 3px 0 rgba(255, 244, 220, .9), inset 0 -4px 5px rgba(150, 84, 20, .35); }
.gh2-room[data-mode="eat"][data-many] > .gh2-panel { height: 44%; }
.gh2-room[data-mode="eat"] > .gh2-panel::before { content: ""; position: absolute; z-index: -1; inset: 7px; border-radius: 16px; background: var(--woodh) 0 0 / 220px 140px, linear-gradient(#DDA562, #CF9450);
  box-shadow: inset 0 7px 9px rgba(84, 40, 6, .55), inset 5px 0 7px -3px rgba(84, 40, 6, .4), inset -5px 0 7px -3px rgba(84, 40, 6, .4), inset 0 -3px 4px rgba(255, 232, 190, .5), 0 1px 0 rgba(255, 240, 210, .9); }
/* tủ đồ: khung tủ sơn hồng phấn, từng ngăn lõm vào trong */
.gh2-room[data-mode="dress"] > .gh2-panel { height: 45%; border-color: #FFF4F9; background: linear-gradient(#FFE1EF, #FFBFDC);
  box-shadow: 0 8px 0 #D56FA3, 0 16px 22px rgba(30, 42, 94, .22), inset 0 3px 0 rgba(255, 255, 255, .9), inset 0 -8px 12px rgba(214, 80, 150, .22); }
.gh2-room[data-mode="bath"] > .gh2-panel { height: 24%; background: linear-gradient(#EAF7FF, #B8E0FF); box-shadow: 0 8px 0 rgba(30, 42, 94, .18), 0 16px 22px rgba(30, 42, 94, .2), inset 0 3px 0 rgba(255, 255, 255, .95), inset 0 -12px 16px rgba(60, 150, 240, .2); }
.gh2-room[data-mode="sleep"] > .gh2-panel { height: 22%; background: linear-gradient(#414BA0, #232963); border-color: #8E9CCB; box-shadow: 0 8px 0 rgba(12, 16, 60, .5), 0 16px 22px rgba(30, 42, 94, .25), inset 0 3px 0 rgba(170, 185, 255, .5), inset 0 -12px 16px rgba(8, 10, 50, .4); }
.gh2-room.gh2-wide > .gh2-panel, .gh2-room.gh2-wide[data-many] > .gh2-panel { width: clamp(232px, 32%, 340px); height: auto; min-height: 0; }

/* bốn nút việc: nút nổi 3D (mặt nút bóng, viền vát, thân nút dày), ấn thì lún xuống */
.gh2-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; min-height: 0; padding-bottom: 7px; }
.gh2-wide .gh2-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 230px)); align-content: center; gap: 12px 10px; }
.gh2-act { --t: #FFA733; --tl: #FFC875; --d: #DB7A0A; --tint: #FFE0AE; --ink: #9A5200; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 0; padding: 4px 2px 6px;
  border-radius: 22px; border: 4px solid var(--t); border-top-color: var(--tl); border-bottom-color: var(--d);
  background: radial-gradient(ellipse 88% 42% at 50% 0, rgba(255, 255, 255, .98), rgba(255, 255, 255, 0) 74%), linear-gradient(#FFFDF8 28%, var(--tint));
  box-shadow: inset 0 2px 0 #fff, inset 0 -7px 10px rgba(30, 42, 94, .07), 0 7px 0 var(--d), 0 9px 0 rgba(30, 42, 94, .16), 0 15px 12px rgba(30, 42, 94, .3);
  font-size: min(17cqw, 46cqh); line-height: 1; transition: transform .2s cubic-bezier(.3, 1.7, .5, 1), box-shadow .12s; }
.gh2-act[data-act="clean"] { --t: #4DA8FF; --tl: #8CC8FF; --d: #1F74D1; --tint: #CFE7FF; --ink: #1B5AA8; }
.gh2-act[data-act="sleep"] { --t: #9B7BFF; --tl: #BFA9FF; --d: #6A48D6; --tint: #E1D7FF; --ink: #5235B0; }
.gh2-act[data-act="dress"] { --t: #FF7DBB; --tl: #FFAAD3; --d: #D94C93; --tint: #FFD6EA; --ink: #B02E74; }
.gh2-wide .gh2-act { font-size: min(30cqw, 19cqh); }
.gh2-act:active { transform: translateY(6px); box-shadow: inset 0 2px 0 #fff, inset 0 -7px 10px rgba(30, 42, 94, .07), 0 1px 0 var(--d), 0 2px 0 rgba(30, 42, 94, .16), 0 4px 5px rgba(30, 42, 94, .3); transition-duration: .06s; }
.gh2-act > .emo { width: 1em; height: 1em; filter: drop-shadow(0 .07em .05em rgba(30, 42, 94, .28)); }
.gh2-act > b { font-weight: 800; font-size: clamp(.9rem, .3em, 1.35rem); line-height: 1.15; white-space: nowrap; color: var(--ink); text-shadow: 0 1px 0 #fff; }
/* ba trái tim 3D: tim còn thiếu chỉ là cái bóng xám mờ */
.gh2-hearts { display: flex; gap: 2px; height: clamp(17px, .3em, 26px); }
.gh2-hearts > .emo { width: auto; height: 100%; aspect-ratio: 1; transition: filter .4s, opacity .4s; filter: drop-shadow(0 1.5px 1px rgba(30, 42, 94, .3)); }
.gh2-act[data-h="1"] .gh2-hearts > .emo:nth-child(n+2), .gh2-act[data-h="2"] .gh2-hearts > .emo:nth-child(3) { filter: grayscale(1) brightness(1.2); opacity: .42; }
.gh2-act.gh2-urgent { animation: gh2-wiggle 1.15s ease-in-out infinite; box-shadow: inset 0 2px 0 #fff, inset 0 -7px 10px rgba(30, 42, 94, .07), 0 7px 0 var(--d), 0 15px 12px rgba(30, 42, 94, .3), 0 0 0 5px rgba(255, 210, 63, .8), 0 0 16px 8px rgba(255, 205, 50, .5); }
.gh2-dot { display: block; height: clamp(17px, .3em, 26px); aspect-ratio: 1; visibility: hidden; }
.gh2-dot > .emo { display: block; width: 130%; height: 130%; margin: -15%; filter: drop-shadow(0 1.5px 1px rgba(30, 42, 94, .3)); }
.gh2-act.gh2-fresh .gh2-dot { visibility: visible; animation: pulse .9s ease-in-out infinite; }

/* khay đồ ăn và tủ đồ: lưới ô vuông, JS chọn số cột để ô to nhất (--cols, --cell) */
.gh2-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), var(--cell, 64px)); grid-auto-rows: var(--cell, 64px); gap: 6px; place-content: center; min-width: 0; min-height: 0; }
.gh2-food { position: relative; display: grid; place-items: center; width: var(--cell, 64px); height: var(--cell, 64px); font-size: calc(var(--cell, 64px) * .8); line-height: 1; touch-action: none; cursor: grab;
  filter: drop-shadow(0 .09em .05em rgba(70, 32, 4, .5)); transition: transform .14s; }
.gh2-food .emo { width: 1.12em; height: 1.12em; pointer-events: none; }
.gh2-food:active { transform: scale(1.1); }
.gh2-food.gh2-drag { z-index: 9; transition: none; cursor: grabbing; filter: drop-shadow(0 .3em .16em rgba(70, 32, 4, .4)); }
.gh2-food.gh2-gone { visibility: hidden; pointer-events: none; }
.gh2-food.gh2-rest { opacity: .45; }
.gh2-nope { animation: wobble .45s; }

/* một ngăn tủ: lòng ngăn sẫm ở trên (bóng của tấm ván phía trên), đáy ngăn sáng; món đồ đứng trên đáy ngăn, có bóng */
.gh2-item { position: relative; display: grid; place-items: center; width: var(--cell, 64px); height: var(--cell, 64px); font-size: calc(var(--cell, 64px) * .7); line-height: 1; border-radius: 16%;
  background: linear-gradient(#EBA3C6 0, #F9CBE0 26%, #FFE4F0 74%, #FFF6FA 75%, #FFE9F3 100%);
  box-shadow: inset 0 .16em .16em rgba(126, 30, 84, .5), inset .07em 0 .09em rgba(126, 30, 84, .22), inset -.07em 0 .09em rgba(126, 30, 84, .22), 0 1px 0 rgba(255, 255, 255, .95), 0 -1px 0 rgba(190, 70, 130, .35);
  transition: transform .2s cubic-bezier(.3, 1.7, .5, 1); }
.gh2-item:active { transform: scale(.92); transition-duration: .06s; }
.gh2-item > .emo { width: 1.12em; height: 1.12em; filter: drop-shadow(0 .09em .05em rgba(110, 30, 70, .5)); }
.gh2-item.gh2-worn { background: linear-gradient(#8FD8A4 0, #C6F0D0 26%, #E4FBE9 74%, #F6FFF8 75%, #E0F8E6 100%);
  box-shadow: inset 0 .16em .16em rgba(20, 100, 50, .45), inset .07em 0 .09em rgba(20, 100, 50, .2), inset -.07em 0 .09em rgba(20, 100, 50, .2), 0 0 0 3px #3CCB6B, 0 0 9px 3px rgba(60, 203, 107, .6); }
.gh2-item.gh2-worn::after { content: ""; position: absolute; right: -7px; top: -9px; width: 30px; height: 30px; background: url(../img/nha-dau-tich.png) center / contain no-repeat; filter: drop-shadow(0 2px 1.5px rgba(30, 42, 94, .4)); }
.gh2-item.gh2-new { animation: gh2-new 1.1s ease-in-out infinite; box-shadow: inset 0 .16em .16em rgba(126, 30, 84, .5), 0 0 0 3px #FFD23F, 0 0 10px 4px rgba(255, 210, 63, .75); }
/* món chưa mở: chỉ là cái bóng mềm trong ngăn tủ tối, kèm ngôi sao (hoặc hộp quà) và con số còn thiếu; vạch dưới cho biết đã gom được bao nhiêu */
.gh2-item.gh2-lock { background: linear-gradient(#C9A9C6 0, #DCC6DD 30%, #EBDDEC 74%, #F3EAF4 75%, #E6DAE8 100%); box-shadow: inset 0 .18em .2em rgba(70, 40, 90, .5), inset .07em 0 .09em rgba(70, 40, 90, .22), inset -.07em 0 .09em rgba(70, 40, 90, .22), 0 1px 0 rgba(255, 255, 255, .95); }
.gh2-item.gh2-lock > .emo { filter: brightness(0) blur(1px); opacity: .26; transform: translateY(-16%); }
.gh2-cue { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); display: flex; align-items: center; gap: 1px; padding: 1px 7px 1px 3px; border-radius: 999px; background: linear-gradient(#fff, #F1ECF8); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #CFC3E0, 0 4px 4px rgba(30, 42, 94, .3);
  font: 700 calc(var(--cell, 64px) * .24) / 1.1 var(--font-letter); color: var(--navy); }
.gh2-cue > .emo { width: 1.2em; height: 1.2em; font-size: 1em; }
.gh2-bar { position: absolute; left: 12%; right: 12%; bottom: 7%; height: 7%; min-height: 5px; border-radius: 9px; background: #D9CFE6; box-shadow: inset 0 1px 2px rgba(60, 40, 90, .45); overflow: hidden; }
.gh2-bar > i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(#FFE88A, #FFC21F); }
.gh2-item.gh2-next { animation: bd-invite 1.6s ease-in-out infinite; box-shadow: inset 0 .18em .2em rgba(70, 40, 90, .5), 0 0 0 3px #FF6DB3, 0 0 8px 2px rgba(255, 109, 179, .5); }

/* hai dụng cụ tắm: nút nổi 3D như bốn nút việc */
.gh2-tools { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 4cqw, 26px); min-width: 0; min-height: 0; }
.gh2-wide .gh2-tools { flex-direction: column; }
.gh2-tool { --t: #FFD23F; --tl: #FFE68A; --d: #D9A400; --tint: #FFF1B8; display: grid; place-items: center; width: 1.5em; height: 1.5em; font-size: min(30cqw, 60cqh, 120px); line-height: 1; border-radius: 26%;
  border: 5px solid var(--t); border-top-color: var(--tl); border-bottom-color: var(--d); background: radial-gradient(ellipse 88% 42% at 50% 0, rgba(255, 255, 255, .98), rgba(255, 255, 255, 0) 74%), linear-gradient(#FFFDF8 28%, var(--tint));
  box-shadow: inset 0 2px 0 #fff, 0 6px 0 var(--d), 0 8px 0 rgba(30, 42, 94, .16), 0 13px 11px rgba(30, 42, 94, .28); opacity: .55; transition: opacity .3s, transform .2s; touch-action: none; }
.gh2-tool.c-blue { --t: #4DA8FF; --tl: #8CC8FF; --d: #1F74D1; --tint: #CFE7FF; }
.gh2-wide .gh2-tool { font-size: min(46cqw, 24cqh, 130px); }
.gh2-tool .emo { width: 1.12em; height: 1.12em; pointer-events: none; filter: drop-shadow(0 .05em .04em rgba(30, 42, 94, .3)); }
.gh2-tool.gh2-now { opacity: 1; animation: pulse 1s ease-in-out infinite; }
.gh2-tool.gh2-rest { opacity: .35; }
.gh2-arrow { font: 800 min(12cqw, 26cqh, 48px) / 1 var(--font-ui); font-style: normal; color: var(--blue); }
.gh2-arrow > .emo { display: block; width: 1em; height: 1em; filter: drop-shadow(0 2px 2px rgba(30, 42, 94, .3)); }
.gh2-wide .gh2-arrow { transform: rotate(90deg); }

.gh2-nap { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3cqw, 20px); min-width: 0; min-height: 0; color: #fff; font-size: min(17cqw, 58cqh, 88px); line-height: 1; }
.gh2-wide .gh2-nap { flex-direction: column; text-align: center; font-size: min(30cqw, 16cqh, 96px); }
.gh2-nap > .emo { width: 1.12em; height: 1.12em; flex: none; animation: gh2-bob 3s ease-in-out infinite; filter: drop-shadow(0 0 .12em rgba(255, 236, 150, .7)); }
.gh2-nap > b { min-width: 0; font-weight: 800; font-size: clamp(.95rem, .26em, 1.4rem); line-height: 1.2; text-shadow: 0 2px 2px rgba(8, 10, 50, .5); }
.gh2-nap.gh2-late > b { color: #FFF3A3; }
/* nút mặt trời gọi Gấu Con dậy: nút tròn nổi */
.gh2-wake { display: grid; place-items: center; flex: none; width: 1.36em; height: 1.36em; border-radius: 50%; background: radial-gradient(circle at 36% 26%, #FFFCE0 0 18%, #FFE169 52%, #FFC21F 100%); border: 4px solid #fff;
  box-shadow: inset 0 -.08em .1em rgba(210, 130, 0, .45), 0 .07em 0 #C98A00, 0 .16em .14em rgba(0, 0, 0, .45); opacity: .3; transition: opacity .6s, transform .2s; }
.gh2-wake:active { transform: translateY(.05em); }
.gh2-wake .emo { width: 1em; height: 1em; }
.gh2-wake.gh2-ready { opacity: 1; }
.gh2-nap.gh2-late .gh2-wake { font-size: .7em; }

@keyframes gh2-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes gh2-boing { 0% { scale: 1; } 30% { scale: 1.3 .8; } 55% { scale: .88 1.18; } 78% { scale: 1.08 .95; } 100% { scale: 1; } }
@keyframes gh2-popin { from { scale: .2; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes gh2-wearin { from { transform: translate(-50%, -160%) rotate(var(--rot, 0deg)) scale(1.5); opacity: 0; } to { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); opacity: 1; } }
@keyframes gh2-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7%; } }
@keyframes gh2-chew { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04, .93); } }
@keyframes gh2-wiggle { 0%, 55%, 100% { transform: rotate(0); } 62% { transform: rotate(-6deg) scale(1.06); } 72% { transform: rotate(6deg) scale(1.06); } 82% { transform: rotate(-4deg); } 92% { transform: rotate(3deg); } }
@keyframes gh2-new { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1) rotate(-4deg); } }
@keyframes gh2-drop { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .95; } 85% { opacity: .95; } 100% { transform: translateY(820%); opacity: 0; } }
@keyframes gh2-zzz { 0% { transform: translate(-20%, 30%) scale(.5); opacity: 0; } 30% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(25%, -40%) scale(1.1); opacity: 0; } }

@media (max-height: 560px) {
  .gh2-room { gap: 6px; }
  .gh2-scene, .gh2-panel { border-width: 4px; border-radius: 20px; }
  .gh2-scene::after { border-radius: 15px; }
  .gh2-panel { padding: 6px; }
  .gh2-act { border-width: 3px; border-radius: 16px; }
  .gh2-act > b { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gh2-body, .gh2-lamp.gh2-call, .gh2-think, .gh2-act.gh2-urgent, .gh2-item, .gh2-tool, .gh2-duck, .gh2-nap > .emo, .gh2-tw, .gh2-suds, .gh2-dot, .gh2-boing, .gh2-popin, .gh2-nope { animation: none !important; }
  .gh2-zzz .emo { animation: none; }
  .gh2-spot, .gh2-on, .gh2-act, .gh2-item, .gh2-beam, .gh2-amb { transition: none; }
  .gh2-rain > .gh2-drop { animation: none; opacity: .9; top: 30%; }
}

/* ---------- wave 6: compat (trình duyệt cũ) ---------- */
/* Bản dự phòng cho máy cũ của các luật phía trên (giải thích ở cuối css/style.css); sửa luật gốc thì sửa luôn dòng tương ứng ở đây. */
/* color-mix(): file này không còn dùng (nút và bóng đổ dùng màu ghi sẵn), nên không cần bản dự phòng */
/* chưa có đơn vị cqw/cqh, @container */
@supports not (width: 1cqw) {
  .gh2-scene { --b: min(calc(78 * var(--cq-h)), calc(84 * var(--cq-w))); --cq: size; contain: size; }
  .gh2-win { width: clamp(74px, calc(22 * var(--cqw)), 168px); }
  .gh2-win .gh2-tw { font-size: clamp(9px, calc(3 * var(--cqw)), 16px); }
  .gh2-lamp { width: clamp(66px, calc(18 * var(--cqw)), 128px); height: clamp(88px, calc(27 * var(--cqh)), 168px); }
  .gh2-deco, .gh2-toy { font-size: clamp(34px, calc(11 * var(--cqw)), 72px); }
  .gh2-frame { font-size: clamp(34px, calc(10 * var(--cqw)), 64px); }
  .gh2-clock { font-size: clamp(30px, calc(8.5 * var(--cqw)), 56px); }
  .gh2-plant { font-size: clamp(54px, calc(15 * var(--cqw)), 110px); }
  .gh2-shelf { font-size: clamp(32px, calc(8.5 * var(--cqw)), 58px); }
  .gh2-crate { font-size: clamp(38px, calc(9.5 * var(--cqw)), 64px); }
  :where(.gh2-scene[data-cq-wide]) .gh2-plant { display: grid; }
  :where(.gh2-scene[data-cq-wide]) .gh2-frame { left: 27%; margin-left: 0; top: 7%; }
  :where(.gh2-scene[data-cq-wide]) .gh2-clock { left: auto; right: 30%; margin-left: 0; top: 6%; }
  :where(.gh2-scene[data-cq-wide]) .gh2-t1 { right: calc(2.5% + calc(16 * var(--cqw))); }
  :where(.gh2-scene[data-cq-wide]) .gh2-shelf { display: flex; }
  :where(.gh2-scene[data-cq-wide]) .gh2-crate { display: block; }
  :where(.gh2-scene[data-cq-wide]) .gh2-t0 { left: 3%; bottom: 2%; }
  :where(.gh2-scene[data-cq-wide]) .gh2-t2 { left: auto; right: 4%; bottom: auto; top: 36%; }
  :where(.gh2-scene[data-cq-wide]) .gh2-t4 { left: calc(2% + .35em); bottom: calc(18.5% + .85em); }
  .gh2-scene[data-cq-wide] .gh2-t4::after { display: none; }
  .gh2-night .gh2-tw { font-size: clamp(12px, calc(4.2 * var(--cqw)), 28px); }
  .gh2-panel { --cq: size; contain: size; }
  .gh2-act { font-size: min(calc(17 * var(--cqw)), calc(46 * var(--cqh))); }
  .gh2-wide .gh2-act { font-size: min(calc(30 * var(--cqw)), calc(19 * var(--cqh))); }
  .gh2-tools { gap: clamp(8px, calc(4 * var(--cqw)), 26px); }
  .gh2-tool { font-size: min(calc(30 * var(--cqw)), calc(60 * var(--cqh)), 120px); }
  .gh2-wide .gh2-tool { font-size: min(calc(46 * var(--cqw)), calc(24 * var(--cqh)), 130px); }
  .gh2-arrow { font: 800 min(calc(12 * var(--cqw)), calc(26 * var(--cqh)), 48px) / 1 var(--font-ui); }
  .gh2-nap { gap: clamp(8px, calc(3 * var(--cqw)), 20px); font-size: min(calc(17 * var(--cqw)), calc(58 * var(--cqh)), 88px); }
  .gh2-wide .gh2-nap { font-size: min(calc(30 * var(--cqw)), calc(16 * var(--cqh)), 96px); }
}
/* chưa có translate/rotate/scale rời */
@supports not (translate: 0) {
  :where(.gh2-tw) { transform: var(--i-t); }
  .gh2-crate > .emo:first-child { --i-r: -14deg; transform: var(--i-t); }
  .gh2-crate > .emo:last-child { --i-r: 16deg; transform: var(--i-t); }
  :where(.gh2-boing) { transform: var(--i-t); }
  :where(.gh2-scene[data-cq-wide]) .gh2-t4 { --i-r: 8deg; transform: var(--i-t); }
  :where(.gh2-room[data-mode="room"] .gh2-think) { transform: var(--i-t); }
  :where(.gh2-popin) { transform: var(--i-t); }
  :where(.gh2-duck) { transform: var(--i-t); }
  .gh2-suds { transform: var(--i-t) scale(var(--k, 1)); }
  :where(.gh2-nap > .emo) { transform: var(--i-t); }
  @keyframes gh2-boing { 0% { --i-sx: 1; --i-sy: 1; } 30% { --i-sx: 1.3; --i-sy: .8; } 55% { --i-sx: .88; --i-sy: 1.18; } 78% { --i-sx: 1.08; --i-sy: .95; } 100% { --i-sx: 1; --i-sy: 1; } }
  @keyframes gh2-popin { from { --i-sx: .2; --i-sy: .2; opacity: 0; } to { --i-sx: 1; --i-sy: 1; opacity: 1; } }
  @keyframes gh2-wearin { from { transform: var(--i-t) translate(-50%, -160%) rotate(var(--rot, 0deg)) scale(1.5); opacity: 0; } to { transform: var(--i-t) translate(-50%, -50%) rotate(var(--rot, 0deg)); opacity: 1; } }
  @keyframes gh2-bob { 0%, 100% { --i-tx: 0px; --i-ty: 0px; } 50% { --i-tx: 0px; --i-ty: -7%; } }
}
