.title-row {
  flex-wrap: wrap;
}
.sound-open,
.mirror-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid #d3c3ce;
  border-radius: 16px;
  background: #faf1f5;
  font-weight: 650;
}
.sound-open {
  margin-left: auto;
  padding: 5px 13px;
}
.sound-open svg,
.mirror-button svg {
  width: 30px;
  height: 30px;
}
.mirror-button {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  background: #f2e7f4;
}
.action-tray {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.action.bath {
  background: #d9eeeb;
  border-color: #b2ceca;
}
.action.garden {
  background: #edf0ce;
  border-color: #c2c9a7;
}
.scene.bathroom {
  background-image: url(world/bathroom.svg);
}
.bathroom .pet-target {
  width: 52%;
  left: 24%;
  height: 87%;
  bottom: 4%;
}
.bath-tray {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.bath-tray .action {
  flex-direction: row;
  gap: 10px;
  min-height: 65px;
}
.bath-tray .action svg {
  width: 38px;
  height: 38px;
}
#tub,
#egg-art,
#egg-art > svg,
#egg-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.nest-panel {
  text-align: center;
}
.nest-hand {
  width: 65px;
  height: 65px;
  padding: 9px;
  background: #f7e8d6;
  border: 1px solid #e6cbb5;
  border-radius: 22px;
  rotate: -6deg;
}
.nest-panel p {
  margin: 8px 0 12px;
}
.nest-panel .primary {
  margin-top: 15px;
}
.nest-panel .primary svg {
  width: 29px;
  height: 29px;
}
#egg-progress {
  display: flex;
  gap: 10px;
  justify-content: center;
}
#egg-progress i {
  width: 17px;
  height: 21px;
  border: 1.5px dashed #ac94a7;
  border-radius: 50% 50% 45% 45%;
  background: #f4ebed;
}
#egg-progress i.done {
  background: #f1d391;
  border: 2px solid #bc9757;
  box-shadow: inset 3px 2px 0 #fff0bb;
}
#egg-art[data-step='1'] #crack-1,
#egg-art[data-step='2'] #crack-1,
#egg-art[data-step='2'] #crack-2,
#egg-art[data-step='3'] [id^='crack-'],
#egg-art[data-step='4'] [id^='crack-'],
#egg-art[data-step='3'] #egg-stars,
#egg-art[data-step='4'] #egg-stars {
  opacity: 1;
}
#egg-art #egg {
  animation: egg-nudge 4.6s ease-in-out infinite;
}
.egg-room .pet-target:after {
  opacity: 0.36;
}
@keyframes egg-nudge {
  0%,
  67%,
  80%,
  100% {
    transform: rotate(0deg);
  }
  71% {
    transform: rotate(2.8deg);
  }
  76% {
    transform: rotate(-2deg);
  }
}
.fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fireflies i {
  width: 6px;
  height: 6px;
  position: absolute;
  left: 18%;
  top: 55%;
  border-radius: 50%;
  background: #fff7bd;
  box-shadow: 0 0 7px 3px #fff1ac70;
  animation: firefly 7s ease-in-out infinite;
}
.fireflies i:nth-child(2) {
  left: 77%;
  top: 31%;
  animation-delay: -3s;
}
.fireflies i:nth-child(3) {
  left: 69%;
  top: 64%;
  animation-delay: -5s;
}
.bathroom .fireflies {
  display: none;
}
@keyframes firefly {
  0%,
  100% {
    opacity: 0.12;
    transform: translate(0, 0);
  }
  50% {
    opacity: 0.88;
    transform: translate(10px, -14px);
  }
}
.scene .soap {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border: 1px solid #a1c9cb;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, #fff 0 10%, transparent 13%),
    radial-gradient(circle at 62% 70%, #e3daefaa, #c3eaeabb 55%, #fff7);
  box-shadow: inset -2px -2px 3px #b2b2cd55;
  animation: soap-rise 0.85s ease-out forwards;
}
@keyframes soap-rise {
  from {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translate(-40%, -190%) scale(1.12);
  }
}
#look-dialog {
  width: min(620px, calc(100% - 20px));
  max-height: 90dvh;
  padding: 0;
  overflow: auto;
}
#look-form {
  padding: 20px;
}
.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
  margin: 15px 0;
}
.mirror-preview {
  position: sticky;
  top: 6px;
  display: grid;
  place-items: center;
  min-height: 185px;
  border: 3px double #baa0aa;
  border-radius: 48% 48% 43% 43%;
  background: radial-gradient(
    ellipse at 35% 24%,
    #fffbef,
    #e6e2ed 67%,
    #d2e6da
  );
  overflow: hidden;
}
.mirror-preview img {
  width: 100%;
  height: 194px;
  object-fit: contain;
}
.look-fields > label {
  margin-top: 0;
}
.look-fields fieldset {
  margin: 7px 0 0;
  border: 0;
  padding: 0;
}
.look-fields legend {
  font-size: 0.95rem;
  font-weight: 650;
}
.swatch {
  position: relative;
  display: inline-flex;
  vertical-align: top;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 44px;
  margin: 0;
  cursor: pointer;
}
.swatch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.swatch span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #c0aabc;
  border-radius: 50%;
  font-size: 1.45rem;
  background: #fff8ef;
  pointer-events: none;
}
.swatch .sample {
  background: linear-gradient(135deg, #fff8, transparent 60%), var(--sample);
}
.swatch svg {
  width: 27px;
  height: 27px;
}
.swatch input:checked + span {
  outline: 2px solid #6f4b6a;
  outline-offset: 2px;
}
.swatch input:checked + span:after {
  content: '✓';
  position: absolute;
  right: 1px;
  bottom: 2px;
  background: #694763;
  color: white;
  border-radius: 50%;
  font: 700 12px/17px system-ui;
  width: 17px;
  text-align: center;
}
.swatch input:focus-visible + span {
  outline: 3px dashed #744f82;
}
.studio-foot .primary {
  margin-top: 0;
}
.studio-foot p:not(:empty) {
  margin-bottom: 10px;
}
.sound-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 8px 0 0;
  border-radius: 12px;
  background: #f2ece4;
  border: 1px solid #d9c8bd;
  padding: 6px 12px;
  font-weight: 650;
  text-align: left;
}
.sound-row svg {
  width: 30px;
  height: 30px;
}
.sound-row .switch {
  margin-left: auto;
  width: 38px;
  height: 23px;
  border-radius: 15px;
  border: 1px solid #a79ba6;
  background: #d6cdd1;
  position: relative;
}
.sound-row .switch:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: white;
}
.sound-row[aria-checked='true'] .switch {
  background: #775277;
}
.sound-row[aria-checked='true'] .switch:after {
  left: 18px;
}
.sound-row:disabled {
  opacity: 0.58;
  cursor: default;
}
#voice-note {
  margin-top: 12px;
  font-size: 0.92rem;
}
@media (max-width: 790px) {
  .mirror-button {
    margin: 12px 0 0;
  }
  .mirror-button + .star-summary {
    margin-top: 7px;
  }
  .bathroom .pet-target {
    width: 69%;
    left: 15.5%;
    height: 88%;
  }
  .action-tray {
    gap: 6px;
  }
  .action {
    font-size: clamp(0.77rem, 3.5vw, 1rem);
    padding-inline: 1px;
  }
  .nest-hand {
    width: 43px;
    height: 43px;
    padding: 4px;
  }
  .nest-panel {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 5px 10px;
    text-align: left;
    align-items: center;
  }
  .nest-hand {
    grid-row: span 2;
  }
  .nest-panel p {
    margin: 0;
  }
  #egg-progress {
    justify-content: flex-start;
    grid-column: 2;
  }
  .nest-panel .primary {
    grid-column: 1/-1;
    margin-top: 6px;
  }
}
@media (max-width: 530px) {
  .sound-open {
    padding: 5px 8px;
  }
  .sound-open span {
    display: none;
  }
  .sound-open svg {
    width: 27px;
    height: 27px;
  }
  .title-row {
    column-gap: 6px;
  }
  .title-row h1 {
    font-size: clamp(1.65rem, 7.25vw, 2.5rem);
  }
  .heading-stars {
    width: 26px;
  }
  .studio-body {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .mirror-preview {
    min-height: 0;
    width: 133px;
    margin: auto;
    position: static;
  }
  .mirror-preview img {
    height: 95px;
  }
  #look-form {
    padding: 13px 17px;
  }
  .look-fields fieldset {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    margin: 0;
    padding-left: 69px;
    position: relative;
    min-height: 44px;
  }
  .look-fields legend {
    position: absolute;
    left: 0;
    top: 13px;
  }
  .look-fields input[type='text'] {
    padding: 6px 10px;
  }
  .studio-foot {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    padding: 7px 0;
  }
  .studio-body {
    margin: 7px 0;
  }
  .studio-foot .primary {
    min-height: 44px;
  }
  .swatch {
    width: 44px;
  }
  .studio-foot p:empty {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fireflies i,
  #egg-art #egg,
  .scene .soap {
    animation: none;
  }
  .fireflies {
    opacity: 0.3;
  }
}

#egg-art[data-step='4'] [id^='crack-'] {
  opacity: 0;
}
#dust {
  transition: opacity 0.95s ease-in-out;
}

.swatch .sample svg {
  width: 27px;
  height: 27px;
  color: #694961;
}
