/* room.css — the home screen is her room (room.js).
   Everything inside the scene is sized in "scene units": --su = pixels per unit of the 1200×900 picture. */
.room {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #f8cbe0;
  --su: calc(min(100vw, calc(var(--vh) * 4 / 3)) / 1200); /* room.js sets the exact value */
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.room::after { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(74, 31, 102, 0) 60%, rgba(74, 31, 102, .17) 100%); }
.room-scene { position: absolute; left: 50%; top: 50%; width: calc(var(--su) * 1200); height: calc(var(--su) * 900); margin: calc(var(--su) * -450) 0 0 calc(var(--su) * -600); }
.room-tall .room-scene { top: 57%; }
.room-art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }

/* every hand-drawn icon (icons.js) follows the font-size around it */
.du-ico { display: inline-block; width: 1em; height: 1em; vertical-align: -.16em; flex: none; overflow: visible; }

/* ---------- things you can tap ---------- */
.room-hot { position: absolute; display: block; border-radius: calc(var(--su) * 26); z-index: 1; }
.room-hot:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.room-tag {
  position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); white-space: nowrap; direction: rtl; pointer-events: none;
  display: inline-flex; align-items: center; line-height: 1; font-weight: 600; font-size: max(15px, calc(var(--su) * 26));
  padding: .42em .8em .46em; border-radius: 999px; background: #fff; color: #7a3c8f; border: max(2px, calc(var(--su) * 3)) solid #ffb3d3;
  box-shadow: 0 max(2px, calc(var(--su) * 4)) 0 rgba(90, 45, 110, .2);
  animation: room-pulse 2.6s ease-in-out infinite alternate;
}
.room-tag.mint { border-color: #8fdcc6; }
.room-tag.gold { border-color: #ffcf5a; color: #8a5a12; animation-duration: 1.1s; }
.room-tag.lilac { border-color: #c9b3ff; }
.room-tag.big { font-size: max(20px, calc(var(--su) * 36)); font-weight: 700; background: var(--pink); color: #fff; border-color: #fff; padding: .4em .85em .44em; box-shadow: 0 max(3px, calc(var(--su) * 5)) 0 var(--pink-d), 0 calc(var(--su) * 12) calc(var(--su) * 20) rgba(224, 69, 127, .3); }
.room-tag.purple { font-size: max(17px, calc(var(--su) * 30)); font-weight: 700; background: var(--purple); color: #fff; border-color: #fff; box-shadow: 0 max(3px, calc(var(--su) * 5)) 0 var(--purple-d); }
.room-tag > .du-ico { margin-inline-end: .3em; }
.room-tag small { font-size: .68em; font-weight: 600; background: #f1e8ff; color: #6a4fd0; border-radius: 999px; padding: .22em .55em; margin-right: .5em; margin-left: -.3em; }
.room-hot:active .room-tag { animation: none; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(.93); }
.room-gallery .room-tag { animation-delay: -.6s; }
.room-shop .room-tag { animation-delay: -1.2s; }
.room-album .room-tag { animation-delay: -1.8s; }
@keyframes room-pulse { from { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); } to { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.07); } }

.room-pointswrap { position: absolute; transform: translate(-50%, -50%) rotate(6deg); z-index: 2; pointer-events: none; }
.room .room-points { height: auto; padding: .28em .7em .3em; gap: 0; font-size: max(17px, calc(var(--su) * 27)); font-weight: 700; border: max(2px, calc(var(--su) * 3)) solid #ffcf5a; box-shadow: 0 max(2px, calc(var(--su) * 4)) 0 rgba(90, 45, 110, .2); background: #fff; color: #8a5a12; }

.room .room-points .du-ico { font-size: 1.25em; margin-right: .22em; }
.room-girl { position: absolute; pointer-events: none; z-index: 1; transform-origin: 50% 91%; animation: room-breath 3.2s ease-in-out infinite alternate; }
.room-girl svg { display: block; width: 100%; height: 100%; overflow: visible; }
.room-girlbtn { z-index: 2; }
.room-gift { z-index: 2; }

/* ---------- the name of the game ---------- */
.room-title { position: absolute; left: 50%; top: calc(50% - var(--su) * 446); width: calc(var(--su) * 404); margin-left: calc(var(--su) * -202); display: flex; align-items: center; direction: rtl; pointer-events: none; z-index: 3; }
.room-tall .room-title { top: calc(57% - var(--su) * 640); width: calc(var(--su) * 800); margin-left: calc(var(--su) * -400); }
.room-title-art { flex: 1; min-width: 0; height: auto; display: block; overflow: visible; }
.room-pencil { pointer-events: auto; flex: none; width: max(44px, calc(var(--su) * 50)); height: max(44px, calc(var(--su) * 50)); margin-inline-start: calc(var(--su) * -14); border-radius: 50%; background: #fff; font-size: max(22px, calc(var(--su) * 27)); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #dccbee, 0 6px 12px rgba(120, 90, 160, .16); }
.room-pencil:active { transform: translateY(2px); box-shadow: 0 1px 0 #dccbee; }
.room-pencil:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.room-mute { position: absolute; top: 12px; right: 12px; z-index: 4; }

/* ---------- the surprise ---------- */
.room-plus { position: absolute; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; white-space: nowrap; display: inline-flex; align-items: center; direction: ltr; font-weight: 700; font-size: max(26px, calc(var(--su) * 58)); line-height: 1; color: #8a5a12; background: #fffbe8; border: max(3px, calc(var(--su) * 4)) solid #ffcf5a; border-radius: 999px; padding: .18em .5em .2em; box-shadow: 0 calc(var(--su) * 6) 0 rgba(90, 45, 110, .2); }
.room-plus .du-ico { margin-left: .18em; }
.room-fly { position: absolute; z-index: 6; pointer-events: none; line-height: 0; font-size: max(20px, calc(var(--su) * 42)); transform: translate(-50%, -50%); }
.room-gift-open .room-gift .room-tag { opacity: 0; transition: opacity .2s; }

/* ---------- life inside the picture ---------- */
.room-jstar { animation: room-tw 2.8s ease-in-out infinite; }
.room-glow { animation: room-tw 3.6s ease-in-out infinite; }
.room-bglow { animation: room-bg 3s ease-in-out infinite; }
.room-mote { animation: room-mote 7s linear infinite; opacity: .75; }
.room-cloud { animation: room-cloud 26s linear infinite alternate; }
.room-curtain { transform-box: fill-box; transform-origin: 50% 0%; animation: room-sway 5.5s ease-in-out infinite alternate; }
.room-c2 { animation-delay: -2.4s; }
.room-cat { transform-box: fill-box; transform-origin: 50% 100%; animation: room-breathe 3.4s ease-in-out infinite alternate; }
.room-plant { transform-box: fill-box; transform-origin: 50% 100%; animation: room-plant 6s ease-in-out infinite alternate; }
.room-spark { transform-box: fill-box; transform-origin: center; animation: room-spark 2.6s ease-in-out infinite; }
.room-frame { transform-box: fill-box; transform-origin: 50% 0%; }
.room-wig .room-frame { animation: room-wig .7s ease-in-out; }
.room-jar { transform-box: fill-box; transform-origin: 50% 100%; }
.room-jig .room-jar { animation: room-jig .6s ease-in-out; }
.room-book { transform-box: fill-box; transform-origin: 50% 100%; }
.room-bookhop .room-book { animation: room-hop .6s cubic-bezier(.3, 1.4, .6, 1); }
.room-dl, .room-dr { transform-box: fill-box; transform-origin: 0% 50%; transition: transform .6s cubic-bezier(.34, 1.3, .64, 1); }
.room-dl { transform: skewY(-2deg) scaleX(.74); }
.room-dr { transform: skewY(-1.5deg) scaleX(.8); }
.room-open .room-dl, .room-open .room-dr { transform: skewY(-7deg) scaleX(-.4); }
.room-present { transform-box: fill-box; transform-origin: 50% 100%; animation: room-wobble 2.8s ease-in-out infinite; }
.room-lid { transform-box: fill-box; transform-origin: center; transition: transform .5s cubic-bezier(.34, 1.6, .64, 1), opacity .3s .7s; }
.room-rays { transform-box: fill-box; transform-origin: center; opacity: 0; transition: opacity .35s; }
.room-gift-open .room-present { animation: room-boxpop .45s cubic-bezier(.34, 1.8, .64, 1); }
.room-gift-open .room-lid { transform: translate(-90px, -70px) rotate(-64deg); opacity: 0; }
.room-gift-open .room-rays { opacity: 1; animation: room-spin 9s linear infinite; }
.room-gift-open .room-giftart { transition: opacity .35s 1.25s; opacity: 0; }
@keyframes room-breath { from { transform: scale(1, 1); } to { transform: scale(1.004, 1.013); } }
@keyframes room-tw { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
@keyframes room-bg { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes room-mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .8; } 85% { opacity: .8; } 100% { transform: translate(46px, -90px); opacity: 0; } }
@keyframes room-cloud { from { transform: translateX(-20px); } to { transform: translateX(150px); } }
@keyframes room-sway { from { transform: skewX(-.8deg); } to { transform: skewX(1.2deg); } }
@keyframes room-breathe { from { transform: scale(1, 1); } to { transform: scale(1.015, 1.06); } }
@keyframes room-plant { from { transform: rotate(-1.2deg); } to { transform: rotate(1.4deg); } }
@keyframes room-spark { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(.35); opacity: .25; } }
@keyframes room-wig { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(5deg); } 60% { transform: rotate(-4deg); } 85% { transform: rotate(1.5deg); } }
@keyframes room-jig { 0%, 100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-7deg) translateY(-6px); } 65% { transform: rotate(6deg) translateY(-2px); } }
@keyframes room-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 35% { transform: translateY(-14px) scale(.97, 1.04); } 70% { transform: translateY(0) scale(1.04, .96); } }
@keyframes room-wobble { 0%, 62%, 100% { transform: rotate(0) scale(1, 1); } 68% { transform: rotate(-4deg) scale(1.03, .97); } 76% { transform: rotate(4deg) scale(.98, 1.03); } 84% { transform: rotate(-2deg); } 92% { transform: rotate(1deg); } }
@keyframes room-boxpop { 0% { transform: scale(1, 1); } 40% { transform: scale(1.1, .88); } 100% { transform: scale(1, 1); } }
@keyframes room-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .room *, .room *::before, .room *::after { animation: none !important; transition: none !important; }
}
