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

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

.gm {
  position: relative;
  width: min(92vw, 160vh - 12.8vw);
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gm__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 140px;
  flex: 0 0 auto;
}

.gm__cell {
  aspect-ratio: 1/1;
  border-radius: 8px;
  border: 2px dashed rgba(255, 247, 230, 0.32);
  transition: border-color 220ms ease-out, background-color 220ms ease-out;
}

.gm__cell.is-target {
  border-color: #fff7e6;
  border-style: solid;
  background: rgba(255, 247, 230, 0.12);
}

.gm__tray {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
}

.gm__icon {
  appearance: none;
  border: 0;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #2f6df6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.gm__icon.is-grabbed {
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  outline: 2px solid #5b8cf8;
  outline-offset: 3px;
}

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

.gm.is-dragging .gm__icon {
  cursor: grabbing;
}

.gm__caption {
  flex-basis: 100%;
  margin: 0;
  color: #fff7e6;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 340px) {
  .gm__grid {
    width: 110px;
  }
  .gm__icon {
    width: 44px;
    height: 44px;
  }
  .gm__caption {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gm__icon {
    transition: none;
  }
  .gm__cell {
    transition: none;
  }
}
