html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.hb {
  position: relative;
  width: min(92vw, 160vh - 12.8vw);
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hb__board {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 200px;
  border-radius: 16px;
  border: 1px dashed rgba(23, 20, 26, 0.22);
  background: rgba(23, 20, 26, 0.04);
  overflow: hidden;
}

.hb__cell {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 8px;
  border: 2px dashed rgba(47, 109, 246, 0.5);
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}

.hb__cell.is-target {
  background: rgba(47, 109, 246, 0.18);
  border-color: #2f6df6;
  border-style: solid;
}

.hb__icon {
  appearance: none;
  border: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 999px;
  background: #c93000;
  box-shadow: 0 6px 14px rgba(23, 20, 26, 0.18);
  touch-action: none;
  cursor: grab;
  transform-origin: center;
  will-change: transform;
}

.hb.is-dragging .hb__icon {
  cursor: grabbing;
}

.hb__icon.is-grabbed {
  box-shadow: 0 0 0 3px #5b8cf8, 0 6px 14px rgba(23, 20, 26, 0.18);
}

.hb__icon:focus-visible {
  outline: 2px solid #5b8cf8;
  outline-offset: 3px;
}

.hb__caption {
  margin: 0;
  color: #17141a;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  min-height: 2.8em;
}

@media (max-width: 340px) {
  .hb {
    gap: 8px;
  }
  .hb__board {
    max-width: 200px;
    height: 110px;
  }
  .hb__cell {
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
  }
  .hb__icon {
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
  }
  .hb__caption {
    font-size: 10px;
    min-height: 1.8em;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hb__cell {
    transition: none;
  }
}
