/* ---------- Комната — главный экран (скилл felt-design, прототип proto/Main.html и proto/Tablet.html) ----------
   Сцена нарисована в своих пикселях: телефон 390×844, планшет лёжа 1280×800 (класс .wide).
   room.js масштабирует её целиком под экран, поэтому внутри — px, как в прототипе. */

#start.room { display: block; padding: 0; overflow: hidden; touch-action: manipulation;
  background: linear-gradient(to bottom, var(--f-wall) 0 var(--horizon, 59%), var(--f-lav) var(--horizon, 59%) calc(var(--horizon, 59%) + 1.6vh), var(--f-wood) calc(var(--horizon, 59%) + 1.6vh)); }
html[data-daypart="night"] #start.room { background: linear-gradient(to bottom, var(--f-night) 0 var(--horizon, 59%), var(--f-lav) var(--horizon, 59%) calc(var(--horizon, 59%) + 1.6vh), #8A6040 calc(var(--horizon, 59%) + 1.6vh)); }

.room-scene { position: absolute; left: 0; top: 0; width: 390px; height: 844px; transform-origin: 0 0; --u: 3.9px; }
.room-scene.wide { width: 1280px; height: 800px; --u: 4.6px; }

.ro-wall { position: absolute; left: 0; top: 0; width: 100%; height: 498px; }
.ro-skirt { position: absolute; left: 0; top: 498px; width: 100%; height: 14px; background: var(--f-lav); box-shadow: 0 4px 0 rgba(61,37,82,.2); }
.ro-floor { position: absolute; left: 0; top: 512px; width: 100%; bottom: 0; }
.ro-rug { position: absolute; left: 0; top: 548px; width: 390px; height: 230px; }
.wide .ro-wall { height: 486px; } .wide .ro-skirt { top: 486px; height: 16px; } .wide .ro-floor { top: 502px; }
.wide .ro-rug { left: 260px; top: 520px; width: 760px; height: 260px; }
html[data-daypart="night"] .ro-floor, html[data-daypart="night"] .ro-rug { filter: brightness(.72) saturate(.9); }

