.room-head h1 {
  margin: 0.3em 0;
}
.room-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.room-tools button,
.room-head button,
.room-menu select {
  min-height: 44px;
  border: 2px solid #dfc9bc;
  background: #fff;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 700;
}
.room-tools button[aria-pressed="true"],
.room-palette button[aria-pressed="true"] {
  outline: 3px solid #a24355;
}
.room-stage {
  position: relative;
  aspect-ratio: 3/2;
  width: 100%;
  max-width: 850px;
  margin: auto;
  overflow: hidden;
  border: 4px solid #d5b59c;
  border-radius: 22px;
  isolation: isolate;
  background: #fff0d7;
}
.room-bg,
.room-objects {
  position: absolute;
  inset: 0;
}
.room-bg {
  pointer-events: none;
  background-size: 100% 100%;
}
.room-object {
  position: absolute;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  min-height: 0 !important;
  touch-action: none;
  cursor: grab;
  line-height: 0;
}
.room-object img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.room-object.chosen {
  outline: 3px dashed #a24355;
  border-radius: 8px;
}
.room-object:disabled {
  opacity: 1;
  cursor: default;
}
.room-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding: 6px;
}
.room-palette button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 2px solid #e2cfc0;
  border-radius: 14px;
  padding: 6px;
  min-height: 90px;
}
.room-palette img {
  width: 65px;
  height: 65px;
  object-fit: contain;
}
.room-palette small {
  font-size: 11px;
}
.room-menu label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin: 5px;
}
.room-status {
  min-height: 1.5em;
}
.room-preview img {
  width: 100%;
  max-width: 850px;
}
.room-breathe {
  animation: room-breathe 3s ease-in-out infinite;
}
@keyframes room-breathe {
  50% {
    transform: scale(1.025);
  }
}
@media (prefers-reduced-motion: reduce) {
  .room-breathe {
    animation: none;
  }
}
.room-tools[hidden],
.room-menu[hidden] {
  display: none;
}

.room-object > svg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.studio {
  border: 2px solid #e8dacc;
  border-radius: 24px;
  background: #fffcf7;
  padding: clamp(10px, 3vw, 24px);
  max-width: 850px;
  margin: auto;
}
.studio select,
.studio button,
.picnic button {
  min-height: 44px;
}
.studio select {
  border-radius: 12px;
  padding: 9px;
  background: white;
}
.portrait {
  text-align: center;
  display: grid;
  justify-items: center;
  background:
    radial-gradient(ellipse at 50% 85%, #f5d6b7 0 20%, transparent 21%),
    linear-gradient(#e4f3ef 0 72%, #f8e9d2 72%);
  border-radius: 25px;
  padding: 10px;
}
.animal-show {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  width: min(100%, 320px);
  touch-action: manipulation;
}
.animal-show > svg {
  width: 100%;
  height: 200px;
  display: block;
  overflow: visible;
}
.portrait strong {
  background: #fff9ec;
  padding: 4px 18px;
  border-radius: 20px;
}
.studio .room-palette:empty {
  display: none;
}
.cloth {
  min-height: 80px;
  padding: 12px;
  border: 5px solid #c79569;
  border-radius: 18px;
  background: repeating-conic-gradient(#ffe7d8 0 25%, #fff4e8 0 50%) 0 0/28px
    28px;
}
.cloth img {
  width: 60px;
  height: 60px;
}
.play-note {
  min-height: 1.5em;
}
.wiggle,
.blink,
[data-react] {
  transform-box: fill-box;
  transform-origin: center;
}
.wiggle {
  animation: wiggle 0.42s ease-in-out 3 alternate;
}
.blink {
  animation: blink 0.8s ease-in-out;
}
.room-object > svg[data-react="dance"],
.animal-show > svg[data-react="dance"] {
  animation: hop 0.48s ease-in-out 2;
}
.animal-show > svg[data-react="hello"],
.room-object > svg[data-react="hello"] {
  animation: nod 0.52s ease-in-out 2;
}
[data-react="sleep"] {
  animation: doze 3s ease-in-out infinite;
}
@keyframes wiggle {
  50% {
    transform: rotate(11deg) translateY(-1px);
  }
}
@keyframes blink {
  50% {
    transform: scaleY(0.18);
  }
}
@keyframes hop {
  50% {
    transform: translateY(-7%) rotate(-3deg);
  }
}
@keyframes nod {
  50% {
    transform: rotate(5deg);
  }
}
@keyframes doze {
  50% {
    transform: scaleY(0.975);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wiggle,
  .blink,
  [data-react] {
    animation: none !important;
  }
}
html[data-motion="off"] :is(.wiggle, .blink, [data-react], .room-breathe) {
  animation: none !important;
}

.room-object > svg,
.room-object > img {
  max-width: none;
}
.room-tools button:focus-visible,
.studio button:focus-visible,
.room-object:focus-visible {
  outline: 3px solid #3356a2;
  outline-offset: 2px;
}
.play-note {
  width: 100%;
  font-weight: 700;
}
.room-tools .picnic {
  width: 100%;
}
#parent-records input {
  max-width: 100%;
}
@media (min-width: 760px) {
  .studio {
    display: flow-root;
    min-height: 385px;
  }
  .studio .portrait {
    float: left;
    width: 43%;
    margin: 0 20px 12px 0;
  }
  .studio .room-palette {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }
  .studio .cloth {
    overflow: auto;
  }
  .studio .picnic {
    clear: both;
  }
}
.room-object:disabled {
  pointer-events: none;
}
