.cottage-editor {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}
.cottage-tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 4px;
}
.cottage-tray:empty {
  display: none;
}
.cottage-piece {
  display: grid;
  justify-items: center;
  align-content: start;
  grid-template-rows: 26px auto auto;
  padding: 3px 2px 4px;
  border: 1px solid #bbba95;
  border-radius: 4px;
  background: #fffbe9;
  text-align: center;
  font: 600 13px/1.03 var(--pixel);
  min-width: 0;
}
.cottage-piece:hover,
.cottage-piece[aria-pressed="true"] {
  border-color: #72906a;
  background: #ecf0d1;
}
.cottage-piece[aria-pressed="true"] {
  box-shadow: inset 0 -2px #a0b28a;
}
.cottage-piece canvas {
  width: 40px;
  max-width: 100%;
  height: 26px;
  image-rendering: pixelated;
}
.cottage-piece small {
  color: #59664f;
  margin-top: 3px;
  font: 10px/1.15 var(--sans);
}
.cottage-layout {
  position: relative;
  aspect-ratio: 1000 / 409;
  overflow: hidden;
  border: 2px solid #73543a;
  border-radius: 5px;
  background: #c7874f url("assets/cottage.webp") center / 100% 100% no-repeat;
  isolation: isolate;
}
.cottage-preview {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}
.cottage-slot {
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  width: 32px;
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: 600 12px/1 var(--pixel);
}
.cottage-slot::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border: 2px dashed #4d6847;
  border-radius: 2px;
  background-color: #fbebbc;
  box-shadow: 0 1px #5238217a;
}
.cottage-slot[data-occupied="true"]::before {
  border-style: solid;
  background: #93aa79;
}
.cottage-slot:hover::before,
.cottage-slot[aria-pressed="true"]::before {
  border-style: solid;
  border-color: #344f39;
  box-shadow: 0 0 0 2px #fff4c8;
  background: #ebc774;
}
.cottage-slot span {
  position: absolute;
  top: calc(50% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 3px;
  white-space: nowrap;
  border-radius: 2px;
  background: #fff4cddd;
  box-shadow: 0 1px #553d2555;
  color: #3f5038;
}
.cottage-slot[aria-pressed="true"] span {
  color: #ffface;
  background: #415842;
}
.cottage-slot:focus-visible {
  z-index: 1;
  outline: 2px solid #ffefb3;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 3px #563e2c;
}
.cottage-status {
  margin: 0;
  min-height: 17px;
  color: #52614e;
  font: 13px/1.3 var(--sans);
}
.cottage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cottage-actions .small-action:disabled {
  background: #efedda;
  border-color: #c6c5aa;
  color: #777b67;
}
.cottage-secondary {
  border: 1px solid #b3b498;
  border-radius: 4px;
  padding: 6px 9px;
  font: 600 15px/1 var(--pixel);
  background: #faf4dd;
}
.cottage-secondary:hover {
  background: #ecf0d1;
}
.cottage-done {
  margin-left: auto;
}
@media (max-width: 550px) {
  .cottage-tray {
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 3px;
  }
  .cottage-piece {
    font-size: 12px;
  }
  .cottage-piece small {
    font-size: 9px;
  }
  .cottage-slot {
    font-size: 11px;
  }
}
