/* ---------- Our room: the house (js/room.js) ---------- */
.room { display: grid; justify-items: center; gap: var(--space-3); width: 100%; }
.house__scroller {
  position: relative; width: 100%; height: min(56vh, 470px); overflow: hidden;
  transition: height 0.6s cubic-bezier(0.22, 0.8, 0.26, 1);
  touch-action: pan-y;               /* up/down still scrolls the page; sideways is ours */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.house__world { --sky-top: #8FD3FF; --sky-bottom: #DDF3FF; position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.26, 1); will-change: transform; }
.house__world.is-evening { --sky-top: #2B2A5E; --sky-bottom: #7A5FA8; }
.house__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.room__sky1 { stop-color: var(--sky-top); }
.room__sky2 { stop-color: var(--sky-bottom); }
.room__stars, .room__moon { opacity: 0; transition: opacity 0.6s; }
.house__world.is-evening .room__stars, .house__world.is-evening .room__moon, .house__world.is-dark .room__stars, .house__world.is-dark .room__moon { opacity: 1; }
.house__world.is-evening .room__sun, .house__world.is-dark .room__sun { opacity: 0; }
[data-thing] { cursor: pointer; }
.room__toggle { transition: transform 0.2s; transform-box: fill-box; transform-origin: 50% 50%; }
.room__screen { animation: room-screen 3s ease-in-out infinite alternate; }
@keyframes room-screen { from { fill: #7FD8FF; } to { fill: #F5A3FF; } }
.house__rgb polygon { animation: room-rgb 2.4s linear infinite; }
@keyframes room-rgb { 0% { fill: #F06C9B; } 33% { fill: #7FD8FF; } 66% { fill: #B8F28A; } 100% { fill: #F06C9B; } }
.house__tvscreen { fill: #2A2050; }
.house__nav { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding: 2px 12px; scrollbar-width: none; }
.house__nav::-webkit-scrollbar { display: none; }
.house__go { flex: none; min-height: 36px; font-size: 0.8rem; }
.house__go[aria-pressed="true"] { background: var(--rose); color: #FFFFFF; border-color: var(--rose); }
.room__switch { animation: room-switch 2.4s ease-in-out 1s 3; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes room-switch { 50% { transform: scale(1.12); } }

/* lights off */
.room__dark { fill: #1C1440; opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
.house__glowlayer { opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
.house__world.is-dark .room__dark { opacity: 0.55; }
.house__world.is-dark .house__glowlayer { opacity: 1; filter: drop-shadow(0 0 4px #FFE07A); }
.house__world.is-dark .room__toggle { transform: translateY(3px); fill: #9C8FB8; }
.house__world.is-dark .room__screen, .house__world.is-dark .house__rgb polygon { animation: none; }
.house__world.is-dark .cat__svg { filter: brightness(0.6) saturate(0.8) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3)); }
.cat__svg { transition: filter 0.9s ease; }

/* kitties */
.room__cats { position: absolute; inset: 0; pointer-events: none; }
.cat {
  position: absolute; left: 0; top: 0; width: var(--cat-w, 60px); aspect-ratio: 64 / 56; margin-left: calc(var(--cat-w, 60px) / -2); margin-top: calc(var(--cat-w, 60px) * -0.8);
  padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
}
.cat__inner { display: block; width: 100%; height: 100%; transition: transform 0.25s ease; }
.cat__svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 2px rgba(74, 23, 52, 0.25)); }
.cat__asleep, .cat__happy { display: none; }
.cat.is-sleep .cat__awake { display: none; }
.cat.is-sleep .cat__asleep { display: inline; }
.cat.is-happy .cat__eyes { display: none; }
.cat.is-happy .cat__happy { display: inline; }
.cat__tail { transform-box: fill-box; transform-origin: 90% 95%; animation: cat-tail 2.4s ease-in-out infinite; }
@keyframes cat-tail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
.cat__eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: cat-blink 4.5s infinite; }
@keyframes cat-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.cat--za .cat__eyes { animation-delay: -2s; }
.cat__leg { transform-box: fill-box; transform-origin: 50% 0; }
.cat.is-walk .cat__leg--b1, .cat.is-walk .cat__leg--f2 { animation: cat-step 0.4s ease-in-out infinite; }
.cat.is-walk .cat__leg--b2, .cat.is-walk .cat__leg--f1 { animation: cat-step 0.4s ease-in-out infinite reverse; }
@keyframes cat-step { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
.cat.is-walk .cat__svg { animation: cat-bob 0.4s ease-in-out infinite; }
@keyframes cat-bob { 50% { transform: translateY(-1.5px); } }
.cat__head { transform-box: fill-box; transform-origin: 30% 80%; }
.cat.is-groom .cat__head { animation: cat-groom 1.1s ease-in-out infinite; }
@keyframes cat-groom { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg) translateY(2px); } }
.cat.is-sit .cat__legs { transform: translateY(-2px); }
.cat.is-stretch .cat__svg { animation: cat-stretch 0.7s ease-in-out; }
@keyframes cat-stretch { 40% { transform: scaleX(1.18) scaleY(0.86); } }
.cat.is-sleep .cat__svg { animation: cat-breathe 3s ease-in-out infinite; }
@keyframes cat-breathe { 50% { transform: scale(1.03, 0.97); } }
.cat__zzz { position: absolute; left: 60%; top: -18%; font: 800 0.8rem var(--font-hand); color: #FFFFFF; opacity: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.cat.is-sleep .cat__zzz { animation: cat-zzz 2.6s ease-in-out infinite; }
.cat--za .cat__zzz { animation-delay: -1.3s !important; }
@keyframes cat-zzz { 0% { opacity: 0; transform: translate(0, 6px) scale(0.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -14px) scale(1.1); } }
.cat__tag { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); font: 800 0.62rem var(--font-body); color: var(--rose); opacity: 0; transition: opacity 0.3s; pointer-events: none; white-space: nowrap; }
.cat--za .cat__tag { color: #2F7BD9; }
.cat.is-happy .cat__tag { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cat__tail, .cat__eyes, .room__screen, .cat.is-sleep .cat__svg { animation: none; } }

/* bubbles and hearts */
.room__bubble { position: absolute; z-index: 400; transform: translate(-50%, -100%) scale(0.6); padding: 6px 12px; border-radius: 14px; background: #FFFFFF; color: #4A1734; font: 800 0.82rem var(--font-body); white-space: normal; width: max-content; max-width: 230px; text-align: center; box-shadow: 0 6px 14px -6px rgba(74, 23, 52, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.room__bubble.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.room__heart { position: absolute; z-index: 401; pointer-events: none; color: var(--rose); font-size: 1.1rem; }
.room__status { min-height: 1em; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.room__hint { font-family: var(--font-hand); font-size: 1.05rem; color: var(--muted); text-align: center; }

/* ---------- looking after them: cooking + bath time ---------- */
.house__food { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: 50% 80%; transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.house__food.is-full { opacity: 1; transform: scale(1); }
.house__steam { opacity: 0; transition: opacity 0.4s; }
.house__steam path { animation: room-steam 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.house__world.is-cooking .house__steam { opacity: 0.9; }
@keyframes room-steam { 0% { transform: translateY(4px) scaleY(0.7); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-8px) scaleY(1.1); opacity: 0; } }
.house__suds { opacity: 0; transition: opacity 0.6s; }
.house__world.is-bathing .house__suds { opacity: 1; }
.room__fly { position: absolute; z-index: 402; margin: -0.7em 0 0 -0.6em; font-size: 1.3rem; pointer-events: none; }
.room__puff { position: absolute; z-index: 401; pointer-events: none; color: #FFFFFF; font-size: 1rem; font-weight: 800; text-shadow: 0 0 3px rgba(80, 160, 220, 0.8); }

/* the need above a kitty's head */
.cat__need { position: absolute; left: 50%; top: -30%; transform: translateX(-50%); font-size: calc(var(--cat-w, 60px) * 0.28); pointer-events: none; animation: cat-need 2s ease-in-out infinite; }
.cat__need:empty, .cat.is-sleep .cat__need, .cat.is-eat .cat__need, .cat.is-bath .cat__need { display: none; }
@keyframes cat-need { 50% { transform: translate(-50%, -4px); } }
/* eating: head down in the bowl */
.cat.is-eat .cat__head { animation: cat-eat 0.5s ease-in-out infinite; }
@keyframes cat-eat { 0%, 100% { transform: rotate(18deg) translateY(5px); } 50% { transform: rotate(24deg) translateY(8px); } }
.cat.is-eat .cat__tail { animation-duration: 0.9s; }
/* in the tub: only the top half shows above the water */
.cat.is-bath .cat__inner { clip-path: inset(0 0 46% 0); }
.cat.is-bath .cat__svg { animation: cat-bob 1.2s ease-in-out infinite; }
.cat.is-shake .cat__svg { animation: cat-shake 0.12s linear 6; }
@keyframes cat-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }

/* what they need, under the house */
.room__needs { display: flex; flex-wrap: nowrap; justify-content: center; gap: 6px; padding: 0 12px; max-width: 100%; }
.room { padding-bottom: 12px; }
.room__need { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 12px; border: 2px solid transparent; border-radius: 999px; background: rgba(255, 255, 255, 0.85); font: 800 0.76rem var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.room__need--hawwi { color: var(--rose); }
.room__need--za { color: #2F7BD9; }
.room__need.is-needy.room__need--hawwi { border-color: #FFB3CF; }
.room__need.is-needy.room__need--za { border-color: #A9D2FF; }

/* the cook / bath card */
.room__sheet { display: grid; gap: 10px; width: min(100% - 24px, 420px); padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 12px 28px -16px rgba(190, 24, 93, 0.6); }
.room__sheet[hidden] { display: none; }
.room__sheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 1.05rem; color: #4A1734; }
.room__sheet-x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #FFE3EE; color: var(--rose); font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer; }
.room__sheet-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--font-hand); font-size: 1.1rem; color: var(--muted); }
.room__who { min-height: 34px; font-size: 0.8rem; }
.room__who--za[aria-pressed="true"] { background: #4A90E2; border-color: #4A90E2; color: #FFFFFF; }
.room__dishes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room__dish { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 2px solid #FFE3EE; border-radius: 16px; background: #FFF8FB; font: 800 0.74rem var(--font-body); color: #4A1734; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.room__dish:active { transform: scale(0.95); }
.room__dish-emoji { font-size: 1.6rem; }
.room__go { justify-self: center; }
.house__scroller { scroll-margin-top: 72px; }
.room__sheet { scroll-margin-bottom: 110px; }
.cat.is-bath .cat__tag { opacity: 0; }

/* ---------- the overview (whole house) vs zoomed into one room ---------- */
.room.is-overview .house__scroller { cursor: zoom-in; }
.room.is-overview .house__svg, .room.is-overview .cat { pointer-events: none; }
.room.is-overview .room__bubble { opacity: 0; }
.house__hint, .house__labels, .house__home { position: absolute; z-index: 5; transition: opacity 0.35s; }
.house__hint { left: 0; right: 0; margin: 0; text-align: center; font-family: var(--font-hand); font-size: 1.15rem; color: var(--muted); pointer-events: none; }
.house__labels { left: 0; right: 0; height: 22px; pointer-events: none; }
.house__label { position: absolute; top: 0; transform: translateX(-50%); padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); font: 800 0.66rem var(--font-body); color: #B2507A; white-space: nowrap; }
.house__home { top: 8px; left: 8px; padding: 6px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--rose); font: 800 0.78rem var(--font-body); box-shadow: 0 4px 12px -6px rgba(74, 23, 52, 0.5); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.room.is-overview .house__home, .room:not(.is-overview) .house__hint, .room:not(.is-overview) .house__labels { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .house__world, .house__scroller { transition: none; } }
.room.is-overview .house__nav { display: none; }

/* the house's own little scene, so it doesn't melt into the pink page */
.house__scroller {
  --sky-a: #BFE6FF; --sky-b: #EAF6FF;
  width: calc(100% - 16px); border: 3px solid #FFFFFF; border-radius: 26px;
  background: linear-gradient(180deg, var(--sky-a), var(--sky-b) 70%);
  box-shadow: 0 14px 30px -18px rgba(74, 23, 52, 0.55), inset 0 0 0 1px rgba(178, 80, 122, 0.12);
}
.house__scroller.is-evening { --sky-a: #2B2A5E; --sky-b: #8A6BB0; }
.house__scroller.is-evening .house__hint { color: #FFFFFF; }
.house__lawn { fill: #CDEFC9; }
.house__horizon { fill: #B4E2AE; }
.house__bush { fill: #A6DDA0; }
.house__lawn, .house__horizon, .house__bush { transition: fill 0.9s ease; }
/* at night the garden goes dark too, so it doesn't glow under a dark house */
.house__scroller.is-evening .house__lawn { fill: #3E5A4C; }
.house__scroller.is-evening .house__horizon, .house__scroller.is-evening .house__bush { fill: #344D41; }
.house__home { top: 10px; left: 10px; }

/* ---------- Pochita on the balcony (js/room.js pochitaSvg) ---------- */
.cat--pochita { width: calc(var(--cat-w, 60px) * var(--ps, 0.7)); margin-left: calc(var(--cat-w, 60px) * var(--ps, 0.7) / -2); margin-top: calc(var(--cat-w, 60px) * var(--ps, 0.7) * -0.8); }
.cat--pochita .cat__tag { color: #D9761F; }
.cat--pochita.is-sleep .cat__awake { display: inline; }        /* one drawing; only the face and tail change */
/* faces: normal unless happy / sad / asleep (asleep wins, then happy, then sad) */
.pochita__face { display: none; }
.cat--pochita .pochita__face--normal { display: inline; }
.cat--pochita.is-sad .pochita__face--normal { display: none; }
.cat--pochita.is-sad .pochita__face--sad { display: inline; }
.cat--pochita.is-happy .pochita__face--normal, .cat--pochita.is-happy .pochita__face--sad { display: none; }
.cat--pochita.is-happy .pochita__face--happy { display: inline; }
.cat--pochita.is-sleep .pochita__face { display: none; }
.cat--pochita.is-sleep .pochita__face--sleep { display: inline; }
/* the tail pivots where it joins his back */
.pochita__tail { transform-box: view-box; transform-origin: 11px 29px; transition: transform 0.6s ease; animation: pochita-wag 1.4s ease-in-out infinite; }
@keyframes pochita-wag { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
.cat--pochita.is-walk .pochita__tail { animation-duration: 0.6s; }
.cat--pochita.is-happy .pochita__tail { animation: pochita-wag-fast 0.22s ease-in-out infinite; }
@keyframes pochita-wag-fast { 0%, 100% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } }
.cat--pochita.is-sad .pochita__tail { animation: none; transform: rotate(-150deg); }          /* hanging down, limp */
.cat--pochita.is-sleep .pochita__tail { animation: none; transform: rotate(-125deg); }        /* lying behind him */
.cat--pochita.is-sad.is-happy .pochita__tail { animation: pochita-wag-fast 0.22s ease-in-out infinite; }   /* a pet cheers him up */
/* body: hops when moving, bounces when happy, sags when sad, breathes when asleep */
.cat--pochita.is-walk .cat__svg { animation: pochita-hop 0.42s ease-in-out infinite; }
.cat--pochita.is-happy .cat__svg { animation: pochita-hop 0.3s ease-in-out 4; }
@keyframes pochita-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-5px) scale(0.96, 1.04); } 80% { transform: translateY(0) scale(1.05, 0.95); } }
.cat--pochita.is-sad:not(.is-happy):not(.is-walk) .cat__svg { transform: scale(1.03, 0.94); transform-origin: 50% 100%; }
.cat--pochita.is-sleep .cat__svg { animation: cat-breathe 3s ease-in-out infinite; transform-origin: 50% 100%; }
.cat--pochita .cat__eyes { animation: none; }
@media (prefers-reduced-motion: reduce) { .pochita__tail, .cat--pochita .cat__svg { animation: none !important; } }
.house__dogfood { opacity: 0; transition: opacity 0.3s; }
.house__dogfood.is-full { opacity: 1; }
.cat--pochita.is-sad.is-happy .pochita__mouth { display: inline; }
.cat--pochita.is-sad.is-happy .pochita__frown { display: none; }
