/* The original scenery and character art stay untouched beneath this layer. */
.room-life-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.room-life-layer[hidden] { display: none; }
.room-life-plane {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.room-life-plane > i { position: absolute; display: block; pointer-events: none; }
.room-life-light {
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 239, 193, .2), rgba(255, 238, 202, .06) 48%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: roomLightBreathe 17s ease-in-out infinite;
}
.room-life-shade {
  left: 29%;
  top: 52%;
  width: 44%;
  height: 22%;
  opacity: .35;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 23% 38%, rgba(61, 70, 32, .09), transparent 25%),
    radial-gradient(ellipse at 49% 56%, rgba(61, 70, 32, .08), transparent 24%),
    radial-gradient(ellipse at 74% 36%, rgba(61, 70, 32, .07), transparent 23%);
  animation: roomShadeSway 21s ease-in-out infinite;
}
.room-life-mote {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 248, 218, .86);
  opacity: 0;
  animation: roomMoteDrift var(--mote-duration) var(--mote-delay) ease-in-out infinite;
}
.room-life-mote:nth-of-type(2n) { width: 2px; height: 2px; }
.room-life-layer[data-indoors="false"] .room-life-mote {
  width: 5px;
  height: 2px;
  border-radius: 70% 30% 65% 35%;
  background: rgba(255, 248, 215, .8);
}
.room-life-layer[data-indoors="false"] .room-life-shade { opacity: .55; }
.room-life-layer[data-slot="evening"] .room-life-light { opacity: .45; }
.room-life-layer[data-slot="night"] .room-life-light,
.room-life-layer[data-slot="night"] .room-life-shade { display: none; }
.room-life-layer[data-slot="night"] .room-life-mote {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(249, 246, 199, .82);
  box-shadow: 0 0 5px 1px rgba(232, 239, 160, .13);
  animation-name: roomFireflyDrift;
}
.room-life-layer[data-slot="night"][data-indoors="true"] .room-life-mote {
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 232, .75);
  box-shadow: none;
  animation-name: roomWindowTwinkle;
}
.room-life-layer[data-phase="late-night"] { opacity: .65; }
.room-life-layer[data-running="false"] .room-life-plane > i { animation-play-state: paused; }
.room-life-layer[data-pause-reason="entry-pending"],
.room-life-layer[data-pause-reason="item-scene"] { visibility: hidden; }

@keyframes roomLightBreathe {
  0%, 100% { opacity: .36; transform: translate(-50%, -50%) scale(.98); }
  52% { opacity: .72; transform: translate(-49%, -50%) scale(1.02); }
}
@keyframes roomShadeSway {
  0%, 100% { transform: translateX(-5px) rotate(-1deg); }
  48% { transform: translateX(7px) rotate(1deg); }
}
@keyframes roomMoteDrift {
  0%, 100% { opacity: 0; transform: translate(0, 8px); }
  20% { opacity: .24; }
  58% { opacity: .52; }
  88% { opacity: 0; transform: translate(var(--mote-drift), var(--mote-lift)); }
}
@keyframes roomFireflyDrift {
  0%, 100% { opacity: .08; transform: translate(0, 0); }
  38% { opacity: .62; transform: translate(8px, -9px); }
  69% { opacity: .15; transform: translate(-4px, -3px); }
}
@keyframes roomWindowTwinkle {
  0%, 100% { opacity: .1; }
  46% { opacity: .65; }
  72% { opacity: .26; }
}

.room.has-room-life > .room-select {
  min-width: min(275px, calc(100% - 80px));
  max-width: calc(100% - 80px);
}
.room-life-toggle {
  position: absolute;
  z-index: 5;
  top: 24px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(126, 95, 60, .2);
  border-radius: 50%;
  background: rgba(255, 253, 246, .8);
  color: #66764f;
  box-shadow: 0 3px 9px rgba(74, 55, 36, .08);
  cursor: pointer;
}
.room-life-toggle:hover { background: rgba(255, 253, 246, .96); }
.room-life-toggle:focus-visible { outline: 3px solid #728c62; outline-offset: 3px; }
.room-life-toggle:disabled { opacity: .45; cursor: default; }
.room-life-toggle-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 75% 10% 75% 10%;
  transform: rotate(-26deg);
}
.room-life-toggle-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 18px;
  height: 1px;
  background: currentColor;
  transform: rotate(-24deg);
  transform-origin: left center;
}
.room-life-toggle[aria-pressed="false"],
.room-life-toggle[data-reduced="true"] { color: #827b70; }
.room-life-toggle[aria-pressed="false"]::after,
.room-life-toggle[data-reduced="true"]::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 1px;
  background: currentColor;
  transform: rotate(-44deg);
}
.room-life-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .room-life-layer { display: none !important; }
  .room-life-plane > i { animation: none !important; }
}
