.layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-gap: 32px;
  width: fit-content;
  margin: auto;
}

.layout-meta {
  display: flex;
  margin: 64px 32px 32px;
  grid-gap: 32px;
}

@media (max-width: 540px) {
  .layout-meta {
    margin: 64px 16px 32px;
    grid-gap: 16px;
  }
}

.layout-meta-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  grid-gap: 6px;
}

.layout-meta-row-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.65;
}

.layout-meta-row input[type="text"],
.layout-meta-row input[type="number"] {
  width: 100%;
  height: 42px;
  font-size: inherit;
  border-radius: 4px;
  border: 2px solid var(--white);
  background: none;
  color: inherit;
  padding: 8px 12px;
  display: block;
  box-sizing: border-box;
}

.layout-meta-row input[type="range"] {
  width: 100%;
  height: 42px;
  margin: 0;
}

.layout-preview {
  --ball-size: 60px;
  display: flex;
  flex: 1;
  flex-direction: column;
  grid-gap: 32px;
  padding-bottom: 160px;
}

@media (max-width: 540px) {
  .layout-preview {
    --ball-size: 42px;
  }
}

.preview-row {
  display: flex;
  grid-gap: 8px;
  border-radius: 100px;
  outline-offset: 2px;
  outline-width: 0px;
  outline-color: rgba(0, 0, 0, 0);
  transition: all 0.15s ease-out;
}

.preview-row:has(.preview-row-actions-delete:hover) {
  outline-offset: 12px;
  outline: 2px solid var(--red);
}

.preview-cell {
  height: var(--ball-size);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease-in-out;
}

.preview-cell--empty::after {
  content: "";
  width: var(--ball-size);
  height: var(--ball-size);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--ball-size);
  transition: background-color 0.1s ease-in-out;
}

.preview-cell--empty img {
  position: absolute;
  pointer-events: none;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.15s ease-out;
}

.preview-cell--empty:hover::after {
  background: rgba(255, 255, 255, 0.2);
}

.preview-cell--empty:hover img {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.preview-cell-ball {
  width: var(--ball-size);
  height: var(--ball-size);
  border-radius: var(--ball-size);
}

.preview-cell-ball:not(.preview-cell-ball--selected):hover {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

.preview-cell-ball--selected {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.preview-cell-velocity {
  font-size: 12px;
  color: var(--white);
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-gap: 4px;
  font-weight: 600;
  pointer-events: none;
  mix-blend-mode: difference;
}

.preview-cell-velocity-x--left::before {
  content: "←";
}

.preview-cell-velocity-x--right::after {
  content: "→";
}

.preview-cell-velocity-y--up::before {
  content: "↑";
}

.preview-cell-velocity-y--down::before {
  content: "↓";
}

.preview-row-actions {
  display: flex;
  grid-gap: 8px;
}

.preview-row-actions-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ball-size);
  height: var(--ball-size);
  cursor: pointer;
  transition: transform 0.15s ease-out;
}

.preview-row-actions-delete:hover {
  transform: scale(1.1);
}
