/* Zakzak's house (js/house.js): the salon, two screens wide, dragged by a finger (native scroll). */
.zh {
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  direction: ltr;
  background: #f6e3c4;
}
.zh::-webkit-scrollbar { display: none; }
.zh[hidden] { display: none; }
.zh.zh-in { animation: zh-in .35s ease-out; }
@keyframes zh-in { from { opacity: 0; transform: scale(1.04); } }
.zh-track { position: relative; width: max(200vw, 360vmin); height: 100%; direction: ltr; }
.zh-wall { position: absolute; inset: 0 0 22vh; background: repeating-linear-gradient(90deg, #ffe7b8 0 6vmin, #ffdfa6 6vmin 12vmin); }
.zh-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; background: linear-gradient(#c98a4b, #a86a33); border-top: 1.2vmin solid #8a5426; }
.zh-rug { position: absolute; left: 34%; width: 30%; bottom: 4vh; height: 10vh; border-radius: 50%; background: #e46a6a; box-shadow: inset 0 0 0 1.4vmin #f39b9b; }
.zh.is-dim .zh-wall, .zh.is-dim .zh-floor { filter: brightness(.55); }

.zh-item { position: absolute; transform: translateX(-50%); padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 100%; }
.zh-item svg { display: block; width: 100%; height: auto; overflow: visible; }
.zh-f1 { fill: #e8eef5; } .zh-f2 { fill: #d5dde8; } .zh-f3 { fill: #c6d0dd; }
.zh-sofa .zh-f1 { fill: #3a8ee6; } .zh-sofa .zh-f2 { fill: #2f74c0; } .zh-sofa .zh-f3 { fill: #5aa5f0; }
.zh-fridge .zh-door { fill: #e8eef5; transform-origin: 6px 0; transition: transform .2s; }
.zh-tv .zh-f1 { fill: #333; } .zh-screen { fill: #22303c; }
.zh-shelf .zh-f1, .zh-window .zh-f1, .zh-window .zh-f2 { fill: #a8652e; }
.zh-lamp .zh-f1 { fill: #f7a400; }
.zh-show { opacity: 0; transition: opacity .3s; }
.zh-inside, .zh-light { opacity: 0; transition: opacity .3s; }
.zh-lamp:not(.is-shadow):not(.is-off) .zh-light { opacity: 1; }
.zh-lamp.is-off .zh-bulb { fill: #999; }

/* 0 = a faint shadow of the thing */
.zh-item.is-shadow svg { filter: grayscale(1) brightness(.35); opacity: .16; }
.zh-item.is-shadow { outline: .6vmin dashed rgba(120, 80, 40, .35); outline-offset: .6vmin; border-radius: 2vmin; }
.zh-item.is-shadow .zh-light { opacity: 0; }
/* 1 = new, shines all day */
.zh-item.is-new::after { content: ''; position: absolute; inset: -12%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(rgba(255, 240, 150, .55), transparent 65%); animation: zh-shine 1.6s ease-in-out infinite; }
@keyframes zh-shine { 50% { opacity: .35; transform: scale(1.06); } }
/* Zakzak proposes this one */
.zh-item.is-proposed { animation: zh-call 1s ease-in-out infinite; }
.zh-item.is-proposed svg { opacity: .45; }
@keyframes zh-call { 50% { transform: translateX(-50%) scale(1.08); } }

.zh-wiggle { animation: zh-wiggle .45s; }
@keyframes zh-wiggle { 25% { transform: translateX(-50%) rotate(-5deg); } 75% { transform: translateX(-50%) rotate(5deg); } }
.zh-drop { animation: zh-drop .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes zh-drop { 0% { transform: translateX(-50%) translateY(-70vh); } 70% { transform: translateX(-50%) scaleY(.85); } }
.zh-use { animation: zh-use .6s; }
@keyframes zh-use { 30% { transform: translateX(-50%) scale(1.1, .9); } 60% { transform: translateX(-50%) scale(.95, 1.06); } }
.zh-fridge.zh-use .zh-door { transform: scaleX(.1); }
.zh-fridge.zh-use .zh-inside, .zh-fridge.is-new .zh-inside { opacity: 1; }
.zh-tv.zh-use .zh-show, .zh-tv.is-new .zh-show { opacity: 1; }
.zh-sofa.zh-use .zh-pillow { animation: zh-pillow .6s; }
@keyframes zh-pillow { 50% { transform: translateY(-40px) rotate(30deg); } }
.zh-shelf.zh-use .zh-letter { animation: zh-letter .6s; transform-origin: 128px 48px; }
@keyframes zh-letter { 50% { transform: scale(1.4); } }
.zh-window.zh-use .zh-bird { animation: zh-bird .9s; }
@keyframes zh-bird { 60% { transform: translate(40px, -50px); opacity: 0; } 61% { transform: none; opacity: 0; } }
.zh-toys.zh-open .zh-lid { animation: zh-lid .45s; transform-origin: 4px 54px; }
@keyframes zh-lid { 60% { transform: rotate(-40deg); } }
.zh-leaf { transform-origin: 12px 0; }
.zh-opening .zh-leaf { animation: zh-dooropen .5s forwards; }
@keyframes zh-dooropen { to { transform: scaleX(.12); } }

/* Zakzak's copy in the salon (looks from css/planet.css .pl-zak) */
.zh-zak { position: absolute; bottom: 6vh; left: 62%; width: clamp(90px, 22vmin, 150px); transform: translateX(-50%); z-index: 3; }
.zh-zak.is-walking .pl-zak-body { animation: walk-run .26s ease-in-out infinite; }
.zh-hop { animation: zh-hop .5s; }
@keyframes zh-hop { 40% { transform: translateY(-30px); } }
.zh-nap { animation: zh-nap 2s; }
@keyframes zh-nap { 20%, 80% { transform: rotate(-80deg) translateY(10px); } }

/* "ورّي ماما": the whole salon small, new things bounce, any tap closes */
.zh-mama { display: flex; align-items: center; justify-content: center; background: rgba(40, 30, 20, .7); }
.zh-mini { direction: ltr; width: 92vw; height: 46vh; background: #f6e3c4; overflow: hidden; border-radius: 3vmin; border: 1.4vmin solid #fff; position: relative; animation: zh-in .4s; }
.zh-mini .zh-track { position: absolute; left: 0; top: 0; width: 200vw; height: 100vh; transform: scale(.46); transform-origin: 0 0; pointer-events: none; }
.zh-bounce { animation: zh-call .7s ease-in-out infinite !important; }

/* Back to the salon from the old house (hidden in lessons and while Zakzak runs) */
.zh-home { position: absolute; left: 3vmin; bottom: 3vmin; width: clamp(54px, 13vmin, 78px); padding: 0; border: 0; background: none; z-index: 4; }
.zh-home svg { display: block; width: 100%; height: auto; }
body.zh-on .zh-home, .room:has(#home-btn:not([hidden])) .zh-home,
.room:is(.is-between, .is-running) .zh-home { display: none; }
/* Grown-ups' corner buttons stay above the salon */
body.zh-on :is(.parents-btn, .kid-btn, .music-btn) { z-index: 16; }

@media (prefers-reduced-motion: reduce) {
  .zh-item.is-new::after, .zh-item.is-proposed, .zh-bounce { animation: none !important; }
}

/* Phase 3: things that only react (ball, clock, light switch) */
.zh-roll .zh-spin { animation: zh-spin .7s ease-out; transform-origin: 30px 30px; }
.zh-rollback .zh-spin { animation: zh-spin .7s ease-out reverse; transform-origin: 30px 30px; }
@keyframes zh-spin { to { transform: rotate(360deg); } }
.zh-clock.zh-use .zh-hand { animation: zh-tick .6s steps(4); transform-origin: 40px 40px; }
@keyframes zh-tick { to { transform: rotate(540deg); } }
.zh-moon { opacity: 0; }
body.zd-night .zh-moon { opacity: 1; } body.zd-night .zh-sun { opacity: 0; }
.zh-switch .zh-knob { transition: transform .15s; }
.zh-switch.is-off .zh-knob { transform: translateY(18px); fill: #999; }
.zh.is-dim .zh-item:not(.zh-lamp) svg { filter: brightness(.6); }

/* Planet 4-5: price in pictured stars on empty spots (js/house.js prices/buy) */
.zh-price { position: absolute; left: 50%; bottom: -3.4vmin; translate: -50% 0; display: flex; gap: .3vmin; font-style: normal; pointer-events: none; white-space: nowrap; }
.zh-price i { font-style: normal; font-size: 3.2vmin; color: #cfc6b8; text-shadow: 0 1px 0 #0002; }
.zh-price i.is-lit { color: #ffc928; text-shadow: 0 2px 0 #e09b00; }
.zh-price.is-full { animation: zh-price 1.2s ease-in-out infinite; }
@keyframes zh-price { 50% { scale: 1.12; } }
.zh-coin { position: fixed; z-index: 60; translate: -50% -50%; font-size: 30px; color: #ffc928; text-shadow: 0 2px 0 #e09b00; pointer-events: none;
  transition: left .7s cubic-bezier(.4, 0, .3, 1), top .7s cubic-bezier(.5, -0.4, .6, 1); }