/* предметы */
.ro { position: absolute; border: 0; padding: 0; background: none; cursor: pointer; display: block; -webkit-tap-highlight-color: transparent; }
.ro > svg { display: block; width: 100%; height: auto; transition: translate .12s; }
.ro:not(.f-tap) > svg { filter: drop-shadow(0 4px 0 rgba(61,37,82,.22)); }
.ro:active > svg { translate: 0 3px; }
.ro.armed > svg, .ro.armed.f-doll, .ro.armed .f-doll { filter: drop-shadow(0 0 7px #FFD65A) drop-shadow(0 0 3px #FFD65A) drop-shadow(0 4px 0 rgba(61,37,82,.22)); }
.ro.tap-pop > svg, .ro.tap-pop.f-doll, .ro.tap-pop .f-doll { animation: f-wob .6s var(--f-spring); }
html.lite .ro:not(.f-tap) > svg { filter: none; }

.ro-window { left: 95px; top: 30px; width: 200px; }
.ro-lock { left: 14px; top: 16px; width: 46px; }
.ro-full { left: 68px; top: 18px; width: 42px; height: 42px; border-radius: 50%; background: var(--f-cream); box-shadow: var(--f-drop); display: grid; place-items: center; }
.ro-full svg { width: 55%; height: 55%; filter: none; }
.ro-jar { left: 312px; top: 10px; width: 66px; }
.ro-jar .star-count { position: absolute; left: 50%; bottom: -10px; translate: -50% 0; min-width: 34px; padding: 3px 8px 4px; border-radius: 99px; background: var(--f-cream); box-shadow: var(--f-drop);
  font: 900 15px/1 var(--f-text); color: var(--f-ink); text-align: center; pointer-events: none; }
.ro-shelf { left: 10px; top: 112px; width: 96px; }
.ro-globe { left: 106px; top: 216px; width: 66px; }
.ro-wardrobe { left: 10px; top: 262px; width: 92px; }
.ro-easel { left: 286px; top: 108px; width: 96px; }
.ro-cal { left: 316px; top: 352px; width: 66px; }
.ro-vlada { left: 92px; top: 330px; width: 118px; height: 118px; }
.ro-vlada .f-doll { width: 100%; height: 100%; }
.ro-vlada .f-doll svg { width: 100%; height: 100%; display: block; }
.ro-pasha { left: 180px; top: 318px; width: 128px; height: 128px; }
#roomPasha .face { width: 100%; height: 100%; border: 0; font-size: 80px; }
.ro-chest { left: 92px; top: 536px; width: 206px; border-radius: 40px; }
.ro-gift { left: 304px; top: 586px; width: 56px; display: none; }
.ro-gift.ready { display: block; animation: roGift 2.4s ease-in-out infinite; }
@keyframes roGift { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -9deg; } 90% { rotate: 8deg; } 95% { rotate: -5deg; } }
.ro-box { left: 8px; top: 712px; width: 82px; }
.ro-mirror { left: 106px; top: 690px; width: 78px; }
.ro-cats { left: 196px; top: 712px; width: 100px; }
.ro-cats img { position: absolute; border-radius: 50%; pointer-events: none; }
.ro-cats .c1 { left: 4%; top: 4%; width: 52%; } .ro-cats .c2 { left: 44%; top: 12%; width: 50%; }
.ro-phone { left: 302px; top: 704px; width: 82px; }

/* планшет лёжа: та же комната, шире */
.wide .ro-window { left: 490px; top: 26px; width: 300px; }
.wide .ro-lock { left: 22px; top: 20px; width: 52px; }
.wide .ro-full { left: 86px; top: 24px; width: 46px; height: 46px; }
.wide .ro-jar { left: 1190px; top: 14px; width: 70px; }
.wide .ro-shelf { left: 70px; top: 118px; width: 140px; }
.wide .ro-globe { left: 110px; top: 320px; width: 100px; }
.wide .ro-wardrobe { left: 270px; top: 186px; width: 130px; }
.wide .ro-easel { left: 880px; top: 120px; width: 130px; }
.wide .ro-cal { left: 1090px; top: 150px; width: 100px; }
.wide .ro-vlada { left: 418px; top: 360px; width: 150px; height: 150px; }
.wide .ro-pasha { left: 698px; top: 346px; width: 164px; height: 164px; }
.wide .ro-chest { left: 512px; top: 470px; width: 256px; }
.wide .ro-gift { left: 800px; top: 600px; width: 72px; }
.wide .ro-box { left: 60px; top: 600px; width: 110px; }
.wide .ro-mirror { left: 240px; top: 600px; width: 96px; }
.wide .ro-cats { left: 930px; top: 640px; width: 130px; }
.wide .ro-phone { left: 1110px; top: 604px; width: 110px; }

/* окно: день / ночь / погода */
.ro-window .sky1 { stop-color: #7EC8FF; } .ro-window .sky2 { stop-color: #E2F5FF; }
html[data-daypart="evening"] .ro-window .sky1 { stop-color: #FF9A76; } html[data-daypart="evening"] .ro-window .sky2 { stop-color: #FFD29A; }
html[data-daypart="night"] .ro-window .sky1 { stop-color: #1F2160; } html[data-daypart="night"] .ro-window .sky2 { stop-color: #4A3F9A; }
.ro-window .w-moon, .ro-window .w-rain, .ro-window .w-snow { display: none; }
html[data-daypart="night"] .ro-window .w-sun { display: none; } html[data-daypart="night"] .ro-window .w-moon { display: inline; }
html[data-daypart="night"] .ro-window .w-hill { fill: #2F5A4A; } html[data-daypart="night"] .ro-window .w-cloud { opacity: .25; }
.room-scene.rain .ro-window .w-rain, .room-scene.snow .ro-window .w-snow { display: inline; }
.room-scene.rain .ro-window .w-sun, .room-scene.snow .ro-window .w-sun { display: none; }
.room-scene.rain .ro-window .w-cloud { fill: #C9D3E6; }
.room-scene.snow .ro-window .w-hill { fill: #F2F7FF; }
.room-scene.rain .ro-window .w-rain path { animation: roRain .7s linear infinite; }
@keyframes roRain { to { translate: -3px 10px; opacity: .3; } }

/* пузырь «говорит» */
.ro-bubble { position: absolute; left: 196px; top: 248px; width: 92px; height: 56px; min-width: 0; min-height: 0; padding: 0; z-index: 30; pointer-events: none;
  opacity: 0; scale: .5; transition: opacity .18s, scale .25s var(--f-spring), left .25s var(--f-ease), top .25s var(--f-ease); }
.ro-bubble.show { opacity: 1; scale: 1; }
.ro-bubble i { width: 6px; } .ro-bubble i:nth-child(1) { height: 12px; } .ro-bubble i:nth-child(2) { height: 24px; } .ro-bubble i:nth-child(3) { height: 18px; } .ro-bubble i:nth-child(4) { height: 10px; }
#roomHand { width: 58px; left: 262px; top: 630px; }
.wide #roomHand { left: 720px; top: 590px; }

#start .install-tip { z-index: 40; }

/* ---------- Комнатка-выбор (коробка, телефон, календарь) ---------- */
#hub { justify-content: center; gap: calc(6 * var(--u)); }
#hub .hub-home { position: absolute; left: calc(env(safe-area-inset-left) + 4 * var(--u)); top: calc(env(safe-area-inset-top) + 4 * var(--u)); }
.hub-pic { width: calc(34 * var(--u)); }
.hub-pic svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 calc(1 * var(--u)) 0 rgba(61,37,82,.22)); }
.hub-items { display: grid; grid-template-columns: repeat(2, calc(40 * var(--u))); gap: calc(5 * var(--u)); }
.hub-items.n2 { grid-template-columns: repeat(2, calc(42 * var(--u))); }
.hub-item { width: 100%; aspect-ratio: 1; }
.hub-item svg { width: 82%; height: 82%; position: relative; z-index: 1; }
.hub-item.armed { box-shadow: 0 0 0 calc(1.2 * var(--u)) #FFD65A, var(--f-drop-lg); }
.hub-item.tap-pop svg { animation: f-wob .6s var(--f-spring); }
@media (orientation: landscape) and (min-width: 700px) {
  #hub { flex-direction: row; gap: calc(10 * var(--u)); }
  .hub-pic { width: calc(40 * var(--u)); }
  .hub-items, .hub-items.n2 { grid-template-columns: repeat(2, calc(42 * var(--u))); }
}

/* старые правила #startBtn (сетка меню) сюда не относятся */
#start.room #startBtn { height: auto; font-size: inherit; grid-area: auto; translate: none; }
#start.room .wide #startBtn { width: 256px; }
#start.room .room-scene:not(.wide) #startBtn { width: 206px; }

/* бант подарка дня на сундуке — только когда подарок ждёт */
.ro-chest .chest-bow { display: none; }
#startBtn.ready .chest-bow { display: inline; scale: 1.5; animation: roGift 2.4s ease-in-out infinite; transform-origin: 103px 36px; }
